@visactor/vchart 2.0.16 → 2.0.18

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.
Files changed (80) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +138 -39
  3. package/build/index.js +138 -38
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/callback-disappear.js +2 -1
  7. package/cjs/animation/index.js +1 -2
  8. package/cjs/compile/util.js +2 -1
  9. package/cjs/component/axis/base-axis.js +3 -3
  10. package/cjs/component/axis/base-axis.js.map +1 -1
  11. package/cjs/component/base/base-component.js +1 -1
  12. package/cjs/component/base/base-component.js.map +1 -1
  13. package/cjs/component/data-zoom/data-filter-base-component.d.ts +9 -0
  14. package/cjs/component/data-zoom/data-filter-base-component.js +41 -5
  15. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  16. package/cjs/component/player/player.d.ts +2 -0
  17. package/cjs/component/player/player.js +10 -5
  18. package/cjs/component/player/player.js.map +1 -1
  19. package/cjs/constant/gradient.js +2 -1
  20. package/cjs/constant/polar.js +1 -2
  21. package/cjs/constant/sunburst.js +1 -1
  22. package/cjs/constant/waterfall.js +1 -1
  23. package/cjs/constant/word-cloud.js +1 -1
  24. package/cjs/core/index.d.ts +1 -1
  25. package/cjs/core/index.js +2 -2
  26. package/cjs/core/index.js.map +1 -1
  27. package/cjs/core/instance-manager.js +1 -1
  28. package/cjs/core/interface.js +1 -1
  29. package/cjs/core/util.js +1 -1
  30. package/cjs/core/vchart.js +1 -1
  31. package/cjs/core/vchart.js.map +1 -1
  32. package/cjs/data/initialize.js +1 -1
  33. package/cjs/data/register.js +1 -2
  34. package/cjs/mark/base/base-mark.js +2 -1
  35. package/cjs/mark/base/base-mark.js.map +1 -1
  36. package/cjs/series/heatmap/heatmap.js +2 -1
  37. package/cjs/series/heatmap/heatmap.js.map +1 -1
  38. package/cjs/theme/builtin/common/series/heatmap.js +5 -0
  39. package/cjs/theme/builtin/common/series/heatmap.js.map +1 -1
  40. package/cjs/util/spec/transform.d.ts +1 -0
  41. package/cjs/util/spec/transform.js +7 -2
  42. package/cjs/util/spec/transform.js.map +1 -1
  43. package/esm/animation/callback-disappear.js +2 -1
  44. package/esm/animation/index.js +1 -2
  45. package/esm/compile/util.js +2 -1
  46. package/esm/component/axis/base-axis.js +4 -2
  47. package/esm/component/axis/base-axis.js.map +1 -1
  48. package/esm/component/base/base-component.js +1 -1
  49. package/esm/component/base/base-component.js.map +1 -1
  50. package/esm/component/data-zoom/data-filter-base-component.d.ts +9 -0
  51. package/esm/component/data-zoom/data-filter-base-component.js +41 -6
  52. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  53. package/esm/component/player/player.d.ts +2 -0
  54. package/esm/component/player/player.js +9 -5
  55. package/esm/component/player/player.js.map +1 -1
  56. package/esm/constant/gradient.js +2 -1
  57. package/esm/constant/polar.js +1 -2
  58. package/esm/constant/sunburst.js +1 -1
  59. package/esm/constant/waterfall.js +1 -1
  60. package/esm/constant/word-cloud.js +1 -1
  61. package/esm/core/index.d.ts +1 -1
  62. package/esm/core/index.js +2 -2
  63. package/esm/core/index.js.map +1 -1
  64. package/esm/core/instance-manager.js +1 -1
  65. package/esm/core/interface.js +1 -1
  66. package/esm/core/util.js +1 -1
  67. package/esm/core/vchart.js +1 -1
  68. package/esm/core/vchart.js.map +1 -1
  69. package/esm/data/initialize.js +1 -1
  70. package/esm/data/register.js +1 -2
  71. package/esm/mark/base/base-mark.js +2 -1
  72. package/esm/mark/base/base-mark.js.map +1 -1
  73. package/esm/series/heatmap/heatmap.js +2 -1
  74. package/esm/series/heatmap/heatmap.js.map +1 -1
  75. package/esm/theme/builtin/common/series/heatmap.js +5 -0
  76. package/esm/theme/builtin/common/series/heatmap.js.map +1 -1
  77. package/esm/util/spec/transform.d.ts +1 -0
  78. package/esm/util/spec/transform.js +5 -1
  79. package/esm/util/spec/transform.js.map +1 -1
  80. package/package.json +6 -6
