UNPKG

@antv/g2plot

Version:

G2 Plot, a market of plots built with the Grammar of Graphics'

49 lines 1.78 kB
import { __extends } from "tslib"; /** * Create By Bruce Too * On 2020-01-09 */ import * as _ from '@antv/util'; import HtmlTooltip from '@antv/component/lib/tooltip/html'; var WordCloudTooltips = /** @class */ (function (_super) { __extends(WordCloudTooltips, _super); function WordCloudTooltips(cfg) { var _this = this; var newCfg = _.deepMix({}, cfg, { itemTpl: "<div data-index={index}>\n <span style=\"background-color:{color};\" class=\"g2-tooltip-marker\"></span>\n {name}<span class=\"g2-tooltip-value\">{value}</span></div>", }); _this = _super.call(this, newCfg) || this; return _this; } WordCloudTooltips.prototype.show = function () { var container = this.get('container'); container.style.visibility = 'visible'; container.style.display = 'block'; var crosshairGroup = this.get('crosshairGroup'); if (crosshairGroup) { crosshairGroup.show(); } var markerGroup = this.get('markerGroup'); if (markerGroup) { markerGroup.show(); } this.set('visible', true); }; WordCloudTooltips.prototype.hide = function () { var container = this.get('container'); container.style.visibility = 'hidden'; container.style.display = 'none'; var crosshairGroup = this.get('crosshairGroup'); if (crosshairGroup) { crosshairGroup.hide(); } var markerGroup = this.get('markerGroup'); if (markerGroup) { markerGroup.hide(); } this.set('visible', false); }; return WordCloudTooltips; }(HtmlTooltip)); export default WordCloudTooltips; //# sourceMappingURL=word-cloud-tooltips.js.map