@visactor/vchart 2.0.20-alpha.5 → 2.0.20-alpha.6
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/es5/index.js +1 -1
- package/build/index.es.js +50 -69
- package/build/index.js +50 -69
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/brush/brush.js +15 -12
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -2
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +2 -2
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/cjs/mark/base/base-mark.js +2 -2
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/esm/component/brush/brush.js +12 -9
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -2
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -2
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/esm/mark/base/base-mark.js +2 -2
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -45474,16 +45474,6 @@ 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
|
-
};
|
|
45487
45477
|
|
|
45488
45478
|
const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
|
|
45489
45479
|
if (!textBounds) return !1;
|
|
@@ -45614,14 +45604,12 @@ class DataZoomRenderer {
|
|
|
45614
45604
|
x: position.x + start * width,
|
|
45615
45605
|
y: position.y,
|
|
45616
45606
|
width: (end - start) * width,
|
|
45617
|
-
height: height
|
|
45618
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
45607
|
+
height: height
|
|
45619
45608
|
}, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
|
|
45620
45609
|
x: position.x,
|
|
45621
45610
|
y: position.y + start * height,
|
|
45622
45611
|
width: width,
|
|
45623
|
-
height: (end - start) * height
|
|
45624
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
45612
|
+
height: (end - start) * height
|
|
45625
45613
|
}, dragMaskStyle), "rect"), {
|
|
45626
45614
|
start: start,
|
|
45627
45615
|
end: end
|
|
@@ -45645,8 +45633,7 @@ class DataZoomRenderer {
|
|
|
45645
45633
|
y: position.y,
|
|
45646
45634
|
width: width,
|
|
45647
45635
|
height: height,
|
|
45648
|
-
cursor: brushSelect ? "crosshair" : "auto"
|
|
45649
|
-
zIndex: LAYOUT_LEVEL.background
|
|
45636
|
+
cursor: brushSelect ? "crosshair" : "auto"
|
|
45650
45637
|
}, backgroundStyle), {
|
|
45651
45638
|
pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
|
|
45652
45639
|
}), "rect");
|
|
@@ -45679,8 +45666,7 @@ class DataZoomRenderer {
|
|
|
45679
45666
|
x: position.x + start * width,
|
|
45680
45667
|
y: position.y - middleHandlerBackgroundSize,
|
|
45681
45668
|
width: (end - start) * width,
|
|
45682
|
-
height: middleHandlerBackgroundSize
|
|
45683
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45669
|
+
height: middleHandlerBackgroundSize
|
|
45684
45670
|
}, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
|
|
45685
45671
|
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)
|
|
45686
45672
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -45688,29 +45674,24 @@ class DataZoomRenderer {
|
|
|
45688
45674
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
45689
45675
|
strokeBoundsBuffer: 0,
|
|
45690
45676
|
angle: 0,
|
|
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
|
|
45677
|
+
symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
|
|
45693
45678
|
}, middleHandlerStyle.icon), {
|
|
45694
45679
|
pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
|
|
45695
45680
|
}), "symbol");
|
|
45696
45681
|
}
|
|
45697
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
45682
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
45698
45683
|
x: position.x + start * width,
|
|
45699
45684
|
y: position.y + height / 2,
|
|
45700
45685
|
size: height,
|
|
45701
45686
|
symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
|
|
45702
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45703
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45704
|
-
}), startHandlerStyle), {
|
|
45687
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
45705
45688
|
pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
|
|
45706
|
-
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(
|
|
45689
|
+
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
45707
45690
|
x: position.x + end * width,
|
|
45708
45691
|
y: position.y + height / 2,
|
|
45709
45692
|
size: height,
|
|
45710
45693
|
symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
|
|
45711
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45712
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45713
|
-
}), endHandlerStyle), {
|
|
45694
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
45714
45695
|
pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
|
|
45715
45696
|
}), "symbol");
|
|
45716
45697
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
@@ -45724,7 +45705,7 @@ class DataZoomRenderer {
|
|
|
45724
45705
|
height: startHandlerHeight,
|
|
45725
45706
|
fill: "white",
|
|
45726
45707
|
fillOpacity: 0,
|
|
45727
|
-
zIndex:
|
|
45708
|
+
zIndex: 999
|
|
45728
45709
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45729
45710
|
pickable: !zoomLock
|
|
45730
45711
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -45734,7 +45715,7 @@ class DataZoomRenderer {
|
|
|
45734
45715
|
height: endHandlerHeight,
|
|
45735
45716
|
fill: "white",
|
|
45736
45717
|
fillOpacity: 0,
|
|
45737
|
-
zIndex:
|
|
45718
|
+
zIndex: 999
|
|
45738
45719
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45739
45720
|
pickable: !zoomLock
|
|
45740
45721
|
}), "rect");
|
|
@@ -45745,8 +45726,7 @@ class DataZoomRenderer {
|
|
|
45745
45726
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
45746
45727
|
y: position.y + start * height,
|
|
45747
45728
|
width: middleHandlerBackgroundSize,
|
|
45748
|
-
height: (end - start) * height
|
|
45749
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45729
|
+
height: (end - start) * height
|
|
45750
45730
|
}, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
|
|
45751
45731
|
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)
|
|
45752
45732
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -45754,27 +45734,23 @@ class DataZoomRenderer {
|
|
|
45754
45734
|
y: position.y + (start + end) / 2 * height,
|
|
45755
45735
|
angle: Math.PI / 180 * 90,
|
|
45756
45736
|
symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
|
|
45757
|
-
strokeBoundsBuffer: 0
|
|
45758
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45737
|
+
strokeBoundsBuffer: 0
|
|
45759
45738
|
}, middleHandlerStyle.icon), {
|
|
45760
45739
|
pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
|
|
45761
45740
|
}), "symbol");
|
|
45762
45741
|
}
|
|
45763
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
45742
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
45764
45743
|
x: position.x + width / 2,
|
|
45765
45744
|
y: position.y + start * height,
|
|
45766
45745
|
size: width,
|
|
45767
45746
|
symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
|
|
45768
|
-
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45769
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45770
|
-
}), startHandlerStyle), {
|
|
45747
|
+
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
45771
45748
|
pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
|
|
45772
45749
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
45773
45750
|
x: position.x + width / 2,
|
|
45774
45751
|
y: position.y + end * height,
|
|
45775
45752
|
size: width,
|
|
45776
|
-
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
45777
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45753
|
+
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
45778
45754
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
45779
45755
|
pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
|
|
45780
45756
|
}), "symbol");
|
|
@@ -45789,7 +45765,7 @@ class DataZoomRenderer {
|
|
|
45789
45765
|
height: endHandlerWidth,
|
|
45790
45766
|
fill: "white",
|
|
45791
45767
|
fillOpacity: 0,
|
|
45792
|
-
zIndex:
|
|
45768
|
+
zIndex: 999
|
|
45793
45769
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45794
45770
|
pickable: !zoomLock
|
|
45795
45771
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -45799,7 +45775,7 @@ class DataZoomRenderer {
|
|
|
45799
45775
|
height: endHandlerWidth,
|
|
45800
45776
|
fill: "white",
|
|
45801
45777
|
fillOpacity: 0,
|
|
45802
|
-
zIndex:
|
|
45778
|
+
zIndex: 999
|
|
45803
45779
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45804
45780
|
pickable: !zoomLock
|
|
45805
45781
|
}), "rect");
|
|
@@ -45828,8 +45804,7 @@ class DataZoomRenderer {
|
|
|
45828
45804
|
y: position.y,
|
|
45829
45805
|
width: (end - start) * width,
|
|
45830
45806
|
height: height,
|
|
45831
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
45832
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
45807
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
45833
45808
|
}, selectedBackgroundStyle), {
|
|
45834
45809
|
pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
|
|
45835
45810
|
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
@@ -45837,16 +45812,14 @@ class DataZoomRenderer {
|
|
|
45837
45812
|
y: position.y + start * height,
|
|
45838
45813
|
width: width,
|
|
45839
45814
|
height: (end - start) * height,
|
|
45840
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
45841
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
45815
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
45842
45816
|
}, selectedBackgroundStyle), {
|
|
45843
45817
|
pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
|
|
45844
45818
|
}), "rect");
|
|
45845
45819
|
}
|
|
45846
45820
|
_setPreviewAttributes(type, group) {
|
|
45847
45821
|
this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
|
|
45848
|
-
pickable: !1
|
|
45849
|
-
zIndex: LAYOUT_LEVEL.preview
|
|
45822
|
+
pickable: !1
|
|
45850
45823
|
}, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
|
|
45851
45824
|
curveType: "basis"
|
|
45852
45825
|
}, "area");
|
|
@@ -45865,8 +45838,7 @@ class DataZoomRenderer {
|
|
|
45865
45838
|
}
|
|
45866
45839
|
_setSelectedPreviewClipAttributes(type, group) {
|
|
45867
45840
|
this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
|
|
45868
|
-
pickable: !1
|
|
45869
|
-
zIndex: LAYOUT_LEVEL.selectedPreview
|
|
45841
|
+
pickable: !1
|
|
45870
45842
|
}, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
|
|
45871
45843
|
const {
|
|
45872
45844
|
start: start,
|
|
@@ -58774,6 +58746,9 @@ class BaseMark extends GrammarItem {
|
|
|
58774
58746
|
return;
|
|
58775
58747
|
}
|
|
58776
58748
|
this._product = mark.getProduct();
|
|
58749
|
+
if (!this._product) {
|
|
58750
|
+
return;
|
|
58751
|
+
}
|
|
58777
58752
|
this._product.clearStates();
|
|
58778
58753
|
this._graphics = mark.getGraphics();
|
|
58779
58754
|
this._graphics.forEach(g => {
|
|
@@ -58857,7 +58832,7 @@ class BaseMark extends GrammarItem {
|
|
|
58857
58832
|
});
|
|
58858
58833
|
}
|
|
58859
58834
|
return config
|
|
58860
|
-
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (
|
|
58835
|
+
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
|
|
58861
58836
|
}
|
|
58862
58837
|
tryRunMorphing(graphics) {
|
|
58863
58838
|
if (this._lastMark) {
|
|
@@ -63728,7 +63703,7 @@ class BaseSeries extends BaseModel {
|
|
|
63728
63703
|
attributeContext: this._markAttributeContext,
|
|
63729
63704
|
componentType: option.componentType,
|
|
63730
63705
|
noSeparateStyle,
|
|
63731
|
-
parent: parent !== false ?
|
|
63706
|
+
parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
|
|
63732
63707
|
});
|
|
63733
63708
|
if (isValid$1(m)) {
|
|
63734
63709
|
const spec = this.getSpec() || {};
|
|
@@ -99347,7 +99322,6 @@ class DataZoom extends DataFilterBaseComponent {
|
|
|
99347
99322
|
_handleDataCollectionChange() {
|
|
99348
99323
|
const data = this._data.getDataView();
|
|
99349
99324
|
data.reRunAllTransform();
|
|
99350
|
-
this._initAfterLayout();
|
|
99351
99325
|
const domain = this._computeDomainOfValueScale();
|
|
99352
99326
|
if (domain) {
|
|
99353
99327
|
if (!this._valueScale) {
|
|
@@ -99588,7 +99562,9 @@ class DataZoom extends DataFilterBaseComponent {
|
|
|
99588
99562
|
}
|
|
99589
99563
|
_createOrUpdateComponent(changeData) {
|
|
99590
99564
|
if (this._visible) {
|
|
99591
|
-
const
|
|
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;
|
|
99592
99568
|
const attrs = this._getAttrs(isNeedPreview);
|
|
99593
99569
|
const axis = this._relatedAxisComponent;
|
|
99594
99570
|
if (this._component) {
|
|
@@ -99753,8 +99729,10 @@ class ScrollBar extends DataFilterBaseComponent {
|
|
|
99753
99729
|
}
|
|
99754
99730
|
this._start = start;
|
|
99755
99731
|
this._end = end;
|
|
99756
|
-
const
|
|
99757
|
-
const
|
|
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
99736
|
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
99759
99737
|
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
99760
99738
|
: this._handleStateChange(startValue, endValue);
|
|
@@ -104024,23 +104002,15 @@ class Brush extends BaseComponent {
|
|
|
104024
104002
|
const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
|
|
104025
104003
|
const { x1, x2, y1, y2 } = operateMaskBounds;
|
|
104026
104004
|
const regionStartAttr = isHorizontal ? 'x' : 'y';
|
|
104005
|
+
const regionSizeAttr = isHorizontal ? 'width' : 'height';
|
|
104027
104006
|
const boundsStart = isHorizontal ? x1 : y1;
|
|
104028
104007
|
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);
|
|
104040
104008
|
if (this._axisDataZoomMap[axis.id]) {
|
|
104041
104009
|
const dataZoom = this._axisDataZoomMap[axis.id];
|
|
104042
|
-
const
|
|
104043
|
-
const
|
|
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
104014
|
dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
|
|
104045
104015
|
'percent',
|
|
104046
104016
|
'percent'
|
|
@@ -104054,6 +104024,17 @@ class Brush extends BaseComponent {
|
|
|
104054
104024
|
});
|
|
104055
104025
|
}
|
|
104056
104026
|
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);
|
|
104057
104038
|
axis.scaleRangeFactor([newStart, newEnd]);
|
|
104058
104039
|
axis.effect.scaleUpdate();
|
|
104059
104040
|
this._zoomRecord.push({
|
package/build/index.js
CHANGED
|
@@ -45480,16 +45480,6 @@
|
|
|
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
|
-
};
|
|
45493
45483
|
|
|
45494
45484
|
const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
|
|
45495
45485
|
if (!textBounds) return !1;
|
|
@@ -45620,14 +45610,12 @@
|
|
|
45620
45610
|
x: position.x + start * width,
|
|
45621
45611
|
y: position.y,
|
|
45622
45612
|
width: (end - start) * width,
|
|
45623
|
-
height: height
|
|
45624
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
45613
|
+
height: height
|
|
45625
45614
|
}, dragMaskStyle), "rect") : this._dragMask = this._getContainer().createOrUpdateChild("dragMask", Object.assign({
|
|
45626
45615
|
x: position.x,
|
|
45627
45616
|
y: position.y + start * height,
|
|
45628
45617
|
width: width,
|
|
45629
|
-
height: (end - start) * height
|
|
45630
|
-
zIndex: LAYOUT_LEVEL.dragMask
|
|
45618
|
+
height: (end - start) * height
|
|
45631
45619
|
}, dragMaskStyle), "rect"), {
|
|
45632
45620
|
start: start,
|
|
45633
45621
|
end: end
|
|
@@ -45651,8 +45639,7 @@
|
|
|
45651
45639
|
y: position.y,
|
|
45652
45640
|
width: width,
|
|
45653
45641
|
height: height,
|
|
45654
|
-
cursor: brushSelect ? "crosshair" : "auto"
|
|
45655
|
-
zIndex: LAYOUT_LEVEL.background
|
|
45642
|
+
cursor: brushSelect ? "crosshair" : "auto"
|
|
45656
45643
|
}, backgroundStyle), {
|
|
45657
45644
|
pickable: !zoomLock && (null === (_a = backgroundStyle.pickable) || void 0 === _a || _a)
|
|
45658
45645
|
}), "rect");
|
|
@@ -45685,8 +45672,7 @@
|
|
|
45685
45672
|
x: position.x + start * width,
|
|
45686
45673
|
y: position.y - middleHandlerBackgroundSize,
|
|
45687
45674
|
width: (end - start) * width,
|
|
45688
|
-
height: middleHandlerBackgroundSize
|
|
45689
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45675
|
+
height: middleHandlerBackgroundSize
|
|
45690
45676
|
}, null === (_d = middleHandlerStyle.background) || void 0 === _d ? void 0 : _d.style), {
|
|
45691
45677
|
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)
|
|
45692
45678
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -45694,29 +45680,24 @@
|
|
|
45694
45680
|
y: position.y - middleHandlerBackgroundSize / 2,
|
|
45695
45681
|
strokeBoundsBuffer: 0,
|
|
45696
45682
|
angle: 0,
|
|
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
|
|
45683
|
+
symbolType: null !== (_j = null === (_h = middleHandlerStyle.icon) || void 0 === _h ? void 0 : _h.symbolType) && void 0 !== _j ? _j : "square"
|
|
45699
45684
|
}, middleHandlerStyle.icon), {
|
|
45700
45685
|
pickable: !zoomLock && (null === (_k = middleHandlerStyle.icon.pickable) || void 0 === _k || _k)
|
|
45701
45686
|
}), "symbol");
|
|
45702
45687
|
}
|
|
45703
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
45688
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
45704
45689
|
x: position.x + start * width,
|
|
45705
45690
|
y: position.y + height / 2,
|
|
45706
45691
|
size: height,
|
|
45707
45692
|
symbolType: null !== (_l = startHandlerStyle.symbolType) && void 0 !== _l ? _l : "square"
|
|
45708
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45709
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45710
|
-
}), startHandlerStyle), {
|
|
45693
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), {
|
|
45711
45694
|
pickable: !zoomLock && (null === (_m = startHandlerStyle.pickable) || void 0 === _m || _m)
|
|
45712
|
-
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign(
|
|
45695
|
+
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
45713
45696
|
x: position.x + end * width,
|
|
45714
45697
|
y: position.y + height / 2,
|
|
45715
45698
|
size: height,
|
|
45716
45699
|
symbolType: null !== (_o = endHandlerStyle.symbolType) && void 0 !== _o ? _o : "square"
|
|
45717
|
-
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45718
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45719
|
-
}), endHandlerStyle), {
|
|
45700
|
+
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), {
|
|
45720
45701
|
pickable: !zoomLock && (null === (_p = endHandlerStyle.pickable) || void 0 === _p || _p)
|
|
45721
45702
|
}), "symbol");
|
|
45722
45703
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize),
|
|
@@ -45730,7 +45711,7 @@
|
|
|
45730
45711
|
height: startHandlerHeight,
|
|
45731
45712
|
fill: "white",
|
|
45732
45713
|
fillOpacity: 0,
|
|
45733
|
-
zIndex:
|
|
45714
|
+
zIndex: 999
|
|
45734
45715
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45735
45716
|
pickable: !zoomLock
|
|
45736
45717
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -45740,7 +45721,7 @@
|
|
|
45740
45721
|
height: endHandlerHeight,
|
|
45741
45722
|
fill: "white",
|
|
45742
45723
|
fillOpacity: 0,
|
|
45743
|
-
zIndex:
|
|
45724
|
+
zIndex: 999
|
|
45744
45725
|
}, DEFAULT_HANDLER_ATTR_MAP.horizontal), {
|
|
45745
45726
|
pickable: !zoomLock
|
|
45746
45727
|
}), "rect");
|
|
@@ -45751,8 +45732,7 @@
|
|
|
45751
45732
|
x: "left" === orient ? position.x - middleHandlerBackgroundSize : position.x + width,
|
|
45752
45733
|
y: position.y + start * height,
|
|
45753
45734
|
width: middleHandlerBackgroundSize,
|
|
45754
|
-
height: (end - start) * height
|
|
45755
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45735
|
+
height: (end - start) * height
|
|
45756
45736
|
}, null === (_r = middleHandlerStyle.background) || void 0 === _r ? void 0 : _r.style), {
|
|
45757
45737
|
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)
|
|
45758
45738
|
}), "rect"), this._middleHandlerSymbol = group.createOrUpdateChild("middleHandlerSymbol", Object.assign(Object.assign({
|
|
@@ -45760,27 +45740,23 @@
|
|
|
45760
45740
|
y: position.y + (start + end) / 2 * height,
|
|
45761
45741
|
angle: Math.PI / 180 * 90,
|
|
45762
45742
|
symbolType: null !== (_w = null === (_v = middleHandlerStyle.icon) || void 0 === _v ? void 0 : _v.symbolType) && void 0 !== _w ? _w : "square",
|
|
45763
|
-
strokeBoundsBuffer: 0
|
|
45764
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45743
|
+
strokeBoundsBuffer: 0
|
|
45765
45744
|
}, middleHandlerStyle.icon), {
|
|
45766
45745
|
pickable: !zoomLock && (null === (_y = null === (_x = middleHandlerStyle.icon) || void 0 === _x ? void 0 : _x.pickable) || void 0 === _y || _y)
|
|
45767
45746
|
}), "symbol");
|
|
45768
45747
|
}
|
|
45769
|
-
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign(
|
|
45748
|
+
this._startHandler = group.createOrUpdateChild("startHandler", Object.assign(Object.assign(Object.assign({
|
|
45770
45749
|
x: position.x + width / 2,
|
|
45771
45750
|
y: position.y + start * height,
|
|
45772
45751
|
size: width,
|
|
45773
45752
|
symbolType: null !== (_z = startHandlerStyle.symbolType) && void 0 !== _z ? _z : "square"
|
|
45774
|
-
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45775
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45776
|
-
}), startHandlerStyle), {
|
|
45753
|
+
}, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), {
|
|
45777
45754
|
pickable: !zoomLock && (null === (_0 = startHandlerStyle.pickable) || void 0 === _0 || _0)
|
|
45778
45755
|
}), "symbol"), this._endHandler = group.createOrUpdateChild("endHandler", Object.assign(Object.assign(Object.assign({
|
|
45779
45756
|
x: position.x + width / 2,
|
|
45780
45757
|
y: position.y + end * height,
|
|
45781
45758
|
size: width,
|
|
45782
|
-
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
45783
|
-
zIndex: LAYOUT_LEVEL.handler
|
|
45759
|
+
symbolType: null !== (_1 = endHandlerStyle.symbolType) && void 0 !== _1 ? _1 : "square"
|
|
45784
45760
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), {
|
|
45785
45761
|
pickable: !zoomLock && (null === (_2 = endHandlerStyle.pickable) || void 0 === _2 || _2)
|
|
45786
45762
|
}), "symbol");
|
|
@@ -45795,7 +45771,7 @@
|
|
|
45795
45771
|
height: endHandlerWidth,
|
|
45796
45772
|
fill: "white",
|
|
45797
45773
|
fillOpacity: 0,
|
|
45798
|
-
zIndex:
|
|
45774
|
+
zIndex: 999
|
|
45799
45775
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45800
45776
|
pickable: !zoomLock
|
|
45801
45777
|
}), "rect"), this._endHandlerMask = group.createOrUpdateChild("endHandlerMask", Object.assign(Object.assign({
|
|
@@ -45805,7 +45781,7 @@
|
|
|
45805
45781
|
height: endHandlerWidth,
|
|
45806
45782
|
fill: "white",
|
|
45807
45783
|
fillOpacity: 0,
|
|
45808
|
-
zIndex:
|
|
45784
|
+
zIndex: 999
|
|
45809
45785
|
}, DEFAULT_HANDLER_ATTR_MAP.vertical), {
|
|
45810
45786
|
pickable: !zoomLock
|
|
45811
45787
|
}), "rect");
|
|
@@ -45834,8 +45810,7 @@
|
|
|
45834
45810
|
y: position.y,
|
|
45835
45811
|
width: (end - start) * width,
|
|
45836
45812
|
height: height,
|
|
45837
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
45838
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
45813
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
45839
45814
|
}, selectedBackgroundStyle), {
|
|
45840
45815
|
pickable: !zoomLock && (null === (_a = selectedBackgroundChartStyle.pickable) || void 0 === _a || _a)
|
|
45841
45816
|
}), "rect") : this._selectedBackground = group.createOrUpdateChild("selectedBackground", Object.assign(Object.assign({
|
|
@@ -45843,16 +45818,14 @@
|
|
|
45843
45818
|
y: position.y + start * height,
|
|
45844
45819
|
width: width,
|
|
45845
45820
|
height: (end - start) * height,
|
|
45846
|
-
cursor: brushSelect ? "crosshair" : "move"
|
|
45847
|
-
zIndex: LAYOUT_LEVEL.selectedBackground
|
|
45821
|
+
cursor: brushSelect ? "crosshair" : "move"
|
|
45848
45822
|
}, selectedBackgroundStyle), {
|
|
45849
45823
|
pickable: !zoomLock && (null === (_b = selectedBackgroundStyle.pickable) || void 0 === _b || _b)
|
|
45850
45824
|
}), "rect");
|
|
45851
45825
|
}
|
|
45852
45826
|
_setPreviewAttributes(type, group) {
|
|
45853
45827
|
this._previewGroup || (this._previewGroup = group.createOrUpdateChild("previewGroup", {
|
|
45854
|
-
pickable: !1
|
|
45855
|
-
zIndex: LAYOUT_LEVEL.preview
|
|
45828
|
+
pickable: !1
|
|
45856
45829
|
}, "group")), "line" === type ? this._previewLine = this._previewGroup.createOrUpdateChild("previewLine", {}, "line") : this._previewArea = this._previewGroup.createOrUpdateChild("previewArea", {
|
|
45857
45830
|
curveType: "basis"
|
|
45858
45831
|
}, "area");
|
|
@@ -45871,8 +45844,7 @@
|
|
|
45871
45844
|
}
|
|
45872
45845
|
_setSelectedPreviewClipAttributes(type, group) {
|
|
45873
45846
|
this._selectedPreviewGroupClip || (this._selectedPreviewGroupClip = group.createOrUpdateChild("selectedPreviewGroupClip", {
|
|
45874
|
-
pickable: !1
|
|
45875
|
-
zIndex: LAYOUT_LEVEL.selectedPreview
|
|
45847
|
+
pickable: !1
|
|
45876
45848
|
}, "group"), this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup", {}, "group"));
|
|
45877
45849
|
const {
|
|
45878
45850
|
start: start,
|
|
@@ -58780,6 +58752,9 @@
|
|
|
58780
58752
|
return;
|
|
58781
58753
|
}
|
|
58782
58754
|
this._product = mark.getProduct();
|
|
58755
|
+
if (!this._product) {
|
|
58756
|
+
return;
|
|
58757
|
+
}
|
|
58783
58758
|
this._product.clearStates();
|
|
58784
58759
|
this._graphics = mark.getGraphics();
|
|
58785
58760
|
this._graphics.forEach(g => {
|
|
@@ -58863,7 +58838,7 @@
|
|
|
58863
58838
|
});
|
|
58864
58839
|
}
|
|
58865
58840
|
return config
|
|
58866
|
-
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (
|
|
58841
|
+
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
|
|
58867
58842
|
}
|
|
58868
58843
|
tryRunMorphing(graphics) {
|
|
58869
58844
|
if (this._lastMark) {
|
|
@@ -63734,7 +63709,7 @@
|
|
|
63734
63709
|
attributeContext: this._markAttributeContext,
|
|
63735
63710
|
componentType: option.componentType,
|
|
63736
63711
|
noSeparateStyle,
|
|
63737
|
-
parent: parent !== false ?
|
|
63712
|
+
parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
|
|
63738
63713
|
});
|
|
63739
63714
|
if (isValid$1(m)) {
|
|
63740
63715
|
const spec = this.getSpec() || {};
|
|
@@ -99353,7 +99328,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99353
99328
|
_handleDataCollectionChange() {
|
|
99354
99329
|
const data = this._data.getDataView();
|
|
99355
99330
|
data.reRunAllTransform();
|
|
99356
|
-
this._initAfterLayout();
|
|
99357
99331
|
const domain = this._computeDomainOfValueScale();
|
|
99358
99332
|
if (domain) {
|
|
99359
99333
|
if (!this._valueScale) {
|
|
@@ -99594,7 +99568,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99594
99568
|
}
|
|
99595
99569
|
_createOrUpdateComponent(changeData) {
|
|
99596
99570
|
if (this._visible) {
|
|
99597
|
-
const
|
|
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;
|
|
99598
99574
|
const attrs = this._getAttrs(isNeedPreview);
|
|
99599
99575
|
const axis = this._relatedAxisComponent;
|
|
99600
99576
|
if (this._component) {
|
|
@@ -99759,8 +99735,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99759
99735
|
}
|
|
99760
99736
|
this._start = start;
|
|
99761
99737
|
this._end = end;
|
|
99762
|
-
const
|
|
99763
|
-
const
|
|
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
99742
|
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
99765
99743
|
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
99766
99744
|
: this._handleStateChange(startValue, endValue);
|
|
@@ -104030,23 +104008,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
104030
104008
|
const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
|
|
104031
104009
|
const { x1, x2, y1, y2 } = operateMaskBounds;
|
|
104032
104010
|
const regionStartAttr = isHorizontal ? 'x' : 'y';
|
|
104011
|
+
const regionSizeAttr = isHorizontal ? 'width' : 'height';
|
|
104033
104012
|
const boundsStart = isHorizontal ? x1 : y1;
|
|
104034
104013
|
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);
|
|
104046
104014
|
if (this._axisDataZoomMap[axis.id]) {
|
|
104047
104015
|
const dataZoom = this._axisDataZoomMap[axis.id];
|
|
104048
|
-
const
|
|
104049
|
-
const
|
|
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
104020
|
dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
|
|
104051
104021
|
'percent',
|
|
104052
104022
|
'percent'
|
|
@@ -104060,6 +104030,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
104060
104030
|
});
|
|
104061
104031
|
}
|
|
104062
104032
|
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);
|
|
104063
104044
|
axis.scaleRangeFactor([newStart, newEnd]);
|
|
104064
104045
|
axis.effect.scaleUpdate();
|
|
104065
104046
|
this._zoomRecord.push({
|