package/build/index.js CHANGED
@@ -9671,28 +9671,59 @@
9671
9671
  }
9672
9672
  addEventListener(type, listener, options) {
9673
9673
  if (!listener) return;
9674
+ const capture = this._resolveCapture(options),
9675
+ once = this._resolveOnce(options),
9676
+ listenerTypeMap = this._getOrCreateListenerTypeMap(type),
9677
+ wrappedMap = this._getOrCreateWrappedMap(listenerTypeMap, listener);
9678
+ if (wrappedMap.has(capture)) return;
9674
9679
  const wrappedListener = event => {
9675
9680
  const transformedEvent = this._eventListenerTransformer(event);
9676
- "function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent);
9681
+ "function" == typeof listener ? listener(transformedEvent) : listener.handleEvent && listener.handleEvent(transformedEvent), once && this._deleteListenerRecord(type, listener, capture);
9677
9682
  };
9678
- this._listenerMap.has(type) || this._listenerMap.set(type, new Map()), this._listenerMap.get(type).set(listener, wrappedListener), this._nativeAddEventListener(type, wrappedListener, options);
9683
+ wrappedMap.set(capture, {
9684
+ wrappedListener: wrappedListener,
9685
+ options: options
9686
+ }), this._nativeAddEventListener(type, wrappedListener, options);
9679
9687
  }
9680
9688
  removeEventListener(type, listener, options) {
9681
- var _a;
9689
+ var _a, _b;
9682
9690
  if (!listener) return;
9683
- const wrappedListener = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener);
9684
- wrappedListener && (this._nativeRemoveEventListener(type, wrappedListener, options), this._listenerMap.get(type).delete(listener), 0 === this._listenerMap.get(type).size && this._listenerMap.delete(type));
9691
+ const capture = this._resolveCapture(options),
9692
+ wrappedRecord = null === (_b = null === (_a = this._listenerMap.get(type)) || void 0 === _a ? void 0 : _a.get(listener)) || void 0 === _b ? void 0 : _b.get(capture);
9693
+ wrappedRecord && (this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture), this._deleteListenerRecord(type, listener, capture));
9685
9694
  }
9686
9695
  dispatchEvent(event) {
9687
9696
  return this._nativeDispatchEvent(event);
9688
9697
  }
9689
9698
  clearAllEventListeners() {
9690
- this._listenerMap.forEach((listenersMap, type) => {
9691
- listenersMap.forEach((wrappedListener, originalListener) => {
9692
- this._nativeRemoveEventListener(type, wrappedListener, void 0);
9699
+ this._listenerMap.forEach((listenerMap, type) => {
9700
+ listenerMap.forEach(wrappedMap => {
9701
+ wrappedMap.forEach((wrappedRecord, capture) => {
9702
+ this._nativeRemoveEventListener(type, wrappedRecord.wrappedListener, capture);
9703
+ });
9693
9704
  });
9694
9705
  }), this._listenerMap.clear();
9695
9706
  }
9707
+ _resolveCapture(options) {
9708
+ return "boolean" == typeof options ? options : !!(null == options ? void 0 : options.capture);
9709
+ }
9710
+ _resolveOnce(options) {
9711
+ return "object" == typeof options && !!(null == options ? void 0 : options.once);
9712
+ }
9713
+ _getOrCreateListenerTypeMap(type) {
9714
+ let listenerTypeMap = this._listenerMap.get(type);
9715
+ return listenerTypeMap || (listenerTypeMap = new Map(), this._listenerMap.set(type, listenerTypeMap)), listenerTypeMap;
9716
+ }
9717
+ _getOrCreateWrappedMap(listenerTypeMap, listener) {
9718
+ let wrappedMap = listenerTypeMap.get(listener);
9719
+ return wrappedMap || (wrappedMap = new Map(), listenerTypeMap.set(listener, wrappedMap)), wrappedMap;
9720
+ }
9721
+ _deleteListenerRecord(type, listener, capture) {
9722
+ const listenerTypeMap = this._listenerMap.get(type);
9723
+ if (!listenerTypeMap) return;
9724
+ const wrappedMap = listenerTypeMap.get(listener);
9725
+ wrappedMap && (wrappedMap.delete(capture), 0 === wrappedMap.size && listenerTypeMap.delete(listener), 0 === listenerTypeMap.size && this._listenerMap.delete(type));
9726
+ }
9696
9727
  _nativeAddEventListener(type, listener, options) {
9697
9728
  throw new Error("_nativeAddEventListener must be implemented by derived classes");
9698
9729
  }
@@ -14037,7 +14068,9 @@
14037
14068
  var _a;
14038
14069
  if (event.manager !== this) throw new Error("It is illegal to free an event not managed by this EventManager!");
14039
14070
  const constructor = event.constructor;
14040
- this.eventPool.has(constructor) || this.eventPool.set(constructor, []), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
14071
+ this.eventPool.has(constructor) || (this.eventPool.get(constructor).forEach(e => {
14072
+ e.eventPhase = event.NONE, e.currentTarget = null, e.path = [], e.detailPath = [], e.target = null;
14073
+ }), this.eventPool.set(constructor, [])), null === (_a = this.eventPool.get(constructor)) || void 0 === _a || _a.push(event);
14041
14074
  }
14042
14075
  notifyListeners(e, type) {
14043
14076
  const listeners = e.currentTarget._events[type];
@@ -16679,7 +16712,7 @@
16679
16712
  });
16680
16713
  }
16681
16714
  release() {
16682
- this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this);
16715
+ this.releaseStatus = "released", this.stopAnimates(), application.graphicService.onRelease(this), super.release();
16683
16716
  }
