@visactor/vchart 2.0.20-alpha.6 → 2.0.20-alpha.7

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.
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,
@@ -46040,7 +46068,8 @@ class DataZoomRenderer {
46040
46068
  visible: this._showText,
46041
46069
  pickable: !1,
46042
46070
  childrenPickable: !1,
46043
- textStyle: startTextAlignStyle
46071
+ textStyle: startTextAlignStyle,
46072
+ zIndex: LAYOUT_LEVEL.handlerText
46044
46073
  }), "data-zoom-start-text"), this._endText = this._maybeAddLabel(this._getContainer(), merge$1({}, restEndTextStyle, {
46045
46074
  text: endTextValue,
46046
46075
  x: endTextPosition.x,
@@ -46048,7 +46077,8 @@ class DataZoomRenderer {
46048
46077
  visible: this._showText,
46049
46078
  pickable: !1,
46050
46079
  childrenPickable: !1,
46051
- textStyle: endTextAlignStyle
46080
+ textStyle: endTextAlignStyle,
46081
+ zIndex: LAYOUT_LEVEL.handlerText
46052
46082
  }), "data-zoom-end-text");
46053
46083
  }
46054
46084
  _maybeAddLabel(container, attributes, name) {
@@ -58746,9 +58776,6 @@ class BaseMark extends GrammarItem {
58746
58776
  return;
58747
58777
  }
58748
58778
  this._product = mark.getProduct();
58749
- if (!this._product) {
58750
- return;
58751
- }
58752
58779
  this._product.clearStates();
58753
58780
  this._graphics = mark.getGraphics();
58754
58781
  this._graphics.forEach(g => {
@@ -58832,7 +58859,7 @@ class BaseMark extends GrammarItem {
58832
58859
  });
58833
58860
  }
58834
58861
  return config
58835
- ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
58862
+ ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
58836
58863
  }
