@visactor/vrender-animate 0.22.4

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 (303) hide show
  1. package/README.md +177 -0
  2. package/cjs/animate-extension.d.ts +15 -0
  3. package/cjs/animate-extension.js +46 -0
  4. package/cjs/animate-extension.js.map +1 -0
  5. package/cjs/animate.d.ts +71 -0
  6. package/cjs/animate.js +210 -0
  7. package/cjs/animate.js.map +1 -0
  8. package/cjs/custom/clip-graphic.d.ts +53 -0
  9. package/cjs/custom/clip-graphic.js +146 -0
  10. package/cjs/custom/clip-graphic.js.map +1 -0
  11. package/cjs/custom/clip.d.ts +13 -0
  12. package/cjs/custom/clip.js +24 -0
  13. package/cjs/custom/clip.js.map +1 -0
  14. package/cjs/custom/common.d.ts +22 -0
  15. package/cjs/custom/common.js +58 -0
  16. package/cjs/custom/common.js.map +1 -0
  17. package/cjs/custom/custom-animate.d.ts +15 -0
  18. package/cjs/custom/custom-animate.js +25 -0
  19. package/cjs/custom/custom-animate.js.map +1 -0
  20. package/cjs/custom/fade.d.ts +13 -0
  21. package/cjs/custom/fade.js +24 -0
  22. package/cjs/custom/fade.js.map +1 -0
  23. package/cjs/custom/group-fade.d.ts +16 -0
  24. package/cjs/custom/group-fade.js +66 -0
  25. package/cjs/custom/group-fade.js.map +1 -0
  26. package/cjs/custom/growAngle.d.ts +37 -0
  27. package/cjs/custom/growAngle.js +140 -0
  28. package/cjs/custom/growAngle.js.map +1 -0
  29. package/cjs/custom/growCenter.d.ts +17 -0
  30. package/cjs/custom/growCenter.js +161 -0
  31. package/cjs/custom/growCenter.js.map +1 -0
  32. package/cjs/custom/growHeight.d.ts +36 -0
  33. package/cjs/custom/growHeight.js +154 -0
  34. package/cjs/custom/growHeight.js.map +1 -0
  35. package/cjs/custom/growPoints.d.ts +52 -0
  36. package/cjs/custom/growPoints.js +227 -0
  37. package/cjs/custom/growPoints.js.map +1 -0
  38. package/cjs/custom/growRadius.d.ts +41 -0
  39. package/cjs/custom/growRadius.js +113 -0
  40. package/cjs/custom/growRadius.js.map +1 -0
  41. package/cjs/custom/growWidth.d.ts +36 -0
  42. package/cjs/custom/growWidth.js +154 -0
  43. package/cjs/custom/growWidth.js.map +1 -0
  44. package/cjs/custom/input-text.d.ts +29 -0
  45. package/cjs/custom/input-text.js +45 -0
  46. package/cjs/custom/input-text.js.map +1 -0
  47. package/cjs/custom/number.d.ts +25 -0
  48. package/cjs/custom/number.js +102 -0
  49. package/cjs/custom/number.js.map +1 -0
  50. package/cjs/custom/register.d.ts +1 -0
  51. package/cjs/custom/register.js +35 -0
  52. package/cjs/custom/register.js.map +1 -0
  53. package/cjs/custom/scale-in.d.ts +13 -0
  54. package/cjs/custom/scale-in.js +57 -0
  55. package/cjs/custom/scale-in.js.map +1 -0
  56. package/cjs/custom/scale.d.ts +20 -0
  57. package/cjs/custom/scale.js +106 -0
  58. package/cjs/custom/scale.js.map +1 -0
  59. package/cjs/custom/sphere.d.ts +20 -0
  60. package/cjs/custom/sphere.js +26 -0
  61. package/cjs/custom/sphere.js.map +1 -0
  62. package/cjs/custom/state.d.ts +13 -0
  63. package/cjs/custom/state.js +25 -0
  64. package/cjs/custom/state.js.map +1 -0
  65. package/cjs/custom/tag-points.d.ts +26 -0
  66. package/cjs/custom/tag-points.js +81 -0
  67. package/cjs/custom/tag-points.js.map +1 -0
  68. package/cjs/custom/update.d.ts +14 -0
  69. package/cjs/custom/update.js +26 -0
  70. package/cjs/custom/update.js.map +1 -0
  71. package/cjs/executor/animate-executor.d.ts +36 -0
  72. package/cjs/executor/animate-executor.js +177 -0
  73. package/cjs/executor/animate-executor.js.map +1 -0
  74. package/cjs/executor/executor.d.ts +69 -0
  75. package/cjs/executor/executor.js +6 -0
  76. package/cjs/executor/executor.js.map +1 -0
  77. package/cjs/index.d.ts +25 -0
  78. package/cjs/index.js +214 -0
  79. package/cjs/index.js.map +1 -0
  80. package/cjs/interpolate/executor.d.ts +66 -0
  81. package/cjs/interpolate/executor.js +6 -0
  82. package/cjs/interpolate/executor.js.map +1 -0
  83. package/cjs/interpolate/number.d.ts +1 -0
  84. package/cjs/interpolate/number.js +10 -0
  85. package/cjs/interpolate/number.js.map +1 -0
  86. package/cjs/interpolate/store.d.ts +32 -0
  87. package/cjs/interpolate/store.js +96 -0
  88. package/cjs/interpolate/store.js.map +1 -0
  89. package/cjs/intreface/animate.d.ts +91 -0
  90. package/cjs/intreface/animate.js +10 -0
  91. package/cjs/intreface/animate.js.map +1 -0
  92. package/cjs/intreface/easing.d.ts +3 -0
  93. package/cjs/intreface/easing.js +6 -0
  94. package/cjs/intreface/easing.js.map +1 -0
  95. package/cjs/intreface/state.d.ts +35 -0
  96. package/cjs/intreface/state.js +6 -0
  97. package/cjs/intreface/state.js.map +1 -0
  98. package/cjs/intreface/ticker.d.ts +37 -0
  99. package/cjs/intreface/ticker.js +10 -0
  100. package/cjs/intreface/ticker.js.map +1 -0
  101. package/cjs/intreface/timeline.d.ts +17 -0
  102. package/cjs/intreface/timeline.js +6 -0
  103. package/cjs/intreface/timeline.js.map +1 -0
  104. package/cjs/intreface/type.d.ts +13 -0
  105. package/cjs/intreface/type.js +15 -0
  106. package/cjs/intreface/type.js.map +1 -0
  107. package/cjs/register.d.ts +1 -0
  108. package/cjs/register.js +19 -0
  109. package/cjs/register.js.map +1 -0
  110. package/cjs/state/animation-state-machine.d.ts +22 -0
  111. package/cjs/state/animation-state-machine.js +53 -0
  112. package/cjs/state/animation-state-machine.js.map +1 -0
  113. package/cjs/state/animation-state-queue.d.ts +24 -0
  114. package/cjs/state/animation-state-queue.js +66 -0
  115. package/cjs/state/animation-state-queue.js.map +1 -0
  116. package/cjs/state/animation-state-registry.d.ts +14 -0
  117. package/cjs/state/animation-state-registry.js +53 -0
  118. package/cjs/state/animation-state-registry.js.map +1 -0
  119. package/cjs/state/animation-state.d.ts +25 -0
  120. package/cjs/state/animation-state.js +80 -0
  121. package/cjs/state/animation-state.js.map +1 -0
  122. package/cjs/state/animation-states-registry.d.ts +17 -0
  123. package/cjs/state/animation-states-registry.js +95 -0
  124. package/cjs/state/animation-states-registry.js.map +1 -0
  125. package/cjs/state/graphic-extension.d.ts +12 -0
  126. package/cjs/state/graphic-extension.js +37 -0
  127. package/cjs/state/graphic-extension.js.map +1 -0
  128. package/cjs/state/index.d.ts +3 -0
  129. package/cjs/state/index.js +22 -0
  130. package/cjs/state/index.js.map +1 -0
  131. package/cjs/state/types.d.ts +11 -0
  132. package/cjs/state/types.js +6 -0
  133. package/cjs/state/types.js.map +1 -0
  134. package/cjs/step.d.ts +49 -0
  135. package/cjs/step.js +124 -0
  136. package/cjs/step.js.map +1 -0
  137. package/cjs/ticker/default-ticker.d.ts +39 -0
  138. package/cjs/ticker/default-ticker.js +133 -0
  139. package/cjs/ticker/default-ticker.js.map +1 -0
  140. package/cjs/ticker/manual-ticker.d.ts +6 -0
  141. package/cjs/ticker/manual-ticker.js +37 -0
  142. package/cjs/ticker/manual-ticker.js.map +1 -0
  143. package/cjs/timeline.d.ts +34 -0
  144. package/cjs/timeline.js +84 -0
  145. package/cjs/timeline.js.map +1 -0
  146. package/cjs/utils/easing-func.d.ts +1 -0
  147. package/cjs/utils/easing-func.js +16 -0
  148. package/cjs/utils/easing-func.js.map +1 -0
  149. package/cjs/utils/easing.d.ts +49 -0
  150. package/cjs/utils/easing.js +141 -0
  151. package/cjs/utils/easing.js.map +1 -0
  152. package/dist/index.es.js +3824 -0
  153. package/es/animate-extension.d.ts +15 -0
  154. package/es/animate-extension.js +42 -0
  155. package/es/animate-extension.js.map +1 -0
  156. package/es/animate.d.ts +71 -0
  157. package/es/animate.js +207 -0
  158. package/es/animate.js.map +1 -0
  159. package/es/custom/clip-graphic.d.ts +53 -0
  160. package/es/custom/clip-graphic.js +134 -0
  161. package/es/custom/clip-graphic.js.map +1 -0
  162. package/es/custom/clip.d.ts +13 -0
  163. package/es/custom/clip.js +14 -0
  164. package/es/custom/clip.js.map +1 -0
  165. package/es/custom/common.d.ts +22 -0
  166. package/es/custom/common.js +48 -0
  167. package/es/custom/common.js.map +1 -0
  168. package/es/custom/custom-animate.d.ts +15 -0
  169. package/es/custom/custom-animate.js +17 -0
  170. package/es/custom/custom-animate.js.map +1 -0
  171. package/es/custom/fade.d.ts +13 -0
  172. package/es/custom/fade.js +14 -0
  173. package/es/custom/fade.js.map +1 -0
  174. package/es/custom/group-fade.d.ts +16 -0
  175. package/es/custom/group-fade.js +56 -0
  176. package/es/custom/group-fade.js.map +1 -0
  177. package/es/custom/growAngle.d.ts +37 -0
  178. package/es/custom/growAngle.js +132 -0
  179. package/es/custom/growAngle.js.map +1 -0
  180. package/es/custom/growCenter.d.ts +17 -0
  181. package/es/custom/growCenter.js +155 -0
  182. package/es/custom/growCenter.js.map +1 -0
  183. package/es/custom/growHeight.d.ts +36 -0
  184. package/es/custom/growHeight.js +144 -0
  185. package/es/custom/growHeight.js.map +1 -0
  186. package/es/custom/growPoints.d.ts +52 -0
  187. package/es/custom/growPoints.js +219 -0
  188. package/es/custom/growPoints.js.map +1 -0
  189. package/es/custom/growRadius.d.ts +41 -0
  190. package/es/custom/growRadius.js +105 -0
  191. package/es/custom/growRadius.js.map +1 -0
  192. package/es/custom/growWidth.d.ts +36 -0
  193. package/es/custom/growWidth.js +144 -0
  194. package/es/custom/growWidth.js.map +1 -0
  195. package/es/custom/input-text.d.ts +29 -0
  196. package/es/custom/input-text.js +37 -0
  197. package/es/custom/input-text.js.map +1 -0
  198. package/es/custom/number.d.ts +25 -0
  199. package/es/custom/number.js +94 -0
  200. package/es/custom/number.js.map +1 -0
  201. package/es/custom/register.d.ts +1 -0
  202. package/es/custom/register.js +39 -0
  203. package/es/custom/register.js.map +1 -0
  204. package/es/custom/scale-in.d.ts +13 -0
  205. package/es/custom/scale-in.js +49 -0
  206. package/es/custom/scale-in.js.map +1 -0
  207. package/es/custom/scale.d.ts +20 -0
  208. package/es/custom/scale.js +96 -0
  209. package/es/custom/scale.js.map +1 -0
  210. package/es/custom/sphere.d.ts +20 -0
  211. package/es/custom/sphere.js +20 -0
  212. package/es/custom/sphere.js.map +1 -0
  213. package/es/custom/state.d.ts +13 -0
  214. package/es/custom/state.js +17 -0
  215. package/es/custom/state.js.map +1 -0
  216. package/es/custom/tag-points.d.ts +26 -0
  217. package/es/custom/tag-points.js +77 -0
  218. package/es/custom/tag-points.js.map +1 -0
  219. package/es/custom/update.d.ts +14 -0
  220. package/es/custom/update.js +18 -0
  221. package/es/custom/update.js.map +1 -0
  222. package/es/executor/animate-executor.d.ts +36 -0
  223. package/es/executor/animate-executor.js +169 -0
  224. package/es/executor/animate-executor.js.map +1 -0
  225. package/es/executor/executor.d.ts +69 -0
  226. package/es/executor/executor.js +2 -0
  227. package/es/executor/executor.js.map +1 -0
  228. package/es/index.d.ts +25 -0
  229. package/es/index.js +50 -0
  230. package/es/index.js.map +1 -0
  231. package/es/interpolate/executor.d.ts +66 -0
  232. package/es/interpolate/executor.js +2 -0
  233. package/es/interpolate/executor.js.map +1 -0
  234. package/es/interpolate/number.d.ts +1 -0
  235. package/es/interpolate/number.js +4 -0
  236. package/es/interpolate/number.js.map +1 -0
  237. package/es/interpolate/store.d.ts +32 -0
  238. package/es/interpolate/store.js +88 -0
  239. package/es/interpolate/store.js.map +1 -0
  240. package/es/intreface/animate.d.ts +91 -0
  241. package/es/intreface/animate.js +6 -0
  242. package/es/intreface/animate.js.map +1 -0
  243. package/es/intreface/easing.d.ts +3 -0
  244. package/es/intreface/easing.js +2 -0
  245. package/es/intreface/easing.js.map +1 -0
  246. package/es/intreface/state.d.ts +35 -0
  247. package/es/intreface/state.js +2 -0
  248. package/es/intreface/state.js.map +1 -0
  249. package/es/intreface/ticker.d.ts +37 -0
  250. package/es/intreface/ticker.js +6 -0
  251. package/es/intreface/ticker.js.map +1 -0
  252. package/es/intreface/timeline.d.ts +17 -0
  253. package/es/intreface/timeline.js +2 -0
  254. package/es/intreface/timeline.js.map +1 -0
  255. package/es/intreface/type.d.ts +13 -0
  256. package/es/intreface/type.js +14 -0
  257. package/es/intreface/type.js.map +1 -0
  258. package/es/register.d.ts +1 -0
  259. package/es/register.js +20 -0
  260. package/es/register.js.map +1 -0
  261. package/es/state/animation-state-machine.d.ts +22 -0
  262. package/es/state/animation-state-machine.js +47 -0
  263. package/es/state/animation-state-machine.js.map +1 -0
  264. package/es/state/animation-state-queue.d.ts +24 -0
  265. package/es/state/animation-state-queue.js +58 -0
  266. package/es/state/animation-state-queue.js.map +1 -0
  267. package/es/state/animation-state-registry.d.ts +14 -0
  268. package/es/state/animation-state-registry.js +45 -0
  269. package/es/state/animation-state-registry.js.map +1 -0
  270. package/es/state/animation-state.d.ts +25 -0
  271. package/es/state/animation-state.js +72 -0
  272. package/es/state/animation-state.js.map +1 -0
  273. package/es/state/animation-states-registry.d.ts +17 -0
  274. package/es/state/animation-states-registry.js +87 -0
  275. package/es/state/animation-states-registry.js.map +1 -0
  276. package/es/state/graphic-extension.d.ts +12 -0
  277. package/es/state/graphic-extension.js +29 -0
  278. package/es/state/graphic-extension.js.map +1 -0
  279. package/es/state/index.d.ts +3 -0
  280. package/es/state/index.js +6 -0
  281. package/es/state/index.js.map +1 -0
  282. package/es/state/types.d.ts +11 -0
  283. package/es/state/types.js +2 -0
  284. package/es/state/types.js.map +1 -0
  285. package/es/step.d.ts +49 -0
  286. package/es/step.js +120 -0
  287. package/es/step.js.map +1 -0
  288. package/es/ticker/default-ticker.d.ts +39 -0
  289. package/es/ticker/default-ticker.js +129 -0
  290. package/es/ticker/default-ticker.js.map +1 -0
  291. package/es/ticker/manual-ticker.d.ts +6 -0
  292. package/es/ticker/manual-ticker.js +29 -0
  293. package/es/ticker/manual-ticker.js.map +1 -0
  294. package/es/timeline.d.ts +34 -0
  295. package/es/timeline.js +79 -0
  296. package/es/timeline.js.map +1 -0
  297. package/es/utils/easing-func.d.ts +1 -0
  298. package/es/utils/easing-func.js +8 -0
  299. package/es/utils/easing-func.js.map +1 -0
  300. package/es/utils/easing.d.ts +49 -0
  301. package/es/utils/easing.js +134 -0
  302. package/es/utils/easing.js.map +1 -0
  303. package/package.json +72 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/growCenter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuBlD,MAAM,YAAY,GAA4B,CAC5C,OAAiB,EACjB,OAAuC,EACvC,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,QAAQ,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,EAAE;QAC1B,KAAK,GAAG,CAAC,CAAC;YACR,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAE1B,OAAO;gBACL,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC;oBAClB,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;wBAChB,EAAE,EAAE,SAAS;wBACb,KAAK,EAAE,CAAC;qBACT;oBACH,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;wBACf,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;wBAChB,KAAK,EAAE,SAAS;qBACjB;gBACL,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;aACrB,CAAC;SACH;QACD,KAAK,GAAG,CAAC,CAAC;YACR,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YAE5B,OAAO;gBACL,IAAI,EAAE,OA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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,CAAC;IAED,KAAK,CAAC,EAA6C;QACjD,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF","file":"growCenter.js","sourcesContent":["import type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isValid } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nconst growCenterIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n from: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n },\n to: { x, x1, width }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n from: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n },\n to: { y, y1, height }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n const from: any = {};\n\n if (isValid(width)) {\n from.x = x + width / 2;\n from.width = 0;\n from.x1 = undefined;\n } else {\n from.x = (x + x1) / 2;\n from.x1 = (x + x1) / 2;\n from.width = undefined;\n }\n\n if (isValid(height)) {\n from.y = y + height / 2;\n from.height = 0;\n from.y1 = undefined;\n } else {\n from.y = (y + y1) / 2;\n from.y1 = (y + y1) / 2;\n from.height = undefined;\n }\n\n return {\n from,\n to: { x, y, x1, y1, width, height }\n };\n }\n }\n};\n\nconst growCenterOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n switch (options?.direction) {\n case 'x': {\n const x = attrs.x;\n const x1 = attrs.x1;\n const width = attrs.width;\n\n return {\n to: isValid(width)\n ? {\n x: x + width / 2,\n x1: undefined,\n width: 0\n }\n : {\n x: (x + x1) / 2,\n x1: (x + x1) / 2,\n width: undefined\n }\n };\n }\n case 'y': {\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n return {\n to: isValid(height)\n ? {\n y: y + height / 2,\n y1: undefined,\n height: 0\n }\n : {\n y: (y + y1) / 2,\n y1: (y + y1) / 2,\n height: undefined\n }\n };\n }\n case 'xy':\n default: {\n const x = attrs.x;\n const y = attrs.y;\n const x1 = attrs.x1;\n const y1 = attrs.y1;\n const width = attrs.width;\n const height = attrs.height;\n const to: any = {};\n\n if (isValid(width)) {\n to.x = x + width / 2;\n to.width = 0;\n to.x1 = undefined;\n } else {\n to.x = (x + x1) / 2;\n to.x1 = (x + x1) / 2;\n to.width = undefined;\n }\n\n if (isValid(height)) {\n to.y = y + height / 2;\n to.height = 0;\n to.y1 = undefined;\n } else {\n to.y = (y + y1) / 2;\n to.y1 = (y + y1) / 2;\n to.height = undefined;\n }\n\n return {\n to\n };\n }\n }\n};\n\n/**\n * 增长渐入\n */\nexport class GrowCenterIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const { from, to } = growCenterIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n\nexport class GrowCenterOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growCenterOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import type { IGraphic, IGroup } from '@visactor/vrender-core';
