@visactor/vchart 2.0.20-alpha.3 → 2.0.20-alpha.5

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 (72) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +68 -53
  3. package/build/index.js +68 -53
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/component/brush/brush.js +12 -15
  7. package/cjs/component/brush/brush.js.map +1 -1
  8. package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -2
  9. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  10. package/cjs/constant/funnel.js +1 -1
  11. package/cjs/constant/gradient.js +1 -1
  12. package/cjs/constant/hierarchy.js +1 -1
  13. package/cjs/constant/label.js +1 -1
  14. package/cjs/constant/layout.js +1 -1
  15. package/cjs/constant/marker.js +1 -1
  16. package/cjs/constant/polar.js +1 -1
  17. package/cjs/constant/scatter.js +1 -1
  18. package/cjs/constant/scroll-bar.js +1 -2
  19. package/cjs/constant/sunburst.js +1 -1
  20. package/cjs/constant/waterfall.js +1 -1
  21. package/cjs/constant/word-cloud.js +1 -1
  22. package/cjs/core/interface.js +1 -1
  23. package/cjs/core/util.js +1 -1
  24. package/cjs/core/vchart.js +1 -1
  25. package/cjs/data/initialize.js +1 -1
  26. package/cjs/data/register.js +1 -1
  27. package/cjs/env/env.js +1 -1
  28. package/cjs/env/index.js +1 -1
  29. package/cjs/event/bubble.js +1 -1
  30. package/cjs/event/event-dispatcher.js +1 -1
  31. package/cjs/event/event.js +1 -1
  32. package/cjs/event/index.js +1 -1
  33. package/cjs/event/interface.js +2 -1
  34. package/cjs/mark/base/base-mark.js.map +1 -1
  35. package/cjs/series/base/base-series.js.map +1 -1
  36. package/cjs/series/pie/pie.d.ts +0 -2
  37. package/cjs/series/pie/pie.js +4 -6
  38. package/cjs/series/pie/pie.js.map +1 -1
  39. package/esm/component/brush/brush.js +9 -12
  40. package/esm/component/brush/brush.js.map +1 -1
  41. package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -2
  42. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  43. package/esm/constant/funnel.js +1 -1
  44. package/esm/constant/gradient.js +1 -1
  45. package/esm/constant/hierarchy.js +1 -1
  46. package/esm/constant/label.js +1 -1
  47. package/esm/constant/layout.js +1 -1
  48. package/esm/constant/marker.js +1 -1
  49. package/esm/constant/polar.js +1 -1
  50. package/esm/constant/scatter.js +1 -1
  51. package/esm/constant/scroll-bar.js +1 -2
  52. package/esm/constant/sunburst.js +1 -1
  53. package/esm/constant/waterfall.js +1 -1
  54. package/esm/constant/word-cloud.js +1 -1
  55. package/esm/core/interface.js +1 -1
  56. package/esm/core/util.js +1 -1
  57. package/esm/core/vchart.js +1 -1
  58. package/esm/data/initialize.js +1 -1
  59. package/esm/data/register.js +1 -1
  60. package/esm/env/env.js +1 -1
  61. package/esm/env/index.js +1 -1
  62. package/esm/event/bubble.js +1 -1
  63. package/esm/event/event-dispatcher.js +1 -1
  64. package/esm/event/event.js +1 -1
  65. package/esm/event/index.js +1 -1
  66. package/esm/event/interface.js +2 -1
  67. package/esm/mark/base/base-mark.js.map +1 -1
  68. package/esm/series/base/base-series.js.map +1 -1
  69. package/esm/series/pie/pie.d.ts +0 -2
  70. package/esm/series/pie/pie.js +4 -7
  71. package/esm/series/pie/pie.js.map +1 -1
  72. package/package.json +9 -9
package/build/index.es.js CHANGED
@@ -45474,6 +45474,16 @@ const DEFAULT_HANDLER_ATTR_MAP = {
45474
45474
  strokeBoundsBuffer: 0
45475
45475
  }