16684
16717
  _emitCustomEvent(type, context) {
16685
16718
  var _a, _b;
@@ -24342,12 +24375,12 @@
24342
24375
  throw new Error("暂不支持");
24343
24376
  }
24344
24377
  release() {
24345
- var _a, _b;
24378
+ var _a, _b, _d;
24346
24379
  super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
24347
24380
  layer.release();
24348
24381
  }), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
24349
24382
  item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
24350
- }), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.renderService.renderTreeRoots = [];
24383
+ }), this.interactiveLayer.release()), this.window.release(), null === (_a = this._ticker) || void 0 === _a || _a.remTimeline(null == this ? void 0 : this.timeline), null === (_b = this._ticker) || void 0 === _b || _b.removeListener("tick", this.afterTickCb), this.params.ticker || null === (_d = this._ticker) || void 0 === _d || _d.release(), this.renderService.renderTreeRoots = [];
24351
24384
  }
24352
24385
  setStage(stage) {}
24353
24386
  dirty(b, matrix) {
@@ -31672,7 +31705,7 @@
31672
31705
  this._sliderRenderBounds = null, this._sliderLimitRange = null;
31673
31706
  }
31674
31707
  release(all) {
31675
- super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
31708
+ super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
31676
31709
  passive: !1
31677
31710
  }), this._clearDragEvents();
31678
31711
  }
@@ -33877,17 +33910,21 @@
33877
33910
  } = this.attribute.label;
33878
33911
  textStyle = isFunction$1(textStyle) ? merge$1({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
33879
33912
  const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
33880
- return textStyle = merge$1(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
33913
+ textStyle = merge$1(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
33881
33914
  label: tickDatum.label,
33882
33915
  value: tickDatum.rawValue,
33883
33916
  index: tickDatum.index,
33884
33917
  layer: layer
33885
- })), Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
33918
+ }));
33919
+ let reactStyle = textStyle.react;
33920
+ return isFunction$1(reactStyle) && (reactStyle = reactStyle(tickDatum, index, tickData, layer)), Object.assign(Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
33886
33921
  text: null != text ? text : textContent,
33887
33922
  _originText: tickDatum.label,
33888
33923
  lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
33889
33924
  type: type
33890
- }), textStyle);
33925
+ }), textStyle), {
33926
+ react: reactStyle
33927
+ });
33891
33928
  }
33892
33929
  getLabelPosition(point, vector, text, style) {
33893
33930
  return point;
@@ -34916,6 +34953,8 @@
34916
34953
  this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(timeline => {
34917
34954
  timeline.tick(delta);
34918
34955
  }), this.emit("tick", delta));
34956
+ }, this._handleGraphTick = () => {
34957
+ this.initHandler(!1);
34919
34958
  }, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.stage = stage, this.autoStop = !0, this.interval = 16, this.computeTimeOffsetAndJitter();
