tvcharts 0.8.92 → 0.8.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -76,6 +76,9 @@ var LabelsView = /** @class */function (_super) {
|
|
|
76
76
|
_this.type = LabelsView.type;
|
|
77
77
|
return _this;
|
|
78
78
|
}
|
|
79
|
+
LabelsView.prototype.init = function (ecModel, api) {
|
|
80
|
+
api.getZr().on('mousedown', this._hideTip, this);
|
|
81
|
+
};
|
|
79
82
|
LabelsView.prototype.render = function (seriesModel, ecModel, api) {
|
|
80
83
|
var data = seriesModel.getData();
|
|
81
84
|
// const symbolDraw = this._updateSymbolDraw(data, seriesModel);
|
|
@@ -268,6 +271,19 @@ var LabelsView = /** @class */function (_super) {
|
|
|
268
271
|
_this._isTooltipOpen = true;
|
|
269
272
|
}, 300);
|
|
270
273
|
};
|
|
274
|
+
LabelsView.prototype._hideTip = function (e) {
|
|
275
|
+
if (e.target && typeof inner(e.target).index === 'number') {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
// this._clearTimer();
|
|
279
|
+
if (this._isTooltipOpen) {
|
|
280
|
+
this.api.dispatchAction({
|
|
281
|
+
type: 'hideTipText',
|
|
282
|
+
escapeConnect: true
|
|
283
|
+
});
|
|
284
|
+
this._isTooltipOpen = false;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
271
287
|
LabelsView.prototype._mouseout = function () {
|
|
272
288
|
this._clearTimer();
|
|
273
289
|
if (this._isTooltipOpen) {
|
|
@@ -293,6 +309,7 @@ var LabelsView = /** @class */function (_super) {
|
|
|
293
309
|
this._textGroup = null;
|
|
294
310
|
this._toolTipGroup && this._toolTipGroup.removeAll();
|
|
295
311
|
this._toolTipGroup = null;
|
|
312
|
+
this.api.getZr().off('mousedown', this._hideTip);
|
|
296
313
|
this.seriesModel = null;
|
|
297
314
|
this.api = null;
|
|
298
315
|
};
|
|
@@ -82,7 +82,7 @@ var TooltipTextHtmlContent = /** @class */function () {
|
|
|
82
82
|
style.transform = "translateX(-50%)";
|
|
83
83
|
triangleStyle = "transform: translateX(-50%) translateY(-50%) rotate(45deg); position: absolute; top: 0px;";
|
|
84
84
|
}
|
|
85
|
-
el.innerHTML = "<div>\n <div style=\"min-width: 32px; padding: 2px 8px; color: #fff; background-color: rgb(42, 46, 57); font-size: 12px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.08) 0px 6px 16px 0px, rgba(0, 0, 0, 0.12) 0px 3px 6px -4px, rgba(0, 0, 0, 0.05) 0px 9px 28px 8px; white-space: pre;\">" + text + "</div>\n <div style=\"width: 6px; height: 6px; " + triangleStyle + " left: 50%; background-color: rgb(42, 46, 57);\"></div>\n </div>";
|
|
85
|
+
el.innerHTML = "<div style=\"max-width:300px\">\n <div style=\"min-width: 32px; padding: 2px 8px; color: #fff; background-color: rgb(42, 46, 57); font-size: 12px; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.08) 0px 6px 16px 0px, rgba(0, 0, 0, 0.12) 0px 3px 6px -4px, rgba(0, 0, 0, 0.05) 0px 9px 28px 8px; white-space: pre-wrap;\">" + text + "</div>\n <div style=\"width: 6px; height: 6px; " + triangleStyle + " left: 50%; background-color: rgb(42, 46, 57);\"></div>\n </div>";
|
|
86
86
|
};
|
|
87
87
|
TooltipTextHtmlContent.prototype.getSize = function () {
|
|
88
88
|
var el = this.el;
|
package/package.json
CHANGED
|
@@ -19,12 +19,14 @@ declare class LabelsView extends ChartView {
|
|
|
19
19
|
api: ExtensionAPI;
|
|
20
20
|
_isTooltipOpen: boolean;
|
|
21
21
|
_timer: NodeJS.Timeout;
|
|
22
|
+
init(ecModel: GlobalModel, api: ExtensionAPI): void;
|
|
22
23
|
render(seriesModel: ScatterSeriesModel, ecModel: GlobalModel, api: ExtensionAPI): void;
|
|
23
24
|
_renderText(data: SeriesData, seriesModel: ScatterSeriesModel): void;
|
|
24
25
|
_renderSymbol(data: SeriesData, seriesModel: ScatterSeriesModel): void;
|
|
25
26
|
_renderTooltipSymbol(data: SeriesData, seriesModel: ScatterSeriesModel): void;
|
|
26
27
|
_getClipShape(seriesModel: ScatterSeriesModel): import("../../coord/CoordinateSystem").CoordinateSystemClipArea;
|
|
27
28
|
_mouseover(e: any): void;
|
|
29
|
+
_hideTip(e: any): void;
|
|
28
30
|
_mouseout(): void;
|
|
29
31
|
_clearTimer(): void;
|
|
30
32
|
remove(): void;
|