45476
45476
  };
45477
+ const LAYOUT_LEVEL = {
45478
+ background: 0,
45479
+ preview: 1,
45480
+ dragMask: 2,
45481
+ selectedBackground: 3,
45482
+ selectedPreview: 4,
45483
+ handler: 5,
45484
+ handlerText: 5,
45485
+ handlerMask: 999
45486
+ };
45477
45487
 
45478
45488
  const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
45479
45489
  if (!textBounds) return !1;
@@ -45604,12 +45614,14 @@ class DataZoomRenderer {
45604
45614
  x: position.x + start * width,
45605
45615
  y: position.y,
45606
45616
  width: (end - start) * width,
45607
- height: height
45617
+ height: height,
45618
+ zIndex: LAYOUT_LEVEL.dragMask
45608
45619
  }, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
45609
45620
  x: position.x,
45610
45621
  y: position.y + start * height,
45611
45622
  width: width,
45612
- height: (end - start) * height
45623
+ height: (end - start) * height,
45624
+ zIndex: LAYOUT_LEVEL.dragMask
45613
45625
  }, dragMaskStyle), "rect"), {
45614
45626
  start: start,
45615
45627
  end: end
@@ -45633,7 +45645,8 @@ class DataZoomRenderer {
45633
45645
  y: position.y,
45634
45646
  width: width,
45635
45647
  height: height,
45636
- cursor: brushSelect ? "crosshair" : "auto"
45648
+ cursor: brushSelect ? "crosshair" : "auto",
45649
+ zIndex: LAYOUT_LEVEL.background
45637
45650
  }, backgroundStyle), {
45638
45651
  pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
45639
45652
  }), "rect");
@@ -45666,7 +45679,8 @@ class DataZoomRenderer {
45666
45679
  x: position.x + start * width,
45667
45680
  y: position.y - middleHandlerBackgroundSize,
45668
45681
  width: (end - start) * width,
45669
- height: middleHandlerBackgroundSize
45682
+ height: middleHandlerBackgroundSize,
45683
+ zIndex: LAYOUT_LEVEL.handler
45670
45684
  }, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
45671
45685
  pickable: !zoomLock && (null === (_g = null === (_f = null === (_e = middleHandlerStyle.background) || void 0 === _e ? void 0 : _e.style) || void 0 === _f ? void 0 : _f.pickable) || void 0 === _g || _g)
45672
45686
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -45674,24 +45688,29 @@ class DataZoomRenderer {
45674
45688
  y: position.y - middleHandlerBackgroundSize / 2,
45675
45689
  strokeBoundsBuffer: 0,
45676
45690
  angle: 0,
45677
- symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
45691
+ symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square",
45692
+ zIndex: LAYOUT_LEVEL.handler
45678
45693
  }, middleHandlerStyle.icon), {
45679
45694
  pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
45680
45695
  }), "symbol");
45681
45696
  }
45682
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
45697
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45683
45698
  x: position.x + start * width,
45684
45699
  y: position.y + height / 2,
45685
45700
  size: height,
45686
45701
  symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
45687
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
45702
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45703
+ zIndex: LAYOUT_LEVEL.handler
45704
+ }), startHandlerStyle), {
45688
45705
  pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
45689
- }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
45706
+ }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45690
45707
  x: position.x + end * width,
45691
45708
  y: position.y + height / 2,
45692
45709
  size: height,
45693
45710
  symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
45694
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
45711
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45712
+ zIndex: LAYOUT_LEVEL.handler
45713
+ }), endHandlerStyle), {
45695
45714
  pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
45696
45715
  }), "symbol");
