@visactor/vseed 0.4.27 → 0.5.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.
Files changed (214) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +2 -1
  4. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
  5. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +2 -1
  6. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
  7. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js +2 -1
  8. package/dist/esm/pipeline/advanced/chart/pipes/config/pie.js.map +1 -1
  9. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js +2 -1
  10. package/dist/esm/pipeline/advanced/chart/pipes/config/scatter.js.map +1 -1
  11. package/dist/esm/pipeline/spec/chart/pipeline/area.js +3 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  13. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
  14. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  15. package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
  16. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  17. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
  18. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  19. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
  20. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  21. package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
  22. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  23. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
  24. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  25. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
  26. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  27. package/dist/esm/pipeline/spec/chart/pipeline/donut.js +3 -1
  28. package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
  29. package/dist/esm/pipeline/spec/chart/pipeline/line.js +3 -1
  30. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  31. package/dist/esm/pipeline/spec/chart/pipeline/pie.js +3 -1
  32. package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
  33. package/dist/esm/pipeline/spec/chart/pipeline/radar.js +3 -1
  34. package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
  35. package/dist/esm/pipeline/spec/chart/pipeline/rose.js +3 -1
  36. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  37. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +3 -1
  38. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  39. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js +3 -1
  40. package/dist/esm/pipeline/spec/chart/pipeline/scatter.js.map +1 -1
  41. package/dist/esm/pipeline/spec/chart/pipes/animation/animation.d.ts +15 -0
  42. package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js +94 -0
  43. package/dist/esm/pipeline/spec/chart/pipes/animation/animation.js.map +1 -0
  44. package/dist/esm/pipeline/spec/chart/pipes/animation/bar.d.ts +77 -0
  45. package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js +88 -0
  46. package/dist/esm/pipeline/spec/chart/pipes/animation/bar.js.map +1 -0
  47. package/dist/esm/pipeline/spec/chart/pipes/animation/index.d.ts +2 -0
  48. package/dist/esm/pipeline/spec/chart/pipes/animation/index.js +2 -0
  49. package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.d.ts +254 -0
  50. package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js +138 -0
  51. package/dist/esm/pipeline/spec/chart/pipes/animation/lineOrArea.js.map +1 -0
  52. package/dist/esm/pipeline/spec/chart/pipes/animation/pie.d.ts +71 -0
  53. package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js +176 -0
  54. package/dist/esm/pipeline/spec/chart/pipes/animation/pie.js.map +1 -0
  55. package/dist/esm/pipeline/spec/chart/pipes/animation/radar.d.ts +131 -0
  56. package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js +46 -0
  57. package/dist/esm/pipeline/spec/chart/pipes/animation/radar.js.map +1 -0
  58. package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.d.ts +102 -0
  59. package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js +57 -0
  60. package/dist/esm/pipeline/spec/chart/pipes/animation/scatter.js.map +1 -0
  61. package/dist/esm/pipeline/spec/chart/pipes/animation/types.d.ts +130 -0
  62. package/dist/esm/pipeline/spec/chart/pipes/animation/types.js +19 -0
  63. package/dist/esm/pipeline/spec/chart/pipes/animation/types.js.map +1 -0
  64. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.d.ts +11 -0
  65. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js +13 -0
  66. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/bar.js.map +1 -0
  67. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.d.ts +52 -0
  68. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js +51 -0
  69. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barColor.js.map +1 -0
  70. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.d.ts +102 -0
  71. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js +84 -0
  72. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barGroup.js.map +1 -0
  73. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.d.ts +66 -0
  74. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js +72 -0
  75. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/barMotion.js.map +1 -0
  76. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.d.ts +86 -0
  77. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js +60 -0
  78. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/index.js.map +1 -0
  79. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.d.ts +29 -0
  80. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js +20 -0
  81. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/lineOrArea.js.map +1 -0
  82. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.d.ts +14 -0
  83. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js +9 -0
  84. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/pie.js.map +1 -0
  85. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.d.ts +69 -0
  86. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js +59 -0
  87. package/dist/esm/pipeline/spec/chart/pipes/animation/utils/scatter.js.map +1 -0
  88. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +63 -10
  89. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -1
  90. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.d.ts +1 -0
  91. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js +8 -3
  92. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointCommon.js.map +1 -1
  93. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js +3 -3
  94. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationPointOfDualAxis.js.map +1 -1
  95. package/dist/esm/pipeline/spec/chart/pipes/index.d.ts +1 -0
  96. package/dist/esm/pipeline/spec/chart/pipes/index.js +1 -0
  97. package/dist/esm/types/chartType/area/area.d.ts +6 -1
  98. package/dist/esm/types/chartType/area/zArea.d.ts +42 -0
  99. package/dist/esm/types/chartType/area/zArea.js +2 -1
  100. package/dist/esm/types/chartType/area/zArea.js.map +1 -1
  101. package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
  102. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +42 -0
  103. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
  104. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
  105. package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
  106. package/dist/esm/types/chartType/bar/zBar.d.ts +42 -0
  107. package/dist/esm/types/chartType/bar/zBar.js +2 -1
  108. package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
  109. package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
  110. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +42 -0
  111. package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
  112. package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
  113. package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
  114. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +42 -0
  115. package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
  116. package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
  117. package/dist/esm/types/chartType/boxPlot/zBoxPlot.d.ts +2 -0
  118. package/dist/esm/types/chartType/column/column.d.ts +6 -1
  119. package/dist/esm/types/chartType/column/zColumn.d.ts +42 -0
  120. package/dist/esm/types/chartType/column/zColumn.js +2 -1
  121. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  122. package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
  123. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +42 -0
  124. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
  125. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
  126. package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
  127. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +42 -0
  128. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
  129. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
  130. package/dist/esm/types/chartType/donut/donut.d.ts +6 -1
  131. package/dist/esm/types/chartType/donut/zDonut.d.ts +40 -0
  132. package/dist/esm/types/chartType/donut/zDonut.js +2 -1
  133. package/dist/esm/types/chartType/donut/zDonut.js.map +1 -1
  134. package/dist/esm/types/chartType/dualAxis/zDualAxis.d.ts +2 -0
  135. package/dist/esm/types/chartType/histogram/zHistogram.d.ts +2 -0
  136. package/dist/esm/types/chartType/line/line.d.ts +6 -1
  137. package/dist/esm/types/chartType/line/zLine.d.ts +42 -0
  138. package/dist/esm/types/chartType/line/zLine.js +2 -1
  139. package/dist/esm/types/chartType/line/zLine.js.map +1 -1
  140. package/dist/esm/types/chartType/pie/pie.d.ts +6 -1
  141. package/dist/esm/types/chartType/pie/zPie.d.ts +40 -0
  142. package/dist/esm/types/chartType/pie/zPie.js +2 -1
  143. package/dist/esm/types/chartType/pie/zPie.js.map +1 -1
  144. package/dist/esm/types/chartType/raceBar/zRaceBar.d.ts +2 -0
  145. package/dist/esm/types/chartType/raceColumn/zRaceColumn.d.ts +2 -0
  146. package/dist/esm/types/chartType/raceLine/zRaceLine.d.ts +2 -0
  147. package/dist/esm/types/chartType/raceScatter/zRaceScatter.d.ts +2 -0
  148. package/dist/esm/types/chartType/radar/radar.d.ts +6 -1
  149. package/dist/esm/types/chartType/radar/zRadar.d.ts +40 -0
  150. package/dist/esm/types/chartType/radar/zRadar.js +2 -1
  151. package/dist/esm/types/chartType/radar/zRadar.js.map +1 -1
  152. package/dist/esm/types/chartType/rose/rose.d.ts +6 -1
  153. package/dist/esm/types/chartType/rose/zRose.d.ts +40 -0
  154. package/dist/esm/types/chartType/rose/zRose.js +2 -1
  155. package/dist/esm/types/chartType/rose/zRose.js.map +1 -1
  156. package/dist/esm/types/chartType/roseParallel/roseParallel.d.ts +6 -1
  157. package/dist/esm/types/chartType/roseParallel/zRoseParallel.d.ts +40 -0
  158. package/dist/esm/types/chartType/roseParallel/zRoseParallel.js +2 -1
  159. package/dist/esm/types/chartType/roseParallel/zRoseParallel.js.map +1 -1
  160. package/dist/esm/types/chartType/scatter/scatter.d.ts +6 -1
  161. package/dist/esm/types/chartType/scatter/zScatter.d.ts +42 -0
  162. package/dist/esm/types/chartType/scatter/zScatter.js +2 -1
  163. package/dist/esm/types/chartType/scatter/zScatter.js.map +1 -1
  164. package/dist/esm/types/properties/annotation/annotation.d.ts +2 -0
  165. package/dist/esm/types/properties/annotation/annotationPoint.d.ts +4 -0
  166. package/dist/esm/types/properties/annotation/zAnnotationPoint.d.ts +1 -0
  167. package/dist/esm/types/properties/annotation/zAnnotationPoint.js +1 -0
  168. package/dist/esm/types/properties/annotation/zAnnotationPoint.js.map +1 -1
  169. package/dist/esm/types/properties/config/animation/animation.d.ts +72 -0
  170. package/dist/esm/types/properties/config/animation/animation.js +0 -0
  171. package/dist/esm/types/properties/config/animation/animationAtmosphere.d.ts +15 -0
  172. package/dist/esm/types/properties/config/animation/animationAtmosphere.js +0 -0
  173. package/dist/esm/types/properties/config/animation/animationConfig.d.ts +2 -0
  174. package/dist/esm/types/properties/config/animation/animationConfig.js +0 -0
  175. package/dist/esm/types/properties/config/animation/animationEffect.d.ts +72 -0
  176. package/dist/esm/types/properties/config/animation/animationEffect.js +0 -0
  177. package/dist/esm/types/properties/config/animation/animationLoop.d.ts +49 -0
  178. package/dist/esm/types/properties/config/animation/animationLoop.js +0 -0
  179. package/dist/esm/types/properties/config/animation/index.d.ts +6 -0
  180. package/dist/esm/types/properties/config/animation/index.js +1 -0
  181. package/dist/esm/types/properties/config/animation/zAnimation.d.ts +201 -0
  182. package/dist/esm/types/properties/config/animation/zAnimation.js +114 -0
  183. package/dist/esm/types/properties/config/animation/zAnimation.js.map +1 -0
  184. package/dist/esm/types/properties/config/annotation/zAnnotation.js +1 -0
  185. package/dist/esm/types/properties/config/annotation/zAnnotation.js.map +1 -1
  186. package/dist/esm/types/properties/config/area.d.ts +80 -0
  187. package/dist/esm/types/properties/config/area.js +3 -1
  188. package/dist/esm/types/properties/config/area.js.map +1 -1
  189. package/dist/esm/types/properties/config/bar.d.ts +120 -0
  190. package/dist/esm/types/properties/config/bar.js +3 -1
  191. package/dist/esm/types/properties/config/bar.js.map +1 -1
  192. package/dist/esm/types/properties/config/column.d.ts +120 -0
  193. package/dist/esm/types/properties/config/column.js +3 -1
  194. package/dist/esm/types/properties/config/column.js.map +1 -1
  195. package/dist/esm/types/properties/config/config.d.ts +840 -0
  196. package/dist/esm/types/properties/config/index.d.ts +1 -0
  197. package/dist/esm/types/properties/config/index.js +1 -0
  198. package/dist/esm/types/properties/config/line.d.ts +40 -0
  199. package/dist/esm/types/properties/config/line.js +3 -1
  200. package/dist/esm/types/properties/config/line.js.map +1 -1
  201. package/dist/esm/types/properties/config/pie.d.ts +120 -0
  202. package/dist/esm/types/properties/config/pie.js +6 -2
  203. package/dist/esm/types/properties/config/pie.js.map +1 -1
  204. package/dist/esm/types/properties/config/race.d.ts +240 -0
  205. package/dist/esm/types/properties/config/rose.d.ts +80 -0
  206. package/dist/esm/types/properties/config/rose.js +3 -1
  207. package/dist/esm/types/properties/config/rose.js.map +1 -1
  208. package/dist/esm/types/properties/config/scatter.d.ts +40 -0
  209. package/dist/esm/types/properties/config/scatter.js +3 -1
  210. package/dist/esm/types/properties/config/scatter.js.map +1 -1
  211. package/dist/esm/types/properties/theme/customTheme.d.ts +1680 -0
  212. package/dist/umd/index.js +5040 -641
  213. package/dist/umd/index.js.map +1 -1
  214. package/package.json +3 -3