2
+ import type { IAnimate, IStep } from '../intreface/animate';
3
+ import type { EasingType } from '../intreface/easing';
4
+ import { ACustomAnimate } from './custom-animate';
5
+ interface IAnimationParameters {
6
+ width: number;
7
+ height: number;
8
+ group: IGroup;
9
+ elementIndex: number;
10
+ elementCount: number;
11
+ view: any;
12
+ }
13
+ type TypeAnimation<T extends IGraphic> = (graphic: T, options: any, animationParameters: IAnimationParameters) => {
14
+ from?: {
15
+ [channel: string]: any;
16
+ };
17
+ to?: {
18
+ [channel: string]: any;
19
+ };
20
+ };
21
+ export declare class GrowHeightIn extends ACustomAnimate<Record<string, number>> {
22
+ valid: boolean;
23
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
24
+ onBind(): void;
25
+ onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
26
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
27
+ }
28
+ export declare const growHeightOut: TypeAnimation<IGraphic>;
29
+ export declare class GrowHeightOut extends ACustomAnimate<Record<string, number>> {
30
+ valid: boolean;
31
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
32
+ onBind(): void;
33
+ onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
34
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
35
+ }
36
+ export {};
@@ -0,0 +1,144 @@
1
+ import { isNil, isNumber, isValid } from "@visactor/vutils";
2
+
3
+ import { ACustomAnimate } from "./custom-animate";
4
+
5
+ function growHeightInIndividual(graphic, options, animationParameters) {
6
+ const attrs = graphic.getFinalAttribute(), y = attrs.y, y1 = attrs.y1, height = attrs.height;
7
+ if (options && "negative" === options.orient) {
8
+ const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);
9
+ return {
10
+ from: {
11
+ y: computedY1,
12
+ y1: isNil(y1) ? void 0 : computedY1,
13
+ height: isNil(height) ? void 0 : 0
14
+ },
15
+ to: {
16
+ y: y,
17
+ y1: y1,
18
+ height: height
19
+ }
20
+ };
21
+ }
22
+ const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);
23
+ return {
24
+ from: {
25
+ y: computedY,
26
+ y1: isNil(y1) ? void 0 : computedY,
27
+ height: isNil(height) ? void 0 : 0
28
+ },
29
+ to: {
30
+ y: y,
31
+ y1: y1,
32
+ height: height
33
+ }
34
+ };
35
+ }
36
+
37
+ function growHeightInOverall(graphic, options, animationParameters) {
38
+ var _a;
39
+ const attrs = graphic.getFinalAttribute(), y = attrs.y, y1 = attrs.y1, height = attrs.height;
40
+ let overallValue;
41
+ return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
42
+ animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber(null == options ? void 0 : options.overall) ? options.overall : 0,
43
+ {
44
+ from: {
45
+ y: overallValue,
46
+ y1: isNil(y1) ? void 0 : overallValue,
47
+ height: isNil(height) ? void 0 : 0
48
+ },
49
+ to: {
50
+ y: y,
51
+ y1: y1,
52
+ height: height
53
+ }
54
+ };
55
+ }
56
+
57
+ const growHeightIn = (graphic, options, animationParameters) => {
58
+ var _a;
59
+ return !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growHeightInOverall(graphic, options, animationParameters) : growHeightInIndividual(graphic, options, animationParameters);
60
+ };
61
+
62
+ export class GrowHeightIn extends ACustomAnimate {
63
+ constructor(from, to, duration, easing, params) {
64
+ super(from, to, duration, easing, params);
65
+ }
66
+ onBind() {
67
+ var _a;
68
+ const {from: from, to: to} = growHeightIn(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
69
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
70
+ this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
71
+ }
72
+ onEnd(cb) {
73
+ super.onEnd(cb);
74
+ }
75
+ onUpdate(end, ratio, out) {
76
+ this.propKeys.forEach((key => {
77
+ out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
78
+ })), this.target.setAttributes(out);
79
+ }
80
+ }
81
+
82
+ function growHeightOutIndividual(graphic, options, animationParameters) {
83
+ const attrs = graphic.getFinalAttribute(), y = attrs.y, y1 = attrs.y1, height = attrs.height;
84
+ if (options && "negative" === options.orient) {
85
+ const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);
86
+ return {
87
+ to: {
88
+ y: computedY1,
89
+ y1: isNil(y1) ? void 0 : computedY1,
90
+ height: isNil(height) ? void 0 : 0
91
+ }
92
+ };
93
+ }
94
+ const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);
95
+ return {
96
+ to: {
97
+ y: computedY,
98
+ y1: isNil(y1) ? void 0 : computedY,
99
+ height: isNil(height) ? void 0 : 0
100
+ }
101
+ };
102
+ }
103
+
104
+ function growHeightOutOverall(graphic, options, animationParameters) {
105
+ var _a;
106
+ const attrs = graphic.getFinalAttribute(), y1 = attrs.y1, height = attrs.height;
107
+ let overallValue;
108
+ return options && "negative" === options.orient ? isNumber(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
109
+ animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber(null == options ? void 0 : options.overall) ? options.overall : 0,
110
+ {
111
+ to: {
112
+ y: overallValue,
113
+ y1: isNil(y1) ? void 0 : overallValue,
114
+ height: isNil(height) ? void 0 : 0
115
+ }
116
+ };
117
+ }
118
+
119
+ export const growHeightOut = (graphic, options, animationParameters) => {
120
+ var _a;
121
+ return !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growHeightOutOverall(graphic, options, animationParameters) : growHeightOutIndividual(graphic, options, animationParameters);
122
+ };
123
+
124
+ export class GrowHeightOut extends ACustomAnimate {
125
+ constructor(from, to, duration, easing, params) {
126
+ super(from, to, duration, easing, params);
127
+ }
128
+ onBind() {
129
+ const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
130
+ options = this.params.options, animationParameters = this.params, !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growHeightOutOverall(graphic, options, animationParameters) : growHeightOutIndividual(graphic, options, animationParameters));
131
+ var graphic, options, animationParameters, _a;
132
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
133
+ this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
134
+ }
135
+ onEnd(cb) {
136
+ super.onEnd(cb);
137
+ }
138
+ onUpdate(end, ratio, out) {
139
+ this.propKeys.forEach((key => {
140
+ out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
141
+ })), this.target.setAttributes(out);
142
+ }
143
+ }
144
+ //# sourceMappingURL=growHeight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/growHeight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuBlD,SAAS,sBAAsB,CAC7B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EA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CAAC,CAAC;QAClF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;QAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IAEf,CAAC;IAED,KAAK,CAAC,EAA6C;QACjD,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF","file":"growHeight.js","sourcesContent":["import type { IGraphic, IGroup } from '@visactor/vrender-core';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nfunction growHeightInIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n return {\n from: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n from: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nfunction growHeightInOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n from: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 },\n to: { y: y, y1: y1, height: height }\n };\n}\n\nconst growHeightIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightInOverall(graphic, options, animationParameters)\n : growHeightInIndividual(graphic, options, animationParameters);\n};\n\n/**\n * 增长渐入\n */\nexport class GrowHeightIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const { from, to } = growHeightIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n\nfunction growHeightOutIndividual(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y = attrs.y;\n const y1 = attrs.y1;\n const height = attrs.height;\n\n if (options && options.orient === 'negative') {\n const computedY1 = isValid(height) ? Math.max(y, y + height) : Math.max(y, y1);\n\n return {\n to: { y: computedY1, y1: isNil(y1) ? undefined : computedY1, height: isNil(height) ? undefined : 0 }\n };\n }\n\n const computedY = isValid(height) ? Math.min(y, y + height) : Math.min(y, y1);\n return {\n to: { y: computedY, y1: isNil(y1) ? undefined : computedY, height: isNil(height) ? undefined : 0 }\n };\n}\n\nfunction growHeightOutOverall(\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) {\n const attrs = graphic.getFinalAttribute();\n const y1 = attrs.y1;\n const height = attrs.height;\n\n let overallValue: number;\n if (options && options.orient === 'negative') {\n if (isNumber(options.overall)) {\n overallValue = options.overall;\n } else if (animationParameters.group) {\n overallValue = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = overallValue;\n } else {\n overallValue = animationParameters.height;\n }\n } else {\n overallValue = isNumber(options?.overall) ? options.overall : 0;\n }\n return {\n to: { y: overallValue, y1: isNil(y1) ? undefined : overallValue, height: isNil(height) ? undefined : 0 }\n };\n}\n\n/**\n * 增长渐出\n */\nexport const growHeightOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowCartesianAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growHeightOutOverall(graphic, options, animationParameters)\n : growHeightOutIndividual(graphic, options, animationParameters);\n};\n\nexport class GrowHeightOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growHeightOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n // this.target.setAttributes(from);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import { type IGraphic, type IGroup } from '@visactor/vrender-core';
2
+ import type { IPointLike } from '@visactor/vutils';
3
+ import type { EasingType } from '../intreface/easing';
4
+ import { ACustomAnimate } from './custom-animate';
5
+ interface IAnimationParameters {
6
+ width: number;
7
+ height: number;
8
+ group: IGroup;
9
+ elementIndex: number;
10
+ elementCount: number;
11
+ view: any;
12
+ }
13
+ type TypeAnimation<T extends IGraphic> = (graphic: T, options: any, animationParameters: IAnimationParameters) => {
14
+ from?: {
15
+ [channel: string]: any;
16
+ };
17
+ to?: {
18
+ [channel: string]: any;
19
+ };
20
+ };
21
+ export interface IGrowPointsAnimationOptions {
22
+ orient?: 'positive' | 'negative';
23
+ }
24
+ export interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {
25
+ center?: IPointLike;
26
+ }
27
+ export declare const growPointsIn: TypeAnimation<IGraphic>;
28
+ export declare const growPointsOut: TypeAnimation<IGraphic>;
29
+ export declare class GworPointsBase extends ACustomAnimate<Record<string, number>> {
30
+ valid: boolean;
31
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
32
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
33
+ }
34
+ export declare class GrowPointsIn extends GworPointsBase {
35
+ onBind(): void;
36
+ }
37
+ export declare class GrowPointsOut extends GworPointsBase {
38
+ onBind(): void;
39
+ }
40
+ export declare class GrowPointsXIn extends GworPointsBase {
41
+ onBind(): void;
42
+ }
43
+ export declare class GrowPointsXOut extends GworPointsBase {
44
+ onBind(): void;
45
+ }
46
+ export declare class GrowPointsYIn extends GworPointsBase {
47
+ onBind(): void;
48
+ }
49
+ export declare class GrowPointsYOut extends GworPointsBase {
50
+ onBind(): void;
51
+ }
52
+ export {};
@@ -0,0 +1,219 @@
1
+ import { pointInterpolation } from "@visactor/vrender-core";
2
+
3
+ import { isValidNumber } from "@visactor/vutils";
4
+
5
+ import { ACustomAnimate } from "./custom-animate";
6
+
7
+ const getCenterPoints = (graphic, options, animationParameters) => {
8
+ const points = graphic.getFinalAttribute().points, center = {
9
+ x: 0,
10
+ y: 0
11
+ };
12
+ return points.forEach((point => {
13
+ center.x += point.x, center.y += point.y;
14
+ })), center.x /= points.length, center.y /= points.length, options && options.center && (isValidNumber(options.center.x) && (center.x = options.center.x),
15
+ isValidNumber(options.center.y) && (center.y = options.center.y)), "area" === graphic.type && (center.x1 = center.x,
16
+ center.y1 = center.y), points.map((point => Object.assign({}, point, center)));
17
+ };
18
+
19
+ export const growPointsIn = (graphic, options, animationParameters) => {
20
+ const attrs = graphic.getFinalAttribute();
21
+ return {
22
+ from: {
23
+ points: getCenterPoints(graphic, options)
24
+ },
25
+ to: {
26
+ points: attrs.points
27
+ }
28
+ };
29
+ };
30
+
31
+ export const growPointsOut = (graphic, options, animationParameters) => ({
32
+ from: {
33
+ points: graphic.getFinalAttribute().points
34
+ },
35
+ to: {
36
+ points: getCenterPoints(graphic, options)
37
+ }
38
+ });
39
+
40
+ export class GworPointsBase extends ACustomAnimate {
41
+ constructor(from, to, duration, easing, params) {
42
+ super(from, to, duration, easing, params);
43
+ }
44
+ onUpdate(end, ratio, out) {
45
+ var _a, _b;
46
+ const fromPoints = null === (_a = this.from) || void 0 === _a ? void 0 : _a.points, toPoints = null === (_b = this.to) || void 0 === _b ? void 0 : _b.points;
47
+ fromPoints && toPoints && (out.points = fromPoints.map(((point, index) => pointInterpolation(fromPoints[index], toPoints[index], ratio))),
48
+ this.target.setAttributes(out));
49
+ }
50
+ }
51
+
52
+ export class GrowPointsIn extends GworPointsBase {
53
+ onBind() {
54
+ var _a;
55
+ if ([ "area", "line" ].includes(this.target.type)) {
56
+ const {from: from, to: to} = growPointsIn(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
57
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
58
+ this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
59
+ } else this.valid = !1;
60
+ }
61
+ }
62
+
63
+ export class GrowPointsOut extends GworPointsBase {
64
+ onBind() {
65
+ if ([ "area", "line" ].includes(this.target.type)) {
66
+ const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
67
+ options = this.params.options, this.params, {
68
+ from: {
69
+ points: graphic.getFinalAttribute().points
70
+ },
71
+ to: {
72
+ points: getCenterPoints(graphic, options)
73
+ }
74
+ });
75
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
76
+ this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
77
+ } else this.valid = !1;
78
+ var graphic, options;
79
+ }
80
+ }
81
+
82
+ const changePointsX = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
83
+ var _a;
84
+ if (options && "negative" === options.orient) {
85
+ let groupRight = animationParameters.width;
86
+ return animationParameters.group && (groupRight = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(),
87
+ animationParameters.groupWidth = groupRight), Object.assign(Object.assign({}, point), {
88
+ x: groupRight,
89
+ y: point.y,
90
+ x1: groupRight,
91
+ y1: point.y1,
92
+ defined: !1 !== point.defined
93
+ });
94
+ }
95
+ return Object.assign(Object.assign({}, point), {
96
+ x: 0,
97
+ y: point.y,
98
+ x1: 0,
99
+ y1: point.y1,
100
+ defined: !1 !== point.defined
101
+ });
102
+ })), growPointsXIn = (graphic, options, animationParameters) => {
103
+ const attrs = graphic.getFinalAttribute();
104
+ return {
105
+ from: {
106
+ points: changePointsX(graphic, options, animationParameters)
107
+ },
108
+ to: {
109
+ points: attrs.points
110
+ }
111
+ };
112
+ }, growPointsXOut = (graphic, options, animationParameters) => ({
113
+ from: {
114
+ points: graphic.getFinalAttribute().points
115
+ },
116
+ to: {
117
+ points: changePointsX(graphic, options, animationParameters)
118
+ }
119
+ });
120
+
121
+ export class GrowPointsXIn extends GworPointsBase {
122
+ onBind() {
123
+ var _a;
124
+ if ([ "area", "line" ].includes(this.target.type)) {
125
+ const {from: from, to: to} = growPointsXIn(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
126
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
127
+ this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
128
+ } else this.valid = !1;
129
+ }
130
+ }
131
+
132
+ export class GrowPointsXOut extends GworPointsBase {
133
+ onBind() {
134
+ if ([ "area", "line" ].includes(this.target.type)) {
135
+ const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
136
+ options = this.params.options, animationParameters = this.params, {
137
+ from: {
138
+ points: graphic.getFinalAttribute().points
139
+ },
140
+ to: {
141
+ points: changePointsX(graphic, options, animationParameters)
142
+ }
143
+ });
144
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
145
+ this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
146
+ } else this.valid = !1;
147
+ var graphic, options, animationParameters;
148
+ }
149
+ }
150
+
151
+ const changePointsY = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
152
+ var _a;
153
+ if (options && "negative" === options.orient) {
154
+ let groupBottom = animationParameters.height;
155
+ return animationParameters.group && (groupBottom = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
156
+ animationParameters.groupHeight = groupBottom), Object.assign(Object.assign({}, point), {
157
+ x: point.x,
158
+ y: groupBottom,
159
+ x1: point.x1,
160
+ y1: groupBottom,
161
+ defined: !1 !== point.defined
162
+ });
163
+ }
164
+ return Object.assign(Object.assign({}, point), {
165
+ x: point.x,
166
+ y: 0,
167
+ x1: point.x1,
168
+ y1: 0,
169
+ defined: !1 !== point.defined
170
+ });
171
+ })), growPointsYIn = (graphic, options, animationParameters) => {
172
+ const attrs = graphic.getFinalAttribute();
173
+ return {
174
+ from: {
175
+ points: changePointsY(graphic, options, animationParameters)
176
+ },
177
+ to: {
178
+ points: attrs.points
179
+ }
180
+ };
181
+ }, growPointsYOut = (graphic, options, animationParameters) => ({
182
+ from: {
183
+ points: graphic.getFinalAttribute().points
184
+ },
185
+ to: {
186
+ points: changePointsY(graphic, options, animationParameters)
187
+ }
188
+ });
189
+
190
+ export class GrowPointsYIn extends GworPointsBase {
191
+ onBind() {
192
+ var _a;
193
+ if ([ "area", "line" ].includes(this.target.type)) {
194
+ const {from: from, to: to} = growPointsYIn(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
195
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
196
+ this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
197
+ } else this.valid = !1;
198
+ }
199
+ }
200
+
201
+ export class GrowPointsYOut extends GworPointsBase {
202
+ onBind() {
203
+ if ([ "area", "line" ].includes(this.target.type)) {
204
+ const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
205
+ options = this.params.options, animationParameters = this.params, {
206
+ from: {
207
+ points: graphic.getFinalAttribute().points
208
+ },
209
+ to: {
210
+ points: changePointsY(graphic, options, animationParameters)
211
+ }
212
+ });
213
+ this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
214
+ this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
215
+ } else this.valid = !1;
216
+ var graphic, options, animationParameters;
217
+ }
218
+ }
219
+ //# sourceMappingURL=growPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/growPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA8B,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlD,MAAM,eAAe,GAAG,CACtB,OAAiB,EACjB,OAA2C,EAC3C,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAiB,KAAK,CAAC,MAAM,CAAC;IAC1C,MAAM,MAAM,GAAe,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC1C,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;QACpB,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC;IAC1B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AC,EAAE;YAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC9C,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACnF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;YAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;YAC1B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;SACd;aAAM;YACL,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;SACpB;IACH,CAAC;CACF","file":"growPoints.js","sourcesContent":["import { pointInterpolation, type IGraphic, type IGroup } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport { isValidNumber } from '@visactor/vutils';\nimport type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IAnimationParameters {\n width: number;\n height: number;\n group: IGroup;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\ntype TypeAnimation<T extends IGraphic> = (\n graphic: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nconst getCenterPoints = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points: IPointLike[] = attrs.points;\n const center: IPointLike = { x: 0, y: 0 };\n points.forEach(point => {\n center.x += point.x;\n center.y += point.y;\n });\n center.x /= points.length;\n center.y /= points.length;\n\n if (options && options.center) {\n if (isValidNumber(options.center.x)) {\n center.x = options.center.x;\n }\n if (isValidNumber(options.center.y)) {\n center.y = options.center.y;\n }\n }\n\n if (graphic.type === 'area') {\n center.x1 = center.x;\n center.y1 = center.y;\n }\n\n return points.map(point => Object.assign({}, point, center));\n};\n\nexport const growPointsIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: getCenterPoints(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nexport const growPointsOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsOverallAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: getCenterPoints(graphic, options, animationParameters) }\n };\n};\n\nexport class GworPointsBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const fromPoints = this.from?.points as unknown as IPointLike[];\n const toPoints = this.to?.points as unknown as IPointLike[];\n if (!fromPoints || !toPoints) {\n return;\n }\n\n out.points = fromPoints.map((point, index) => {\n const newPoint = pointInterpolation(fromPoints[index], toPoints[index], ratio);\n return newPoint;\n });\n this.target.setAttributes(out);\n }\n}\n\n/**\n * 增长渐入\n */\nexport class GrowPointsIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsX = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupRight = animationParameters.width;\n\n if (animationParameters.group) {\n groupRight = (animationParameters as any).groupWidth ?? animationParameters.group.getBounds().width();\n\n (animationParameters as any).groupWidth = groupRight;\n }\n\n return {\n ...point,\n x: groupRight,\n y: point.y,\n x1: groupRight,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: 0,\n y: point.y,\n x1: 0,\n y1: point.y1,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsXIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsX(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsXOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsX(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsXIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsXIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsXOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsXOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n\nconst changePointsY = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n const points = attrs.points;\n return points.map((point: IPointLike) => {\n if (options && options.orient === 'negative') {\n let groupBottom = animationParameters.height;\n\n if (animationParameters.group) {\n groupBottom = (animationParameters as any).groupHeight ?? animationParameters.group.getBounds().height();\n\n (animationParameters as any).groupHeight = groupBottom;\n }\n\n return {\n ...point,\n x: point.x,\n y: groupBottom,\n x1: point.x1,\n y1: groupBottom,\n defined: point.defined !== false\n } as IPointLike;\n }\n return {\n ...point,\n x: point.x,\n y: 0,\n x1: point.x1,\n y1: 0,\n defined: point.defined !== false\n } as IPointLike;\n });\n};\n\nconst growPointsYIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: changePointsY(graphic, options, animationParameters) },\n to: { points: attrs.points }\n };\n};\n\nconst growPointsYOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowPointsAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n return {\n from: { points: attrs.points },\n to: { points: changePointsY(graphic, options, animationParameters) }\n };\n};\n\nexport class GrowPointsYIn extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const { from, to } = growPointsYIn(this.target, this.params.options, this.params);\n const fromAttrs = this.target.context.lastAttrs ?? from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = fromAttrs;\n this.to = to;\n this.target.setAttributes(fromAttrs);\n } else {\n this.valid = false;\n }\n }\n}\n\nexport class GrowPointsYOut extends GworPointsBase {\n onBind(): void {\n if (['area', 'line'].includes(this.target.type)) {\n const attrs = this.target.getFinalAttribute();\n const { from, to } = growPointsYOut(this.target, this.params.options, this.params);\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.animate.reSyncProps();\n this.from = from || attrs;\n this.to = to;\n } else {\n this.valid = false;\n }\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { type IGraphic, type IGroup } from '@visactor/vrender-core';
2
+ import type { EasingType } from '../intreface/easing';
3
+ import { ACustomAnimate } from './custom-animate';
4
+ interface IAnimationParameters {
5
+ width: number;
6
+ height: number;
7
+ group: IGroup;
8
+ elementIndex: number;
9
+ elementCount: number;
10
+ view: any;
11
+ }
12
+ type TypeAnimation<T extends IGraphic> = (graphic: T, options: any, animationParameters: IAnimationParameters) => {
13
+ from?: {
14
+ [channel: string]: any;
15
+ };
16
+ to?: {
17
+ [channel: string]: any;
18
+ };
19
+ };
20
+ export interface IGrowAngleAnimationOptions {
21
+ orient?: 'clockwise' | 'anticlockwise';
22
+ overall?: boolean | number;
23
+ }
24
+ export interface IGrowRadiusAnimationOptions {
25
+ orient?: 'inside' | 'outside';
26
+ overall?: boolean | number;
27
+ }
28
+ export declare const growRadiusIn: TypeAnimation<IGraphic>;
29
+ export declare const growRadiusOut: TypeAnimation<IGraphic>;
30
+ export declare class GworPointsBase extends ACustomAnimate<Record<string, number>> {
31
+ valid: boolean;
32
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
33
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
34
+ }
35
+ export declare class GrowRadiusIn extends GworPointsBase {
36
+ onBind(): void;
37
+ }
38
+ export declare class GrowRadiusOut extends GworPointsBase {
39
+ onBind(): void;
40
+ }
41
+ export {};