@visactor/vchart 2.0.12-alpha.5 → 2.0.13-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 +155 -128
- package/build/index.js +155 -128
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/callback-disappear.d.ts +10 -0
- package/cjs/animation/callback-disappear.js +25 -0
- package/cjs/animation/callback-disappear.js.map +1 -0
- package/cjs/animation/config.d.ts +0 -6
- package/cjs/animation/config.js +3 -29
- package/cjs/animation/config.js.map +1 -1
- package/cjs/animation/interface.d.ts +6 -3
- package/cjs/animation/interface.js.map +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +7 -2
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/compile/compiler.d.ts +1 -1
- package/cjs/compile/compiler.js +16 -15
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/grammar-item.js +1 -1
- package/cjs/compile/interface/compilable-item.d.ts +1 -0
- package/cjs/compile/interface/compilable-item.js.map +1 -1
- package/cjs/compile/morph.js +1 -1
- package/cjs/compile/state-manager.js +1 -1
- package/cjs/compile/util.js +1 -1
- package/cjs/component/axis/cartesian/axis.js +4 -1
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.js +3 -2
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +22 -20
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +10 -2
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/constant/animate.d.ts +5 -0
- package/cjs/constant/animate.js +15 -0
- package/cjs/constant/animate.js.map +1 -0
- package/cjs/constant/data.js +1 -2
- package/cjs/constant/label.js +2 -1
- package/cjs/constant/word-cloud.js +1 -1
- package/cjs/core/expression-function.js +2 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +2 -3
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +3 -0
- package/cjs/core/vchart.js +17 -4
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/env/env.js +1 -1
- package/cjs/env/index.js +1 -1
- package/cjs/region/interface.d.ts +1 -0
- package/cjs/region/interface.js.map +1 -1
- package/cjs/series/bar/animation.js +4 -2
- package/cjs/series/bar/animation.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +0 -1
- package/cjs/series/base/base-series.js +2 -7
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/circle-packing/animation.js +2 -2
- package/cjs/series/circle-packing/animation.js.map +1 -1
- package/cjs/series/gauge/animation.js +2 -2
- package/cjs/series/gauge/animation.js.map +1 -1
- package/cjs/series/heatmap/heatmap.d.ts +1 -1
- package/cjs/series/heatmap/heatmap.js +2 -2
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/pie/animation/animation.js +4 -2
- package/cjs/series/pie/animation/animation.js.map +1 -1
- package/cjs/series/polar/progress-like/animation.js +2 -2
- package/cjs/series/polar/progress-like/animation.js.map +1 -1
- package/cjs/series/progress/linear/animation.js +4 -2
- package/cjs/series/progress/linear/animation.js.map +1 -1
- package/cjs/series/radar/animation.js +9 -3
- package/cjs/series/radar/animation.js.map +1 -1
- package/cjs/series/range-column/animation.js +4 -2
- package/cjs/series/range-column/animation.js.map +1 -1
- package/cjs/series/rose/animation.js +4 -2
- package/cjs/series/rose/animation.js.map +1 -1
- package/cjs/series/sankey/animation.js +3 -3
- package/cjs/series/sankey/animation.js.map +1 -1
- package/cjs/series/sunburst/animation/index.js +4 -2
- package/cjs/series/sunburst/animation/index.js.map +1 -1
- package/cjs/series/treemap/animation.js +2 -2
- package/cjs/series/treemap/animation.js.map +1 -1
- package/cjs/series/venn/animation.js +3 -3
- package/cjs/series/venn/animation.js.map +1 -1
- package/cjs/series/waterfall/animation.js +4 -2
- package/cjs/series/waterfall/animation.js.map +1 -1
- package/cjs/series/word-cloud/animation.js +1 -1
- package/cjs/series/word-cloud/animation.js.map +1 -1
- package/cjs/theme/builtin/common/series/heatmap.js +1 -1
- package/cjs/theme/builtin/common/series/heatmap.js.map +1 -1
- package/cjs/util/type.d.ts +1 -0
- package/cjs/util/type.js +6 -2
- package/cjs/util/type.js.map +1 -1
- package/esm/animation/callback-disappear.d.ts +10 -0
- package/esm/animation/callback-disappear.js +17 -0
- package/esm/animation/callback-disappear.js.map +1 -0
- package/esm/animation/config.d.ts +0 -6
- package/esm/animation/config.js +7 -26
- package/esm/animation/config.js.map +1 -1
- package/esm/animation/interface.d.ts +6 -3
- package/esm/animation/interface.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +7 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/compile/compiler.d.ts +1 -1
- package/esm/compile/compiler.js +18 -16
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/grammar-item.js +1 -1
- package/esm/compile/interface/compilable-item.d.ts +1 -0
- package/esm/compile/interface/compilable-item.js.map +1 -1
- package/esm/compile/morph.js +1 -1
- package/esm/compile/state-manager.js +1 -1
- package/esm/compile/util.js +1 -1
- package/esm/component/axis/cartesian/axis.js +4 -1
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/geo/geo-coordinate.js +3 -2
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +22 -20
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +10 -2
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/constant/animate.d.ts +5 -0
- package/esm/constant/animate.js +10 -0
- package/esm/constant/animate.js.map +1 -0
- package/esm/constant/data.js +1 -2
- package/esm/constant/label.js +2 -1
- package/esm/constant/word-cloud.js +1 -1
- package/esm/core/expression-function.js +2 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +2 -3
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +3 -0
- package/esm/core/vchart.js +18 -3
- package/esm/core/vchart.js.map +1 -1
- package/esm/env/env.js +1 -1
- package/esm/env/index.js +1 -1
- package/esm/region/interface.d.ts +1 -0
- package/esm/region/interface.js.map +1 -1
- package/esm/series/bar/animation.js +5 -1
- package/esm/series/bar/animation.js.map +1 -1
- package/esm/series/base/base-series.d.ts +0 -1
- package/esm/series/base/base-series.js +2 -6
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/circle-packing/animation.js +3 -1
- package/esm/series/circle-packing/animation.js.map +1 -1
- package/esm/series/gauge/animation.js +3 -1
- package/esm/series/gauge/animation.js.map +1 -1
- package/esm/series/heatmap/heatmap.d.ts +1 -1
- package/esm/series/heatmap/heatmap.js +2 -2
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/pie/animation/animation.js +5 -1
- package/esm/series/pie/animation/animation.js.map +1 -1
- package/esm/series/polar/progress-like/animation.js +3 -1
- package/esm/series/polar/progress-like/animation.js.map +1 -1
- package/esm/series/progress/linear/animation.js +5 -1
- package/esm/series/progress/linear/animation.js.map +1 -1
- package/esm/series/radar/animation.js +9 -3
- package/esm/series/radar/animation.js.map +1 -1
- package/esm/series/range-column/animation.js +5 -1
- package/esm/series/range-column/animation.js.map +1 -1
- package/esm/series/rose/animation.js +5 -1
- package/esm/series/rose/animation.js.map +1 -1
- package/esm/series/sankey/animation.js +3 -1
- package/esm/series/sankey/animation.js.map +1 -1
- package/esm/series/sunburst/animation/index.js +5 -1
- package/esm/series/sunburst/animation/index.js.map +1 -1
- package/esm/series/treemap/animation.js +3 -1
- package/esm/series/treemap/animation.js.map +1 -1
- package/esm/series/venn/animation.js +4 -2
- package/esm/series/venn/animation.js.map +1 -1
- package/esm/series/waterfall/animation.js +5 -1
- package/esm/series/waterfall/animation.js.map +1 -1
- package/esm/series/word-cloud/animation.js +1 -1
- package/esm/series/word-cloud/animation.js.map +1 -1
- package/esm/theme/builtin/common/series/heatmap.js +1 -1
- package/esm/theme/builtin/common/series/heatmap.js.map +1 -1
- package/esm/util/type.d.ts +1 -0
- package/esm/util/type.js +4 -0
- package/esm/util/type.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AStageAnimate } from '@visactor/vrender-animate';
|
|
2
|
+
import { EasingType } from '@visactor/vrender-core';
|
|
3
|
+
export declare class CallbackDisappearAnimate extends AStageAnimate<any> {
|
|
4
|
+
protected currentAnimationRatio: number;
|
|
5
|
+
protected animationTime: number;
|
|
6
|
+
constructor(from: null, to: null, duration: number, easing: EasingType, params: any);
|
|
7
|
+
onUpdate(end: boolean, ratio: number, out: any): void;
|
|
8
|
+
protected getAnimationTime(): number;
|
|
9
|
+
protected afterStageRender(stage: any, canvas: HTMLCanvasElement): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.CallbackDisappearAnimate = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_animate_1 = require("@visactor/vrender-animate");
|
|
8
|
+
|
|
9
|
+
class CallbackDisappearAnimate extends vrender_animate_1.AStageAnimate {
|
|
10
|
+
constructor(from, to, duration, easing, params) {
|
|
11
|
+
super(from, to, duration, easing, params), this.currentAnimationRatio = 0, this.animationTime = 0;
|
|
12
|
+
}
|
|
13
|
+
onUpdate(end, ratio, out) {
|
|
14
|
+
super.onUpdate(end, ratio, out), this.currentAnimationRatio = ratio, this.animationTime = ratio * Math.PI * 2;
|
|
15
|
+
}
|
|
16
|
+
getAnimationTime() {
|
|
17
|
+
return this.currentAnimationRatio > 0 ? this.animationTime : Date.now() / 1e3;
|
|
18
|
+
}
|
|
19
|
+
afterStageRender(stage, canvas) {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.callBack) || void 0 === _b ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.CallbackDisappearAnimate = CallbackDisappearAnimate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/animation/callback-disappear.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAM1D,MAAa,wBAAyB,SAAQ,+BAAkB;IAI9D,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAW;QACjF,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAJlC,0BAAqB,GAAG,CAAC,CAAC;QAC1B,kBAAa,GAAG,CAAC,CAAC;IAI5B,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAQ;QAC5C,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAKS,gBAAgB;QACxB,IAAI,IAAI,CAAC,qBAAqB,GAAG,CAAC,EAAE;YAClC,OAAO,IAAI,CAAC,aAAa,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;IAC7B,CAAC;IAES,gBAAgB,CAAC,KAAU,EAAE,MAAyB;;QAC9D,OAAO,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,mDAAG,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAChG,CAAC;CACF;AA3BD,4DA2BC","file":"callback-disappear.js","sourcesContent":["import { AStageAnimate } from '@visactor/vrender-animate';\nimport { EasingType } from '@visactor/vrender-core';\n\n/**\n * 特效动画基类,提取公共的WebGL和Canvas 2D操作\n */\nexport class CallbackDisappearAnimate extends AStageAnimate<any> {\n protected currentAnimationRatio = 0;\n protected animationTime = 0;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: any): void {\n super.onUpdate(end, ratio, out);\n this.currentAnimationRatio = ratio;\n this.animationTime = ratio * Math.PI * 2;\n }\n\n /**\n * 获取基于动画进度的时间\n */\n protected getAnimationTime(): number {\n if (this.currentAnimationRatio > 0) {\n return this.animationTime;\n }\n return Date.now() / 1000.0;\n }\n\n protected afterStageRender(stage: any, canvas: HTMLCanvasElement): void {\n return this.params?.callBack?.(stage, canvas, this.currentAnimationRatio, this.animationTime);\n }\n}\n"]}
|
|
@@ -35,9 +35,6 @@ export declare const ScaleInOutAnimation: {
|
|
|
35
35
|
exit: {
|
|
36
36
|
type: string;
|
|
37
37
|
};
|
|
38
|
-
disappear: {
|
|
39
|
-
type: string;
|
|
40
|
-
};
|
|
41
38
|
};
|
|
42
39
|
export declare const FadeInOutAnimation: {
|
|
43
40
|
appear: {
|
|
@@ -49,9 +46,6 @@ export declare const FadeInOutAnimation: {
|
|
|
49
46
|
exit: {
|
|
50
47
|
type: string;
|
|
51
48
|
};
|
|
52
|
-
disappear: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
49
|
};
|
|
56
50
|
export declare const registerScaleInOutAnimation: () => void;
|
|
57
51
|
export declare const registerFadeInOutAnimation: () => void;
|
package/cjs/animation/config.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.registerStageAnimation = exports.registerPolygonAnimation = exports.registerLineOrAreaAnimation = exports.registerArcAnimation = exports.registerRectAnimation = exports.registerBuiltInAnimation = exports.registerAreaAnimation = exports.registerLineAnimation = exports.registerCartesianGroupClipAnimation = exports.registerFadeInOutAnimation = exports.registerScaleInOutAnimation = exports.FadeInOutAnimation = exports.ScaleInOutAnimation = exports.DEFAULT_ANIMATION_CONFIG = void 0;
|
|
6
6
|
|
|
7
|
-
const vrender_animate_1 = require("@visactor/vrender-animate"), animation_1 = require("../series/line/animation"), factory_1 = require("../core/factory");
|
|
7
|
+
const vrender_animate_1 = require("@visactor/vrender-animate"), animation_1 = require("../series/line/animation"), factory_1 = require("../core/factory"), callback_disappear_1 = require("./callback-disappear"), animate_1 = require("../constant/animate");
|
|
8
8
|
|
|
9
9
|
exports.DEFAULT_ANIMATION_CONFIG = {
|
|
10
10
|
appear: {
|
|
@@ -41,9 +41,6 @@ exports.DEFAULT_ANIMATION_CONFIG = {
|
|
|
41
41
|
},
|
|
42
42
|
exit: {
|
|
43
43
|
type: "scaleOut"
|
|
44
|
-
},
|
|
45
|
-
disappear: {
|
|
46
|
-
type: "scaleOut"
|
|
47
44
|
}
|
|
48
45
|
}, exports.FadeInOutAnimation = {
|
|
49
46
|
appear: {
|
|
@@ -54,9 +51,6 @@ exports.DEFAULT_ANIMATION_CONFIG = {
|
|
|
54
51
|
},
|
|
55
52
|
exit: {
|
|
56
53
|
type: "fadeOut"
|
|
57
|
-
},
|
|
58
|
-
disappear: {
|
|
59
|
-
type: "fadeOut"
|
|
60
54
|
}
|
|
61
55
|
};
|
|
62
56
|
|
|
@@ -84,17 +78,6 @@ const registerCartesianGroupClipAnimation = () => {
|
|
|
84
78
|
height: params.height(),
|
|
85
79
|
orient: params.orient()
|
|
86
80
|
})
|
|
87
|
-
},
|
|
88
|
-
disappear: {
|
|
89
|
-
custom: vrender_animate_1.ClipDirectionAnimate,
|
|
90
|
-
customParameters: (datum, g) => ({
|
|
91
|
-
animationType: "out",
|
|
92
|
-
group: g,
|
|
93
|
-
direction: params.direction(),
|
|
94
|
-
width: params.width(),
|
|
95
|
-
height: params.height(),
|
|
96
|
-
orient: params.orient()
|
|
97
|
-
})
|
|
98
81
|
}
|
|
99
82
|
})));
|
|
100
83
|
};
|
|
@@ -122,10 +105,7 @@ const lineOrAreaAnimation = (params, preset) => ({
|
|
|
122
105
|
customParameters: {
|
|
123
106
|
clipRangeByDimension: "horizontal" === params.direction ? "y" : "x"
|
|
124
107
|
}
|
|
125
|
-
} ]
|
|
126
|
-
disappear: {
|
|
127
|
-
type: "clipOut"
|
|
128
|
-
}
|
|
108
|
+
} ]
|
|
129
109
|
}), registerLineAnimation = () => {
|
|
130
110
|
factory_1.Factory.registerAnimation("line", lineOrAreaAnimation);
|
|
131
111
|
};
|
|
@@ -194,13 +174,7 @@ const registerPolygonAnimation = () => {
|
|
|
194
174
|
exports.registerPolygonAnimation = registerPolygonAnimation;
|
|
195
175
|
|
|
196
176
|
const registerStageAnimation = () => {
|
|
197
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate(
|
|
198
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("particle", vrender_animate_1.Particle),
|
|
199
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("pixelation", vrender_animate_1.Pixelation),
|
|
200
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("gaussianBlur", vrender_animate_1.GaussianBlur),
|
|
201
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("glitch", vrender_animate_1.Glitch),
|
|
202
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("grayscale", vrender_animate_1.Grayscale),
|
|
203
|
-
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("dissolve", vrender_animate_1.Dissolve);
|
|
177
|
+
vrender_animate_1.AnimateExecutor.registerBuiltInAnimate(animate_1.BuiltIn_DISAPPEAR_ANIMATE_NAME, callback_disappear_1.CallbackDisappearAnimate);
|
|
204
178
|
};
|
|
205
179
|
|
|
206
180
|
exports.registerStageAnimation = registerStageAnimation;
|
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Ae,CAAC,sBAAsB,CAAC,QAAQ,EAAE,wBAAM,CAAC,CAAC;IACzD,iCAAe,CAAC,sBAAsB,CAAC,WAAW,EAAE,2BAAS,CAAC,CAAC;IAC/D,iCAAe,CAAC,sBAAsB,CAAC,UAAU,EAAE,0BAAQ,CAAC,CAAC;AAC/D,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC","file":"config.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IGraphic } from '@visactor/vrender-core';\nimport {\n TagPointsUpdate,\n ClipDirectionAnimate,\n AnimateExecutor,\n ScaleIn,\n ScaleOut,\n FadeIn,\n FadeOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n Update,\n State,\n GrowHeightIn,\n GrowHeightOut,\n GrowWidthIn,\n GrowWidthOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n ClipIn,\n ClipOut,\n FromTo,\n Dissolve,\n Grayscale,\n Distortion,\n Particle,\n Glitch,\n GaussianBlur,\n Pixelation\n} from '@visactor/vrender-animate';\n\nimport type { ILineAnimationParams, LineAppearPreset } from '../series/line/interface';\nimport { linePresetAnimation } from '../series/line/animation';\nimport type { MarkAnimationSpec, ICartesianGroupAnimationParams } from './interface';\nimport { Factory } from '../core/factory';\nimport { Direction } from '../typings/space';\n\nexport const DEFAULT_ANIMATION_CONFIG = {\n appear: {\n duration: 1000,\n easing: 'cubicOut'\n },\n update: {\n type: 'update',\n duration: 300,\n easing: 'linear'\n },\n enter: {\n duration: 300,\n easing: 'linear'\n },\n exit: {\n duration: 300,\n easing: 'linear'\n },\n disappear: {\n duration: 500,\n easing: 'cubicIn'\n },\n state: {\n duration: 300,\n easing: 'linear'\n }\n};\n\nexport const ScaleInOutAnimation = {\n appear: { type: 'scaleIn' },\n enter: { type: 'scaleIn' },\n exit: { type: 'scaleOut' },\n disappear: { type: 'scaleOut' }\n};\n\nexport const FadeInOutAnimation = {\n appear: { type: 'fadeIn' },\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n disappear: { type: 'fadeOut' }\n};\n\nexport const registerScaleInOutAnimation = () => {\n Factory.registerAnimation('scaleInOut', () => ScaleInOutAnimation);\n};\n\nexport const registerFadeInOutAnimation = () => {\n Factory.registerAnimation('fadeInOut', () => FadeInOutAnimation);\n};\n\nexport const registerCartesianGroupClipAnimation = () => {\n Factory.registerAnimation('cartesianGroupClip', (params?: ICartesianGroupAnimationParams) => {\n return {\n appear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'in',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n },\n disappear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'out',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n }\n };\n });\n};\n\nconst lineOrAreaAnimation = (params: ILineAnimationParams, preset: LineAppearPreset) => {\n return {\n appear: linePresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n update: [\n {\n type: 'update',\n options: { excludeChannels: ['points', 'defined', 'segments'] }\n },\n {\n channel: ['points', 'segments'],\n custom: TagPointsUpdate,\n duration: DEFAULT_ANIMATION_CONFIG.update.duration,\n easing: DEFAULT_ANIMATION_CONFIG.update.easing,\n customParameters: {\n clipRangeByDimension: params.direction === Direction.horizontal ? 'y' : 'x'\n }\n }\n ],\n disappear: { type: 'clipOut' }\n } as MarkAnimationSpec;\n};\n\nexport const registerLineAnimation = () => {\n Factory.registerAnimation('line', lineOrAreaAnimation);\n};\n\nexport const registerAreaAnimation = () => {\n Factory.registerAnimation('area', lineOrAreaAnimation);\n};\n\nexport const registerBuiltInAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n};\n\nexport const registerRectAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n};\n\nexport const registerArcAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n};\n\nexport const registerLineOrAreaAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n};\n\nexport const registerPolygonAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n};\n\nexport const registerStageAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('distortion', Distortion);\n AnimateExecutor.registerBuiltInAnimate('particle', Particle);\n AnimateExecutor.registerBuiltInAnimate('pixelation', Pixelation);\n AnimateExecutor.registerBuiltInAnimate('gaussianBlur', GaussianBlur);\n AnimateExecutor.registerBuiltInAnimate('glitch', Glitch);\n AnimateExecutor.registerBuiltInAnimate('grayscale', Grayscale);\n AnimateExecutor.registerBuiltInAnimate('dissolve', Dissolve);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/animation/config.ts"],"names":[],"mappings":";;;AAEA,+DAiCmC;AAGnC,wDAA+D;AAE/D,6CAA0C;AAE1C,6DAAgE;AAChE,iDAAqE;AAExD,QAAA,wBAAwB,GAAG;IACtC,MAAM,EAAE;QACN,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,UAAU;KACnB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,SAAS;KAClB;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,QAAQ;KACjB;CACF,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,E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AE,+BAAa,CAAC,CAAC;IACvE,iCAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,6BAAW,CAAC,CAAC;IACnE,iCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,8BAAY,CAAC,CAAC;AACvE,CAAC,CAAC;AALW,QAAA,oBAAoB,wBAK/B;AAEK,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,iCAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,8BAAY,CAAC,CAAC;IACrE,iCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,+BAAa,CAAC,CAAC;IACvE,iCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,+BAAa,CAAC,CAAC;IACvE,iCAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,gCAAc,CAAC,CAAC;IACzE,iCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,+BAAa,CAAC,CAAC;IACvE,iCAAe,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,gCAAc,CAAC,CAAC;IACzE,iCAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,wBAAM,CAAC,CAAC;IACzD,iCAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,yBAAO,CAAC,CAAC;AAC7D,CAAC,CAAC;AATW,QAAA,2BAA2B,+BAStC;AAEK,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,iCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,+BAAa,CAAC,CAAC;AACzE,CAAC,CAAC;AAFW,QAAA,wBAAwB,4BAEnC;AAEK,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,iCAAe,CAAC,sBAAsB,CAAC,wCAA8B,EAAE,6CAAwB,CAAC,CAAC;AACnG,CAAC,CAAC;AAFW,QAAA,sBAAsB,0BAEjC","file":"config.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IGraphic } from '@visactor/vrender-core';\nimport {\n TagPointsUpdate,\n ClipDirectionAnimate,\n AnimateExecutor,\n ScaleIn,\n ScaleOut,\n FadeIn,\n FadeOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n Update,\n State,\n GrowHeightIn,\n GrowHeightOut,\n GrowWidthIn,\n GrowWidthOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n ClipIn,\n ClipOut,\n FromTo\n} from '@visactor/vrender-animate';\n\nimport type { ILineAnimationParams, LineAppearPreset } from '../series/line/interface';\nimport { linePresetAnimation } from '../series/line/animation';\nimport type { MarkAnimationSpec, ICartesianGroupAnimationParams } from './interface';\nimport { Factory } from '../core/factory';\nimport { Direction } from '../typings/space';\nimport { CallbackDisappearAnimate } from './callback-disappear';\nimport { BuiltIn_DISAPPEAR_ANIMATE_NAME } from '../constant/animate';\n\nexport const DEFAULT_ANIMATION_CONFIG = {\n appear: {\n duration: 1000,\n easing: 'cubicOut'\n },\n update: {\n type: 'update',\n duration: 300,\n easing: 'linear'\n },\n enter: {\n duration: 300,\n easing: 'linear'\n },\n exit: {\n duration: 300,\n easing: 'linear'\n },\n disappear: {\n duration: 500,\n easing: 'cubicIn'\n },\n state: {\n duration: 300,\n easing: 'linear'\n }\n};\n\nexport const ScaleInOutAnimation = {\n appear: { type: 'scaleIn' },\n enter: { type: 'scaleIn' },\n exit: { type: 'scaleOut' }\n};\n\nexport const FadeInOutAnimation = {\n appear: { type: 'fadeIn' },\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' }\n};\n\nexport const registerScaleInOutAnimation = () => {\n Factory.registerAnimation('scaleInOut', () => ScaleInOutAnimation);\n};\n\nexport const registerFadeInOutAnimation = () => {\n Factory.registerAnimation('fadeInOut', () => FadeInOutAnimation);\n};\n\nexport const registerCartesianGroupClipAnimation = () => {\n Factory.registerAnimation('cartesianGroupClip', (params?: ICartesianGroupAnimationParams) => {\n return {\n appear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'in',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n }\n };\n });\n};\n\nconst lineOrAreaAnimation = (params: ILineAnimationParams, preset: LineAppearPreset) => {\n return {\n appear: linePresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n update: [\n {\n type: 'update',\n options: { excludeChannels: ['points', 'defined', 'segments'] }\n },\n {\n channel: ['points', 'segments'],\n custom: TagPointsUpdate,\n duration: DEFAULT_ANIMATION_CONFIG.update.duration,\n easing: DEFAULT_ANIMATION_CONFIG.update.easing,\n customParameters: {\n clipRangeByDimension: params.direction === Direction.horizontal ? 'y' : 'x'\n }\n }\n ]\n } as MarkAnimationSpec;\n};\n\nexport const registerLineAnimation = () => {\n Factory.registerAnimation('line', lineOrAreaAnimation);\n};\n\nexport const registerAreaAnimation = () => {\n Factory.registerAnimation('area', lineOrAreaAnimation);\n};\n\nexport const registerBuiltInAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n};\n\nexport const registerRectAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n};\n\nexport const registerArcAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n};\n\nexport const registerLineOrAreaAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n};\n\nexport const registerPolygonAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n};\n\nexport const registerStageAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate(BuiltIn_DISAPPEAR_ANIMATE_NAME, CallbackDisappearAnimate);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ACustomAnimate } from '@visactor/vrender-animate';
|
|
2
|
-
import type { IGraphic, EasingType } from '@visactor/vrender-core';
|
|
1
|
+
import type { ACustomAnimate, AStageAnimate } from '@visactor/vrender-animate';
|
|
2
|
+
import type { IGraphic, EasingType, IStage } from '@visactor/vrender-core';
|
|
3
3
|
import type { IMark, IMarkGraphic } from '../mark/interface/common';
|
|
4
4
|
import type { BaseMark } from '../mark';
|
|
5
5
|
export declare enum AnimationStateEnum {
|
|
@@ -101,8 +101,11 @@ export interface IAnimationTimeline {
|
|
|
101
101
|
controlOptions?: IAnimationControlOptions;
|
|
102
102
|
}
|
|
103
103
|
export type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;
|
|
104
|
+
export type IStageAnimationCallback = (stage: IStage, canvas: HTMLCanvasElement, ratio: number, time: number) => void;
|
|
104
105
|
export interface MarkAnimationSpec {
|
|
105
|
-
disappear?: IAnimationConfig
|
|
106
|
+
disappear?: IAnimationConfig & {
|
|
107
|
+
callBack?: IStageAnimationCallback | AStageAnimate<any>;
|
|
108
|
+
};
|
|
106
109
|
appear?: IAnimationConfig | IAnimationConfig[];
|
|
107
110
|
enter?: IAnimationConfig | IAnimationConfig[];
|
|
108
111
|
exit?: IAnimationConfig | IAnimationConfig[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/animation/interface.ts"],"names":[],"mappings":";;;AAKA,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;IACvB,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uCAAiB,CAAA;IAEjB,mCAAa,CAAA;AACf,CAAC,EAVW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAU7B","file":"interface.js","sourcesContent":["import type { ACustomAnimate } from '@visactor/vrender-animate';\nimport type { IGraphic, EasingType } from '@visactor/vrender-core';\nimport type { IMark, IMarkGraphic } from '../mark/interface/common';\nimport type { BaseMark } from '../mark';\n\nexport enum AnimationStateEnum {\n appear = 'appear',\n disappear = 'disappear',\n enter = 'enter',\n update = 'update',\n state = 'state',\n exit = 'exit',\n normal = 'normal',\n // for hack\n none = 'none'\n}\n\nexport type IAnimationState = keyof typeof AnimationStateEnum;\n\nexport interface IAnimateState {\n animationState: { callback: (datum: any, element: any) => AnimationStateEnum };\n}\n\nexport interface ICartesianGroupAnimationParams {\n direction: () => 'x' | 'y';\n orient: () => 'positive' | 'negative';\n width: () => number;\n height: () => number;\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n g: IGraphic,\n parameters: IAnimationParameters\n) => boolean | void;\n\nexport type GraphicFunctionCallback<T> = (datum: any, g: IGraphic, params: any) => T;\n\nexport type GraphicFunctionValueType<T> = GraphicFunctionCallback<T> | T;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\nexport interface CommonAnimationConfigItem {\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n\n easing?: EasingType;\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n oneByOne?: GraphicFunctionValueType<boolean | number>;\n startTime?: GraphicFunctionValueType<number>;\n totalTime?: GraphicFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: GraphicFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n /** 该动画是否需要忽略子图元 */\n selfOnly?: boolean;\n}\n\nexport interface TypeAnimationConfig extends CommonAnimationConfigItem {\n type: string;\n}\n\nexport type IAnimationChannelFunction = (datum: any, g: IGraphic, mark: IMark) => any;\n\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\n\nexport interface ChannelAnimationConfig extends CommonAnimationConfigItem {\n channel: IAnimationChannelAttrs | string[];\n}\n\nexport type IAnimationTypeConfig = TypeAnimationConfig | ChannelAnimationConfig | CommonAnimationConfigItem;\n\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport type IAnimationEffect = {\n type?: string;\n channel?: IAnimationChannelAttrs | string[];\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n easing?: EasingType;\n options?: GraphicFunctionValueType<any>;\n};\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n}\n\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: GraphicFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: GraphicFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: GraphicFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: GraphicFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: GraphicFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, graphicA: IGraphic, graphicB: IGraphic) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\nexport interface MarkAnimationSpec {\n disappear?: IAnimationConfig |
|
|
1
|
+
{"version":3,"sources":["../src/animation/interface.ts"],"names":[],"mappings":";;;AAKA,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;IACvB,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uCAAiB,CAAA;IAEjB,mCAAa,CAAA;AACf,CAAC,EAVW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAU7B","file":"interface.js","sourcesContent":["import type { ACustomAnimate, AStageAnimate } from '@visactor/vrender-animate';\nimport type { IGraphic, EasingType, IStage } from '@visactor/vrender-core';\nimport type { IMark, IMarkGraphic } from '../mark/interface/common';\nimport type { BaseMark } from '../mark';\n\nexport enum AnimationStateEnum {\n appear = 'appear',\n disappear = 'disappear',\n enter = 'enter',\n update = 'update',\n state = 'state',\n exit = 'exit',\n normal = 'normal',\n // for hack\n none = 'none'\n}\n\nexport type IAnimationState = keyof typeof AnimationStateEnum;\n\nexport interface IAnimateState {\n animationState: { callback: (datum: any, element: any) => AnimationStateEnum };\n}\n\nexport interface ICartesianGroupAnimationParams {\n direction: () => 'x' | 'y';\n orient: () => 'positive' | 'negative';\n width: () => number;\n height: () => number;\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n g: IGraphic,\n parameters: IAnimationParameters\n) => boolean | void;\n\nexport type GraphicFunctionCallback<T> = (datum: any, g: IGraphic, params: any) => T;\n\nexport type GraphicFunctionValueType<T> = GraphicFunctionCallback<T> | T;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\nexport interface CommonAnimationConfigItem {\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n\n easing?: EasingType;\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n oneByOne?: GraphicFunctionValueType<boolean | number>;\n startTime?: GraphicFunctionValueType<number>;\n totalTime?: GraphicFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: GraphicFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n /** 该动画是否需要忽略子图元 */\n selfOnly?: boolean;\n}\n\nexport interface TypeAnimationConfig extends CommonAnimationConfigItem {\n type: string;\n}\n\nexport type IAnimationChannelFunction = (datum: any, g: IGraphic, mark: IMark) => any;\n\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\n\nexport interface ChannelAnimationConfig extends CommonAnimationConfigItem {\n channel: IAnimationChannelAttrs | string[];\n}\n\nexport type IAnimationTypeConfig = TypeAnimationConfig | ChannelAnimationConfig | CommonAnimationConfigItem;\n\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport type IAnimationEffect = {\n type?: string;\n channel?: IAnimationChannelAttrs | string[];\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n easing?: EasingType;\n options?: GraphicFunctionValueType<any>;\n};\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n}\n\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: GraphicFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: GraphicFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: GraphicFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: GraphicFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: GraphicFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, graphicA: IGraphic, graphicB: IGraphic) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\nexport type IStageAnimationCallback = (stage: IStage, canvas: HTMLCanvasElement, ratio: number, time: number) => void;\n\nexport interface MarkAnimationSpec {\n disappear?: IAnimationConfig & {\n callBack?: IStageAnimationCallback | AStageAnimate<any>;\n };\n appear?: IAnimationConfig | IAnimationConfig[];\n enter?: IAnimationConfig | IAnimationConfig[];\n exit?: IAnimationConfig | IAnimationConfig[];\n update?: IAnimationConfig | IAnimationConfig[];\n normal?: IAnimationConfig | IAnimationConfig[];\n state?: IStateAnimationConfig;\n}\n\nexport type MarkAnimationType = keyof MarkAnimationSpec;\n\n/**\n * 动画拆分策略接口\n * 用于定义如何拆分一个动画更新为多个步骤\n */\nexport interface IAnimationSplitStrategy {\n /**\n * 策略名称\n */\n name: string;\n\n /**\n * 检查是否应该应用此策略\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 是否应用此策略\n */\n shouldApply: (mark: BaseMark<any>, graphic: IMarkGraphic) => boolean;\n\n /**\n * 拆分动画更新\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 拆分后的动画更新数组(每个元素包含一组属性和执行顺序)\n */\n split: (\n mark: BaseMark<any>,\n graphic: IMarkGraphic\n ) => Array<{\n attrs: Record<string, any>;\n order: number;\n }>;\n}\n"]}
|
|
@@ -62,6 +62,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
62
62
|
created(transformer: Maybe<IChartSpecTransformer>): void;
|
|
63
63
|
_initInteractions(): void;
|
|
64
64
|
init(): void;
|
|
65
|
+
initStageAnimation(): void;
|
|
65
66
|
reDataFlow(): void;
|
|
66
67
|
onResize(width: number, height: number, reRender?: boolean): void;
|
|
67
68
|
updateViewBox(viewBox: IBoundsLike, reLayout: boolean): void;
|
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
14
14
|
value: !0
|
|
15
15
|
}), exports.BaseChart = void 0;
|
|
16
16
|
|
|
17
|
-
const data_1 = require("../chart-meta/data"), global_scale_1 = require("../../scale/global-scale"), interface_1 = require("../../component/interface"), factory_1 = require("../../core/factory"), event_1 = require("../../event/event"), util_1 = require("../../util"), base_model_1 = require("../../model/base-model"), base_mark_1 = require("../../mark/base/base-mark"), base_1 = require("../../constant/base"), vutils_1 = require("@visactor/vutils"), util_2 = require("../../theme/color-scheme/util"), compilable_base_1 = require("../../compile/compilable-base"), interface_2 = require("../../compile/mark/interface"), event_2 = require("../../constant/event"), interface_3 = require("../../event/events/dimension/interface"), util_3 = require("../util"), vscale_1 = require("@visactor/vscale"), initialize_1 = require("../../data/initialize"), layout_1 = require("../../constant/layout"), interaction_1 = require("../../interaction/interaction");
|
|
17
|
+
const data_1 = require("../chart-meta/data"), global_scale_1 = require("../../scale/global-scale"), interface_1 = require("../../component/interface"), factory_1 = require("../../core/factory"), event_1 = require("../../event/event"), util_1 = require("../../util"), base_model_1 = require("../../model/base-model"), base_mark_1 = require("../../mark/base/base-mark"), base_1 = require("../../constant/base"), vutils_1 = require("@visactor/vutils"), util_2 = require("../../theme/color-scheme/util"), compilable_base_1 = require("../../compile/compilable-base"), interface_2 = require("../../compile/mark/interface"), event_2 = require("../../constant/event"), interface_3 = require("../../event/events/dimension/interface"), util_3 = require("../util"), vscale_1 = require("@visactor/vscale"), initialize_1 = require("../../data/initialize"), layout_1 = require("../../constant/layout"), interaction_1 = require("../../interaction/interaction"), utils_1 = require("../../animation/utils");
|
|
18
18
|
|
|
19
19
|
class BaseChart extends compilable_base_1.CompilableBase {
|
|
20
20
|
getSpec() {
|
|
@@ -155,7 +155,12 @@ class BaseChart extends compilable_base_1.CompilableBase {
|
|
|
155
155
|
this._series.forEach((s => s.init({}))), this._components.forEach((c => c.init({
|
|
156
156
|
dataSet: this._dataSet
|
|
157
157
|
}))), this._initEvent(), null === (_d = this._initStack) || void 0 === _d || _d.call(this),
|
|
158
|
-
this.reDataFlow(), this._initInteractions();
|
|
158
|
+
this.reDataFlow(), this._initInteractions(), this.initStageAnimation();
|
|
159
|
+
}
|
|
160
|
+
initStageAnimation() {
|
|
161
|
+
const compiler = this._option.getCompiler();
|
|
162
|
+
(null == compiler ? void 0 : compiler.setStageAnimationConfig) && compiler.setStageAnimationConfig((0,
|
|
163
|
+
utils_1.animationConfig)({}, (0, utils_1.userAnimationConfig)("stage", this._spec, {}), null));
|
|
159
164
|
}
|
|
160
165
|
reDataFlow() {
|
|
161
166
|
this._series.forEach((s => {
|