45697
45716
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
@@ -45705,7 +45724,7 @@ class DataZoomRenderer {
45705
45724
  height: startHandlerHeight,
45706
45725
  fill: "white",
45707
45726
  fillOpacity: 0,
45708
- zIndex: 999
45727
+ zIndex: LAYOUT_LEVEL.handlerMask
45709
45728
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45710
45729
  pickable: !zoomLock
45711
45730
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -45715,7 +45734,7 @@ class DataZoomRenderer {
45715
45734
  height: endHandlerHeight,
45716
45735
  fill: "white",
45717
45736
  fillOpacity: 0,
45718
- zIndex: 999
45737
+ zIndex: LAYOUT_LEVEL.handlerMask
45719
45738
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45720
45739
  pickable: !zoomLock
45721
45740
  }), "rect");
@@ -45726,7 +45745,8 @@ class DataZoomRenderer {
45726
45745
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
45727
45746
  y: position.y + start * height,
45728
45747
  width: middleHandlerBackgroundSize,
45729
- height: (end - start) * height
45748
+ height: (end - start) * height,
45749
+ zIndex: LAYOUT_LEVEL.handler
45730
45750
  }, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
45731
45751
  pickable: !zoomLock && (null === (_u = null === (_t = null === (_s = middleHandlerStyle.background) || void 0 === _s ? void 0 : _s.style) || void 0 === _t ? void 0 : _t.pickable) || void 0 === _u || _u)
45732
45752
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -45734,23 +45754,27 @@ class DataZoomRenderer {
45734
45754
  y: position.y + (start + end) / 2 * height,
45735
45755
  angle: Math.PI / 180 * 90,
45736
45756
  symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
45737
- strokeBoundsBuffer: 0
45757
+ strokeBoundsBuffer: 0,
45758
+ zIndex: LAYOUT_LEVEL.handler
45738
45759
  }, middleHandlerStyle.icon), {
45739
45760
  pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
45740
45761
  }), "symbol");
45741
45762
  }
45742
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
45763
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45743
45764
  x: position.x + width / 2,
45744
45765
  y: position.y + start * height,
45745
45766
  size: width,
45746
45767
  symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
45747
- }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
45768
+ }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45769
+ zIndex: LAYOUT_LEVEL.handler
45770
+ }), startHandlerStyle), {
45748
45771
  pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
45749
45772
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
45750
45773
  x: position.x + width / 2,
45751
45774
  y: position.y + end * height,
45752
45775
  size: width,
45753
- symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
45776
+ symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square",
45777
+ zIndex: LAYOUT_LEVEL.handler
45754
45778
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
45755
45779
  pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
45756
45780
  }), "symbol");
@@ -45765,7 +45789,7 @@ class DataZoomRenderer {
45765
45789
  height: endHandlerWidth,
45766
45790
  fill: "white",
45767
45791
  fillOpacity: 0,
45768
- zIndex: 999
45792
+ zIndex: LAYOUT_LEVEL.handlerMask
45769
45793
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45770
45794
  pickable: !zoomLock
45771
45795
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -45775,7 +45799,7 @@ class DataZoomRenderer {
45775
45799
  height: endHandlerWidth,
45776
45800
  fill: "white",
45777
45801
  fillOpacity: 0,
45778
- zIndex: 999
45802
+ zIndex: LAYOUT_LEVEL.handlerMask
45779
45803
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45780
45804
  pickable: !zoomLock
45781
45805
  }), "rect");
@@ -45804,7 +45828,8 @@ class DataZoomRenderer {
45804
45828
  y: position.y,
45805
45829
  width: (end - start) * width,
45806
45830
  height: height,
45807
- cursor: brushSelect ? "crosshair" : "move"
45831
+ cursor: brushSelect ? "crosshair" : "move",
45832
+ zIndex: LAYOUT_LEVEL.selectedBackground
45808
45833
  }, selectedBackgroundStyle), {
45809
45834
  pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
45810
45835
  }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
@@ -45812,14 +45837,16 @@ class DataZoomRenderer {
45812
45837
  y: position.y + start * height,
45813
45838
  width: width,
45814
45839
  height: (end - start) * height,
45815
- cursor: brushSelect ? "crosshair" : "move"
45840
+ cursor: brushSelect ? "crosshair" : "move",
45841
+ zIndex: LAYOUT_LEVEL.selectedBackground
45816
45842
  }, selectedBackgroundStyle), {
45817
45843
  pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
45818
45844
  }), "rect");
