@visactor/vchart 2.0.20-alpha.6 → 2.0.20
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 +72 -46
- package/build/index.js +72 -46
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/brush/brush.js +12 -15
- 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/constant/gradient.js +1 -2
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -1
- package/cjs/constant/word-cloud.js +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- 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 +9 -12
- 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/constant/gradient.js +1 -2
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -1
- package/esm/constant/word-cloud.js +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- 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,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),
|
|
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),
|
|
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:
|
|
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:
|
|
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),
|
|
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:
|
|
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:
|
|
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) {
|
|
@@ -58832,7 +58862,7 @@ class BaseMark extends GrammarItem {
|
|
|
58832
58862
|
});
|
|
58833
58863
|
}
|
|
58834
58864
|
return config
|
|
58835
|
-
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
|
|
58865
|
+
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
|
|
58836
58866
|
}
|
|
58837
58867
|
tryRunMorphing(graphics) {
|
|
58838
58868
|
if (this._lastMark) {
|
|
@@ -61899,7 +61929,7 @@ const lookup = (data, opt) => {
|
|
|
61899
61929
|
});
|
|
61900
61930
|
};
|
|
61901
61931
|
|
|
61902
|
-
const version = "2.0.
|
|
61932
|
+
const version = "2.0.20";
|
|
61903
61933
|
|
|
61904
61934
|
const addVChartProperty = (data, op) => {
|
|
61905
61935
|
const context = op.beforeCall();
|
|
@@ -63703,7 +63733,7 @@ class BaseSeries extends BaseModel {
|
|
|
63703
63733
|
attributeContext: this._markAttributeContext,
|
|
63704
63734
|
componentType: option.componentType,
|
|
63705
63735
|
noSeparateStyle,
|
|
63706
|
-
parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
|
|
63736
|
+
parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
|
|
63707
63737
|
});
|
|
63708
63738
|
if (isValid$1(m)) {
|
|
63709
63739
|
const spec = this.getSpec() || {};
|
|
@@ -99322,6 +99352,7 @@ class DataZoom extends DataFilterBaseComponent {
|
|
|
99322
99352
|
_handleDataCollectionChange() {
|
|
99323
99353
|
const data = this._data.getDataView();
|
|
99324
99354
|
data.reRunAllTransform();
|
|
99355
|
+
this._initAfterLayout();
|
|
99325
99356
|
const domain = this._computeDomainOfValueScale();
|
|
99326
99357
|
if (domain) {
|
|
99327
99358
|
if (!this._valueScale) {
|
|
@@ -99562,9 +99593,7 @@ class DataZoom extends DataFilterBaseComponent {
|
|
|
99562
99593
|
}
|
|
99563
99594
|
_createOrUpdateComponent(changeData) {
|
|
99564
99595
|
if (this._visible) {
|
|
99565
|
-
const
|
|
99566
|
-
const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
|
|
99567
|
-
const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
|
|
99596
|
+
const isNeedPreview = this._spec.showBackgroundChart !== false;
|
|
99568
99597
|
const attrs = this._getAttrs(isNeedPreview);
|
|
99569
99598
|
const axis = this._relatedAxisComponent;
|
|
99570
99599
|
if (this._component) {
|
|
@@ -104002,15 +104031,23 @@ class Brush extends BaseComponent {
|
|
|
104002
104031
|
const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
|
|
104003
104032
|
const { x1, x2, y1, y2 } = operateMaskBounds;
|
|
104004
104033
|
const regionStartAttr = isHorizontal ? 'x' : 'y';
|
|
104005
|
-
const regionSizeAttr = isHorizontal ? 'width' : 'height';
|
|
104006
104034
|
const boundsStart = isHorizontal ? x1 : y1;
|
|
104007
104035
|
const boundsEnd = isHorizontal ? x2 : y2;
|
|
104036
|
+
const range = axis.getScale().range();
|
|
104037
|
+
const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
104038
|
+
const isAxisReverse = last(range) < range[0];
|
|
104039
|
+
const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
|
|
104040
|
+
const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
|
|
104041
|
+
const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
|
|
104042
|
+
const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
|
|
104043
|
+
const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
104044
|
+
const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
104045
|
+
const newStart = this._stateClamp(start - axisRangeExpand);
|
|
104046
|
+
const newEnd = this._stateClamp(end + axisRangeExpand);
|
|
104008
104047
|
if (this._axisDataZoomMap[axis.id]) {
|
|
104009
104048
|
const dataZoom = this._axisDataZoomMap[axis.id];
|
|
104010
|
-
const
|
|
104011
|
-
const
|
|
104012
|
-
const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
|
|
104013
|
-
const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
|
|
104049
|
+
const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
|
|
104050
|
+
const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
|
|
104014
104051
|
dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
|
|
104015
104052
|
'percent',
|
|
104016
104053
|
'percent'
|
|
@@ -104024,17 +104061,6 @@ class Brush extends BaseComponent {
|
|
|
104024
104061
|
});
|
|
104025
104062
|
}
|
|
104026
104063
|
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
104064
|
axis.scaleRangeFactor([newStart, newEnd]);
|
|
104039
104065
|
axis.effect.scaleUpdate();
|
|
104040
104066
|
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),
|
|
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),
|
|
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:
|
|
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:
|
|
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),
|
|
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:
|
|
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:
|
|
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) {
|
|
@@ -58838,7 +58868,7 @@
|
|
|
58838
58868
|
});
|
|
58839
58869
|
}
|
|
58840
58870
|
return config
|
|
58841
|
-
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
|
|
58871
|
+
? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? ((_a = config.priority) !== null && _a !== void 0 ? _a : Infinity) : config.priority }) : config;
|
|
58842
58872
|
}
|
|
58843
58873
|
tryRunMorphing(graphics) {
|
|
58844
58874
|
if (this._lastMark) {
|
|
@@ -61905,7 +61935,7 @@
|
|
|
61905
61935
|
});
|
|
61906
61936
|
};
|
|
61907
61937
|
|
|
61908
|
-
const version = "2.0.
|
|
61938
|
+
const version = "2.0.20";
|
|
61909
61939
|
|
|
61910
61940
|
const addVChartProperty = (data, op) => {
|
|
61911
61941
|
const context = op.beforeCall();
|
|
@@ -63709,7 +63739,7 @@
|
|
|
63709
63739
|
attributeContext: this._markAttributeContext,
|
|
63710
63740
|
componentType: option.componentType,
|
|
63711
63741
|
noSeparateStyle,
|
|
63712
|
-
parent: parent !== false ? parent !== null && parent !== void 0 ? parent : this._rootMark : null
|
|
63742
|
+
parent: parent !== false ? (parent !== null && parent !== void 0 ? parent : this._rootMark) : null
|
|
63713
63743
|
});
|
|
63714
63744
|
if (isValid$1(m)) {
|
|
63715
63745
|
const spec = this.getSpec() || {};
|
|
@@ -99328,6 +99358,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99328
99358
|
_handleDataCollectionChange() {
|
|
99329
99359
|
const data = this._data.getDataView();
|
|
99330
99360
|
data.reRunAllTransform();
|
|
99361
|
+
this._initAfterLayout();
|
|
99331
99362
|
const domain = this._computeDomainOfValueScale();
|
|
99332
99363
|
if (domain) {
|
|
99333
99364
|
if (!this._valueScale) {
|
|
@@ -99568,9 +99599,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99568
99599
|
}
|
|
99569
99600
|
_createOrUpdateComponent(changeData) {
|
|
99570
99601
|
if (this._visible) {
|
|
99571
|
-
const
|
|
99572
|
-
const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
|
|
99573
|
-
const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
|
|
99602
|
+
const isNeedPreview = this._spec.showBackgroundChart !== false;
|
|
99574
99603
|
const attrs = this._getAttrs(isNeedPreview);
|
|
99575
99604
|
const axis = this._relatedAxisComponent;
|
|
99576
99605
|
if (this._component) {
|
|
@@ -104008,15 +104037,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
104008
104037
|
const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
|
|
104009
104038
|
const { x1, x2, y1, y2 } = operateMaskBounds;
|
|
104010
104039
|
const regionStartAttr = isHorizontal ? 'x' : 'y';
|
|
104011
|
-
const regionSizeAttr = isHorizontal ? 'width' : 'height';
|
|
104012
104040
|
const boundsStart = isHorizontal ? x1 : y1;
|
|
104013
104041
|
const boundsEnd = isHorizontal ? x2 : y2;
|
|
104042
|
+
const range = axis.getScale().range();
|
|
104043
|
+
const rangeFactor = (_b = axis.scaleRangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
104044
|
+
const isAxisReverse = last(range) < range[0];
|
|
104045
|
+
const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
|
|
104046
|
+
const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
|
|
104047
|
+
const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
|
|
104048
|
+
const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
|
|
104049
|
+
const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
104050
|
+
const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
104051
|
+
const newStart = this._stateClamp(start - axisRangeExpand);
|
|
104052
|
+
const newEnd = this._stateClamp(end + axisRangeExpand);
|
|
104014
104053
|
if (this._axisDataZoomMap[axis.id]) {
|
|
104015
104054
|
const dataZoom = this._axisDataZoomMap[axis.id];
|
|
104016
|
-
const
|
|
104017
|
-
const
|
|
104018
|
-
const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
|
|
104019
|
-
const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
|
|
104055
|
+
const newStartPercent = isAxisReverse ? 1 - newStart : newStart;
|
|
104056
|
+
const newEndPercent = isAxisReverse ? 1 - newEnd : newEnd;
|
|
104020
104057
|
dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
|
|
104021
104058
|
'percent',
|
|
104022
104059
|
'percent'
|
|
@@ -104030,17 +104067,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
104030
104067
|
});
|
|
104031
104068
|
}
|
|
104032
104069
|
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
104070
|
axis.scaleRangeFactor([newStart, newEnd]);
|
|
104045
104071
|
axis.effect.scaleUpdate();
|
|
104046
104072
|
this._zoomRecord.push({
|