@visactor/vchart 2.0.8 → 2.0.10-alpha.0

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 (152) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +944 -587
  3. package/build/index.js +944 -587
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/config.d.ts +1 -0
  7. package/cjs/animation/config.js +13 -1
  8. package/cjs/animation/config.js.map +1 -1
  9. package/cjs/compile/compiler.d.ts +5 -0
  10. package/cjs/compile/compiler.js +42 -4
  11. package/cjs/compile/compiler.js.map +1 -1
  12. package/cjs/compile/interface/compilable-item.d.ts +2 -0
  13. package/cjs/compile/interface/compilable-item.js.map +1 -1
  14. package/cjs/component/axis/base-axis.d.ts +1 -1
  15. package/cjs/component/axis/base-axis.js +3 -3
  16. package/cjs/component/axis/base-axis.js.map +1 -1
  17. package/cjs/component/axis/cartesian/axis.d.ts +1 -1
  18. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  19. package/cjs/component/axis/cartesian/band-axis.d.ts +1 -1
  20. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  21. package/cjs/component/axis/interface/common.d.ts +1 -0
  22. package/cjs/component/axis/interface/common.js.map +1 -1
  23. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  24. package/cjs/component/axis/mixin/band-axis-mixin.js +10 -4
  25. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  26. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
  27. package/cjs/component/axis/mixin/linear-axis-mixin.js +15 -1
  28. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  29. package/cjs/component/axis/polar/axis.d.ts +1 -1
  30. package/cjs/component/axis/polar/axis.js.map +1 -1
  31. package/cjs/component/axis/polar/band-axis.d.ts +1 -1
  32. package/cjs/component/axis/polar/band-axis.js.map +1 -1
  33. package/cjs/component/brush/brush.js +6 -5
  34. package/cjs/component/brush/brush.js.map +1 -1
  35. package/cjs/component/custom-mark/custom-mark.js +2 -2
  36. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  37. package/cjs/component/data-zoom/data-filter-base-component.d.ts +31 -52
  38. package/cjs/component/data-zoom/data-filter-base-component.js +164 -240
  39. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  40. package/cjs/component/data-zoom/data-filter-event.d.ts +53 -0
  41. package/cjs/component/data-zoom/data-filter-event.js +112 -0
  42. package/cjs/component/data-zoom/data-filter-event.js.map +1 -0
  43. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
  44. package/cjs/component/data-zoom/data-zoom/data-zoom.js +129 -84
  45. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  46. package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
  47. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +35 -36
  48. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  49. package/cjs/component/data-zoom/util.d.ts +14 -0
  50. package/cjs/component/data-zoom/util.js +81 -7
  51. package/cjs/component/data-zoom/util.js.map +1 -1
  52. package/cjs/component/marker/utils.js +1 -1
  53. package/cjs/component/marker/utils.js.map +1 -1
  54. package/cjs/component/tooltip/utils/show-tooltip.js +3 -3
  55. package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
  56. package/cjs/constant/event.d.ts +1 -0
  57. package/cjs/constant/event.js +8 -8
  58. package/cjs/constant/event.js.map +1 -1
  59. package/cjs/core/index.d.ts +1 -1
  60. package/cjs/core/index.js +1 -1
  61. package/cjs/core/index.js.map +1 -1
  62. package/cjs/mark/base/base-mark.d.ts +2 -1
  63. package/cjs/mark/base/base-mark.js +7 -3
  64. package/cjs/mark/base/base-mark.js.map +1 -1
  65. package/cjs/mark/interface/common.d.ts +1 -0
  66. package/cjs/mark/interface/common.js.map +1 -1
  67. package/cjs/plugin/other.js +2 -1
  68. package/cjs/plugin/other.js.map +1 -1
  69. package/cjs/series/bar/bar.js +1 -1
  70. package/cjs/series/bar/bar.js.map +1 -1
  71. package/cjs/series/base/base-series.d.ts +1 -0
  72. package/cjs/series/base/base-series.js +10 -5
  73. package/cjs/series/base/base-series.js.map +1 -1
  74. package/cjs/series/dot/dot.js +6 -2
  75. package/cjs/series/dot/dot.js.map +1 -1
  76. package/cjs/series/util/stack.js +1 -1
  77. package/cjs/series/util/stack.js.map +1 -1
  78. package/cjs/typings/spec/common.js.map +1 -1
  79. package/esm/animation/config.d.ts +1 -0
  80. package/esm/animation/config.js +8 -1
  81. package/esm/animation/config.js.map +1 -1
  82. package/esm/compile/compiler.d.ts +5 -0
  83. package/esm/compile/compiler.js +44 -4
  84. package/esm/compile/compiler.js.map +1 -1
  85. package/esm/compile/interface/compilable-item.d.ts +2 -0
  86. package/esm/compile/interface/compilable-item.js.map +1 -1
  87. package/esm/component/axis/base-axis.d.ts +1 -1
  88. package/esm/component/axis/base-axis.js +3 -3
  89. package/esm/component/axis/base-axis.js.map +1 -1
  90. package/esm/component/axis/cartesian/axis.d.ts +1 -1
  91. package/esm/component/axis/cartesian/axis.js.map +1 -1
  92. package/esm/component/axis/cartesian/band-axis.d.ts +1 -1
  93. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  94. package/esm/component/axis/interface/common.d.ts +1 -0
  95. package/esm/component/axis/interface/common.js.map +1 -1
  96. package/esm/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  97. package/esm/component/axis/mixin/band-axis-mixin.js +10 -4
  98. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  99. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
  100. package/esm/component/axis/mixin/linear-axis-mixin.js +15 -1
  101. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  102. package/esm/component/axis/polar/axis.d.ts +1 -1
  103. package/esm/component/axis/polar/axis.js.map +1 -1
  104. package/esm/component/axis/polar/band-axis.d.ts +1 -1
  105. package/esm/component/axis/polar/band-axis.js.map +1 -1
  106. package/esm/component/brush/brush.js +6 -4
  107. package/esm/component/brush/brush.js.map +1 -1
  108. package/esm/component/custom-mark/custom-mark.js +2 -2
  109. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  110. package/esm/component/data-zoom/data-filter-base-component.d.ts +31 -52
  111. package/esm/component/data-zoom/data-filter-base-component.js +155 -232
  112. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  113. package/esm/component/data-zoom/data-filter-event.d.ts +53 -0
  114. package/esm/component/data-zoom/data-filter-event.js +108 -0
  115. package/esm/component/data-zoom/data-filter-event.js.map +1 -0
  116. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
  117. package/esm/component/data-zoom/data-zoom/data-zoom.js +125 -82
  118. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  119. package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
  120. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +36 -36
  121. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  122. package/esm/component/data-zoom/util.d.ts +14 -0
  123. package/esm/component/data-zoom/util.js +63 -7
  124. package/esm/component/data-zoom/util.js.map +1 -1
  125. package/esm/component/marker/utils.js +1 -1
  126. package/esm/component/marker/utils.js.map +1 -1
  127. package/esm/component/tooltip/utils/show-tooltip.js +3 -3
  128. package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
  129. package/esm/constant/event.d.ts +1 -0
  130. package/esm/constant/event.js +8 -8
  131. package/esm/constant/event.js.map +1 -1
  132. package/esm/core/index.d.ts +1 -1
  133. package/esm/core/index.js +1 -1
  134. package/esm/core/index.js.map +1 -1
  135. package/esm/mark/base/base-mark.d.ts +2 -1
  136. package/esm/mark/base/base-mark.js +7 -3
  137. package/esm/mark/base/base-mark.js.map +1 -1
  138. package/esm/mark/interface/common.d.ts +1 -0
  139. package/esm/mark/interface/common.js.map +1 -1
  140. package/esm/plugin/other.js +2 -2
  141. package/esm/plugin/other.js.map +1 -1
  142. package/esm/series/bar/bar.js +2 -2
  143. package/esm/series/bar/bar.js.map +1 -1
  144. package/esm/series/base/base-series.d.ts +1 -0
  145. package/esm/series/base/base-series.js +9 -5
  146. package/esm/series/base/base-series.js.map +1 -1
  147. package/esm/series/dot/dot.js +6 -2
  148. package/esm/series/dot/dot.js.map +1 -1
  149. package/esm/series/util/stack.js +2 -2
  150. package/esm/series/util/stack.js.map +1 -1
  151. package/esm/typings/spec/common.js.map +1 -1
  152. package/package.json +6 -6
package/build/index.js CHANGED
@@ -18048,9 +18048,10 @@
18048
18048
  }
18049
18049
  updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
18050
18050
  const {
18051
- size = symbolTheme.size
18052
- } = attribute;
18053
- return this.getParsedPath().bounds(size, aabbBounds), aabbBounds;
18051
+ size = symbolTheme.size
18052
+ } = attribute,
18053
+ symbolClass = this.getParsedPath();
18054
+ return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
18054
18055
  }
18055
18056
  needUpdateTags(keys) {
18056
18057
  return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
@@ -18059,8 +18060,9 @@
18059
18060
  return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
18060
18061
  }
18061
18062
  toCustomPath() {
18062
- const symbolInstance = this.getParsedPath(),
18063
- size = this.attribute.size,
18063
+ const symbolInstance = this.getParsedPath();
18064
+ if (!symbolInstance) return null;
18065
+ const size = this.attribute.size,
18064
18066
  formattedSize = isArray$1(size) ? size : [size, size];
18065
18067
  return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
18066
18068
  }
@@ -24025,7 +24027,7 @@
24025
24027
  }));
24026
24028
  }
24027
24029
  enableAutoRefresh() {
24028
- this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
24030
+ this.autoRefresh || "node" === this.global.env || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
24029
24031
  }
24030
24032
  disableAutoRefresh() {
24031
24033
  this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
@@ -42404,7 +42406,7 @@
42404
42406
  labelStyle: labelStyle
42405
42407
  } = op,
42406
42408
  radius = null == getRadius ? void 0 : getRadius();
42407
- if (!radius) return convertDomainToTickData(scale.domain());
42409
+ if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
42408
42410
  let scaleTicks;
42409
42411
  if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
42410
42412
  const range = scale.range(),
@@ -43202,7 +43204,16 @@
43202
43204
  data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
43203
43205
  }
43204
43206
  let labels = this._initText(data);
43205
- labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels), isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : !1 !== overlap && (labels = this._overlapping(labels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
43207
+ labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels);
43208
+ const filteredLabels = [],
43209
+ overlapLabels = labels;
43210
+ if (!isBoolean$1(overlap) && isFunction$1(overlap.filterBeforeOverlap)) {
43211
+ const getRelatedGraphic = this.getRelatedGraphic.bind(this);
43212
+ labels.forEach(label => {
43213
+ overlap.filterBeforeOverlap(label, getRelatedGraphic, this) ? overlapLabels.push(label) : filteredLabels.push(label);
43214
+ });
43215
+ }
43216
+ isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(overlapLabels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this).concat(filteredLabels) : !1 !== overlap && (labels = this._overlapping(overlapLabels).concat(filteredLabels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
43206
43217
  this._bindEvent(label), this._setStatesOfText(label);
43207
43218
  }), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels), !1 !== this._enableAnimation && this._baseMarks.forEach((mark, index) => {
43208
43219
  mark.initAttributes(markAttributeList[index]);
@@ -43576,20 +43587,23 @@
43576
43587
  {
43577
43588
  enter: enter
43578
43589
  } = this._animationConfig;
43579
- [text, labelLine].filter(Boolean).forEach(item => item.applyAnimationState(["enter"], [{
43580
- name: "enter",
43581
- animation: Object.assign(Object.assign({}, enter), {
43582
- type: "labelEnter",
43583
- selfOnly: !0,
43584
- customParameters: {
43585
- relatedGraphic: relatedGraphic,
43586
- relatedGraphics: this._idToGraphic,
43587
- config: Object.assign(Object.assign({}, enter), {
43588
- type: item === text ? enter.type : "fadeIn"
43589
- })
43590
- }
43591
- })
43592
- }]));
43590
+ [text, labelLine].filter(Boolean).forEach(item => {
43591
+ var _a;
43592
+ null === (_a = item.setFinalAttributes) || void 0 === _a || _a.call(item, item.attribute), item.applyAnimationState(["enter"], [{
43593
+ name: "enter",
43594
+ animation: Object.assign(Object.assign({}, enter), {
43595
+ type: "labelEnter",
43596
+ selfOnly: !0,
43597
+ customParameters: {
43598
+ relatedGraphic: relatedGraphic,
43599
+ relatedGraphics: this._idToGraphic,
43600
+ config: Object.assign(Object.assign({}, enter), {
43601
+ type: item === text ? enter.type : "fadeIn"
43602
+ })
43603
+ }
43604
+ })
43605
+ }]);
43606
+ });
43593
43607
  }
43594
43608
  _runUpdateAnimation(prevLabel, currentLabel) {
43595
43609
  const {
@@ -45471,15 +45485,18 @@
45471
45485
  pickable: !1
45472
45486
  }, selectedBackgroundChartStyle.area));
45473
45487
  }
45474
- _computeBasePoints() {
45488
+ _computeBasePoints(points) {
45475
45489
  const {
45476
45490
  orient: orient
45477
45491
  } = this.attribute,
45478
- {
45479
- position: position,
45480
- width: width,
45481
- height: height
45482
- } = this._getLayoutAttrFromConfig();
45492
+ key = "bottom" === orient || "top" === orient ? "x" : "y";
45493
+ let lastPointSide = Math.sign(points[points.length - 1][key] - points[0][key]);
45494
+ 0 === lastPointSide && (lastPointSide = 1);
45495
+ const {
45496
+ position: position,
45497
+ width: width,
45498
+ height: height
45499
+ } = this._getLayoutAttrFromConfig();
45483
45500
  let basePointStart, basePointEnd;
45484
45501
  return this._isHorizontal ? (basePointStart = [{
45485
45502
  x: position.x,
@@ -45499,7 +45516,10 @@
45499
45516
  }], basePointEnd = [{
45500
45517
  x: position.x,
45501
45518
  y: position.y
45502
- }]), {
45519
+ }]), Math.sign(basePointEnd[0][key] - basePointStart[0][key]) !== lastPointSide ? {
45520
+ basePointStart: basePointEnd,
45521
+ basePointEnd: basePointStart
45522
+ } : {
45503
45523
  basePointStart: basePointStart,
45504
45524
  basePointEnd: basePointEnd
45505
45525
  };