45819
45845
  }
45820
45846
  _setPreviewAttributes(type, group) {
45821
45847
  this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
45822
- pickable: !1
45848
+ pickable: !1,
45849
+ zIndex: LAYOUT_LEVEL.preview
45823
45850
  }, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
45824
45851
  curveType: "basis"
45825
45852
  }, "area");
@@ -45838,7 +45865,8 @@ class DataZoomRenderer {
45838
45865
  }
45839
45866
  _setSelectedPreviewClipAttributes(type, group) {
45840
45867
  this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
45841
- pickable: !1
45868
+ pickable: !1,
45869
+ zIndex: LAYOUT_LEVEL.selectedPreview
45842
45870
  }, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
45843
45871
  const {
45844
45872
  start: start,
@@ -58829,7 +58857,7 @@ class BaseMark extends GrammarItem {
58829
58857
  });
58830
58858
  }
58831
58859
  return config
58832
- ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
58860
+ ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
58833
58861
  }
58834
58862
  tryRunMorphing(graphics) {
58835
58863
  if (this._lastMark) {
@@ -63700,7 +63728,7 @@ class BaseSeries extends BaseModel {
63700
63728
  attributeContext: this._markAttributeContext,
63701
63729
  componentType: option.componentType,
63702
63730
  noSeparateStyle,
63703
- parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
63731
+ parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
63704
63732
  });
63705
63733
  if (isValid$1(m)) {
63706
63734
  const spec = this.getSpec() || {};
@@ -78511,14 +78539,6 @@ class BasePieSeries extends PolarSeries {
78511
78539
  this._labelMark = null;
78512
78540
  this._labelLineMark = null;
78513
78541
  this._emptyArcMark = null;
78514
- this._pendingViewDataLabelUpdate = false;
78515
- this.flushViewDataLabelUpdate = () => {
78516
- if (!this._pendingViewDataLabelUpdate) {
78517
- return;
78518
- }
78519
- this._pendingViewDataLabelUpdate = false;
78520
- this._viewDataLabel.getDataView().reRunAllTransform();
78521
- };
78522
78542
  this.dataToCentralPosition = (datum) => {
78523
78543
  const angle = datum[ARC_MIDDLE_ANGLE];
78524
78544
  if (isNil$1(angle)) {
@@ -78694,13 +78714,12 @@ class BasePieSeries extends PolarSeries {
78694
78714
  var _a;
78695
78715
  super.initEvent();
78696
78716
  (_a = this._viewDataLabel.getDataView()) === null || _a === void 0 ? void 0 : _a.target.addListener('change', this.viewDataLabelUpdate.bind(this));
78697
- this.event.on(ChartEvent.afterRender, this.flushViewDataLabelUpdate);
78698
78717
  }
78699
78718
  initGroups() {
78700
78719
  return;
78701
78720
  }
78702
78721
  onLayoutEnd() {
78703
- this._pendingViewDataLabelUpdate = true;
78722
+ this._viewDataLabel.getDataView().reRunAllTransform();
78704
78723
  this.onMarkPositionUpdate();
78705
78724
  super.onLayoutEnd();
78706
78725
  }
@@ -99328,6 +99347,7 @@ class DataZoom extends DataFilterBaseComponent {
99328
99347
  _handleDataCollectionChange() {
99329
99348
  const data = this._data.getDataView();
99330
99349
  data.reRunAllTransform();
99350
+ this._initAfterLayout();
99331
99351
  const domain = this._computeDomainOfValueScale();
99332
99352
  if (domain) {
99333
99353
  if (!this._valueScale) {
@@ -99568,9 +99588,7 @@ class DataZoom extends DataFilterBaseComponent {
99568
99588
  }
99569
99589
  _createOrUpdateComponent(changeData) {
99570
99590
  if (this._visible) {
99571
- const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
99572
- const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
99573
- const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
99591
+ const isNeedPreview = this._spec.showBackgroundChart !== false;
99574
99592
  const attrs = this._getAttrs(isNeedPreview);
99575
99593
  const axis = this._relatedAxisComponent;
99576
99594
  if (this._component) {
@@ -104006,15 +104024,23 @@ class Brush extends BaseComponent {
104006
104024
  const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
104007
104025
  const { x1, x2, y1, y2 } = operateMaskBounds;
104008
104026
  const regionStartAttr = isHorizontal ? 'x' : 'y';
104009
- const regionSizeAttr = isHorizontal ? 'width' : 'height';
104010
104027
  const boundsStart = isHorizontal ? x1 : y1;
104011
104028
  const boundsEnd = isHorizontal ? x2 : y2;
104029
+ const range = axis.getScale().range();
104030
+ const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104031
+ const isAxisReverse = last(range) < range[0];
104032
+ const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104033
+ const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104034
+ const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104035
+ const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104036
+ const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104037
+ const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104038
+ const newStart = this._stateClamp(start - axisRangeExpand);
104039
+ const newEnd = this._stateClamp(end + axisRangeExpand);
104012
104040
  if (this._axisDataZoomMap[axis.id]) {
104013
104041
  const dataZoom = this._axisDataZoomMap[axis.id];
104014
- const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104015
- const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104016
- const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
104017
- const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
104042
+ const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
104043
+ const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
104018
104044
  dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
104019
104045
  'percent',
104020
104046
  'percent'
@@ -104028,17 +104054,6 @@ class Brush extends BaseComponent {
104028
104054
  });
104029
104055
  }
104030
104056
  else {
104031
- const range = axis.getScale().range();
104032
- const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104033
- const isAxisReverse = last(range) < range[0];
104034
- const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104035
- const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104036
- const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104037
- const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104038
- const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104039
- const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104040
- const newStart = this._stateClamp(start - axisRangeExpand);
104041
- const newEnd = this._stateClamp(end + axisRangeExpand);
104042
104057
  axis.scaleRangeFactor([newStart, newEnd]);
104043
104058
  axis.effect.scaleUpdate();
104044
104059
  this._zoomRecord.push({
package/build/index.js CHANGED
@@ -45480,6 +45480,16 @@
45480
45480
  strokeBoundsBuffer: 0
45481
45481
  }
45482
45482
  };
45483
+ const LAYOUT_LEVEL = {
45484
+ background: 0,
45485
+ preview: 1,
45486
+ dragMask: 2,
45487
+ selectedBackground: 3,
45488
+ selectedPreview: 4,
45489
+ handler: 5,
45490
+ handlerText: 5,
45491
+ handlerMask: 999
45492
+ };
45483
45493
 
45484
45494
  const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
45485
45495
  if (!textBounds) return !1;
@@ -45610,12 +45620,14 @@
45610
45620
  x: position.x + start * width,
45611
45621
  y: position.y,
45612
45622
  width: (end - start) * width,
45613
- height: height
45623
+ height: height,
45624
+ zIndex: LAYOUT_LEVEL.dragMask
45614
45625
  }, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
45615
45626
  x: position.x,
45616
45627
  y: position.y + start * height,
45617
45628
  width: width,
45618
- height: (end - start) * height
45629
+ height: (end - start) * height,
45630
+ zIndex: LAYOUT_LEVEL.dragMask
45619
45631
  }, dragMaskStyle), "rect"), {
45620
45632
  start: start,
45621
45633
  end: end
@@ -45639,7 +45651,8 @@
45639
45651
  y: position.y,
45640
45652
  width: width,
45641
45653
  height: height,
45642
- cursor: brushSelect ? "crosshair" : "auto"
45654
+ cursor: brushSelect ? "crosshair" : "auto",
45655
+ zIndex: LAYOUT_LEVEL.background
45643
45656
  }, backgroundStyle), {
45644
45657
  pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
45645
45658
  }), "rect");
@@ -45672,7 +45685,8 @@
45672
45685
  x: position.x + start * width,
45673
45686
  y: position.y - middleHandlerBackgroundSize,
45674
45687
  width: (end - start) * width,
45675
- height: middleHandlerBackgroundSize
45688
+ height: middleHandlerBackgroundSize,
45689
+ zIndex: LAYOUT_LEVEL.handler
45676
45690
  }, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
45677
45691
  pickable: !zoomLock && (null === (_g = null === (_f = null === (_e = middleHandlerStyle.background) || void 0 === _e ? void 0 : _e.style) || void 0 === _f ? void 0 : _f.pickable) || void 0 === _g || _g)
45678
45692
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -45680,24 +45694,29 @@
45680
45694
  y: position.y - middleHandlerBackgroundSize / 2,
45681
45695
  strokeBoundsBuffer: 0,
45682
45696
  angle: 0,
45683
- symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
45697
+ symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square",
45698
+ zIndex: LAYOUT_LEVEL.handler
45684
45699
  }, middleHandlerStyle.icon), {
45685
45700
  pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
45686
45701
  }), "symbol");
45687
45702
  }
