@visactor/vchart 2.0.1-alpha.2 → 2.0.1-alpha.4
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 +176 -76
- package/build/index.js +176 -76
- 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/chart/base/base-chart.js +2 -8
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/compile/compiler.d.ts +1 -0
- package/cjs/compile/compiler.js +3 -0
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +1 -0
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +8 -0
- package/cjs/component/axis/cartesian/band-axis.js +9 -0
- package/cjs/component/axis/cartesian/band-axis.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 +15 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- 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 +29 -9
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +4 -2
- package/cjs/mark/base/base-mark.js +38 -22
- 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 +4 -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/chart/base/base-chart.js +2 -8
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/compile/compiler.d.ts +1 -0
- package/esm/compile/compiler.js +3 -0
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +1 -0
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +8 -0
- package/esm/component/axis/cartesian/band-axis.js +9 -1
- package/esm/component/axis/cartesian/band-axis.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 +15 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- 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 +29 -9
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +4 -2
- package/esm/mark/base/base-mark.js +37 -22
- 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 +4 -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) {
|
|
@@ -50216,6 +50243,9 @@ class Compiler {
|
|
|
50216
50243
|
this._container = container;
|
|
50217
50244
|
this._option = option;
|
|
50218
50245
|
}
|
|
50246
|
+
getChart() {
|
|
50247
|
+
return this._compileChart;
|
|
50248
|
+
}
|
|
50219
50249
|
getCanvas() {
|
|
50220
50250
|
var _a;
|
|
50221
50251
|
return (_a = this._stage) === null || _a === void 0 ? void 0 : _a.window.getNativeHandler().nativeCanvas;
|
|
@@ -51224,6 +51254,12 @@ class BaseModel extends CompilableBase {
|
|
|
51224
51254
|
}
|
|
51225
51255
|
return index;
|
|
51226
51256
|
}
|
|
51257
|
+
updateAnimateStateCallback(callback) {
|
|
51258
|
+
this._aniamtionStateCallback = callback;
|
|
51259
|
+
}
|
|
51260
|
+
getAnimationStateCallback() {
|
|
51261
|
+
return this._aniamtionStateCallback;
|
|
51262
|
+
}
|
|
51227
51263
|
}
|
|
51228
51264
|
|
|
51229
51265
|
class LayoutItem {
|
|
@@ -53247,26 +53283,39 @@ class BaseMark extends GrammarItem {
|
|
|
53247
53283
|
}
|
|
53248
53284
|
setAnimationConfig(config) {
|
|
53249
53285
|
const defaultPrams = this.type === 'group' ? { selfOnly: true } : {};
|
|
53286
|
+
const formatAnimationCfg = (cfg) => {
|
|
53287
|
+
var _a;
|
|
53288
|
+
const options = (_a = cfg.options) !== null && _a !== void 0 ? _a : {};
|
|
53289
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), cfg), { options: (datum, graphic, customParams) => {
|
|
53290
|
+
var _a, _b;
|
|
53291
|
+
const _options = typeof options === 'function' ? options(datum, graphic, customParams) : options;
|
|
53292
|
+
if (graphic && graphic.context && graphic.context.compiler && isValid$1(graphic.context.modelId)) {
|
|
53293
|
+
const model = (_a = graphic.context.compiler.getChart()) === null || _a === void 0 ? void 0 : _a.getModelById(graphic.context.modelId);
|
|
53294
|
+
return Object.assign(Object.assign({}, _options), { layoutRect: (_b = model === null || model === void 0 ? void 0 : model.getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(model) });
|
|
53295
|
+
}
|
|
53296
|
+
return Object.assign({}, _options);
|
|
53297
|
+
} });
|
|
53298
|
+
};
|
|
53250
53299
|
const animationConfig = {};
|
|
53251
53300
|
Object.keys(config).forEach(key => {
|
|
53252
53301
|
const value = config[key];
|
|
53253
53302
|
if (isArray$1(value)) {
|
|
53254
|
-
animationConfig[key] = value.map(
|
|
53255
|
-
var _a;
|
|
53256
|
-
const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
|
|
53257
|
-
return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), { options: (...args) => {
|
|
53258
|
-
var _a, _b;
|
|
53259
|
-
const _options = typeof options === 'function' ? options(...args) : options;
|
|
53260
|
-
return Object.assign(Object.assign({}, _options), { layoutRect: (_b = (_a = this.model).getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(_a) });
|
|
53261
|
-
} });
|
|
53262
|
-
});
|
|
53303
|
+
animationConfig[key] = value.map(formatAnimationCfg);
|
|
53263
53304
|
}
|
|
53264
|
-
else {
|
|
53265
|
-
animationConfig[key] =
|
|
53305
|
+
else if (isValid$1(value)) {
|
|
53306
|
+
animationConfig[key] = formatAnimationCfg(value);
|
|
53266
53307
|
}
|
|
53267
53308
|
});
|
|
53268
53309
|
this._animationConfig = animationConfig;
|
|
53269
53310
|
}
|
|
53311
|
+
disableAnimationByState(state) {
|
|
53312
|
+
const states = array(state);
|
|
53313
|
+
this._disabledAnimationStates = [...new Set([...this._disabledAnimationStates, ...states])];
|
|
53314
|
+
}
|
|
53315
|
+
enableAnimationByState(state) {
|
|
53316
|
+
const states = array(state);
|
|
53317
|
+
this._disabledAnimationStates = this._disabledAnimationStates.filter(s => !states.includes(s));
|
|
53318
|
+
}
|
|
53270
53319
|
setSkipBeforeLayouted(skip) {
|
|
53271
53320
|
this._skipBeforeLayouted = skip;
|
|
53272
53321
|
}
|
|
@@ -53401,6 +53450,7 @@ class BaseMark extends GrammarItem {
|
|
|
53401
53450
|
this._visible = true;
|
|
53402
53451
|
this.stateStyle = {};
|
|
53403
53452
|
this._unCompileChannel = {};
|
|
53453
|
+
this._disabledAnimationStates = [];
|
|
53404
53454
|
this._skipBeforeLayouted = false;
|
|
53405
53455
|
this._extensionChannel = {};
|
|
53406
53456
|
this._computeExChannel = {};
|
|
@@ -53818,6 +53868,7 @@ class BaseMark extends GrammarItem {
|
|
|
53818
53868
|
}
|
|
53819
53869
|
_getCommonContext() {
|
|
53820
53870
|
return {
|
|
53871
|
+
compiler: this.getCompiler(),
|
|
53821
53872
|
markType: this.type,
|
|
53822
53873
|
markId: this.id,
|
|
53823
53874
|
modelId: this.model.id,
|
|
@@ -53841,7 +53892,6 @@ class BaseMark extends GrammarItem {
|
|
|
53841
53892
|
this._dataByKey = mark._dataByKey;
|
|
53842
53893
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53843
53894
|
this.needClear = mark.needClear;
|
|
53844
|
-
this._aniamtionStateCallback = mark._aniamtionStateCallback;
|
|
53845
53895
|
}
|
|
53846
53896
|
_parseProgressiveContext(data) {
|
|
53847
53897
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -53989,7 +54039,20 @@ class BaseMark extends GrammarItem {
|
|
|
53989
54039
|
}
|
|
53990
54040
|
}
|
|
53991
54041
|
_setAnimationState(g) {
|
|
53992
|
-
|
|
54042
|
+
var _a, _b, _c;
|
|
54043
|
+
const callback = (this.type === "component"
|
|
54044
|
+
? this.model.getAnimationStateCallback()
|
|
54045
|
+
: (_c = (_b = (_a = this.model).getRegion) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getAnimationStateCallback()) ||
|
|
54046
|
+
((g) => {
|
|
54047
|
+
var _a;
|
|
54048
|
+
const diffState = (_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState;
|
|
54049
|
+
return diffState === AnimationStateEnum.exit
|
|
54050
|
+
? AnimationStateEnum.exit
|
|
54051
|
+
: diffState === AnimationStateEnum.update
|
|
54052
|
+
? AnimationStateEnum.update
|
|
54053
|
+
: AnimationStateEnum.appear;
|
|
54054
|
+
});
|
|
54055
|
+
const customizedState = callback(g);
|
|
53993
54056
|
g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
|
|
53994
54057
|
if (g.context.animationState === DiffState.exit) {
|
|
53995
54058
|
g.context.reusing = true;
|
|
@@ -54492,11 +54555,11 @@ class BaseMark extends GrammarItem {
|
|
|
54492
54555
|
this._runProgressiveStep();
|
|
54493
54556
|
}
|
|
54494
54557
|
}
|
|
54495
|
-
updateAnimationState(callback) {
|
|
54496
|
-
this._aniamtionStateCallback = callback;
|
|
54497
|
-
}
|
|
54498
54558
|
hasAnimationByState(state) {
|
|
54499
|
-
if (!state ||
|
|
54559
|
+
if (!state ||
|
|
54560
|
+
!this._animationConfig ||
|
|
54561
|
+
!this._animationConfig[state] ||
|
|
54562
|
+
this._disabledAnimationStates.includes(state)) {
|
|
54500
54563
|
return false;
|
|
54501
54564
|
}
|
|
54502
54565
|
const stateAnimationConfig = this._animationConfig[state];
|
|
@@ -54542,6 +54605,7 @@ class GroupMark extends BaseMark {
|
|
|
54542
54605
|
super(...arguments);
|
|
54543
54606
|
this.type = GroupMark.type;
|
|
54544
54607
|
this._marks = [];
|
|
54608
|
+
this._diffState = DiffState.enter;
|
|
54545
54609
|
}
|
|
54546
54610
|
getMarks() {
|
|
54547
54611
|
return this._marks;
|
|
@@ -54599,13 +54663,12 @@ class GroupMark extends BaseMark {
|
|
|
54599
54663
|
return [this._product];
|
|
54600
54664
|
}
|
|
54601
54665
|
renderInner() {
|
|
54602
|
-
var _a
|
|
54666
|
+
var _a;
|
|
54603
54667
|
if (!this._product) {
|
|
54604
54668
|
return;
|
|
54605
54669
|
}
|
|
54606
54670
|
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 });
|
|
54671
|
+
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: this._diffState });
|
|
54609
54672
|
this._setAnimationState(this._product);
|
|
54610
54673
|
const newAttrs = this._getAttrsFromConfig(style);
|
|
54611
54674
|
if (this._product.context.diffState === DiffState.update) {
|
|
@@ -54624,6 +54687,9 @@ class GroupMark extends BaseMark {
|
|
|
54624
54687
|
}
|
|
54625
54688
|
this.needClear = true;
|
|
54626
54689
|
}
|
|
54690
|
+
clearExitGraphics() {
|
|
54691
|
+
this._diffState = DiffState.update;
|
|
54692
|
+
}
|
|
54627
54693
|
render() {
|
|
54628
54694
|
if (this._isCommited) {
|
|
54629
54695
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
@@ -54634,12 +54700,6 @@ class GroupMark extends BaseMark {
|
|
|
54634
54700
|
mark.render();
|
|
54635
54701
|
});
|
|
54636
54702
|
}
|
|
54637
|
-
updateAnimationState(callback) {
|
|
54638
|
-
super.updateAnimationState(callback);
|
|
54639
|
-
this.getMarks().forEach(mark => {
|
|
54640
|
-
mark.updateAnimationState(callback);
|
|
54641
|
-
});
|
|
54642
|
-
}
|
|
54643
54703
|
release() {
|
|
54644
54704
|
super.release();
|
|
54645
54705
|
this.removeProduct();
|
|
@@ -55833,7 +55893,7 @@ class VChart {
|
|
|
55833
55893
|
return this._beforeRender(option);
|
|
55834
55894
|
}
|
|
55835
55895
|
_reCompile(updateResult, morphConfig) {
|
|
55836
|
-
var _a, _b, _c, _d, _e;
|
|
55896
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
55837
55897
|
if (updateResult.reMake) {
|
|
55838
55898
|
this._releaseData();
|
|
55839
55899
|
this._initDataSet();
|
|
@@ -55853,20 +55913,16 @@ class VChart {
|
|
|
55853
55913
|
if (updateResult.reMake) {
|
|
55854
55914
|
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
|
|
55855
55915
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
55856
|
-
if (updateResult.reSize) {
|
|
55857
|
-
this._doResize();
|
|
55858
|
-
}
|
|
55859
55916
|
}
|
|
55860
|
-
else {
|
|
55861
|
-
|
|
55862
|
-
|
|
55863
|
-
|
|
55864
|
-
|
|
55865
|
-
|
|
55866
|
-
|
|
55867
|
-
|
|
55868
|
-
|
|
55869
|
-
}
|
|
55917
|
+
else if (updateResult.reCompile) {
|
|
55918
|
+
(_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
|
|
55919
|
+
(_e = this._compiler) === null || _e === void 0 ? void 0 : _e.compile({ chart: this._chart, vChart: this });
|
|
55920
|
+
}
|
|
55921
|
+
if (updateResult.reSize) {
|
|
55922
|
+
const { width, height } = this.getCurrentSize();
|
|
55923
|
+
this._currentSize = { width, height };
|
|
55924
|
+
(_f = this._chart) === null || _f === void 0 ? void 0 : _f.onResize(width, height, false);
|
|
55925
|
+
(_g = this._compiler) === null || _g === void 0 ? void 0 : _g.resize(width, height, false);
|
|
55870
55926
|
}
|
|
55871
55927
|
}
|
|
55872
55928
|
_beforeRender(option = {}) {
|
|
@@ -55925,6 +55981,7 @@ class VChart {
|
|
|
55925
55981
|
});
|
|
55926
55982
|
}
|
|
55927
55983
|
_updateAnimateState(initial) {
|
|
55984
|
+
var _a, _b;
|
|
55928
55985
|
if (this._option.animation) {
|
|
55929
55986
|
const updateGraphicAnimationState = (graphic) => {
|
|
55930
55987
|
var _a;
|
|
@@ -55934,8 +55991,11 @@ class VChart {
|
|
|
55934
55991
|
}
|
|
55935
55992
|
return diffState;
|
|
55936
55993
|
};
|
|
55937
|
-
this.
|
|
55938
|
-
|
|
55994
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.getAllRegions().forEach(region => {
|
|
55995
|
+
region.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55996
|
+
});
|
|
55997
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.getAllComponents().forEach(component => {
|
|
55998
|
+
component.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55939
55999
|
});
|
|
55940
56000
|
}
|
|
55941
56001
|
}
|
|
@@ -56558,10 +56618,20 @@ class VChart {
|
|
|
56558
56618
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
56559
56619
|
}
|
|
56560
56620
|
stopAnimation() {
|
|
56621
|
+
var _a;
|
|
56622
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
|
|
56623
|
+
}
|
|
56624
|
+
reRunNormalAnimation() {
|
|
56625
|
+
var _a;
|
|
56626
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.reApplyAnimationState('normal', true);
|
|
56561
56627
|
}
|
|
56562
56628
|
pauseAnimation() {
|
|
56629
|
+
var _a;
|
|
56630
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.pauseAnimation(true);
|
|
56563
56631
|
}
|
|
56564
56632
|
resumeAnimation() {
|
|
56633
|
+
var _a;
|
|
56634
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.resumeAnimation(true);
|
|
56565
56635
|
}
|
|
56566
56636
|
convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
|
|
56567
56637
|
var _a;
|
|
@@ -56845,7 +56915,7 @@ const lookup = (data, opt) => {
|
|
|
56845
56915
|
});
|
|
56846
56916
|
};
|
|
56847
56917
|
|
|
56848
|
-
const version = "2.0.1-alpha.
|
|
56918
|
+
const version = "2.0.1-alpha.4";
|
|
56849
56919
|
|
|
56850
56920
|
const addVChartProperty = (data, op) => {
|
|
56851
56921
|
const context = op.beforeCall();
|
|
@@ -63053,6 +63123,24 @@ class BandAxisMixin {
|
|
|
63053
63123
|
};
|
|
63054
63124
|
}
|
|
63055
63125
|
}
|
|
63126
|
+
_updateData() {
|
|
63127
|
+
var _a, _b, _c;
|
|
63128
|
+
const tickTransformType = this.registerTicksTransform();
|
|
63129
|
+
if (this._spec.showAllGroupLayers && this._scales.length > 1) {
|
|
63130
|
+
const layers = (_a = this._spec.layers) !== null && _a !== void 0 ? _a : [];
|
|
63131
|
+
Object.keys(this._tickDataMap).forEach(layer => {
|
|
63132
|
+
const layerConfig = layers[this._scales.length - 1 - +layer] || {};
|
|
63133
|
+
const tickData = this._tickDataMap[layer];
|
|
63134
|
+
const tickTransform = tickData === null || tickData === void 0 ? void 0 : tickData.getDataView().transformsArr.find((t) => t.type === tickTransformType);
|
|
63135
|
+
tickTransform &&
|
|
63136
|
+
(tickTransform.options = Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig));
|
|
63137
|
+
});
|
|
63138
|
+
}
|
|
63139
|
+
else {
|
|
63140
|
+
const tickTransform = (_c = (_b = this._tickData) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.getDataView().transformsArr.find(t => t.type === tickTransformType);
|
|
63141
|
+
tickTransform && (tickTransform.options = this._tickTransformOption());
|
|
63142
|
+
}
|
|
63143
|
+
}
|
|
63056
63144
|
dataToPosition(values, cfg = {}) {
|
|
63057
63145
|
var _a, _b;
|
|
63058
63146
|
if (values.length === 0 || this._scales.length === 0) {
|
|
@@ -63145,7 +63233,7 @@ class BandAxisMixin {
|
|
|
63145
63233
|
getLabelItems(length) {
|
|
63146
63234
|
const labelItems = [];
|
|
63147
63235
|
let preData = [];
|
|
63148
|
-
this._scales.forEach((scale, index) => {
|
|
63236
|
+
(this._spec.showAllGroupLayers ? this._scales : [this._scales[0]]).forEach((scale, index) => {
|
|
63149
63237
|
var _a;
|
|
63150
63238
|
const tickData = this._tickDataMap[index];
|
|
63151
63239
|
const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
|
|
@@ -63327,6 +63415,20 @@ class CartesianBandAxis extends CartesianAxis {
|
|
|
63327
63415
|
minBandSize
|
|
63328
63416
|
};
|
|
63329
63417
|
}
|
|
63418
|
+
_compareSpec(spec, prevSpec) {
|
|
63419
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
63420
|
+
if (result.reMake) {
|
|
63421
|
+
return result;
|
|
63422
|
+
}
|
|
63423
|
+
if ((prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.showAllGroupLayers) !== (spec === null || spec === void 0 ? void 0 : spec.showAllGroupLayers) || !isEqual(prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.layers, spec === null || spec === void 0 ? void 0 : spec.layers)) {
|
|
63424
|
+
result.reMake = true;
|
|
63425
|
+
}
|
|
63426
|
+
return result;
|
|
63427
|
+
}
|
|
63428
|
+
reInit(spec) {
|
|
63429
|
+
super.reInit();
|
|
63430
|
+
this === null || this === void 0 ? void 0 : this._updateData();
|
|
63431
|
+
}
|
|
63330
63432
|
}
|
|
63331
63433
|
CartesianBandAxis.type = ComponentTypeEnum.cartesianBandAxis;
|
|
63332
63434
|
CartesianBandAxis.specKey = 'axes';
|
|
@@ -65438,17 +65540,11 @@ class BaseChart extends CompilableBase {
|
|
|
65438
65540
|
}
|
|
65439
65541
|
_enableMarkAnimation(states) {
|
|
65440
65542
|
const marks = this.getAllMarks();
|
|
65441
|
-
marks.forEach(mark =>
|
|
65442
|
-
const product = mark.getProduct();
|
|
65443
|
-
if (product && product.animate) ;
|
|
65444
|
-
});
|
|
65543
|
+
marks.forEach(mark => mark.enableAnimationByState(states));
|
|
65445
65544
|
}
|
|
65446
65545
|
_disableMarkAnimation(states) {
|
|
65447
65546
|
const marks = this.getAllMarks();
|
|
65448
|
-
marks.forEach(mark =>
|
|
65449
|
-
const product = mark.getProduct();
|
|
65450
|
-
if (product && product.animate) ;
|
|
65451
|
-
});
|
|
65547
|
+
marks.forEach(mark => mark.disableAnimationByState(states));
|
|
65452
65548
|
}
|
|
65453
65549
|
filterGraphicsByDatum(datum, opt = {}) {
|
|
65454
65550
|
var _a;
|
|
@@ -89937,7 +90033,10 @@ class Tooltip extends BaseComponent {
|
|
|
89937
90033
|
const activeType = this._spec.activeType;
|
|
89938
90034
|
this.processor = {};
|
|
89939
90035
|
activeType.forEach(type => {
|
|
89940
|
-
|
|
90036
|
+
const instance = Factory.createTooltipProcessor(type, this);
|
|
90037
|
+
if (instance) {
|
|
90038
|
+
this.processor[type] = instance;
|
|
90039
|
+
}
|
|
89941
90040
|
});
|
|
89942
90041
|
}
|
|
89943
90042
|
_initEvent() {
|
|
@@ -97790,14 +97889,15 @@ const getDomStyle = (spec = {}) => {
|
|
|
97790
97889
|
const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';
|
|
97791
97890
|
if (align === 'right') {
|
|
97792
97891
|
panelStyle.direction = 'rtl';
|
|
97793
|
-
titleStyle.textAlign = 'right';
|
|
97794
|
-
keyStyle.textAlign = 'right';
|
|
97795
|
-
valueStyle.textAlign = 'left';
|
|
97796
97892
|
}
|
|
97797
|
-
|
|
97798
|
-
titleStyle.textAlign = 'left';
|
|
97799
|
-
|
|
97800
|
-
|
|
97893
|
+
if (isNil$1(titleStyle.textAlign)) {
|
|
97894
|
+
titleStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97895
|
+
}
|
|
97896
|
+
if (isNil$1(keyStyle.textAlign)) {
|
|
97897
|
+
keyStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97898
|
+
}
|
|
97899
|
+
if (isNil$1(valueStyle.textAlign)) {
|
|
97900
|
+
valueStyle.textAlign = align === 'right' ? 'left' : 'right';
|
|
97801
97901
|
}
|
|
97802
97902
|
shapeStyle[marginKey] = getPixelPropertyStr((_b = shape.spacing) !== null && _b !== void 0 ? _b : DEFAULT_SHAPE_SPACING);
|
|
97803
97903
|
keyStyle[marginKey] = getPixelPropertyStr((_c = keyLabel.spacing) !== null && _c !== void 0 ? _c : DEFAULT_KEY_SPACING);
|