@@ -45522,7 +45542,7 @@
45522
45542
  const {
45523
45543
  basePointStart: basePointStart,
45524
45544
  basePointEnd: basePointEnd
45525
- } = this._computeBasePoints();
45545
+ } = this._computeBasePoints(previewPoints);
45526
45546
  return basePointStart.concat(previewPoints).concat(basePointEnd);
45527
45547
  }
45528
45548
  _getPreviewAreaPoints() {
@@ -45537,7 +45557,7 @@
45537
45557
  const {
45538
45558
  basePointStart: basePointStart,
45539
45559
  basePointEnd: basePointEnd
45540
- } = this._computeBasePoints();
45560
+ } = this._computeBasePoints(previewPoints);
45541
45561
  return basePointStart.concat(previewPoints).concat(basePointEnd);
45542
45562
  }
45543
45563
  renderText() {
@@ -45950,11 +45970,12 @@
45950
45970
  })));
45951
45971
  }
45952
45972
  setAttributes(params, forceUpdateTag) {
45973
+ var _a, _b;
45953
45974
  const {
45954
45975
  start: start,
45955
45976
  end: end
45956
45977
  } = this.attribute;
45957
- start && (this._state.start = start), end && (this._state.end = end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
45978
+ start && (this._state.start = null !== (_a = params.start) && void 0 !== _a ? _a : start), end && (this._state.end = null !== (_b = params.end) && void 0 !== _b ? _b : end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
45958
45979
  }
45959
45980
  render() {
45960
45981
  this._layoutCacheFromConfig = null, this._container = this.createOrUpdateChild("datazoom-container", {}, "group"), this._renderer.renderDataZoom(), this._interaction.setAttributes(this._getInteractionAttrs());
@@ -53708,6 +53729,7 @@
53708
53729
  ChartEvent["markDeltaYUpdate"] = "markDeltaYUpdate";
53709
53730
  ChartEvent["viewDataLabelUpdate"] = "viewDataLabelUpdate";
53710
53731
  ChartEvent["scaleDomainUpdate"] = "scaleDomainUpdate";
53732
+ ChartEvent["scaleRawDomainUpdate"] = "scaleRawDomainUpdate";
53711
53733
  ChartEvent["scaleUpdate"] = "scaleUpdate";
53712
53734
  ChartEvent["dataZoomChange"] = "dataZoomChange";
53713
53735
  ChartEvent["drill"] = "drill";
@@ -54729,6 +54751,7 @@
54729
54751
  var _a, _b, _c, _d, _e, _f;
54730
54752
  (_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeDoRender) === null || _b === void 0 ? void 0 : _b.call(_a, this._compileChart.getOption().globalInstance);
54731
54753
  if (this._stage) {
54754
+ this.runStageAnimation();
54732
54755
  this._rootMarks.forEach(g => {
54733
54756
  traverseGroupMark(g, m => {
54734
54757
  if (m.needClear) {
@@ -54771,6 +54794,7 @@
54771
54794
  this.handleLayoutEnd();
54772
54795
  }
54773
54796
  this.findProgressiveMarks();
54797
+ this.updateStateAnimation();
54774
54798
  this._doRender(true);
54775
54799
  this.doPreProgressive();
54776
54800
  log(`--- start of renderMarks(${this._count}) ---`);
@@ -54816,6 +54840,67 @@
54816
54840
  this.renderMarks();
54817
54841
  }
54818
54842
  }
54843
+ setStageAnimationConfig(config) {
54844
+ const animationConfig = {};
54845
+ Object.keys(config).forEach(key => {
54846
+ const value = config[key];
54847
+ if (isArray$1(value)) {
54848
+ animationConfig[key] = value.map(item => {
54849
+ var _a;
54850
+ const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
54851
+ return Object.assign(Object.assign({}, item), { options: (...args) => {
54852
+ const _options = typeof options === 'function' ? options(...args) : options;
54853
+ return Object.assign({}, _options);
54854
+ } });
54855
+ });
54856
+ }
54857
+ else {
54858
+ animationConfig[key] = Object.assign({}, config[key]);
54859
+ }
54860
+ });
54861
+ this._stateAnimationConfig = animationConfig;
54862
+ }
54863
+ updateStateAnimation() {
54864
+ const allMarks = [];
54865
+ this._rootMarks.forEach(mark => {
54866
+ traverseGroupMark(mark, m => {
54867
+ allMarks.push(m);
54868
+ });
54869
+ });
54870
+ const markAnimationStates = allMarks.map(mark => mark.getAnimationState());
54871
+ const animationState = markAnimationStates.every(state => state === AnimationStateEnum.appear)
54872
+ ? AnimationStateEnum.appear
54873
+ : markAnimationStates.every(state => state === AnimationStateEnum.disappear)
54874
+ ? AnimationStateEnum.disappear
54875
+ : AnimationStateEnum.none;
54876
+ if (!this._stage.context) {
54877
+ this._stage.context = {};
54878
+ }
54879
+ this._stage.context.animationState = animationState;
54880
+ }
54881
+ runStageAnimation() {
54882
+ var _a;
54883
+ const animationState = (_a = this._stage.context) === null || _a === void 0 ? void 0 : _a.animationState;
54884
+ if (!this._stateAnimationConfig || animationState === AnimationStateEnum.none) {
54885
+ return;
54886
+ }
54887
+ const animationConfigs = array(this._stateAnimationConfig[animationState]).filter(config => config.type);
54888
+ if (!animationConfigs.length) {
54889
+ return;
54890
+ }
54891
+ if (animationState === AnimationStateEnum.appear) {
54892
+ this._stage.stopAnimationState(AnimationStateEnum.disappear);
54893
+ }
54894
+ else if (animationState === AnimationStateEnum.disappear) {
54895
+ this._stage.stopAnimationState(AnimationStateEnum.appear);
54896
+ }
54897
+ this._stage.applyAnimationState([animationState], [
54898
+ {
54899
+ name: animationState,
54900
+ animation: animationConfigs
54901
+ }
54902
+ ]);
54903
+ }
54819
54904
  updateViewBox(viewBox, reRender = true) {
54820
54905
  if (!this._stage) {
54821
54906
  return;
@@ -58285,6 +58370,15 @@
58285
58370
  : () => 'key';
58286
58371
  this._dataByGroup = groupData(data, this._groupKeyGetter);
58287
58372
  }
58373
+ getAnimationState() {
58374
+ const graphicsAnimationStates = this._graphics.map(g => g.context.animationState);
58375
+ const animationState = graphicsAnimationStates.every(state => state === AnimationStateEnum.appear)
58376
+ ? AnimationStateEnum.appear
58377
+ : graphicsAnimationStates.every(state => state === AnimationStateEnum.disappear)
58378
+ ? AnimationStateEnum.disappear
58379
+ : graphicsAnimationStates[0];
58380
+ return animationState !== null && animationState !== void 0 ? animationState : AnimationStateEnum.none;
58381
+ }
58288
58382
  createAnimationStateList(type, animationConfig) {
58289
58383
  var _a;
58290
58384
  let config = animationConfig[type];
@@ -58539,14 +58633,14 @@
58539
58633
  _runApplyGraphic(graphics) {
58540
58634
  const hasAnimation = this.hasAnimation();
58541
58635
  graphics.forEach((g, index) => {
58542
- var _a;
58636
+ var _a, _b;
58543
58637
  const finalAttrs = g.context.finalAttrs;
58544
58638
  const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
58545
58639
  if (!g.setAttributes) {
58546
58640
  const mockGraphic = g;
58547
58641
  g = this._createGraphic(finalAttrs);
58548
58642
  if (hasAnimation) {
58549
- g.setFinalAttributes(finalAttrs);
58643
+ (_a = g.setFinalAttributes) === null || _a === void 0 ? void 0 : _a.call(g, finalAttrs);
58550
58644
  }
58551
58645
  g.context = mockGraphic.context;
58552
58646
  g.context.diffAttrs = finalAttrs;
@@ -58554,7 +58648,7 @@
58554
58648
  if (gIndex >= 0) {
58555
58649
  this._graphics[gIndex] = g;
58556
58650
  }
58557
- if ((_a = this.renderContext) === null || _a === void 0 ? void 0 : _a.progressive) {
58651
+ if ((_b = this.renderContext) === null || _b === void 0 ? void 0 : _b.progressive) {
58558
58652
  const groupIndex = this._dataByGroup ? this._dataByGroup.keys.indexOf(g.context.groupKey) : 0;
58559
58653
  const group = groupIndex >= 0 ? this._product.getChildAt(groupIndex) : null;
58560
58654
  if (group) {
@@ -59408,10 +59502,20 @@
59408
59502
  const registerPolygonAnimation = () => {
59409
59503
  AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);
59410
59504
  };
59505
+ const registerStageAnimation = () => {
59506
+ AnimateExecutor.registerBuiltInAnimate('distortion', Distortion);
59507
+ AnimateExecutor.registerBuiltInAnimate('particle', Particle);
59508
+ AnimateExecutor.registerBuiltInAnimate('pixelation', Pixelation);
59509
+ AnimateExecutor.registerBuiltInAnimate('gaussianBlur', GaussianBlur);
59510
+ AnimateExecutor.registerBuiltInAnimate('glitch', Glitch);
59511
+ AnimateExecutor.registerBuiltInAnimate('grayscale', Grayscale);
59512
+ AnimateExecutor.registerBuiltInAnimate('dissolve', Dissolve);
59513
+ };
59411
59514
 
59412
59515
  const registerAnimate = () => {
59413
59516
  registerAnimate$1();
59414
59517
  registerBuiltInAnimation();
59518
+ registerStageAnimation();
59415
59519
  };
59416
59520
  const registerDragPlugin = () => {
59417
59521
  Factory.registerStageEventPlugin('drag', DragNDrop);
@@ -61296,7 +61400,7 @@
61296
61400
  });
61297
61401
  };
61298
61402
 
61299
- const version = "2.0.8";
61403
+ const version = "2.0.10-alpha.0";
61300
61404
 
61301
61405
  const addVChartProperty = (data, op) => {
61302
61406
  const context = op.beforeCall();
@@ -62346,6 +62450,7 @@
62346
62450
  this.initMarkState();
62347
62451
  if (hasAnimation) {
62348
62452
  this.initAnimation();
62453
+ this.initStageAnimation();
62349
62454
  }
62350
62455
  this.afterInitMark();
62351
62456
  this.initEvent();
@@ -62666,7 +62771,7 @@
62666
62771
  if (isValid$1(spec.id)) {
62667
62772
  mark.setUserId(spec.id);
62668
62773
  }
62669
- if (options.hasAnimation) {
62774
+ if (options.hasAnimation && spec.animation !== false) {
62670
62775
  const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
62671
62776
  mark.setAnimationConfig(config);
62672
62777
  }
@@ -62676,7 +62781,7 @@
62676
62781
  this._createExtensionMark(s, mark, namePrefix, i, options);
62677
62782
  });
62678
62783
  }
62679
- else if (!parentMark && (!isNil$1(spec.dataId) || !isNil$1(spec.dataIndex))) {
62784
+ if (!isNil$1(spec.dataId) || !isNil$1(spec.dataIndex)) {
62680
62785
  const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);
62681
62786
  if (dataView === this._rawData) {
62682
62787
  mark.setData(this._data);
@@ -62802,6 +62907,13 @@
62802
62907
  }
62803
62908
  initAnimation() {
62804
62909
  }
62910
+ initStageAnimation() {
62911
+ const compiler = this._option.getCompiler();
62912
+ if (!(compiler === null || compiler === void 0 ? void 0 : compiler.setStageAnimationConfig)) {
62913
+ return;
62914
+ }
62915
+ compiler.setStageAnimationConfig(animationConfig({}, userAnimationConfig('stage', this._spec, this._markAttributeContext), null));
62916
+ }
62805
62917
  initMarkState() {
62806
62918
  this.initSeriesStyleState();
62807
62919
  }
@@ -65672,7 +65784,7 @@
65672
65784
  const viewData = s.getViewData();
65673
65785
  if (rawData) {
65674
65786
  field.forEach(f => {
65675
- data.push(s.getRawDataStatisticsByField(f, false));
65787
+ data.push(s.getRawDataStatisticsByField(f, !!isContinuous(this._scale.type)));
65676
65788
  });
65677
65789
  }
65678
65790
  else if (viewData && viewData.latestData && viewData.latestData.length) {
@@ -65974,7 +66086,7 @@
65974
66086
  _getGridAttributes() {
65975
66087
  const spec = this._spec;
65976
66088
  return {
65977
- alternateColor: spec.grid.alternateColor,
66089
+ alternateColor: isFunction$1(spec.grid.alternateColor) ? spec.grid.alternateColor() : spec.grid.alternateColor,
65978
66090
  alignWithLabel: spec.grid.alignWithLabel,
65979
66091
  style: isFunction$1(spec.grid.style)
65980
66092
  ? (datum, index) => {
@@ -65988,7 +66100,9 @@
65988
66100
  : {
65989
66101
  type: 'line',
65990
66102
  visible: spec.subGrid.visible,
65991
- alternateColor: spec.subGrid.alternateColor,
66103
+ alternateColor: isFunction$1(spec.subGrid.alternateColor)
66104
+ ? spec.subGrid.alternateColor()
66105
+ : spec.subGrid.alternateColor,
65992
66106
  style: transformToGraphic(spec.subGrid.style)
65993
66107
  }
65994
66108
  };
@@ -66935,8 +67049,12 @@
66935
67049
  class LinearAxisMixin {
66936
67050
  constructor() {
66937
67051
  this._extend = {};
67052
+ this._rawDomain = [];
66938
67053
  this.niceLabelFormatter = null;
66939
67054
  }
67055
+ getRawDomain() {
67056
+ return this._rawDomain;
67057
+ }
66940
67058
  setExtraAttrFromSpec() {
66941
67059
  isValid$1(this._spec.nice) && (this._nice = this._spec.nice);
66942
67060
  isValid$1(this._spec.zero) && (this._zero = this._spec.zero);
@@ -67203,9 +67321,13 @@
67203
67321
  }
67204
67322
  }
67205
67323
  updateScaleDomain() {
67324
+ var _a;
67206
67325
  if (!this.isSeriesDataEnable()) {
67207
67326
  return;
67208
67327
  }
67328
+ if (!((_a = this._rawDomain) === null || _a === void 0 ? void 0 : _a.length) && this._scale) {
67329
+ this._updateRawDomain();
67330
+ }
67209
67331
  const data = this.collectData();
67210
67332
  const domain = this.computeLinearDomain(data);
67211
67333
  this.updateScaleDomainByModel(domain);
@@ -67240,6 +67362,15 @@
67240
67362
  return value;
67241
67363
  };
67242
67364
  }
67365
+ _updateRawDomain() {
67366
+ const data = this.collectData(0, true);
67367
+ const domain = this.computeLinearDomain(data);
67368
+ this._rawDomain = domain;
67369
+ this.event.emit(exports.ChartEvent.scaleRawDomainUpdate, { model: this });
67370
+ }
67371
+ _clearRawDomain() {
67372
+ this._rawDomain = [];
67373
+ }
67243
67374
  }
67244
67375
 
67245
67376
  const axisLinear = {
@@ -67471,6 +67602,7 @@
67471
67602
  class BandAxisMixin {
67472
67603
  constructor() {
67473
67604
  this._rawDomainIndex = [];
67605
+ this._rawDomain = [];
67474
67606
  }
67475
67607
  _initData() {
67476
67608
  var _a;
@@ -67522,6 +67654,9 @@
67522
67654
  tickTransform && (tickTransform.options = this._tickTransformOption());
67523
67655
  }
67524
67656
  }
67657
+ getRawDomain() {
67658
+ return this._rawDomain;
67659
+ }
67525
67660
  dataToPosition(values, cfg = {}) {
67526
67661
  var _a, _b;
67527
67662
  if (values.length === 0 || this._scales.length === 0) {
@@ -67659,6 +67794,7 @@
67659
67794
  }
67660
67795
  _updateRawDomain() {
67661
67796
  this._rawDomainIndex = [];
67797
+ this._rawDomain = [];
67662
67798
  const userDomain = this._spec.domain;
67663
67799
  for (let i = 0; i < this._scales.length; i++) {
67664
67800
  if (userDomain && userDomain.length && i === 0) {
@@ -67668,12 +67804,15 @@
67668
67804
  const data = this.collectData(i, true);
67669
67805
  const domain = this.computeBandDomain(data);
67670
67806
  this._rawDomainIndex[i] = {};
67807
+ this._rawDomain[i] = domain;
67671
67808
  domain.forEach((d, _i) => (this._rawDomainIndex[i][d] = _i));
67672
67809
  }
67673
67810
  }
67811
+ this.event.emit(exports.ChartEvent.scaleRawDomainUpdate, { model: this });
67674
67812
  }
67675
67813
  _clearRawDomain() {
67676
67814
  this._rawDomainIndex = [];
67815
+ this._rawDomain = [];
67677
67816
  }
67678
67817
  }
67679
67818
 
@@ -72011,7 +72150,10 @@
72011
72150
  lastY = y1;
72012
72151
  }
72013
72152
  let height = Math.abs(y1 - y);
72014
- if (height < barMinHeight) {
72153
+ if (height <= 0 && !isValueInScaleDomain(obj[s.getStackValueField()], seriesScale)) {
72154
+ height = 0;
72155
+ }
72156
+ else if (height < barMinHeight) {
72015
72157
  height = barMinHeight;
72016
72158
  }
72017
72159
  let flag = 1;
@@ -72360,7 +72502,10 @@
72360
72502
  const y1 = valueInScaleRange(this[startMethod](datum), seriesScale, useWholeRange);
72361
72503
  const y = valueInScaleRange(this[endMethod](datum), seriesScale, useWholeRange);
72362
72504
  let height = Math.abs(y1 - y);
72363
- if (height < barMinHeight) {
72505
+ if (height <= 0 && !isValueInScaleDomain(datum[this.getStackValueField()], seriesScale)) {
72506
+ height = 0;
72507
+ }
72508
+ else if (height < barMinHeight) {
72364
72509
  height = barMinHeight;
72365
72510
  }
72366
72511
  let flag = 1;
@@ -79378,13 +79523,14 @@
79378
79523
  });
79379
79524
  }
79380
79525
  initMarkStyle() {
79526
+ var _a;
79381
79527
  const clipMark = this._clipMark;
79382
79528
  if (clipMark) {
79383
79529
  this.setMarkStyle(clipMark, {
79384
- x: -this._spec.leftAppendPadding,
79530
+ x: -((_a = this._spec.leftAppendPadding) !== null && _a !== void 0 ? _a : 0),
79385
79531
  y: 0,
79386
79532
  width: 10000,
79387
- height: this._spec.clipHeight
79533
+ height: () => { var _a; return (_a = this._spec.clipHeight) !== null && _a !== void 0 ? _a : this._region.getLayoutRect().height; }
79388
79534
  }, 'normal', exports.AttributeLevel.Series);
79389
79535
  clipMark.setMarkConfig({ interactive: false, clip: true });
79390
79536
  }
@@ -94984,7 +95130,7 @@
94984
95130
  return Object.keys(data).length > 0;
94985
95131
  };
94986
95132
  function showTooltip(datum, options, component) {
94987
- var _a, _b, _c;
95133
+ var _a, _b, _c, _d, _e, _f;
94988
95134
  const opt = Object.assign({ regionIndex: 0 }, options);
94989
95135
  const componentOptions = component.getOption();
94990
95136
  const region = componentOptions.getRegionsInUserIdOrIndex(isValid$1(opt.regionId) ? [opt.regionId] : undefined, isValid$1(opt.regionIndex) ? [opt.regionIndex] : undefined)[0];
@@ -95067,7 +95213,7 @@
95067
95213
  }),
95068
95214
  item: undefined
95069
95215
  };
95070
- component.processor.dimension.showTooltip(mockDimensionInfo, mockParams, false);
95216
+ (_e = (_d = (_c = component.processor) === null || _c === void 0 ? void 0 : _c.dimension) === null || _d === void 0 ? void 0 : _d.showTooltip) === null || _e === void 0 ? void 0 : _e.call(_d, mockDimensionInfo, mockParams, false);
95071
95217
  const vchart = componentOptions.globalInstance;
95072
95218
  if (VChart.globalConfig.uniqueTooltip) {
95073
95219
  VChart.hideTooltip(vchart.id);
@@ -95096,7 +95242,7 @@
95096
95242
  changePositionOnly: false,
95097
95243
  tooltip: null,
95098
95244
  dimensionInfo: mockDimensionInfo,
95099
- chart: (_c = componentOptions.globalInstance.getChart()) !== null && _c !== void 0 ? _c : undefined,
95245
+ chart: (_f = componentOptions.globalInstance.getChart()) !== null && _f !== void 0 ? _f : undefined,
95100
95246
  datum: mockDatum,
95101
95247
  model: info.series,
95102
95248
  source: Event_Source_Type.chart,
@@ -97049,17 +97195,26 @@
97049
97195
  return data.filter(filter);
97050
97196
  };
97051
97197
  const dataFilterComputeDomain = (data, op) => {
97052
- const { stateFields, valueFields, dataCollection, isCategoryState } = op.input;
97198
+ const { stateFields, valueFields, dataCollection, isCategoryState, seriesCollection } = op.input;
97053
97199
  const { stateField, valueField } = op.output;
97054
97200
  const resultObj = {};
97201
+ const resultKeys = [];
97055
97202
  const resultData = [];
97056
97203
  const stateValues = [];
97057
97204
  let hasLockDomain = false;
97205
+ let isAllLinearValue = false;
97058
97206
  dataCollection.forEach((dv, i) => {
97059
97207
  var _a;
97060
97208
  if (isNil$1(stateFields[i])) {
97061
97209
  return;
97062
97210
  }
97211
+ const series = seriesCollection[i];
97212
+ if (series) {
97213
+ const statistics = series.getRawDataStatisticsByField(stateFields[i]);
97214
+ if (isValid$1(statistics === null || statistics === void 0 ? void 0 : statistics.max) && isValid$1(statistics === null || statistics === void 0 ? void 0 : statistics.min)) {
97215
+ isAllLinearValue = true;
97216
+ }
97217
+ }
97063
97218
  const stateFieldInfo = (_a = dv.getFields()) === null || _a === void 0 ? void 0 : _a[stateFields[i]];
97064
97219
  if (stateFieldInfo && stateFieldInfo.lockStatisticsByDomain) {
97065
97220
  hasLockDomain = true;
@@ -97067,6 +97222,7 @@
97067
97222
  if (isNil$1(resultObj[d])) {
97068
97223
  stateValues.push(d);
97069
97224
  resultObj[d] = 0;
97225
+ resultKeys.push(d);
97070
97226
  }
97071
97227
  });
97072
97228
  }
@@ -97076,6 +97232,7 @@
97076
97232
  if (isNil$1(resultObj[d[state]])) {
97077
97233
  stateValues.push(d[state]);
97078
97234
  resultObj[d[state]] = 0;
97235
+ resultKeys.push(d[state]);
97079
97236
  }
97080
97237
  if (!isNil$1(valueFields[i])) {
97081
97238
  resultObj[d[state]] += isNaN(parseFloat(d[valueFields[i]])) ? 1 : parseFloat(d[valueFields[i]]);
@@ -97086,9 +97243,9 @@
97086
97243
  });
97087
97244
  const sortedStateValues = hasLockDomain
97088
97245
  ? stateValues
97089
- : isCategoryState === false
97246
+ : isCategoryState === false || isAllLinearValue
97090
97247
  ? stateValues.sort((a, b) => a - b)
97091
- : Object.keys(resultObj);
97248
+ : resultKeys;
97092
97249
  sortedStateValues.forEach(state => {
97093
97250
  const res = { [stateField]: state };
97094
97251
  if (valueField) {
@@ -97098,17 +97255,83 @@
97098
97255
  });
97099
97256
  return resultData;
97100
97257
  };
97101
-
97102
- class DataFilterBaseComponent extends BaseComponent {
97103
- get relatedAxisComponent() {
97104
- return this._relatedAxisComponent;
97258
+ const statePointToData = (state, scale, reverse) => {
97259
+ const domain = scale.domain();
97260
+ if (isContinuous(scale.type)) {
97261
+ if (reverse) {
97262
+ return domain[0] + (last(domain) - domain[0]) * (1 - state);
97263
+ }
97264
+ return domain[0] + (last(domain) - domain[0]) * state;
97105
97265
  }
97106
- setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
97107
- const [startMode = 'percent', endMode = 'percent'] = rangeMode;
97108
- const startPercent = (startMode === 'percent' ? start : this.dataToStatePoint(start));
97109
- const endPercent = (endMode === 'percent' ? end : this.dataToStatePoint(end));
97110
- this._handleChange(startPercent, endPercent, true);
97266
+ let range = scale.range();
97267
+ if (reverse) {
97268
+ range = range.slice().reverse();
97269
+ }
97270
+ const posInRange = range[0] + (last(range) - range[0]) * state;
97271
+ return scale.invert(posInRange);
97272
+ };
97273
+ const dataToStatePoint = (data, scale, isHorizontal) => {
97274
+ const pos = scale.scale(data);
97275
+ let range = scale.range();
97276
+ if (!isHorizontal && isContinuous(scale.type)) {
97277
+ range = range.slice().reverse();
97278
+ }
97279
+ return Math.max(0, Math.min(1, (pos - range[0]) / (last(range) - range[0])));
97280
+ };
97281
+ const isReverse = (axisComponent, isHorizontal) => {
97282
+ const axis = axisComponent;
97283
+ if (!axis) {
97284
+ return false;
97111
97285
  }
97286
+ const axisScale = axis.getScale();
97287
+ return axisScale.range()[0] > axisScale.range()[1] && (!axis.getInverse() || isHorizontal);
97288
+ };
97289
+ const getAxisBandSize = (axisSpec) => {
97290
+ const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
97291
+ const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
97292
+ const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
97293
+ if (bandSize || minBandSize || maxBandSize) {
97294
+ return { bandSize, maxBandSize, minBandSize };
97295
+ }
97296
+ return undefined;
97297
+ };
97298
+ const modeCheck = (statePoint, mode, spec) => {
97299
+ if (statePoint === 'start') {
97300
+ return (mode === 'percent' && isValid$1(spec.start)) || (mode === 'value' && isValid$1(spec.startValue));
97301
+ }
97302
+ return (mode === 'percent' && isValid$1(spec.end)) || (mode === 'value' && isValid$1(spec.endValue));
97303
+ };
97304
+ const parseDomainFromState = (startValue, endValue, scale) => {
97305
+ if (isContinuous(scale.type)) {
97306
+ return [Math.min(endValue, startValue), Math.max(endValue, startValue)];
97307
+ }
97308
+ const allDomain = scale.domain();
97309
+ const startIndex = allDomain.indexOf(startValue);
97310
+ const endIndex = allDomain.indexOf(endValue);
97311
+ return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
97312
+ };
97313
+ const parseDomainFromStateAndValue = (start, startValue, end, endValue, scale) => {
97314
+ if (isContinuous(scale.type)) {
97315
+ const domain = scale.domain();
97316
+ const min = domain[0];
97317
+ const total = last(domain) - min;
97318
+ const resultStart = isValid$1(start) ? min + total * start : +startValue;
97319
+ const resultEnd = isValid$1(end) ? min + total * end : +endValue;
97320
+ return [Math.min(resultEnd, resultStart), Math.max(resultEnd, resultStart)];
97321
+ }
97322
+ const allDomain = scale.domain();
97323
+ const range = scale.range();
97324
+ const rangeSize = range[range.length - 1] - range[0];
97325
+ const startIndex = isValid$1(start)
97326
+ ? allDomain.indexOf(scale.invert(rangeSize * start + range[0]))
97327
+ : allDomain.indexOf(startValue);
97328
+ const endIndex = isValid$1(end)
97329
+ ? allDomain.indexOf(scale.invert(rangeSize * end + range[0]))
97330
+ : allDomain.indexOf(endValue);
97331
+ return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
97332
+ };
97333
+
97334
+ class DataFilterEvent {
97112
97335
  enableInteraction() {
97113
97336
  this._activeRoam = true;
97114
97337
  }
@@ -97116,19 +97339,203 @@
97116
97339
  this._activeRoam = false;
97117
97340
  }
97118
97341
  zoomIn(location) {
97119
- this._handleChartZoom({
97342
+ this.handleChartZoom({
97120
97343
  zoomDelta: 1.2,
97121
97344
  zoomX: location === null || location === void 0 ? void 0 : location.x,
97122
97345
  zoomY: location === null || location === void 0 ? void 0 : location.y
97123
97346
  });
97124
97347
  }
97125
97348
  zoomOut(location) {
97126
- this._handleChartZoom({
97349
+ this.handleChartZoom({
97127
97350
  zoomDelta: 0.8,
97128
97351
  zoomX: location === null || location === void 0 ? void 0 : location.x,
97129
97352
  zoomY: location === null || location === void 0 ? void 0 : location.y
97130
97353
  });
97131
97354
  }
97355
+ constructor(type, spec, handleChange, getLayoutRect, getState, getRegions, getOption, getEvent) {
97356
+ this._activeRoam = true;
97357
+ this._zoomAttr = {
97358
+ enable: true,
97359
+ rate: 1,
97360
+ focus: true
97361
+ };
97362
+ this._dragAttr = {
97363
+ enable: true,
97364
+ rate: 1,
97365
+ reverse: true
97366
+ };
97367
+ this._scrollAttr = {
97368
+ enable: true,
97369
+ rate: 1,
97370
+ reverse: true
97371
+ };
97372
+ this.initZoomEvent = () => {
97373
+ var _a, _b, _c, _d, _e, _f, _g;
97374
+ const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
97375
+ const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? ((_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30) : 0;
97376
+ const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g : true;
97377
+ const option = { delayType, delayTime, realTime, allowComponentZoom: true };
97378
+ if (this._zoomAttr.enable) {
97379
+ this.initZoomEventOfRegions(this.getRegions(), null, this.handleChartZoom, option);
97380
+ }
97381
+ if (this._scrollAttr.enable) {
97382
+ this.initScrollEventOfRegions(this.getRegions(), null, this.handleChartScroll, option);
97383
+ }
97384
+ if (this._dragAttr.enable) {
97385
+ this.initDragEventOfRegions(this.getRegions(), null, this.handleChartDrag, option);
97386
+ }
97387
+ };
97388
+ this.handleChartZoom = (params, e) => {
97389
+ var _a, _b;
97390
+ if (!this._activeRoam || (this._zoomAttr.filter && !this._zoomAttr.filter(params, e))) {
97391
+ return;
97392
+ }
97393
+ const { zoomDelta, zoomX, zoomY } = params;
97394
+ const { x, y } = this.getRegions()[0].getLayoutStartPoint();
97395
+ const { width, height } = this.getRegions()[0].getLayoutRect();
97396
+ const delta = Math.abs(this.getState().start - this.getState().end);
97397
+ const zoomRate = (_b = (_a = this._spec.roamZoom) === null || _a === void 0 ? void 0 : _a.rate) !== null && _b !== void 0 ? _b : 1;
97398
+ if (delta >= 1 && zoomDelta < 1) {
97399
+ return;
97400
+ }
97401
+ if (delta <= 0.01 && zoomDelta > 1) {
97402
+ return;
97403
+ }
97404
+ const focusLoc = this._isHorizontal ? zoomX : zoomY;
97405
+ const totalValue = delta * (zoomDelta - 1) * zoomRate;
97406
+ let startValue = totalValue / 2;
97407
+ let endValue = totalValue / 2;
97408
+ if (focusLoc) {
97409
+ const startLoc = this._isHorizontal ? x : y;
97410
+ const endLoc = this._isHorizontal ? width : height;
97411
+ startValue = (Math.abs(startLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
97412
+ endValue = (Math.abs(endLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
97413
+ }
97414
+ const start = clamp$1(this.getState().start + startValue, 0, 1);
97415
+ const end = clamp$1(this.getState().end - endValue, 0, 1);
97416
+ this._handleChange(Math.min(start, end), Math.max(start, end), true);
97417
+ };
97418
+ this.handleChartScroll = (params, e) => {
97419
+ var _a;
97420
+ if (!this._activeRoam || (this._scrollAttr.filter && !this._scrollAttr.filter(params, e))) {
97421
+ return false;
97422
+ }
97423
+ const { scrollX, scrollY } = params;
97424
+ let value = this._isHorizontal ? scrollX : scrollY;
97425
+ const active = this._isHorizontal ? abs$1(scrollX / scrollY) >= 0.5 : abs$1(scrollY / scrollX) >= 0.5;
97426
+ if (!this._scrollAttr.reverse) {
97427
+ value = -value;
97428
+ }
97429
+ if (active) {
97430
+ this.handleChartMove(value, (_a = this._scrollAttr.rate) !== null && _a !== void 0 ? _a : 1);
97431
+ }
97432
+ const hasChange = this.getState().start !== 0 && this.getState().end !== 1;
97433
+ return active && hasChange;
97434
+ };
97435
+ this.handleChartDrag = (delta, e) => {
97436
+ var _a;
97437
+ if (!this._activeRoam || (this._dragAttr.filter && !this._dragAttr.filter(delta, e))) {
97438
+ return;
97439
+ }
97440
+ const [dx, dy] = delta;
97441
+ let value = this._isHorizontal ? dx : dy;
97442
+ if (this._dragAttr.reverse) {
97443
+ value = -value;
97444
+ }
97445
+ this.handleChartMove(value, (_a = this._dragAttr.rate) !== null && _a !== void 0 ? _a : 1);
97446
+ };
97447
+ this.handleChartMove = (value, rate) => {
97448
+ const totalValue = this._isHorizontal ? this.getLayoutRect().width : this.getLayoutRect().height;
97449
+ if (Math.abs(value) >= 1e-6) {
97450
+ if (value > 0 && this.getState().end < 1) {
97451
+ const moveDelta = Math.min(1 - this.getState().end, value / totalValue) * rate;
97452
+ this._handleChange(this.getState().start + moveDelta, this.getState().end + moveDelta, true);
97453
+ }
97454
+ else if (value < 0 && this.getState().start > 0) {
97455
+ const moveDelta = Math.max(-this.getState().start, value / totalValue) * rate;
97456
+ this._handleChange(this.getState().start + moveDelta, this.getState().end + moveDelta, true);
97457
+ }
97458
+ }
97459
+ return false;
97460
+ };
97461
+ this._type = type;
97462
+ this._spec = spec;
97463
+ this._handleChange = handleChange;
97464
+ this.getLayoutRect = getLayoutRect;
97465
+ this.getState = getState;
97466
+ this.getRegions = getRegions;
97467
+ this._regions = getRegions();
97468
+ this.getOption = getOption;
97469
+ this._option = getOption();
97470
+ this.getEvent = getEvent;
97471
+ this._isHorizontal = getDirectionByOrient(getOrient(spec)) === "horizontal";
97472
+ }
97473
+ setEventAttrFromSpec() {
97474
+ if (this._spec.roamZoom === true || this._spec.roamZoom) {
97475
+ this._zoomAttr = merge$1({}, this._zoomAttr, this._spec.roamZoom);
97476
+ }
97477
+ else {
97478
+ this._zoomAttr.enable = false;
97479
+ }
97480
+ if (this._spec.roamDrag === true || this._spec.roamDrag) {
97481
+ this._dragAttr = merge$1({}, this._dragAttr, this._spec.roamDrag);
97482
+ }
97483
+ else {
97484
+ this._dragAttr.enable = false;
97485
+ }
97486
+ if (this._spec.roamScroll === true || this._spec.roamScroll) {
97487
+ this._scrollAttr = merge$1({}, this._scrollAttr, this._spec.roamScroll);
97488
+ }
97489
+ else {
97490
+ this._scrollAttr.enable = false;
97491
+ }
97492
+ if (isBoolean$1(this._spec.roam)) {
97493
+ this._zoomAttr.enable = this._type === 'scrollBar' ? false : this._spec.roam;
97494
+ this._dragAttr.enable = this._spec.roam;
97495
+ this._scrollAttr.enable = this._spec.roam;
97496
+ }
97497
+ if (this._zoomAttr.enable || this._dragAttr.enable || this._scrollAttr.enable) {
97498
+ this.initZoomable(this.getEvent(), this._option.mode);
97499
+ }
97500
+ }
97501
+ }
97502
+ mixin(DataFilterEvent, Zoomable);
97503
+
97504
+ class DataFilterBaseComponent extends BaseComponent {
97505
+ get isHorizontal() {
97506
+ return this._isHorizontal;
97507
+ }
97508
+ get stateScale() {
97509
+ return this._stateScale;
97510
+ }
97511
+ get relatedAxisComponent() {
97512
+ return this._relatedAxisComponent;
97513
+ }
97514
+ setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
97515
+ const [startMode = 'percent', endMode = 'percent'] = rangeMode;
97516
+ const startPercent = (startMode === 'percent' ? start : dataToStatePoint(start, this._stateScale, this._isHorizontal));
97517
+ const endPercent = (endMode === 'percent' ? end : dataToStatePoint(end, this._stateScale, this._isHorizontal));
97518
+ this._handleChange(startPercent, endPercent, true);
97519
+ }
97520
+ enableInteraction() {
97521
+ this._dataFilterEvent.enableInteraction();
97522
+ }
97523
+ disableInteraction() {
97524
+ this._dataFilterEvent.disableInteraction();
97525
+ }
97526
+ zoomIn(location) {
97527
+ this._dataFilterEvent.zoomIn(location);
97528
+ }
97529
+ zoomOut(location) {
97530
+ this._dataFilterEvent.zoomOut(location);
97531
+ }
97532
+ _initEvent() {
97533
+ var _a;
97534
+ this._dataFilterEvent.initZoomEvent();
97535
+ (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.event.on(exports.ChartEvent.scaleRawDomainUpdate, ({ model }) => {
97536
+ console.log('scaleRawDomainUpdate', model.getRawDomain());
97537
+ });
97538
+ }
97132
97539
  _handleChange(start, end, updateComponent) {
97133
97540
  var _a, _b;
97134
97541
  const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
@@ -97142,18 +97549,10 @@
97142
97549
  this._spanCache = end - start;
97143
97550
  }
97144
97551
  }
97145
- _isReverse() {
97146
- const axis = this._relatedAxisComponent;
97147
- if (!axis) {
97148
- return false;
97149
- }
97150
- const axisScale = axis.getScale();
97151
- return axisScale.range()[0] > axisScale.range()[1] && (!axis.getInverse() || this._isHorizontal);
97152
- }
97153
97552
  _updateRangeFactor(tag) {
97154
97553
  const axis = this._relatedAxisComponent;
97155
97554
  const axisScale = axis.getScale();
97156
- const reverse = this._isReverse();
97555
+ const reverse = isReverse(axis, this._isHorizontal);
97157
97556
  const newRangeFactor = reverse ? [1 - this._end, 1 - this._start] : [this._start, this._end];
97158
97557
  if (reverse) {
97159
97558
  switch (tag) {
@@ -97200,23 +97599,16 @@
97200
97599
  this._orient = 'left';
97201
97600
  this._cacheVisibility = undefined;
97202
97601
  this._dataUpdating = false;
97602
+ this._hasInitStateScale = false;
97203
97603
  this._shouldChange = true;
97204
97604
  this._stateField = 'x';
97205
- this._activeRoam = true;
97206
- this._zoomAttr = {
97207
- enable: true,
97208
- rate: 1,
97209
- focus: true
97210
- };
97211
- this._dragAttr = {
97212
- enable: true,
97213
- rate: 1,
97214
- reverse: true
97215
- };
97216
- this._scrollAttr = {
97217
- enable: true,
97218
- rate: 1,
97219
- reverse: true
97605
+ this._handleStateChange = (startValue, endValue, tag) => {
97606
+ var _a, _b;
97607
+ this._startValue = startValue;
97608
+ this._endValue = endValue;
97609
+ this._newDomain = parseDomainFromState(this._startValue, this._endValue, this._stateScale);
97610
+ (_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a, tag);
97611
+ return true;
97220
97612
  };
97221
97613
  this.effect = {
97222
97614
  onZoomChange: (tag) => {
@@ -97225,7 +97617,7 @@
97225
97617
  if (axis && this._filterMode === 'axis') {
97226
97618
  const axisScale = axis.getScale();
97227
97619
  const axisSpec = axis.getSpec();
97228
- if (this._auto && this._getAxisBandSize(axisSpec) && this._spec.ignoreBandSize) {
97620
+ if (this._auto && getAxisBandSize(axisSpec) && this._spec.ignoreBandSize) {
97229
97621
  axisScale.bandwidth('auto');
97230
97622
  axisScale.maxBandwidth('auto');
97231
97623
  axisScale.minBandwidth('auto');
@@ -97256,92 +97648,14 @@
97256
97648
  }
97257
97649
  };
97258
97650
  this._visible = true;
97259
- this._handleStateChange = (startValue, endValue, tag) => {
97260
- var _a, _b;
97261
- this._startValue = startValue;
97262
- this._endValue = endValue;
97263
- this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
97264
- (_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a, tag);
97265
- return true;
97266
- };
97267
- this._handleChartZoom = (params, e) => {
97268
- var _a, _b;
97269
- if (!this._activeRoam || (this._zoomAttr.filter && !this._zoomAttr.filter(params, e))) {
97270
- return;
97271
- }
97272
- const { zoomDelta, zoomX, zoomY } = params;
97273
- const { x, y } = this._regions[0].getLayoutStartPoint();
97274
- const { width, height } = this._regions[0].getLayoutRect();
97275
- const delta = Math.abs(this._start - this._end);
97276
- const zoomRate = (_b = (_a = this._spec.roamZoom) === null || _a === void 0 ? void 0 : _a.rate) !== null && _b !== void 0 ? _b : 1;
97277
- if (delta >= 1 && zoomDelta < 1) {
97278
- return;
97279
- }
97280
- if (delta <= 0.01 && zoomDelta > 1) {
97281
- return;
97282
- }
97283
- const focusLoc = this._isHorizontal ? zoomX : zoomY;
97284
- const totalValue = delta * (zoomDelta - 1) * zoomRate;
97285
- let startValue = totalValue / 2;
97286
- let endValue = totalValue / 2;
97287
- if (focusLoc) {
97288
- const startLoc = this._isHorizontal ? x : y;
97289
- const endLoc = this._isHorizontal ? width : height;
97290
- startValue = (Math.abs(startLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
97291
- endValue = (Math.abs(endLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
97292
- }
97293
- const start = clamp$1(this._start + startValue, 0, 1);
97294
- const end = clamp$1(this._end - endValue, 0, 1);
97295
- this._handleChange(Math.min(start, end), Math.max(start, end), true);
97296
- };
97297
- this._handleChartScroll = (params, e) => {
97298
- var _a;
97299
- if (!this._activeRoam || (this._scrollAttr.filter && !this._scrollAttr.filter(params, e))) {
97300
- return false;
97301
- }
97302
- const { scrollX, scrollY } = params;
97303
- let value = this._isHorizontal ? scrollX : scrollY;
97304
- const active = this._isHorizontal ? abs$1(scrollX / scrollY) >= 0.5 : abs$1(scrollY / scrollX) >= 0.5;
97305
- if (!this._scrollAttr.reverse) {
97306
- value = -value;
97307
- }
97308
- if (active) {
97309
- this._handleChartMove(value, (_a = this._scrollAttr.rate) !== null && _a !== void 0 ? _a : 1);
97310
- }
97311
- const hasChange = this._start !== 0 && this._end !== 1;
97312
- return active && hasChange;
97313
- };
97314
- this._handleChartDrag = (delta, e) => {
97315
- var _a, _b;
97316
- if (!this._activeRoam || (this._dragAttr.filter && !this._dragAttr.filter(delta, e))) {
97317
- return;
97318
- }
97319
- if ((_a = this._spec.roamDrag) === null || _a === void 0 ? void 0 : _a.autoVisible) {
97320
- this.show();
97321
- }
97322
- const [dx, dy] = delta;
97323
- let value = this._isHorizontal ? dx : dy;
97324
- if (this._dragAttr.reverse) {
97325
- value = -value;
97326
- }
97327
- this._handleChartMove(value, (_b = this._dragAttr.rate) !== null && _b !== void 0 ? _b : 1);
97328
- };
97329
- this._handleChartMove = (value, rate) => {
97330
- const totalValue = this._isHorizontal ? this.getLayoutRect().width : this.getLayoutRect().height;
97331
- if (Math.abs(value) >= 1e-6) {
97332
- if (value > 0 && this._end < 1) {
97333
- const moveDelta = Math.min(1 - this._end, value / totalValue) * rate;
97334
- this._handleChange(this._start + moveDelta, this._end + moveDelta, true);
97335
- }
97336
- else if (value < 0 && this._start > 0) {
97337
- const moveDelta = Math.max(-this._start, value / totalValue) * rate;
97338
- this._handleChange(this._start + moveDelta, this._end + moveDelta, true);
97339
- }
97340
- }
97341
- return false;
97342
- };
97343
97651
  this._orient = getOrient(spec);
97344
97652
  this._isHorizontal = getDirectionByOrient(this._orient) === "horizontal";
97653
+ this._dataFilterEvent = new DataFilterEvent(this.type, this._spec, this._handleChange.bind(this), this.getLayoutRect.bind(this), () => {
97654
+ return {
97655
+ start: this._start,
97656
+ end: this._end
97657
+ };
97658
+ }, () => this._regions, (() => this._option).bind(this), () => this.event);
97345
97659
  }
97346
97660
  created() {
97347
97661
  super.created();
@@ -97356,6 +97670,88 @@
97356
97670
  super.initLayout();
97357
97671
  this._layout && (this._layout.layoutOrient = this._orient);
97358
97672
  }
97673
+ init(option) {
97674
+ super.init(option);
97675
+ this._addTransformToSeries();
97676
+ if (this._start !== 0 || this._end !== 1) {
97677
+ this.effect.onZoomChange();
97678
+ }
97679
+ }
97680
+ _compareSpec(spec, prevSpec) {
97681
+ const result = super._compareSpec(spec, prevSpec);
97682
+ if (!result.reMake && !isEqual(prevSpec, spec)) {
97683
+ result.reRender = true;
97684
+ result.reMake = true;
97685
+ }
97686
+ return result;
97687
+ }
97688
+ reInit(spec) {
97689
+ super.reInit(spec);
97690
+ this._marks.forEach(g => {
97691
+ g.getMarks().forEach(m => {
97692
+ this.initMarkStyleWithSpec(m, this._spec[m.name]);
97693
+ });
97694
+ });
97695
+ }
97696
+ onLayoutStart(layoutRect, viewRect) {
97697
+ super.onLayoutStart(layoutRect, viewRect);
97698
+ const isShown = this._autoUpdate(layoutRect);
97699
+ this._autoVisible(isShown);
97700
+ this._dataUpdating = false;
97701
+ }
97702
+ updateLayoutAttribute() {
97703
+ this._visible && this._createOrUpdateComponent();
97704
+ if (!this._hasInitStateScale) {
97705
+ if (this._start !== 0 || this._end !== 1) {
97706
+ this._newDomain = parseDomainFromStateAndValue(this._spec.start, this._startValue, this._spec.end, this._endValue, this._stateScale);
97707
+ this.effect.onZoomChange();
97708
+ }
97709
+ this._hasInitStateScale = true;
97710
+ }
97711
+ }
97712
+ _initAfterLayout() {
97713
+ this._stateScale = null;
97714
+ this._initStateScale();
97715
+ this._updateScaleRange();
97716
+ this._setStateFromAxis();
97717
+ }
97718
+ _beforeLayoutEnd() {
97719
+ if (!this._hasInitStateScale) {
97720
+ this._initAfterLayout();
97721
+ }
97722
+ else {
97723
+ this._updateScaleRange();
97724
+ }
97725
+ }
97726
+ onLayoutEnd() {
97727
+ var _a;
97728
+ this._beforeLayoutEnd();
97729
+ const isShown = !(this._start === 0 && this._end === 1);
97730
+ this._autoVisible(isShown);
97731
+ super.onLayoutEnd();
97732
+ (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.updateScaleRange();
97733
+ }
97734
+ getBoundsInRect(rect) {
97735
+ const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
97736
+ if (this._isHorizontal) {
97737
+ result.y2 = result.y1 + this._height;
97738
+ result.x2 = result.x1 + rect.width;
97739
+ }
97740
+ else {
97741
+ result.x2 = result.x1 + this._width;
97742
+ result.y2 = result.y1 + rect.height;
97743
+ }
97744
+ return result;
97745
+ }
97746
+ setAttrFromSpec() {
97747
+ var _a;
97748
+ super.setAttrFromSpec();
97749
+ this._dataFilterEvent.setEventAttrFromSpec();
97750
+ this._field = this._spec.field;
97751
+ this._width = this._computeWidth();
97752
+ this._height = this._computeHeight();
97753
+ this._visible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
97754
+ }
97359
97755
  _setAxisFromSpec() {
97360
97756
  if (isValid$1(this._spec.axisId)) {
97361
97757
  this._relatedAxisComponent = this._option.getComponentByUserId(this._spec.axisId);
@@ -97365,7 +97761,7 @@
97365
97761
  }
97366
97762
  if (isNil$1(this._spec.field) && !this._relatedAxisComponent) {
97367
97763
  const axes = this._option.getComponentsByKey('axes');
97368
- const sameOrientAxis = axes.find((cm) => cm._orient === this._orient);
97764
+ const sameOrientAxis = axes.find((cm) => getDirectionByOrient(cm._orient) === getDirectionByOrient(this._orient));
97369
97765
  if (sameOrientAxis) {
97370
97766
  this._relatedAxisComponent = sameOrientAxis;
97371
97767
  }
@@ -97416,33 +97812,9 @@
97416
97812
  }
97417
97813
  return;
97418
97814
  }
97419
- onDataUpdate() {
97420
- var _a;
97421
- const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
97422
- this._stateScale.domain(domain, false);
97423
- this._handleChange(this._start, this._end, true);
97424
- if (this._spec.auto && !isEqual(this._domainCache, domain)) {
97425
- this._domainCache = domain;
97426
- this._dataUpdating = true;
97427
- (_a = this.getChart()) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true, null, false);
97428
- }
97429
- }
97430
- _computeDomainOfStateScale(isContinuous) {
97431
- if (this._spec.customDomain) {
97432
- return this._spec.customDomain;
97433
- }
97434
- const domain = this._data.getLatestData().map((d) => d[this._stateField]);
97435
- if (isContinuous) {
97436
- const domainNum = domain.map((n) => n * 1);
97437
- return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [-Infinity, Infinity];
97438
- }
97439
- return domain;
97440
- }
97441
- _initEvent() {
97442
- this._initCommonEvent();
97443
- }
97444
97815
  _initData() {
97445
97816
  const dataCollection = [];
97817
+ const seriesCollection = [];
97446
97818
  const stateFields = [];
97447
97819
  const valueFields = [];
97448
97820
  let isCategoryState;
@@ -97471,6 +97843,8 @@
97471
97843
  ? xAxisHelper
97472
97844
  : yAxisHelper;
97473
97845
  const valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
97846
+ const isValidateValueAxis = isContinuous(valueAxisHelper.getScale(0).type);
97847
+ const isValidateStateAxis = isContinuous(stateAxisHelper.getScale(0).type);
97474
97848
  dataCollection.push(s.getRawData());
97475
97849
  const seriesSpec = s.getSpec();
97476
97850
  const xField = s.coordinate === 'cartesian'
@@ -97481,16 +97855,17 @@
97481
97855
  : array((_b = seriesSpec.radiusField) !== null && _b !== void 0 ? _b : seriesSpec.valueField);
97482
97856
  originalStateFields[s.id] =
97483
97857
  s.type === 'link' ? ['from_xField'] : stateAxisHelper === xAxisHelper ? xField : yField;
97484
- if (isContinuous(stateAxisHelper.getScale(0).type)) {
97858
+ if (isValidateStateAxis) {
97485
97859
  isCategoryState = false;
97486
97860
  stateFields.push(originalStateFields[s.id]);
97487
97861
  }
97488
97862
  else {
97863
+ isCategoryState = true;
97489
97864
  stateFields.push(originalStateFields[s.id][0]);
97490
97865
  }
97491
97866
  if (this._valueField) {
97492
97867
  const valueField = s.type === 'link' ? ['from_yField'] : valueAxisHelper === xAxisHelper ? xField : yField;
97493
- if (isContinuous(valueAxisHelper.getScale(0).type)) {
97868
+ if (isValidateValueAxis) {
97494
97869
  valueFields.push(...valueField);
97495
97870
  }
97496
97871
  }
@@ -97503,6 +97878,7 @@
97503
97878
  else {
97504
97879
  eachSeries(this._regions, s => {
97505
97880
  dataCollection.push(s.getRawData());
97881
+ seriesCollection.push(s);
97506
97882
  stateFields.push(this._field);
97507
97883
  if (this._valueField) {
97508
97884
  valueFields.push(this._spec.valueField);
@@ -97521,6 +97897,7 @@
97521
97897
  options: {
97522
97898
  input: {
97523
97899
  dataCollection: dataCollection,
97900
+ seriesCollection,
97524
97901
  stateFields,
97525
97902
  valueFields,
97526
97903
  isCategoryState
@@ -97535,136 +97912,6 @@
97535
97912
  data.reRunAllTransform();
97536
97913
  dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChange.bind(this));
97537
97914
  }
97538
- setAttrFromSpec() {
97539
- var _a;
97540
- super.setAttrFromSpec();
97541
- if (this._spec.roamZoom === true || this._spec.roamZoom) {
97542
- this._zoomAttr = merge$1({}, this._zoomAttr, this._spec.roamZoom);
97543
- }
97544
- else {
97545
- this._zoomAttr.enable = false;
97546
- }
97547
- if (this._spec.roamDrag === true || this._spec.roamDrag) {
97548
- this._dragAttr = merge$1({}, this._dragAttr, this._spec.roamDrag);
97549
- }
97550
- else {
97551
- this._dragAttr.enable = false;
97552
- }
97553
- if (this._spec.roamScroll === true || this._spec.roamScroll) {
97554
- this._scrollAttr = merge$1({}, this._scrollAttr, this._spec.roamScroll);
97555
- }
97556
- else {
97557
- this._scrollAttr.enable = false;
97558
- }
97559
- this._field = this._spec.field;
97560
- this._width = this._computeWidth();
97561
- this._height = this._computeHeight();
97562
- this._visible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
97563
- }
97564
- statePointToData(state) {
97565
- const scale = this._stateScale;
97566
- const domain = scale.domain();
97567
- if (isContinuous(scale.type)) {
97568
- if (this._isReverse()) {
97569
- return domain[0] + (last(domain) - domain[0]) * (1 - state);
97570
- }
97571
- return domain[0] + (last(domain) - domain[0]) * state;
97572
- }
97573
- let range = scale.range();
97574
- if (this._isReverse()) {
97575
- range = range.slice().reverse();
97576
- }
97577
- const posInRange = range[0] + (last(range) - range[0]) * state;
97578
- return scale.invert(posInRange);
97579
- }
97580
- dataToStatePoint(data) {
97581
- const scale = this._stateScale;
97582
- const pos = scale.scale(data);
97583
- let range = scale.range();
97584
- if (!this._isHorizontal && isContinuous(scale.type)) {
97585
- range = range.slice().reverse();
97586
- }
97587
- return (pos - range[0]) / (last(range) - range[0]);
97588
- }
97589
- _modeCheck(statePoint, mode) {
97590
- if (statePoint === 'start') {
97591
- return (mode === 'percent' && isValid$1(this._spec.start)) || (mode === 'value' && isValid$1(this._spec.startValue));
97592
- }
97593
- return (mode === 'percent' && isValid$1(this._spec.end)) || (mode === 'value' && isValid$1(this._spec.endValue));
97594
- }
97595
- _setStateFromSpec() {
97596
- var _a, _b;
97597
- this._auto = !!this._spec.auto;
97598
- let start;
97599
- let end;
97600
- if (this._spec.rangeMode) {
97601
- const [startMode, endMode] = this._spec.rangeMode;
97602
- if (this._modeCheck('start', startMode) && this._modeCheck('end', endMode)) {
97603
- start = startMode === 'percent' ? this._spec.start : this.dataToStatePoint(this._spec.startValue);
97604
- end = endMode === 'percent' ? this._spec.end : this.dataToStatePoint(this._spec.endValue);
97605
- }
97606
- }
97607
- else {
97608
- start = this._spec.start
97609
- ? this._spec.start
97610
- : this._spec.startValue
97611
- ? this.dataToStatePoint(this._spec.startValue)
97612
- : 0;
97613
- end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
97614
- }
97615
- this._startValue = this.statePointToData(start);
97616
- this._endValue = this.statePointToData(end);
97617
- this._start = start;
97618
- this._end = end;
97619
- this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
97620
- this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
97621
- if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== last(this._stateScale.domain())) {
97622
- if (this._spec.minValueSpan) {
97623
- this._minSpan = this._spec.minValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
97624
- }
97625
- if (this._spec.maxValueSpan) {
97626
- this._maxSpan = this._spec.maxValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
97627
- }
97628
- }
97629
- this._minSpan = Math.max(0, this._minSpan);
97630
- this._maxSpan = Math.min(this._maxSpan, 1);
97631
- if ((!this._relatedAxisComponent || this._filterMode !== 'axis') && (this._start !== 0 || this._end !== 1)) {
97632
- this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
97633
- }
97634
- }
97635
- _parseFieldOfSeries(s) {
97636
- var _a;
97637
- return (_a = this._originalStateFields) === null || _a === void 0 ? void 0 : _a[s.id];
97638
- }
97639
- _initStateScale() {
97640
- const defaultRange = [0, 1];
97641
- if (this._relatedAxisComponent) {
97642
- const scale = this._relatedAxisComponent.getScale();
97643
- const isContinuousScale = isContinuous(scale.type);
97644
- const domain = this._computeDomainOfStateScale(isContinuousScale);
97645
- this._stateScale = scale.clone();
97646
- if (isContinuousScale) {
97647
- const domainNum = domain.map((n) => n * 1);
97648
- this._stateScale
97649
- .domain(domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [0, 1], true)
97650
- .range(defaultRange);
97651
- }
97652
- else {
97653
- this._stateScale.domain(domain, true).range(defaultRange);
97654
- }
97655
- }
97656
- else {
97657
- this._stateScale = new BandScale();
97658
- this._stateScale.domain(this._computeDomainOfStateScale(), true).range(defaultRange);
97659
- }
97660
- }
97661
- init(option) {
97662
- super.init(option);
97663
- this._addTransformToSeries();
97664
- if (this._start !== 0 || this._end !== 1) {
97665
- this.effect.onZoomChange();
97666
- }
97667
- }
97668
97915
  _addTransformToSeries() {
97669
97916
  if (!this._relatedAxisComponent || this._filterMode !== 'axis') {
97670
97917
  registerDataSetInstanceTransform(this._option.dataSet, 'dataFilterWithNewDomain', dataFilterWithNewDomain);
@@ -97703,59 +97950,116 @@
97703
97950
  });
97704
97951
  }
97705
97952
  }
97706
- _compareSpec(spec, prevSpec) {
97707
- const result = super._compareSpec(spec, prevSpec);
97708
- if (!result.reMake && !isEqual(prevSpec, spec)) {
97709
- result.reRender = true;
97710
- result.reMake = true;
97953
+ onDataUpdate() {
97954
+ var _a;
97955
+ const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
97956
+ this._stateScale.domain(domain, false);
97957
+ this._handleChange(this._start, this._end, true);
97958
+ if (this._spec.auto && !isEqual(this._domainCache, domain)) {
97959
+ this._domainCache = domain;
97960
+ this._dataUpdating = true;
97961
+ (_a = this.getChart()) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true, null, false);
97711
97962
  }
97712
- return result;
97713
97963
  }
97714
- reInit(spec) {
97715
- super.reInit(spec);
97716
- this._marks.forEach(g => {
97717
- g.getMarks().forEach(m => {
97718
- this.initMarkStyleWithSpec(m, this._spec[m.name]);
97719
- });
97720
- });
97964
+ _parseFieldOfSeries(s) {
97965
+ var _a;
97966
+ return (_a = this._originalStateFields) === null || _a === void 0 ? void 0 : _a[s.id];
97721
97967
  }
97722
- _parseDomainFromState(startValue, endValue) {
97723
- if (isContinuous(this._stateScale.type)) {
97724
- return [Math.min(endValue, startValue), Math.max(endValue, startValue)];
97968
+ _setStateFromSpec() {
97969
+ this._auto = !!this._spec.auto;
97970
+ let start;
97971
+ let end;
97972
+ if (this._spec.rangeMode) {
97973
+ const [startMode, endMode] = this._spec.rangeMode;
97974
+ if (modeCheck('start', startMode, this._spec) && modeCheck('end', endMode, this._spec)) {
97975
+ start =
97976
+ startMode === 'percent'
97977
+ ? this._spec.start
97978
+ : dataToStatePoint(this._spec.startValue, this._stateScale, this._isHorizontal);
97979
+ end =
97980
+ endMode === 'percent'
97981
+ ? this._spec.end
97982
+ : dataToStatePoint(this._spec.endValue, this._stateScale, this._isHorizontal);
97983
+ }
97984
+ }
97985
+ else {
97986
+ start = this._spec.start
97987
+ ? this._spec.start
97988
+ : this._spec.startValue
97989
+ ? dataToStatePoint(this._spec.startValue, this._stateScale, this._isHorizontal)
97990
+ : 0;
97991
+ end = this._spec.end
97992
+ ? this._spec.end
97993
+ : this._spec.endValue
97994
+ ? dataToStatePoint(this._spec.endValue, this._stateScale, this._isHorizontal)
97995
+ : 1;
97725
97996
  }
97726
- const allDomain = this._stateScale.domain();
97727
- const startIndex = allDomain.indexOf(startValue);
97728
- const endIndex = allDomain.indexOf(endValue);
97729
- return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
97997
+ this._start = Math.max(0, Math.min(1, start));
97998
+ this._end = Math.max(0, Math.min(1, end));
97730
97999
  }
97731
- _initCommonEvent() {
97732
- var _a, _b, _c, _d, _e, _f, _g, _h;
97733
- const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
97734
- const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? ((_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30) : 0;
97735
- const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g : true;
97736
- const option = { delayType, delayTime, realTime, allowComponentZoom: true };
97737
- if (this._zoomAttr.enable) {
97738
- this.initZoomEventOfRegions(this._regions, null, this._handleChartZoom, option);
97739
- }
97740
- if (this._scrollAttr.enable) {
97741
- this.initScrollEventOfRegions(this._regions, null, this._handleChartScroll, option);
97742
- }
97743
- if (this._dragAttr.enable) {
97744
- this.initDragEventOfRegions(this._regions, null, this._handleChartDrag, option);
97745
- }
97746
- if ((_h = this._spec.roamDrag) === null || _h === void 0 ? void 0 : _h.autoVisible) {
97747
- const dragEnd = 'panend';
97748
- this._throttledHide = throttle(() => this.hide(), 300);
97749
- this.event.on(dragEnd, () => {
97750
- this._throttledHide();
97751
- });
98000
+ _setStateFromAxis() {
98001
+ var _a, _b;
98002
+ this._setStateFromSpec();
98003
+ const axis = this._relatedAxisComponent;
98004
+ this._startValue = statePointToData(this._start, this._stateScale, isReverse(axis, this._isHorizontal));
98005
+ this._endValue = statePointToData(this._end, this._stateScale, isReverse(axis, this._isHorizontal));
98006
+ this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
98007
+ this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
98008
+ if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== last(this._stateScale.domain())) {
98009
+ if (this._spec.minValueSpan) {
98010
+ this._minSpan = this._spec.minValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
98011
+ }
98012
+ if (this._spec.maxValueSpan) {
98013
+ this._maxSpan = this._spec.maxValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
98014
+ }
98015
+ }
98016
+ this._minSpan = Math.max(0, this._minSpan);
98017
+ this._maxSpan = Math.min(this._maxSpan, 1);
98018
+ if (!axis) {
98019
+ return;
98020
+ }
98021
+ if ((!axis || this._filterMode !== 'axis') && (this._start !== 0 || this._end !== 1)) {
98022
+ this._newDomain = parseDomainFromState(this._startValue, this._endValue, this._stateScale);
97752
98023
  }
97753
98024
  }
97754
- updateLayoutAttribute() {
97755
- if (this._visible) {
97756
- this._createOrUpdateComponent();
98025
+ _initStateScale() {
98026
+ var _a, _b, _c, _d, _e, _f;
98027
+ const defaultRange = [0, 1];
98028
+ if (this._relatedAxisComponent) {
98029
+ const scale = this._relatedAxisComponent.getScale().clone();
98030
+ this._stateScale = scale;
98031
+ (_b = (_a = scale).maxBandwidth) === null || _b === void 0 ? void 0 : _b.call(_a, 'auto', true);
98032
+ (_d = (_c = scale).minBandwidth) === null || _d === void 0 ? void 0 : _d.call(_c, 'auto', true);
98033
+ (_f = (_e = scale).bandwidth) === null || _f === void 0 ? void 0 : _f.call(_e, 'auto', true);
98034
+ scale.rangeFactor(defaultRange, true).range(defaultRange);
97757
98035
  }
97758
- super.updateLayoutAttribute();
98036
+ else {
98037
+ let fieldLinear = true;
98038
+ if (this._field) {
98039
+ eachSeries(this._regions, s => {
98040
+ const stats = s.getRawDataStatisticsByField(this._field);
98041
+ if (!isValidNumber$1(stats === null || stats === void 0 ? void 0 : stats.min) || !isValidNumber$1(stats === null || stats === void 0 ? void 0 : stats.max)) {
98042
+ fieldLinear = false;
98043
+ }
98044
+ }, {
98045
+ userId: this._seriesUserId,
98046
+ specIndex: this._seriesIndex
98047
+ });
98048
+ }
98049
+ this._stateScale = fieldLinear ? new LinearScale() : new BandScale();
98050
+ this._stateScale.domain(this._computeDomainOfStateScale(fieldLinear), true).range(defaultRange);
98051
+ }
98052
+ }
98053
+ _computeDomainOfStateScale(isContinuous) {
98054
+ if (this._spec.customDomain) {
98055
+ return this._spec.customDomain;
98056
+ }
98057
+ const domain = this._data.getLatestData().map((d) => d[this._stateField]);
98058
+ if (isContinuous) {
98059
+ const domainNum = domain.map((n) => n * 1);
98060
+ return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [-Infinity, Infinity];
98061
+ }
98062
+ return domain;
97759
98063
  }
97760
98064
  _autoVisible(isShown) {
97761
98065
  if (!this._auto) {
@@ -97774,29 +98078,6 @@
97774
98078
  [sizeKey]: exports.AttributeLevel.Built_In
97775
98079
  });
97776
98080
  }
97777
- onLayoutStart(layoutRect, viewRect) {
97778
- super.onLayoutStart(layoutRect, viewRect);
97779
- const isShown = this._autoUpdate(layoutRect);
97780
- this._autoVisible(isShown);
97781
- this._dataUpdating = false;
97782
- }
97783
- onLayoutEnd() {
97784
- const isShown = !(this._start === 0 && this._end === 1);
97785
- this._autoVisible(isShown);
97786
- super.onLayoutEnd();
97787
- }
97788
- getBoundsInRect(rect) {
97789
- const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
97790
- if (this._isHorizontal) {
97791
- result.y2 = result.y1 + this._height;
97792
- result.x2 = result.x1 + rect.width;
97793
- }
97794
- else {
97795
- result.x2 = result.x1 + this._width;
97796
- result.y2 = result.y1 + rect.height;
97797
- }
97798
- return result;
97799
- }
97800
98081
  hide() {
97801
98082
  var _a;
97802
98083
  (_a = this._component) === null || _a === void 0 ? void 0 : _a.hideAll();
@@ -97805,15 +98086,6 @@
97805
98086
  var _a;
97806
98087
  (_a = this._component) === null || _a === void 0 ? void 0 : _a.showAll();
97807
98088
  }
97808
- _getAxisBandSize(axisSpec) {
97809
- const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
97810
- const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
97811
- const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
97812
- if (bandSize || minBandSize || maxBandSize) {
97813
- return { bandSize, maxBandSize, minBandSize };
97814
- }
97815
- return undefined;
97816
- }
97817
98089
  _autoUpdate(rect) {
97818
98090
  var _a, _b, _c, _d, _e, _f;
97819
98091
  if (!this._auto) {
@@ -97823,7 +98095,7 @@
97823
98095
  const axis = this._relatedAxisComponent;
97824
98096
  const axisSpec = axis === null || axis === void 0 ? void 0 : axis.getSpec();
97825
98097
  const axisScale = axis === null || axis === void 0 ? void 0 : axis.getScale();
97826
- const bandSizeResult = this._getAxisBandSize(axisSpec);
98098
+ const bandSizeResult = getAxisBandSize(axisSpec);
97827
98099
  if (!this._dataUpdating &&
97828
98100
  isDiscrete(axisScale.type) &&
97829
98101
  (rect === null || rect === void 0 ? void 0 : rect.height) === ((_a = this._cacheRect) === null || _a === void 0 ? void 0 : _a.height) &&
@@ -97870,9 +98142,6 @@
97870
98142
  _getNeedClearVRenderComponents() {
97871
98143
  return [this._component];
97872
98144
  }
97873
- clear() {
97874
- this._throttledHide = null;
97875
- }
97876
98145
  }
97877
98146
  mixin(DataFilterBaseComponent, Zoomable);
97878
98147
 
@@ -98018,14 +98287,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98018
98287
  this.layoutType = 'region-relative';
98019
98288
  this._isReverseCache = false;
98020
98289
  this._dataToPositionX = (datum) => {
98021
- const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
98290
+ const offsetLeft = !this._isHorizontal ? this._middleHandlerSize : 0;
98022
98291
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
98023
98292
  const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
98024
98293
  const xField = this._isHorizontal ? this._stateField : this._valueField;
98025
98294
  return xScale.scale(datum[xField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
98026
98295
  };
98027
98296
  this._dataToPositionX2 = (datum) => {
98028
- const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
98297
+ const offsetLeft = !this._isHorizontal ? this._middleHandlerSize : 0;
98029
98298
  const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
98030
98299
  const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
98031
98300
  const min = xScale.domain()[0];
@@ -98034,63 +98303,146 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98034
98303
  this._dataToPositionY = (datum) => {
98035
98304
  const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
98036
98305
  const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
98037
- const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
98306
+ const yScale = this._isHorizontal ? this._valueScale : this._getPreviewStateScale();
98038
98307
  const yField = this._isHorizontal ? this._valueField : this._stateField;
98039
98308
  return yScale.scale(datum[yField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
98040
98309
  };
98041
98310
  this._dataToPositionY2 = (datum) => {
98042
98311
  const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
98043
98312
  const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
98044
- const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
98313
+ const yScale = this._isHorizontal ? this._valueScale : this._getPreviewStateScale();
98045
98314
  const min = yScale.domain()[0];
98046
98315
  return yScale.scale(min) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
98047
98316
  };
98048
98317
  this._valueField = 'y';
98049
98318
  this._filterMode = (_a = spec.filterMode) !== null && _a !== void 0 ? _a : 'filter';
98050
98319
  }
98320
+ _handleChange(start, end, updateComponent, tag) {
98321
+ super._handleChange(start, end, updateComponent);
98322
+ if (this._shouldChange) {
98323
+ if (updateComponent && this._component) {
98324
+ this._component.setStartAndEnd(start, end);
98325
+ }
98326
+ else {
98327
+ const axis = this._relatedAxisComponent;
98328
+ const startValue = statePointToData(start, this._stateScale, isReverse(axis, this._isHorizontal));
98329
+ const endValue = statePointToData(end, this._stateScale, isReverse(axis, this._isHorizontal));
98330
+ if (!isValid$1(startValue) || !isValid$1(endValue)) {
98331
+ return;
98332
+ }
98333
+ this._start = start;
98334
+ this._end = end;
98335
+ const hasChange = isFunction$1(this._spec.updateDataAfterChange)
98336
+ ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
98337
+ : this._handleStateChange(startValue, endValue, tag);
98338
+ if (hasChange) {
98339
+ this.event.emit(exports.ChartEvent.dataZoomChange, {
98340
+ model: this,
98341
+ value: {
98342
+ filterData: this._filterMode !== 'axis',
98343
+ start,
98344
+ end,
98345
+ startValue: this._startValue,
98346
+ endValue: this._endValue,
98347
+ newDomain: this._newDomain
98348
+ }
98349
+ });
98350
+ }
98351
+ }
98352
+ }
98353
+ }
98354
+ _handleDataCollectionChange() {
98355
+ const data = this._data.getDataView();
98356
+ data.reRunAllTransform();
98357
+ const domain = this._computeDomainOfValueScale();
98358
+ if (domain) {
98359
+ if (!this._valueScale) {
98360
+ this._valueScale = new LinearScale();
98361
+ }
98362
+ this._valueScale.domain(domain);
98363
+ this._updateValueScaleRange();
98364
+ if (this._component) {
98365
+ this._createOrUpdateComponent(true);
98366
+ }
98367
+ }
98368
+ }
98051
98369
  created() {
98052
98370
  super.created();
98053
98371
  this._initValueScale();
98054
98372
  }
98373
+ updateLayoutAttribute() {
98374
+ if (this._cacheVisibility !== false) {
98375
+ super.updateLayoutAttribute();
98376
+ }
98377
+ }
98378
+ _beforeLayoutEnd() {
98379
+ super._beforeLayoutEnd();
98380
+ const axis = this._relatedAxisComponent;
98381
+ if ((isReverse(axis, this._isHorizontal) && !this._isReverseCache) || this._auto) {
98382
+ this._isReverseCache = isReverse(axis, this._isHorizontal);
98383
+ this.effect.onZoomChange();
98384
+ }
98385
+ }
98386
+ clear() {
98387
+ if (this._component) {
98388
+ const container = this.getContainer();
98389
+ this._component.removeAllChild();
98390
+ if (container) {
98391
+ container.removeChild(this._component);
98392
+ }
98393
+ this._component = null;
98394
+ }
98395
+ super.clear();
98396
+ }
98397
+ getBoundsInRect(rect) {
98398
+ var _a, _b, _c, _d;
98399
+ const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
98400
+ const startHandlerScaleXSize = this._startHandlerSize * ((_a = this._spec.startHandler.style.scaleX) !== null && _a !== void 0 ? _a : 1);
98401
+ const startHandlerScaleYSize = this._startHandlerSize * ((_b = this._spec.startHandler.style.scaleY) !== null && _b !== void 0 ? _b : 1);
98402
+ const endHandlerScaleXSize = this._endHandlerSize * ((_c = this._spec.endHandler.style.scaleX) !== null && _c !== void 0 ? _c : 1);
98403
+ const endHandlerScaleYSize = this._endHandlerSize * ((_d = this._spec.endHandler.style.scaleY) !== null && _d !== void 0 ? _d : 1);
98404
+ const extendWidth = !this._visible
98405
+ ? 0
98406
+ : this._isHorizontal
98407
+ ? (startHandlerScaleXSize - this._startHandlerSize) / 2 + (endHandlerScaleXSize - this._endHandlerSize) / 2
98408
+ : (Math.max(startHandlerScaleXSize, endHandlerScaleXSize) - this._width) / 2;
98409
+ const extendHeight = !this._visible
98410
+ ? 0
98411
+ : this._isHorizontal
98412
+ ? (Math.max(startHandlerScaleYSize, endHandlerScaleYSize) - this._height) / 2
98413
+ : (startHandlerScaleYSize - this._startHandlerSize) / 2 + (endHandlerScaleYSize - this._endHandlerSize) / 2;
98414
+ if (this._isHorizontal) {
98415
+ result.y2 = result.y1 + this._height + extendHeight;
98416
+ result.x2 = result.x1 + rect.width + extendWidth;
98417
+ }
98418
+ else {
98419
+ result.x2 = result.x1 + this._width + extendWidth;
98420
+ result.y2 = result.y1 + rect.height + extendHeight;
98421
+ }
98422
+ return result;
98423
+ }
98055
98424
  setAttrFromSpec() {
98056
98425
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
98057
98426
  super.setAttrFromSpec();
98058
- if (isBoolean$1(this._spec.roam)) {
98059
- this._zoomAttr.enable = this._spec.roam;
98060
- this._dragAttr.enable = this._spec.roam;
98061
- this._scrollAttr.enable = this._spec.roam;
98062
- }
98063
- if (this._zoomAttr.enable || this._dragAttr.enable || this._scrollAttr.enable) {
98064
- this.initZoomable(this.event, this._option.mode);
98065
- }
98427
+ const componentSize = this._isHorizontal ? Number(this._spec.height) : Number(this._spec.width);
98066
98428
  this._backgroundSize = (_b = (_a = this._spec.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 30;
98067
98429
  this._middleHandlerSize = this._computeMiddleHandlerSize();
98068
- this._width = this._computeWidth();
98069
- this._height = this._computeHeight();
98070
98430
  if (isNil$1((_e = (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.startHandler) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.size)) {
98071
- this._spec.startHandler.style.size = this._isHorizontal
98072
- ? this._height - this._middleHandlerSize
98073
- : this._width - this._middleHandlerSize;
98431
+ this._spec.startHandler.style.size = isNaN(componentSize)
98432
+ ? this._backgroundSize
98433
+ : componentSize - this._middleHandlerSize;
98074
98434
  }
98075
98435
  if (isNil$1((_h = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.endHandler) === null || _g === void 0 ? void 0 : _g.style) === null || _h === void 0 ? void 0 : _h.size)) {
98076
- this._spec.endHandler.style.size = this._isHorizontal
98077
- ? this._height - this._middleHandlerSize
98078
- : this._width - this._middleHandlerSize;
98079
- }
98080
- const startHandlerVisble = (_j = this._spec.startHandler.style.visible) !== null && _j !== void 0 ? _j : true;
98081
- const endHandlerVisble = (_k = this._spec.endHandler.style.visible) !== null && _k !== void 0 ? _k : true;
98082
- this._startHandlerSize = startHandlerVisble ? this._spec.startHandler.style.size : 0;
98083
- this._endHandlerSize = endHandlerVisble ? this._spec.endHandler.style.size : 0;
98084
- }
98085
- onLayoutEnd() {
98086
- this._updateScaleRange();
98087
- if (this._isReverse() && !this._isReverseCache) {
98088
- this._isReverseCache = this._isReverse();
98089
- this.effect.onZoomChange();
98090
- }
98091
- if (this._cacheVisibility !== false) {
98092
- super.onLayoutEnd();
98093
- }
98436
+ this._spec.endHandler.style.size = isNaN(componentSize)
98437
+ ? this._backgroundSize
98438
+ : componentSize - this._middleHandlerSize;
98439
+ }
98440
+ const startHandlerVisible = (_j = this._spec.startHandler.style.visible) !== null && _j !== void 0 ? _j : true;
98441
+ const endHandlerVisible = (_k = this._spec.endHandler.style.visible) !== null && _k !== void 0 ? _k : true;
98442
+ this._startHandlerSize = startHandlerVisible ? this._spec.startHandler.style.size : 0;
98443
+ this._endHandlerSize = endHandlerVisible ? this._spec.endHandler.style.size : 0;
98444
+ this._width = this._computeWidth();
98445
+ this._height = this._computeHeight();
98094
98446
  }
98095
98447
  _initValueScale() {
98096
98448
  const domain = this._computeDomainOfValueScale();
@@ -98101,9 +98453,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98101
98453
  }
98102
98454
  }
98103
98455
  _updateScaleRange() {
98104
- var _a, _b;
98456
+ this._updateStateScaleRange();
98457
+ this._updateValueScaleRange();
98458
+ }
98459
+ _updateStateScaleRange() {
98460
+ var _a, _b, _c;
98105
98461
  const handlerSize = this._startHandlerSize + this._endHandlerSize;
98106
- if (!this._stateScale || !this._valueScale) {
98462
+ if (!this._stateScale) {
98107
98463
  return;
98108
98464
  }
98109
98465
  let stateScaleRange;
@@ -98120,14 +98476,27 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98120
98476
  stateScaleRange = this._visible
98121
98477
  ? [this._startHandlerSize / 2, compWidth - handlerSize + this._startHandlerSize / 2]
98122
98478
  : defaultRange;
98123
- this._stateScale.range(stateScaleRange);
98124
- this._valueScale.range([compHeight - this._middleHandlerSize, 0]);
98125
98479
  }
98126
98480
  else {
98127
98481
  stateScaleRange = this._visible
98128
98482
  ? [this._startHandlerSize / 2, compHeight - handlerSize + this._startHandlerSize / 2]
98129
98483
  : defaultRange;
98130
- this._stateScale.range(stateScaleRange);
98484
+ }
98485
+ this._stateScale.range(stateScaleRange);
98486
+ (_c = this._previewStateScale) === null || _c === void 0 ? void 0 : _c.range(isReverse(this._relatedAxisComponent, this._isHorizontal)
98487
+ ? stateScaleRange.reverse()
98488
+ : stateScaleRange);
98489
+ }
98490
+ _updateValueScaleRange() {
98491
+ if (!this._valueScale) {
98492
+ return;
98493
+ }
98494
+ const compWidth = this._computeWidth();
98495
+ const compHeight = this._computeHeight();
98496
+ if (this._isHorizontal) {
98497
+ this._valueScale.range([compHeight - this._middleHandlerSize, 0]);
98498
+ }
98499
+ else {
98131
98500
  if (this.layoutOrient === 'left') {
98132
98501
  this._valueScale.range([compWidth - this._middleHandlerSize, 0]);
98133
98502
  }
@@ -98135,24 +98504,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98135
98504
  this._valueScale.range([0, compWidth - this._middleHandlerSize]);
98136
98505
  }
98137
98506
  }
98138
- if (this._component && this._cacheVisibility !== false) {
98139
- this._component.setAttributes({
98140
- size: {
98141
- width: compWidth,
98142
- height: compHeight
98143
- },
98144
- position: {
98145
- x: this.getLayoutStartPoint().x,
98146
- y: this.getLayoutStartPoint().y
98147
- }
98148
- });
98149
- }
98150
98507
  }
98151
98508
  _computeDomainOfValueScale() {
98152
98509
  const domain = this._data.getLatestData().map((d) => d[this._valueField]);
98153
98510
  const domainNum = domain.map((n) => n * 1);
98154
98511
  return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : null;
98155
98512
  }
98513
+ _isScaleValid(scale) {
98514
+ if (!scale || !scale.domain()) {
98515
+ return false;
98516
+ }
98517
+ const domain = scale.domain();
98518
+ if (isContinuous(scale.type) && domain[0] === last(domain)) {
98519
+ return false;
98520
+ }
98521
+ if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
98522
+ return false;
98523
+ }
98524
+ return true;
98525
+ }
98526
+ _getXScale() {
98527
+ const bindScale = this._relatedAxisComponent.getScale();
98528
+ if (bindScale.type === this.stateScale.type && this._isHorizontal) {
98529
+ return this.stateScale;
98530
+ }
98531
+ return this._isHorizontal ? this._stateScale : this._valueScale;
98532
+ }
98533
+ _getYScale() {
98534
+ return this._isHorizontal ? this._valueScale : this._stateScale;
98535
+ }
98156
98536
  _computeMiddleHandlerSize() {
98157
98537
  var _a, _b, _c, _d;
98158
98538
  let size = 0;
@@ -98173,7 +98553,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98173
98553
  if (this._isHorizontal) {
98174
98554
  return this.getLayoutRect().width;
98175
98555
  }
98176
- return this._backgroundSize + this._middleHandlerSize;
98556
+ return (Math.max(this._startHandlerSize || 0, this._endHandlerSize || 0, this._backgroundSize || 0) +
98557
+ this._middleHandlerSize);
98177
98558
  }
98178
98559
  _computeHeight() {
98179
98560
  if (this._visible === false) {
@@ -98183,23 +98564,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98183
98564
  return this._spec.height;
98184
98565
  }
98185
98566
  if (this._isHorizontal) {
98186
- return this._backgroundSize + this._middleHandlerSize;
98567
+ return (Math.max(this._startHandlerSize || 0, this._endHandlerSize || 0, this._backgroundSize || 0) +
98568
+ this._middleHandlerSize);
98187
98569
  }
98188
98570
  return this.getLayoutRect().height;
98189
98571
  }
98190
- _isScaleValid(scale) {
98191
- if (!scale || !scale.domain()) {
98192
- return false;
98193
- }
98194
- const domain = scale.domain();
98195
- if (isContinuous(scale.type) && domain[0] === last(domain)) {
98196
- return false;
98197
- }
98198
- if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
98199
- return false;
98200
- }
98201
- return true;
98202
- }
98203
98572
  _getAttrs(isNeedPreview) {
98204
98573
  var _a, _b, _c, _d, _e;
98205
98574
  const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : {};
@@ -98209,73 +98578,58 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98209
98578
  }, orient: this._orient, size: {
98210
98579
  width: this._computeWidth(),
98211
98580
  height: this._computeHeight()
98212
- }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs(isNeedPreview));
98581
+ }, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? ((_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30) : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance, isReverse: isReverse(this._relatedAxisComponent, this._isHorizontal) }, this._getComponentAttrs(isNeedPreview));
98213
98582
  }
98214
- _createOrUpdateComponent() {
98583
+ _getLayoutAttrs() {
98584
+ return {
98585
+ position: {
98586
+ x: this.getLayoutStartPoint().x,
98587
+ y: this.getLayoutStartPoint().y
98588
+ },
98589
+ size: {
98590
+ width: this._computeWidth(),
98591
+ height: this._computeHeight()
98592
+ }
98593
+ };
98594
+ }
98595
+ _createOrUpdateComponent(changeData) {
98215
98596
  if (this._visible) {
98216
98597
  const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
98217
98598
  const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
98218
98599
  const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
98219
98600
  const attrs = this._getAttrs(isNeedPreview);
98601
+ const axis = this._relatedAxisComponent;
98220
98602
  if (this._component) {
98221
98603
  this._component.setAttributes(attrs);
98604
+ if (changeData) {
98605
+ this._component.setPreviewData(this._data.getDataView().latestData);
98606
+ if (isNeedPreview) {
98607
+ if (this._isHorizontal) {
98608
+ this._component.setPreviewPointsY1(this._dataToPositionY2);
98609
+ }
98610
+ else {
98611
+ this._component.setPreviewPointsX1(this._dataToPositionX2);
98612
+ }
98613
+ this._component.setStatePointToData((state) => statePointToData(state, this._stateScale, isReverse(axis, this._isHorizontal)));
98614
+ }
98615
+ }
98222
98616
  }
98223
98617
  else {
98224
98618
  const container = this.getContainer();
98225
98619
  this._component = new DataZoom$1(attrs);
98620
+ this._component.setPreviewData(this._data.getDataView().latestData);
98226
98621
  if (this._isHorizontal) {
98227
98622
  isNeedPreview && this._component.setPreviewPointsY1(this._dataToPositionY2);
98228
98623
  }
98229
98624
  else {
98230
98625
  isNeedPreview && this._component.setPreviewPointsX1(this._dataToPositionX2);
98231
98626
  }
98232
- this._component.setStatePointToData((state) => this.statePointToData(state));
98233
- this._component.addEventListener('change', (e) => {
98627
+ this._component.setStatePointToData((state) => statePointToData(state, this._stateScale, isReverse(axis, this._isHorizontal)));
98628
+ this._component.addEventListener('dataZoomChange', (e) => {
98234
98629
  const { start, end, tag } = e.detail;
98235
98630
  this._handleChange(start, end, undefined, tag);
98236
98631
  });
98237
98632
  container.add(this._component);
98238
- this._updateScaleRange();
98239
- }
98240
- }
98241
- }
98242
- _handleChange(start, end, updateComponent, tag) {
98243
- super._handleChange(start, end, updateComponent);
98244
- if (this._shouldChange) {
98245
- if (updateComponent && this._component) {
98246
- this._component.setStartAndEnd(start, end);
98247
- }
98248
- this._start = start;
98249
- this._end = end;
98250
- const startValue = this.statePointToData(start);
98251
- const endValue = this.statePointToData(end);
98252
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
98253
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
98254
- : this._handleStateChange(startValue, endValue, tag);
98255
- if (hasChange) {
98256
- this.event.emit(exports.ChartEvent.dataZoomChange, {
98257
- model: this,
98258
- value: {
98259
- filterData: this._filterMode !== 'axis',
98260
- start,
98261
- end,
98262
- startValue: this._startValue,
98263
- endValue: this._endValue,
98264
- newDomain: this._newDomain
98265
- }
98266
- });
98267
- }
98268
- }
98269
- }
98270
- _handleDataCollectionChange() {
98271
- var _a;
98272
- const data = this._data.getDataView();
98273
- data.reRunAllTransform();
98274
- (_a = this._component) === null || _a === void 0 ? void 0 : _a.setPreviewData(data.latestData);
98275
- if (this._valueScale) {
98276
- const domain = this._computeDomainOfValueScale();
98277
- if (domain) {
98278
- this._valueScale.domain(domain);
98279
98633
  }
98280
98634
  }
98281
98635
  }
@@ -98337,16 +98691,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98337
98691
  _getNeedClearVRenderComponents() {
98338
98692
  return [this._component];
98339
98693
  }
98340
- clear() {
98341
- if (this._component) {
98342
- const container = this.getContainer();
98343
- this._component.removeAllChild();
98344
- if (container) {
98345
- container.removeChild(this._component);
98694
+ onDataUpdate() {
98695
+ super.onDataUpdate();
98696
+ if (this._previewStateScale !== this._stateScale) {
98697
+ this._previewStateScale = null;
98698
+ }
98699
+ }
98700
+ _getPreviewStateScale() {
98701
+ if (!this._previewStateScale) {
98702
+ if (isReverse(this._relatedAxisComponent, this._isHorizontal)) {
98703
+ this._previewStateScale = this._stateScale.clone();
98704
+ this._previewStateScale.range(this._stateScale.range().reverse());
98705
+ }
98706
+ else {
98707
+ this._previewStateScale = this._stateScale;
98346
98708
  }
98347
- this._component = null;
98348
98709
  }
98349
- super.clear();
98710
+ return this._previewStateScale;
98350
98711
  }
98351
98712
  }
98352
98713
  DataZoom.type = ComponentTypeEnum.dataZoom;
@@ -98391,24 +98752,53 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98391
98752
  this.layoutType = 'region-relative';
98392
98753
  this._filterMode = (_a = spec.filterMode) !== null && _a !== void 0 ? _a : 'axis';
98393
98754
  }
98394
- setAttrFromSpec() {
98395
- super.setAttrFromSpec();
98396
- if (isBoolean$1(this._spec.roam)) {
98397
- this._zoomAttr.enable = false;
98398
- this._dragAttr.enable = this._spec.roam;
98399
- this._scrollAttr.enable = this._spec.roam;
98755
+ _handleChange(start, end, updateComponent) {
98756
+ super._handleChange(start, end, updateComponent);
98757
+ const isSameScrollValue = isClose(this._start, start) && isClose(this._end, end);
98758
+ if (this._shouldChange && (!isSameScrollValue || this._spec.realTime === false)) {
98759
+ if (updateComponent && this._component) {
98760
+ this._component.setAttribute('range', [start, end]);
98761
+ }
98762
+ this._start = start;
98763
+ this._end = end;
98764
+ const startValue = statePointToData(start, this._stateScale, false);
98765
+ const endValue = statePointToData(end, this._stateScale, false);
98766
+ const hasChange = isFunction$1(this._spec.updateDataAfterChange)
98767
+ ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
98768
+ : this._handleStateChange(startValue, endValue);
98769
+ if (hasChange) {
98770
+ this.event.emit(exports.ChartEvent.scrollBarChange, {
98771
+ model: this,
98772
+ value: {
98773
+ filterData: this._filterMode !== 'axis',
98774
+ start: this._start,
98775
+ end: this._end,
98776
+ startValue: this._startValue,
98777
+ endValue: this._endValue,
98778
+ newDomain: this._newDomain
98779
+ }
98780
+ });
98781
+ }
98400
98782
  }
98401
- if (this._zoomAttr.enable || this._dragAttr.enable || this._scrollAttr.enable) {
98402
- this.initZoomable(this.event, this._option.mode);
98783
+ }
98784
+ _handleDataCollectionChange() {
98785
+ if (this._spec.auto) {
98786
+ const data = this._data.getDataView();
98787
+ data.reRunAllTransform();
98403
98788
  }
98404
98789
  }
98405
- onLayoutEnd() {
98790
+ _beforeLayoutEnd() {
98406
98791
  var _a, _b;
98407
- this._updateScaleRange();
98792
+ super._beforeLayoutEnd();
98408
98793
  (_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a);
98794
+ }
98795
+ onLayoutEnd() {
98796
+ this._updateComponentBounds();
98409
98797
  super.onLayoutEnd();
98410
98798
  }
98411
98799
  _updateScaleRange() {
98800
+ }
98801
+ _updateComponentBounds() {
98412
98802
  if (this._component) {
98413
98803
  this._component.setAttributes({
98414
98804
  x: this.getLayoutStartPoint().x,
@@ -98419,6 +98809,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98419
98809
  }
98420
98810
  }
98421
98811
  _computeWidth() {
98812
+ if (this._visible === false) {
98813
+ return 0;
98814
+ }
98422
98815
  if (isNumber$1(this._spec.width)) {
98423
98816
  return this._spec.width;
98424
98817
  }
@@ -98428,6 +98821,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98428
98821
  return SCROLL_BAR_DEFAULT_SIZE;
98429
98822
  }
98430
98823
  _computeHeight() {
98824
+ if (this._visible === false) {
98825
+ return 0;
98826
+ }
98431
98827
  if (isNumber$1(this._spec.height)) {
98432
98828
  return this._spec.height;
98433
98829
  }
@@ -98438,7 +98834,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98438
98834
  }
98439
98835
  _getAttrs() {
98440
98836
  var _a, _b, _c, _d, _e, _f;
98441
- return Object.assign({ zIndex: this.layoutZIndex, x: this.getLayoutStartPoint().x, y: this.getLayoutStartPoint().y, width: this.getLayoutRect().width, height: this.getLayoutRect().height, range: [this._start, this._end], direction: this._isHorizontal ? 'horizontal' : 'vertical', delayType: (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType, delayTime: isValid$1((_b = this._spec) === null || _b === void 0 ? void 0 : _b.delayType) ? (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_f = (_e = this._spec) === null || _e === void 0 ? void 0 : _e.realTime) !== null && _f !== void 0 ? _f : true }, this._getComponentAttrs());
98837
+ return Object.assign({ zIndex: this.layoutZIndex, x: this.getLayoutStartPoint().x, y: this.getLayoutStartPoint().y, width: this.getLayoutRect().width, height: this.getLayoutRect().height, range: [this._start, this._end], direction: this._isHorizontal ? 'horizontal' : 'vertical', delayType: (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType, delayTime: isValid$1((_b = this._spec) === null || _b === void 0 ? void 0 : _b.delayType) ? ((_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayTime) !== null && _d !== void 0 ? _d : 30) : 0, realTime: (_f = (_e = this._spec) === null || _e === void 0 ? void 0 : _e.realTime) !== null && _f !== void 0 ? _f : true }, this._getComponentAttrs());
98442
98838
  }
98443
98839
  _createOrUpdateComponent() {
98444
98840
  const attrs = this._getAttrs();
@@ -98459,41 +98855,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98459
98855
  container.add(this._component);
98460
98856
  }
98461
98857
  }
98462
- _handleChange(start, end, updateComponent) {
98463
- super._handleChange(start, end, updateComponent);
98464
- const isSameScrollValue = isClose(this._start, start) && isClose(this._end, end);
98465
- if (this._shouldChange && (!isSameScrollValue || this._spec.realTime === false)) {
98466
- if (updateComponent && this._component) {
98467
- this._component.setAttribute('range', [start, end]);
98468
- }
98469
- this._start = start;
98470
- this._end = end;
98471
- const startValue = this.statePointToData(start);
98472
- const endValue = this.statePointToData(end);
98473
- const hasChange = isFunction$1(this._spec.updateDataAfterChange)
98474
- ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
98475
- : this._handleStateChange(this.statePointToData(start), this.statePointToData(end));
98476
- if (hasChange) {
98477
- this.event.emit(exports.ChartEvent.scrollBarChange, {
98478
- model: this,
98479
- value: {
98480
- filterData: this._filterMode !== 'axis',
98481
- start: this._start,
98482
- end: this._end,
98483
- startValue: this._startValue,
98484
- endValue: this._endValue,
98485
- newDomain: this._newDomain
98486
- }
98487
- });
98488
- }
98489
- }
98490
- }
98491
- _handleDataCollectionChange() {
98492
- if (this._spec.auto) {
98493
- const data = this._data.getDataView();
98494
- data.reRunAllTransform();
98495
- }
98496
- }
98497
98858
  _getComponentAttrs() {
98498
98859
  const { rail, slider, innerPadding } = this._spec;
98499
98860
  const attrs = {};
@@ -98850,7 +99211,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98850
99211
  const lines = [];
98851
99212
  const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
98852
99213
  const xAxisHelper = relativeSeries.getXAxisHelper();
98853
- const yAxisHelper = relativeSeries.getXAxisHelper();
99214
+ const yAxisHelper = relativeSeries.getYAxisHelper();
98854
99215
  const xDomain = xAxisHelper.getScale(0).domain();
98855
99216
  const yDomain = yAxisHelper.getScale(0).domain();
98856
99217
  const isXExpand = includeFullBand && !xAxisHelper.isContinuous && !!xAxisHelper.getBandwidth;
@@ -102629,17 +102990,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102629
102990
  const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
102630
102991
  const { x1, x2, y1, y2 } = operateMaskBounds;
102631
102992
  const regionStartAttr = isHorizontal ? 'x' : 'y';
102993
+ const regionSizeAttr = isHorizontal ? 'width' : 'height';
102632
102994
  const boundsStart = isHorizontal ? x1 : y1;
102633
102995
  const boundsEnd = isHorizontal ? x2 : y2;
102634
102996
  if (this._axisDataZoomMap[axis.id]) {
102635
102997
  const dataZoom = this._axisDataZoomMap[axis.id];
102636
- const releatedAxis = dataZoom.relatedAxisComponent;
102637
- const startValue = releatedAxis
102638
- .getScale()
102639
- .invert(boundsStart - region.getLayoutStartPoint()[regionStartAttr]);
102640
- const endValue = releatedAxis.getScale().invert(boundsEnd - region.getLayoutStartPoint()[regionStartAttr]);
102641
- const startPercent = dataZoom.dataToStatePoint(startValue);
102642
- const endPercent = dataZoom.dataToStatePoint(endValue);
102998
+ const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
102999
+ const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
102643
103000
  const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
102644
103001
  const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
102645
103002
  dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
@@ -102650,8 +103007,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102650
103007
  operateComponent: dataZoom,
102651
103008
  start: newStartPercent,
102652
103009
  end: newEndPercent,
102653
- startValue: dataZoom.statePointToData(newStartPercent),
102654
- endValue: dataZoom.statePointToData(newEndPercent)
103010
+ startValue: statePointToData(newStartPercent, dataZoom.stateScale, isReverse(dataZoom.relatedAxisComponent, dataZoom.isHorizontal)),
103011
+ endValue: statePointToData(newEndPercent, dataZoom.stateScale, isReverse(dataZoom.relatedAxisComponent, dataZoom.isHorizontal))
102655
103012
  });
102656
103013
  }
102657
103014
  else {
@@ -102791,10 +103148,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
102791
103148
  if (isValid$1(spec.dataId) || isValidNumber$1(spec.dataIndex)) {
102792
103149
  const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
102793
103150
  if (dataview) {
103151
+ mark.setDataView(dataview);
102794
103152
  dataview.target.addListener('change', () => {
102795
103153
  mark.getData().updateData();
102796
103154
  });
102797
- mark.setDataView(dataview);
102798
103155
  }
102799
103156
  }
102800
103157
  }