34920
34959
  }
34921
34960
  bindStage(stage) {
@@ -34925,9 +34964,7 @@
34925
34964
  this.timeOffset = Math.floor(Math.random() * this.interval), this._jitter = Math.min(Math.max(.2 * this.interval, 6), .7 * this.interval);
34926
34965
  }
34927
34966
  init() {
34928
- this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
34929
- this.initHandler(!1);
34930
- }), application.global.env && this.initHandler(!1);
34967
+ this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", this._handleGraphTick), application.global.env && this.initHandler(!1);
34931
34968
  }
34932
34969
  addTimeline(timeline) {
34933
34970
  this.timelines.push(timeline);
@@ -35000,7 +35037,7 @@
35000
35037
  }
35001
35038
  release() {
35002
35039
  var _a;
35003
- this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
35040
+ this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1, application.global.hooks.onSetEnv.unTap("graph-ticker", this._handleGraphTick);
35004
35041
  }
35005
35042
  checkSkip(delta) {
35006
35043
  var _a, _b, _c;
@@ -46121,7 +46158,7 @@
46121
46158
  });
46122
46159
  }
46123
46160
  clearVGlobalEvents() {
46124
- ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
46161
+ ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
46125
46162
  passive: !1
46126
46163
  });
46127
46164
  }
@@ -49825,7 +49862,7 @@
49825
49862
  };
49826
49863
  }
49827
49864
  release(all) {
49828
- super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
49865
+ super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).removeEventListener("touchmove", this._handleTouchMove, {
49829
49866
  passive: !1
49830
49867
  }), this._clearAllDragEvents();
49831
49868
  }
@@ -50872,6 +50909,9 @@
50872
50909
  value: this._data[dataIndex]
50873
50910
  });
50874
50911
  }
50912
+ release(all) {
50913
+ this._sliderVisible || this._slider.release(all), super.release(all);
50914
+ }
50875
50915
  }
50876
50916
  BasePlayer.defaultAttributes = {
50877
50917
  visible: !0,
@@ -53341,6 +53381,12 @@
53341
53381
  }
53342
53382
  return spec;
53343
53383
  }
53384
+ function transformFunctionAttribute(att, ...args) {
53385
+ if (isFunction$1(att)) {
53386
+ return att(...args);
53387
+ }
53388
+ return att;
53389
+ }
53344
53390
 
53345
53391
  const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