58837
58864
  tryRunMorphing(graphics) {
58838
58865
  if (this._lastMark) {
@@ -63703,7 +63730,7 @@ class BaseSeries extends BaseModel {
63703
63730
  attributeContext: this._markAttributeContext,
63704
63731
  componentType: option.componentType,
63705
63732
  noSeparateStyle,
63706
- parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
63733
+ parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
63707
63734
  });
63708
63735
  if (isValid$1(m)) {
63709
63736
  const spec = this.getSpec() || {};
@@ -99322,6 +99349,7 @@ class DataZoom extends DataFilterBaseComponent {
99322
99349
  _handleDataCollectionChange() {
99323
99350
  const data = this._data.getDataView();
99324
99351
  data.reRunAllTransform();
99352
+ this._initAfterLayout();
99325
99353
  const domain = this._computeDomainOfValueScale();
99326
99354
  if (domain) {
99327
99355
  if (!this._valueScale) {
@@ -99562,9 +99590,7 @@ class DataZoom extends DataFilterBaseComponent {
99562
99590
  }
99563
99591
  _createOrUpdateComponent(changeData) {
99564
99592
  if (this._visible) {
99565
- const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
99566
- const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
99567
- const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
99593
+ const isNeedPreview = this._spec.showBackgroundChart !== false;
99568
99594
  const attrs = this._getAttrs(isNeedPreview);
99569
99595
  const axis = this._relatedAxisComponent;
99570
99596
  if (this._component) {
@@ -99729,10 +99755,8 @@ class ScrollBar extends DataFilterBaseComponent {
99729
99755
  }
99730
99756
  this._start = start;
99731
99757
  this._end = end;
99732
- const axis = this._relatedAxisComponent;
99733
- const reverse = isReverse(axis, this._isHorizontal);
99734
- const startValue = statePointToData(start, this._stateScale, reverse);
99735
- const endValue = statePointToData(end, this._stateScale, reverse);
99758
+ const startValue = statePointToData(start, this._stateScale, false);
99759
+ const endValue = statePointToData(end, this._stateScale, false);
99736
99760
  const hasChange = isFunction$1(this._spec.updateDataAfterChange)
99737
99761
  ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
99738
99762
  : this._handleStateChange(startValue, endValue);
@@ -104002,15 +104026,23 @@ class Brush extends BaseComponent {
104002
104026
  const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
104003
104027
  const { x1, x2, y1, y2 } = operateMaskBounds;
104004
104028
  const regionStartAttr = isHorizontal ? 'x' : 'y';
104005
- const regionSizeAttr = isHorizontal ? 'width' : 'height';
104006
104029
  const boundsStart = isHorizontal ? x1 : y1;
104007
104030
  const boundsEnd = isHorizontal ? x2 : y2;
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);
104008
104042
  if (this._axisDataZoomMap[axis.id]) {
104009
104043
  const dataZoom = this._axisDataZoomMap[axis.id];
104010
- const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104011
- const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104012
- const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
104013
- const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
104044
+ const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
104045
+ const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
104014
104046
  dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
104015
104047
  'percent',
104016
104048
  'percent'
@@ -104024,17 +104056,6 @@ class Brush extends BaseComponent {
104024
104056
  });
104025
104057
  }
104026
104058
  else {
104027
- const range = axis.getScale().range();
104028
- const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104029
- const isAxisReverse = last(range) < range[0];
104030
- const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104031
- const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104032
- const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104033
- const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104034
- const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104035
- const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104036
- const newStart = this._stateClamp(start - axisRangeExpand);
104037
- const newEnd = this._stateClamp(end + axisRangeExpand);
104038
104059
  axis.scaleRangeFactor([newStart, newEnd]);
104039
104060
  axis.effect.scaleUpdate();
104040
104061
  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,
@@ -46046,7 +46074,8 @@
46046
46074
  visible: this._showText,
46047
46075
  pickable: !1,
46048
46076
  childrenPickable: !1,
46049
- textStyle: startTextAlignStyle
46077
+ textStyle: startTextAlignStyle,
46078
+ zIndex: LAYOUT_LEVEL.handlerText
46050
46079
  }), "data-zoom-start-text"), this._endText = this._maybeAddLabel(this._getContainer(), merge$1({}, restEndTextStyle, {
46051
46080
  text: endTextValue,
46052
46081
  x: endTextPosition.x,
@@ -46054,7 +46083,8 @@
46054
46083
  visible: this._showText,
46055
46084
  pickable: !1,
46056
46085
  childrenPickable: !1,
46057
- textStyle: endTextAlignStyle
46086
+ textStyle: endTextAlignStyle,
46087
+ zIndex: LAYOUT_LEVEL.handlerText
46058
46088
  }), "data-zoom-end-text");
46059
46089
  }
46060
46090
  _maybeAddLabel(container, attributes, name) {
@@ -58752,9 +58782,6 @@
58752
58782
  return;
58753
58783
  }
58754
58784
  this._product = mark.getProduct();
58755
- if (!this._product) {
58756
- return;
58757
- }
58758
58785
  this._product.clearStates();
58759
58786
  this._graphics = mark.getGraphics();
58760
58787
  this._graphics.forEach(g => {
@@ -58838,7 +58865,7 @@
58838
58865
  });
58839
58866
  }
58840
58867
  return config
58841
- ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
58868
+ ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
58842
58869
  }
58843
58870
  tryRunMorphing(graphics) {
58844
58871
  if (this._lastMark) {
@@ -63709,7 +63736,7 @@
63709
63736
  attributeContext: this._markAttributeContext,
63710
63737
  componentType: option.componentType,
63711
63738
  noSeparateStyle,
63712
- parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
63739
+ parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
63713
63740
  });
63714
63741
  if (isValid$1(m)) {
63715
63742
  const spec = this.getSpec() || {};
@@ -99328,6 +99355,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99328
99355
  _handleDataCollectionChange() {
99329
99356
  const data = this._data.getDataView();
99330
99357
  data.reRunAllTransform();
99358
+ this._initAfterLayout();
99331
99359
  const domain = this._computeDomainOfValueScale();
99332
99360
  if (domain) {
99333
99361
  if (!this._valueScale) {
@@ -99568,9 +99596,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99568
99596
  }
99569
99597
  _createOrUpdateComponent(changeData) {
99570
99598
  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;
99599
+ const isNeedPreview = this._spec.showBackgroundChart !== false;
99574
99600
  const attrs = this._getAttrs(isNeedPreview);
99575
99601
  const axis = this._relatedAxisComponent;
99576
99602
  if (this._component) {
@@ -99735,10 +99761,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
99735
99761
  }
99736
99762
  this._start = start;
99737
99763
  this._end = end;
99738
- const axis = this._relatedAxisComponent;
99739
- const reverse = isReverse(axis, this._isHorizontal);
99740
- const startValue = statePointToData(start, this._stateScale, reverse);
99741
- const endValue = statePointToData(end, this._stateScale, reverse);
99764
+ const startValue = statePointToData(start, this._stateScale, false);
99765
+ const endValue = statePointToData(end, this._stateScale, false);
99742
99766
  const hasChange = isFunction$1(this._spec.updateDataAfterChange)
99743
99767
  ? this._spec.updateDataAfterChange(start, end, startValue, endValue)
99744
99768
  : this._handleStateChange(startValue, endValue);
@@ -104008,15 +104032,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104008
104032
  const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
104009
104033
  const { x1, x2, y1, y2 } = operateMaskBounds;
104010
104034
  const regionStartAttr = isHorizontal ? 'x' : 'y';
104011
- const regionSizeAttr = isHorizontal ? 'width' : 'height';
104012
104035
  const boundsStart = isHorizontal ? x1 : y1;
104013
104036
  const boundsEnd = isHorizontal ? x2 : y2;
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);
104014
104048
  if (this._axisDataZoomMap[axis.id]) {
104015
104049
  const dataZoom = this._axisDataZoomMap[axis.id];
104016
- const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104017
- const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
104018
- const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
104019
- const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
104050
+ const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
104051
+ const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
104020
104052
  dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
104021
104053
  'percent',
104022
104054
  'percent'
@@ -104030,17 +104062,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104030
104062
  });
104031
104063
  }
104032
104064
  else {
104033
- const range = axis.getScale().range();
104034
- const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
104035
- const isAxisReverse = last(range) < range[0];
104036
- const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
104037
- const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
104038
- const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
104039
- const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
104040
- const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104041
- const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
104042
- const newStart = this._stateClamp(start - axisRangeExpand);
104043
- const newEnd = this._stateClamp(end + axisRangeExpand);
104044
104065
  axis.scaleRangeFactor([newStart, newEnd]);
104045
104066
  axis.effect.scaleUpdate();
104046
104067
  this._zoomRecord.push({