@visactor/vchart 2.0.1 → 2.0.3-alpha.0
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 +384 -427
- package/build/index.js +383 -427
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/animate-manager.d.ts +1 -0
- package/cjs/animation/animate-manager.js +2 -0
- package/cjs/animation/animate-manager.js.map +1 -0
- package/cjs/animation/index.js +1 -2
- package/cjs/animation/interface.js +2 -1
- package/cjs/chart/base/base-chart.d.ts +0 -1
- package/cjs/chart/base/base-chart.js +8 -5
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +0 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/util.js +1 -2
- package/cjs/compile/compiler.d.ts +0 -1
- package/cjs/compile/compiler.js +2 -10
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +0 -1
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/compile/interface/compiler.d.ts +0 -1
- package/cjs/compile/interface/compiler.js.map +1 -1
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +0 -8
- package/cjs/component/axis/cartesian/band-axis.js +0 -9
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +0 -2
- package/cjs/component/axis/mixin/band-axis-mixin.js +1 -15
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/brush/brush.js +6 -6
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +0 -1
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +1 -1
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.js +2 -2
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/cjs/component/data-zoom/data-filter-base-component.js +19 -13
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/interface.d.ts +3 -0
- package/cjs/component/data-zoom/interface.js.map +1 -1
- package/cjs/component/data-zoom/util.d.ts +1 -0
- package/cjs/component/data-zoom/util.js +4 -3
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/player/player.js +1 -2
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/tooltip/tooltip.js +3 -8
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/constant/attribute.js +2 -1
- package/cjs/constant/sunburst.js +1 -2
- package/cjs/constant/waterfall.js +2 -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/util.js +1 -1
- package/cjs/core/vchart.d.ts +0 -1
- package/cjs/core/vchart.js +17 -36
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/transforms/obj-flat.js +4 -1
- package/cjs/data/transforms/obj-flat.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +2 -6
- package/cjs/mark/base/base-mark.js +51 -69
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/group.d.ts +2 -3
- package/cjs/mark/group.js +13 -15
- package/cjs/mark/group.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +2 -5
- package/cjs/mark/interface/common.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -5
- package/cjs/model/base-model.js +0 -7
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +1 -4
- 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/cjs/series/base/base-series.js +3 -2
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/dot/dot.d.ts +1 -0
- package/cjs/series/dot/dot.js +29 -6
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/dot/interface.d.ts +1 -0
- package/cjs/series/dot/interface.js.map +1 -1
- package/cjs/series/dot/tooltip-helper.js +3 -2
- package/cjs/series/dot/tooltip-helper.js.map +1 -1
- package/cjs/series/funnel/funnel.js +2 -0
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/interface/type.d.ts +3 -0
- package/cjs/series/interface/type.js +5 -3
- package/cjs/series/interface/type.js.map +1 -1
- package/cjs/series/link/constant.js +8 -0
- package/cjs/series/link/constant.js.map +1 -1
- package/cjs/series/link/interface.d.ts +10 -1
- package/cjs/series/link/interface.js +5 -1
- package/cjs/series/link/interface.js.map +1 -1
- package/cjs/series/link/link.d.ts +3 -1
- package/cjs/series/link/link.js +46 -16
- package/cjs/series/link/link.js.map +1 -1
- package/cjs/series/map/map.js +2 -1
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/pie/pie.js +1 -0
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/util/mark.d.ts +0 -1
- package/cjs/util/mark.js +1 -10
- package/cjs/util/mark.js.map +1 -1
- package/esm/animation/animate-manager.d.ts +1 -0
- package/esm/animation/animate-manager.js +2 -0
- package/esm/animation/animate-manager.js.map +1 -0
- package/esm/animation/index.js +1 -2
- package/esm/animation/interface.js +2 -1
- package/esm/chart/base/base-chart.d.ts +0 -1
- package/esm/chart/base/base-chart.js +8 -5
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +0 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/util.js +1 -2
- package/esm/compile/compiler.d.ts +0 -1
- package/esm/compile/compiler.js +4 -11
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compilable-item.d.ts +0 -1
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/compile/interface/compiler.d.ts +0 -1
- package/esm/compile/interface/compiler.js.map +1 -1
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +0 -8
- package/esm/component/axis/cartesian/band-axis.js +1 -9
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +0 -2
- package/esm/component/axis/mixin/band-axis-mixin.js +1 -15
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/brush/brush.js +6 -6
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +0 -1
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +1 -1
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.js +2 -2
- package/esm/component/crosshair/utils/cartesian.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/esm/component/data-zoom/data-filter-base-component.js +18 -13
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/interface.d.ts +3 -0
- package/esm/component/data-zoom/interface.js.map +1 -1
- package/esm/component/data-zoom/util.d.ts +1 -0
- package/esm/component/data-zoom/util.js +5 -2
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/player/player.js +1 -2
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/tooltip/tooltip.js +3 -8
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/constant/attribute.js +2 -1
- package/esm/constant/sunburst.js +1 -2
- package/esm/constant/waterfall.js +2 -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/util.js +1 -1
- package/esm/core/vchart.d.ts +0 -1
- package/esm/core/vchart.js +16 -35
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/transforms/obj-flat.js +4 -1
- package/esm/data/transforms/obj-flat.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +2 -6
- package/esm/mark/base/base-mark.js +50 -69
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/group.d.ts +2 -3
- package/esm/mark/group.js +12 -18
- package/esm/mark/group.js.map +1 -1
- package/esm/mark/interface/common.d.ts +2 -5
- package/esm/mark/interface/common.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -5
- package/esm/model/base-model.js +0 -7
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +1 -4
- package/esm/model/interface.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/style.js +4 -5
- package/esm/plugin/components/tooltip-handler/utils/style.js.map +1 -1
- package/esm/region/region.js.map +1 -1
- package/esm/series/base/base-series.js +3 -2
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/dot/dot.d.ts +1 -0
- package/esm/series/dot/dot.js +29 -6
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/dot/interface.d.ts +1 -0
- package/esm/series/dot/interface.js.map +1 -1
- package/esm/series/dot/tooltip-helper.js +3 -2
- package/esm/series/dot/tooltip-helper.js.map +1 -1
- package/esm/series/funnel/funnel.js +2 -0
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/interface/type.d.ts +3 -0
- package/esm/series/interface/type.js +5 -3
- package/esm/series/interface/type.js.map +1 -1
- package/esm/series/link/constant.js +8 -0
- package/esm/series/link/constant.js.map +1 -1
- package/esm/series/link/interface.d.ts +10 -1
- package/esm/series/link/interface.js +5 -1
- package/esm/series/link/interface.js.map +1 -1
- package/esm/series/link/link.d.ts +3 -1
- package/esm/series/link/link.js +48 -16
- package/esm/series/link/link.js.map +1 -1
- package/esm/series/map/map.js +2 -1
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/pie/pie.js +1 -0
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/util/mark.d.ts +0 -1
- package/esm/util/mark.js +0 -7
- package/esm/util/mark.js.map +1 -1
- package/package.json +8 -8
|
@@ -44,9 +44,6 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
44
44
|
protected _animationConfig: Partial<MarkAnimationSpec>;
|
|
45
45
|
getAnimationConfig(): Partial<MarkAnimationSpec>;
|
|
46
46
|
setAnimationConfig(config: Partial<MarkAnimationSpec>): void;
|
|
47
|
-
protected _disabledAnimationStates?: string[];
|
|
48
|
-
disableAnimationByState(state: string | string[]): void;
|
|
49
|
-
enableAnimationByState(state: string | string[]): void;
|
|
50
47
|
private _skipBeforeLayouted;
|
|
51
48
|
setSkipBeforeLayouted(skip: boolean): void;
|
|
52
49
|
protected _groupKey?: string;
|
|
@@ -126,7 +123,6 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
126
123
|
protected _attrsByGroup?: Record<string, T>;
|
|
127
124
|
protected _getDataByKey(data: Datum[]): GroupedData<Datum>;
|
|
128
125
|
protected _getCommonContext(): {
|
|
129
|
-
compiler: import("../../compile/interface").ICompiler;
|
|
130
126
|
markType: MarkTypeEnum;
|
|
131
127
|
markId: number;
|
|
132
128
|
modelId: number;
|
|
@@ -142,7 +138,6 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
142
138
|
protected createAnimationStateList(type: string, animationConfig: Partial<MarkAnimationSpec>): any;
|
|
143
139
|
protected tryRunMorphing(graphics: IMarkGraphic[]): boolean;
|
|
144
140
|
protected _runStateAnimation(graphics: IMarkGraphic[]): void;
|
|
145
|
-
protected _setAnimationState(g: IMarkGraphic): void;
|
|
146
141
|
protected _runJoin(data: Datum[]): void;
|
|
147
142
|
_runEncoderOfGraphic(styles: Record<string, (datum: Datum) => any>, g: IMarkGraphic, attrs?: any): any;
|
|
148
143
|
_runGroupEncoder(groupStyles: Record<string, (datum: Datum) => any>): any;
|
|
@@ -184,7 +179,8 @@ export declare class BaseMark<T extends ICommonSpec> extends GrammarItem impleme
|
|
|
184
179
|
protected _runProgressiveApplyGraphic(graphics: IMarkGraphic[]): void;
|
|
185
180
|
protected _runProgressiveStep(): void;
|
|
186
181
|
renderProgressive(): void;
|
|
187
|
-
|
|
182
|
+
updateAnimationState(callback: (graphic: IMarkGraphic) => AnimationStateValues): void;
|
|
183
|
+
hasAnimationByState(state: keyof MarkAnimationSpec): boolean;
|
|
188
184
|
hasAnimation(): boolean;
|
|
189
185
|
runAnimation(): void;
|
|
190
186
|
}
|
|
@@ -50,9 +50,7 @@ import { AnimationStateEnum } from "../../animation/interface";
|
|
|
50
50
|
|
|
51
51
|
import { CompilableData } from "../../compile/data/compilable-data";
|
|
52
52
|
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
import { log } from "../../util/debug";
|
|
53
|
+
import { log } from "../../util";
|
|
56
54
|
|
|
57
55
|
import { morph as runMorph } from "../../compile/morph";
|
|
58
56
|
|
|
@@ -112,36 +110,24 @@ export class BaseMark extends GrammarItem {
|
|
|
112
110
|
setAnimationConfig(config) {
|
|
113
111
|
const defaultPrams = "group" === this.type ? {
|
|
114
112
|
selfOnly: !0
|
|
115
|
-
} : {},
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
} : {}, animationConfig = {};
|
|
114
|
+
Object.keys(config).forEach((key => {
|
|
115
|
+
const value = config[key];
|
|
116
|
+
isArray(value) ? animationConfig[key] = value.map((item => {
|
|
117
|
+
var _a;
|
|
118
|
+
const options = null !== (_a = item.options) && void 0 !== _a ? _a : {};
|
|
119
|
+
return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), {
|
|
120
|
+
options: (...args) => {
|
|
121
|
+
var _a, _b;
|
|
122
|
+
const _options = "function" == typeof options ? options(...args) : options;
|
|
124
123
|
return Object.assign(Object.assign({}, _options), {
|
|
125
|
-
layoutRect: null === (_b =
|
|
124
|
+
layoutRect: null === (_b = (_a = this.model).getLayoutRect) || void 0 === _b ? void 0 : _b.call(_a)
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
131
|
-
}, animationConfig = {};
|
|
132
|
-
Object.keys(config).forEach((key => {
|
|
133
|
-
const value = config[key];
|
|
134
|
-
isArray(value) ? animationConfig[key] = value.map(formatAnimationCfg) : isValid(value) && (animationConfig[key] = formatAnimationCfg(value));
|
|
127
|
+
});
|
|
128
|
+
})) : animationConfig[key] = Object.assign(Object.assign({}, defaultPrams), config[key]);
|
|
135
129
|
})), this._animationConfig = animationConfig;
|
|
136
130
|
}
|
|
137
|
-
disableAnimationByState(state) {
|
|
138
|
-
const states = array(state);
|
|
139
|
-
this._disabledAnimationStates = [ ...new Set([ ...this._disabledAnimationStates, ...states ]) ];
|
|
140
|
-
}
|
|
141
|
-
enableAnimationByState(state) {
|
|
142
|
-
const states = array(state);
|
|
143
|
-
this._disabledAnimationStates = this._disabledAnimationStates.filter((s => !states.includes(s)));
|
|
144
|
-
}
|
|
145
131
|
setSkipBeforeLayouted(skip) {
|
|
146
132
|
this._skipBeforeLayouted = skip;
|
|
147
133
|
}
|
|
@@ -226,9 +212,9 @@ export class BaseMark extends GrammarItem {
|
|
|
226
212
|
super(option), this.type = void 0, this.name = "mark", this._markConfig = {
|
|
227
213
|
zIndex: LayoutZIndex.Mark,
|
|
228
214
|
morph: !1
|
|
229
|
-
}, this._visible = !0, this.stateStyle = {}, this._unCompileChannel = {}, this.
|
|
230
|
-
this.
|
|
231
|
-
this.
|
|
215
|
+
}, this._visible = !0, this.stateStyle = {}, this._unCompileChannel = {}, this._skipBeforeLayouted = !1,
|
|
216
|
+
this._extensionChannel = {}, this._computeExChannel = {}, this._graphicMap = new Map,
|
|
217
|
+
this._graphics = [], this._getEncoderOfStyle = (stateName, style) => {
|
|
232
218
|
if (style && stateName) {
|
|
233
219
|
const validEncoder = {};
|
|
234
220
|
return Object.keys(style).forEach((key => {
|
|
@@ -473,7 +459,6 @@ export class BaseMark extends GrammarItem {
|
|
|
473
459
|
}
|
|
474
460
|
_getCommonContext() {
|
|
475
461
|
return {
|
|
476
|
-
compiler: this.getCompiler(),
|
|
477
462
|
markType: this.type,
|
|
478
463
|
markId: this.id,
|
|
479
464
|
modelId: this.model.id,
|
|
@@ -524,17 +509,14 @@ export class BaseMark extends GrammarItem {
|
|
|
524
509
|
this._dataByGroup = groupData(data, this._groupKeyGetter);
|
|
525
510
|
}
|
|
526
511
|
createAnimationStateList(type, animationConfig) {
|
|
527
|
-
var _a;
|
|
528
512
|
let config = animationConfig[type];
|
|
529
513
|
return config && Array.isArray(config) && (config = 1 === config.length ? config[0] : config),
|
|
530
|
-
Array.isArray(config)
|
|
514
|
+
Array.isArray(config) && (config = config.map(((item, index) => {
|
|
531
515
|
var _a;
|
|
532
516
|
return Object.assign(Object.assign({}, item), {
|
|
533
517
|
priority: null !== (_a = item.priority) && void 0 !== _a ? _a : 1 / 0
|
|
534
518
|
});
|
|
535
|
-
}))
|
|
536
|
-
priority: "normal" === type ? null !== (_a = config.priority) && void 0 !== _a ? _a : 1 / 0 : config.priority
|
|
537
|
-
}) : config;
|
|
519
|
+
}))), config;
|
|
538
520
|
}
|
|
539
521
|
tryRunMorphing(graphics) {
|
|
540
522
|
if (this._lastMark) {
|
|
@@ -593,37 +575,29 @@ export class BaseMark extends GrammarItem {
|
|
|
593
575
|
this._product.applyAnimationState([ "normal" ], [ normalConfig ]);
|
|
594
576
|
}
|
|
595
577
|
}
|
|
596
|
-
_setAnimationState(g) {
|
|
597
|
-
var _a, _b, _c;
|
|
598
|
-
const callback = ("component" === this.type ? this.model.getAnimationStateCallback() : null === (_c = null === (_b = (_a = this.model).getRegion) || void 0 === _b ? void 0 : _b.call(_a)) || void 0 === _c ? void 0 : _c.getAnimationStateCallback()) || (g => {
|
|
599
|
-
var _a;
|
|
600
|
-
const diffState = null === (_a = g.context) || void 0 === _a ? void 0 : _a.diffState;
|
|
601
|
-
return diffState === AnimationStateEnum.exit ? AnimationStateEnum.exit : diffState === AnimationStateEnum.update ? AnimationStateEnum.update : AnimationStateEnum.appear;
|
|
602
|
-
}), customizedState = callback(g);
|
|
603
|
-
g.context.animationState = null != customizedState ? customizedState : g.context.diffState,
|
|
604
|
-
g.context.animationState === DiffState.exit && (g.context.reusing = !0, g.animates && g.animates.forEach((a => a.stop())));
|
|
605
|
-
}
|
|
606
578
|
_runJoin(data) {
|
|
607
|
-
const newGroupedData = this._getDataByKey(data), prevGroupedData = this._prevDataByKey,
|
|
608
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
579
|
+
const newGroupedData = this._getDataByKey(data), prevGroupedData = this._prevDataByKey, newGraphics = [], enterGraphics = new Set(this._graphics.filter((g => g.context.diffState === DiffState.enter))), callback = (key, newData, prevData) => {
|
|
580
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
609
581
|
let g, diffState;
|
|
610
582
|
return isNil(newData) ? (g = this._graphicMap.get(key), g && (diffState = DiffState.exit)) : isNil(prevData) ? (g = this._graphicMap.has(key) ? this._graphicMap.get(key) : {},
|
|
611
|
-
diffState = DiffState.enter, g.isExiting = !1,
|
|
612
|
-
g && (
|
|
613
|
-
g
|
|
583
|
+
diffState = DiffState.enter, g.isExiting = !1, (null === (_a = g.context) || void 0 === _a ? void 0 : _a.diffState) === DiffState.exit && (g.context.reusing = !0,
|
|
584
|
+
g.animates && g.animates.forEach((a => a.stop()))), this._graphicMap.set(key, g),
|
|
585
|
+
newGraphics.push(g)) : (g = this._graphicMap.get(key), g && (diffState = DiffState.update,
|
|
586
|
+
newGraphics.push(g))), g && (g.context = Object.assign(Object.assign({}, this._getCommonContext()), {
|
|
614
587
|
diffState: diffState,
|
|
615
|
-
reusing: null === (
|
|
616
|
-
originalFieldX: null === (
|
|
617
|
-
originalFieldY: null === (
|
|
618
|
-
fieldX: null === (
|
|
619
|
-
fieldY: null === (
|
|
620
|
-
|
|
588
|
+
reusing: null === (_b = g.context) || void 0 === _b ? void 0 : _b.reusing,
|
|
589
|
+
originalFieldX: null === (_c = g.context) || void 0 === _c ? void 0 : _c.originalFieldX,
|
|
590
|
+
originalFieldY: null === (_d = g.context) || void 0 === _d ? void 0 : _d.originalFieldY,
|
|
591
|
+
fieldX: null === (_e = g.context) || void 0 === _e ? void 0 : _e.fieldX,
|
|
592
|
+
fieldY: null === (_f = g.context) || void 0 === _f ? void 0 : _f.fieldY,
|
|
593
|
+
animationState: diffState,
|
|
594
|
+
data: null != newData ? newData : null === (_g = g.context) || void 0 === _g ? void 0 : _g.data,
|
|
621
595
|
uniqueKey: key,
|
|
622
|
-
key: newData ? this._keyGetter(newData[0]) : null === (
|
|
623
|
-
groupKey: newData ? this._groupKeyGetter(newData[0]) : null === (
|
|
596
|
+
key: newData ? this._keyGetter(newData[0]) : null === (_h = g.context) || void 0 === _h ? void 0 : _h.key,
|
|
597
|
+
groupKey: newData ? this._groupKeyGetter(newData[0]) : null === (_j = g.context) || void 0 === _j ? void 0 : _j.groupKey,
|
|
624
598
|
indexKey: "__VCHART_DEFAULT_DATA_INDEX",
|
|
625
|
-
stateAnimateConfig: null === (
|
|
626
|
-
}),
|
|
599
|
+
stateAnimateConfig: null === (_k = this.getAnimationConfig()) || void 0 === _k ? void 0 : _k.state
|
|
600
|
+
}), enterGraphics.delete(g)), g;
|
|
627
601
|
};
|
|
628
602
|
if (prevGroupedData && newGroupedData) {
|
|
629
603
|
const prevMap = new Map(prevGroupedData.data);
|
|
@@ -642,10 +616,10 @@ export class BaseMark extends GrammarItem {
|
|
|
642
616
|
this._graphicMap.delete(g.context.uniqueKey), g.parent && g.parent.removeChild(g),
|
|
643
617
|
g.release();
|
|
644
618
|
}));
|
|
645
|
-
const graphicCount =
|
|
646
|
-
|
|
619
|
+
const graphicCount = newGraphics.length;
|
|
620
|
+
newGraphics.forEach(((g, index) => {
|
|
647
621
|
g.context.graphicCount = graphicCount, g.context.graphicIndex = index;
|
|
648
|
-
})), this._dataByKey = newGroupedData, this._graphics =
|
|
622
|
+
})), this._dataByKey = newGroupedData, this._graphics = newGraphics, this.needClear = !0;
|
|
649
623
|
}
|
|
650
624
|
_runEncoderOfGraphic(styles, g, attrs = {}) {
|
|
651
625
|
return runEncoder(styles, g.context.data[0], attrs);
|
|
@@ -689,8 +663,10 @@ export class BaseMark extends GrammarItem {
|
|
|
689
663
|
var _a;
|
|
690
664
|
const finalAttrs = g.context.finalAttrs, hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
691
665
|
if (g.setAttributes) {
|
|
692
|
-
const
|
|
693
|
-
|
|
666
|
+
const prevAttrs = g.getAttributes(!0), diffAttrs = {};
|
|
667
|
+
Object.keys(finalAttrs).forEach((key => {
|
|
668
|
+
prevAttrs[key] !== finalAttrs[key] && (diffAttrs[key] = finalAttrs[key]);
|
|
669
|
+
})), g.context.diffAttrs = diffAttrs, g.context.reusing ? (g.context.lastAttrs = g.attribute,
|
|
694
670
|
g.initAttributes({}), g.context.reusing = !1) : hasStateAnimation || (hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs)),
|
|
695
671
|
hasAnimation && g.setFinalAttributes(finalAttrs);
|
|
696
672
|
} else {
|
|
@@ -794,7 +770,7 @@ export class BaseMark extends GrammarItem {
|
|
|
794
770
|
this._graphicMap.delete(key), g.parent && g.parent.removeChild(g), g.release && g.release();
|
|
795
771
|
};
|
|
796
772
|
this._graphicMap.forEach(((g, key) => {
|
|
797
|
-
if (g.context.diffState === DiffState.exit && !g.isExiting) if (
|
|
773
|
+
if (g.context.diffState === DiffState.exit && !g.isExiting) if (this.hasAnimationByState("exit")) {
|
|
798
774
|
g.isExiting = !0;
|
|
799
775
|
const animationConfig = this.getAnimationConfig();
|
|
800
776
|
if (animationConfig.exit && animationConfig.exit.length) {
|
|
@@ -903,8 +879,13 @@ export class BaseMark extends GrammarItem {
|
|
|
903
879
|
var _a;
|
|
904
880
|
(null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.beforeTransformProgressive) ? this._runBeforeProgressive() : this.renderContext.progressive && this._runProgressiveStep();
|
|
905
881
|
}
|
|
882
|
+
updateAnimationState(callback) {
|
|
883
|
+
this._graphics && this._graphics.length && this._graphics.forEach((g => {
|
|
884
|
+
g.context.animationState = callback(g);
|
|
885
|
+
}));
|
|
886
|
+
}
|
|
906
887
|
hasAnimationByState(state) {
|
|
907
|
-
if (!state || !this._animationConfig || !this._animationConfig[state]
|
|
888
|
+
if (!state || !this._animationConfig || !this._animationConfig[state]) return !1;
|
|
908
889
|
const stateAnimationConfig = this._animationConfig[state];
|
|
909
890
|
return stateAnimationConfig.length > 0 || isObject(stateAnimationConfig);
|
|
910
891
|
}
|