53346
53392
  return initTextMeasure$1(textSpec, option, useNaiveCanvas, {
@@ -58997,7 +59043,7 @@
58997
59043
  _runApplyGraphic(graphics) {
58998
59044
  const hasAnimation = this.hasAnimation();
58999
59045
  graphics.forEach((g, index) => {
59000
- var _a, _b;
59046
+ var _a, _b, _c;
59001
59047
  const finalAttrs = g.context.finalAttrs;
59002
59048
  const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
59003
59049
  if (!g.setAttributes) {
@@ -59036,6 +59082,9 @@
59036
59082
  else if (!hasStateAnimation) {
59037
59083
  hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs);
59038
59084
  }
59085
+ if (!((_c = this.renderContext) === null || _c === void 0 ? void 0 : _c.progressive) && this._product && g.parent !== this._product) {
59086
+ this._product.appendChild(g);
59087
+ }
59039
59088
  if (hasAnimation) {
59040
59089
  g.setFinalAttributes(finalAttrs);
59041
59090
  }
@@ -60568,7 +60617,7 @@
60568
60617
  this._compiler.updateLayoutTag();
60569
60618
  this._setFontFamilyTheme(this.getTheme('fontFamily'));
60570
60619
  this._initDataSet(this._option.dataSet);
60571
- this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
60620
+ this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
60572
60621
  this._bindResizeEvent();
60573
60622
  this._bindViewEvent();
60574
60623
  this._initChartPlugin();
@@ -61221,7 +61270,7 @@
61221
61270
  resize = true;
61222
61271
  }
61223
61272
  const lasAutoSize = this._autoSize;
61224
- this._autoSize = isTrueBrowser(this._option.mode) ? ((_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true) : false;
61273
+ this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
61225
61274
  if (this._autoSize !== lasAutoSize) {
61226
61275
  resize = true;
61227
61276
  }
@@ -61806,7 +61855,7 @@
61806
61855
  });
61807
61856
  };
61808
61857
 
61809
- const version = "2.0.16";
61858
+ const version = "2.0.18";
61810
61859
 
61811
61860
  const addVChartProperty = (data, op) => {
61812
61861
  const context = op.beforeCall();
@@ -65921,6 +65970,7 @@
65921
65970
  components.forEach(c => {
65922
65971
  var _a;
65923
65972
  if (c) {
65973
+ c.release(true);
65924
65974
  (_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
65925
65975
  c = null;
65926
65976
  }
@@ -66486,7 +66536,7 @@
66486
66536
  _getGridAttributes() {
66487
66537
  const spec = this._spec;
66488
66538
  return {
66489
- alternateColor: spec.grid.alternateColor,
66539
+ alternateColor: transformFunctionAttribute(spec.grid.alternateColor),
66490
66540
  alignWithLabel: spec.grid.alignWithLabel,
66491
66541
  style: isFunction$1(spec.grid.style)
66492
66542
  ? (datum, index) => {
@@ -66500,7 +66550,7 @@
66500
66550
  : {
66501
66551
  type: 'line',
66502
66552
  visible: spec.subGrid.visible,
66503
- alternateColor: spec.subGrid.alternateColor,
66553
+ alternateColor: transformFunctionAttribute(spec.subGrid.alternateColor),
66504
66554
  style: transformToGraphic(spec.subGrid.style)
66505
66555
  }
66506
66556
  };
@@ -91256,6 +91306,11 @@
91256
91306
  },
91257
91307
  cellBackground: {
91258
91308
  visible: false
91309
+ },
91310
+ label: {
91311
+ style: {
91312
+ lineWidth: 2
91313
+ }
91259
91314
  }
91260
91315
  };
91261
91316
 
@@ -91290,11 +91345,12 @@
91290
91345
  this.initCellBackgroundMarkStyle();
91291
91346
  }
91292
91347
  initLabelMarkStyle(textMark) {
91348
+ var _a, _b, _c;
91293
91349
  if (!textMark) {
91294
91350
  return;
91295
91351
  }
91296
91352
  this.setMarkStyle(textMark, {
91297
- fill: this.getColorAttribute(),
91353
+ fill: (_c = (_b = (_a = this._spec.cell) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fill) !== null && _c !== void 0 ? _c : this.getColorAttribute(),
91298
91354
  text: (datum) => {
91299
91355
  return datum[this.getMeasureField()[0]];
91300
91356
  }
@@ -98364,6 +98420,7 @@
98364
98420
  this._hasInitStateScale = false;
98365
98421
  this._shouldChange = true;
98366
98422
  this._stateField = 'x';
98423
+ this._currentDataCollection = [];
98367
98424
  this._handleStateChange = (startValue, endValue, tag) => {
98368
98425
  var _a, _b;
98369
98426
  this._startValue = startValue;
@@ -98420,6 +98477,7 @@
98420
98477
  }, () => this._regions, (() => this._option).bind(this), () => this.event);
98421
98478
  }
98422
98479
  created() {
98480
+ this._handleDataCollectionChangeBound = this._handleDataCollectionChange.bind(this);
98423
98481
  super.created();
98424
98482
  this._setAxisFromSpec();
98425
98483
  this._setRegionsFromSpec();
@@ -98574,7 +98632,7 @@
98574
98632
  }
98575
98633
  return;
98576
98634
  }
98577
- _initData() {
98635
+ _collectDataInfo() {
98578
98636
  const dataCollection = [];
98579
98637
  const seriesCollection = [];
98580
98638
  const stateFields = [];
@@ -98650,6 +98708,10 @@
98650
98708
  specIndex: this._seriesIndex
98651
98709
  });
98652
98710
  }
98711
+ return { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState };
98712
+ }
98713
+ _initData() {
98714
+ const { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState } = this._collectDataInfo();
98653
98715
  const { dataSet } = this._option;
98654
98716
  registerDataSetInstanceParser(dataSet, 'dataview', dataViewParser);
98655
98717
  registerDataSetInstanceTransform(dataSet, 'dataFilterComputeDomain', dataFilterComputeDomain);
@@ -98672,7 +98734,8 @@
98672
98734
  }, false);
98673
98735
  this._data = new CompilableData(this._option, data);
98674
98736
  data.reRunAllTransform();
98675
- dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChange.bind(this));
98737
+ this._currentDataCollection = dataCollection;
98738
+ dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChangeBound);
98676
98739
  }