45688
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
45703
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45689
45704
  x: position.x + start * width,
45690
45705
  y: position.y + height / 2,
45691
45706
  size: height,
45692
45707
  symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
45693
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
45708
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45709
+ zIndex: LAYOUT_LEVEL.handler
45710
+ }), startHandlerStyle), {
45694
45711
  pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
45695
- }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
45712
+ }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45696
45713
  x: position.x + end * width,
45697
45714
  y: position.y + height / 2,
45698
45715
  size: height,
45699
45716
  symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
45700
- }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
45717
+ }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45718
+ zIndex: LAYOUT_LEVEL.handler
45719
+ }), endHandlerStyle), {
45701
45720
  pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
45702
45721
  }), "symbol");
45703
45722
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
@@ -45711,7 +45730,7 @@
45711
45730
  height: startHandlerHeight,
45712
45731
  fill: "white",
45713
45732
  fillOpacity: 0,
45714
- zIndex: 999
45733
+ zIndex: LAYOUT_LEVEL.handlerMask
45715
45734
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45716
45735
  pickable: !zoomLock
45717
45736
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -45721,7 +45740,7 @@
45721
45740
  height: endHandlerHeight,
45722
45741
  fill: "white",
45723
45742
  fillOpacity: 0,
45724
- zIndex: 999
45743
+ zIndex: LAYOUT_LEVEL.handlerMask
45725
45744
  }, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
