@antv/g2plot
Version:
G2 Plot, a market of plots built with the Grammar of Graphics'
51 lines • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/**
* Create By Bruce Too
* On 2020-01-09
*/
var _ = tslib_1.__importStar(require("@antv/util"));
var html_1 = tslib_1.__importDefault(require("@antv/component/lib/tooltip/html"));
var WordCloudTooltips = /** @class */ (function (_super) {
tslib_1.__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;
}(html_1.default));
exports.default = WordCloudTooltips;
//# sourceMappingURL=word-cloud-tooltips.js.map