@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.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) {
|
|
@@ -50222,6 +50249,9 @@
|
|
|
50222
50249
|
this._container = container;
|
|
50223
50250
|
this._option = option;
|
|
50224
50251
|
}
|
|
50252
|
+
getChart() {
|
|
50253
|
+
return this._compileChart;
|
|
50254
|
+
}
|
|
50225
50255
|
getCanvas() {
|
|
50226
50256
|
var _a;
|
|
50227
50257
|
return (_a = this._stage) === null || _a === void 0 ? void 0 : _a.window.getNativeHandler().nativeCanvas;
|
|
@@ -51230,6 +51260,12 @@
|
|
|
51230
51260
|
}
|
|
51231
51261
|
return index;
|
|
51232
51262
|
}
|
|
51263
|
+
updateAnimateStateCallback(callback) {
|
|
51264
|
+
this._aniamtionStateCallback = callback;
|
|
51265
|
+
}
|
|
51266
|
+
getAnimationStateCallback() {
|
|
51267
|
+
return this._aniamtionStateCallback;
|
|
51268
|
+
}
|
|
51233
51269
|
}
|
|
51234
51270
|
|
|
51235
51271
|
class LayoutItem {
|
|
@@ -53253,26 +53289,39 @@
|
|
|
53253
53289
|
}
|
|
53254
53290
|
setAnimationConfig(config) {
|
|
53255
53291
|
const defaultPrams = this.type === 'group' ? { selfOnly: true } : {};
|
|
53292
|
+
const formatAnimationCfg = (cfg) => {
|
|
53293
|
+
var _a;
|
|
53294
|
+
const options = (_a = cfg.options) !== null && _a !== void 0 ? _a : {};
|
|
53295
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), cfg), { options: (datum, graphic, customParams) => {
|
|
53296
|
+
var _a, _b;
|
|
53297
|
+
const _options = typeof options === 'function' ? options(datum, graphic, customParams) : options;
|
|
53298
|
+
if (graphic && graphic.context && graphic.context.compiler && isValid$1(graphic.context.modelId)) {
|
|
53299
|
+
const model = (_a = graphic.context.compiler.getChart()) === null || _a === void 0 ? void 0 : _a.getModelById(graphic.context.modelId);
|
|
53300
|
+
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) });
|
|
53301
|
+
}
|
|
53302
|
+
return Object.assign({}, _options);
|
|
53303
|
+
} });
|
|
53304
|
+
};
|
|
53256
53305
|
const animationConfig = {};
|
|
53257
53306
|
Object.keys(config).forEach(key => {
|
|
53258
53307
|
const value = config[key];
|
|
53259
53308
|
if (isArray$1(value)) {
|
|
53260
|
-
animationConfig[key] = value.map(
|
|
53261
|
-
var _a;
|
|
53262
|
-
const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
|
|
53263
|
-
return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), { options: (...args) => {
|
|
53264
|
-
var _a, _b;
|
|
53265
|
-
const _options = typeof options === 'function' ? options(...args) : options;
|
|
53266
|
-
return Object.assign(Object.assign({}, _options), { layoutRect: (_b = (_a = this.model).getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(_a) });
|
|
53267
|
-
} });
|
|
53268
|
-
});
|
|
53309
|
+
animationConfig[key] = value.map(formatAnimationCfg);
|
|
53269
53310
|
}
|
|
53270
|
-
else {
|
|
53271
|
-
animationConfig[key] =
|
|
53311
|
+
else if (isValid$1(value)) {
|
|
53312
|
+
animationConfig[key] = formatAnimationCfg(value);
|
|
53272
53313
|
}
|
|
53273
53314
|
});
|
|
53274
53315
|
this._animationConfig = animationConfig;
|
|
53275
53316
|
}
|
|
53317
|
+
disableAnimationByState(state) {
|
|
53318
|
+
const states = array(state);
|
|
53319
|
+
this._disabledAnimationStates = [...new Set([...this._disabledAnimationStates, ...states])];
|
|
53320
|
+
}
|
|
53321
|
+
enableAnimationByState(state) {
|
|
53322
|
+
const states = array(state);
|
|
53323
|
+
this._disabledAnimationStates = this._disabledAnimationStates.filter(s => !states.includes(s));
|
|
53324
|
+
}
|
|
53276
53325
|
setSkipBeforeLayouted(skip) {
|
|
53277
53326
|
this._skipBeforeLayouted = skip;
|
|
53278
53327
|
}
|
|
@@ -53407,6 +53456,7 @@
|
|
|
53407
53456
|
this._visible = true;
|
|
53408
53457
|
this.stateStyle = {};
|
|
53409
53458
|
this._unCompileChannel = {};
|
|
53459
|
+
this._disabledAnimationStates = [];
|
|
53410
53460
|
this._skipBeforeLayouted = false;
|
|
53411
53461
|
this._extensionChannel = {};
|
|
53412
53462
|
this._computeExChannel = {};
|
|
@@ -53824,6 +53874,7 @@
|
|
|
53824
53874
|
}
|
|
53825
53875
|
_getCommonContext() {
|
|
53826
53876
|
return {
|
|
53877
|
+
compiler: this.getCompiler(),
|
|
53827
53878
|
markType: this.type,
|
|
53828
53879
|
markId: this.id,
|
|
53829
53880
|
modelId: this.model.id,
|
|
@@ -53847,7 +53898,6 @@
|
|
|
53847
53898
|
this._dataByKey = mark._dataByKey;
|
|
53848
53899
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53849
53900
|
this.needClear = mark.needClear;
|
|
53850
|
-
this._aniamtionStateCallback = mark._aniamtionStateCallback;
|
|
53851
53901
|
}
|
|
53852
53902
|
_parseProgressiveContext(data) {
|
|
53853
53903
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -53995,7 +54045,20 @@
|
|
|
53995
54045
|
}
|
|
53996
54046
|
}
|
|
53997
54047
|
_setAnimationState(g) {
|
|
53998
|
-
|
|
54048
|
+
var _a, _b, _c;
|
|
54049
|
+
const callback = (this.type === "component"
|
|
54050
|
+
? this.model.getAnimationStateCallback()
|
|
54051
|
+
: (_c = (_b = (_a = this.model).getRegion) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getAnimationStateCallback()) ||
|
|
54052
|
+
((g) => {
|
|
54053
|
+
var _a;
|
|
54054
|
+
const diffState = (_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState;
|
|
54055
|
+
return diffState === AnimationStateEnum.exit
|
|
54056
|
+
? AnimationStateEnum.exit
|
|
54057
|
+
: diffState === AnimationStateEnum.update
|
|
54058
|
+
? AnimationStateEnum.update
|
|
54059
|
+
: AnimationStateEnum.appear;
|
|
54060
|
+
});
|
|
54061
|
+
const customizedState = callback(g);
|
|
53999
54062
|
g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
|
|
54000
54063
|
if (g.context.animationState === DiffState.exit) {
|
|
54001
54064
|
g.context.reusing = true;
|
|
@@ -54498,11 +54561,11 @@
|
|
|
54498
54561
|
this._runProgressiveStep();
|
|
54499
54562
|
}
|
|
54500
54563
|
}
|
|
54501
|
-
updateAnimationState(callback) {
|
|
54502
|
-
this._aniamtionStateCallback = callback;
|
|
54503
|
-
}
|
|
54504
54564
|
hasAnimationByState(state) {
|
|
54505
|
-
if (!state ||
|
|
54565
|
+
if (!state ||
|
|
54566
|
+
!this._animationConfig ||
|
|
54567
|
+
!this._animationConfig[state] ||
|
|
54568
|
+
this._disabledAnimationStates.includes(state)) {
|
|
54506
54569
|
return false;
|
|
54507
54570
|
}
|
|
54508
54571
|
const stateAnimationConfig = this._animationConfig[state];
|
|
@@ -54548,6 +54611,7 @@
|
|
|
54548
54611
|
super(...arguments);
|
|
54549
54612
|
this.type = GroupMark.type;
|
|
54550
54613
|
this._marks = [];
|
|
54614
|
+
this._diffState = DiffState.enter;
|
|
54551
54615
|
}
|
|
54552
54616
|
getMarks() {
|
|
54553
54617
|
return this._marks;
|
|
@@ -54605,13 +54669,12 @@
|
|
|
54605
54669
|
return [this._product];
|
|
54606
54670
|
}
|
|
54607
54671
|
renderInner() {
|
|
54608
|
-
var _a
|
|
54672
|
+
var _a;
|
|
54609
54673
|
if (!this._product) {
|
|
54610
54674
|
return;
|
|
54611
54675
|
}
|
|
54612
54676
|
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 });
|
|
54677
|
+
this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: this._diffState });
|
|
54615
54678
|
this._setAnimationState(this._product);
|
|
54616
54679
|
const newAttrs = this._getAttrsFromConfig(style);
|
|
54617
54680
|
if (this._product.context.diffState === DiffState.update) {
|
|
@@ -54630,6 +54693,9 @@
|
|
|
54630
54693
|
}
|
|
54631
54694
|
this.needClear = true;
|
|
54632
54695
|
}
|
|
54696
|
+
clearExitGraphics() {
|
|
54697
|
+
this._diffState = DiffState.update;
|
|
54698
|
+
}
|
|
54633
54699
|
render() {
|
|
54634
54700
|
if (this._isCommited) {
|
|
54635
54701
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
@@ -54640,12 +54706,6 @@
|
|
|
54640
54706
|
mark.render();
|
|
54641
54707
|
});
|
|
54642
54708
|
}
|
|
54643
|
-
updateAnimationState(callback) {
|
|
54644
|
-
super.updateAnimationState(callback);
|
|
54645
|
-
this.getMarks().forEach(mark => {
|
|
54646
|
-
mark.updateAnimationState(callback);
|
|
54647
|
-
});
|
|
54648
|
-
}
|
|
54649
54709
|
release() {
|
|
54650
54710
|
super.release();
|
|
54651
54711
|
this.removeProduct();
|
|
@@ -55839,7 +55899,7 @@
|
|
|
55839
55899
|
return this._beforeRender(option);
|
|
55840
55900
|
}
|
|
55841
55901
|
_reCompile(updateResult, morphConfig) {
|
|
55842
|
-
var _a, _b, _c, _d, _e;
|
|
55902
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
55843
55903
|
if (updateResult.reMake) {
|
|
55844
55904
|
this._releaseData();
|
|
55845
55905
|
this._initDataSet();
|
|
@@ -55859,20 +55919,16 @@
|
|
|
55859
55919
|
if (updateResult.reMake) {
|
|
55860
55920
|
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
|
|
55861
55921
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
55862
|
-
if (updateResult.reSize) {
|
|
55863
|
-
this._doResize();
|
|
55864
|
-
}
|
|
55865
55922
|
}
|
|
55866
|
-
else {
|
|
55867
|
-
|
|
55868
|
-
|
|
55869
|
-
|
|
55870
|
-
|
|
55871
|
-
|
|
55872
|
-
|
|
55873
|
-
|
|
55874
|
-
|
|
55875
|
-
}
|
|
55923
|
+
else if (updateResult.reCompile) {
|
|
55924
|
+
(_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
|
|
55925
|
+
(_e = this._compiler) === null || _e === void 0 ? void 0 : _e.compile({ chart: this._chart, vChart: this });
|
|
55926
|
+
}
|
|
55927
|
+
if (updateResult.reSize) {
|
|
55928
|
+
const { width, height } = this.getCurrentSize();
|
|
55929
|
+
this._currentSize = { width, height };
|
|
55930
|
+
(_f = this._chart) === null || _f === void 0 ? void 0 : _f.onResize(width, height, false);
|
|
55931
|
+
(_g = this._compiler) === null || _g === void 0 ? void 0 : _g.resize(width, height, false);
|
|
55876
55932
|
}
|
|
55877
55933
|
}
|
|
55878
55934
|
_beforeRender(option = {}) {
|
|
@@ -55931,6 +55987,7 @@
|
|
|
55931
55987
|
});
|
|
55932
55988
|
}
|
|
55933
55989
|
_updateAnimateState(initial) {
|
|
55990
|
+
var _a, _b;
|
|
55934
55991
|
if (this._option.animation) {
|
|
55935
55992
|
const updateGraphicAnimationState = (graphic) => {
|
|
55936
55993
|
var _a;
|
|
@@ -55940,8 +55997,11 @@
|
|
|
55940
55997
|
}
|
|
55941
55998
|
return diffState;
|
|
55942
55999
|
};
|
|
55943
|
-
this.
|
|
55944
|
-
|
|
56000
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.getAllRegions().forEach(region => {
|
|
56001
|
+
region.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
56002
|
+
});
|
|
56003
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.getAllComponents().forEach(component => {
|
|
56004
|
+
component.updateAnimateStateCallback(updateGraphicAnimationState);
|
|
55945
56005
|
});
|
|
55946
56006
|
}
|
|
55947
56007
|
}
|
|
@@ -56564,10 +56624,20 @@
|
|
|
56564
56624
|
return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
|
|
56565
56625
|
}
|
|
56566
56626
|
stopAnimation() {
|
|
56627
|
+
var _a;
|
|
56628
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
|
|
56629
|
+
}
|
|
56630
|
+
reRunNormalAnimation() {
|
|
56631
|
+
var _a;
|
|
56632
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.reApplyAnimationState('normal', true);
|
|
56567
56633
|
}
|
|
56568
56634
|
pauseAnimation() {
|
|
56635
|
+
var _a;
|
|
56636
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.pauseAnimation(true);
|
|
56569
56637
|
}
|
|
56570
56638
|
resumeAnimation() {
|
|
56639
|
+
var _a;
|
|
56640
|
+
(_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.resumeAnimation(true);
|
|
56571
56641
|
}
|
|
56572
56642
|
convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
|
|
56573
56643
|
var _a;
|
|
@@ -56851,7 +56921,7 @@
|
|
|
56851
56921
|
});
|
|
56852
56922
|
};
|
|
56853
56923
|
|
|
56854
|
-
const version = "2.0.1-alpha.
|
|
56924
|
+
const version = "2.0.1-alpha.4";
|
|
56855
56925
|
|
|
56856
56926
|
const addVChartProperty = (data, op) => {
|
|
56857
56927
|
const context = op.beforeCall();
|
|
@@ -63059,6 +63129,24 @@
|
|
|
63059
63129
|
};
|
|
63060
63130
|
}
|
|
63061
63131
|
}
|
|
63132
|
+
_updateData() {
|
|
63133
|
+
var _a, _b, _c;
|
|
63134
|
+
const tickTransformType = this.registerTicksTransform();
|
|
63135
|
+
if (this._spec.showAllGroupLayers && this._scales.length > 1) {
|
|
63136
|
+
const layers = (_a = this._spec.layers) !== null && _a !== void 0 ? _a : [];
|
|
63137
|
+
Object.keys(this._tickDataMap).forEach(layer => {
|
|
63138
|
+
const layerConfig = layers[this._scales.length - 1 - +layer] || {};
|
|
63139
|
+
const tickData = this._tickDataMap[layer];
|
|
63140
|
+
const tickTransform = tickData === null || tickData === void 0 ? void 0 : tickData.getDataView().transformsArr.find((t) => t.type === tickTransformType);
|
|
63141
|
+
tickTransform &&
|
|
63142
|
+
(tickTransform.options = Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig));
|
|
63143
|
+
});
|
|
63144
|
+
}
|
|
63145
|
+
else {
|
|
63146
|
+
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);
|
|
63147
|
+
tickTransform && (tickTransform.options = this._tickTransformOption());
|
|
63148
|
+
}
|
|
63149
|
+
}
|
|
63062
63150
|
dataToPosition(values, cfg = {}) {
|
|
63063
63151
|
var _a, _b;
|
|
63064
63152
|
if (values.length === 0 || this._scales.length === 0) {
|
|
@@ -63151,7 +63239,7 @@
|
|
|
63151
63239
|
getLabelItems(length) {
|
|
63152
63240
|
const labelItems = [];
|
|
63153
63241
|
let preData = [];
|
|
63154
|
-
this._scales.forEach((scale, index) => {
|
|
63242
|
+
(this._spec.showAllGroupLayers ? this._scales : [this._scales[0]]).forEach((scale, index) => {
|
|
63155
63243
|
var _a;
|
|
63156
63244
|
const tickData = this._tickDataMap[index];
|
|
63157
63245
|
const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
|
|
@@ -63333,6 +63421,20 @@
|
|
|
63333
63421
|
minBandSize
|
|
63334
63422
|
};
|
|
63335
63423
|
}
|
|
63424
|
+
_compareSpec(spec, prevSpec) {
|
|
63425
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
63426
|
+
if (result.reMake) {
|
|
63427
|
+
return result;
|
|
63428
|
+
}
|
|
63429
|
+
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)) {
|
|
63430
|
+
result.reMake = true;
|
|
63431
|
+
}
|
|
63432
|
+
return result;
|
|
63433
|
+
}
|
|
63434
|
+
reInit(spec) {
|
|
63435
|
+
super.reInit();
|
|
63436
|
+
this === null || this === void 0 ? void 0 : this._updateData();
|
|
63437
|
+
}
|
|
63336
63438
|
}
|
|
63337
63439
|
CartesianBandAxis.type = ComponentTypeEnum.cartesianBandAxis;
|
|
63338
63440
|
CartesianBandAxis.specKey = 'axes';
|
|
@@ -65444,17 +65546,11 @@
|
|
|
65444
65546
|
}
|
|
65445
65547
|
_enableMarkAnimation(states) {
|
|
65446
65548
|
const marks = this.getAllMarks();
|
|
65447
|
-
marks.forEach(mark =>
|
|
65448
|
-
const product = mark.getProduct();
|
|
65449
|
-
if (product && product.animate) ;
|
|
65450
|
-
});
|
|
65549
|
+
marks.forEach(mark => mark.enableAnimationByState(states));
|
|
65451
65550
|
}
|
|
65452
65551
|
_disableMarkAnimation(states) {
|
|
65453
65552
|
const marks = this.getAllMarks();
|
|
65454
|
-
marks.forEach(mark =>
|
|
65455
|
-
const product = mark.getProduct();
|
|
65456
|
-
if (product && product.animate) ;
|
|
65457
|
-
});
|
|
65553
|
+
marks.forEach(mark => mark.disableAnimationByState(states));
|
|
65458
65554
|
}
|
|
65459
65555
|
filterGraphicsByDatum(datum, opt = {}) {
|
|
65460
65556
|
var _a;
|
|
@@ -89943,7 +90039,10 @@
|
|
|
89943
90039
|
const activeType = this._spec.activeType;
|
|
89944
90040
|
this.processor = {};
|
|
89945
90041
|
activeType.forEach(type => {
|
|
89946
|
-
|
|
90042
|
+
const instance = Factory.createTooltipProcessor(type, this);
|
|
90043
|
+
if (instance) {
|
|
90044
|
+
this.processor[type] = instance;
|
|
90045
|
+
}
|
|
89947
90046
|
});
|
|
89948
90047
|
}
|
|
89949
90048
|
_initEvent() {
|
|
@@ -97796,14 +97895,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97796
97895
|
const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';
|
|
97797
97896
|
if (align === 'right') {
|
|
97798
97897
|
panelStyle.direction = 'rtl';
|
|
97799
|
-
titleStyle.textAlign = 'right';
|
|
97800
|
-
keyStyle.textAlign = 'right';
|
|
97801
|
-
valueStyle.textAlign = 'left';
|
|
97802
97898
|
}
|
|
97803
|
-
|
|
97804
|
-
titleStyle.textAlign = 'left';
|
|
97805
|
-
|
|
97806
|
-
|
|
97899
|
+
if (isNil$1(titleStyle.textAlign)) {
|
|
97900
|
+
titleStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97901
|
+
}
|
|
97902
|
+
if (isNil$1(keyStyle.textAlign)) {
|
|
97903
|
+
keyStyle.textAlign = align === 'right' ? 'right' : 'left';
|
|
97904
|
+
}
|
|
97905
|
+
if (isNil$1(valueStyle.textAlign)) {
|
|
97906
|
+
valueStyle.textAlign = align === 'right' ? 'left' : 'right';
|
|
97807
97907
|
}
|
|
97808
97908
|
shapeStyle[marginKey] = getPixelPropertyStr((_b = shape.spacing) !== null && _b !== void 0 ? _b : DEFAULT_SHAPE_SPACING);
|
|
97809
97909
|
keyStyle[marginKey] = getPixelPropertyStr((_c = keyLabel.spacing) !== null && _c !== void 0 ? _c : DEFAULT_KEY_SPACING);
|