45726
45745
  pickable: !zoomLock
45727
45746
  }), "rect");
@@ -45732,7 +45751,8 @@
45732
45751
  x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
45733
45752
  y: position.y + start * height,
45734
45753
  width: middleHandlerBackgroundSize,
45735
- height: (end - start) * height
45754
+ height: (end - start) * height,
45755
+ zIndex: LAYOUT_LEVEL.handler
45736
45756
  }, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
45737
45757
  pickable: !zoomLock && (null === (_u = null === (_t = null === (_s = middleHandlerStyle.background) || void 0 === _s ? void 0 : _s.style) || void 0 === _t ? void 0 : _t.pickable) || void 0 === _u || _u)
45738
45758
  }), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
@@ -45740,23 +45760,27 @@
45740
45760
  y: position.y + (start + end) / 2 * height,
45741
45761
  angle: Math.PI / 180 * 90,
45742
45762
  symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
45743
- strokeBoundsBuffer: 0
45763
+ strokeBoundsBuffer: 0,
45764
+ zIndex: LAYOUT_LEVEL.handler
45744
45765
  }, middleHandlerStyle.icon), {
45745
45766
  pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
45746
45767
  }), "symbol");
45747
45768
  }
45748
- this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
45769
+ this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(Object.assign({
45749
45770
  x: position.x + width / 2,
45750
45771
  y: position.y + start * height,
45751
45772
  size: width,
45752
45773
  symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
45753
- }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
45774
+ }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45775
+ zIndex: LAYOUT_LEVEL.handler
45776
+ }), startHandlerStyle), {
45754
45777
  pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
45755
45778
  }), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
