@visactor/vseed 0.4.28 → 0.5.1
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/dist/cjs/index.cjs +2 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/builder/builder/advanced/colorItems.d.ts +1 -0
- package/dist/esm/builder/builder/advanced/colorItems.js +21 -1
- package/dist/esm/builder/builder/advanced/colorItems.js.map +1 -1
- package/dist/esm/builder/builder/buildSpec.js.map +1 -1
- package/dist/esm/builder/builder/builder.d.ts +4 -0
- package/dist/esm/builder/builder/builder.js +2 -1
- package/dist/esm/builder/builder/builder.js.map +1 -1
- package/dist/esm/dataSelector/selector.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +2 -1
- package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
- package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.d.ts +15 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js +94 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.d.ts +77 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js +88 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/index.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/index.js +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.d.ts +254 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js +138 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.d.ts +71 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js +176 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.d.ts +131 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js +46 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.d.ts +102 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js +57 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.d.ts +130 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.js +19 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/types.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.d.ts +11 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js +13 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.d.ts +52 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js +51 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.d.ts +102 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js +84 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.d.ts +66 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js +72 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.d.ts +86 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js +60 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.d.ts +29 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js +20 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.d.ts +14 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js +9 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.d.ts +69 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js +59 -0
- package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js.map +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationArea.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationAreaBand.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +63 -18
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js +7 -13
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationHorizontalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js +2 -2
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js +9 -15
- package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationVerticalLine.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.d.ts +2 -0
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js +15 -1
- package/dist/esm/pipeline/spec/chart/pipes/annotation/utils.js.map +1 -1
- package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
- package/dist/esm/pipeline/utils/sandbox/execute.js.map +1 -1
- package/dist/esm/theme/tokenTheme.d.ts +6 -0
- package/dist/esm/theme/tokenTheme.js +36 -7
- package/dist/esm/theme/tokenTheme.js.map +1 -1
- package/dist/esm/types/builder/builder.d.ts +1 -0
- package/dist/esm/types/builder/builder.js.map +1 -1
- package/dist/esm/types/chartType/area/area.d.ts +6 -1
- package/dist/esm/types/chartType/area/zArea.d.ts +50 -0
- package/dist/esm/types/chartType/area/zArea.js +2 -1
- package/dist/esm/types/chartType/area/zArea.js.map +1 -1
- package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +40 -0
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
- package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
- package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
- package/dist/esm/types/chartType/bar/zBar.d.ts +50 -0
- package/dist/esm/types/chartType/bar/zBar.js +2 -1
- package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
- package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +50 -0
- package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
- package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
- package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +40 -0
- package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
- package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
- package/dist/esm/types/chartType/column/column.d.ts +6 -1
- package/dist/esm/types/chartType/column/zColumn.d.ts +50 -0
- package/dist/esm/types/chartType/column/zColumn.js +2 -1
- package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
- package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +50 -0
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
- package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
- package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +40 -0
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
- package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
- package/dist/esm/types/chartType/donut/donut.d.ts +6 -1
- package/dist/esm/types/chartType/donut/zDonut.d.ts +40 -0
- package/dist/esm/types/chartType/donut/zDonut.js +2 -1
- package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
- package/dist/esm/types/chartType/line/line.d.ts +6 -1
- package/dist/esm/types/chartType/line/zLine.d.ts +50 -0
- package/dist/esm/types/chartType/line/zLine.js +2 -1
- package/dist/esm/types/chartType/line/zLine.js.map +1 -1
- package/dist/esm/types/chartType/pie/pie.d.ts +6 -1
- package/dist/esm/types/chartType/pie/zPie.d.ts +40 -0
- package/dist/esm/types/chartType/pie/zPie.js +2 -1
- package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
- package/dist/esm/types/chartType/radar/radar.d.ts +6 -1
- package/dist/esm/types/chartType/radar/zRadar.d.ts +40 -0
- package/dist/esm/types/chartType/radar/zRadar.js +2 -1
- package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
- package/dist/esm/types/chartType/rose/rose.d.ts +6 -1
- package/dist/esm/types/chartType/rose/zRose.d.ts +40 -0
- package/dist/esm/types/chartType/rose/zRose.js +2 -1
- package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
- package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +6 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +40 -0
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +2 -1
- package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
- package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
- package/dist/esm/types/chartType/scatter/zScatter.d.ts +40 -0
- package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
- package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
- package/dist/esm/types/properties/annotation/annotation.d.ts +10 -0
- package/dist/esm/types/properties/annotation/annotationDifferenceLine.d.ts +4 -0
- package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.d.ts +5 -0
- package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js +6 -1
- package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js.map +1 -1
- package/dist/esm/types/properties/config/animation/animation.d.ts +72 -0
- package/dist/esm/types/properties/config/animation/animation.js +0 -0
- package/dist/esm/types/properties/config/animation/animationAtmosphere.d.ts +15 -0
- package/dist/esm/types/properties/config/animation/animationAtmosphere.js +0 -0
- package/dist/esm/types/properties/config/animation/animationConfig.d.ts +2 -0
- package/dist/esm/types/properties/config/animation/animationConfig.js +0 -0
- package/dist/esm/types/properties/config/animation/animationEffect.d.ts +72 -0
- package/dist/esm/types/properties/config/animation/animationEffect.js +0 -0
- package/dist/esm/types/properties/config/animation/animationLoop.d.ts +49 -0
- package/dist/esm/types/properties/config/animation/animationLoop.js +0 -0
- package/dist/esm/types/properties/config/animation/index.d.ts +6 -0
- package/dist/esm/types/properties/config/animation/index.js +1 -0
- package/dist/esm/types/properties/config/animation/zAnimation.d.ts +201 -0
- package/dist/esm/types/properties/config/animation/zAnimation.js +114 -0
- package/dist/esm/types/properties/config/animation/zAnimation.js.map +1 -0
- package/dist/esm/types/properties/config/annotation/annotation.d.ts +32 -5
- package/dist/esm/types/properties/config/annotation/zAnnotation.d.ts +30 -4
- package/dist/esm/types/properties/config/annotation/zAnnotation.js +11 -1
- package/dist/esm/types/properties/config/annotation/zAnnotation.js.map +1 -1
- package/dist/esm/types/properties/config/area.d.ts +110 -4
- package/dist/esm/types/properties/config/area.js +3 -1
- package/dist/esm/types/properties/config/area.js.map +1 -1
- package/dist/esm/types/properties/config/bar.d.ts +165 -6
- package/dist/esm/types/properties/config/bar.js +3 -1
- package/dist/esm/types/properties/config/bar.js.map +1 -1
- package/dist/esm/types/properties/config/boxplot.d.ts +15 -2
- package/dist/esm/types/properties/config/column.d.ts +165 -6
- package/dist/esm/types/properties/config/column.js +3 -1
- package/dist/esm/types/properties/config/column.js.map +1 -1
- package/dist/esm/types/properties/config/config.d.ts +1125 -38
- package/dist/esm/types/properties/config/dualAxis.d.ts +15 -2
- package/dist/esm/types/properties/config/histogram.d.ts +15 -2
- package/dist/esm/types/properties/config/index.d.ts +1 -0
- package/dist/esm/types/properties/config/index.js +1 -0
- package/dist/esm/types/properties/config/line.d.ts +55 -2
- package/dist/esm/types/properties/config/line.js +3 -1
- package/dist/esm/types/properties/config/line.js.map +1 -1
- package/dist/esm/types/properties/config/pie.d.ts +120 -0
- package/dist/esm/types/properties/config/pie.js +6 -2
- package/dist/esm/types/properties/config/pie.js.map +1 -1
- package/dist/esm/types/properties/config/race.d.ts +330 -12
- package/dist/esm/types/properties/config/rose.d.ts +80 -0
- package/dist/esm/types/properties/config/rose.js +3 -1
- package/dist/esm/types/properties/config/rose.js.map +1 -1
- package/dist/esm/types/properties/config/scatter.d.ts +55 -2
- package/dist/esm/types/properties/config/scatter.js +3 -1
- package/dist/esm/types/properties/config/scatter.js.map +1 -1
- package/dist/esm/types/properties/theme/customTheme.d.ts +2250 -76
- package/dist/umd/index.js +5152 -689
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -9
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { BarLikeAppearConfig, BarLikeLoopConfig, BarLikeUpdateConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 柱图/条形图 入场动画
|
|
4
|
+
* 动画类型:
|
|
5
|
+
* 1. growth: 生长动画
|
|
6
|
+
* 效果:横向柱使用宽度增长, 纵向柱使用高度增长。
|
|
7
|
+
* 编排逻辑:仅作用于 bar mark, 使用 appear 的 easing 和 duration。
|
|
8
|
+
* 2. load: 加载动画
|
|
9
|
+
* 效果:使用逐个淡入, 让柱子按图元顺序出现。
|
|
10
|
+
* 编排逻辑:仅作用于 bar mark, 使用 appear 的 easing 和 duration。
|
|
11
|
+
* 3. 其他: 默认入场动画
|
|
12
|
+
* 效果:不指定额外动画 type, 交给 VChart 默认入场补间。
|
|
13
|
+
* 编排逻辑:仅保留 easing 和 duration。
|
|
14
|
+
*/
|
|
15
|
+
export declare const barAppear: (config: BarLikeAppearConfig | undefined, chartType: string) => false | {
|
|
16
|
+
bar: {
|
|
17
|
+
easing: string | undefined;
|
|
18
|
+
duration: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 柱图/条形图 更新动画
|
|
23
|
+
* 动画类型:
|
|
24
|
+
* 1. moveIn: 移入动画
|
|
25
|
+
* 效果:update 阶段沿柱图方向从画布外移入。
|
|
26
|
+
* 编排逻辑:复用移入方向, 但不再补随机 dataKey, 只作用于 bar mark。
|
|
27
|
+
* 2. 其他: 默认更新动画
|
|
28
|
+
* 效果:使用 VChart 默认更新补间。
|
|
29
|
+
* 编排逻辑:只保留 easing 和 duration, 不影响轴、标签等其他组件。
|
|
30
|
+
*/
|
|
31
|
+
export declare const barUpdate: (config: BarLikeUpdateConfig | undefined, chartType: string, spec?: any) => false | {
|
|
32
|
+
bar: {
|
|
33
|
+
easing: string | undefined;
|
|
34
|
+
duration: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 柱图/条形图 循环动画
|
|
39
|
+
* 动画类型:
|
|
40
|
+
* 1. highLight: 分组高亮动画
|
|
41
|
+
* 效果:按类目分组依次切换高亮填充和描边。
|
|
42
|
+
* 编排逻辑:startTime = appear 存在 ? interval : 0, loopDuration = groupDuration * groupCount + stopDuration, 一轮结束后等待 interval。
|
|
43
|
+
* 2. growth/moveIn/load: mark 循环动画
|
|
44
|
+
* 效果:复用对应的柱图 mark 动画。
|
|
45
|
+
* 编排逻辑:先执行 loopDuration, 再等待 interval + atmosphereDuration 后重复。
|
|
46
|
+
* 3. atmosphere: 流光氛围动画
|
|
47
|
+
* 效果:使用 StreamLight 在柱子上形成流光。
|
|
48
|
+
* 编排逻辑:延迟 loopDuration 后启动, 持续 atmosphereDuration, 一轮结束后等待 interval。
|
|
49
|
+
*/
|
|
50
|
+
export declare const barLoop: (config: BarLikeLoopConfig | undefined, ignoreFirstNormal: boolean, chartType: string, spec?: any) => false | {
|
|
51
|
+
bar: any[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* 柱图/条形图 离场动画
|
|
55
|
+
* 动画类型:
|
|
56
|
+
* 1. moveIn: 反向移出动画
|
|
57
|
+
* 效果:沿柱图进入方向反向移出画布。
|
|
58
|
+
* 编排逻辑:只有 update 效果为 moveIn 时才补充 moveOut。
|
|
59
|
+
* 2. 其他: 默认离场动画
|
|
60
|
+
* 效果:不配置自定义 exit。
|
|
61
|
+
* 编排逻辑:返回空配置, 由 VChart 默认行为处理。
|
|
62
|
+
*/
|
|
63
|
+
export declare const barExit: (config: BarLikeUpdateConfig | undefined, chartType: string) => false | {
|
|
64
|
+
bar?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
bar: {
|
|
67
|
+
duration: number;
|
|
68
|
+
type: string;
|
|
69
|
+
options: {
|
|
70
|
+
direction: string;
|
|
71
|
+
orient: string;
|
|
72
|
+
point: (_datum: any, element: any, opt: any) => {
|
|
73
|
+
[x: string]: any;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { StreamLight } from "@visactor/vchart";
|
|
2
|
+
import { VScreenAnimationType } from "./types.js";
|
|
3
|
+
import { allowAnimation, getPrimaryEffect, toMs } from "./utils/index.js";
|
|
4
|
+
import { fadeInBar, getGroupCountFromSpec, getLoopResult, groupHighLightBar, growBar, isHorizontalBar, moveInBar, moveOutBar, transform2VChartColor } from "./utils/bar.js";
|
|
5
|
+
const barAppear = (config, chartType)=>{
|
|
6
|
+
if (!allowAnimation(config)) return false;
|
|
7
|
+
const effect = getPrimaryEffect(config);
|
|
8
|
+
const configByType = effect === VScreenAnimationType.growth ? growBar(chartType) : effect === VScreenAnimationType.load ? fadeInBar() : {};
|
|
9
|
+
return {
|
|
10
|
+
bar: {
|
|
11
|
+
...configByType,
|
|
12
|
+
easing: config?.ease,
|
|
13
|
+
duration: toMs(config?.duration ?? 1)
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const barUpdate = (config, chartType, spec)=>{
|
|
18
|
+
if (!allowAnimation(config)) return false;
|
|
19
|
+
const effect = getPrimaryEffect(config);
|
|
20
|
+
const configByType = effect === VScreenAnimationType.moveIn ? moveInBar(chartType, spec, true) : {};
|
|
21
|
+
return {
|
|
22
|
+
bar: {
|
|
23
|
+
...configByType,
|
|
24
|
+
easing: config?.ease,
|
|
25
|
+
duration: toMs(config?.duration ?? 1)
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const barLoop = (config, ignoreFirstNormal, chartType, spec)=>{
|
|
30
|
+
if (!config?.enable) return false;
|
|
31
|
+
const interval = config.interval ?? 0;
|
|
32
|
+
const startTime = ignoreFirstNormal ? toMs(interval) : 0;
|
|
33
|
+
const loop = config.loop;
|
|
34
|
+
const atmosphere = config.atmosphere;
|
|
35
|
+
const loopEffect = getPrimaryEffect(loop);
|
|
36
|
+
const result = [];
|
|
37
|
+
let loopDuration = loopEffect === VScreenAnimationType.none ? 0 : 1;
|
|
38
|
+
const atmosphereDuration = loopEffect === VScreenAnimationType.none ? 2 : 1;
|
|
39
|
+
if (loopEffect === VScreenAnimationType.highLight && loop) {
|
|
40
|
+
const groupDuration = 0.7;
|
|
41
|
+
const stopDuration = 0.85;
|
|
42
|
+
loopDuration = groupDuration * getGroupCountFromSpec(spec).groupCount + stopDuration;
|
|
43
|
+
result.push(...groupHighLightBar(startTime, loop, loopDuration, interval, atmosphereDuration, isHorizontalBar(chartType), spec));
|
|
44
|
+
} else if (loop) result.push({
|
|
45
|
+
...getLoopResult(loopEffect, chartType, spec),
|
|
46
|
+
startTime,
|
|
47
|
+
easing: loop.ease,
|
|
48
|
+
duration: toMs(loopDuration),
|
|
49
|
+
delayAfter: toMs(interval + atmosphereDuration),
|
|
50
|
+
loop: true,
|
|
51
|
+
controlOptions: {
|
|
52
|
+
immediatelyApply: false
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
if (atmosphere?.ease || atmosphere?.color) result.push({
|
|
56
|
+
loop: true,
|
|
57
|
+
startTime,
|
|
58
|
+
delay: toMs(loopDuration),
|
|
59
|
+
delayAfter: toMs(interval),
|
|
60
|
+
duration: toMs(atmosphereDuration),
|
|
61
|
+
easing: atmosphere.ease,
|
|
62
|
+
custom: StreamLight,
|
|
63
|
+
customParameters: {
|
|
64
|
+
isHorizontal: isHorizontalBar(chartType),
|
|
65
|
+
attribute: {
|
|
66
|
+
fill: transform2VChartColor(atmosphere.color),
|
|
67
|
+
blur: 0,
|
|
68
|
+
shadowColor: 'rgba(0,0,0,0)'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return result.length > 0 ? {
|
|
73
|
+
bar: result
|
|
74
|
+
} : false;
|
|
75
|
+
};
|
|
76
|
+
const barExit = (config, chartType)=>{
|
|
77
|
+
if (!allowAnimation(config)) return false;
|
|
78
|
+
if (getPrimaryEffect(config) !== VScreenAnimationType.moveIn) return {};
|
|
79
|
+
return {
|
|
80
|
+
bar: {
|
|
81
|
+
...moveOutBar(chartType),
|
|
82
|
+
duration: 1000
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export { barAppear, barExit, barLoop, barUpdate };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/bar.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/bar.ts"],"sourcesContent":["import { StreamLight } from '@visactor/vchart'\nimport type { BarLikeAppearConfig, BarLikeLoopConfig, BarLikeUpdateConfig } from './types'\nimport { VScreenAnimationType } from './types'\nimport { allowAnimation, getPrimaryEffect, toMs } from './utils'\nimport {\n fadeInBar,\n getGroupCountFromSpec,\n getLoopResult,\n groupHighLightBar,\n growBar,\n isHorizontalBar,\n moveInBar,\n moveOutBar,\n transform2VChartColor,\n} from './utils/bar'\n\n/**\n * 柱图/条形图 入场动画\n * 动画类型:\n * 1. growth: 生长动画\n * 效果:横向柱使用宽度增长, 纵向柱使用高度增长。\n * 编排逻辑:仅作用于 bar mark, 使用 appear 的 easing 和 duration。\n * 2. load: 加载动画\n * 效果:使用逐个淡入, 让柱子按图元顺序出现。\n * 编排逻辑:仅作用于 bar mark, 使用 appear 的 easing 和 duration。\n * 3. 其他: 默认入场动画\n * 效果:不指定额外动画 type, 交给 VChart 默认入场补间。\n * 编排逻辑:仅保留 easing 和 duration。\n */\nexport const barAppear = (config: BarLikeAppearConfig | undefined, chartType: string) => {\n if (!allowAnimation(config)) return false\n const effect = getPrimaryEffect(config)\n const configByType =\n effect === VScreenAnimationType.growth\n ? growBar(chartType)\n : effect === VScreenAnimationType.load\n ? fadeInBar()\n : {}\n return { bar: { ...configByType, easing: config?.ease, duration: toMs(config?.duration ?? 1) } }\n}\n\n/**\n * 柱图/条形图 更新动画\n * 动画类型:\n * 1. moveIn: 移入动画\n * 效果:update 阶段沿柱图方向从画布外移入。\n * 编排逻辑:复用移入方向, 但不再补随机 dataKey, 只作用于 bar mark。\n * 2. 其他: 默认更新动画\n * 效果:使用 VChart 默认更新补间。\n * 编排逻辑:只保留 easing 和 duration, 不影响轴、标签等其他组件。\n */\nexport const barUpdate = (config: BarLikeUpdateConfig | undefined, chartType: string, spec?: any) => {\n if (!allowAnimation(config)) return false\n const effect = getPrimaryEffect(config)\n const configByType = effect === VScreenAnimationType.moveIn ? moveInBar(chartType, spec, true) : {}\n return { bar: { ...configByType, easing: config?.ease, duration: toMs(config?.duration ?? 1) } }\n}\n\n/**\n * 柱图/条形图 循环动画\n * 动画类型:\n * 1. highLight: 分组高亮动画\n * 效果:按类目分组依次切换高亮填充和描边。\n * 编排逻辑:startTime = appear 存在 ? interval : 0, loopDuration = groupDuration * groupCount + stopDuration, 一轮结束后等待 interval。\n * 2. growth/moveIn/load: mark 循环动画\n * 效果:复用对应的柱图 mark 动画。\n * 编排逻辑:先执行 loopDuration, 再等待 interval + atmosphereDuration 后重复。\n * 3. atmosphere: 流光氛围动画\n * 效果:使用 StreamLight 在柱子上形成流光。\n * 编排逻辑:延迟 loopDuration 后启动, 持续 atmosphereDuration, 一轮结束后等待 interval。\n */\nexport const barLoop = (\n config: BarLikeLoopConfig | undefined,\n ignoreFirstNormal: boolean,\n chartType: string,\n spec?: any,\n) => {\n if (!config?.enable) return false\n const interval = config.interval ?? 0\n const startTime = ignoreFirstNormal ? toMs(interval) : 0\n const loop = config.loop\n const atmosphere = config.atmosphere\n const loopEffect = getPrimaryEffect(loop)\n const result: any[] = []\n let loopDuration = loopEffect === VScreenAnimationType.none ? 0 : 1\n const atmosphereDuration = loopEffect === VScreenAnimationType.none ? 2 : 1\n\n if (loopEffect === VScreenAnimationType.highLight && loop) {\n const groupDuration = 0.7\n const stopDuration = 0.85\n loopDuration = groupDuration * getGroupCountFromSpec(spec).groupCount + stopDuration\n result.push(\n ...groupHighLightBar(\n startTime,\n loop,\n loopDuration,\n interval,\n atmosphereDuration,\n isHorizontalBar(chartType),\n spec,\n ),\n )\n } else if (loop) {\n result.push({\n ...getLoopResult(loopEffect, chartType, spec),\n startTime,\n easing: loop.ease,\n duration: toMs(loopDuration),\n delayAfter: toMs(interval + atmosphereDuration),\n loop: true,\n controlOptions: { immediatelyApply: false },\n })\n }\n\n if (atmosphere?.ease || atmosphere?.color) {\n result.push({\n loop: true,\n startTime,\n delay: toMs(loopDuration),\n delayAfter: toMs(interval),\n duration: toMs(atmosphereDuration),\n easing: atmosphere.ease,\n custom: StreamLight,\n customParameters: {\n isHorizontal: isHorizontalBar(chartType),\n attribute: {\n fill: transform2VChartColor(atmosphere.color),\n blur: 0,\n shadowColor: 'rgba(0,0,0,0)',\n },\n },\n })\n }\n\n return result.length > 0 ? { bar: result } : false\n}\n\n/**\n * 柱图/条形图 离场动画\n * 动画类型:\n * 1. moveIn: 反向移出动画\n * 效果:沿柱图进入方向反向移出画布。\n * 编排逻辑:只有 update 效果为 moveIn 时才补充 moveOut。\n * 2. 其他: 默认离场动画\n * 效果:不配置自定义 exit。\n * 编排逻辑:返回空配置, 由 VChart 默认行为处理。\n */\nexport const barExit = (config: BarLikeUpdateConfig | undefined, chartType: string) => {\n if (!allowAnimation(config)) return false\n if (getPrimaryEffect(config) !== VScreenAnimationType.moveIn) return {}\n return { bar: { ...moveOutBar(chartType), duration: 1000 } }\n}\n"],"names":["barAppear","config","chartType","allowAnimation","effect","getPrimaryEffect","configByType","VScreenAnimationType","growBar","fadeInBar","toMs","barUpdate","spec","moveInBar","barLoop","ignoreFirstNormal","interval","startTime","loop","atmosphere","loopEffect","result","loopDuration","atmosphereDuration","groupDuration","stopDuration","getGroupCountFromSpec","groupHighLightBar","isHorizontalBar","getLoopResult","StreamLight","transform2VChartColor","barExit","moveOutBar"],"mappings":";;;;AA6BO,MAAMA,YAAY,CAACC,QAAyCC;IACjE,IAAI,CAACC,eAAeF,SAAS,OAAO;IACpC,MAAMG,SAASC,iBAAiBJ;IAChC,MAAMK,eACJF,WAAWG,qBAAqB,MAAM,GAClCC,QAAQN,aACRE,WAAWG,qBAAqB,IAAI,GAClCE,cACA,CAAC;IACT,OAAO;QAAE,KAAK;YAAE,GAAGH,YAAY;YAAE,QAAQL,QAAQ;YAAM,UAAUS,KAAKT,QAAQ,YAAY;QAAG;IAAE;AACjG;AAYO,MAAMU,YAAY,CAACV,QAAyCC,WAAmBU;IACpF,IAAI,CAACT,eAAeF,SAAS,OAAO;IACpC,MAAMG,SAASC,iBAAiBJ;IAChC,MAAMK,eAAeF,WAAWG,qBAAqB,MAAM,GAAGM,UAAUX,WAAWU,MAAM,QAAQ,CAAC;IAClG,OAAO;QAAE,KAAK;YAAE,GAAGN,YAAY;YAAE,QAAQL,QAAQ;YAAM,UAAUS,KAAKT,QAAQ,YAAY;QAAG;IAAE;AACjG;AAeO,MAAMa,UAAU,CACrBb,QACAc,mBACAb,WACAU;IAEA,IAAI,CAACX,QAAQ,QAAQ,OAAO;IAC5B,MAAMe,WAAWf,OAAO,QAAQ,IAAI;IACpC,MAAMgB,YAAYF,oBAAoBL,KAAKM,YAAY;IACvD,MAAME,OAAOjB,OAAO,IAAI;IACxB,MAAMkB,aAAalB,OAAO,UAAU;IACpC,MAAMmB,aAAaf,iBAAiBa;IACpC,MAAMG,SAAgB,EAAE;IACxB,IAAIC,eAAeF,eAAeb,qBAAqB,IAAI,GAAG,IAAI;IAClE,MAAMgB,qBAAqBH,eAAeb,qBAAqB,IAAI,GAAG,IAAI;IAE1E,IAAIa,eAAeb,qBAAqB,SAAS,IAAIW,MAAM;QACzD,MAAMM,gBAAgB;QACtB,MAAMC,eAAe;QACrBH,eAAeE,gBAAgBE,sBAAsBd,MAAM,UAAU,GAAGa;QACxEJ,OAAO,IAAI,IACNM,kBACDV,WACAC,MACAI,cACAN,UACAO,oBACAK,gBAAgB1B,YAChBU;IAGN,OAAO,IAAIM,MACTG,OAAO,IAAI,CAAC;QACV,GAAGQ,cAAcT,YAAYlB,WAAWU,KAAK;QAC7CK;QACA,QAAQC,KAAK,IAAI;QACjB,UAAUR,KAAKY;QACf,YAAYZ,KAAKM,WAAWO;QAC5B,MAAM;QACN,gBAAgB;YAAE,kBAAkB;QAAM;IAC5C;IAGF,IAAIJ,YAAY,QAAQA,YAAY,OAClCE,OAAO,IAAI,CAAC;QACV,MAAM;QACNJ;QACA,OAAOP,KAAKY;QACZ,YAAYZ,KAAKM;QACjB,UAAUN,KAAKa;QACf,QAAQJ,WAAW,IAAI;QACvB,QAAQW;QACR,kBAAkB;YAChB,cAAcF,gBAAgB1B;YAC9B,WAAW;gBACT,MAAM6B,sBAAsBZ,WAAW,KAAK;gBAC5C,MAAM;gBACN,aAAa;YACf;QACF;IACF;IAGF,OAAOE,OAAO,MAAM,GAAG,IAAI;QAAE,KAAKA;IAAO,IAAI;AAC/C;AAYO,MAAMW,UAAU,CAAC/B,QAAyCC;IAC/D,IAAI,CAACC,eAAeF,SAAS,OAAO;IACpC,IAAII,iBAAiBJ,YAAYM,qBAAqB,MAAM,EAAE,OAAO,CAAC;IACtE,OAAO;QAAE,KAAK;YAAE,GAAG0B,WAAW/B,UAAU;YAAE,UAAU;QAAK;IAAE;AAC7D"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { LineAreaAppearConfig, LineAreaLoopConfig, LineAreaUpdateConfig } from './types';
|
|
2
|
+
import { StreamLight } from '@visactor/vchart';
|
|
3
|
+
/**
|
|
4
|
+
* 折线图/面积图/百分比面积图 入场动画
|
|
5
|
+
* 动画类型:
|
|
6
|
+
* 1. growth: 生长动画
|
|
7
|
+
* 效果:line/area 使用路径增长, point 使用顶部移入。
|
|
8
|
+
* 编排逻辑:line、area、point 共用 appear 的 easing 和 duration。
|
|
9
|
+
* 2. load: 加载动画
|
|
10
|
+
* 效果:line/area 使用整体裁剪进入, point 不额外配置进入方式。
|
|
11
|
+
* 编排逻辑:line、area、point 共用 appear 的 easing 和 duration。
|
|
12
|
+
*/
|
|
13
|
+
export declare const lineOrAreaAppear: (config: LineAreaAppearConfig | undefined) => false | {
|
|
14
|
+
line: {
|
|
15
|
+
easing: string | undefined;
|
|
16
|
+
duration: number;
|
|
17
|
+
};
|
|
18
|
+
area: {
|
|
19
|
+
easing: string | undefined;
|
|
20
|
+
duration: number;
|
|
21
|
+
};
|
|
22
|
+
point: {
|
|
23
|
+
easing: string | undefined;
|
|
24
|
+
duration: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 折线图/面积图/百分比面积图 循环动画
|
|
29
|
+
* 动画类型:
|
|
30
|
+
* 1. growth/load: 线面 loop 动画
|
|
31
|
+
* 效果:line/area 执行路径增长或整体裁剪。
|
|
32
|
+
* 编排逻辑:startTime = appear 存在 ? interval : 0, 有 loop 时 loopDuration = 1s, 执行后等待 interval + atmosphereDuration。
|
|
33
|
+
* 2. atmosphere: 线面流光氛围动画
|
|
34
|
+
* 效果:line/area 使用 StreamLight 形成流光。
|
|
35
|
+
* 编排逻辑:延迟 loopDuration 后启动, 持续 atmosphereDuration, 一轮结束后等待 interval。
|
|
36
|
+
* 3. atmospherePoint: 点氛围动画
|
|
37
|
+
* 效果:point 执行 breath/reveal/ripple 等氛围效果。
|
|
38
|
+
* 编排逻辑:和整轮时间线同步, 一轮结束后等待 interval + atmosphereDuration。
|
|
39
|
+
*/
|
|
40
|
+
export declare const lineOrAreaLoop: (config: LineAreaLoopConfig | undefined, ignoreFirstNormal: boolean) => false | {
|
|
41
|
+
line: ({
|
|
42
|
+
loop: boolean;
|
|
43
|
+
startTime: number;
|
|
44
|
+
delay: number;
|
|
45
|
+
delayAfter: number;
|
|
46
|
+
duration: number;
|
|
47
|
+
easing: string | undefined;
|
|
48
|
+
custom: typeof StreamLight;
|
|
49
|
+
customParameters: (...args: any[]) => {
|
|
50
|
+
streamLength: number;
|
|
51
|
+
attribute: {
|
|
52
|
+
stroke: string | {
|
|
53
|
+
gradient: string;
|
|
54
|
+
x0: number;
|
|
55
|
+
x1: number;
|
|
56
|
+
y1: number;
|
|
57
|
+
y0: number;
|
|
58
|
+
stops: {
|
|
59
|
+
offset: number;
|
|
60
|
+
color: string;
|
|
61
|
+
}[];
|
|
62
|
+
} | undefined;
|
|
63
|
+
strokeOpacity: number;
|
|
64
|
+
lineWidth: any;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
startTime: number;
|
|
69
|
+
easing: string;
|
|
70
|
+
duration: number;
|
|
71
|
+
delayAfter: number;
|
|
72
|
+
loop: boolean;
|
|
73
|
+
controlOptions: {
|
|
74
|
+
immediatelyApply: boolean;
|
|
75
|
+
};
|
|
76
|
+
type: string;
|
|
77
|
+
options: {
|
|
78
|
+
orient: string;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
startTime: number;
|
|
82
|
+
easing: string;
|
|
83
|
+
duration: number;
|
|
84
|
+
delayAfter: number;
|
|
85
|
+
loop: boolean;
|
|
86
|
+
controlOptions: {
|
|
87
|
+
immediatelyApply: boolean;
|
|
88
|
+
};
|
|
89
|
+
type: string;
|
|
90
|
+
oneByOne: boolean;
|
|
91
|
+
})[];
|
|
92
|
+
area: ({
|
|
93
|
+
loop: boolean;
|
|
94
|
+
startTime: number;
|
|
95
|
+
delay: number;
|
|
96
|
+
delayAfter: number;
|
|
97
|
+
duration: number;
|
|
98
|
+
easing: string | undefined;
|
|
99
|
+
custom: typeof StreamLight;
|
|
100
|
+
customParameters: (...args: any[]) => {
|
|
101
|
+
streamLength: number;
|
|
102
|
+
attribute: {
|
|
103
|
+
stroke: string | {
|
|
104
|
+
gradient: string;
|
|
105
|
+
x0: number;
|
|
106
|
+
x1: number;
|
|
107
|
+
y1: number;
|
|
108
|
+
y0: number;
|
|
109
|
+
stops: {
|
|
110
|
+
offset: number;
|
|
111
|
+
color: string;
|
|
112
|
+
}[];
|
|
113
|
+
} | undefined;
|
|
114
|
+
strokeOpacity: number;
|
|
115
|
+
lineWidth: any;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
} | {
|
|
119
|
+
startTime: number;
|
|
120
|
+
easing: string;
|
|
121
|
+
duration: number;
|
|
122
|
+
delayAfter: number;
|
|
123
|
+
loop: boolean;
|
|
124
|
+
controlOptions: {
|
|
125
|
+
immediatelyApply: boolean;
|
|
126
|
+
};
|
|
127
|
+
type: string;
|
|
128
|
+
options: {
|
|
129
|
+
orient: string;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
startTime: number;
|
|
133
|
+
easing: string;
|
|
134
|
+
duration: number;
|
|
135
|
+
delayAfter: number;
|
|
136
|
+
loop: boolean;
|
|
137
|
+
controlOptions: {
|
|
138
|
+
immediatelyApply: boolean;
|
|
139
|
+
};
|
|
140
|
+
type: string;
|
|
141
|
+
oneByOne: boolean;
|
|
142
|
+
})[];
|
|
143
|
+
point: ({
|
|
144
|
+
channel?: undefined;
|
|
145
|
+
loop: boolean;
|
|
146
|
+
startTime: number;
|
|
147
|
+
delayAfter: number;
|
|
148
|
+
duration: number;
|
|
149
|
+
easing: string | undefined;
|
|
150
|
+
} | {
|
|
151
|
+
channel: {
|
|
152
|
+
scaleX: {
|
|
153
|
+
from: number;
|
|
154
|
+
to: number;
|
|
155
|
+
};
|
|
156
|
+
scaleY: {
|
|
157
|
+
from: number;
|
|
158
|
+
to: number;
|
|
159
|
+
};
|
|
160
|
+
fillOpacity?: undefined;
|
|
161
|
+
strokeOpacity?: undefined;
|
|
162
|
+
outerBorder?: undefined;
|
|
163
|
+
};
|
|
164
|
+
loop: boolean;
|
|
165
|
+
startTime: number;
|
|
166
|
+
delayAfter: number;
|
|
167
|
+
duration: number;
|
|
168
|
+
easing: string | undefined;
|
|
169
|
+
} | {
|
|
170
|
+
channel: {
|
|
171
|
+
fillOpacity: {
|
|
172
|
+
from: number;
|
|
173
|
+
to: number;
|
|
174
|
+
};
|
|
175
|
+
strokeOpacity: {
|
|
176
|
+
from: number;
|
|
177
|
+
to: number;
|
|
178
|
+
};
|
|
179
|
+
scaleX?: undefined;
|
|
180
|
+
scaleY?: undefined;
|
|
181
|
+
outerBorder?: undefined;
|
|
182
|
+
};
|
|
183
|
+
loop: boolean;
|
|
184
|
+
startTime: number;
|
|
185
|
+
delayAfter: number;
|
|
186
|
+
duration: number;
|
|
187
|
+
easing: string | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
channel: {
|
|
190
|
+
outerBorder: {
|
|
191
|
+
from: {
|
|
192
|
+
distance: number;
|
|
193
|
+
strokeOpacity: number;
|
|
194
|
+
};
|
|
195
|
+
to: (...args: any[]) => {
|
|
196
|
+
distance: number;
|
|
197
|
+
strokeOpacity: number;
|
|
198
|
+
stroke: any;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
scaleX?: undefined;
|
|
202
|
+
scaleY?: undefined;
|
|
203
|
+
fillOpacity?: undefined;
|
|
204
|
+
strokeOpacity?: undefined;
|
|
205
|
+
};
|
|
206
|
+
loop: boolean;
|
|
207
|
+
startTime: number;
|
|
208
|
+
delayAfter: number;
|
|
209
|
+
duration: number;
|
|
210
|
+
easing: string | undefined;
|
|
211
|
+
})[];
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* 折线图/面积图/百分比面积图 更新动画
|
|
215
|
+
* 动画类型:
|
|
216
|
+
* 1. default: 默认更新动画
|
|
217
|
+
* 效果:使用 VChart 默认补间覆盖数据更新、点位变化和面积路径变化。
|
|
218
|
+
* 编排逻辑:line、area、point 共用 update 的 easing 和 duration。
|
|
219
|
+
*/
|
|
220
|
+
export declare const lineOrAreaUpdate: (config: LineAreaUpdateConfig | undefined) => false | {
|
|
221
|
+
line: {
|
|
222
|
+
easing: string | undefined;
|
|
223
|
+
duration: number;
|
|
224
|
+
};
|
|
225
|
+
area: {
|
|
226
|
+
easing: string | undefined;
|
|
227
|
+
duration: number;
|
|
228
|
+
};
|
|
229
|
+
point: {
|
|
230
|
+
easing: string | undefined;
|
|
231
|
+
duration: number;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* 折线图/面积图/百分比面积图 离场动画
|
|
236
|
+
* 动画类型:
|
|
237
|
+
* 1. default: 默认离场动画
|
|
238
|
+
* 效果:使用 VChart 默认补间完成 line、area、point 离场。
|
|
239
|
+
* 编排逻辑:line、area、point 共用 exit 的 easing 和 duration, 保持节奏一致。
|
|
240
|
+
*/
|
|
241
|
+
export declare const lineOrAreaExit: (config: LineAreaUpdateConfig | undefined) => false | {
|
|
242
|
+
line: {
|
|
243
|
+
easing: string | undefined;
|
|
244
|
+
duration: number;
|
|
245
|
+
};
|
|
246
|
+
point: {
|
|
247
|
+
easing: string | undefined;
|
|
248
|
+
duration: number;
|
|
249
|
+
};
|
|
250
|
+
area: {
|
|
251
|
+
easing: string | undefined;
|
|
252
|
+
duration: number;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { VScreenAnimationType } from "./types.js";
|
|
2
|
+
import { allowLineOrAreaAnimation, atmospherePoint } from "./utils/index.js";
|
|
3
|
+
import { transform2VChartColor } from "./utils/bar.js";
|
|
4
|
+
import { clipInLine, growthTopLine, growthTopPoint } from "./utils/lineOrArea.js";
|
|
5
|
+
import { StreamLight } from "@visactor/vchart";
|
|
6
|
+
const lineOrAreaAppear = (config)=>{
|
|
7
|
+
if (!config || !allowLineOrAreaAnimation(config)) return false;
|
|
8
|
+
const { effects, ease, duration } = config;
|
|
9
|
+
const effect = effects?.[0];
|
|
10
|
+
const durationMs = (duration ?? 1) * 1000;
|
|
11
|
+
let lineOrAreaConfigByType = {};
|
|
12
|
+
let pointConfigByType = {};
|
|
13
|
+
if (effect === VScreenAnimationType.growth) {
|
|
14
|
+
lineOrAreaConfigByType = growthTopLine();
|
|
15
|
+
pointConfigByType = growthTopPoint();
|
|
16
|
+
} else if (effect === VScreenAnimationType.load) lineOrAreaConfigByType = clipInLine();
|
|
17
|
+
return {
|
|
18
|
+
line: {
|
|
19
|
+
...lineOrAreaConfigByType,
|
|
20
|
+
easing: ease,
|
|
21
|
+
duration: durationMs
|
|
22
|
+
},
|
|
23
|
+
area: {
|
|
24
|
+
...lineOrAreaConfigByType,
|
|
25
|
+
easing: ease,
|
|
26
|
+
duration: durationMs
|
|
27
|
+
},
|
|
28
|
+
point: {
|
|
29
|
+
...pointConfigByType,
|
|
30
|
+
easing: ease,
|
|
31
|
+
duration: durationMs
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const lineOrAreaLoop = (config, ignoreFirstNormal)=>{
|
|
36
|
+
if (!config?.enable) return false;
|
|
37
|
+
const { loop, atmosphere, interval = 5 } = config;
|
|
38
|
+
const totalDuration = 2;
|
|
39
|
+
const startTime = ignoreFirstNormal ? 1000 * interval : 0;
|
|
40
|
+
const lineOrAreaResult = [];
|
|
41
|
+
const pointResult = [];
|
|
42
|
+
const { effects: loopEffects = [], ease: loopEase = 'linear' } = loop ?? {};
|
|
43
|
+
const loopEffect = loopEffects[0] ?? VScreenAnimationType.none;
|
|
44
|
+
const loopDuration = loopEffect === VScreenAnimationType.none ? 0 : totalDuration / 2;
|
|
45
|
+
const atmosphereDuration = loopEffect === VScreenAnimationType.none ? totalDuration : totalDuration / 2;
|
|
46
|
+
const timeLineConfig = {
|
|
47
|
+
startTime,
|
|
48
|
+
easing: loopEase,
|
|
49
|
+
duration: 1000 * loopDuration,
|
|
50
|
+
delayAfter: (interval + atmosphereDuration) * 1000,
|
|
51
|
+
loop: true,
|
|
52
|
+
controlOptions: {
|
|
53
|
+
immediatelyApply: false
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
if (loopEffect === VScreenAnimationType.growth) lineOrAreaResult.push({
|
|
57
|
+
...growthTopLine(),
|
|
58
|
+
...timeLineConfig
|
|
59
|
+
});
|
|
60
|
+
else if (loopEffect === VScreenAnimationType.load) lineOrAreaResult.push({
|
|
61
|
+
...clipInLine(),
|
|
62
|
+
...timeLineConfig
|
|
63
|
+
});
|
|
64
|
+
const { ease: atmosphereEase, effect: atmosphereEffect, color: atmosphereColor } = atmosphere ?? {};
|
|
65
|
+
const atmosphereLineOrAreaResult = {
|
|
66
|
+
loop: true,
|
|
67
|
+
startTime,
|
|
68
|
+
delay: 1000 * loopDuration,
|
|
69
|
+
delayAfter: 1000 * interval,
|
|
70
|
+
duration: 1000 * atmosphereDuration,
|
|
71
|
+
easing: atmosphereEase,
|
|
72
|
+
custom: StreamLight,
|
|
73
|
+
customParameters: (...args)=>({
|
|
74
|
+
streamLength: 20,
|
|
75
|
+
attribute: {
|
|
76
|
+
stroke: transform2VChartColor(atmosphereColor),
|
|
77
|
+
strokeOpacity: 0.8,
|
|
78
|
+
lineWidth: args[1].attribute?.lineWidth ?? 1
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
};
|
|
82
|
+
lineOrAreaResult.push(atmosphereLineOrAreaResult);
|
|
83
|
+
const atmospherePointResult = {
|
|
84
|
+
loop: true,
|
|
85
|
+
startTime,
|
|
86
|
+
delayAfter: (interval + atmosphereDuration) * 1000,
|
|
87
|
+
duration: 1000 * atmosphereDuration,
|
|
88
|
+
easing: atmosphereEase,
|
|
89
|
+
...atmospherePoint(atmosphereEffect)
|
|
90
|
+
};
|
|
91
|
+
pointResult.push(atmospherePointResult);
|
|
92
|
+
return {
|
|
93
|
+
line: lineOrAreaResult,
|
|
94
|
+
area: lineOrAreaResult,
|
|
95
|
+
point: pointResult
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
const lineOrAreaUpdate = (config)=>{
|
|
99
|
+
if (!config || !allowLineOrAreaAnimation(config)) return false;
|
|
100
|
+
const { ease, duration } = config;
|
|
101
|
+
const durationMs = (duration ?? 1) * 1000;
|
|
102
|
+
return {
|
|
103
|
+
line: {
|
|
104
|
+
easing: ease,
|
|
105
|
+
duration: durationMs
|
|
106
|
+
},
|
|
107
|
+
area: {
|
|
108
|
+
easing: ease,
|
|
109
|
+
duration: durationMs
|
|
110
|
+
},
|
|
111
|
+
point: {
|
|
112
|
+
easing: ease,
|
|
113
|
+
duration: durationMs
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const lineOrAreaExit = (config)=>{
|
|
118
|
+
if (!config || !allowLineOrAreaAnimation(config)) return false;
|
|
119
|
+
const { ease, duration } = config;
|
|
120
|
+
const durationMs = (duration ?? 1) * 1000;
|
|
121
|
+
return {
|
|
122
|
+
line: {
|
|
123
|
+
easing: ease,
|
|
124
|
+
duration: durationMs
|
|
125
|
+
},
|
|
126
|
+
point: {
|
|
127
|
+
easing: ease,
|
|
128
|
+
duration: durationMs
|
|
129
|
+
},
|
|
130
|
+
area: {
|
|
131
|
+
easing: ease,
|
|
132
|
+
duration: durationMs
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export { lineOrAreaAppear, lineOrAreaExit, lineOrAreaLoop, lineOrAreaUpdate };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=lineOrArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline/spec/chart/pipes/animation/lineOrArea.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/animation/lineOrArea.ts"],"sourcesContent":["import type { LineAreaAppearConfig, LineAreaLoopConfig, LineAreaUpdateConfig } from './types'\nimport { VScreenAnimationType } from './types'\nimport { allowLineOrAreaAnimation, atmospherePoint } from './utils'\nimport { transform2VChartColor } from './utils/bar'\nimport { clipInLine, growthTopLine, growthTopPoint } from './utils/lineOrArea'\nimport { StreamLight } from '@visactor/vchart'\n\n/**\n * 折线图/面积图/百分比面积图 入场动画\n * 动画类型:\n * 1. growth: 生长动画\n * 效果:line/area 使用路径增长, point 使用顶部移入。\n * 编排逻辑:line、area、point 共用 appear 的 easing 和 duration。\n * 2. load: 加载动画\n * 效果:line/area 使用整体裁剪进入, point 不额外配置进入方式。\n * 编排逻辑:line、area、point 共用 appear 的 easing 和 duration。\n */\nexport const lineOrAreaAppear = (config: LineAreaAppearConfig | undefined) => {\n if (!config || !allowLineOrAreaAnimation(config)) {\n return false\n }\n const { effects, ease, duration } = config\n const effect = effects?.[0]\n const durationMs = (duration ?? 1) * 1000\n\n let lineOrAreaConfigByType = {}\n let pointConfigByType = {}\n if (effect === VScreenAnimationType.growth) {\n lineOrAreaConfigByType = growthTopLine()\n pointConfigByType = growthTopPoint()\n } else if (effect === VScreenAnimationType.load) {\n lineOrAreaConfigByType = clipInLine()\n }\n return {\n line: {\n ...lineOrAreaConfigByType,\n easing: ease,\n duration: durationMs,\n },\n area: {\n ...lineOrAreaConfigByType,\n easing: ease,\n duration: durationMs,\n },\n point: {\n ...pointConfigByType,\n easing: ease,\n duration: durationMs,\n },\n }\n}\n\n/**\n * 折线图/面积图/百分比面积图 循环动画\n * 动画类型:\n * 1. growth/load: 线面 loop 动画\n * 效果:line/area 执行路径增长或整体裁剪。\n * 编排逻辑:startTime = appear 存在 ? interval : 0, 有 loop 时 loopDuration = 1s, 执行后等待 interval + atmosphereDuration。\n * 2. atmosphere: 线面流光氛围动画\n * 效果:line/area 使用 StreamLight 形成流光。\n * 编排逻辑:延迟 loopDuration 后启动, 持续 atmosphereDuration, 一轮结束后等待 interval。\n * 3. atmospherePoint: 点氛围动画\n * 效果:point 执行 breath/reveal/ripple 等氛围效果。\n * 编排逻辑:和整轮时间线同步, 一轮结束后等待 interval + atmosphereDuration。\n */\nexport const lineOrAreaLoop = (config: LineAreaLoopConfig | undefined, ignoreFirstNormal: boolean) => {\n if (!config?.enable) {\n return false\n }\n const { loop, atmosphere, interval = 5 } = config\n const totalDuration = 2\n // const startTime = 0\n const startTime = ignoreFirstNormal ? interval * 1000 : 0\n const lineOrAreaResult = []\n const pointResult = []\n\n // 轮播动画\n const { effects: loopEffects = [], ease: loopEase = 'linear' } = loop ?? {}\n const loopEffect = loopEffects[0] ?? VScreenAnimationType.none\n\n const loopDuration = loopEffect === VScreenAnimationType.none ? 0 : totalDuration / 2\n const atmosphereDuration = loopEffect === VScreenAnimationType.none ? totalDuration : totalDuration / 2\n\n const timeLineConfig = {\n startTime,\n easing: loopEase,\n duration: loopDuration * 1000,\n delayAfter: (interval + atmosphereDuration) * 1000,\n loop: true,\n controlOptions: {\n immediatelyApply: false,\n },\n }\n if (loopEffect === VScreenAnimationType.growth) {\n lineOrAreaResult.push({\n ...growthTopLine(),\n ...timeLineConfig,\n })\n } else if (loopEffect === VScreenAnimationType.load) {\n lineOrAreaResult.push({\n ...clipInLine(),\n ...timeLineConfig,\n })\n }\n // point loop动画只能在appear中生效\n\n // 氛围动画\n const { ease: atmosphereEase, effect: atmosphereEffect, color: atmosphereColor } = atmosphere ?? {}\n\n const atmosphereLineOrAreaResult = {\n loop: true,\n startTime,\n delay: loopDuration * 1000,\n delayAfter: interval * 1000,\n duration: atmosphereDuration * 1000,\n easing: atmosphereEase,\n custom: StreamLight,\n customParameters: (...args: any[]) => {\n return {\n streamLength: 20,\n attribute: {\n stroke: transform2VChartColor(atmosphereColor),\n strokeOpacity: 0.8,\n lineWidth: args[1].attribute?.lineWidth ?? 1,\n },\n }\n },\n }\n lineOrAreaResult.push(atmosphereLineOrAreaResult)\n\n // 虽然是氛围动画, 但时机跟随折线loop动画\n const atmospherePointResult = {\n loop: true,\n startTime,\n delayAfter: (interval + atmosphereDuration) * 1000,\n duration: atmosphereDuration * 1000,\n easing: atmosphereEase,\n ...atmospherePoint(atmosphereEffect),\n }\n\n pointResult.push(atmospherePointResult)\n\n return {\n line: lineOrAreaResult,\n area: lineOrAreaResult,\n point: pointResult,\n }\n}\n\n/**\n * 折线图/面积图/百分比面积图 更新动画\n * 动画类型:\n * 1. default: 默认更新动画\n * 效果:使用 VChart 默认补间覆盖数据更新、点位变化和面积路径变化。\n * 编排逻辑:line、area、point 共用 update 的 easing 和 duration。\n */\nexport const lineOrAreaUpdate = (config: LineAreaUpdateConfig | undefined) => {\n if (!config || !allowLineOrAreaAnimation(config)) {\n return false\n }\n const { ease, duration } = config\n const durationMs = (duration ?? 1) * 1000\n\n // 用图表库默认的补间效果\n return {\n line: {\n easing: ease,\n duration: durationMs,\n },\n area: {\n easing: ease,\n duration: durationMs,\n },\n point: {\n easing: ease,\n duration: durationMs,\n },\n }\n}\n\n/**\n * 折线图/面积图/百分比面积图 离场动画\n * 动画类型:\n * 1. default: 默认离场动画\n * 效果:使用 VChart 默认补间完成 line、area、point 离场。\n * 编排逻辑:line、area、point 共用 exit 的 easing 和 duration, 保持节奏一致。\n */\nexport const lineOrAreaExit = (config: LineAreaUpdateConfig | undefined) => {\n if (!config || !allowLineOrAreaAnimation(config)) {\n return false\n }\n const { ease, duration } = config\n const durationMs = (duration ?? 1) * 1000\n return {\n line: {\n easing: ease,\n duration: durationMs,\n },\n point: {\n easing: ease,\n duration: durationMs,\n },\n area: {\n easing: ease,\n duration: durationMs,\n },\n }\n}\n"],"names":["lineOrAreaAppear","config","allowLineOrAreaAnimation","effects","ease","duration","effect","durationMs","lineOrAreaConfigByType","pointConfigByType","VScreenAnimationType","growthTopLine","growthTopPoint","clipInLine","lineOrAreaLoop","ignoreFirstNormal","loop","atmosphere","interval","totalDuration","startTime","lineOrAreaResult","pointResult","loopEffects","loopEase","loopEffect","loopDuration","atmosphereDuration","timeLineConfig","atmosphereEase","atmosphereEffect","atmosphereColor","atmosphereLineOrAreaResult","StreamLight","args","transform2VChartColor","atmospherePointResult","atmospherePoint","lineOrAreaUpdate","lineOrAreaExit"],"mappings":"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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type PieLikeAppearConfig, type PieLikeLoopConfig, type PieLikeUpdateConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 饼图/环图/玫瑰图 入场动画
|
|
4
|
+
* 动画类型:
|
|
5
|
+
* 1. radial: 角度展开动画
|
|
6
|
+
* 效果:pie/rose 按扇区角度展开。
|
|
7
|
+
* 编排逻辑:pie/rose 同步使用 growAngleIn, rose 额外补 preset = growAngle。
|
|
8
|
+
* 2. scale: 半径展开动画
|
|
9
|
+
* 效果:pie/rose 按半径从内向外展开。
|
|
10
|
+
* 编排逻辑:pie/rose 同步使用 growRadiusIn, 共用 appear 的 easing 和 duration。
|
|
11
|
+
*/
|
|
12
|
+
export declare const pieAppear: (config: PieLikeAppearConfig | undefined, chartType: string) => any;
|
|
13
|
+
/**
|
|
14
|
+
* 饼图/环图/玫瑰图 更新动画
|
|
15
|
+
* 动画类型:
|
|
16
|
+
* 1. default: 默认更新动画
|
|
17
|
+
* 效果:pie/rose 使用 VChart 默认补间。
|
|
18
|
+
* 编排逻辑:不指定角度或半径动画, 避免和 normal 阶段的通道动画冲突。
|
|
19
|
+
*/
|
|
20
|
+
export declare const pieUpdate: (config: PieLikeUpdateConfig | undefined) => false | {
|
|
21
|
+
pie: {
|
|
22
|
+
easing: string | undefined;
|
|
23
|
+
duration: number;
|
|
24
|
+
};
|
|
25
|
+
rose: {
|
|
26
|
+
easing: string | undefined;
|
|
27
|
+
duration: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 饼图/环图/玫瑰图 新数据进入动画
|
|
32
|
+
* 动画类型:
|
|
33
|
+
* 1. default: 默认 enter 动画
|
|
34
|
+
* 效果:新数据使用 VChart 默认 enter 补间。
|
|
35
|
+
* 编排逻辑:pie/rose 共用 update 的 easing 和 duration。
|
|
36
|
+
* 2. enlarge + rose: 淡入 enter 动画
|
|
37
|
+
* 效果:rose 新数据使用 fadeIn。
|
|
38
|
+
* 编排逻辑:当 normal 的 loop 效果为 enlarge 时启用, 避免 enter 和 enlarge 同时争用 outerRadius 通道。
|
|
39
|
+
*/
|
|
40
|
+
export declare const pieEnter: (config: PieLikeUpdateConfig | undefined, atmosphereConfig: PieLikeLoopConfig | undefined) => false | {
|
|
41
|
+
pie: {
|
|
42
|
+
easing: string | undefined;
|
|
43
|
+
duration: number;
|
|
44
|
+
};
|
|
45
|
+
rose: {
|
|
46
|
+
easing: string | undefined;
|
|
47
|
+
duration: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* 饼图/环图/玫瑰图 循环动画
|
|
52
|
+
* 动画类型:
|
|
53
|
+
* 1. enlarge: 半径放大动画
|
|
54
|
+
* 效果:扇区 outerRadius 放大 10px 后恢复。
|
|
55
|
+
* 编排逻辑:startTime = appear 存在 ? interval : 0, 前半段放大, 后半段恢复, oneByOne 错峰执行。
|
|
56
|
+
* 2. relocate: 扇区偏移动画
|
|
57
|
+
* 效果:扇区沿中心角方向向外偏移后恢复。
|
|
58
|
+
* 编排逻辑:前半段计算 x/y 偏移, 后半段回到原始 x/y, 一轮结束后等待 interval。
|
|
59
|
+
*/
|
|
60
|
+
export declare const pieLoop: (config: PieLikeLoopConfig | undefined, ignoreFirstNormal: boolean) => false | {
|
|
61
|
+
pie: {};
|
|
62
|
+
rose: {};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 饼图/环图/玫瑰图 离场动画
|
|
66
|
+
* 动画类型:
|
|
67
|
+
* 1. none: 无离场动画
|
|
68
|
+
* 效果:不配置自定义 exit。
|
|
69
|
+
* 编排逻辑:返回 false, 关闭该阶段动画配置。
|
|
70
|
+
*/
|
|
71
|
+
export declare const pieExit: () => boolean;
|