@visactor/vchart 2.0.8-alpha.5 → 2.0.9
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 +908 -583
- package/build/index.js +908 -583
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/config.d.ts +1 -0
- package/cjs/animation/config.js +13 -1
- package/cjs/animation/config.js.map +1 -1
- package/cjs/chart/base/base-chart.d.ts +0 -2
- package/cjs/chart/base/base-chart.js +2 -16
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +0 -2
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/compile/compiler.d.ts +5 -0
- package/cjs/compile/compiler.js +42 -4
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +2 -0
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -1
- package/cjs/component/axis/base-axis.js +1 -1
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +1 -1
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +1 -1
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/interface/common.d.ts +1 -0
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +2 -0
- package/cjs/component/axis/mixin/band-axis-mixin.js +10 -4
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +15 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +1 -1
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/axis/polar/band-axis.d.ts +1 -1
- package/cjs/component/axis/polar/band-axis.js.map +1 -1
- package/cjs/component/brush/brush.js +6 -5
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +31 -52
- package/cjs/component/data-zoom/data-filter-base-component.js +164 -240
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-event.d.ts +53 -0
- package/cjs/component/data-zoom/data-filter-event.js +112 -0
- package/cjs/component/data-zoom/data-filter-event.js.map +1 -0
- package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +129 -84
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +35 -36
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/cjs/component/data-zoom/util.d.ts +14 -0
- package/cjs/component/data-zoom/util.js +81 -7
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/constant/event.d.ts +1 -0
- package/cjs/constant/event.js +8 -8
- package/cjs/constant/event.js.map +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/vchart.d.ts +0 -2
- package/cjs/core/vchart.js +0 -4
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +2 -1
- package/cjs/mark/base/base-mark.js +7 -3
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +1 -0
- package/cjs/mark/interface/common.js.map +1 -1
- package/cjs/plugin/other.js +2 -1
- package/cjs/plugin/other.js.map +1 -1
- package/cjs/series/bar/bar.js +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +1 -0
- package/cjs/series/base/base-series.js +7 -2
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/dot/dot.js +6 -2
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/util/stack.js +1 -1
- package/cjs/series/util/stack.js.map +1 -1
- package/cjs/typings/spec/common.js.map +1 -1
- package/esm/animation/config.d.ts +1 -0
- package/esm/animation/config.js +8 -1
- package/esm/animation/config.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +0 -2
- package/esm/chart/base/base-chart.js +2 -15
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +0 -2
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/compile/compiler.d.ts +5 -0
- package/esm/compile/compiler.js +44 -4
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +2 -0
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -1
- package/esm/component/axis/base-axis.js +1 -1
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +1 -1
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +1 -1
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/interface/common.d.ts +1 -0
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +2 -0
- package/esm/component/axis/mixin/band-axis-mixin.js +10 -4
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +5 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +15 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +1 -1
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/axis/polar/band-axis.d.ts +1 -1
- package/esm/component/axis/polar/band-axis.js.map +1 -1
- package/esm/component/brush/brush.js +6 -4
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +31 -52
- package/esm/component/data-zoom/data-filter-base-component.js +155 -232
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-filter-event.d.ts +53 -0
- package/esm/component/data-zoom/data-filter-event.js +108 -0
- package/esm/component/data-zoom/data-filter-event.js.map +1 -0
- package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +23 -12
- package/esm/component/data-zoom/data-zoom/data-zoom.js +125 -82
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +4 -3
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js +36 -36
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/esm/component/data-zoom/util.d.ts +14 -0
- package/esm/component/data-zoom/util.js +63 -7
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/constant/event.d.ts +1 -0
- package/esm/constant/event.js +8 -8
- package/esm/constant/event.js.map +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/vchart.d.ts +0 -2
- package/esm/core/vchart.js +0 -4
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +2 -1
- package/esm/mark/base/base-mark.js +7 -3
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/interface/common.d.ts +1 -0
- package/esm/mark/interface/common.js.map +1 -1
- package/esm/plugin/other.js +2 -2
- package/esm/plugin/other.js.map +1 -1
- package/esm/series/bar/bar.js +2 -2
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.d.ts +1 -0
- package/esm/series/base/base-series.js +6 -2
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/dot/dot.js +6 -2
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/util/stack.js +2 -2
- package/esm/series/util/stack.js.map +1 -1
- package/esm/typings/spec/common.js.map +1 -1
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -43202,7 +43202,16 @@
|
|
|
43202
43202
|
data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
|
|
43203
43203
|
}
|
|
43204
43204
|
let labels = this._initText(data);
|
|
43205
|
-
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels)
|
|
43205
|
+
labels = isFunction$1(customLayoutFunc) ? customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this) : this._layout(labels);
|
|
43206
|
+
const filteredLabels = [],
|
|
43207
|
+
overlapLabels = labels;
|
|
43208
|
+
if (!isBoolean$1(overlap) && isFunction$1(overlap.filterBeforeOverlap)) {
|
|
43209
|
+
const getRelatedGraphic = this.getRelatedGraphic.bind(this);
|
|
43210
|
+
labels.forEach(label => {
|
|
43211
|
+
overlap.filterBeforeOverlap(label, getRelatedGraphic, this) ? overlapLabels.push(label) : filteredLabels.push(label);
|
|
43212
|
+
});
|
|
43213
|
+
}
|
|
43214
|
+
isFunction$1(customOverlapFunc) ? labels = customOverlapFunc(overlapLabels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this).concat(filteredLabels) : !1 !== overlap && (labels = this._overlapping(overlapLabels).concat(filteredLabels)), isFunction$1(this.attribute.onAfterOverlapping) && this.attribute.onAfterOverlapping(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? d => this._idToPoint.get(d.id) : null, this), labels && labels.length && labels.forEach(label => {
|
|
43206
43215
|
this._bindEvent(label), this._setStatesOfText(label);
|
|
43207
43216
|
}), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels), !1 !== this._enableAnimation && this._baseMarks.forEach((mark, index) => {
|
|
43208
43217
|
mark.initAttributes(markAttributeList[index]);
|
|
@@ -45471,15 +45480,18 @@
|
|
|
45471
45480
|
pickable: !1
|
|
45472
45481
|
}, selectedBackgroundChartStyle.area));
|
|
45473
45482
|
}
|
|
45474
|
-
_computeBasePoints() {
|
|
45483
|
+
_computeBasePoints(points) {
|
|
45475
45484
|
const {
|
|
45476
45485
|
orient: orient
|
|
45477
45486
|
} = this.attribute,
|
|
45478
|
-
|
|
45479
|
-
|
|
45480
|
-
|
|
45481
|
-
|
|
45482
|
-
|
|
45487
|
+
key = "bottom" === orient || "top" === orient ? "x" : "y";
|
|
45488
|
+
let lastPointSide = Math.sign(points[points.length - 1][key] - points[0][key]);
|
|
45489
|
+
0 === lastPointSide && (lastPointSide = 1);
|
|
45490
|
+
const {
|
|
45491
|
+
position: position,
|
|
45492
|
+
width: width,
|
|
45493
|
+
height: height
|
|
45494
|
+
} = this._getLayoutAttrFromConfig();
|
|
45483
45495
|
let basePointStart, basePointEnd;
|
|
45484
45496
|
return this._isHorizontal ? (basePointStart = [{
|
|
45485
45497
|
x: position.x,
|
|
@@ -45499,7 +45511,10 @@
|
|
|
45499
45511
|
}], basePointEnd = [{
|
|
45500
45512
|
x: position.x,
|
|
45501
45513
|
y: position.y
|
|
45502
|
-
}]), {
|
|
45514
|
+
}]), Math.sign(basePointEnd[0][key] - basePointStart[0][key]) !== lastPointSide ? {
|
|
45515
|
+
basePointStart: basePointEnd,
|
|
45516
|
+
basePointEnd: basePointStart
|
|
45517
|
+
} : {
|
|
45503
45518
|
basePointStart: basePointStart,
|
|
45504
45519
|
basePointEnd: basePointEnd
|
|
45505
45520
|
};
|
|
@@ -45522,7 +45537,7 @@
|
|
|
45522
45537
|
const {
|
|
45523
45538
|
basePointStart: basePointStart,
|
|
45524
45539
|
basePointEnd: basePointEnd
|
|
45525
|
-
} = this._computeBasePoints();
|
|
45540
|
+
} = this._computeBasePoints(previewPoints);
|
|
45526
45541
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
45527
45542
|
}
|
|
45528
45543
|
_getPreviewAreaPoints() {
|
|
@@ -45537,7 +45552,7 @@
|
|
|
45537
45552
|
const {
|
|
45538
45553
|
basePointStart: basePointStart,
|
|
45539
45554
|
basePointEnd: basePointEnd
|
|
45540
|
-
} = this._computeBasePoints();
|
|
45555
|
+
} = this._computeBasePoints(previewPoints);
|
|
45541
45556
|
return basePointStart.concat(previewPoints).concat(basePointEnd);
|
|
45542
45557
|
}
|
|
45543
45558
|
renderText() {
|
|
@@ -45950,11 +45965,12 @@
|
|
|
45950
45965
|
})));
|
|
45951
45966
|
}
|
|
45952
45967
|
setAttributes(params, forceUpdateTag) {
|
|
45968
|
+
var _a, _b;
|
|
45953
45969
|
const {
|
|
45954
45970
|
start: start,
|
|
45955
45971
|
end: end
|
|
45956
45972
|
} = this.attribute;
|
|
45957
|
-
start && (this._state.start = start), end && (this._state.end = end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
|
|
45973
|
+
start && (this._state.start = null !== (_a = params.start) && void 0 !== _a ? _a : start), end && (this._state.end = null !== (_b = params.end) && void 0 !== _b ? _b : end), this._renderer.setAttributes(this._getRendererAttrs()), this._interaction.setAttributes(this._getInteractionAttrs()), super.setAttributes(params, forceUpdateTag);
|
|
45958
45974
|
}
|
|
45959
45975
|
render() {
|
|
45960
45976
|
this._layoutCacheFromConfig = null, this._container = this.createOrUpdateChild("datazoom-container", {}, "group"), this._renderer.renderDataZoom(), this._interaction.setAttributes(this._getInteractionAttrs());
|
|
@@ -53708,6 +53724,7 @@
|
|
|
53708
53724
|
ChartEvent["markDeltaYUpdate"] = "markDeltaYUpdate";
|
|
53709
53725
|
ChartEvent["viewDataLabelUpdate"] = "viewDataLabelUpdate";
|
|
53710
53726
|
ChartEvent["scaleDomainUpdate"] = "scaleDomainUpdate";
|
|
53727
|
+
ChartEvent["scaleRawDomainUpdate"] = "scaleRawDomainUpdate";
|
|
53711
53728
|
ChartEvent["scaleUpdate"] = "scaleUpdate";
|
|
53712
53729
|
ChartEvent["dataZoomChange"] = "dataZoomChange";
|
|
53713
53730
|
ChartEvent["drill"] = "drill";
|
|
@@ -54729,6 +54746,7 @@
|
|
|
54729
54746
|
var _a, _b, _c, _d, _e, _f;
|
|
54730
54747
|
(_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeDoRender) === null || _b === void 0 ? void 0 : _b.call(_a, this._compileChart.getOption().globalInstance);
|
|
54731
54748
|
if (this._stage) {
|
|
54749
|
+
this.runStageAnimation();
|
|
54732
54750
|
this._rootMarks.forEach(g => {
|
|
54733
54751
|
traverseGroupMark(g, m => {
|
|
54734
54752
|
if (m.needClear) {
|
|
@@ -54771,6 +54789,7 @@
|
|
|
54771
54789
|
this.handleLayoutEnd();
|
|
54772
54790
|
}
|
|
54773
54791
|
this.findProgressiveMarks();
|
|
54792
|
+
this.updateStateAnimation();
|
|
54774
54793
|
this._doRender(true);
|
|
54775
54794
|
this.doPreProgressive();
|
|
54776
54795
|
log(`--- start of renderMarks(${this._count}) ---`);
|
|
@@ -54816,6 +54835,67 @@
|
|
|
54816
54835
|
this.renderMarks();
|
|
54817
54836
|
}
|
|
54818
54837
|
}
|
|
54838
|
+
setStageAnimationConfig(config) {
|
|
54839
|
+
const animationConfig = {};
|
|
54840
|
+
Object.keys(config).forEach(key => {
|
|
54841
|
+
const value = config[key];
|
|
54842
|
+
if (isArray$1(value)) {
|
|
54843
|
+
animationConfig[key] = value.map(item => {
|
|
54844
|
+
var _a;
|
|
54845
|
+
const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
|
|
54846
|
+
return Object.assign(Object.assign({}, item), { options: (...args) => {
|
|
54847
|
+
const _options = typeof options === 'function' ? options(...args) : options;
|
|
54848
|
+
return Object.assign({}, _options);
|
|
54849
|
+
} });
|
|
54850
|
+
});
|
|
54851
|
+
}
|
|
54852
|
+
else {
|
|
54853
|
+
animationConfig[key] = Object.assign({}, config[key]);
|
|
54854
|
+
}
|
|
54855
|
+
});
|
|
54856
|
+
this._stateAnimationConfig = animationConfig;
|
|
54857
|
+
}
|
|
54858
|
+
updateStateAnimation() {
|
|
54859
|
+
const allMarks = [];
|
|
54860
|
+
this._rootMarks.forEach(mark => {
|
|
54861
|
+
traverseGroupMark(mark, m => {
|
|
54862
|
+
allMarks.push(m);
|
|
54863
|
+
});
|
|
54864
|
+
});
|
|
54865
|
+
const markAnimationStates = allMarks.map(mark => mark.getAnimationState());
|
|
54866
|
+
const animationState = markAnimationStates.every(state => state === AnimationStateEnum.appear)
|
|
54867
|
+
? AnimationStateEnum.appear
|
|
54868
|
+
: markAnimationStates.every(state => state === AnimationStateEnum.disappear)
|
|
54869
|
+
? AnimationStateEnum.disappear
|
|
54870
|
+
: AnimationStateEnum.none;
|
|
54871
|
+
if (!this._stage.context) {
|
|
54872
|
+
this._stage.context = {};
|
|
54873
|
+
}
|
|
54874
|
+
this._stage.context.animationState = animationState;
|
|
54875
|
+
}
|
|
54876
|
+
runStageAnimation() {
|
|
54877
|
+
var _a;
|
|
54878
|
+
const animationState = (_a = this._stage.context) === null || _a === void 0 ? void 0 : _a.animationState;
|
|
54879
|
+
if (!this._stateAnimationConfig || animationState === AnimationStateEnum.none) {
|
|
54880
|
+
return;
|
|
54881
|
+
}
|
|
54882
|
+
const animationConfigs = array(this._stateAnimationConfig[animationState]).filter(config => config.type);
|
|
54883
|
+
if (!animationConfigs.length) {
|
|
54884
|
+
return;
|
|
54885
|
+
}
|
|
54886
|
+
if (animationState === AnimationStateEnum.appear) {
|
|
54887
|
+
this._stage.stopAnimationState(AnimationStateEnum.disappear);
|
|
54888
|
+
}
|
|
54889
|
+
else if (animationState === AnimationStateEnum.disappear) {
|
|
54890
|
+
this._stage.stopAnimationState(AnimationStateEnum.appear);
|
|
54891
|
+
}
|
|
54892
|
+
this._stage.applyAnimationState([animationState], [
|
|
54893
|
+
{
|
|
54894
|
+
name: animationState,
|
|
54895
|
+
animation: animationConfigs
|
|
54896
|
+
}
|
|
54897
|
+
]);
|
|
54898
|
+
}
|
|
54819
54899
|
updateViewBox(viewBox, reRender = true) {
|
|
54820
54900
|
if (!this._stage) {
|
|
54821
54901
|
return;
|
|
@@ -58285,6 +58365,15 @@
|
|
|
58285
58365
|
: () => 'key';
|
|
58286
58366
|
this._dataByGroup = groupData(data, this._groupKeyGetter);
|
|
58287
58367
|
}
|
|
58368
|
+
getAnimationState() {
|
|
58369
|
+
const graphicsAnimationStates = this._graphics.map(g => g.context.animationState);
|
|
58370
|
+
const animationState = graphicsAnimationStates.every(state => state === AnimationStateEnum.appear)
|
|
58371
|
+
? AnimationStateEnum.appear
|
|
58372
|
+
: graphicsAnimationStates.every(state => state === AnimationStateEnum.disappear)
|
|
58373
|
+
? AnimationStateEnum.disappear
|
|
58374
|
+
: graphicsAnimationStates[0];
|
|
58375
|
+
return animationState !== null && animationState !== void 0 ? animationState : AnimationStateEnum.none;
|
|
58376
|
+
}
|
|
58288
58377
|
createAnimationStateList(type, animationConfig) {
|
|
58289
58378
|
var _a;
|
|
58290
58379
|
let config = animationConfig[type];
|
|
@@ -58539,14 +58628,14 @@
|
|
|
58539
58628
|
_runApplyGraphic(graphics) {
|
|
58540
58629
|
const hasAnimation = this.hasAnimation();
|
|
58541
58630
|
graphics.forEach((g, index) => {
|
|
58542
|
-
var _a;
|
|
58631
|
+
var _a, _b;
|
|
58543
58632
|
const finalAttrs = g.context.finalAttrs;
|
|
58544
58633
|
const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
58545
58634
|
if (!g.setAttributes) {
|
|
58546
58635
|
const mockGraphic = g;
|
|
58547
58636
|
g = this._createGraphic(finalAttrs);
|
|
58548
58637
|
if (hasAnimation) {
|
|
58549
|
-
g.setFinalAttributes(finalAttrs);
|
|
58638
|
+
(_a = g.setFinalAttributes) === null || _a === void 0 ? void 0 : _a.call(g, finalAttrs);
|
|
58550
58639
|
}
|
|
58551
58640
|
g.context = mockGraphic.context;
|
|
58552
58641
|
g.context.diffAttrs = finalAttrs;
|
|
@@ -58554,7 +58643,7 @@
|
|
|
58554
58643
|
if (gIndex >= 0) {
|
|
58555
58644
|
this._graphics[gIndex] = g;
|
|
58556
58645
|
}
|
|
58557
|
-
if ((
|
|
58646
|
+
if ((_b = this.renderContext) === null || _b === void 0 ? void 0 : _b.progressive) {
|
|
58558
58647
|
const groupIndex = this._dataByGroup ? this._dataByGroup.keys.indexOf(g.context.groupKey) : 0;
|
|
58559
58648
|
const group = groupIndex >= 0 ? this._product.getChildAt(groupIndex) : null;
|
|
58560
58649
|
if (group) {
|
|
@@ -59408,10 +59497,20 @@
|
|
|
59408
59497
|
const registerPolygonAnimation = () => {
|
|
59409
59498
|
AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);
|
|
59410
59499
|
};
|
|
59500
|
+
const registerStageAnimation = () => {
|
|
59501
|
+
AnimateExecutor.registerBuiltInAnimate('distortion', Distortion);
|
|
59502
|
+
AnimateExecutor.registerBuiltInAnimate('particle', Particle);
|
|
59503
|
+
AnimateExecutor.registerBuiltInAnimate('pixelation', Pixelation);
|
|
59504
|
+
AnimateExecutor.registerBuiltInAnimate('gaussianBlur', GaussianBlur);
|
|
59505
|
+
AnimateExecutor.registerBuiltInAnimate('glitch', Glitch);
|
|
59506
|
+
AnimateExecutor.registerBuiltInAnimate('grayscale', Grayscale);
|
|
59507
|
+
AnimateExecutor.registerBuiltInAnimate('dissolve', Dissolve);
|
|
59508
|
+
};
|
|
59411
59509
|
|
|
59412
59510
|
const registerAnimate = () => {
|
|
59413
59511
|
registerAnimate$1();
|
|
59414
59512
|
registerBuiltInAnimation();
|
|
59513
|
+
registerStageAnimation();
|
|
59415
59514
|
};
|
|
59416
59515
|
const registerDragPlugin = () => {
|
|
59417
59516
|
Factory.registerStageEventPlugin('drag', DragNDrop);
|
|
@@ -60987,10 +61086,6 @@
|
|
|
60987
61086
|
var _a;
|
|
60988
61087
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
60989
61088
|
}
|
|
60990
|
-
showCrosshair(cb) {
|
|
60991
|
-
var _a;
|
|
60992
|
-
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.showCrosshair(cb);
|
|
60993
|
-
}
|
|
60994
61089
|
stopAnimation() {
|
|
60995
61090
|
var _a;
|
|
60996
61091
|
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
|
|
@@ -61300,7 +61395,7 @@
|
|
|
61300
61395
|
});
|
|
61301
61396
|
};
|
|
61302
61397
|
|
|
61303
|
-
const version = "2.0.
|
|
61398
|
+
const version = "2.0.9";
|
|
61304
61399
|
|
|
61305
61400
|
const addVChartProperty = (data, op) => {
|
|
61306
61401
|
const context = op.beforeCall();
|
|
@@ -62350,6 +62445,7 @@
|
|
|
62350
62445
|
this.initMarkState();
|
|
62351
62446
|
if (hasAnimation) {
|
|
62352
62447
|
this.initAnimation();
|
|
62448
|
+
this.initStageAnimation();
|
|
62353
62449
|
}
|
|
62354
62450
|
this.afterInitMark();
|
|
62355
62451
|
this.initEvent();
|
|
@@ -62806,6 +62902,13 @@
|
|
|
62806
62902
|
}
|
|
62807
62903
|
initAnimation() {
|
|
62808
62904
|
}
|
|
62905
|
+
initStageAnimation() {
|
|
62906
|
+
const compiler = this._option.getCompiler();
|
|
62907
|
+
if (!(compiler === null || compiler === void 0 ? void 0 : compiler.setStageAnimationConfig)) {
|
|
62908
|
+
return;
|
|
62909
|
+
}
|
|
62910
|
+
compiler.setStageAnimationConfig(animationConfig({}, userAnimationConfig('stage', this._spec, this._markAttributeContext), null));
|
|
62911
|
+
}
|
|
62809
62912
|
initMarkState() {
|
|
62810
62913
|
this.initSeriesStyleState();
|
|
62811
62914
|
}
|
|
@@ -65676,7 +65779,7 @@
|
|
|
65676
65779
|
const viewData = s.getViewData();
|
|
65677
65780
|
if (rawData) {
|
|
65678
65781
|
field.forEach(f => {
|
|
65679
|
-
data.push(s.getRawDataStatisticsByField(f,
|
|
65782
|
+
data.push(s.getRawDataStatisticsByField(f, !!isContinuous(this._scale.type)));
|
|
65680
65783
|
});
|
|
65681
65784
|
}
|
|
65682
65785
|
else if (viewData && viewData.latestData && viewData.latestData.length) {
|
|
@@ -66939,8 +67042,12 @@
|
|
|
66939
67042
|
class LinearAxisMixin {
|
|
66940
67043
|
constructor() {
|
|
66941
67044
|
this._extend = {};
|
|
67045
|
+
this._rawDomain = [];
|
|
66942
67046
|
this.niceLabelFormatter = null;
|
|
66943
67047
|
}
|
|
67048
|
+
getRawDomain() {
|
|
67049
|
+
return this._rawDomain;
|
|
67050
|
+
}
|
|
66944
67051
|
setExtraAttrFromSpec() {
|
|
66945
67052
|
isValid$1(this._spec.nice) && (this._nice = this._spec.nice);
|
|
66946
67053
|
isValid$1(this._spec.zero) && (this._zero = this._spec.zero);
|
|
@@ -67207,9 +67314,13 @@
|
|
|
67207
67314
|
}
|
|
67208
67315
|
}
|
|
67209
67316
|
updateScaleDomain() {
|
|
67317
|
+
var _a;
|
|
67210
67318
|
if (!this.isSeriesDataEnable()) {
|
|
67211
67319
|
return;
|
|
67212
67320
|
}
|
|
67321
|
+
if (!((_a = this._rawDomain) === null || _a === void 0 ? void 0 : _a.length) && this._scale) {
|
|
67322
|
+
this._updateRawDomain();
|
|
67323
|
+
}
|
|
67213
67324
|
const data = this.collectData();
|
|
67214
67325
|
const domain = this.computeLinearDomain(data);
|
|
67215
67326
|
this.updateScaleDomainByModel(domain);
|
|
@@ -67244,6 +67355,15 @@
|
|
|
67244
67355
|
return value;
|
|
67245
67356
|
};
|
|
67246
67357
|
}
|
|
67358
|
+
_updateRawDomain() {
|
|
67359
|
+
const data = this.collectData(0, true);
|
|
67360
|
+
const domain = this.computeLinearDomain(data);
|
|
67361
|
+
this._rawDomain = domain;
|
|
67362
|
+
this.event.emit(exports.ChartEvent.scaleRawDomainUpdate, { model: this });
|
|
67363
|
+
}
|
|
67364
|
+
_clearRawDomain() {
|
|
67365
|
+
this._rawDomain = [];
|
|
67366
|
+
}
|
|
67247
67367
|
}
|
|
67248
67368
|
|
|
67249
67369
|
const axisLinear = {
|
|
@@ -67475,6 +67595,7 @@
|
|
|
67475
67595
|
class BandAxisMixin {
|
|
67476
67596
|
constructor() {
|
|
67477
67597
|
this._rawDomainIndex = [];
|
|
67598
|
+
this._rawDomain = [];
|
|
67478
67599
|
}
|
|
67479
67600
|
_initData() {
|
|
67480
67601
|
var _a;
|
|
@@ -67526,6 +67647,9 @@
|
|
|
67526
67647
|
tickTransform && (tickTransform.options = this._tickTransformOption());
|
|
67527
67648
|
}
|
|
67528
67649
|
}
|
|
67650
|
+
getRawDomain() {
|
|
67651
|
+
return this._rawDomain;
|
|
67652
|
+
}
|
|
67529
67653
|
dataToPosition(values, cfg = {}) {
|
|
67530
67654
|
var _a, _b;
|
|
67531
67655
|
if (values.length === 0 || this._scales.length === 0) {
|
|
@@ -67663,6 +67787,7 @@
|
|
|
67663
67787
|
}
|
|
67664
67788
|
_updateRawDomain() {
|
|
67665
67789
|
this._rawDomainIndex = [];
|
|
67790
|
+
this._rawDomain = [];
|
|
67666
67791
|
const userDomain = this._spec.domain;
|
|
67667
67792
|
for (let i = 0; i < this._scales.length; i++) {
|
|
67668
67793
|
if (userDomain && userDomain.length && i === 0) {
|
|
@@ -67672,12 +67797,15 @@
|
|
|
67672
67797
|
const data = this.collectData(i, true);
|
|
67673
67798
|
const domain = this.computeBandDomain(data);
|
|
67674
67799
|
this._rawDomainIndex[i] = {};
|
|
67800
|
+
this._rawDomain[i] = domain;
|
|
67675
67801
|
domain.forEach((d, _i) => (this._rawDomainIndex[i][d] = _i));
|
|
67676
67802
|
}
|
|
67677
67803
|
}
|
|
67804
|
+
this.event.emit(exports.ChartEvent.scaleRawDomainUpdate, { model: this });
|
|
67678
67805
|
}
|
|
67679
67806
|
_clearRawDomain() {
|
|
67680
67807
|
this._rawDomainIndex = [];
|
|
67808
|
+
this._rawDomain = [];
|
|
67681
67809
|
}
|
|
67682
67810
|
}
|
|
67683
67811
|
|
|
@@ -70016,12 +70144,10 @@
|
|
|
70016
70144
|
}
|
|
70017
70145
|
});
|
|
70018
70146
|
const isUnableValue = isNil$1(value) || !dimensionInfo || dimensionInfo.every(d => isDiscrete(d.axis.getScale().type) && isNil$1(d.index));
|
|
70019
|
-
const isUnableTooltip = isUnableValue ||
|
|
70020
|
-
dimensionInfo.every(d => isDiscrete(d.axis.getScale().type) && d.data.every(_data => _data.datum.length === 0));
|
|
70021
70147
|
if (opt.tooltip !== false) {
|
|
70022
70148
|
const tooltip = this.getComponentsByType(ComponentTypeEnum.tooltip)[0];
|
|
70023
70149
|
if (tooltip === null || tooltip === void 0 ? void 0 : tooltip.getVisible()) {
|
|
70024
|
-
if (isUnableValue
|
|
70150
|
+
if (isUnableValue) {
|
|
70025
70151
|
(_b = (_a = tooltip).hideTooltip) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
70026
70152
|
}
|
|
70027
70153
|
else {
|
|
@@ -70051,25 +70177,6 @@
|
|
|
70051
70177
|
}
|
|
70052
70178
|
}
|
|
70053
70179
|
}
|
|
70054
|
-
showCrosshair(cb) {
|
|
70055
|
-
var _a;
|
|
70056
|
-
const crosshair = (_a = this.getComponentsByType(ComponentTypeEnum.cartesianCrosshair)[0]) !== null && _a !== void 0 ? _a : this.getComponentsByType(ComponentTypeEnum.polarCrosshair)[0];
|
|
70057
|
-
if (!crosshair) {
|
|
70058
|
-
return;
|
|
70059
|
-
}
|
|
70060
|
-
const axes = this.getComponentsByKey('axes');
|
|
70061
|
-
const dimInfo = [];
|
|
70062
|
-
axes.forEach(axis => {
|
|
70063
|
-
const value = cb(axis);
|
|
70064
|
-
if (value !== false) {
|
|
70065
|
-
dimInfo.push({
|
|
70066
|
-
axis,
|
|
70067
|
-
value
|
|
70068
|
-
});
|
|
70069
|
-
}
|
|
70070
|
-
});
|
|
70071
|
-
crosshair.showCrosshair(dimInfo);
|
|
70072
|
-
}
|
|
70073
70180
|
getColorScheme() {
|
|
70074
70181
|
var _a, _b;
|
|
70075
70182
|
return (_b = (_a = this._option).getTheme) === null || _b === void 0 ? void 0 : _b.call(_a, 'colorScheme');
|
|
@@ -72036,7 +72143,10 @@
|
|
|
72036
72143
|
lastY = y1;
|
|
72037
72144
|
}
|
|
72038
72145
|
let height = Math.abs(y1 - y);
|
|
72039
|
-
if (height
|
|
72146
|
+
if (height <= 0 && !isValueInScaleDomain(obj[s.getStackValueField()], seriesScale)) {
|
|
72147
|
+
height = 0;
|
|
72148
|
+
}
|
|
72149
|
+
else if (height < barMinHeight) {
|
|
72040
72150
|
height = barMinHeight;
|
|
72041
72151
|
}
|
|
72042
72152
|
let flag = 1;
|
|
@@ -72385,7 +72495,10 @@
|
|
|
72385
72495
|
const y1 = valueInScaleRange(this[startMethod](datum), seriesScale, useWholeRange);
|
|
72386
72496
|
const y = valueInScaleRange(this[endMethod](datum), seriesScale, useWholeRange);
|
|
72387
72497
|
let height = Math.abs(y1 - y);
|
|
72388
|
-
if (height
|
|
72498
|
+
if (height <= 0 && !isValueInScaleDomain(datum[this.getStackValueField()], seriesScale)) {
|
|
72499
|
+
height = 0;
|
|
72500
|
+
}
|
|
72501
|
+
else if (height < barMinHeight) {
|
|
72389
72502
|
height = barMinHeight;
|
|
72390
72503
|
}
|
|
72391
72504
|
let flag = 1;
|
|
@@ -79403,13 +79516,14 @@
|
|
|
79403
79516
|
});
|
|
79404
79517
|
}
|
|
79405
79518
|
initMarkStyle() {
|
|
79519
|
+
var _a;
|
|
79406
79520
|
const clipMark = this._clipMark;
|
|
79407
79521
|
if (clipMark) {
|
|
79408
79522
|
this.setMarkStyle(clipMark, {
|
|
79409
|
-
x: -this._spec.leftAppendPadding,
|
|
79523
|
+
x: -((_a = this._spec.leftAppendPadding) !== null && _a !== void 0 ? _a : 0),
|
|
79410
79524
|
y: 0,
|
|
79411
79525
|
width: 10000,
|
|
79412
|
-
height: this._spec.clipHeight
|
|
79526
|
+
height: () => { var _a; return (_a = this._spec.clipHeight) !== null && _a !== void 0 ? _a : this._region.getLayoutRect().height; }
|
|
79413
79527
|
}, 'normal', exports.AttributeLevel.Series);
|
|
79414
79528
|
clipMark.setMarkConfig({ interactive: false, clip: true });
|
|
79415
79529
|
}
|
|
@@ -97074,17 +97188,26 @@
|
|
|
97074
97188
|
return data.filter(filter);
|
|
97075
97189
|
};
|
|
97076
97190
|
const dataFilterComputeDomain = (data, op) => {
|
|
97077
|
-
const { stateFields, valueFields, dataCollection, isCategoryState } = op.input;
|
|
97191
|
+
const { stateFields, valueFields, dataCollection, isCategoryState, seriesCollection } = op.input;
|
|
97078
97192
|
const { stateField, valueField } = op.output;
|
|
97079
97193
|
const resultObj = {};
|
|
97194
|
+
const resultKeys = [];
|
|
97080
97195
|
const resultData = [];
|
|
97081
97196
|
const stateValues = [];
|
|
97082
97197
|
let hasLockDomain = false;
|
|
97198
|
+
let isAllLinearValue = false;
|
|
97083
97199
|
dataCollection.forEach((dv, i) => {
|
|
97084
97200
|
var _a;
|
|
97085
97201
|
if (isNil$1(stateFields[i])) {
|
|
97086
97202
|
return;
|
|
97087
97203
|
}
|
|
97204
|
+
const series = seriesCollection[i];
|
|
97205
|
+
if (series) {
|
|
97206
|
+
const statistics = series.getRawDataStatisticsByField(stateFields[i]);
|
|
97207
|
+
if (isValid$1(statistics === null || statistics === void 0 ? void 0 : statistics.max) && isValid$1(statistics === null || statistics === void 0 ? void 0 : statistics.min)) {
|
|
97208
|
+
isAllLinearValue = true;
|
|
97209
|
+
}
|
|
97210
|
+
}
|
|
97088
97211
|
const stateFieldInfo = (_a = dv.getFields()) === null || _a === void 0 ? void 0 : _a[stateFields[i]];
|
|
97089
97212
|
if (stateFieldInfo && stateFieldInfo.lockStatisticsByDomain) {
|
|
97090
97213
|
hasLockDomain = true;
|
|
@@ -97092,6 +97215,7 @@
|
|
|
97092
97215
|
if (isNil$1(resultObj[d])) {
|
|
97093
97216
|
stateValues.push(d);
|
|
97094
97217
|
resultObj[d] = 0;
|
|
97218
|
+
resultKeys.push(d);
|
|
97095
97219
|
}
|
|
97096
97220
|
});
|
|
97097
97221
|
}
|
|
@@ -97101,6 +97225,7 @@
|
|
|
97101
97225
|
if (isNil$1(resultObj[d[state]])) {
|
|
97102
97226
|
stateValues.push(d[state]);
|
|
97103
97227
|
resultObj[d[state]] = 0;
|
|
97228
|
+
resultKeys.push(d[state]);
|
|
97104
97229
|
}
|
|
97105
97230
|
if (!isNil$1(valueFields[i])) {
|
|
97106
97231
|
resultObj[d[state]] += isNaN(parseFloat(d[valueFields[i]])) ? 1 : parseFloat(d[valueFields[i]]);
|
|
@@ -97111,9 +97236,9 @@
|
|
|
97111
97236
|
});
|
|
97112
97237
|
const sortedStateValues = hasLockDomain
|
|
97113
97238
|
? stateValues
|
|
97114
|
-
: isCategoryState === false
|
|
97239
|
+
: isCategoryState === false || isAllLinearValue
|
|
97115
97240
|
? stateValues.sort((a, b) => a - b)
|
|
97116
|
-
:
|
|
97241
|
+
: resultKeys;
|
|
97117
97242
|
sortedStateValues.forEach(state => {
|
|
97118
97243
|
const res = { [stateField]: state };
|
|
97119
97244
|
if (valueField) {
|
|
@@ -97123,17 +97248,83 @@
|
|
|
97123
97248
|
});
|
|
97124
97249
|
return resultData;
|
|
97125
97250
|
};
|
|
97126
|
-
|
|
97127
|
-
|
|
97128
|
-
|
|
97129
|
-
|
|
97251
|
+
const statePointToData = (state, scale, reverse) => {
|
|
97252
|
+
const domain = scale.domain();
|
|
97253
|
+
if (isContinuous(scale.type)) {
|
|
97254
|
+
if (reverse) {
|
|
97255
|
+
return domain[0] + (last(domain) - domain[0]) * (1 - state);
|
|
97256
|
+
}
|
|
97257
|
+
return domain[0] + (last(domain) - domain[0]) * state;
|
|
97130
97258
|
}
|
|
97131
|
-
|
|
97132
|
-
|
|
97133
|
-
|
|
97134
|
-
|
|
97135
|
-
|
|
97259
|
+
let range = scale.range();
|
|
97260
|
+
if (reverse) {
|
|
97261
|
+
range = range.slice().reverse();
|
|
97262
|
+
}
|
|
97263
|
+
const posInRange = range[0] + (last(range) - range[0]) * state;
|
|
97264
|
+
return scale.invert(posInRange);
|
|
97265
|
+
};
|
|
97266
|
+
const dataToStatePoint = (data, scale, isHorizontal) => {
|
|
97267
|
+
const pos = scale.scale(data);
|
|
97268
|
+
let range = scale.range();
|
|
97269
|
+
if (!isHorizontal && isContinuous(scale.type)) {
|
|
97270
|
+
range = range.slice().reverse();
|
|
97271
|
+
}
|
|
97272
|
+
return Math.max(0, Math.min(1, (pos - range[0]) / (last(range) - range[0])));
|
|
97273
|
+
};
|
|
97274
|
+
const isReverse = (axisComponent, isHorizontal) => {
|
|
97275
|
+
const axis = axisComponent;
|
|
97276
|
+
if (!axis) {
|
|
97277
|
+
return false;
|
|
97278
|
+
}
|
|
97279
|
+
const axisScale = axis.getScale();
|
|
97280
|
+
return axisScale.range()[0] > axisScale.range()[1] && (!axis.getInverse() || isHorizontal);
|
|
97281
|
+
};
|
|
97282
|
+
const getAxisBandSize = (axisSpec) => {
|
|
97283
|
+
const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
|
|
97284
|
+
const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
|
|
97285
|
+
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
97286
|
+
if (bandSize || minBandSize || maxBandSize) {
|
|
97287
|
+
return { bandSize, maxBandSize, minBandSize };
|
|
97136
97288
|
}
|
|
97289
|
+
return undefined;
|
|
97290
|
+
};
|
|
97291
|
+
const modeCheck = (statePoint, mode, spec) => {
|
|
97292
|
+
if (statePoint === 'start') {
|
|
97293
|
+
return (mode === 'percent' && isValid$1(spec.start)) || (mode === 'value' && isValid$1(spec.startValue));
|
|
97294
|
+
}
|
|
97295
|
+
return (mode === 'percent' && isValid$1(spec.end)) || (mode === 'value' && isValid$1(spec.endValue));
|
|
97296
|
+
};
|
|
97297
|
+
const parseDomainFromState = (startValue, endValue, scale) => {
|
|
97298
|
+
if (isContinuous(scale.type)) {
|
|
97299
|
+
return [Math.min(endValue, startValue), Math.max(endValue, startValue)];
|
|
97300
|
+
}
|
|
97301
|
+
const allDomain = scale.domain();
|
|
97302
|
+
const startIndex = allDomain.indexOf(startValue);
|
|
97303
|
+
const endIndex = allDomain.indexOf(endValue);
|
|
97304
|
+
return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
|
|
97305
|
+
};
|
|
97306
|
+
const parseDomainFromStateAndValue = (start, startValue, end, endValue, scale) => {
|
|
97307
|
+
if (isContinuous(scale.type)) {
|
|
97308
|
+
const domain = scale.domain();
|
|
97309
|
+
const min = domain[0];
|
|
97310
|
+
const total = last(domain) - min;
|
|
97311
|
+
const resultStart = isValid$1(start) ? min + total * start : +startValue;
|
|
97312
|
+
const resultEnd = isValid$1(end) ? min + total * end : +endValue;
|
|
97313
|
+
return [Math.min(resultEnd, resultStart), Math.max(resultEnd, resultStart)];
|
|
97314
|
+
}
|
|
97315
|
+
const allDomain = scale.domain();
|
|
97316
|
+
const range = scale.range();
|
|
97317
|
+
const rangeSize = range[range.length - 1] - range[0];
|
|
97318
|
+
const startIndex = isValid$1(start)
|
|
97319
|
+
? allDomain.indexOf(scale.invert(rangeSize * start + range[0]))
|
|
97320
|
+
: allDomain.indexOf(startValue);
|
|
97321
|
+
const endIndex = isValid$1(end)
|
|
97322
|
+
? allDomain.indexOf(scale.invert(rangeSize * end + range[0]))
|
|
97323
|
+
: allDomain.indexOf(endValue);
|
|
97324
|
+
return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
|
|
97325
|
+
};
|
|
97326
|
+
|
|
97327
|
+
class DataFilterEvent {
|
|
97137
97328
|
enableInteraction() {
|
|
97138
97329
|
this._activeRoam = true;
|
|
97139
97330
|
}
|
|
@@ -97141,19 +97332,203 @@
|
|
|
97141
97332
|
this._activeRoam = false;
|
|
97142
97333
|
}
|
|
97143
97334
|
zoomIn(location) {
|
|
97144
|
-
this.
|
|
97335
|
+
this.handleChartZoom({
|
|
97145
97336
|
zoomDelta: 1.2,
|
|
97146
97337
|
zoomX: location === null || location === void 0 ? void 0 : location.x,
|
|
97147
97338
|
zoomY: location === null || location === void 0 ? void 0 : location.y
|
|
97148
97339
|
});
|
|
97149
97340
|
}
|
|
97150
97341
|
zoomOut(location) {
|
|
97151
|
-
this.
|
|
97342
|
+
this.handleChartZoom({
|
|
97152
97343
|
zoomDelta: 0.8,
|
|
97153
97344
|
zoomX: location === null || location === void 0 ? void 0 : location.x,
|
|
97154
97345
|
zoomY: location === null || location === void 0 ? void 0 : location.y
|
|
97155
97346
|
});
|
|
97156
97347
|
}
|
|
97348
|
+
constructor(type, spec, handleChange, getLayoutRect, getState, getRegions, getOption, getEvent) {
|
|
97349
|
+
this._activeRoam = true;
|
|
97350
|
+
this._zoomAttr = {
|
|
97351
|
+
enable: true,
|
|
97352
|
+
rate: 1,
|
|
97353
|
+
focus: true
|
|
97354
|
+
};
|
|
97355
|
+
this._dragAttr = {
|
|
97356
|
+
enable: true,
|
|
97357
|
+
rate: 1,
|
|
97358
|
+
reverse: true
|
|
97359
|
+
};
|
|
97360
|
+
this._scrollAttr = {
|
|
97361
|
+
enable: true,
|
|
97362
|
+
rate: 1,
|
|
97363
|
+
reverse: true
|
|
97364
|
+
};
|
|
97365
|
+
this.initZoomEvent = () => {
|
|
97366
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
97367
|
+
const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
|
|
97368
|
+
const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? ((_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30) : 0;
|
|
97369
|
+
const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g : true;
|
|
97370
|
+
const option = { delayType, delayTime, realTime, allowComponentZoom: true };
|
|
97371
|
+
if (this._zoomAttr.enable) {
|
|
97372
|
+
this.initZoomEventOfRegions(this.getRegions(), null, this.handleChartZoom, option);
|
|
97373
|
+
}
|
|
97374
|
+
if (this._scrollAttr.enable) {
|
|
97375
|
+
this.initScrollEventOfRegions(this.getRegions(), null, this.handleChartScroll, option);
|
|
97376
|
+
}
|
|
97377
|
+
if (this._dragAttr.enable) {
|
|
97378
|
+
this.initDragEventOfRegions(this.getRegions(), null, this.handleChartDrag, option);
|
|
97379
|
+
}
|
|
97380
|
+
};
|
|
97381
|
+
this.handleChartZoom = (params, e) => {
|
|
97382
|
+
var _a, _b;
|
|
97383
|
+
if (!this._activeRoam || (this._zoomAttr.filter && !this._zoomAttr.filter(params, e))) {
|
|
97384
|
+
return;
|
|
97385
|
+
}
|
|
97386
|
+
const { zoomDelta, zoomX, zoomY } = params;
|
|
97387
|
+
const { x, y } = this.getRegions()[0].getLayoutStartPoint();
|
|
97388
|
+
const { width, height } = this.getRegions()[0].getLayoutRect();
|
|
97389
|
+
const delta = Math.abs(this.getState().start - this.getState().end);
|
|
97390
|
+
const zoomRate = (_b = (_a = this._spec.roamZoom) === null || _a === void 0 ? void 0 : _a.rate) !== null && _b !== void 0 ? _b : 1;
|
|
97391
|
+
if (delta >= 1 && zoomDelta < 1) {
|
|
97392
|
+
return;
|
|
97393
|
+
}
|
|
97394
|
+
if (delta <= 0.01 && zoomDelta > 1) {
|
|
97395
|
+
return;
|
|
97396
|
+
}
|
|
97397
|
+
const focusLoc = this._isHorizontal ? zoomX : zoomY;
|
|
97398
|
+
const totalValue = delta * (zoomDelta - 1) * zoomRate;
|
|
97399
|
+
let startValue = totalValue / 2;
|
|
97400
|
+
let endValue = totalValue / 2;
|
|
97401
|
+
if (focusLoc) {
|
|
97402
|
+
const startLoc = this._isHorizontal ? x : y;
|
|
97403
|
+
const endLoc = this._isHorizontal ? width : height;
|
|
97404
|
+
startValue = (Math.abs(startLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
|
|
97405
|
+
endValue = (Math.abs(endLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
|
|
97406
|
+
}
|
|
97407
|
+
const start = clamp$1(this.getState().start + startValue, 0, 1);
|
|
97408
|
+
const end = clamp$1(this.getState().end - endValue, 0, 1);
|
|
97409
|
+
this._handleChange(Math.min(start, end), Math.max(start, end), true);
|
|
97410
|
+
};
|
|
97411
|
+
this.handleChartScroll = (params, e) => {
|
|
97412
|
+
var _a;
|
|
97413
|
+
if (!this._activeRoam || (this._scrollAttr.filter && !this._scrollAttr.filter(params, e))) {
|
|
97414
|
+
return false;
|
|
97415
|
+
}
|
|
97416
|
+
const { scrollX, scrollY } = params;
|
|
97417
|
+
let value = this._isHorizontal ? scrollX : scrollY;
|
|
97418
|
+
const active = this._isHorizontal ? abs$1(scrollX / scrollY) >= 0.5 : abs$1(scrollY / scrollX) >= 0.5;
|
|
97419
|
+
if (!this._scrollAttr.reverse) {
|
|
97420
|
+
value = -value;
|
|
97421
|
+
}
|
|
97422
|
+
if (active) {
|
|
97423
|
+
this.handleChartMove(value, (_a = this._scrollAttr.rate) !== null && _a !== void 0 ? _a : 1);
|
|
97424
|
+
}
|
|
97425
|
+
const hasChange = this.getState().start !== 0 && this.getState().end !== 1;
|
|
97426
|
+
return active && hasChange;
|
|
97427
|
+
};
|
|
97428
|
+
this.handleChartDrag = (delta, e) => {
|
|
97429
|
+
var _a;
|
|
97430
|
+
if (!this._activeRoam || (this._dragAttr.filter && !this._dragAttr.filter(delta, e))) {
|
|
97431
|
+
return;
|
|
97432
|
+
}
|
|
97433
|
+
const [dx, dy] = delta;
|
|
97434
|
+
let value = this._isHorizontal ? dx : dy;
|
|
97435
|
+
if (this._dragAttr.reverse) {
|
|
97436
|
+
value = -value;
|
|
97437
|
+
}
|
|
97438
|
+
this.handleChartMove(value, (_a = this._dragAttr.rate) !== null && _a !== void 0 ? _a : 1);
|
|
97439
|
+
};
|
|
97440
|
+
this.handleChartMove = (value, rate) => {
|
|
97441
|
+
const totalValue = this._isHorizontal ? this.getLayoutRect().width : this.getLayoutRect().height;
|
|
97442
|
+
if (Math.abs(value) >= 1e-6) {
|
|
97443
|
+
if (value > 0 && this.getState().end < 1) {
|
|
97444
|
+
const moveDelta = Math.min(1 - this.getState().end, value / totalValue) * rate;
|
|
97445
|
+
this._handleChange(this.getState().start + moveDelta, this.getState().end + moveDelta, true);
|
|
97446
|
+
}
|
|
97447
|
+
else if (value < 0 && this.getState().start > 0) {
|
|
97448
|
+
const moveDelta = Math.max(-this.getState().start, value / totalValue) * rate;
|
|
97449
|
+
this._handleChange(this.getState().start + moveDelta, this.getState().end + moveDelta, true);
|
|
97450
|
+
}
|
|
97451
|
+
}
|
|
97452
|
+
return false;
|
|
97453
|
+
};
|
|
97454
|
+
this._type = type;
|
|
97455
|
+
this._spec = spec;
|
|
97456
|
+
this._handleChange = handleChange;
|
|
97457
|
+
this.getLayoutRect = getLayoutRect;
|
|
97458
|
+
this.getState = getState;
|
|
97459
|
+
this.getRegions = getRegions;
|
|
97460
|
+
this._regions = getRegions();
|
|
97461
|
+
this.getOption = getOption;
|
|
97462
|
+
this._option = getOption();
|
|
97463
|
+
this.getEvent = getEvent;
|
|
97464
|
+
this._isHorizontal = getDirectionByOrient(getOrient(spec)) === "horizontal";
|
|
97465
|
+
}
|
|
97466
|
+
setEventAttrFromSpec() {
|
|
97467
|
+
if (this._spec.roamZoom === true || this._spec.roamZoom) {
|
|
97468
|
+
this._zoomAttr = merge$1({}, this._zoomAttr, this._spec.roamZoom);
|
|
97469
|
+
}
|
|
97470
|
+
else {
|
|
97471
|
+
this._zoomAttr.enable = false;
|
|
97472
|
+
}
|
|
97473
|
+
if (this._spec.roamDrag === true || this._spec.roamDrag) {
|
|
97474
|
+
this._dragAttr = merge$1({}, this._dragAttr, this._spec.roamDrag);
|
|
97475
|
+
}
|
|
97476
|
+
else {
|
|
97477
|
+
this._dragAttr.enable = false;
|
|
97478
|
+
}
|
|
97479
|
+
if (this._spec.roamScroll === true || this._spec.roamScroll) {
|
|
97480
|
+
this._scrollAttr = merge$1({}, this._scrollAttr, this._spec.roamScroll);
|
|
97481
|
+
}
|
|
97482
|
+
else {
|
|
97483
|
+
this._scrollAttr.enable = false;
|
|
97484
|
+
}
|
|
97485
|
+
if (isBoolean$1(this._spec.roam)) {
|
|
97486
|
+
this._zoomAttr.enable = this._type === 'scrollBar' ? false : this._spec.roam;
|
|
97487
|
+
this._dragAttr.enable = this._spec.roam;
|
|
97488
|
+
this._scrollAttr.enable = this._spec.roam;
|
|
97489
|
+
}
|
|
97490
|
+
if (this._zoomAttr.enable || this._dragAttr.enable || this._scrollAttr.enable) {
|
|
97491
|
+
this.initZoomable(this.getEvent(), this._option.mode);
|
|
97492
|
+
}
|
|
97493
|
+
}
|
|
97494
|
+
}
|
|
97495
|
+
mixin(DataFilterEvent, Zoomable);
|
|
97496
|
+
|
|
97497
|
+
class DataFilterBaseComponent extends BaseComponent {
|
|
97498
|
+
get isHorizontal() {
|
|
97499
|
+
return this._isHorizontal;
|
|
97500
|
+
}
|
|
97501
|
+
get stateScale() {
|
|
97502
|
+
return this._stateScale;
|
|
97503
|
+
}
|
|
97504
|
+
get relatedAxisComponent() {
|
|
97505
|
+
return this._relatedAxisComponent;
|
|
97506
|
+
}
|
|
97507
|
+
setStartAndEnd(start, end, rangeMode = ['percent', 'percent']) {
|
|
97508
|
+
const [startMode = 'percent', endMode = 'percent'] = rangeMode;
|
|
97509
|
+
const startPercent = (startMode === 'percent' ? start : dataToStatePoint(start, this._stateScale, this._isHorizontal));
|
|
97510
|
+
const endPercent = (endMode === 'percent' ? end : dataToStatePoint(end, this._stateScale, this._isHorizontal));
|
|
97511
|
+
this._handleChange(startPercent, endPercent, true);
|
|
97512
|
+
}
|
|
97513
|
+
enableInteraction() {
|
|
97514
|
+
this._dataFilterEvent.enableInteraction();
|
|
97515
|
+
}
|
|
97516
|
+
disableInteraction() {
|
|
97517
|
+
this._dataFilterEvent.disableInteraction();
|
|
97518
|
+
}
|
|
97519
|
+
zoomIn(location) {
|
|
97520
|
+
this._dataFilterEvent.zoomIn(location);
|
|
97521
|
+
}
|
|
97522
|
+
zoomOut(location) {
|
|
97523
|
+
this._dataFilterEvent.zoomOut(location);
|
|
97524
|
+
}
|
|
97525
|
+
_initEvent() {
|
|
97526
|
+
var _a;
|
|
97527
|
+
this._dataFilterEvent.initZoomEvent();
|
|
97528
|
+
(_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.event.on(exports.ChartEvent.scaleRawDomainUpdate, ({ model }) => {
|
|
97529
|
+
console.log('scaleRawDomainUpdate', model.getRawDomain());
|
|
97530
|
+
});
|
|
97531
|
+
}
|
|
97157
97532
|
_handleChange(start, end, updateComponent) {
|
|
97158
97533
|
var _a, _b;
|
|
97159
97534
|
const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
|
|
@@ -97167,18 +97542,10 @@
|
|
|
97167
97542
|
this._spanCache = end - start;
|
|
97168
97543
|
}
|
|
97169
97544
|
}
|
|
97170
|
-
_isReverse() {
|
|
97171
|
-
const axis = this._relatedAxisComponent;
|
|
97172
|
-
if (!axis) {
|
|
97173
|
-
return false;
|
|
97174
|
-
}
|
|
97175
|
-
const axisScale = axis.getScale();
|
|
97176
|
-
return axisScale.range()[0] > axisScale.range()[1] && (!axis.getInverse() || this._isHorizontal);
|
|
97177
|
-
}
|
|
97178
97545
|
_updateRangeFactor(tag) {
|
|
97179
97546
|
const axis = this._relatedAxisComponent;
|
|
97180
97547
|
const axisScale = axis.getScale();
|
|
97181
|
-
const reverse = this.
|
|
97548
|
+
const reverse = isReverse(axis, this._isHorizontal);
|
|
97182
97549
|
const newRangeFactor = reverse ? [1 - this._end, 1 - this._start] : [this._start, this._end];
|
|
97183
97550
|
if (reverse) {
|
|
97184
97551
|
switch (tag) {
|
|
@@ -97225,23 +97592,16 @@
|
|
|
97225
97592
|
this._orient = 'left';
|
|
97226
97593
|
this._cacheVisibility = undefined;
|
|
97227
97594
|
this._dataUpdating = false;
|
|
97595
|
+
this._hasInitStateScale = false;
|
|
97228
97596
|
this._shouldChange = true;
|
|
97229
97597
|
this._stateField = 'x';
|
|
97230
|
-
this.
|
|
97231
|
-
|
|
97232
|
-
|
|
97233
|
-
|
|
97234
|
-
|
|
97235
|
-
|
|
97236
|
-
|
|
97237
|
-
enable: true,
|
|
97238
|
-
rate: 1,
|
|
97239
|
-
reverse: true
|
|
97240
|
-
};
|
|
97241
|
-
this._scrollAttr = {
|
|
97242
|
-
enable: true,
|
|
97243
|
-
rate: 1,
|
|
97244
|
-
reverse: true
|
|
97598
|
+
this._handleStateChange = (startValue, endValue, tag) => {
|
|
97599
|
+
var _a, _b;
|
|
97600
|
+
this._startValue = startValue;
|
|
97601
|
+
this._endValue = endValue;
|
|
97602
|
+
this._newDomain = parseDomainFromState(this._startValue, this._endValue, this._stateScale);
|
|
97603
|
+
(_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a, tag);
|
|
97604
|
+
return true;
|
|
97245
97605
|
};
|
|
97246
97606
|
this.effect = {
|
|
97247
97607
|
onZoomChange: (tag) => {
|
|
@@ -97250,7 +97610,7 @@
|
|
|
97250
97610
|
if (axis && this._filterMode === 'axis') {
|
|
97251
97611
|
const axisScale = axis.getScale();
|
|
97252
97612
|
const axisSpec = axis.getSpec();
|
|
97253
|
-
if (this._auto &&
|
|
97613
|
+
if (this._auto && getAxisBandSize(axisSpec) && this._spec.ignoreBandSize) {
|
|
97254
97614
|
axisScale.bandwidth('auto');
|
|
97255
97615
|
axisScale.maxBandwidth('auto');
|
|
97256
97616
|
axisScale.minBandwidth('auto');
|
|
@@ -97281,92 +97641,14 @@
|
|
|
97281
97641
|
}
|
|
97282
97642
|
};
|
|
97283
97643
|
this._visible = true;
|
|
97284
|
-
this._handleStateChange = (startValue, endValue, tag) => {
|
|
97285
|
-
var _a, _b;
|
|
97286
|
-
this._startValue = startValue;
|
|
97287
|
-
this._endValue = endValue;
|
|
97288
|
-
this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
|
|
97289
|
-
(_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a, tag);
|
|
97290
|
-
return true;
|
|
97291
|
-
};
|
|
97292
|
-
this._handleChartZoom = (params, e) => {
|
|
97293
|
-
var _a, _b;
|
|
97294
|
-
if (!this._activeRoam || (this._zoomAttr.filter && !this._zoomAttr.filter(params, e))) {
|
|
97295
|
-
return;
|
|
97296
|
-
}
|
|
97297
|
-
const { zoomDelta, zoomX, zoomY } = params;
|
|
97298
|
-
const { x, y } = this._regions[0].getLayoutStartPoint();
|
|
97299
|
-
const { width, height } = this._regions[0].getLayoutRect();
|
|
97300
|
-
const delta = Math.abs(this._start - this._end);
|
|
97301
|
-
const zoomRate = (_b = (_a = this._spec.roamZoom) === null || _a === void 0 ? void 0 : _a.rate) !== null && _b !== void 0 ? _b : 1;
|
|
97302
|
-
if (delta >= 1 && zoomDelta < 1) {
|
|
97303
|
-
return;
|
|
97304
|
-
}
|
|
97305
|
-
if (delta <= 0.01 && zoomDelta > 1) {
|
|
97306
|
-
return;
|
|
97307
|
-
}
|
|
97308
|
-
const focusLoc = this._isHorizontal ? zoomX : zoomY;
|
|
97309
|
-
const totalValue = delta * (zoomDelta - 1) * zoomRate;
|
|
97310
|
-
let startValue = totalValue / 2;
|
|
97311
|
-
let endValue = totalValue / 2;
|
|
97312
|
-
if (focusLoc) {
|
|
97313
|
-
const startLoc = this._isHorizontal ? x : y;
|
|
97314
|
-
const endLoc = this._isHorizontal ? width : height;
|
|
97315
|
-
startValue = (Math.abs(startLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
|
|
97316
|
-
endValue = (Math.abs(endLoc - focusLoc) / Math.abs(endLoc - startLoc)) * totalValue;
|
|
97317
|
-
}
|
|
97318
|
-
const start = clamp$1(this._start + startValue, 0, 1);
|
|
97319
|
-
const end = clamp$1(this._end - endValue, 0, 1);
|
|
97320
|
-
this._handleChange(Math.min(start, end), Math.max(start, end), true);
|
|
97321
|
-
};
|
|
97322
|
-
this._handleChartScroll = (params, e) => {
|
|
97323
|
-
var _a;
|
|
97324
|
-
if (!this._activeRoam || (this._scrollAttr.filter && !this._scrollAttr.filter(params, e))) {
|
|
97325
|
-
return false;
|
|
97326
|
-
}
|
|
97327
|
-
const { scrollX, scrollY } = params;
|
|
97328
|
-
let value = this._isHorizontal ? scrollX : scrollY;
|
|
97329
|
-
const active = this._isHorizontal ? abs$1(scrollX / scrollY) >= 0.5 : abs$1(scrollY / scrollX) >= 0.5;
|
|
97330
|
-
if (!this._scrollAttr.reverse) {
|
|
97331
|
-
value = -value;
|
|
97332
|
-
}
|
|
97333
|
-
if (active) {
|
|
97334
|
-
this._handleChartMove(value, (_a = this._scrollAttr.rate) !== null && _a !== void 0 ? _a : 1);
|
|
97335
|
-
}
|
|
97336
|
-
const hasChange = this._start !== 0 && this._end !== 1;
|
|
97337
|
-
return active && hasChange;
|
|
97338
|
-
};
|
|
97339
|
-
this._handleChartDrag = (delta, e) => {
|
|
97340
|
-
var _a, _b;
|
|
97341
|
-
if (!this._activeRoam || (this._dragAttr.filter && !this._dragAttr.filter(delta, e))) {
|
|
97342
|
-
return;
|
|
97343
|
-
}
|
|
97344
|
-
if ((_a = this._spec.roamDrag) === null || _a === void 0 ? void 0 : _a.autoVisible) {
|
|
97345
|
-
this.show();
|
|
97346
|
-
}
|
|
97347
|
-
const [dx, dy] = delta;
|
|
97348
|
-
let value = this._isHorizontal ? dx : dy;
|
|
97349
|
-
if (this._dragAttr.reverse) {
|
|
97350
|
-
value = -value;
|
|
97351
|
-
}
|
|
97352
|
-
this._handleChartMove(value, (_b = this._dragAttr.rate) !== null && _b !== void 0 ? _b : 1);
|
|
97353
|
-
};
|
|
97354
|
-
this._handleChartMove = (value, rate) => {
|
|
97355
|
-
const totalValue = this._isHorizontal ? this.getLayoutRect().width : this.getLayoutRect().height;
|
|
97356
|
-
if (Math.abs(value) >= 1e-6) {
|
|
97357
|
-
if (value > 0 && this._end < 1) {
|
|
97358
|
-
const moveDelta = Math.min(1 - this._end, value / totalValue) * rate;
|
|
97359
|
-
this._handleChange(this._start + moveDelta, this._end + moveDelta, true);
|
|
97360
|
-
}
|
|
97361
|
-
else if (value < 0 && this._start > 0) {
|
|
97362
|
-
const moveDelta = Math.max(-this._start, value / totalValue) * rate;
|
|
97363
|
-
this._handleChange(this._start + moveDelta, this._end + moveDelta, true);
|
|
97364
|
-
}
|
|
97365
|
-
}
|
|
97366
|
-
return false;
|
|
97367
|
-
};
|
|
97368
97644
|
this._orient = getOrient(spec);
|
|
97369
97645
|
this._isHorizontal = getDirectionByOrient(this._orient) === "horizontal";
|
|
97646
|
+
this._dataFilterEvent = new DataFilterEvent(this.type, this._spec, this._handleChange.bind(this), this.getLayoutRect.bind(this), () => {
|
|
97647
|
+
return {
|
|
97648
|
+
start: this._start,
|
|
97649
|
+
end: this._end
|
|
97650
|
+
};
|
|
97651
|
+
}, () => this._regions, (() => this._option).bind(this), () => this.event);
|
|
97370
97652
|
}
|
|
97371
97653
|
created() {
|
|
97372
97654
|
super.created();
|
|
@@ -97381,6 +97663,88 @@
|
|
|
97381
97663
|
super.initLayout();
|
|
97382
97664
|
this._layout && (this._layout.layoutOrient = this._orient);
|
|
97383
97665
|
}
|
|
97666
|
+
init(option) {
|
|
97667
|
+
super.init(option);
|
|
97668
|
+
this._addTransformToSeries();
|
|
97669
|
+
if (this._start !== 0 || this._end !== 1) {
|
|
97670
|
+
this.effect.onZoomChange();
|
|
97671
|
+
}
|
|
97672
|
+
}
|
|
97673
|
+
_compareSpec(spec, prevSpec) {
|
|
97674
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
97675
|
+
if (!result.reMake && !isEqual(prevSpec, spec)) {
|
|
97676
|
+
result.reRender = true;
|
|
97677
|
+
result.reMake = true;
|
|
97678
|
+
}
|
|
97679
|
+
return result;
|
|
97680
|
+
}
|
|
97681
|
+
reInit(spec) {
|
|
97682
|
+
super.reInit(spec);
|
|
97683
|
+
this._marks.forEach(g => {
|
|
97684
|
+
g.getMarks().forEach(m => {
|
|
97685
|
+
this.initMarkStyleWithSpec(m, this._spec[m.name]);
|
|
97686
|
+
});
|
|
97687
|
+
});
|
|
97688
|
+
}
|
|
97689
|
+
onLayoutStart(layoutRect, viewRect) {
|
|
97690
|
+
super.onLayoutStart(layoutRect, viewRect);
|
|
97691
|
+
const isShown = this._autoUpdate(layoutRect);
|
|
97692
|
+
this._autoVisible(isShown);
|
|
97693
|
+
this._dataUpdating = false;
|
|
97694
|
+
}
|
|
97695
|
+
updateLayoutAttribute() {
|
|
97696
|
+
this._visible && this._createOrUpdateComponent();
|
|
97697
|
+
if (!this._hasInitStateScale) {
|
|
97698
|
+
if (this._start !== 0 || this._end !== 1) {
|
|
97699
|
+
this._newDomain = parseDomainFromStateAndValue(this._spec.start, this._startValue, this._spec.end, this._endValue, this._stateScale);
|
|
97700
|
+
this.effect.onZoomChange();
|
|
97701
|
+
}
|
|
97702
|
+
this._hasInitStateScale = true;
|
|
97703
|
+
}
|
|
97704
|
+
}
|
|
97705
|
+
_initAfterLayout() {
|
|
97706
|
+
this._stateScale = null;
|
|
97707
|
+
this._initStateScale();
|
|
97708
|
+
this._updateScaleRange();
|
|
97709
|
+
this._setStateFromAxis();
|
|
97710
|
+
}
|
|
97711
|
+
_beforeLayoutEnd() {
|
|
97712
|
+
if (!this._hasInitStateScale) {
|
|
97713
|
+
this._initAfterLayout();
|
|
97714
|
+
}
|
|
97715
|
+
else {
|
|
97716
|
+
this._updateScaleRange();
|
|
97717
|
+
}
|
|
97718
|
+
}
|
|
97719
|
+
onLayoutEnd() {
|
|
97720
|
+
var _a;
|
|
97721
|
+
this._beforeLayoutEnd();
|
|
97722
|
+
const isShown = !(this._start === 0 && this._end === 1);
|
|
97723
|
+
this._autoVisible(isShown);
|
|
97724
|
+
super.onLayoutEnd();
|
|
97725
|
+
(_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.updateScaleRange();
|
|
97726
|
+
}
|
|
97727
|
+
getBoundsInRect(rect) {
|
|
97728
|
+
const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
|
|
97729
|
+
if (this._isHorizontal) {
|
|
97730
|
+
result.y2 = result.y1 + this._height;
|
|
97731
|
+
result.x2 = result.x1 + rect.width;
|
|
97732
|
+
}
|
|
97733
|
+
else {
|
|
97734
|
+
result.x2 = result.x1 + this._width;
|
|
97735
|
+
result.y2 = result.y1 + rect.height;
|
|
97736
|
+
}
|
|
97737
|
+
return result;
|
|
97738
|
+
}
|
|
97739
|
+
setAttrFromSpec() {
|
|
97740
|
+
var _a;
|
|
97741
|
+
super.setAttrFromSpec();
|
|
97742
|
+
this._dataFilterEvent.setEventAttrFromSpec();
|
|
97743
|
+
this._field = this._spec.field;
|
|
97744
|
+
this._width = this._computeWidth();
|
|
97745
|
+
this._height = this._computeHeight();
|
|
97746
|
+
this._visible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
97747
|
+
}
|
|
97384
97748
|
_setAxisFromSpec() {
|
|
97385
97749
|
if (isValid$1(this._spec.axisId)) {
|
|
97386
97750
|
this._relatedAxisComponent = this._option.getComponentByUserId(this._spec.axisId);
|
|
@@ -97390,7 +97754,7 @@
|
|
|
97390
97754
|
}
|
|
97391
97755
|
if (isNil$1(this._spec.field) && !this._relatedAxisComponent) {
|
|
97392
97756
|
const axes = this._option.getComponentsByKey('axes');
|
|
97393
|
-
const sameOrientAxis = axes.find((cm) => cm._orient === this._orient);
|
|
97757
|
+
const sameOrientAxis = axes.find((cm) => getDirectionByOrient(cm._orient) === getDirectionByOrient(this._orient));
|
|
97394
97758
|
if (sameOrientAxis) {
|
|
97395
97759
|
this._relatedAxisComponent = sameOrientAxis;
|
|
97396
97760
|
}
|
|
@@ -97441,33 +97805,9 @@
|
|
|
97441
97805
|
}
|
|
97442
97806
|
return;
|
|
97443
97807
|
}
|
|
97444
|
-
onDataUpdate() {
|
|
97445
|
-
var _a;
|
|
97446
|
-
const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
|
|
97447
|
-
this._stateScale.domain(domain, false);
|
|
97448
|
-
this._handleChange(this._start, this._end, true);
|
|
97449
|
-
if (this._spec.auto && !isEqual(this._domainCache, domain)) {
|
|
97450
|
-
this._domainCache = domain;
|
|
97451
|
-
this._dataUpdating = true;
|
|
97452
|
-
(_a = this.getChart()) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true, null, false);
|
|
97453
|
-
}
|
|
97454
|
-
}
|
|
97455
|
-
_computeDomainOfStateScale(isContinuous) {
|
|
97456
|
-
if (this._spec.customDomain) {
|
|
97457
|
-
return this._spec.customDomain;
|
|
97458
|
-
}
|
|
97459
|
-
const domain = this._data.getLatestData().map((d) => d[this._stateField]);
|
|
97460
|
-
if (isContinuous) {
|
|
97461
|
-
const domainNum = domain.map((n) => n * 1);
|
|
97462
|
-
return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [-Infinity, Infinity];
|
|
97463
|
-
}
|
|
97464
|
-
return domain;
|
|
97465
|
-
}
|
|
97466
|
-
_initEvent() {
|
|
97467
|
-
this._initCommonEvent();
|
|
97468
|
-
}
|
|
97469
97808
|
_initData() {
|
|
97470
97809
|
const dataCollection = [];
|
|
97810
|
+
const seriesCollection = [];
|
|
97471
97811
|
const stateFields = [];
|
|
97472
97812
|
const valueFields = [];
|
|
97473
97813
|
let isCategoryState;
|
|
@@ -97496,6 +97836,8 @@
|
|
|
97496
97836
|
? xAxisHelper
|
|
97497
97837
|
: yAxisHelper;
|
|
97498
97838
|
const valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
|
|
97839
|
+
const isValidateValueAxis = isContinuous(valueAxisHelper.getScale(0).type);
|
|
97840
|
+
const isValidateStateAxis = isContinuous(stateAxisHelper.getScale(0).type);
|
|
97499
97841
|
dataCollection.push(s.getRawData());
|
|
97500
97842
|
const seriesSpec = s.getSpec();
|
|
97501
97843
|
const xField = s.coordinate === 'cartesian'
|
|
@@ -97506,16 +97848,17 @@
|
|
|
97506
97848
|
: array((_b = seriesSpec.radiusField) !== null && _b !== void 0 ? _b : seriesSpec.valueField);
|
|
97507
97849
|
originalStateFields[s.id] =
|
|
97508
97850
|
s.type === 'link' ? ['from_xField'] : stateAxisHelper === xAxisHelper ? xField : yField;
|
|
97509
|
-
if (
|
|
97851
|
+
if (isValidateStateAxis) {
|
|
97510
97852
|
isCategoryState = false;
|
|
97511
97853
|
stateFields.push(originalStateFields[s.id]);
|
|
97512
97854
|
}
|
|
97513
97855
|
else {
|
|
97856
|
+
isCategoryState = true;
|
|
97514
97857
|
stateFields.push(originalStateFields[s.id][0]);
|
|
97515
97858
|
}
|
|
97516
97859
|
if (this._valueField) {
|
|
97517
97860
|
const valueField = s.type === 'link' ? ['from_yField'] : valueAxisHelper === xAxisHelper ? xField : yField;
|
|
97518
|
-
if (
|
|
97861
|
+
if (isValidateValueAxis) {
|
|
97519
97862
|
valueFields.push(...valueField);
|
|
97520
97863
|
}
|
|
97521
97864
|
}
|
|
@@ -97528,6 +97871,7 @@
|
|
|
97528
97871
|
else {
|
|
97529
97872
|
eachSeries(this._regions, s => {
|
|
97530
97873
|
dataCollection.push(s.getRawData());
|
|
97874
|
+
seriesCollection.push(s);
|
|
97531
97875
|
stateFields.push(this._field);
|
|
97532
97876
|
if (this._valueField) {
|
|
97533
97877
|
valueFields.push(this._spec.valueField);
|
|
@@ -97546,6 +97890,7 @@
|
|
|
97546
97890
|
options: {
|
|
97547
97891
|
input: {
|
|
97548
97892
|
dataCollection: dataCollection,
|
|
97893
|
+
seriesCollection,
|
|
97549
97894
|
stateFields,
|
|
97550
97895
|
valueFields,
|
|
97551
97896
|
isCategoryState
|
|
@@ -97560,136 +97905,6 @@
|
|
|
97560
97905
|
data.reRunAllTransform();
|
|
97561
97906
|
dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChange.bind(this));
|
|
97562
97907
|
}
|
|
97563
|
-
setAttrFromSpec() {
|
|
97564
|
-
var _a;
|
|
97565
|
-
super.setAttrFromSpec();
|
|
97566
|
-
if (this._spec.roamZoom === true || this._spec.roamZoom) {
|
|
97567
|
-
this._zoomAttr = merge$1({}, this._zoomAttr, this._spec.roamZoom);
|
|
97568
|
-
}
|
|
97569
|
-
else {
|
|
97570
|
-
this._zoomAttr.enable = false;
|
|
97571
|
-
}
|
|
97572
|
-
if (this._spec.roamDrag === true || this._spec.roamDrag) {
|
|
97573
|
-
this._dragAttr = merge$1({}, this._dragAttr, this._spec.roamDrag);
|
|
97574
|
-
}
|
|
97575
|
-
else {
|
|
97576
|
-
this._dragAttr.enable = false;
|
|
97577
|
-
}
|
|
97578
|
-
if (this._spec.roamScroll === true || this._spec.roamScroll) {
|
|
97579
|
-
this._scrollAttr = merge$1({}, this._scrollAttr, this._spec.roamScroll);
|
|
97580
|
-
}
|
|
97581
|
-
else {
|
|
97582
|
-
this._scrollAttr.enable = false;
|
|
97583
|
-
}
|
|
97584
|
-
this._field = this._spec.field;
|
|
97585
|
-
this._width = this._computeWidth();
|
|
97586
|
-
this._height = this._computeHeight();
|
|
97587
|
-
this._visible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
97588
|
-
}
|
|
97589
|
-
statePointToData(state) {
|
|
97590
|
-
const scale = this._stateScale;
|
|
97591
|
-
const domain = scale.domain();
|
|
97592
|
-
if (isContinuous(scale.type)) {
|
|
97593
|
-
if (this._isReverse()) {
|
|
97594
|
-
return domain[0] + (last(domain) - domain[0]) * (1 - state);
|
|
97595
|
-
}
|
|
97596
|
-
return domain[0] + (last(domain) - domain[0]) * state;
|
|
97597
|
-
}
|
|
97598
|
-
let range = scale.range();
|
|
97599
|
-
if (this._isReverse()) {
|
|
97600
|
-
range = range.slice().reverse();
|
|
97601
|
-
}
|
|
97602
|
-
const posInRange = range[0] + (last(range) - range[0]) * state;
|
|
97603
|
-
return scale.invert(posInRange);
|
|
97604
|
-
}
|
|
97605
|
-
dataToStatePoint(data) {
|
|
97606
|
-
const scale = this._stateScale;
|
|
97607
|
-
const pos = scale.scale(data);
|
|
97608
|
-
let range = scale.range();
|
|
97609
|
-
if (!this._isHorizontal && isContinuous(scale.type)) {
|
|
97610
|
-
range = range.slice().reverse();
|
|
97611
|
-
}
|
|
97612
|
-
return (pos - range[0]) / (last(range) - range[0]);
|
|
97613
|
-
}
|
|
97614
|
-
_modeCheck(statePoint, mode) {
|
|
97615
|
-
if (statePoint === 'start') {
|
|
97616
|
-
return (mode === 'percent' && isValid$1(this._spec.start)) || (mode === 'value' && isValid$1(this._spec.startValue));
|
|
97617
|
-
}
|
|
97618
|
-
return (mode === 'percent' && isValid$1(this._spec.end)) || (mode === 'value' && isValid$1(this._spec.endValue));
|
|
97619
|
-
}
|
|
97620
|
-
_setStateFromSpec() {
|
|
97621
|
-
var _a, _b;
|
|
97622
|
-
this._auto = !!this._spec.auto;
|
|
97623
|
-
let start;
|
|
97624
|
-
let end;
|
|
97625
|
-
if (this._spec.rangeMode) {
|
|
97626
|
-
const [startMode, endMode] = this._spec.rangeMode;
|
|
97627
|
-
if (this._modeCheck('start', startMode) && this._modeCheck('end', endMode)) {
|
|
97628
|
-
start = startMode === 'percent' ? this._spec.start : this.dataToStatePoint(this._spec.startValue);
|
|
97629
|
-
end = endMode === 'percent' ? this._spec.end : this.dataToStatePoint(this._spec.endValue);
|
|
97630
|
-
}
|
|
97631
|
-
}
|
|
97632
|
-
else {
|
|
97633
|
-
start = this._spec.start
|
|
97634
|
-
? this._spec.start
|
|
97635
|
-
: this._spec.startValue
|
|
97636
|
-
? this.dataToStatePoint(this._spec.startValue)
|
|
97637
|
-
: 0;
|
|
97638
|
-
end = this._spec.end ? this._spec.end : this._spec.endValue ? this.dataToStatePoint(this._spec.endValue) : 1;
|
|
97639
|
-
}
|
|
97640
|
-
this._startValue = this.statePointToData(start);
|
|
97641
|
-
this._endValue = this.statePointToData(end);
|
|
97642
|
-
this._start = start;
|
|
97643
|
-
this._end = end;
|
|
97644
|
-
this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
|
|
97645
|
-
this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
|
|
97646
|
-
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== last(this._stateScale.domain())) {
|
|
97647
|
-
if (this._spec.minValueSpan) {
|
|
97648
|
-
this._minSpan = this._spec.minValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
97649
|
-
}
|
|
97650
|
-
if (this._spec.maxValueSpan) {
|
|
97651
|
-
this._maxSpan = this._spec.maxValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
97652
|
-
}
|
|
97653
|
-
}
|
|
97654
|
-
this._minSpan = Math.max(0, this._minSpan);
|
|
97655
|
-
this._maxSpan = Math.min(this._maxSpan, 1);
|
|
97656
|
-
if ((!this._relatedAxisComponent || this._filterMode !== 'axis') && (this._start !== 0 || this._end !== 1)) {
|
|
97657
|
-
this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
|
|
97658
|
-
}
|
|
97659
|
-
}
|
|
97660
|
-
_parseFieldOfSeries(s) {
|
|
97661
|
-
var _a;
|
|
97662
|
-
return (_a = this._originalStateFields) === null || _a === void 0 ? void 0 : _a[s.id];
|
|
97663
|
-
}
|
|
97664
|
-
_initStateScale() {
|
|
97665
|
-
const defaultRange = [0, 1];
|
|
97666
|
-
if (this._relatedAxisComponent) {
|
|
97667
|
-
const scale = this._relatedAxisComponent.getScale();
|
|
97668
|
-
const isContinuousScale = isContinuous(scale.type);
|
|
97669
|
-
const domain = this._computeDomainOfStateScale(isContinuousScale);
|
|
97670
|
-
this._stateScale = scale.clone();
|
|
97671
|
-
if (isContinuousScale) {
|
|
97672
|
-
const domainNum = domain.map((n) => n * 1);
|
|
97673
|
-
this._stateScale
|
|
97674
|
-
.domain(domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [0, 1], true)
|
|
97675
|
-
.range(defaultRange);
|
|
97676
|
-
}
|
|
97677
|
-
else {
|
|
97678
|
-
this._stateScale.domain(domain, true).range(defaultRange);
|
|
97679
|
-
}
|
|
97680
|
-
}
|
|
97681
|
-
else {
|
|
97682
|
-
this._stateScale = new BandScale();
|
|
97683
|
-
this._stateScale.domain(this._computeDomainOfStateScale(), true).range(defaultRange);
|
|
97684
|
-
}
|
|
97685
|
-
}
|
|
97686
|
-
init(option) {
|
|
97687
|
-
super.init(option);
|
|
97688
|
-
this._addTransformToSeries();
|
|
97689
|
-
if (this._start !== 0 || this._end !== 1) {
|
|
97690
|
-
this.effect.onZoomChange();
|
|
97691
|
-
}
|
|
97692
|
-
}
|
|
97693
97908
|
_addTransformToSeries() {
|
|
97694
97909
|
if (!this._relatedAxisComponent || this._filterMode !== 'axis') {
|
|
97695
97910
|
registerDataSetInstanceTransform(this._option.dataSet, 'dataFilterWithNewDomain', dataFilterWithNewDomain);
|
|
@@ -97728,59 +97943,116 @@
|
|
|
97728
97943
|
});
|
|
97729
97944
|
}
|
|
97730
97945
|
}
|
|
97731
|
-
|
|
97732
|
-
|
|
97733
|
-
|
|
97734
|
-
|
|
97735
|
-
|
|
97946
|
+
onDataUpdate() {
|
|
97947
|
+
var _a;
|
|
97948
|
+
const domain = this._computeDomainOfStateScale(isContinuous(this._stateScale.type));
|
|
97949
|
+
this._stateScale.domain(domain, false);
|
|
97950
|
+
this._handleChange(this._start, this._end, true);
|
|
97951
|
+
if (this._spec.auto && !isEqual(this._domainCache, domain)) {
|
|
97952
|
+
this._domainCache = domain;
|
|
97953
|
+
this._dataUpdating = true;
|
|
97954
|
+
(_a = this.getChart()) === null || _a === void 0 ? void 0 : _a.setLayoutTag(true, null, false);
|
|
97736
97955
|
}
|
|
97737
|
-
return result;
|
|
97738
97956
|
}
|
|
97739
|
-
|
|
97740
|
-
|
|
97741
|
-
this.
|
|
97742
|
-
g.getMarks().forEach(m => {
|
|
97743
|
-
this.initMarkStyleWithSpec(m, this._spec[m.name]);
|
|
97744
|
-
});
|
|
97745
|
-
});
|
|
97957
|
+
_parseFieldOfSeries(s) {
|
|
97958
|
+
var _a;
|
|
97959
|
+
return (_a = this._originalStateFields) === null || _a === void 0 ? void 0 : _a[s.id];
|
|
97746
97960
|
}
|
|
97747
|
-
|
|
97748
|
-
|
|
97749
|
-
|
|
97961
|
+
_setStateFromSpec() {
|
|
97962
|
+
this._auto = !!this._spec.auto;
|
|
97963
|
+
let start;
|
|
97964
|
+
let end;
|
|
97965
|
+
if (this._spec.rangeMode) {
|
|
97966
|
+
const [startMode, endMode] = this._spec.rangeMode;
|
|
97967
|
+
if (modeCheck('start', startMode, this._spec) && modeCheck('end', endMode, this._spec)) {
|
|
97968
|
+
start =
|
|
97969
|
+
startMode === 'percent'
|
|
97970
|
+
? this._spec.start
|
|
97971
|
+
: dataToStatePoint(this._spec.startValue, this._stateScale, this._isHorizontal);
|
|
97972
|
+
end =
|
|
97973
|
+
endMode === 'percent'
|
|
97974
|
+
? this._spec.end
|
|
97975
|
+
: dataToStatePoint(this._spec.endValue, this._stateScale, this._isHorizontal);
|
|
97976
|
+
}
|
|
97977
|
+
}
|
|
97978
|
+
else {
|
|
97979
|
+
start = this._spec.start
|
|
97980
|
+
? this._spec.start
|
|
97981
|
+
: this._spec.startValue
|
|
97982
|
+
? dataToStatePoint(this._spec.startValue, this._stateScale, this._isHorizontal)
|
|
97983
|
+
: 0;
|
|
97984
|
+
end = this._spec.end
|
|
97985
|
+
? this._spec.end
|
|
97986
|
+
: this._spec.endValue
|
|
97987
|
+
? dataToStatePoint(this._spec.endValue, this._stateScale, this._isHorizontal)
|
|
97988
|
+
: 1;
|
|
97750
97989
|
}
|
|
97751
|
-
|
|
97752
|
-
|
|
97753
|
-
const endIndex = allDomain.indexOf(endValue);
|
|
97754
|
-
return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
|
|
97990
|
+
this._start = Math.max(0, Math.min(1, start));
|
|
97991
|
+
this._end = Math.max(0, Math.min(1, end));
|
|
97755
97992
|
}
|
|
97756
|
-
|
|
97757
|
-
var _a, _b
|
|
97758
|
-
|
|
97759
|
-
const
|
|
97760
|
-
|
|
97761
|
-
|
|
97762
|
-
|
|
97763
|
-
|
|
97764
|
-
|
|
97765
|
-
|
|
97766
|
-
|
|
97767
|
-
|
|
97768
|
-
|
|
97769
|
-
|
|
97770
|
-
|
|
97771
|
-
|
|
97772
|
-
|
|
97773
|
-
|
|
97774
|
-
|
|
97775
|
-
|
|
97776
|
-
|
|
97993
|
+
_setStateFromAxis() {
|
|
97994
|
+
var _a, _b;
|
|
97995
|
+
this._setStateFromSpec();
|
|
97996
|
+
const axis = this._relatedAxisComponent;
|
|
97997
|
+
this._startValue = statePointToData(this._start, this._stateScale, isReverse(axis, this._isHorizontal));
|
|
97998
|
+
this._endValue = statePointToData(this._end, this._stateScale, isReverse(axis, this._isHorizontal));
|
|
97999
|
+
this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
|
|
98000
|
+
this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
|
|
98001
|
+
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== last(this._stateScale.domain())) {
|
|
98002
|
+
if (this._spec.minValueSpan) {
|
|
98003
|
+
this._minSpan = this._spec.minValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
98004
|
+
}
|
|
98005
|
+
if (this._spec.maxValueSpan) {
|
|
98006
|
+
this._maxSpan = this._spec.maxValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
98007
|
+
}
|
|
98008
|
+
}
|
|
98009
|
+
this._minSpan = Math.max(0, this._minSpan);
|
|
98010
|
+
this._maxSpan = Math.min(this._maxSpan, 1);
|
|
98011
|
+
if (!axis) {
|
|
98012
|
+
return;
|
|
98013
|
+
}
|
|
98014
|
+
if ((!axis || this._filterMode !== 'axis') && (this._start !== 0 || this._end !== 1)) {
|
|
98015
|
+
this._newDomain = parseDomainFromState(this._startValue, this._endValue, this._stateScale);
|
|
97777
98016
|
}
|
|
97778
98017
|
}
|
|
97779
|
-
|
|
97780
|
-
|
|
97781
|
-
|
|
98018
|
+
_initStateScale() {
|
|
98019
|
+
var _a, _b, _c, _d, _e, _f;
|
|
98020
|
+
const defaultRange = [0, 1];
|
|
98021
|
+
if (this._relatedAxisComponent) {
|
|
98022
|
+
const scale = this._relatedAxisComponent.getScale().clone();
|
|
98023
|
+
this._stateScale = scale;
|
|
98024
|
+
(_b = (_a = scale).maxBandwidth) === null || _b === void 0 ? void 0 : _b.call(_a, 'auto', true);
|
|
98025
|
+
(_d = (_c = scale).minBandwidth) === null || _d === void 0 ? void 0 : _d.call(_c, 'auto', true);
|
|
98026
|
+
(_f = (_e = scale).bandwidth) === null || _f === void 0 ? void 0 : _f.call(_e, 'auto', true);
|
|
98027
|
+
scale.rangeFactor(defaultRange, true).range(defaultRange);
|
|
97782
98028
|
}
|
|
97783
|
-
|
|
98029
|
+
else {
|
|
98030
|
+
let fieldLinear = true;
|
|
98031
|
+
if (this._field) {
|
|
98032
|
+
eachSeries(this._regions, s => {
|
|
98033
|
+
const stats = s.getRawDataStatisticsByField(this._field);
|
|
98034
|
+
if (!isValidNumber$1(stats === null || stats === void 0 ? void 0 : stats.min) || !isValidNumber$1(stats === null || stats === void 0 ? void 0 : stats.max)) {
|
|
98035
|
+
fieldLinear = false;
|
|
98036
|
+
}
|
|
98037
|
+
}, {
|
|
98038
|
+
userId: this._seriesUserId,
|
|
98039
|
+
specIndex: this._seriesIndex
|
|
98040
|
+
});
|
|
98041
|
+
}
|
|
98042
|
+
this._stateScale = fieldLinear ? new LinearScale() : new BandScale();
|
|
98043
|
+
this._stateScale.domain(this._computeDomainOfStateScale(fieldLinear), true).range(defaultRange);
|
|
98044
|
+
}
|
|
98045
|
+
}
|
|
98046
|
+
_computeDomainOfStateScale(isContinuous) {
|
|
98047
|
+
if (this._spec.customDomain) {
|
|
98048
|
+
return this._spec.customDomain;
|
|
98049
|
+
}
|
|
98050
|
+
const domain = this._data.getLatestData().map((d) => d[this._stateField]);
|
|
98051
|
+
if (isContinuous) {
|
|
98052
|
+
const domainNum = domain.map((n) => n * 1);
|
|
98053
|
+
return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [-Infinity, Infinity];
|
|
98054
|
+
}
|
|
98055
|
+
return domain;
|
|
97784
98056
|
}
|
|
97785
98057
|
_autoVisible(isShown) {
|
|
97786
98058
|
if (!this._auto) {
|
|
@@ -97799,29 +98071,6 @@
|
|
|
97799
98071
|
[sizeKey]: exports.AttributeLevel.Built_In
|
|
97800
98072
|
});
|
|
97801
98073
|
}
|
|
97802
|
-
onLayoutStart(layoutRect, viewRect) {
|
|
97803
|
-
super.onLayoutStart(layoutRect, viewRect);
|
|
97804
|
-
const isShown = this._autoUpdate(layoutRect);
|
|
97805
|
-
this._autoVisible(isShown);
|
|
97806
|
-
this._dataUpdating = false;
|
|
97807
|
-
}
|
|
97808
|
-
onLayoutEnd() {
|
|
97809
|
-
const isShown = !(this._start === 0 && this._end === 1);
|
|
97810
|
-
this._autoVisible(isShown);
|
|
97811
|
-
super.onLayoutEnd();
|
|
97812
|
-
}
|
|
97813
|
-
getBoundsInRect(rect) {
|
|
97814
|
-
const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
|
|
97815
|
-
if (this._isHorizontal) {
|
|
97816
|
-
result.y2 = result.y1 + this._height;
|
|
97817
|
-
result.x2 = result.x1 + rect.width;
|
|
97818
|
-
}
|
|
97819
|
-
else {
|
|
97820
|
-
result.x2 = result.x1 + this._width;
|
|
97821
|
-
result.y2 = result.y1 + rect.height;
|
|
97822
|
-
}
|
|
97823
|
-
return result;
|
|
97824
|
-
}
|
|
97825
98074
|
hide() {
|
|
97826
98075
|
var _a;
|
|
97827
98076
|
(_a = this._component) === null || _a === void 0 ? void 0 : _a.hideAll();
|
|
@@ -97830,15 +98079,6 @@
|
|
|
97830
98079
|
var _a;
|
|
97831
98080
|
(_a = this._component) === null || _a === void 0 ? void 0 : _a.showAll();
|
|
97832
98081
|
}
|
|
97833
|
-
_getAxisBandSize(axisSpec) {
|
|
97834
|
-
const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
|
|
97835
|
-
const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
|
|
97836
|
-
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
97837
|
-
if (bandSize || minBandSize || maxBandSize) {
|
|
97838
|
-
return { bandSize, maxBandSize, minBandSize };
|
|
97839
|
-
}
|
|
97840
|
-
return undefined;
|
|
97841
|
-
}
|
|
97842
98082
|
_autoUpdate(rect) {
|
|
97843
98083
|
var _a, _b, _c, _d, _e, _f;
|
|
97844
98084
|
if (!this._auto) {
|
|
@@ -97848,7 +98088,7 @@
|
|
|
97848
98088
|
const axis = this._relatedAxisComponent;
|
|
97849
98089
|
const axisSpec = axis === null || axis === void 0 ? void 0 : axis.getSpec();
|
|
97850
98090
|
const axisScale = axis === null || axis === void 0 ? void 0 : axis.getScale();
|
|
97851
|
-
const bandSizeResult =
|
|
98091
|
+
const bandSizeResult = getAxisBandSize(axisSpec);
|
|
97852
98092
|
if (!this._dataUpdating &&
|
|
97853
98093
|
isDiscrete(axisScale.type) &&
|
|
97854
98094
|
(rect === null || rect === void 0 ? void 0 : rect.height) === ((_a = this._cacheRect) === null || _a === void 0 ? void 0 : _a.height) &&
|
|
@@ -97895,9 +98135,6 @@
|
|
|
97895
98135
|
_getNeedClearVRenderComponents() {
|
|
97896
98136
|
return [this._component];
|
|
97897
98137
|
}
|
|
97898
|
-
clear() {
|
|
97899
|
-
this._throttledHide = null;
|
|
97900
|
-
}
|
|
97901
98138
|
}
|
|
97902
98139
|
mixin(DataFilterBaseComponent, Zoomable);
|
|
97903
98140
|
|
|
@@ -98043,14 +98280,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98043
98280
|
this.layoutType = 'region-relative';
|
|
98044
98281
|
this._isReverseCache = false;
|
|
98045
98282
|
this._dataToPositionX = (datum) => {
|
|
98046
|
-
const offsetLeft = this.
|
|
98283
|
+
const offsetLeft = !this._isHorizontal ? this._middleHandlerSize : 0;
|
|
98047
98284
|
const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
|
|
98048
98285
|
const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
|
|
98049
98286
|
const xField = this._isHorizontal ? this._stateField : this._valueField;
|
|
98050
98287
|
return xScale.scale(datum[xField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
|
|
98051
98288
|
};
|
|
98052
98289
|
this._dataToPositionX2 = (datum) => {
|
|
98053
|
-
const offsetLeft = this.
|
|
98290
|
+
const offsetLeft = !this._isHorizontal ? this._middleHandlerSize : 0;
|
|
98054
98291
|
const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
|
|
98055
98292
|
const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
|
|
98056
98293
|
const min = xScale.domain()[0];
|
|
@@ -98059,63 +98296,146 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98059
98296
|
this._dataToPositionY = (datum) => {
|
|
98060
98297
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
98061
98298
|
const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
|
|
98062
|
-
const yScale = this._isHorizontal ? this._valueScale : this.
|
|
98299
|
+
const yScale = this._isHorizontal ? this._valueScale : this._getPreviewStateScale();
|
|
98063
98300
|
const yField = this._isHorizontal ? this._valueField : this._stateField;
|
|
98064
98301
|
return yScale.scale(datum[yField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
|
|
98065
98302
|
};
|
|
98066
98303
|
this._dataToPositionY2 = (datum) => {
|
|
98067
98304
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
98068
98305
|
const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
|
|
98069
|
-
const yScale = this._isHorizontal ? this._valueScale : this.
|
|
98306
|
+
const yScale = this._isHorizontal ? this._valueScale : this._getPreviewStateScale();
|
|
98070
98307
|
const min = yScale.domain()[0];
|
|
98071
98308
|
return yScale.scale(min) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
|
|
98072
98309
|
};
|
|
98073
98310
|
this._valueField = 'y';
|
|
98074
98311
|
this._filterMode = (_a = spec.filterMode) !== null && _a !== void 0 ? _a : 'filter';
|
|
98075
98312
|
}
|
|
98313
|
+
_handleChange(start, end, updateComponent, tag) {
|
|
98314
|
+
super._handleChange(start, end, updateComponent);
|
|
98315
|
+
if (this._shouldChange) {
|
|
98316
|
+
if (updateComponent && this._component) {
|
|
98317
|
+
this._component.setStartAndEnd(start, end);
|
|
98318
|
+
}
|
|
98319
|
+
else {
|
|
98320
|
+
const axis = this._relatedAxisComponent;
|
|
98321
|
+
const startValue = statePointToData(start, this._stateScale, isReverse(axis, this._isHorizontal));
|
|
98322
|
+
const endValue = statePointToData(end, this._stateScale, isReverse(axis, this._isHorizontal));
|
|
98323
|
+
if (!isValid$1(startValue) || !isValid$1(endValue)) {
|
|
98324
|
+
return;
|
|
98325
|
+
}
|
|
98326
|
+
this._start = start;
|
|
98327
|
+
this._end = end;
|
|
98328
|
+
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
98329
|
+
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
98330
|
+
: this._handleStateChange(startValue, endValue, tag);
|
|
98331
|
+
if (hasChange) {
|
|
98332
|
+
this.event.emit(exports.ChartEvent.dataZoomChange, {
|
|
98333
|
+
model: this,
|
|
98334
|
+
value: {
|
|
98335
|
+
filterData: this._filterMode !== 'axis',
|
|
98336
|
+
start,
|
|
98337
|
+
end,
|
|
98338
|
+
startValue: this._startValue,
|
|
98339
|
+
endValue: this._endValue,
|
|
98340
|
+
newDomain: this._newDomain
|
|
98341
|
+
}
|
|
98342
|
+
});
|
|
98343
|
+
}
|
|
98344
|
+
}
|
|
98345
|
+
}
|
|
98346
|
+
}
|
|
98347
|
+
_handleDataCollectionChange() {
|
|
98348
|
+
const data = this._data.getDataView();
|
|
98349
|
+
data.reRunAllTransform();
|
|
98350
|
+
const domain = this._computeDomainOfValueScale();
|
|
98351
|
+
if (domain) {
|
|
98352
|
+
if (!this._valueScale) {
|
|
98353
|
+
this._valueScale = new LinearScale();
|
|
98354
|
+
}
|
|
98355
|
+
this._valueScale.domain(domain);
|
|
98356
|
+
this._updateValueScaleRange();
|
|
98357
|
+
if (this._component) {
|
|
98358
|
+
this._createOrUpdateComponent(true);
|
|
98359
|
+
}
|
|
98360
|
+
}
|
|
98361
|
+
}
|
|
98076
98362
|
created() {
|
|
98077
98363
|
super.created();
|
|
98078
98364
|
this._initValueScale();
|
|
98079
98365
|
}
|
|
98366
|
+
updateLayoutAttribute() {
|
|
98367
|
+
if (this._cacheVisibility !== false) {
|
|
98368
|
+
super.updateLayoutAttribute();
|
|
98369
|
+
}
|
|
98370
|
+
}
|
|
98371
|
+
_beforeLayoutEnd() {
|
|
98372
|
+
super._beforeLayoutEnd();
|
|
98373
|
+
const axis = this._relatedAxisComponent;
|
|
98374
|
+
if ((isReverse(axis, this._isHorizontal) && !this._isReverseCache) || this._auto) {
|
|
98375
|
+
this._isReverseCache = isReverse(axis, this._isHorizontal);
|
|
98376
|
+
this.effect.onZoomChange();
|
|
98377
|
+
}
|
|
98378
|
+
}
|
|
98379
|
+
clear() {
|
|
98380
|
+
if (this._component) {
|
|
98381
|
+
const container = this.getContainer();
|
|
98382
|
+
this._component.removeAllChild();
|
|
98383
|
+
if (container) {
|
|
98384
|
+
container.removeChild(this._component);
|
|
98385
|
+
}
|
|
98386
|
+
this._component = null;
|
|
98387
|
+
}
|
|
98388
|
+
super.clear();
|
|
98389
|
+
}
|
|
98390
|
+
getBoundsInRect(rect) {
|
|
98391
|
+
var _a, _b, _c, _d;
|
|
98392
|
+
const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
|
|
98393
|
+
const startHandlerScaleXSize = this._startHandlerSize * ((_a = this._spec.startHandler.style.scaleX) !== null && _a !== void 0 ? _a : 1);
|
|
98394
|
+
const startHandlerScaleYSize = this._startHandlerSize * ((_b = this._spec.startHandler.style.scaleY) !== null && _b !== void 0 ? _b : 1);
|
|
98395
|
+
const endHandlerScaleXSize = this._endHandlerSize * ((_c = this._spec.endHandler.style.scaleX) !== null && _c !== void 0 ? _c : 1);
|
|
98396
|
+
const endHandlerScaleYSize = this._endHandlerSize * ((_d = this._spec.endHandler.style.scaleY) !== null && _d !== void 0 ? _d : 1);
|
|
98397
|
+
const extendWidth = !this._visible
|
|
98398
|
+
? 0
|
|
98399
|
+
: this._isHorizontal
|
|
98400
|
+
? (startHandlerScaleXSize - this._startHandlerSize) / 2 + (endHandlerScaleXSize - this._endHandlerSize) / 2
|
|
98401
|
+
: (Math.max(startHandlerScaleXSize, endHandlerScaleXSize) - this._width) / 2;
|
|
98402
|
+
const extendHeight = !this._visible
|
|
98403
|
+
? 0
|
|
98404
|
+
: this._isHorizontal
|
|
98405
|
+
? (Math.max(startHandlerScaleYSize, endHandlerScaleYSize) - this._height) / 2
|
|
98406
|
+
: (startHandlerScaleYSize - this._startHandlerSize) / 2 + (endHandlerScaleYSize - this._endHandlerSize) / 2;
|
|
98407
|
+
if (this._isHorizontal) {
|
|
98408
|
+
result.y2 = result.y1 + this._height + extendHeight;
|
|
98409
|
+
result.x2 = result.x1 + rect.width + extendWidth;
|
|
98410
|
+
}
|
|
98411
|
+
else {
|
|
98412
|
+
result.x2 = result.x1 + this._width + extendWidth;
|
|
98413
|
+
result.y2 = result.y1 + rect.height + extendHeight;
|
|
98414
|
+
}
|
|
98415
|
+
return result;
|
|
98416
|
+
}
|
|
98080
98417
|
setAttrFromSpec() {
|
|
98081
98418
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
98082
98419
|
super.setAttrFromSpec();
|
|
98083
|
-
|
|
98084
|
-
this._zoomAttr.enable = this._spec.roam;
|
|
98085
|
-
this._dragAttr.enable = this._spec.roam;
|
|
98086
|
-
this._scrollAttr.enable = this._spec.roam;
|
|
98087
|
-
}
|
|
98088
|
-
if (this._zoomAttr.enable || this._dragAttr.enable || this._scrollAttr.enable) {
|
|
98089
|
-
this.initZoomable(this.event, this._option.mode);
|
|
98090
|
-
}
|
|
98420
|
+
const componentSize = this._isHorizontal ? Number(this._spec.height) : Number(this._spec.width);
|
|
98091
98421
|
this._backgroundSize = (_b = (_a = this._spec.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 30;
|
|
98092
98422
|
this._middleHandlerSize = this._computeMiddleHandlerSize();
|
|
98093
|
-
this._width = this._computeWidth();
|
|
98094
|
-
this._height = this._computeHeight();
|
|
98095
98423
|
if (isNil$1((_e = (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.startHandler) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.size)) {
|
|
98096
|
-
this._spec.startHandler.style.size =
|
|
98097
|
-
? this.
|
|
98098
|
-
:
|
|
98424
|
+
this._spec.startHandler.style.size = isNaN(componentSize)
|
|
98425
|
+
? this._backgroundSize
|
|
98426
|
+
: componentSize - this._middleHandlerSize;
|
|
98099
98427
|
}
|
|
98100
98428
|
if (isNil$1((_h = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.endHandler) === null || _g === void 0 ? void 0 : _g.style) === null || _h === void 0 ? void 0 : _h.size)) {
|
|
98101
|
-
this._spec.endHandler.style.size =
|
|
98102
|
-
? this.
|
|
98103
|
-
:
|
|
98104
|
-
}
|
|
98105
|
-
const
|
|
98106
|
-
const
|
|
98107
|
-
this._startHandlerSize =
|
|
98108
|
-
this._endHandlerSize =
|
|
98109
|
-
|
|
98110
|
-
|
|
98111
|
-
this._updateScaleRange();
|
|
98112
|
-
if (this._isReverse() && !this._isReverseCache) {
|
|
98113
|
-
this._isReverseCache = this._isReverse();
|
|
98114
|
-
this.effect.onZoomChange();
|
|
98115
|
-
}
|
|
98116
|
-
if (this._cacheVisibility !== false) {
|
|
98117
|
-
super.onLayoutEnd();
|
|
98118
|
-
}
|
|
98429
|
+
this._spec.endHandler.style.size = isNaN(componentSize)
|
|
98430
|
+
? this._backgroundSize
|
|
98431
|
+
: componentSize - this._middleHandlerSize;
|
|
98432
|
+
}
|
|
98433
|
+
const startHandlerVisible = (_j = this._spec.startHandler.style.visible) !== null && _j !== void 0 ? _j : true;
|
|
98434
|
+
const endHandlerVisible = (_k = this._spec.endHandler.style.visible) !== null && _k !== void 0 ? _k : true;
|
|
98435
|
+
this._startHandlerSize = startHandlerVisible ? this._spec.startHandler.style.size : 0;
|
|
98436
|
+
this._endHandlerSize = endHandlerVisible ? this._spec.endHandler.style.size : 0;
|
|
98437
|
+
this._width = this._computeWidth();
|
|
98438
|
+
this._height = this._computeHeight();
|
|
98119
98439
|
}
|
|
98120
98440
|
_initValueScale() {
|
|
98121
98441
|
const domain = this._computeDomainOfValueScale();
|
|
@@ -98126,9 +98446,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98126
98446
|
}
|
|
98127
98447
|
}
|
|
98128
98448
|
_updateScaleRange() {
|
|
98129
|
-
|
|
98449
|
+
this._updateStateScaleRange();
|
|
98450
|
+
this._updateValueScaleRange();
|
|
98451
|
+
}
|
|
98452
|
+
_updateStateScaleRange() {
|
|
98453
|
+
var _a, _b, _c;
|
|
98130
98454
|
const handlerSize = this._startHandlerSize + this._endHandlerSize;
|
|
98131
|
-
if (!this._stateScale
|
|
98455
|
+
if (!this._stateScale) {
|
|
98132
98456
|
return;
|
|
98133
98457
|
}
|
|
98134
98458
|
let stateScaleRange;
|
|
@@ -98145,14 +98469,27 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98145
98469
|
stateScaleRange = this._visible
|
|
98146
98470
|
? [this._startHandlerSize / 2, compWidth - handlerSize + this._startHandlerSize / 2]
|
|
98147
98471
|
: defaultRange;
|
|
98148
|
-
this._stateScale.range(stateScaleRange);
|
|
98149
|
-
this._valueScale.range([compHeight - this._middleHandlerSize, 0]);
|
|
98150
98472
|
}
|
|
98151
98473
|
else {
|
|
98152
98474
|
stateScaleRange = this._visible
|
|
98153
98475
|
? [this._startHandlerSize / 2, compHeight - handlerSize + this._startHandlerSize / 2]
|
|
98154
98476
|
: defaultRange;
|
|
98155
|
-
|
|
98477
|
+
}
|
|
98478
|
+
this._stateScale.range(stateScaleRange);
|
|
98479
|
+
(_c = this._previewStateScale) === null || _c === void 0 ? void 0 : _c.range(isReverse(this._relatedAxisComponent, this._isHorizontal)
|
|
98480
|
+
? stateScaleRange.reverse()
|
|
98481
|
+
: stateScaleRange);
|
|
98482
|
+
}
|
|
98483
|
+
_updateValueScaleRange() {
|
|
98484
|
+
if (!this._valueScale) {
|
|
98485
|
+
return;
|
|
98486
|
+
}
|
|
98487
|
+
const compWidth = this._computeWidth();
|
|
98488
|
+
const compHeight = this._computeHeight();
|
|
98489
|
+
if (this._isHorizontal) {
|
|
98490
|
+
this._valueScale.range([compHeight - this._middleHandlerSize, 0]);
|
|
98491
|
+
}
|
|
98492
|
+
else {
|
|
98156
98493
|
if (this.layoutOrient === 'left') {
|
|
98157
98494
|
this._valueScale.range([compWidth - this._middleHandlerSize, 0]);
|
|
98158
98495
|
}
|
|
@@ -98160,24 +98497,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98160
98497
|
this._valueScale.range([0, compWidth - this._middleHandlerSize]);
|
|
98161
98498
|
}
|
|
98162
98499
|
}
|
|
98163
|
-
if (this._component && this._cacheVisibility !== false) {
|
|
98164
|
-
this._component.setAttributes({
|
|
98165
|
-
size: {
|
|
98166
|
-
width: compWidth,
|
|
98167
|
-
height: compHeight
|
|
98168
|
-
},
|
|
98169
|
-
position: {
|
|
98170
|
-
x: this.getLayoutStartPoint().x,
|
|
98171
|
-
y: this.getLayoutStartPoint().y
|
|
98172
|
-
}
|
|
98173
|
-
});
|
|
98174
|
-
}
|
|
98175
98500
|
}
|
|
98176
98501
|
_computeDomainOfValueScale() {
|
|
98177
98502
|
const domain = this._data.getLatestData().map((d) => d[this._valueField]);
|
|
98178
98503
|
const domainNum = domain.map((n) => n * 1);
|
|
98179
98504
|
return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : null;
|
|
98180
98505
|
}
|
|
98506
|
+
_isScaleValid(scale) {
|
|
98507
|
+
if (!scale || !scale.domain()) {
|
|
98508
|
+
return false;
|
|
98509
|
+
}
|
|
98510
|
+
const domain = scale.domain();
|
|
98511
|
+
if (isContinuous(scale.type) && domain[0] === last(domain)) {
|
|
98512
|
+
return false;
|
|
98513
|
+
}
|
|
98514
|
+
if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
|
|
98515
|
+
return false;
|
|
98516
|
+
}
|
|
98517
|
+
return true;
|
|
98518
|
+
}
|
|
98519
|
+
_getXScale() {
|
|
98520
|
+
const bindScale = this._relatedAxisComponent.getScale();
|
|
98521
|
+
if (bindScale.type === this.stateScale.type && this._isHorizontal) {
|
|
98522
|
+
return this.stateScale;
|
|
98523
|
+
}
|
|
98524
|
+
return this._isHorizontal ? this._stateScale : this._valueScale;
|
|
98525
|
+
}
|
|
98526
|
+
_getYScale() {
|
|
98527
|
+
return this._isHorizontal ? this._valueScale : this._stateScale;
|
|
98528
|
+
}
|
|
98181
98529
|
_computeMiddleHandlerSize() {
|
|
98182
98530
|
var _a, _b, _c, _d;
|
|
98183
98531
|
let size = 0;
|
|
@@ -98198,7 +98546,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98198
98546
|
if (this._isHorizontal) {
|
|
98199
98547
|
return this.getLayoutRect().width;
|
|
98200
98548
|
}
|
|
98201
|
-
return this.
|
|
98549
|
+
return (Math.max(this._startHandlerSize || 0, this._endHandlerSize || 0, this._backgroundSize || 0) +
|
|
98550
|
+
this._middleHandlerSize);
|
|
98202
98551
|
}
|
|
98203
98552
|
_computeHeight() {
|
|
98204
98553
|
if (this._visible === false) {
|
|
@@ -98208,23 +98557,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98208
98557
|
return this._spec.height;
|
|
98209
98558
|
}
|
|
98210
98559
|
if (this._isHorizontal) {
|
|
98211
|
-
return this.
|
|
98560
|
+
return (Math.max(this._startHandlerSize || 0, this._endHandlerSize || 0, this._backgroundSize || 0) +
|
|
98561
|
+
this._middleHandlerSize);
|
|
98212
98562
|
}
|
|
98213
98563
|
return this.getLayoutRect().height;
|
|
98214
98564
|
}
|
|
98215
|
-
_isScaleValid(scale) {
|
|
98216
|
-
if (!scale || !scale.domain()) {
|
|
98217
|
-
return false;
|
|
98218
|
-
}
|
|
98219
|
-
const domain = scale.domain();
|
|
98220
|
-
if (isContinuous(scale.type) && domain[0] === last(domain)) {
|
|
98221
|
-
return false;
|
|
98222
|
-
}
|
|
98223
|
-
if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
|
|
98224
|
-
return false;
|
|
98225
|
-
}
|
|
98226
|
-
return true;
|
|
98227
|
-
}
|
|
98228
98565
|
_getAttrs(isNeedPreview) {
|
|
98229
98566
|
var _a, _b, _c, _d, _e;
|
|
98230
98567
|
const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : {};
|
|
@@ -98234,73 +98571,58 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98234
98571
|
}, orient: this._orient, size: {
|
|
98235
98572
|
width: this._computeWidth(),
|
|
98236
98573
|
height: this._computeHeight()
|
|
98237
|
-
}, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? (_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance }, this._getComponentAttrs(isNeedPreview));
|
|
98574
|
+
}, showDetail: spec.showDetail, brushSelect: (_b = spec.brushSelect) !== null && _b !== void 0 ? _b : false, zoomLock: (_c = spec.zoomLock) !== null && _c !== void 0 ? _c : false, minSpan: this._minSpan, maxSpan: this._maxSpan, delayType: spec.delayType, delayTime: isValid$1(spec.delayType) ? ((_d = spec.delayTime) !== null && _d !== void 0 ? _d : 30) : 0, realTime: (_e = spec.realTime) !== null && _e !== void 0 ? _e : true, previewData: isNeedPreview && this._data.getLatestData(), previewPointsX: isNeedPreview && this._dataToPositionX, previewPointsY: isNeedPreview && this._dataToPositionY, tolerance: this._spec.tolerance, isReverse: isReverse(this._relatedAxisComponent, this._isHorizontal) }, this._getComponentAttrs(isNeedPreview));
|
|
98238
98575
|
}
|
|
98239
|
-
|
|
98576
|
+
_getLayoutAttrs() {
|
|
98577
|
+
return {
|
|
98578
|
+
position: {
|
|
98579
|
+
x: this.getLayoutStartPoint().x,
|
|
98580
|
+
y: this.getLayoutStartPoint().y
|
|
98581
|
+
},
|
|
98582
|
+
size: {
|
|
98583
|
+
width: this._computeWidth(),
|
|
98584
|
+
height: this._computeHeight()
|
|
98585
|
+
}
|
|
98586
|
+
};
|
|
98587
|
+
}
|
|
98588
|
+
_createOrUpdateComponent(changeData) {
|
|
98240
98589
|
if (this._visible) {
|
|
98241
98590
|
const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
|
|
98242
98591
|
const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
|
|
98243
98592
|
const isNeedPreview = this._isScaleValid(xScale) && this._isScaleValid(yScale) && this._spec.showBackgroundChart !== false;
|
|
98244
98593
|
const attrs = this._getAttrs(isNeedPreview);
|
|
98594
|
+
const axis = this._relatedAxisComponent;
|
|
98245
98595
|
if (this._component) {
|
|
98246
98596
|
this._component.setAttributes(attrs);
|
|
98597
|
+
if (changeData) {
|
|
98598
|
+
this._component.setPreviewData(this._data.getDataView().latestData);
|
|
98599
|
+
if (isNeedPreview) {
|
|
98600
|
+
if (this._isHorizontal) {
|
|
98601
|
+
this._component.setPreviewPointsY1(this._dataToPositionY2);
|
|
98602
|
+
}
|
|
98603
|
+
else {
|
|
98604
|
+
this._component.setPreviewPointsX1(this._dataToPositionX2);
|
|
98605
|
+
}
|
|
98606
|
+
this._component.setStatePointToData((state) => statePointToData(state, this._stateScale, isReverse(axis, this._isHorizontal)));
|
|
98607
|
+
}
|
|
98608
|
+
}
|
|
98247
98609
|
}
|
|
98248
98610
|
else {
|
|
98249
98611
|
const container = this.getContainer();
|
|
98250
98612
|
this._component = new DataZoom$1(attrs);
|
|
98613
|
+
this._component.setPreviewData(this._data.getDataView().latestData);
|
|
98251
98614
|
if (this._isHorizontal) {
|
|
98252
98615
|
isNeedPreview && this._component.setPreviewPointsY1(this._dataToPositionY2);
|
|
98253
98616
|
}
|
|
98254
98617
|
else {
|
|
98255
98618
|
isNeedPreview && this._component.setPreviewPointsX1(this._dataToPositionX2);
|
|
98256
98619
|
}
|
|
98257
|
-
this._component.setStatePointToData((state) => this.
|
|
98258
|
-
this._component.addEventListener('
|
|
98620
|
+
this._component.setStatePointToData((state) => statePointToData(state, this._stateScale, isReverse(axis, this._isHorizontal)));
|
|
98621
|
+
this._component.addEventListener('dataZoomChange', (e) => {
|
|
98259
98622
|
const { start, end, tag } = e.detail;
|
|
98260
98623
|
this._handleChange(start, end, undefined, tag);
|
|
98261
98624
|
});
|
|
98262
98625
|
container.add(this._component);
|
|
98263
|
-
this._updateScaleRange();
|
|
98264
|
-
}
|
|
98265
|
-
}
|
|
98266
|
-
}
|
|
98267
|
-
_handleChange(start, end, updateComponent, tag) {
|
|
98268
|
-
super._handleChange(start, end, updateComponent);
|
|
98269
|
-
if (this._shouldChange) {
|
|
98270
|
-
if (updateComponent && this._component) {
|
|
98271
|
-
this._component.setStartAndEnd(start, end);
|
|
98272
|
-
}
|
|
98273
|
-
this._start = start;
|
|
98274
|
-
this._end = end;
|
|
98275
|
-
const startValue = this.statePointToData(start);
|
|
98276
|
-
const endValue = this.statePointToData(end);
|
|
98277
|
-
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
98278
|
-
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
98279
|
-
: this._handleStateChange(startValue, endValue, tag);
|
|
98280
|
-
if (hasChange) {
|
|
98281
|
-
this.event.emit(exports.ChartEvent.dataZoomChange, {
|
|
98282
|
-
model: this,
|
|
98283
|
-
value: {
|
|
98284
|
-
filterData: this._filterMode !== 'axis',
|
|
98285
|
-
start,
|
|
98286
|
-
end,
|
|
98287
|
-
startValue: this._startValue,
|
|
98288
|
-
endValue: this._endValue,
|
|
98289
|
-
newDomain: this._newDomain
|
|
98290
|
-
}
|
|
98291
|
-
});
|
|
98292
|
-
}
|
|
98293
|
-
}
|
|
98294
|
-
}
|
|
98295
|
-
_handleDataCollectionChange() {
|
|
98296
|
-
var _a;
|
|
98297
|
-
const data = this._data.getDataView();
|
|
98298
|
-
data.reRunAllTransform();
|
|
98299
|
-
(_a = this._component) === null || _a === void 0 ? void 0 : _a.setPreviewData(data.latestData);
|
|
98300
|
-
if (this._valueScale) {
|
|
98301
|
-
const domain = this._computeDomainOfValueScale();
|
|
98302
|
-
if (domain) {
|
|
98303
|
-
this._valueScale.domain(domain);
|
|
98304
98626
|
}
|
|
98305
98627
|
}
|
|
98306
98628
|
}
|
|
@@ -98362,16 +98684,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98362
98684
|
_getNeedClearVRenderComponents() {
|
|
98363
98685
|
return [this._component];
|
|
98364
98686
|
}
|
|
98365
|
-
|
|
98366
|
-
|
|
98367
|
-
|
|
98368
|
-
this.
|
|
98369
|
-
|
|
98370
|
-
|
|
98687
|
+
onDataUpdate() {
|
|
98688
|
+
super.onDataUpdate();
|
|
98689
|
+
if (this._previewStateScale !== this._stateScale) {
|
|
98690
|
+
this._previewStateScale = null;
|
|
98691
|
+
}
|
|
98692
|
+
}
|
|
98693
|
+
_getPreviewStateScale() {
|
|
98694
|
+
if (!this._previewStateScale) {
|
|
98695
|
+
if (isReverse(this._relatedAxisComponent, this._isHorizontal)) {
|
|
98696
|
+
this._previewStateScale = this._stateScale.clone();
|
|
98697
|
+
this._previewStateScale.range(this._stateScale.range().reverse());
|
|
98698
|
+
}
|
|
98699
|
+
else {
|
|
98700
|
+
this._previewStateScale = this._stateScale;
|
|
98371
98701
|
}
|
|
98372
|
-
this._component = null;
|
|
98373
98702
|
}
|
|
98374
|
-
|
|
98703
|
+
return this._previewStateScale;
|
|
98375
98704
|
}
|
|
98376
98705
|
}
|
|
98377
98706
|
DataZoom.type = ComponentTypeEnum.dataZoom;
|
|
@@ -98416,24 +98745,53 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98416
98745
|
this.layoutType = 'region-relative';
|
|
98417
98746
|
this._filterMode = (_a = spec.filterMode) !== null && _a !== void 0 ? _a : 'axis';
|
|
98418
98747
|
}
|
|
98419
|
-
|
|
98420
|
-
super.
|
|
98421
|
-
|
|
98422
|
-
|
|
98423
|
-
|
|
98424
|
-
|
|
98748
|
+
_handleChange(start, end, updateComponent) {
|
|
98749
|
+
super._handleChange(start, end, updateComponent);
|
|
98750
|
+
const isSameScrollValue = isClose(this._start, start) && isClose(this._end, end);
|
|
98751
|
+
if (this._shouldChange && (!isSameScrollValue || this._spec.realTime === false)) {
|
|
98752
|
+
if (updateComponent && this._component) {
|
|
98753
|
+
this._component.setAttribute('range', [start, end]);
|
|
98754
|
+
}
|
|
98755
|
+
this._start = start;
|
|
98756
|
+
this._end = end;
|
|
98757
|
+
const startValue = statePointToData(start, this._stateScale, false);
|
|
98758
|
+
const endValue = statePointToData(end, this._stateScale, false);
|
|
98759
|
+
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
98760
|
+
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
98761
|
+
: this._handleStateChange(startValue, endValue);
|
|
98762
|
+
if (hasChange) {
|
|
98763
|
+
this.event.emit(exports.ChartEvent.scrollBarChange, {
|
|
98764
|
+
model: this,
|
|
98765
|
+
value: {
|
|
98766
|
+
filterData: this._filterMode !== 'axis',
|
|
98767
|
+
start: this._start,
|
|
98768
|
+
end: this._end,
|
|
98769
|
+
startValue: this._startValue,
|
|
98770
|
+
endValue: this._endValue,
|
|
98771
|
+
newDomain: this._newDomain
|
|
98772
|
+
}
|
|
98773
|
+
});
|
|
98774
|
+
}
|
|
98425
98775
|
}
|
|
98426
|
-
|
|
98427
|
-
|
|
98776
|
+
}
|
|
98777
|
+
_handleDataCollectionChange() {
|
|
98778
|
+
if (this._spec.auto) {
|
|
98779
|
+
const data = this._data.getDataView();
|
|
98780
|
+
data.reRunAllTransform();
|
|
98428
98781
|
}
|
|
98429
98782
|
}
|
|
98430
|
-
|
|
98783
|
+
_beforeLayoutEnd() {
|
|
98431
98784
|
var _a, _b;
|
|
98432
|
-
|
|
98785
|
+
super._beforeLayoutEnd();
|
|
98433
98786
|
(_b = (_a = this.effect).onZoomChange) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
98787
|
+
}
|
|
98788
|
+
onLayoutEnd() {
|
|
98789
|
+
this._updateComponentBounds();
|
|
98434
98790
|
super.onLayoutEnd();
|
|
98435
98791
|
}
|
|
98436
98792
|
_updateScaleRange() {
|
|
98793
|
+
}
|
|
98794
|
+
_updateComponentBounds() {
|
|
98437
98795
|
if (this._component) {
|
|
98438
98796
|
this._component.setAttributes({
|
|
98439
98797
|
x: this.getLayoutStartPoint().x,
|
|
@@ -98444,6 +98802,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98444
98802
|
}
|
|
98445
98803
|
}
|
|
98446
98804
|
_computeWidth() {
|
|
98805
|
+
if (this._visible === false) {
|
|
98806
|
+
return 0;
|
|
98807
|
+
}
|
|
98447
98808
|
if (isNumber$1(this._spec.width)) {
|
|
98448
98809
|
return this._spec.width;
|
|
98449
98810
|
}
|
|
@@ -98453,6 +98814,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98453
98814
|
return SCROLL_BAR_DEFAULT_SIZE;
|
|
98454
98815
|
}
|
|
98455
98816
|
_computeHeight() {
|
|
98817
|
+
if (this._visible === false) {
|
|
98818
|
+
return 0;
|
|
98819
|
+
}
|
|
98456
98820
|
if (isNumber$1(this._spec.height)) {
|
|
98457
98821
|
return this._spec.height;
|
|
98458
98822
|
}
|
|
@@ -98463,7 +98827,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98463
98827
|
}
|
|
98464
98828
|
_getAttrs() {
|
|
98465
98829
|
var _a, _b, _c, _d, _e, _f;
|
|
98466
|
-
return Object.assign({ zIndex: this.layoutZIndex, x: this.getLayoutStartPoint().x, y: this.getLayoutStartPoint().y, width: this.getLayoutRect().width, height: this.getLayoutRect().height, range: [this._start, this._end], direction: this._isHorizontal ? 'horizontal' : 'vertical', delayType: (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType, delayTime: isValid$1((_b = this._spec) === null || _b === void 0 ? void 0 : _b.delayType) ? (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayTime) !== null && _d !== void 0 ? _d : 30 : 0, realTime: (_f = (_e = this._spec) === null || _e === void 0 ? void 0 : _e.realTime) !== null && _f !== void 0 ? _f : true }, this._getComponentAttrs());
|
|
98830
|
+
return Object.assign({ zIndex: this.layoutZIndex, x: this.getLayoutStartPoint().x, y: this.getLayoutStartPoint().y, width: this.getLayoutRect().width, height: this.getLayoutRect().height, range: [this._start, this._end], direction: this._isHorizontal ? 'horizontal' : 'vertical', delayType: (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType, delayTime: isValid$1((_b = this._spec) === null || _b === void 0 ? void 0 : _b.delayType) ? ((_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayTime) !== null && _d !== void 0 ? _d : 30) : 0, realTime: (_f = (_e = this._spec) === null || _e === void 0 ? void 0 : _e.realTime) !== null && _f !== void 0 ? _f : true }, this._getComponentAttrs());
|
|
98467
98831
|
}
|
|
98468
98832
|
_createOrUpdateComponent() {
|
|
98469
98833
|
const attrs = this._getAttrs();
|
|
@@ -98484,41 +98848,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98484
98848
|
container.add(this._component);
|
|
98485
98849
|
}
|
|
98486
98850
|
}
|
|
98487
|
-
_handleChange(start, end, updateComponent) {
|
|
98488
|
-
super._handleChange(start, end, updateComponent);
|
|
98489
|
-
const isSameScrollValue = isClose(this._start, start) && isClose(this._end, end);
|
|
98490
|
-
if (this._shouldChange && (!isSameScrollValue || this._spec.realTime === false)) {
|
|
98491
|
-
if (updateComponent && this._component) {
|
|
98492
|
-
this._component.setAttribute('range', [start, end]);
|
|
98493
|
-
}
|
|
98494
|
-
this._start = start;
|
|
98495
|
-
this._end = end;
|
|
98496
|
-
const startValue = this.statePointToData(start);
|
|
98497
|
-
const endValue = this.statePointToData(end);
|
|
98498
|
-
const hasChange = isFunction$1(this._spec.updateDataAfterChange)
|
|
98499
|
-
? this._spec.updateDataAfterChange(start, end, startValue, endValue)
|
|
98500
|
-
: this._handleStateChange(this.statePointToData(start), this.statePointToData(end));
|
|
98501
|
-
if (hasChange) {
|
|
98502
|
-
this.event.emit(exports.ChartEvent.scrollBarChange, {
|
|
98503
|
-
model: this,
|
|
98504
|
-
value: {
|
|
98505
|
-
filterData: this._filterMode !== 'axis',
|
|
98506
|
-
start: this._start,
|
|
98507
|
-
end: this._end,
|
|
98508
|
-
startValue: this._startValue,
|
|
98509
|
-
endValue: this._endValue,
|
|
98510
|
-
newDomain: this._newDomain
|
|
98511
|
-
}
|
|
98512
|
-
});
|
|
98513
|
-
}
|
|
98514
|
-
}
|
|
98515
|
-
}
|
|
98516
|
-
_handleDataCollectionChange() {
|
|
98517
|
-
if (this._spec.auto) {
|
|
98518
|
-
const data = this._data.getDataView();
|
|
98519
|
-
data.reRunAllTransform();
|
|
98520
|
-
}
|
|
98521
|
-
}
|
|
98522
98851
|
_getComponentAttrs() {
|
|
98523
98852
|
const { rail, slider, innerPadding } = this._spec;
|
|
98524
98853
|
const attrs = {};
|
|
@@ -102654,17 +102983,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102654
102983
|
const axisRangeExpand = (_a = this._spec.axisRangeExpand) !== null && _a !== void 0 ? _a : 0;
|
|
102655
102984
|
const { x1, x2, y1, y2 } = operateMaskBounds;
|
|
102656
102985
|
const regionStartAttr = isHorizontal ? 'x' : 'y';
|
|
102986
|
+
const regionSizeAttr = isHorizontal ? 'width' : 'height';
|
|
102657
102987
|
const boundsStart = isHorizontal ? x1 : y1;
|
|
102658
102988
|
const boundsEnd = isHorizontal ? x2 : y2;
|
|
102659
102989
|
if (this._axisDataZoomMap[axis.id]) {
|
|
102660
102990
|
const dataZoom = this._axisDataZoomMap[axis.id];
|
|
102661
|
-
const
|
|
102662
|
-
const
|
|
102663
|
-
.getScale()
|
|
102664
|
-
.invert(boundsStart - region.getLayoutStartPoint()[regionStartAttr]);
|
|
102665
|
-
const endValue = releatedAxis.getScale().invert(boundsEnd - region.getLayoutStartPoint()[regionStartAttr]);
|
|
102666
|
-
const startPercent = dataZoom.dataToStatePoint(startValue);
|
|
102667
|
-
const endPercent = dataZoom.dataToStatePoint(endValue);
|
|
102991
|
+
const startPercent = (boundsStart - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
|
|
102992
|
+
const endPercent = (boundsEnd - region.getLayoutStartPoint()[regionStartAttr]) / region.getLayoutRect()[regionSizeAttr];
|
|
102668
102993
|
const newStartPercent = this._stateClamp(startPercent - axisRangeExpand);
|
|
102669
102994
|
const newEndPercent = this._stateClamp(endPercent + axisRangeExpand);
|
|
102670
102995
|
dataZoom.setStartAndEnd(Math.min(newStartPercent, newEndPercent), Math.max(newStartPercent, newEndPercent), [
|
|
@@ -102675,8 +103000,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102675
103000
|
operateComponent: dataZoom,
|
|
102676
103001
|
start: newStartPercent,
|
|
102677
103002
|
end: newEndPercent,
|
|
102678
|
-
startValue: dataZoom.
|
|
102679
|
-
endValue: dataZoom.
|
|
103003
|
+
startValue: statePointToData(newStartPercent, dataZoom.stateScale, isReverse(dataZoom.relatedAxisComponent, dataZoom.isHorizontal)),
|
|
103004
|
+
endValue: statePointToData(newEndPercent, dataZoom.stateScale, isReverse(dataZoom.relatedAxisComponent, dataZoom.isHorizontal))
|
|
102680
103005
|
});
|
|
102681
103006
|
}
|
|
102682
103007
|
else {
|