45756
45779
  x: position.x + width / 2,
45757
45780
  y: position.y + end * height,
45758
45781
  size: width,
45759
- symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
45782
+ symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square",
45783
+ zIndex: LAYOUT_LEVEL.handler
45760
45784
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
45761
45785
  pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
45762
45786
  }), "symbol");
@@ -45771,7 +45795,7 @@
45771
45795
  height: endHandlerWidth,
45772
45796
  fill: "white",
45773
45797
  fillOpacity: 0,
45774
- zIndex: 999
45798
+ zIndex: LAYOUT_LEVEL.handlerMask
45775
45799
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45776
45800
  pickable: !zoomLock
45777
45801
  }), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
@@ -45781,7 +45805,7 @@
45781
45805
  height: endHandlerWidth,
45782
45806
  fill: "white",
45783
45807
  fillOpacity: 0,
45784
- zIndex: 999
45808
+ zIndex: LAYOUT_LEVEL.handlerMask
45785
45809
  }, DEFAULT_HANDLER_ATTR_MAP.vertical), {
45786
45810
  pickable: !zoomLock
45787
45811
  }), "rect");
@@ -45810,7 +45834,8 @@
45810
45834
  y: position.y,
45811
45835
  width: (end - start) * width,
45812
45836
  height: height,
45813
- cursor: brushSelect ? "crosshair" : "move"
45837
+ cursor: brushSelect ? "crosshair" : "move",
45838
+ zIndex: LAYOUT_LEVEL.selectedBackground
45814
45839
  }, selectedBackgroundStyle), {
45815
45840
  pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
45816
45841
  }), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
@@ -45818,14 +45843,16 @@
45818
45843
  y: position.y + start * height,
45819
45844
  width: width,
45820
45845
  height: (end - start) * height,
45821
- cursor: brushSelect ? "crosshair" : "move"
45846
+ cursor: brushSelect ? "crosshair" : "move",
45847
+ zIndex: LAYOUT_LEVEL.selectedBackground
45822
45848
  }, selectedBackgroundStyle), {
45823
45849
  pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
45824
45850
  }), "rect");
45825
45851
  }
45826
45852
  _setPreviewAttributes(type, group) {
45827
45853
  this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
45828
- pickable: !1
45854
+ pickable: !1,
45855
+ zIndex: LAYOUT_LEVEL.preview
45829
45856
  }, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
45830
45857
  curveType: "basis"
45831
45858
  }, "area");
@@ -45844,7 +45871,8 @@
45844
45871
  }
45845
45872
  _setSelectedPreviewClipAttributes(type, group) {
45846
45873
  this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
45847
- pickable: !1
45874
+ pickable: !1,
45875
+ zIndex: LAYOUT_LEVEL.selectedPreview
45848
45876
  }, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
45849
45877
  const {
45850
45878
  start: start,
@@ -58835,7 +58863,7 @@
58835
58863
  });
58836
58864
  }
58837
58865
  return config
58838
- ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
58866
+ ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
58839
58867
  }
58840
58868
  tryRunMorphing(graphics) {
58841
58869
  if (this._lastMark) {
@@ -63706,7 +63734,7 @@
63706
63734
  attributeContext: this._markAttributeContext,
63707
63735
  componentType: option.componentType,
63708
63736
  noSeparateStyle,
63709
- parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
63737
+ parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
63710
63738
  });
