@visactor/vchart 2.0.1-alpha.2 → 2.0.1-alpha.3
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 +98 -41
- package/build/index.js +98 -41
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/index.js +2 -1
- package/cjs/animation/interface.js +1 -2
- package/cjs/component/tooltip/tooltip.js +2 -1
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/util.js +2 -1
- package/cjs/constant/attribute.js +1 -2
- package/cjs/constant/sunburst.js +2 -1
- package/cjs/constant/waterfall.js +1 -2
- 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/util.js +1 -1
- package/cjs/core/vchart.d.ts +1 -0
- package/cjs/core/vchart.js +21 -5
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +0 -2
- package/cjs/mark/base/base-mark.js +7 -5
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/group.d.ts +3 -2
- package/cjs/mark/group.js +7 -9
- package/cjs/mark/group.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +0 -1
- package/cjs/mark/interface/common.js.map +1 -1
- package/cjs/model/base-model.d.ts +4 -1
- package/cjs/model/base-model.js +6 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +3 -1
- package/cjs/model/interface.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/style.js +4 -4
- package/cjs/plugin/components/tooltip-handler/utils/style.js.map +1 -1
- package/cjs/region/region.js.map +1 -1
- package/esm/animation/index.js +2 -1
- package/esm/animation/interface.js +1 -2
- package/esm/component/tooltip/tooltip.js +2 -1
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/util.js +2 -1
- package/esm/constant/attribute.js +1 -2
- package/esm/constant/sunburst.js +2 -1
- package/esm/constant/waterfall.js +1 -2
- 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/util.js +1 -1
- package/esm/core/vchart.d.ts +1 -0
- package/esm/core/vchart.js +21 -5
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +0 -2
- package/esm/mark/base/base-mark.js +7 -5
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/group.d.ts +3 -2
- package/esm/mark/group.js +7 -9
- package/esm/mark/group.js.map +1 -1
- package/esm/mark/interface/common.d.ts +0 -1
- package/esm/mark/interface/common.js.map +1 -1
- package/esm/model/base-model.d.ts +4 -1
- package/esm/model/base-model.js +6 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +3 -1
- package/esm/model/interface.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/style.js +5 -4
- package/esm/plugin/components/tooltip-handler/utils/style.js.map +1 -1
- package/esm/region/region.js.map +1 -1
- package/package.json +8 -8
- package/cjs/animation/animate-manager.d.ts +0 -1
- package/cjs/animation/animate-manager.js +0 -2
- package/cjs/animation/animate-manager.js.map +0 -1
- package/esm/animation/animate-manager.d.ts +0 -1
- package/esm/animation/animate-manager.js +0 -2
- package/esm/animation/animate-manager.js.map +0 -1
package/build/index.es.js
CHANGED
|
@@ -14733,7 +14733,7 @@ let Group$1 = class Group extends Graphic {
|
|
|
14733
14733
|
}
|
|
14734
14734
|
removeChild(child) {
|
|
14735
14735
|
const data = super.removeChild(child);
|
|
14736
|
-
return
|
|
14736
|
+
return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
|
|
14737
14737
|
}
|
|
14738
14738
|
removeAllChild(deep = !1) {
|
|
14739
14739
|
this.forEachChildren(child => {
|
|
@@ -22115,7 +22115,7 @@ class Stage extends Group$1 {
|
|
|
22115
22115
|
return this._cursor;
|
|
22116
22116
|
}
|
|
22117
22117
|
eventPointTransform(e) {
|
|
22118
|
-
const point = this.global.mapToCanvasPoint(e, this.window
|
|
22118
|
+
const point = this.global.mapToCanvasPoint(e, this.window);
|
|
22119
22119
|
return this.stage.window.pointTransform(point.x, point.y);
|
|
22120
22120
|
}
|
|
22121
22121
|
pauseTriggerEvent() {
|
|
@@ -32639,6 +32639,11 @@ class AnimationStateManager {
|
|
|
32639
32639
|
state.executor.stop();
|
|
32640
32640
|
}), this.stateList = null;
|
|
32641
32641
|
}
|
|
32642
|
+
reApplyState(state) {
|
|
32643
|
+
var _a;
|
|
32644
|
+
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
32645
|
+
stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
|
|
32646
|
+
}
|
|
32642
32647
|
}
|
|
32643
32648
|
|
|
32644
32649
|
class GraphicStateExtension {
|
|
@@ -32669,12 +32674,19 @@ class GraphicStateExtension {
|
|
|
32669
32674
|
applyUnhighlightState(animationConfig, callback) {
|
|
32670
32675
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
32671
32676
|
}
|
|
32672
|
-
stopAnimationState(state, type) {
|
|
32673
|
-
return this._getAnimationStateManager(this).stopState(state, type), this
|
|
32677
|
+
stopAnimationState(state, type, deep = !1) {
|
|
32678
|
+
return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
|
|
32679
|
+
child.stopAnimationState(state, type, deep);
|
|
32680
|
+
}), this;
|
|
32674
32681
|
}
|
|
32675
32682
|
clearAnimationStates() {
|
|
32676
32683
|
return this._getAnimationStateManager(this).clearState(), this;
|
|
32677
32684
|
}
|
|
32685
|
+
reApplyAnimationState(state, deep = !1) {
|
|
32686
|
+
return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
32687
|
+
child.reApplyAnimationState(state, deep);
|
|
32688
|
+
}), this;
|
|
32689
|
+
}
|
|
32678
32690
|
static extend(graphic) {
|
|
32679
32691
|
return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
|
|
32680
32692
|
}
|
|
@@ -32726,6 +32738,21 @@ class AnimateExtension {
|
|
|
32726
32738
|
getGraphicAttribute(key, prev = !1) {
|
|
32727
32739
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
32728
32740
|
}
|
|
32741
|
+
pauseAnimation(deep = !1) {
|
|
32742
|
+
this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32743
|
+
child.pauseAnimation(deep);
|
|
32744
|
+
});
|
|
32745
|
+
}
|
|
32746
|
+
resumeAnimation(deep = !1) {
|
|
32747
|
+
this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32748
|
+
child.resumeAnimation(deep);
|
|
32749
|
+
});
|
|
32750
|
+
}
|
|
32751
|
+
stopAnimation(deep = !1) {
|
|
32752
|
+
this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32753
|
+
child.stopAnimation(deep);
|
|
32754
|
+
});
|
|
32755
|
+
}
|
|
32729
32756
|
}
|
|
32730
32757
|
|
|
32731
32758
|
function registerAnimate$1() {
|
|
@@ -33806,7 +33833,7 @@ class GrowCenterIn extends ACustomAnimate {
|
|
|
33806
33833
|
super(from, to, duration, easing, params);
|
|
33807
33834
|
}
|
|
33808
33835
|
onBind() {
|
|
33809
|
-
var _a, _b;
|
|
33836
|
+
var _a, _b, _c;
|
|
33810
33837
|
super.onBind();
|
|
33811
33838
|
const {
|
|
33812
33839
|
from: from,
|
|
@@ -33815,7 +33842,7 @@ class GrowCenterIn extends ACustomAnimate {
|
|
|
33815
33842
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33816
33843
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33817
33844
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33818
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33845
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33819
33846
|
}
|
|
33820
33847
|
onEnd(cb) {
|
|
33821
33848
|
super.onEnd(cb);
|
|
@@ -33913,7 +33940,7 @@ class GrowHeightIn extends ACustomAnimate {
|
|
|
33913
33940
|
super(from, to, duration, easing, params);
|
|
33914
33941
|
}
|
|
33915
33942
|
onBind() {
|
|
33916
|
-
var _a, _b;
|
|
33943
|
+
var _a, _b, _c;
|
|
33917
33944
|
super.onBind();
|
|
33918
33945
|
const {
|
|
33919
33946
|
from: from,
|
|
@@ -33922,7 +33949,7 @@ class GrowHeightIn extends ACustomAnimate {
|
|
|
33922
33949
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33923
33950
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33924
33951
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33925
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33952
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33926
33953
|
}
|
|
33927
33954
|
onEnd(cb) {
|
|
33928
33955
|
super.onEnd(cb);
|
|
@@ -38779,7 +38806,8 @@ class LabelUpdate extends AComponentAnimate {
|
|
|
38779
38806
|
prevText: prevText,
|
|
38780
38807
|
curText: curText,
|
|
38781
38808
|
prevLabelLine: prevLabelLine,
|
|
38782
|
-
curLabelLine: curLabelLine
|
|
38809
|
+
curLabelLine: curLabelLine,
|
|
38810
|
+
increaseEffect = !0
|
|
38783
38811
|
} = this.params,
|
|
38784
38812
|
diff = {};
|
|
38785
38813
|
for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
|
|
@@ -38789,7 +38817,7 @@ class LabelUpdate extends AComponentAnimate {
|
|
|
38789
38817
|
to: rest,
|
|
38790
38818
|
duration: duration,
|
|
38791
38819
|
easing: easing
|
|
38792
|
-
}), animator.animate(prevText, {
|
|
38820
|
+
}), !1 !== increaseEffect && animator.animate(prevText, {
|
|
38793
38821
|
type: "increaseCount",
|
|
38794
38822
|
to: {
|
|
38795
38823
|
text: curText.attribute.text
|
|
@@ -39483,16 +39511,15 @@ class LabelBase extends AnimateComponent {
|
|
|
39483
39511
|
} = currentLabel;
|
|
39484
39512
|
prevText.applyAnimationState(["update"], [{
|
|
39485
39513
|
name: "update",
|
|
39486
|
-
animation:
|
|
39487
|
-
type: "labelUpdate"
|
|
39488
|
-
|
|
39489
|
-
customParameters: {
|
|
39514
|
+
animation: {
|
|
39515
|
+
type: "labelUpdate",
|
|
39516
|
+
customParameters: Object.assign(Object.assign({}, this._animationConfig.update), {
|
|
39490
39517
|
prevText: prevText,
|
|
39491
39518
|
curText: curText,
|
|
39492
39519
|
prevLabelLine: prevLabelLine,
|
|
39493
39520
|
curLabelLine: curLabelLine
|
|
39494
|
-
}
|
|
39495
|
-
}
|
|
39521
|
+
})
|
|
39522
|
+
}
|
|
39496
39523
|
}]);
|
|
39497
39524
|
}
|
|
39498
39525
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -51224,6 +51251,12 @@ class BaseModel extends CompilableBase {
|
|
|
51224
51251
|
}
|
|
51225
51252
|
return index;
|
|
51226
51253
|
}
|
|
51254
|
+
updateAnimateStateCallback(callback) {
|
|
51255
|
+
this._aniamtionStateCallback = callback;
|
|
51256
|
+
}
|
|
51257
|
+
getAnimationStateCallback() {
|
|
51258
|
+
return this._aniamtionStateCallback;
|
|
51259
|
+
}
|
|
51227
51260
|
}
|
|
51228
51261
|
|
|
51229
51262
|
class LayoutItem {
|
|
@@ -53841,7 +53874,6 @@ class BaseMark extends GrammarItem {
|
|
|
53841
53874
|
this._dataByKey = mark._dataByKey;
|
|
53842
53875
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53843
53876
|
this.needClear = mark.needClear;
|
|
53844
|
-
this._aniamtionStateCallback = mark._aniamtionStateCallback;
|
|
53845
53877
|
}
|
|
53846
53878
|
_parseProgressiveContext(data) {
|
|
53847
53879
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -53989,7 +54021,20 @@ class BaseMark extends GrammarItem {
|
|
|
53989
54021
|
}
|
|
53990
54022
|
}
|
|
53991
54023
|
_setAnimationState(g) {
|
|
53992
|
-
|
|
54024
|
+
var _a, _b, _c;
|
|
54025
|
+
const callback = (this.type === "component"
|
|
54026
|
+
? this.model.getAnimationStateCallback()
|
|
54027
|
+
: (_c = (_b = (_a = this.model).getRegion) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getAnimationStateCallback()) ||
|
|
54028
|
+
((g) => {
|
|
54029
|
+
var _a;
|
|
54030
|
+
const diffState = (_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState;
|
|
54031
|
+
return diffState === AnimationStateEnum.exit
|
|
54032
|
+
? AnimationStateEnum.exit
|
|
54033
|
+
: diffState === AnimationStateEnum.update
|
|
54034
|
+
? AnimationStateEnum.update
|
|
54035
|
+
: AnimationStateEnum.appear;
|
|
54036
|
+
});
|
|
54037
|
+
const customizedState = callback(g);
|
|
53993
54038
|
g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
|
|
53994
54039
|
if (g.context.animationState === DiffState.exit) {
|
|
53995
54040
|
g.context.reusing = true;
|
|
@@ -54492,9 +54537,6 @@ class BaseMark extends GrammarItem {
|
|
|
54492
54537
|
this._runProgressiveStep();
|
|
54493
54538
|
}
|
|
54494
54539
|
}
|
|
54495
|
-
updateAnimationState(callback) {
|
|
54496
|
-
this._aniamtionStateCallback = callback;
|
|
54497
|
-
}
|
|
54498
54540
|
hasAnimationByState(state) {
|
|
54499
54541
|
if (!state || !this._animationConfig || !this._animationConfig[state]) {
|
|
54500
54542
|
return false;
|
|
@@ -54542,6 +54584,7 @@ class GroupMark extends BaseMark {
|
|
|
54542
54584
|
super(...arguments);
|
|
54543
54585
|
this.type = GroupMark.type;
|
|
54544
54586
|
this._marks = [];
|
|
54587
|
+
this._diffState = DiffState.enter;
|
|
54545
54588
|
}
|
|
54546
54589
|
getMarks() {
|
|
54547
54590
|
return this._marks;
|
|
@@ -54599,13 +54642,12 @@ class GroupMark extends BaseMark {
|
|
|
54599
54642
|
return [this._product];
|
|
54600
54643
|
}
|
|
54601
54644
|
renderInner() {
|
|
54602
|
-
var _a
|
|
54645
|
+
var _a;
|
|
54603
54646
|
if (!this._product) {
|
|
54604
54647
|
return;
|
|
54605
54648
|
}
|
|
54606
54649
|
const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
|
|
54607
|
-
|
|
54608
|
-
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: prevState ? DiffState.update : DiffState.enter });
|
|
54650
|
+
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: this._diffState });
|
|
54609
54651
|
this._setAnimationState(this._product);
|
|
54610
54652
|
const newAttrs = this._getAttrsFromConfig(style);
|
|
54611
54653
|
if (this._product.context.diffState === DiffState.update) {
|
|
@@ -54624,6 +54666,9 @@ class GroupMark extends BaseMark {
|
|
|
54624
54666
|
}
|
|
54625
54667
|
this.needClear = true;
|
|
54626
54668
|
}
|
|
54669
|
+
clearExitGraphics() {
|
|
54670
|
+
this._diffState = DiffState.update;
|
|
54671
|
+
}
|
|
54627
54672
|
render() {
|
|
54628
54673
|
if (this._isCommited) {
|
|
54629
54674
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
@@ -54634,12 +54679,6 @@ class GroupMark extends BaseMark {
|
|
|
54634
54679
|
mark.render();
|
|
54635
54680
|
});
|
|
54636
54681
|
}
|
|
54637
|
-
updateAnimationState(callback) {
|
|
54638
|
-
super.updateAnimationState(callback);
|
|
54639
|
-
this.getMarks().forEach(mark => {
|
|
54640
|
-
mark.updateAnimationState(callback);
|
|
54641
|
-
});
|
|
54642
|
-
}
|
|
54643
54682
|
release() {
|
|
54644
54683
|
super.release();
|
|
54645
54684
|
this.removeProduct();
|
|
@@ -55925,6 +55964,7 @@ class VChart {
|
|
|
55925
55964
|
});
|
|
55926
55965
|
}
|
|
55927
55966
|
_updateAnimateState(initial) {
|
|
55967
|
+
var _a, _b;
|
|
55928
55968
|
if (this._option.animation) {
|
|
55929
55969
|
const updateGraphicAnimationState = (graphic) => {
|
|
55930
55970
|
var _a;
|
|
@@ -55934,8 +55974,11 @@ class VChart {
|
|
|
55934
55974
|
}
|
|
55935
55975
|
return diffState;
|
|
55936
55976
|
};
|
|
55937
|
-
this.
|
|
55938
|
-
|
|
55977
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.getAllRegions().forEach(region => {
|
|
55978
|
+
region.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55979
|
+
});
|
|
55980
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.getAllComponents().forEach(component => {
|
|
55981
|
+
component.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55939
55982
|
});
|
|
55940
55983
|
}
|
|
55941
55984
|
}
|
|
@@ -56558,10 +56601,20 @@ class VChart {
|
|
|
56558
56601
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
56559
56602
|
}
|
|
56560
56603
|
stopAnimation() {
|
|
56604
|
+
var _a;
|
|
56605
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
|
|
56606
|
+
}
|
|
56607
|
+
reRunNormalAnimation() {
|
|
56608
|
+
var _a;
|
|
56609
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.reApplyAnimationState('normal', true);
|
|
56561
56610
|
}
|
|
56562
56611
|
pauseAnimation() {
|
|
56612
|
+
var _a;
|
|
56613
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.pauseAnimation(true);
|
|
56563
56614
|
}
|
|
56564
56615
|
resumeAnimation() {
|
|
56616
|
+
var _a;
|
|
56617
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.resumeAnimation(true);
|
|
56565
56618
|
}
|
|
56566
56619
|
convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
|
|
56567
56620
|
var _a;
|
|
@@ -56845,7 +56898,7 @@ const lookup = (data, opt) => {
|
|
|
56845
56898
|
});
|
|
56846
56899
|
};
|
|
56847
56900
|
|
|
56848
|
-
const version = "2.0.1-alpha.
|
|
56901
|
+
const version = "2.0.1-alpha.3";
|
|
56849
56902
|
|
|
56850
56903
|
const addVChartProperty = (data, op) => {
|
|
56851
56904
|
const context = op.beforeCall();
|
|
@@ -89937,7 +89990,10 @@ class Tooltip extends BaseComponent {
|
|
|
89937
89990
|
const activeType = this._spec.activeType;
|
|
89938
89991
|
this.processor = {};
|
|
89939
89992
|
activeType.forEach(type => {
|
|
89940
|
-
|
|
89993
|
+
const instance = Factory.createTooltipProcessor(type, this);
|
|
89994
|
+
if (instance) {
|
|
89995
|
+
this.processor[type] = instance;
|
|
89996
|
+
}
|
|
89941
89997
|
});
|
|
89942
89998
|
}
|
|
89943
89999
|
_initEvent() {
|
|
@@ -97790,14 +97846,15 @@ const getDomStyle = (spec = {}) => {
|
|
|
97790
97846
|
const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';
|
|
97791
97847
|
if (align === 'right') {
|
|
97792
97848
|
panelStyle.direction = 'rtl';
|
|
97793
|
-
titleStyle.textAlign = 'right';
|
|
97794
|
-
keyStyle.textAlign = 'right';
|
|
97795
|
-
valueStyle.textAlign = 'left';
|
|
97796
97849
|
}
|
|
97797
|
-
|
|
97798
|
-
titleStyle.textAlign = 'left';
|
|
97799
|
-
|
|
97800
|
-
|
|
97850
|
+
if (isNil$1(titleStyle.textAlign)) {
|
|
97851
|
+
titleStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97852
|
+
}
|
|
97853
|
+
if (isNil$1(keyStyle.textAlign)) {
|
|
97854
|
+
keyStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97855
|
+
}
|
|
97856
|
+
if (isNil$1(valueStyle.textAlign)) {
|
|
97857
|
+
valueStyle.textAlign = align === 'right' ? 'left' : 'right';
|
|
97801
97858
|
}
|
|
97802
97859
|
shapeStyle[marginKey] = getPixelPropertyStr((_b = shape.spacing) !== null && _b !== void 0 ? _b : DEFAULT_SHAPE_SPACING);
|
|
97803
97860
|
keyStyle[marginKey] = getPixelPropertyStr((_c = keyLabel.spacing) !== null && _c !== void 0 ? _c : DEFAULT_KEY_SPACING);
|
package/build/index.js
CHANGED
|
@@ -14739,7 +14739,7 @@
|
|
|
14739
14739
|
}
|
|
14740
14740
|
removeChild(child) {
|
|
14741
14741
|
const data = super.removeChild(child);
|
|
14742
|
-
return
|
|
14742
|
+
return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
|
|
14743
14743
|
}
|
|
14744
14744
|
removeAllChild(deep = !1) {
|
|
14745
14745
|
this.forEachChildren(child => {
|
|
@@ -22121,7 +22121,7 @@
|
|
|
22121
22121
|
return this._cursor;
|
|
22122
22122
|
}
|
|
22123
22123
|
eventPointTransform(e) {
|
|
22124
|
-
const point = this.global.mapToCanvasPoint(e, this.window
|
|
22124
|
+
const point = this.global.mapToCanvasPoint(e, this.window);
|
|
22125
22125
|
return this.stage.window.pointTransform(point.x, point.y);
|
|
22126
22126
|
}
|
|
22127
22127
|
pauseTriggerEvent() {
|
|
@@ -32645,6 +32645,11 @@
|
|
|
32645
32645
|
state.executor.stop();
|
|
32646
32646
|
}), this.stateList = null;
|
|
32647
32647
|
}
|
|
32648
|
+
reApplyState(state) {
|
|
32649
|
+
var _a;
|
|
32650
|
+
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
32651
|
+
stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
|
|
32652
|
+
}
|
|
32648
32653
|
}
|
|
32649
32654
|
|
|
32650
32655
|
class GraphicStateExtension {
|
|
@@ -32675,12 +32680,19 @@
|
|
|
32675
32680
|
applyUnhighlightState(animationConfig, callback) {
|
|
32676
32681
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
32677
32682
|
}
|
|
32678
|
-
stopAnimationState(state, type) {
|
|
32679
|
-
return this._getAnimationStateManager(this).stopState(state, type), this
|
|
32683
|
+
stopAnimationState(state, type, deep = !1) {
|
|
32684
|
+
return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
|
|
32685
|
+
child.stopAnimationState(state, type, deep);
|
|
32686
|
+
}), this;
|
|
32680
32687
|
}
|
|
32681
32688
|
clearAnimationStates() {
|
|
32682
32689
|
return this._getAnimationStateManager(this).clearState(), this;
|
|
32683
32690
|
}
|
|
32691
|
+
reApplyAnimationState(state, deep = !1) {
|
|
32692
|
+
return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
32693
|
+
child.reApplyAnimationState(state, deep);
|
|
32694
|
+
}), this;
|
|
32695
|
+
}
|
|
32684
32696
|
static extend(graphic) {
|
|
32685
32697
|
return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
|
|
32686
32698
|
}
|
|
@@ -32732,6 +32744,21 @@
|
|
|
32732
32744
|
getGraphicAttribute(key, prev = !1) {
|
|
32733
32745
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
32734
32746
|
}
|
|
32747
|
+
pauseAnimation(deep = !1) {
|
|
32748
|
+
this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32749
|
+
child.pauseAnimation(deep);
|
|
32750
|
+
});
|
|
32751
|
+
}
|
|
32752
|
+
resumeAnimation(deep = !1) {
|
|
32753
|
+
this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32754
|
+
child.resumeAnimation(deep);
|
|
32755
|
+
});
|
|
32756
|
+
}
|
|
32757
|
+
stopAnimation(deep = !1) {
|
|
32758
|
+
this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
|
|
32759
|
+
child.stopAnimation(deep);
|
|
32760
|
+
});
|
|
32761
|
+
}
|
|
32735
32762
|
}
|
|
32736
32763
|
|
|
32737
32764
|
function registerAnimate$1() {
|
|
@@ -33812,7 +33839,7 @@
|
|
|
33812
33839
|
super(from, to, duration, easing, params);
|
|
33813
33840
|
}
|
|
33814
33841
|
onBind() {
|
|
33815
|
-
var _a, _b;
|
|
33842
|
+
var _a, _b, _c;
|
|
33816
33843
|
super.onBind();
|
|
33817
33844
|
const {
|
|
33818
33845
|
from: from,
|
|
@@ -33821,7 +33848,7 @@
|
|
|
33821
33848
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33822
33849
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33823
33850
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33824
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33851
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33825
33852
|
}
|
|
33826
33853
|
onEnd(cb) {
|
|
33827
33854
|
super.onEnd(cb);
|
|
@@ -33919,7 +33946,7 @@
|
|
|
33919
33946
|
super(from, to, duration, easing, params);
|
|
33920
33947
|
}
|
|
33921
33948
|
onBind() {
|
|
33922
|
-
var _a, _b;
|
|
33949
|
+
var _a, _b, _c;
|
|
33923
33950
|
super.onBind();
|
|
33924
33951
|
const {
|
|
33925
33952
|
from: from,
|
|
@@ -33928,7 +33955,7 @@
|
|
|
33928
33955
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33929
33956
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33930
33957
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33931
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33958
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33932
33959
|
}
|
|
33933
33960
|
onEnd(cb) {
|
|
33934
33961
|
super.onEnd(cb);
|
|
@@ -38785,7 +38812,8 @@
|
|
|
38785
38812
|
prevText: prevText,
|
|
38786
38813
|
curText: curText,
|
|
38787
38814
|
prevLabelLine: prevLabelLine,
|
|
38788
|
-
curLabelLine: curLabelLine
|
|
38815
|
+
curLabelLine: curLabelLine,
|
|
38816
|
+
increaseEffect = !0
|
|
38789
38817
|
} = this.params,
|
|
38790
38818
|
diff = {};
|
|
38791
38819
|
for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
|
|
@@ -38795,7 +38823,7 @@
|
|
|
38795
38823
|
to: rest,
|
|
38796
38824
|
duration: duration,
|
|
38797
38825
|
easing: easing
|
|
38798
|
-
}), animator.animate(prevText, {
|
|
38826
|
+
}), !1 !== increaseEffect && animator.animate(prevText, {
|
|
38799
38827
|
type: "increaseCount",
|
|
38800
38828
|
to: {
|
|
38801
38829
|
text: curText.attribute.text
|
|
@@ -39489,16 +39517,15 @@
|
|
|
39489
39517
|
} = currentLabel;
|
|
39490
39518
|
prevText.applyAnimationState(["update"], [{
|
|
39491
39519
|
name: "update",
|
|
39492
|
-
animation:
|
|
39493
|
-
type: "labelUpdate"
|
|
39494
|
-
|
|
39495
|
-
customParameters: {
|
|
39520
|
+
animation: {
|
|
39521
|
+
type: "labelUpdate",
|
|
39522
|
+
customParameters: Object.assign(Object.assign({}, this._animationConfig.update), {
|
|
39496
39523
|
prevText: prevText,
|
|
39497
39524
|
curText: curText,
|
|
39498
39525
|
prevLabelLine: prevLabelLine,
|
|
39499
39526
|
curLabelLine: curLabelLine
|
|
39500
|
-
}
|
|
39501
|
-
}
|
|
39527
|
+
})
|
|
39528
|
+
}
|
|
39502
39529
|
}]);
|
|
39503
39530
|
}
|
|
39504
39531
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -51230,6 +51257,12 @@
|
|
|
51230
51257
|
}
|
|
51231
51258
|
return index;
|
|
51232
51259
|
}
|
|
51260
|
+
updateAnimateStateCallback(callback) {
|
|
51261
|
+
this._aniamtionStateCallback = callback;
|
|
51262
|
+
}
|
|
51263
|
+
getAnimationStateCallback() {
|
|
51264
|
+
return this._aniamtionStateCallback;
|
|
51265
|
+
}
|
|
51233
51266
|
}
|
|
51234
51267
|
|
|
51235
51268
|
class LayoutItem {
|
|
@@ -53847,7 +53880,6 @@
|
|
|
53847
53880
|
this._dataByKey = mark._dataByKey;
|
|
53848
53881
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53849
53882
|
this.needClear = mark.needClear;
|
|
53850
|
-
this._aniamtionStateCallback = mark._aniamtionStateCallback;
|
|
53851
53883
|
}
|
|
53852
53884
|
_parseProgressiveContext(data) {
|
|
53853
53885
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -53995,7 +54027,20 @@
|
|
|
53995
54027
|
}
|
|
53996
54028
|
}
|
|
53997
54029
|
_setAnimationState(g) {
|
|
53998
|
-
|
|
54030
|
+
var _a, _b, _c;
|
|
54031
|
+
const callback = (this.type === "component"
|
|
54032
|
+
? this.model.getAnimationStateCallback()
|
|
54033
|
+
: (_c = (_b = (_a = this.model).getRegion) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getAnimationStateCallback()) ||
|
|
54034
|
+
((g) => {
|
|
54035
|
+
var _a;
|
|
54036
|
+
const diffState = (_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState;
|
|
54037
|
+
return diffState === AnimationStateEnum.exit
|
|
54038
|
+
? AnimationStateEnum.exit
|
|
54039
|
+
: diffState === AnimationStateEnum.update
|
|
54040
|
+
? AnimationStateEnum.update
|
|
54041
|
+
: AnimationStateEnum.appear;
|
|
54042
|
+
});
|
|
54043
|
+
const customizedState = callback(g);
|
|
53999
54044
|
g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
|
|
54000
54045
|
if (g.context.animationState === DiffState.exit) {
|
|
54001
54046
|
g.context.reusing = true;
|
|
@@ -54498,9 +54543,6 @@
|
|
|
54498
54543
|
this._runProgressiveStep();
|
|
54499
54544
|
}
|
|
54500
54545
|
}
|
|
54501
|
-
updateAnimationState(callback) {
|
|
54502
|
-
this._aniamtionStateCallback = callback;
|
|
54503
|
-
}
|
|
54504
54546
|
hasAnimationByState(state) {
|
|
54505
54547
|
if (!state || !this._animationConfig || !this._animationConfig[state]) {
|
|
54506
54548
|
return false;
|
|
@@ -54548,6 +54590,7 @@
|
|
|
54548
54590
|
super(...arguments);
|
|
54549
54591
|
this.type = GroupMark.type;
|
|
54550
54592
|
this._marks = [];
|
|
54593
|
+
this._diffState = DiffState.enter;
|
|
54551
54594
|
}
|
|
54552
54595
|
getMarks() {
|
|
54553
54596
|
return this._marks;
|
|
@@ -54605,13 +54648,12 @@
|
|
|
54605
54648
|
return [this._product];
|
|
54606
54649
|
}
|
|
54607
54650
|
renderInner() {
|
|
54608
|
-
var _a
|
|
54651
|
+
var _a;
|
|
54609
54652
|
if (!this._product) {
|
|
54610
54653
|
return;
|
|
54611
54654
|
}
|
|
54612
54655
|
const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
|
|
54613
|
-
|
|
54614
|
-
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: prevState ? DiffState.update : DiffState.enter });
|
|
54656
|
+
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: this._diffState });
|
|
54615
54657
|
this._setAnimationState(this._product);
|
|
54616
54658
|
const newAttrs = this._getAttrsFromConfig(style);
|
|
54617
54659
|
if (this._product.context.diffState === DiffState.update) {
|
|
@@ -54630,6 +54672,9 @@
|
|
|
54630
54672
|
}
|
|
54631
54673
|
this.needClear = true;
|
|
54632
54674
|
}
|
|
54675
|
+
clearExitGraphics() {
|
|
54676
|
+
this._diffState = DiffState.update;
|
|
54677
|
+
}
|
|
54633
54678
|
render() {
|
|
54634
54679
|
if (this._isCommited) {
|
|
54635
54680
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
@@ -54640,12 +54685,6 @@
|
|
|
54640
54685
|
mark.render();
|
|
54641
54686
|
});
|
|
54642
54687
|
}
|
|
54643
|
-
updateAnimationState(callback) {
|
|
54644
|
-
super.updateAnimationState(callback);
|
|
54645
|
-
this.getMarks().forEach(mark => {
|
|
54646
|
-
mark.updateAnimationState(callback);
|
|
54647
|
-
});
|
|
54648
|
-
}
|
|
54649
54688
|
release() {
|
|
54650
54689
|
super.release();
|
|
54651
54690
|
this.removeProduct();
|
|
@@ -55931,6 +55970,7 @@
|
|
|
55931
55970
|
});
|
|
55932
55971
|
}
|
|
55933
55972
|
_updateAnimateState(initial) {
|
|
55973
|
+
var _a, _b;
|
|
55934
55974
|
if (this._option.animation) {
|
|
55935
55975
|
const updateGraphicAnimationState = (graphic) => {
|
|
55936
55976
|
var _a;
|
|
@@ -55940,8 +55980,11 @@
|
|
|
55940
55980
|
}
|
|
55941
55981
|
return diffState;
|
|
55942
55982
|
};
|
|
55943
|
-
this.
|
|
55944
|
-
|
|
55983
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.getAllRegions().forEach(region => {
|
|
55984
|
+
region.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55985
|
+
});
|
|
55986
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.getAllComponents().forEach(component => {
|
|
55987
|
+
component.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55945
55988
|
});
|
|
55946
55989
|
}
|
|
55947
55990
|
}
|
|
@@ -56564,10 +56607,20 @@
|
|
|
56564
56607
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
56565
56608
|
}
|
|
56566
56609
|
stopAnimation() {
|
|
56610
|
+
var _a;
|
|
56611
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
|
|
56612
|
+
}
|
|
56613
|
+
reRunNormalAnimation() {
|
|
56614
|
+
var _a;
|
|
56615
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.reApplyAnimationState('normal', true);
|
|
56567
56616
|
}
|
|
56568
56617
|
pauseAnimation() {
|
|
56618
|
+
var _a;
|
|
56619
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.pauseAnimation(true);
|
|
56569
56620
|
}
|
|
56570
56621
|
resumeAnimation() {
|
|
56622
|
+
var _a;
|
|
56623
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.resumeAnimation(true);
|
|
56571
56624
|
}
|
|
56572
56625
|
convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
|
|
56573
56626
|
var _a;
|
|
@@ -56851,7 +56904,7 @@
|
|
|
56851
56904
|
});
|
|
56852
56905
|
};
|
|
56853
56906
|
|
|
56854
|
-
const version = "2.0.1-alpha.
|
|
56907
|
+
const version = "2.0.1-alpha.3";
|
|
56855
56908
|
|
|
56856
56909
|
const addVChartProperty = (data, op) => {
|
|
56857
56910
|
const context = op.beforeCall();
|
|
@@ -89943,7 +89996,10 @@
|
|
|
89943
89996
|
const activeType = this._spec.activeType;
|
|
89944
89997
|
this.processor = {};
|
|
89945
89998
|
activeType.forEach(type => {
|
|
89946
|
-
|
|
89999
|
+
const instance = Factory.createTooltipProcessor(type, this);
|
|
90000
|
+
if (instance) {
|
|
90001
|
+
this.processor[type] = instance;
|
|
90002
|
+
}
|
|
89947
90003
|
});
|
|
89948
90004
|
}
|
|
89949
90005
|
_initEvent() {
|
|
@@ -97796,14 +97852,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97796
97852
|
const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';
|
|
97797
97853
|
if (align === 'right') {
|
|
97798
97854
|
panelStyle.direction = 'rtl';
|
|
97799
|
-
titleStyle.textAlign = 'right';
|
|
97800
|
-
keyStyle.textAlign = 'right';
|
|
97801
|
-
valueStyle.textAlign = 'left';
|
|
97802
97855
|
}
|
|
97803
|
-
|
|
97804
|
-
titleStyle.textAlign = 'left';
|
|
97805
|
-
|
|
97806
|
-
|
|
97856
|
+
if (isNil$1(titleStyle.textAlign)) {
|
|
97857
|
+
titleStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97858
|
+
}
|
|
97859
|
+
if (isNil$1(keyStyle.textAlign)) {
|
|
97860
|
+
keyStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97861
|
+
}
|
|
97862
|
+
if (isNil$1(valueStyle.textAlign)) {
|
|
97863
|
+
valueStyle.textAlign = align === 'right' ? 'left' : 'right';
|
|
97807
97864
|
}
|
|
97808
97865
|
shapeStyle[marginKey] = getPixelPropertyStr((_b = shape.spacing) !== null && _b !== void 0 ? _b : DEFAULT_SHAPE_SPACING);
|
|
97809
97866
|
keyStyle[marginKey] = getPixelPropertyStr((_c = keyLabel.spacing) !== null && _c !== void 0 ? _c : DEFAULT_KEY_SPACING);
|