98677
98740
  _addTransformToSeries() {
98678
98741
  if (!this._relatedAxisComponent || this._filterMode !== 'axis') {
@@ -98714,8 +98777,39 @@
98714
98777
  }
98715
98778
  onDataUpdate() {
98716
98779
  var _a;
98780
+ const { dataCollection, seriesCollection, stateFields, valueFields, isCategoryState } = this._collectDataInfo();
98781
+ if (this._currentDataCollection.length !== dataCollection.length ||
98782
+ this._currentDataCollection.some((dv, i) => dv !== dataCollection[i])) {
98783
+ this._currentDataCollection.forEach(dv => {
98784
+ var _a;
98785
+ (_a = dv === null || dv === void 0 ? void 0 : dv.target) === null || _a === void 0 ? void 0 : _a.removeListener('change', this._handleDataCollectionChangeBound);
98786
+ });
98787
+ this._currentDataCollection = dataCollection;
98788
+ const { dataSet } = this._option;
98789
+ dataSet.multipleDataViewAddListener(this._currentDataCollection, 'change', this._handleDataCollectionChangeBound);
98790
+ }
98791
+ this._data.getDataView().transform({
98792
+ type: 'dataFilterComputeDomain',
98793
+ options: {
98794
+ input: {
98795
+ dataCollection: dataCollection,
98796
+ seriesCollection,
98797
+ stateFields,
98798
+ valueFields,
98799
+ isCategoryState
98800
+ },
98801
+ output: {
98802
+ stateField: this._stateField,
98803
+ valueField: this._valueField
98804
+ }
98805
+ }
98806
+ }, false);
98807
+ this._data.getDataView().reRunAllTransform();
98717
98808
  const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
98718
98809
  this._stateScale.domain(domain, false);
98810
+ if (isValid$1(this._spec.start) || isValid$1(this._spec.end)) {
98811
+ this._setStateFromSpec();
98812
+ }
98719
98813
  this._handleChange(this._start, this._end, true);
98720
98814
  if (this._spec.auto && !isEqual(this._domainCache, domain)) {
98721
98815
  this._domainCache = domain;
@@ -102076,17 +102170,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102076
102170
  }
102077
102171
  return 0;
102078
102172
  };
102173
+ this.autoPlayCallback = () => {
102174
+ var _a;
102175
+ if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.auto) {
102176
+ this._playerComponent.pause();
102177
+ this._playerComponent.play();
102178
+ }
102179
+ };
102079
102180
  this._initEvent = () => {
102080
102181
  if (this._option.disableTriggerEvent) {
102081
102182
  return;
102082
102183
  }
102083
- this._option.globalInstance.on(exports.ChartEvent.rendered, () => {
102084
- var _a;
102085
- if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.auto) {
102086
- this._playerComponent.pause();
102087
- this._playerComponent.play();
102088
- }
102089
- });
102184
+ this._option.globalInstance.off(exports.ChartEvent.rendered, this.autoPlayCallback);
102185
+ this._option.globalInstance.on(exports.ChartEvent.rendered, this.autoPlayCallback);
102090
102186
  this._playerComponent.addEventListener(PlayerEventEnum.end, () => {
102091
102187
  var _a;
102092
102188
  this.event.emit(exports.ChartEvent.playerEnd, { model: this });
@@ -102271,6 +102367,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102271
102367
  }
102272
102368
  });
102273
102369
  }
102370
+ release() {
102371
+ this._option.globalInstance.off(exports.ChartEvent.rendered, this.autoPlayCallback);
102372
+ }
102274
102373
  }
102275
102374
  Player.builtInTheme = {
102276
102375
  player
@@ -108048,6 +108147,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
108048
108147
  exports.transformBounds = transformBounds;
108049
108148
  exports.transformBoundsWithMatrix = transformBoundsWithMatrix;
108050
108149
  exports.transformColorSchemeToStandardStruct = transformColorSchemeToStandardStruct;
108150
+ exports.transformFunctionAttribute = transformFunctionAttribute;
108051
108151
  exports.transformToGraphic = transformToGraphic;
108052
108152
  exports.treeTransform = transform$5;
108053
108153
  exports.treemapTransform = transform$4;