@@ -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;
@@ -0,0 +1,176 @@
1
+ import { ChartTypeEnum } from "../../../../utils/index.js";
2
+ import { VScreenAnimationType } from "./types.js";
3
+ import { allowAnimation, getPrimaryEffect } from "./utils/index.js";
4
+ import { radialPie, scalePie } from "./utils/pie.js";
5
+ const pieAppear = (config, chartType)=>{
6
+ if (!config || !allowAnimation(config)) return false;
7
+ const { effects, ease, duration } = config;
8
+ const effect = effects?.[0];
9
+ const durationMs = (duration ?? 1) * 1000;
10
+ let configByType = {};
11
+ if (effect === VScreenAnimationType.radial) configByType = radialPie();
12
+ else if (effect === VScreenAnimationType.scale) configByType = scalePie();
13
+ const result = {
14
+ pie: {
15
+ ...configByType,
16
+ easing: ease,
17
+ duration: durationMs
18
+ },
19
+ rose: {
20
+ ...configByType,
21
+ easing: ease,
22
+ duration: durationMs
23
+ }
24
+ };
25
+ if (chartType === ChartTypeEnum.Rose && effect === VScreenAnimationType.radial) result.preset = 'growAngle';
26
+ return result;
27
+ };
28
+ const pieUpdate = (config)=>{
29
+ if (!config || !allowAnimation(config)) return false;
30
+ const { ease, duration } = config;
31
+ const durationMs = (duration ?? 1) * 1000;
32
+ return {
33
+ pie: {
34
+ easing: ease,
35
+ duration: durationMs
36
+ },
37
+ rose: {
38
+ easing: ease,
39
+ duration: durationMs
40
+ }
41
+ };
42
+ };
43
+ const pieEnter = (config, atmosphereConfig)=>{
44
+ if (!config || !allowAnimation(config)) return false;
45
+ const { ease, duration } = config;
46
+ const durationMs = (duration ?? 1) * 1000;
47
+ let configByType = {};
48
+ if (atmosphereConfig?.enable && getPrimaryEffect(atmosphereConfig.loop) === VScreenAnimationType.enlarge) configByType = {
49
+ type: 'fadeIn'
50
+ };
51
+ return {
52
+ pie: {
53
+ easing: ease,
54
+ duration: durationMs
55
+ },
56
+ rose: {
57
+ ...configByType,
58
+ easing: ease,
59
+ duration: durationMs
60
+ }
61
+ };
62
+ };
63
+ const pieLoop = (config, ignoreFirstNormal)=>{
64
+ if (!config?.enable) return false;
65
+ const { loop, interval = 0 } = config;
66
+ let loopResult = {};
67
+ const startTime = ignoreFirstNormal ? 1000 * interval : 0;
68
+ const { effects: loopEffects = [], ease: loopEase } = loop ?? {};
69
+ const loopDuration = 1;
70
+ const loopEffect = loopEffects[0];
71
+ if (loopEffect === VScreenAnimationType.enlarge) loopResult = [
72
+ {
73
+ channel: {
74
+ outerRadius: {
75
+ from: (...p)=>p[1].attribute.outerRadius,
76
+ to: (...p)=>p[1].attribute.outerRadius + 10
77
+ }
78
+ },
79
+ startTime,
80
+ oneByOne: 1000 * loopDuration,
81
+ duration: loopDuration / 2 * 1000,
82
+ loop: true,
83
+ easing: loopEase,
84
+ delayAfter: loopDuration / 2 * 1000 + 1000 * interval,
85
+ controlOptions: {
86
+ immediatelyApply: false
87
+ }
88
+ },
89
+ {
90
+ channel: {
91
+ outerRadius: {
92
+ from: (...p)=>p[1].attribute.outerRadius + 10,
93
+ to: (...p)=>p[1].attribute.outerRadius
94
+ }
95
+ },
96
+ startTime,
97
+ oneByOne: 1000 * loopDuration,
98
+ duration: loopDuration / 2 * 1000,
99
+ easing: loopEase,
100
+ delay: loopDuration / 2 * 1000,
101
+ delayAfter: 1000 * interval,
102
+ loop: true,
103
+ controlOptions: {
104
+ immediatelyApply: false
105
+ }
106
+ }
107
+ ];
108
+ else if (loopEffect === VScreenAnimationType.relocate) {
109
+ const offset = 10;
110
+ loopResult = [
111
+ {
112
+ channel: {
113
+ x: {
114
+ from: (...p)=>p[1].attribute.x,
115
+ to: (...p)=>{
116
+ const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2;
117
+ return p[1].attribute.x + offset * Math.cos(angle);
118
+ }
119
+ },
120
+ y: {
121
+ from: (...p)=>p[1].attribute.y,
122
+ to: (...p)=>{
123
+ const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2;
124
+ return p[1].attribute.y + offset * Math.sin(angle);
125
+ }
126
+ }
127
+ },
128
+ startTime,
129
+ oneByOne: 1000 * loopDuration,
130
+ duration: loopDuration / 2 * 1000,
131
+ loop: true,
132
+ easing: loopEase,
133
+ delayAfter: loopDuration / 2 * 1000 + 1000 * interval,
134
+ controlOptions: {
135
+ immediatelyApply: false
136
+ }
137
+ },
138
+ {
139
+ channel: {
140
+ x: {
141
+ from: (...p)=>{
142
+ const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2;
143
+ return p[1].attribute.x + offset * Math.cos(angle);
144
+ },
145
+ to: (...p)=>p[1].attribute.x
146
+ },
147
+ y: {
148
+ from: (...p)=>{
149
+ const angle = (p[1].attribute.startAngle + p[1].attribute.endAngle) / 2;
150
+ return p[1].attribute.y + offset * Math.sin(angle);
151
+ },
152
+ to: (...p)=>p[1].attribute.y
153
+ }
154
+ },
155
+ startTime,
156
+ oneByOne: 1000 * loopDuration,
157
+ duration: loopDuration / 2 * 1000,
158
+ easing: loopEase,
159
+ delay: loopDuration / 2 * 1000,
160
+ delayAfter: 1000 * interval,
161
+ loop: true,
162
+ controlOptions: {
163
+ immediatelyApply: false
164
+ }
165
+ }
166
+ ];
167
+ }
168
+ return {
169
+ pie: loopResult,
170
+ rose: loopResult
171
+ };
172
+ };
173
+ const pieExit = ()=>false;
174
+ export { pieAppear, pieEnter, pieExit, pieLoop, pieUpdate };
175
+
176
+ //# sourceMappingURL=pie.js.map