63711
63739
  if (isValid$1(m)) {
63712
63740
  const spec = this.getSpec() || {};
@@ -78517,14 +78545,6 @@
78517
78545
  this._labelMark = null;
78518
78546
  this._labelLineMark = null;
78519
78547
  this._emptyArcMark = null;
78520
- this._pendingViewDataLabelUpdate = false;
78521
- this.flushViewDataLabelUpdate = () => {
78522
- if (!this._pendingViewDataLabelUpdate) {
78523
- return;
78524
- }
78525
- this._pendingViewDataLabelUpdate = false;
78526
- this._viewDataLabel.getDataView().reRunAllTransform();
78527
- };
78528
78548
  this.dataToCentralPosition = (datum) => {
78529
78549
  const angle = datum[ARC_MIDDLE_ANGLE];
78530
78550
  if (isNil$1(angle)) {
@@ -78700,13 +78720,12 @@
78700
78720
  var _a;
78701
78721
  super.initEvent();
78702
78722
  (_a = this._viewDataLabel.getDataView()) === null || _a === void 0 ? void 0 : _a.target.addListener('change', this.viewDataLabelUpdate.bind(this));
78703
- this.event.on(exports.ChartEvent.afterRender, this.flushViewDataLabelUpdate);
78704
78723
  }
78705
78724
  initGroups() {
78706
78725
  return;
78707
78726
  }
78708
78727
  onLayoutEnd() {
78709
- this._pendingViewDataLabelUpdate = true;
78728
+ this._viewDataLabel.getDataView().reRunAllTransform();
78710
78729
  this.onMarkPositionUpdate();
78711
78730
  super.onLayoutEnd();
78712
78731
  }
@@ -99334,6 +99353,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99334
99353
  _handleDataCollectionChange() {
99335
99354
  const data = this._data.getDataView();
99336
99355
  data.reRunAllTransform();
99356
+ this._initAfterLayout();
99337
99357
  const domain = this._computeDomainOfValueScale();
99338
99358
  if (domain) {
99339
99359
  if (!this._valueScale) {
@@ -99574,9 +99594,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99574
99594
  }
99575
99595
  _createOrUpdateComponent(changeData) {
99576
99596
  if (this._visible) {
99577
- const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
99578
- const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
99579
- const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
99597
+ const isNeedPreview = this._spec.showBackgroundChart !== false;
99580
99598
  const attrs = this._getAttrs(isNeedPreview);
99581
99599
  const axis = this._relatedAxisComponent;
99582
99600
  if (this._component) {
@@ -104012,15 +104030,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104012
104030
  const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
104013
104031
  const { x1, x2, y1, y2 } = operateMaskBounds;
104014
104032
  const regionStartAttr = isHorizontal ? 'x' : 'y';
104015
- const regionSizeAttr = isHorizontal ? 'width' : 'height';
104016
104033
  const boundsStart = isHorizontal ? x1 : y1;
104017
104034
  const boundsEnd = isHorizontal ? x2 : y2;
104035
+ const range = axis.getScale().range();
104036
+ const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104037
+ const isAxisReverse = last(range) < range[0];
104038
+ const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104039
+ const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104040
+ const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104041
+ const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104042
+ const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104043
+ const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104044
+ const newStart = this._stateClamp(start - axisRangeExpand);
104045
+ const newEnd = this._stateClamp(end + axisRangeExpand);
104018
104046
  if (this._axisDataZoomMap[axis.id]) {
104019
104047
  const dataZoom = this._axisDataZoomMap[axis.id];
104020
- const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104021
- const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104022
- const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
104023
- const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
104048
+ const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
104049
+ const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
104024
104050
  dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
104025
104051
  'percent',
104026
104052
  'percent'
@@ -104034,17 +104060,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104034
104060
  });
104035
104061
  }
104036
104062
  else {
104037
- const range = axis.getScale().range();
104038
- const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104039
- const isAxisReverse = last(range) < range[0];
104040
- const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104041
- const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104042
- const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104043
- const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104044
- const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104045
- const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104046
- const newStart = this._stateClamp(start - axisRangeExpand);
104047
- const newEnd = this._stateClamp(end + axisRangeExpand);
104048
104063
  axis.scaleRangeFactor([newStart, newEnd]);
104049
104064
  axis.effect.scaleUpdate();
104050
104065
  this._zoomRecord.push({