tvcharts 0.8.92 → 0.8.94

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) {
@@ -285,6 +301,7 @@ var LabelsView = /** @class */function (_super) {
285
301
  }
286
302
  };
287
303
  LabelsView.prototype.remove = function () {
304
+ var _a;
288
305
  // this._symbolDraw && this._symbolDraw.remove(true);
289
306
  // this._symbolDraw = null;
290
307
  this._symbolGroup && this._symbolGroup.removeAll();
@@ -293,6 +310,9 @@ var LabelsView = /** @class */function (_super) {
293
310
  this._textGroup = null;
294
311
  this._toolTipGroup && this._toolTipGroup.removeAll();
295
312
  this._toolTipGroup = null;
313
+ if (this.api) {
314
+ (_a = this.api.getZr()) === null || _a === void 0 ? void 0 : _a.off('mousedown', this._hideTip);
315
+ }
296
316
  this.seriesModel = null;
297
317
  this.api = null;
298
318
  };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tvcharts",
3
- "version": "0.8.92",
3
+ "version": "0.8.94",
4
4
  "main": "dist/echarts.js",
5
5
  "module": "index.js",
6
6
  "jsdelivr": "dist/echarts.min.js",
@@ -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;