@visactor/vchart 2.0.1-alpha.3 → 2.0.1-alpha.5
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 +79 -36
- package/build/index.js +79 -36
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- 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/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +8 -4
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/cjs/mark/base/base-mark.d.ts +4 -0
- package/cjs/mark/base/base-mark.js +31 -17
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +4 -0
- package/cjs/mark/interface/common.js.map +1 -1
- 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/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +8 -4
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/esm/mark/base/base-mark.d.ts +4 -0
- package/esm/mark/base/base-mark.js +30 -17
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/interface/common.d.ts +4 -0
- package/esm/mark/interface/common.js.map +1 -1
- package/package.json +4 -4
|
@@ -72,24 +72,37 @@ class BaseMark extends grammar_item_1.GrammarItem {
|
|
|
72
72
|
setAnimationConfig(config) {
|
|
73
73
|
const defaultPrams = "group" === this.type ? {
|
|
74
74
|
selfOnly: !0
|
|
75
|
-
} : {},
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const _options = "function" == typeof options ? options(...args) : options;
|
|
75
|
+
} : {}, formatAnimationCfg = cfg => {
|
|
76
|
+
var _a;
|
|
77
|
+
const options = null !== (_a = cfg.options) && void 0 !== _a ? _a : {};
|
|
78
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), cfg), {
|
|
79
|
+
options: (datum, graphic, customParams) => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
const _options = "function" == typeof options ? options(datum, graphic, customParams) : options;
|
|
82
|
+
if (graphic && graphic.context && graphic.context.compiler && (0, vutils_1.isValid)(graphic.context.modelId)) {
|
|
83
|
+
const model = null === (_a = graphic.context.compiler.getChart()) || void 0 === _a ? void 0 : _a.getModelById(graphic.context.modelId);
|
|
85
84
|
return Object.assign(Object.assign({}, _options), {
|
|
86
|
-
layoutRect: null === (_b =
|
|
85
|
+
layoutRect: null === (_b = null == model ? void 0 : model.getLayoutRect) || void 0 === _b ? void 0 : _b.call(model)
|
|
87
86
|
});
|
|
88
87
|
}
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
return Object.assign({}, _options);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}, animationConfig = {};
|
|
92
|
+
Object.keys(config).forEach((key => {
|
|
93
|
+
const value = config[key];
|
|
94
|
+
(0, vutils_1.isArray)(value) ? animationConfig[key] = value.map(formatAnimationCfg) : (0,
|
|
95
|
+
vutils_1.isValid)(value) && (animationConfig[key] = formatAnimationCfg(value));
|
|
91
96
|
})), this._animationConfig = animationConfig;
|
|
92
97
|
}
|
|
98
|
+
disableAnimationByState(state) {
|
|
99
|
+
const states = (0, vutils_1.array)(state);
|
|
100
|
+
this._disabledAnimationStates = [ ...new Set([ ...this._disabledAnimationStates, ...states ]) ];
|
|
101
|
+
}
|
|
102
|
+
enableAnimationByState(state) {
|
|
103
|
+
const states = (0, vutils_1.array)(state);
|
|
104
|
+
this._disabledAnimationStates = this._disabledAnimationStates.filter((s => !states.includes(s)));
|
|
105
|
+
}
|
|
93
106
|
setSkipBeforeLayouted(skip) {
|
|
94
107
|
this._skipBeforeLayouted = skip;
|
|
95
108
|
}
|
|
@@ -175,9 +188,9 @@ class BaseMark extends grammar_item_1.GrammarItem {
|
|
|
175
188
|
super(option), this.type = void 0, this.name = "mark", this._markConfig = {
|
|
176
189
|
zIndex: layout_1.LayoutZIndex.Mark,
|
|
177
190
|
morph: !1
|
|
178
|
-
}, this._visible = !0, this.stateStyle = {}, this._unCompileChannel = {}, this.
|
|
179
|
-
this.
|
|
180
|
-
this._graphics = [], this._getEncoderOfStyle = (stateName, style) => {
|
|
191
|
+
}, this._visible = !0, this.stateStyle = {}, this._unCompileChannel = {}, this._disabledAnimationStates = [],
|
|
192
|
+
this._skipBeforeLayouted = !1, this._extensionChannel = {}, this._computeExChannel = {},
|
|
193
|
+
this._graphicMap = new Map, this._graphics = [], this._getEncoderOfStyle = (stateName, style) => {
|
|
181
194
|
if (style && stateName) {
|
|
182
195
|
const validEncoder = {};
|
|
183
196
|
return Object.keys(style).forEach((key => {
|
|
@@ -426,6 +439,7 @@ class BaseMark extends grammar_item_1.GrammarItem {
|
|
|
426
439
|
}
|
|
427
440
|
_getCommonContext() {
|
|
428
441
|
return {
|
|
442
|
+
compiler: this.getCompiler(),
|
|
429
443
|
markType: this.type,
|
|
430
444
|
markId: this.id,
|
|
431
445
|
modelId: this.model.id,
|
|
@@ -859,7 +873,7 @@ class BaseMark extends grammar_item_1.GrammarItem {
|
|
|
859
873
|
(null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.beforeTransformProgressive) ? this._runBeforeProgressive() : this.renderContext.progressive && this._runProgressiveStep();
|
|
860
874
|
}
|
|
861
875
|
hasAnimationByState(state) {
|
|
862
|
-
if (!state || !this._animationConfig || !this._animationConfig[state]) return !1;
|
|
876
|
+
if (!state || !this._animationConfig || !this._animationConfig[state] || this._disabledAnimationStates.includes(state)) return !1;
|
|
863
877
|
const stateAnimationConfig = this._animationConfig[state];
|
|
864
878
|
return stateAnimationConfig.length > 0 || (0, vutils_1.isObject)(stateAnimationConfig);
|
|
865
879
|
}
|