@visactor/vrender-animate 0.22.4 → 0.22.12

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 (376) hide show
  1. package/cjs/animate-extension.d.ts +12 -5
  2. package/cjs/animate-extension.js +23 -12
  3. package/cjs/animate-extension.js.map +1 -1
  4. package/cjs/animate.d.ts +2 -5
  5. package/cjs/animate.js +23 -18
  6. package/cjs/animate.js.map +1 -1
  7. package/cjs/component/component-animate-extension.d.ts +1 -0
  8. package/cjs/component/component-animate-extension.js +1 -0
  9. package/cjs/component/component-animate-extension.js.map +1 -0
  10. package/cjs/component/component-animator.d.ts +22 -0
  11. package/cjs/component/component-animator.js +67 -0
  12. package/cjs/component/component-animator.js.map +1 -0
  13. package/cjs/component/index.d.ts +1 -0
  14. package/cjs/component/index.js +21 -0
  15. package/cjs/component/index.js.map +1 -0
  16. package/cjs/config/morphing.d.ts +2 -0
  17. package/cjs/config/morphing.js +9 -0
  18. package/cjs/config/morphing.js.map +1 -0
  19. package/cjs/custom/clip-graphic.d.ts +1 -1
  20. package/cjs/custom/clip-graphic.js +2 -2
  21. package/cjs/custom/clip-graphic.js.map +1 -1
  22. package/cjs/custom/clip.d.ts +2 -1
  23. package/cjs/custom/clip.js +9 -1
  24. package/cjs/custom/clip.js.map +1 -1
  25. package/cjs/custom/common.d.ts +1 -3
  26. package/cjs/custom/common.js +21 -17
  27. package/cjs/custom/common.js.map +1 -1
  28. package/cjs/custom/custom-animate.d.ts +7 -3
  29. package/cjs/custom/custom-animate.js +13 -2
  30. package/cjs/custom/custom-animate.js.map +1 -1
  31. package/cjs/custom/fade.d.ts +1 -1
  32. package/cjs/custom/fade.js +7 -2
  33. package/cjs/custom/fade.js.map +1 -1
  34. package/cjs/custom/fromTo.d.ts +10 -0
  35. package/cjs/custom/fromTo.js +42 -0
  36. package/cjs/custom/fromTo.js.map +1 -0
  37. package/cjs/custom/groupFade.d.ts +10 -0
  38. package/cjs/custom/groupFade.js +25 -0
  39. package/cjs/custom/groupFade.js.map +1 -0
  40. package/cjs/custom/growAngle.d.ts +10 -5
  41. package/cjs/custom/growAngle.js +38 -17
  42. package/cjs/custom/growAngle.js.map +1 -1
  43. package/cjs/custom/growCenter.d.ts +1 -2
  44. package/cjs/custom/growCenter.js +16 -10
  45. package/cjs/custom/growCenter.js.map +1 -1
  46. package/cjs/custom/growHeight.d.ts +1 -3
  47. package/cjs/custom/growHeight.js +19 -13
  48. package/cjs/custom/growHeight.js.map +1 -1
  49. package/cjs/custom/growPoints.d.ts +1 -2
  50. package/cjs/custom/growPoints.js +41 -36
  51. package/cjs/custom/growPoints.js.map +1 -1
  52. package/cjs/custom/growRadius.d.ts +4 -5
  53. package/cjs/custom/growRadius.js +22 -18
  54. package/cjs/custom/growRadius.js.map +1 -1
  55. package/cjs/custom/growWidth.d.ts +1 -3
  56. package/cjs/custom/growWidth.js +15 -9
  57. package/cjs/custom/growWidth.js.map +1 -1
  58. package/cjs/custom/input-text.d.ts +1 -2
  59. package/cjs/custom/input-text.js.map +1 -1
  60. package/cjs/custom/label-item-animate.d.ts +7 -0
  61. package/cjs/custom/label-item-animate.js +221 -0
  62. package/cjs/custom/label-item-animate.js.map +1 -0
  63. package/cjs/custom/morphing.d.ts +51 -0
  64. package/cjs/custom/morphing.js +298 -0
  65. package/cjs/custom/morphing.js.map +1 -0
  66. package/cjs/custom/motionPath.d.ts +21 -0
  67. package/cjs/custom/motionPath.js +31 -0
  68. package/cjs/custom/motionPath.js.map +1 -0
  69. package/cjs/custom/move.d.ts +96 -0
  70. package/cjs/custom/move.js +133 -0
  71. package/cjs/custom/move.js.map +1 -0
  72. package/cjs/custom/number.d.ts +1 -2
  73. package/cjs/custom/number.js.map +1 -1
  74. package/cjs/custom/poptip-animate.d.ts +7 -0
  75. package/cjs/custom/poptip-animate.js +109 -0
  76. package/cjs/custom/poptip-animate.js.map +1 -0
  77. package/cjs/custom/register.d.ts +27 -0
  78. package/cjs/custom/register.js +418 -3
  79. package/cjs/custom/register.js.map +1 -1
  80. package/cjs/custom/richtext/input-richtext.d.ts +35 -0
  81. package/cjs/custom/richtext/input-richtext.js +80 -0
  82. package/cjs/custom/richtext/input-richtext.js.map +1 -0
  83. package/cjs/custom/richtext/output-richtext.d.ts +37 -0
  84. package/cjs/custom/richtext/output-richtext.js +94 -0
  85. package/cjs/custom/richtext/output-richtext.js.map +1 -0
  86. package/cjs/custom/richtext/slide-out-richtext.d.ts +38 -0
  87. package/cjs/custom/richtext/slide-out-richtext.js +146 -0
  88. package/cjs/custom/richtext/slide-out-richtext.js.map +1 -0
  89. package/cjs/custom/richtext/slide-richtext.d.ts +36 -0
  90. package/cjs/custom/richtext/slide-richtext.js +144 -0
  91. package/cjs/custom/richtext/slide-richtext.js.map +1 -0
  92. package/cjs/custom/rotate.d.ts +33 -0
  93. package/cjs/custom/rotate.js +79 -0
  94. package/cjs/custom/rotate.js.map +1 -0
  95. package/cjs/custom/scale.d.ts +6 -2
  96. package/cjs/custom/scale.js +32 -17
  97. package/cjs/custom/scale.js.map +1 -1
  98. package/cjs/custom/sphere.d.ts +2 -1
  99. package/cjs/custom/sphere.js +14 -5
  100. package/cjs/custom/sphere.js.map +1 -1
  101. package/cjs/custom/state.d.ts +1 -1
  102. package/cjs/custom/state.js +1 -1
  103. package/cjs/custom/state.js.map +1 -1
  104. package/cjs/custom/story.d.ts +196 -0
  105. package/cjs/custom/story.js +497 -0
  106. package/cjs/custom/story.js.map +1 -0
  107. package/cjs/custom/streamLight.d.ts +27 -0
  108. package/cjs/custom/streamLight.js +161 -0
  109. package/cjs/custom/streamLight.js.map +1 -0
  110. package/cjs/custom/tag-points.d.ts +2 -3
  111. package/cjs/custom/tag-points.js +20 -4
  112. package/cjs/custom/tag-points.js.map +1 -1
  113. package/cjs/custom/update.d.ts +2 -2
  114. package/cjs/custom/update.js +10 -2
  115. package/cjs/custom/update.js.map +1 -1
  116. package/cjs/executor/animate-executor.d.ts +7 -6
  117. package/cjs/executor/animate-executor.js +118 -62
  118. package/cjs/executor/animate-executor.js.map +1 -1
  119. package/cjs/executor/executor.d.ts +9 -3
  120. package/cjs/executor/executor.js.map +1 -1
  121. package/cjs/index.d.ts +8 -8
  122. package/cjs/index.js +50 -18
  123. package/cjs/index.js.map +1 -1
  124. package/cjs/interpolate/store.d.ts +6 -2
  125. package/cjs/interpolate/store.js +13 -2
  126. package/cjs/interpolate/store.js.map +1 -1
  127. package/cjs/register.js +1 -5
  128. package/cjs/register.js.map +1 -1
  129. package/cjs/state/animation-state.d.ts +20 -2
  130. package/cjs/state/animation-state.js +48 -4
  131. package/cjs/state/animation-state.js.map +1 -1
  132. package/cjs/state/animation-states-registry.js +18 -0
  133. package/cjs/state/animation-states-registry.js.map +1 -1
  134. package/cjs/state/graphic-extension.d.ts +7 -1
  135. package/cjs/state/graphic-extension.js +20 -0
  136. package/cjs/state/graphic-extension.js.map +1 -1
  137. package/cjs/step.d.ts +7 -4
  138. package/cjs/step.js +33 -15
  139. package/cjs/step.js.map +1 -1
  140. package/cjs/ticker/default-ticker.d.ts +12 -7
  141. package/cjs/ticker/default-ticker.js +38 -33
  142. package/cjs/ticker/default-ticker.js.map +1 -1
  143. package/cjs/ticker/manual-ticker.d.ts +6 -1
  144. package/cjs/ticker/manual-ticker.js +26 -4
  145. package/cjs/ticker/manual-ticker.js.map +1 -1
  146. package/cjs/timeline.d.ts +14 -7
  147. package/cjs/timeline.js +31 -18
  148. package/cjs/timeline.js.map +1 -1
  149. package/cjs/utils/transform.d.ts +2 -0
  150. package/cjs/utils/transform.js +10 -0
  151. package/cjs/utils/transform.js.map +1 -0
  152. package/dist/index.es.js +3765 -527
  153. package/es/animate-extension.d.ts +12 -5
  154. package/es/animate-extension.js +24 -11
  155. package/es/animate-extension.js.map +1 -1
  156. package/es/animate.d.ts +2 -5
  157. package/es/animate.js +14 -11
  158. package/es/animate.js.map +1 -1
  159. package/es/component/component-animate-extension.d.ts +1 -0
  160. package/es/component/component-animate-extension.js +1 -0
  161. package/es/component/component-animate-extension.js.map +1 -0
  162. package/es/component/component-animator.d.ts +22 -0
  163. package/es/component/component-animator.js +59 -0
  164. package/es/component/component-animator.js.map +1 -0
  165. package/es/component/index.d.ts +1 -0
  166. package/es/component/index.js +2 -0
  167. package/es/component/index.js.map +1 -0
  168. package/es/config/morphing.d.ts +2 -0
  169. package/es/config/morphing.js +5 -0
  170. package/es/config/morphing.js.map +1 -0
  171. package/es/custom/clip-graphic.d.ts +1 -1
  172. package/es/custom/clip-graphic.js +2 -2
  173. package/es/custom/clip-graphic.js.map +1 -1
  174. package/es/custom/clip.d.ts +2 -1
  175. package/es/custom/clip.js +9 -1
  176. package/es/custom/clip.js.map +1 -1
  177. package/es/custom/common.d.ts +1 -3
  178. package/es/custom/common.js +21 -17
  179. package/es/custom/common.js.map +1 -1
  180. package/es/custom/custom-animate.d.ts +7 -3
  181. package/es/custom/custom-animate.js +10 -1
  182. package/es/custom/custom-animate.js.map +1 -1
  183. package/es/custom/fade.d.ts +1 -1
  184. package/es/custom/fade.js +7 -2
  185. package/es/custom/fade.js.map +1 -1
  186. package/es/custom/fromTo.d.ts +10 -0
  187. package/es/custom/fromTo.js +34 -0
  188. package/es/custom/fromTo.js.map +1 -0
  189. package/es/custom/groupFade.d.ts +10 -0
  190. package/es/custom/groupFade.js +15 -0
  191. package/es/custom/groupFade.js.map +1 -0
  192. package/es/custom/growAngle.d.ts +10 -5
  193. package/es/custom/growAngle.js +39 -15
  194. package/es/custom/growAngle.js.map +1 -1
  195. package/es/custom/growCenter.d.ts +1 -2
  196. package/es/custom/growCenter.js +16 -10
  197. package/es/custom/growCenter.js.map +1 -1
  198. package/es/custom/growHeight.d.ts +1 -3
  199. package/es/custom/growHeight.js +20 -14
  200. package/es/custom/growHeight.js.map +1 -1
  201. package/es/custom/growPoints.d.ts +1 -2
  202. package/es/custom/growPoints.js +40 -36
  203. package/es/custom/growPoints.js.map +1 -1
  204. package/es/custom/growRadius.d.ts +4 -5
  205. package/es/custom/growRadius.js +22 -16
  206. package/es/custom/growRadius.js.map +1 -1
  207. package/es/custom/growWidth.d.ts +1 -3
  208. package/es/custom/growWidth.js +16 -10
  209. package/es/custom/growWidth.js.map +1 -1
  210. package/es/custom/input-text.d.ts +1 -2
  211. package/es/custom/input-text.js.map +1 -1
  212. package/es/custom/label-item-animate.d.ts +7 -0
  213. package/es/custom/label-item-animate.js +215 -0
  214. package/es/custom/label-item-animate.js.map +1 -0
  215. package/es/custom/morphing.d.ts +51 -0
  216. package/es/custom/morphing.js +289 -0
  217. package/es/custom/morphing.js.map +1 -0
  218. package/es/custom/motionPath.d.ts +21 -0
  219. package/es/custom/motionPath.js +23 -0
  220. package/es/custom/motionPath.js.map +1 -0
  221. package/es/custom/move.d.ts +96 -0
  222. package/es/custom/move.js +118 -0
  223. package/es/custom/move.js.map +1 -0
  224. package/es/custom/number.d.ts +1 -2
  225. package/es/custom/number.js.map +1 -1
  226. package/es/custom/poptip-animate.d.ts +7 -0
  227. package/es/custom/poptip-animate.js +103 -0
  228. package/es/custom/poptip-animate.js.map +1 -0
  229. package/es/custom/register.d.ts +27 -0
  230. package/es/custom/register.js +48 -1
  231. package/es/custom/register.js.map +1 -1
  232. package/es/custom/richtext/input-richtext.d.ts +35 -0
  233. package/es/custom/richtext/input-richtext.js +74 -0
  234. package/es/custom/richtext/input-richtext.js.map +1 -0
  235. package/es/custom/richtext/output-richtext.d.ts +37 -0
  236. package/es/custom/richtext/output-richtext.js +88 -0
  237. package/es/custom/richtext/output-richtext.js.map +1 -0
  238. package/es/custom/richtext/slide-out-richtext.d.ts +38 -0
  239. package/es/custom/richtext/slide-out-richtext.js +140 -0
  240. package/es/custom/richtext/slide-out-richtext.js.map +1 -0
  241. package/es/custom/richtext/slide-richtext.d.ts +36 -0
  242. package/es/custom/richtext/slide-richtext.js +138 -0
  243. package/es/custom/richtext/slide-richtext.js.map +1 -0
  244. package/es/custom/rotate.d.ts +33 -0
  245. package/es/custom/rotate.js +65 -0
  246. package/es/custom/rotate.js.map +1 -0
  247. package/es/custom/scale.d.ts +6 -2
  248. package/es/custom/scale.js +32 -17
  249. package/es/custom/scale.js.map +1 -1
  250. package/es/custom/sphere.d.ts +2 -1
  251. package/es/custom/sphere.js +14 -5
  252. package/es/custom/sphere.js.map +1 -1
  253. package/es/custom/state.d.ts +1 -1
  254. package/es/custom/state.js +1 -1
  255. package/es/custom/state.js.map +1 -1
  256. package/es/custom/story.d.ts +196 -0
  257. package/es/custom/story.js +468 -0
  258. package/es/custom/story.js.map +1 -0
  259. package/es/custom/streamLight.d.ts +27 -0
  260. package/es/custom/streamLight.js +157 -0
  261. package/es/custom/streamLight.js.map +1 -0
  262. package/es/custom/tag-points.d.ts +2 -3
  263. package/es/custom/tag-points.js +21 -5
  264. package/es/custom/tag-points.js.map +1 -1
  265. package/es/custom/update.d.ts +2 -2
  266. package/es/custom/update.js +10 -2
  267. package/es/custom/update.js.map +1 -1
  268. package/es/executor/animate-executor.d.ts +7 -6
  269. package/es/executor/animate-executor.js +116 -61
  270. package/es/executor/animate-executor.js.map +1 -1
  271. package/es/executor/executor.d.ts +9 -3
  272. package/es/executor/executor.js.map +1 -1
  273. package/es/index.d.ts +8 -8
  274. package/es/index.js +10 -12
  275. package/es/index.js.map +1 -1
  276. package/es/interpolate/store.d.ts +6 -2
  277. package/es/interpolate/store.js +13 -3
  278. package/es/interpolate/store.js.map +1 -1
  279. package/es/register.js +0 -8
  280. package/es/register.js.map +1 -1
  281. package/es/state/animation-state.d.ts +20 -2
  282. package/es/state/animation-state.js +48 -2
  283. package/es/state/animation-state.js.map +1 -1
  284. package/es/state/animation-states-registry.js +18 -0
  285. package/es/state/animation-states-registry.js.map +1 -1
  286. package/es/state/graphic-extension.d.ts +7 -1
  287. package/es/state/graphic-extension.js +20 -0
  288. package/es/state/graphic-extension.js.map +1 -1
  289. package/es/step.d.ts +7 -4
  290. package/es/step.js +34 -16
  291. package/es/step.js.map +1 -1
  292. package/es/ticker/default-ticker.d.ts +12 -7
  293. package/es/ticker/default-ticker.js +30 -27
  294. package/es/ticker/default-ticker.js.map +1 -1
  295. package/es/ticker/manual-ticker.d.ts +6 -1
  296. package/es/ticker/manual-ticker.js +27 -3
  297. package/es/ticker/manual-ticker.js.map +1 -1
  298. package/es/timeline.d.ts +14 -7
  299. package/es/timeline.js +33 -18
  300. package/es/timeline.js.map +1 -1
  301. package/es/utils/transform.d.ts +2 -0
  302. package/es/utils/transform.js +4 -0
  303. package/es/utils/transform.js.map +1 -0
  304. package/package.json +16 -16
  305. package/cjs/custom/group-fade.d.ts +0 -16
  306. package/cjs/custom/group-fade.js +0 -66
  307. package/cjs/custom/group-fade.js.map +0 -1
  308. package/cjs/custom/scale-in.d.ts +0 -13
  309. package/cjs/custom/scale-in.js +0 -57
  310. package/cjs/custom/scale-in.js.map +0 -1
  311. package/cjs/interpolate/executor.d.ts +0 -66
  312. package/cjs/interpolate/executor.js +0 -6
  313. package/cjs/interpolate/executor.js.map +0 -1
  314. package/cjs/intreface/animate.d.ts +0 -91
  315. package/cjs/intreface/animate.js +0 -10
  316. package/cjs/intreface/animate.js.map +0 -1
  317. package/cjs/intreface/easing.d.ts +0 -3
  318. package/cjs/intreface/easing.js +0 -6
  319. package/cjs/intreface/easing.js.map +0 -1
  320. package/cjs/intreface/state.d.ts +0 -35
  321. package/cjs/intreface/state.js +0 -6
  322. package/cjs/intreface/state.js.map +0 -1
  323. package/cjs/intreface/ticker.d.ts +0 -37
  324. package/cjs/intreface/ticker.js +0 -10
  325. package/cjs/intreface/ticker.js.map +0 -1
  326. package/cjs/intreface/timeline.d.ts +0 -17
  327. package/cjs/intreface/timeline.js +0 -6
  328. package/cjs/intreface/timeline.js.map +0 -1
  329. package/cjs/intreface/type.d.ts +0 -13
  330. package/cjs/intreface/type.js +0 -15
  331. package/cjs/intreface/type.js.map +0 -1
  332. package/cjs/state/animation-state-machine.d.ts +0 -22
  333. package/cjs/state/animation-state-machine.js +0 -53
  334. package/cjs/state/animation-state-machine.js.map +0 -1
  335. package/cjs/state/animation-state-queue.d.ts +0 -24
  336. package/cjs/state/animation-state-queue.js +0 -66
  337. package/cjs/state/animation-state-queue.js.map +0 -1
  338. package/cjs/state/animation-state-registry.d.ts +0 -14
  339. package/cjs/state/animation-state-registry.js +0 -53
  340. package/cjs/state/animation-state-registry.js.map +0 -1
  341. package/es/custom/group-fade.d.ts +0 -16
  342. package/es/custom/group-fade.js +0 -56
  343. package/es/custom/group-fade.js.map +0 -1
  344. package/es/custom/scale-in.d.ts +0 -13
  345. package/es/custom/scale-in.js +0 -49
  346. package/es/custom/scale-in.js.map +0 -1
  347. package/es/interpolate/executor.d.ts +0 -66
  348. package/es/interpolate/executor.js +0 -2
  349. package/es/interpolate/executor.js.map +0 -1
  350. package/es/intreface/animate.d.ts +0 -91
  351. package/es/intreface/animate.js +0 -6
  352. package/es/intreface/animate.js.map +0 -1
  353. package/es/intreface/easing.d.ts +0 -3
  354. package/es/intreface/easing.js +0 -2
  355. package/es/intreface/easing.js.map +0 -1
  356. package/es/intreface/state.d.ts +0 -35
  357. package/es/intreface/state.js +0 -2
  358. package/es/intreface/state.js.map +0 -1
  359. package/es/intreface/ticker.d.ts +0 -37
  360. package/es/intreface/ticker.js +0 -6
  361. package/es/intreface/ticker.js.map +0 -1
  362. package/es/intreface/timeline.d.ts +0 -17
  363. package/es/intreface/timeline.js +0 -2
  364. package/es/intreface/timeline.js.map +0 -1
  365. package/es/intreface/type.d.ts +0 -13
  366. package/es/intreface/type.js +0 -14
  367. package/es/intreface/type.js.map +0 -1
  368. package/es/state/animation-state-machine.d.ts +0 -22
  369. package/es/state/animation-state-machine.js +0 -47
  370. package/es/state/animation-state-machine.js.map +0 -1
  371. package/es/state/animation-state-queue.d.ts +0 -24
  372. package/es/state/animation-state-queue.js +0 -58
  373. package/es/state/animation-state-queue.js.map +0 -1
  374. package/es/state/animation-state-registry.d.ts +0 -14
  375. package/es/state/animation-state-registry.js +0 -45
  376. package/es/state/animation-state-registry.js.map +0 -1
@@ -1 +1 @@
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Q,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,SAAS,CAAC;QACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACF;AAXD,kCAWC;AAED,MAAa,YAAa,SAAQ,cAAc;IAC9C,MAAM;;QACJ,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACjF,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI,CAAC;QACxD,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,SAAS,CAAC;QACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACF;AAXD,oCAWC","file":"growAngle.js","sourcesContent":["import { type IGraphic, type IGroup } from '@visactor/vrender-core';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\nimport { isNumber } from '@visactor/vutils';\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 IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nconst growAngleInIndividual = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n if (options && options.orient === 'anticlockwise') {\n return {\n from: { startAngle: attrs?.endAngle },\n to: { startAngle: attrs?.startAngle }\n };\n }\n return {\n from: { endAngle: attrs?.startAngle },\n to: { endAngle: attrs?.endAngle }\n };\n};\n\nconst growAngleInOverall = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n\n if (options && options.orient === 'anticlockwise') {\n const overallValue = isNumber(options.overall) ? options.overall : Math.PI * 2;\n return {\n from: {\n startAngle: overallValue,\n endAngle: overallValue\n },\n to: {\n startAngle: attrs?.startAngle,\n endAngle: attrs?.endAngle\n }\n };\n }\n const overallValue = isNumber(options?.overall) ? options.overall : 0;\n return {\n from: {\n startAngle: overallValue,\n endAngle: overallValue\n },\n to: {\n startAngle: attrs?.startAngle,\n endAngle: attrs?.endAngle\n }\n };\n};\n\nexport const growAngleIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growAngleInOverall(graphic, options, animationParameters)\n : growAngleInIndividual(graphic, options, animationParameters);\n};\n\nconst growAngleOutIndividual = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n\n if (options && options.orient === 'anticlockwise') {\n return {\n from: { startAngle: attrs.startAngle },\n to: { startAngle: attrs?.endAngle }\n };\n }\n return {\n from: { endAngle: attrs.endAngle },\n to: { endAngle: attrs?.startAngle }\n };\n};\n\nconst growAngleOutOverall = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n if (options && options.orient === 'anticlockwise') {\n const overallValue = isNumber(options.overall) ? options.overall : Math.PI * 2;\n return {\n from: {\n startAngle: attrs.startAngle,\n endAngle: attrs.endAngle\n },\n to: {\n startAngle: overallValue,\n endAngle: overallValue\n }\n };\n }\n const overallValue = isNumber(options?.overall) ? options.overall : 0;\n return {\n from: {\n startAngle: attrs.startAngle,\n endAngle: attrs.endAngle\n },\n to: {\n startAngle: overallValue,\n endAngle: overallValue\n }\n };\n};\n\nexport const growAngleOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growAngleOutOverall(graphic, options, animationParameters)\n : growAngleOutIndividual(graphic, options, animationParameters);\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 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\n/**\n * 增长渐入\n */\nexport class GrowAngleIn extends GworPointsBase {\n onBind(): void {\n const { from, to } = growAngleIn(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\nexport class GrowAngleOut extends GworPointsBase {\n onBind(): void {\n const { from, to } = growAngleOut(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"]}
1
+ {"version":3,"sources":["../src/custom/growAngle.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAClD,6CAA4C;AAsB5C,MAAM,qBAAqB,GAAG,CAC5B,OAAiB,EACjB,OAAmC,EACnC,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,eAAe,EAAE;QACjD,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;YACrC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,EAAE;SACtC,CAAC;KACH;IACD,OAAO;QACL,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,EAAE;QACrC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CACzB,OAAiB,EACjB,OAAmC,EACnC,mBAAyC,EACzC,EAAE;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE1C,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,eAAe,EAAE;QACjD,MAAM,YAAY,GAAG,IAAA,iBAAQ,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/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,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;CACF;AAnBD,kCAmBC;AAED,MAAa,YAAa,SAAQ,aAAa;IAC7C,MAAM;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACjF,MAAM,SAAS,GAAG,IAAI,CAAC;QACvB,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,IAAI,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAK,IAAI,CAAC,MAAM,CAAC,SAAiB,CAAC;QACxD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAGb,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;CACF;AAbD,oCAaC","file":"growAngle.js","sourcesContent":["import { type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport { isNumber } from '@visactor/vutils';\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 IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nconst growAngleInIndividual = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n if (options && options.orient === 'anticlockwise') {\n return {\n from: { startAngle: attrs?.endAngle },\n to: { startAngle: attrs?.startAngle }\n };\n }\n return {\n from: { endAngle: attrs?.startAngle },\n to: { endAngle: attrs?.endAngle }\n };\n};\n\nconst growAngleInOverall = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.getFinalAttribute();\n\n if (options && options.orient === 'anticlockwise') {\n const overallValue = isNumber(options.overall) ? options.overall : Math.PI * 2;\n return {\n from: {\n startAngle: overallValue,\n endAngle: overallValue\n },\n to: {\n startAngle: attrs?.startAngle,\n endAngle: attrs?.endAngle\n }\n };\n }\n const overallValue = isNumber(options?.overall) ? options.overall : 0;\n return {\n from: {\n startAngle: overallValue,\n endAngle: overallValue\n },\n to: {\n startAngle: attrs?.startAngle,\n endAngle: attrs?.endAngle\n }\n };\n};\n\nexport const growAngleIn: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growAngleInOverall(graphic, options, animationParameters)\n : growAngleInIndividual(graphic, options, animationParameters);\n};\n\nconst growAngleOutIndividual = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.attribute as any;\n\n if (options && options.orient === 'anticlockwise') {\n return {\n from: { startAngle: attrs.startAngle },\n to: { startAngle: attrs?.endAngle }\n };\n }\n return {\n from: { endAngle: attrs.endAngle },\n to: { endAngle: attrs?.startAngle }\n };\n};\n\nconst growAngleOutOverall = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n const attrs = graphic.attribute as any;\n if (options && options.orient === 'anticlockwise') {\n const overallValue = isNumber(options.overall) ? options.overall : Math.PI * 2;\n return {\n from: {\n startAngle: attrs.startAngle,\n endAngle: attrs.endAngle\n },\n to: {\n startAngle: overallValue,\n endAngle: overallValue\n }\n };\n }\n const overallValue = isNumber(options?.overall) ? options.overall : 0;\n return {\n from: {\n startAngle: attrs.startAngle,\n endAngle: attrs.endAngle\n },\n to: {\n startAngle: overallValue,\n endAngle: overallValue\n }\n };\n};\n\nexport const growAngleOut: TypeAnimation<IGraphic> = (\n graphic: IGraphic,\n options: IGrowAngleAnimationOptions,\n animationParameters: IAnimationParameters\n) => {\n return (options?.overall ?? false) !== false\n ? growAngleOutOverall(graphic, options, animationParameters)\n : growAngleOutIndividual(graphic, options, animationParameters);\n};\n\nexport class GrowAngleBase extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n declare _updateFunction: (ratio: number) => void;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n }\n\n determineUpdateFunction(): void {\n if (!this.propKeys) {\n this.valid = false;\n } else if (this.propKeys && this.propKeys.length > 1) {\n this._updateFunction = this.updateAngle;\n } else if (this.propKeys[0] === 'startAngle') {\n this._updateFunction = this.updateStartAngle;\n } else if (this.propKeys[0] === 'endAngle') {\n this._updateFunction = this.updateEndAngle;\n } else {\n this.valid = false;\n }\n }\n\n /**\n * 删除自身属性,会直接从props等内容里删除掉\n */\n deleteSelfAttr(key: string): void {\n delete this.props[key];\n // fromProps在动画开始时才会计算,这时可能不在\n this.fromProps && delete this.fromProps[key];\n const index = this.propKeys.indexOf(key);\n if (index !== -1) {\n this.propKeys.splice(index, 1);\n }\n\n if (this.propKeys && this.propKeys.length > 1) {\n this._updateFunction = this.updateAngle;\n } else if (this.propKeys[0] === 'startAngle') {\n this._updateFunction = this.updateStartAngle;\n } else if (this.propKeys[0] === 'endAngle') {\n this._updateFunction = this.updateEndAngle;\n } else {\n this._updateFunction = null;\n }\n }\n\n updateStartAngle(ratio: number): void {\n (this.target.attribute as any).startAngle =\n this.from.startAngle + (this.to.startAngle - this.from.startAngle) * ratio;\n }\n\n updateEndAngle(ratio: number): void {\n (this.target.attribute as any).endAngle = this.from.endAngle + (this.to.endAngle - this.from.endAngle) * ratio;\n }\n\n updateAngle(ratio: number): void {\n this.updateStartAngle(ratio);\n this.updateEndAngle(ratio);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this._updateFunction) {\n this._updateFunction(ratio);\n this.target.addUpdateShapeAndBoundsTag();\n }\n }\n}\n\n/**\n * 增长渐入\n */\nexport class GrowAngleIn extends GrowAngleBase {\n onBind(): void {\n super.onBind();\n const { from, to } = growAngleIn(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.from = fromAttrs;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\n this.target.setAttributes(fromAttrs);\n this.determineUpdateFunction();\n }\n}\n\nexport class GrowAngleOut extends GrowAngleBase {\n onBind(): void {\n super.onBind();\n const { from, to } = growAngleOut(this.target, this.params.options, this.params);\n const fromAttrs = from;\n this.props = to;\n this.propKeys = Object.keys(to).filter(key => to[key] != null);\n this.from = fromAttrs ?? (this.target.attribute as any);\n this.to = to;\n\n // this.target.setAttributes(fromAttrs);\n this.determineUpdateFunction();\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
- import type { IAnimate, IStep } from '../intreface/animate';
2
- import type { EasingType } from '../intreface/easing';
1
+ import type { IAnimate, IStep, EasingType } from '@visactor/vrender-core';
3
2
  import { ACustomAnimate } from './custom-animate';
4
3
  export declare class GrowCenterIn extends ACustomAnimate<Record<string, number>> {
5
4
  valid: boolean;
@@ -69,7 +69,7 @@ const vutils_1 = require("@visactor/vutils"), custom_animate_1 = require("./cust
69
69
  }
70
70
  }
71
71
  }, growCenterOut = (graphic, options, animationParameters) => {
72
- const attrs = graphic.getFinalAttribute();
72
+ const attrs = graphic.attribute;
73
73
  switch (null == options ? void 0 : options.direction) {
74
74
  case "x":
75
75
  {
@@ -121,18 +121,22 @@ class GrowCenterIn extends custom_animate_1.ACustomAnimate {
121
121
  super(from, to, duration, easing, params);
122
122
  }
123
123
  onBind() {
124
- var _a;
125
- const {from: from, to: to} = growCenterIn(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
124
+ var _a, _b;
125
+ super.onBind();
126
+ const {from: from, to: to} = growCenterIn(this.target, this.params.options, this.params), fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
126
127
  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
+ this.from = fromAttrs, this.to = to;
129
+ const finalAttribute = this.target.getFinalAttribute();
130
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
128
131
  }
129
132
  onEnd(cb) {
130
133
  super.onEnd(cb);
131
134
  }
132
135
  onUpdate(end, ratio, out) {
136
+ const attribute = this.target.attribute;
133
137
  this.propKeys.forEach((key => {
134
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
135
- })), this.target.setAttributes(out);
138
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
139
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
136
140
  }
137
141
  }
138
142
 
@@ -143,17 +147,19 @@ class GrowCenterOut extends custom_animate_1.ACustomAnimate {
143
147
  super(from, to, duration, easing, params);
144
148
  }
145
149
  onBind() {
146
- const attrs = this.target.getFinalAttribute(), {from: from, to: to} = growCenterOut(this.target, this.params.options, this.params);
150
+ super.onBind();
151
+ const {from: from, to: to} = growCenterOut(this.target, this.params.options, this.params);
147
152
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
148
- this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
153
+ this.from = null != from ? from : this.target.attribute, this.to = to;
149
154
  }
150
155
  onEnd(cb) {
151
156
  super.onEnd(cb);
152
157
  }
153
158
  onUpdate(end, ratio, out) {
159
+ const attribute = this.target.attribute;
154
160
  this.propKeys.forEach((key => {
155
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
156
- })), this.target.setAttributes(out);
161
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
162
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
157
163
  }
158
164
  }
159
165
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/growCenter.ts"],"names":[],"mappings":";;;AACA,6CAA2C;AAG3C,qDAAkD;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,IAAA,gBAAO,EAAC,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;aAC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,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,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;AA5BD,sCA4BC","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"]}
1
+ {"version":3,"sources":["../src/custom/growCenter.ts"],"names":[],"mappings":";;;AACA,6CAA2C;AAC3C,qDAAkD;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,IAAA,gBAAO,EAAC,KAAK,CAAC;oBAClB,CAAC,CAAC;wBACE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;wBAChB,EAAE,EAAE,SAAS;wBACb,KAAK,EAAE,CAAC;qBACT;oB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OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,SAAS,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;QAC5E,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAC3C,CAAC;CACF;AA9BD,sCA8BC","file":"growCenter.js","sourcesContent":["import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';\nimport { isValid } from '@visactor/vutils';\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.attribute as any;\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 super.onBind();\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.from = fromAttrs;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\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 const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\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 super.onBind();\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\n this.from = from ?? (this.target.attribute as any);\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 const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n"]}
@@ -1,6 +1,4 @@
1
- import type { IGraphic, IGroup } from '@visactor/vrender-core';
2
- import type { IAnimate, IStep } from '../intreface/animate';
3
- import type { EasingType } from '../intreface/easing';
1
+ import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';
4
2
  import { ACustomAnimate } from './custom-animate';
5
3
  interface IAnimationParameters {
6
4
  width: number;
@@ -39,10 +39,10 @@ function growHeightInIndividual(graphic, options, animationParameters) {
39
39
  }
40
40
 
41
41
  function growHeightInOverall(graphic, options, animationParameters) {
42
- var _a;
42
+ var _a, _b, _c;
43
43
  const attrs = graphic.getFinalAttribute(), y = attrs.y, y1 = attrs.y1, height = attrs.height;
44
44
  let overallValue;
45
- return options && "negative" === options.orient ? (0, vutils_1.isNumber)(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
45
+ return options && "negative" === options.orient ? (0, vutils_1.isNumber)(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(),
46
46
  animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = (0,
47
47
  vutils_1.isNumber)(null == options ? void 0 : options.overall) ? options.overall : 0,
48
48
  {
@@ -69,18 +69,22 @@ class GrowHeightIn extends custom_animate_1.ACustomAnimate {
69
69
  super(from, to, duration, easing, params);
70
70
  }
71
71
  onBind() {
72
- var _a;
73
- 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;
72
+ var _a, _b;
73
+ super.onBind();
74
+ const {from: from, to: to} = growHeightIn(this.target, this.params.options, this.params), fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
74
75
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
75
- this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
76
+ this.from = fromAttrs, this.to = to;
77
+ const finalAttribute = this.target.getFinalAttribute();
78
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
76
79
  }
77
80
  onEnd(cb) {
78
81
  super.onEnd(cb);
79
82
  }
80
83
  onUpdate(end, ratio, out) {
84
+ const attribute = this.target.attribute;
81
85
  this.propKeys.forEach((key => {
82
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
83
- })), this.target.setAttributes(out);
86
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
87
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
84
88
  }
85
89
  }
86
90
 
@@ -107,10 +111,10 @@ function growHeightOutIndividual(graphic, options, animationParameters) {
107
111
  }
108
112
 
109
113
  function growHeightOutOverall(graphic, options, animationParameters) {
110
- var _a;
114
+ var _a, _b, _c;
111
115
  const attrs = graphic.getFinalAttribute(), y1 = attrs.y1, height = attrs.height;
112
116
  let overallValue;
113
- return options && "negative" === options.orient ? (0, vutils_1.isNumber)(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
117
+ return options && "negative" === options.orient ? (0, vutils_1.isNumber)(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_c = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : null === (_b = options.layoutRect) || void 0 === _b ? void 0 : _b.height) && void 0 !== _c ? _c : animationParameters.group.getBounds().height(),
114
118
  animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = (0,
115
119
  vutils_1.isNumber)(null == options ? void 0 : options.overall) ? options.overall : 0,
116
120
  {
@@ -136,17 +140,19 @@ class GrowHeightOut extends custom_animate_1.ACustomAnimate {
136
140
  super(from, to, duration, easing, params);
137
141
  }
138
142
  onBind() {
139
- const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (0, exports.growHeightOut)(this.target, this.params.options, this.params);
143
+ super.onBind();
144
+ const {from: from, to: to} = (0, exports.growHeightOut)(this.target, this.params.options, this.params);
140
145
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
141
- this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
146
+ this.from = null != from ? from : this.target.attribute, this.to = to;
142
147
  }
143
148
  onEnd(cb) {
144
149
  super.onEnd(cb);
145
150
  }
146
151
  onUpdate(end, ratio, out) {
152
+ const attribute = this.target.attribute;
147
153
  this.propKeys.forEach((key => {
148
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
149
- })), this.target.setAttributes(out);
154
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
155
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
150
156
  }
151
157
  }
152
158
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/growHeight.ts"],"names":[],"mappings":";;;AACA,6CAA4D;AAG5D,qDAAkD;AAuBlD,SAAS,sBAAsB,CAC7B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAE5B,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE;QAC5C,MAAM,UAAU,GAAG,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC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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;AA5BD,sCA4BC","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"]}
1
+ {"version":3,"sources":["../src/custom/growHeight.ts"],"names":[],"mappings":";;;AACA,6CAA4D;AAC5D,qDAAkD;AAwBlD,SAAS,sBAAsB,CAC7B,OAAiB,EACjB,OAAuC,EACvC,mBAAyC;IAEzC,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACpB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAE5B,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE;QAC5C,MAAM,UAAU,GAAG,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CA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,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,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,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAK,IAAI,CAAC,MAAM,CAAC,SAAiB,CAAC;QACnD,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,MAAM,SAAS,GAAwB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;QAC7D,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1B,SAAS,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;QAC5E,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IAC3C,CAAC;CACF;AA7BD,sCA6BC","file":"growHeight.js","sourcesContent":["import type { IGraphic, IGroup, IAnimate, IStep, EasingType } from '@visactor/vrender-core';\nimport { isNil, isNumber, isValid } from '@visactor/vutils';\nimport { ACustomAnimate } from './custom-animate';\n\ninterface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n layoutRect?: { width: number; height: number };\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 =\n (animationParameters as any).groupHeight ??\n options.layoutRect?.height ??\n 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 super.onBind();\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.from = fromAttrs;\n this.to = to;\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\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 const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\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 =\n (animationParameters as any).groupHeight ??\n options.layoutRect?.height ??\n 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 super.onBind();\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.from = from ?? (this.target.attribute as any);\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 const attribute: Record<string, any> = this.target.attribute;\n this.propKeys.forEach(key => {\n attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.addUpdatePositionTag();\n this.target.addUpdateShapeAndBoundsTag();\n }\n}\n"]}
@@ -1,6 +1,5 @@
1
- import { type IGraphic, type IGroup } from '@visactor/vrender-core';
1
+ import { type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';
2
2
  import type { IPointLike } from '@visactor/vutils';
3
- import type { EasingType } from '../intreface/easing';
4
3
  import { ACustomAnimate } from './custom-animate';
5
4
  interface IAnimationParameters {
6
5
  width: number;
@@ -47,8 +47,9 @@ class GworPointsBase extends custom_animate_1.ACustomAnimate {
47
47
  onUpdate(end, ratio, out) {
48
48
  var _a, _b;
49
49
  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;
50
- fromPoints && toPoints && (out.points = fromPoints.map(((point, index) => (0, vrender_core_1.pointInterpolation)(fromPoints[index], toPoints[index], ratio))),
51
- this.target.setAttributes(out));
50
+ fromPoints && toPoints && (this.target.attribute.points = fromPoints.map(((point, index) => (0,
51
+ vrender_core_1.pointInterpolation)(fromPoints[index], toPoints[index], ratio))),
52
+ this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag());
52
53
  }
53
54
  }
54
55
 
@@ -57,10 +58,12 @@ exports.GworPointsBase = GworPointsBase;
57
58
  class GrowPointsIn extends GworPointsBase {
58
59
  onBind() {
59
60
  var _a;
60
- if ([ "area", "line" ].includes(this.target.type)) {
61
- const {from: from, to: to} = (0, exports.growPointsIn)(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
61
+ if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
62
+ const {from: from, to: to} = (0, exports.growPointsIn)(this.target, this.params.options, this.params);
62
63
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
63
- this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
64
+ this.from = from, this.to = to;
65
+ const finalAttribute = this.target.getFinalAttribute();
66
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
64
67
  } else this.valid = !1;
65
68
  }
66
69
  }
@@ -69,10 +72,10 @@ exports.GrowPointsIn = GrowPointsIn;
69
72
 
70
73
  class GrowPointsOut extends GworPointsBase {
71
74
  onBind() {
72
- if ([ "area", "line" ].includes(this.target.type)) {
75
+ if (super.onBind(), [ "area", "line" ].includes(this.target.type)) {
73
76
  const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (0, exports.growPointsOut)(this.target, this.params.options, this.params);
74
77
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
75
- this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
78
+ this.from = from || attrs, this.to = to;
76
79
  } else this.valid = !1;
77
80
  }
78
81
  }
@@ -80,11 +83,10 @@ class GrowPointsOut extends GworPointsBase {
80
83
  exports.GrowPointsOut = GrowPointsOut;
81
84
 
82
85
  const changePointsX = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
83
- var _a;
84
86
  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), {
87
+ let groupRight = graphic.stage.viewWidth;
88
+ return graphic.parent.parent.parent && (groupRight = graphic.parent.parent.parent.AABBBounds.width()),
89
+ Object.assign(Object.assign({}, point), {
88
90
  x: groupRight,
89
91
  y: point.y,
90
92
  x1: groupRight,
@@ -103,7 +105,7 @@ const changePointsX = (graphic, options, animationParameters) => graphic.getFina
103
105
  const attrs = graphic.getFinalAttribute();
104
106
  return {
105
107
  from: {
106
- points: changePointsX(graphic, options, animationParameters)
108
+ points: changePointsX(graphic, options)
107
109
  },
108
110
  to: {
109
111
  points: attrs.points
@@ -114,17 +116,19 @@ const changePointsX = (graphic, options, animationParameters) => graphic.getFina
114
116
  points: graphic.getFinalAttribute().points
115
117
  },
116
118
  to: {
117
- points: changePointsX(graphic, options, animationParameters)
119
+ points: changePointsX(graphic, options)
118
120
  }
119
121
  });
120
122
 
121
123
  class GrowPointsXIn extends GworPointsBase {
122
124
  onBind() {
123
125
  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
+ if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
127
+ const {from: from, to: to} = growPointsXIn(this.target, this.params.options, this.params);
126
128
  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);
129
+ this.from = from, this.to = to;
130
+ const finalAttribute = this.target.getFinalAttribute();
131
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
128
132
  } else this.valid = !1;
129
133
  }
130
134
  }
@@ -133,31 +137,30 @@ exports.GrowPointsXIn = GrowPointsXIn;
133
137
 
134
138
  class GrowPointsXOut extends GworPointsBase {
135
139
  onBind() {
136
- if ([ "area", "line" ].includes(this.target.type)) {
140
+ if (super.onBind(), [ "area", "line" ].includes(this.target.type)) {
137
141
  const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
138
- options = this.params.options, animationParameters = this.params, {
142
+ options = this.params.options, this.params, {
139
143
  from: {
140
144
  points: graphic.getFinalAttribute().points
141
145
  },
142
146
  to: {
143
- points: changePointsX(graphic, options, animationParameters)
147
+ points: changePointsX(graphic, options)
144
148
  }
145
149
  });
146
150
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
147
- this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
151
+ this.from = from || attrs, this.to = to;
148
152
  } else this.valid = !1;
149
- var graphic, options, animationParameters;
153
+ var graphic, options;
150
154
  }
151
155
  }
152
156
 
153
157
  exports.GrowPointsXOut = GrowPointsXOut;
154
158
 
155
159
  const changePointsY = (graphic, options, animationParameters) => graphic.getFinalAttribute().points.map((point => {
156
- var _a;
157
160
  if (options && "negative" === options.orient) {
158
- let groupBottom = animationParameters.height;
159
- return animationParameters.group && (groupBottom = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(),
160
- animationParameters.groupHeight = groupBottom), Object.assign(Object.assign({}, point), {
161
+ let groupBottom = graphic.stage.viewHeight;
162
+ return graphic.parent.parent.parent && (groupBottom = graphic.parent.parent.parent.AABBBounds.height()),
163
+ Object.assign(Object.assign({}, point), {
161
164
  x: point.x,
162
165
  y: groupBottom,
163
166
  x1: point.x1,
@@ -176,7 +179,7 @@ const changePointsY = (graphic, options, animationParameters) => graphic.getFina
176
179
  const attrs = graphic.getFinalAttribute();
177
180
  return {
178
181
  from: {
179
- points: changePointsY(graphic, options, animationParameters)
182
+ points: changePointsY(graphic, options)
180
183
  },
181
184
  to: {
182
185
  points: attrs.points
@@ -187,17 +190,19 @@ const changePointsY = (graphic, options, animationParameters) => graphic.getFina
187
190
  points: graphic.getFinalAttribute().points
188
191
  },
189
192
  to: {
190
- points: changePointsY(graphic, options, animationParameters)
193
+ points: changePointsY(graphic, options)
191
194
  }
192
195
  });
193
196
 
194
197
  class GrowPointsYIn extends GworPointsBase {
195
198
  onBind() {
196
199
  var _a;
197
- if ([ "area", "line" ].includes(this.target.type)) {
198
- 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;
200
+ if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
201
+ const {from: from, to: to} = growPointsYIn(this.target, this.params.options, this.params);
199
202
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
200
- this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
203
+ this.from = from, this.to = to;
204
+ const finalAttribute = this.target.getFinalAttribute();
205
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
201
206
  } else this.valid = !1;
202
207
  }
203
208
  }
@@ -206,20 +211,20 @@ exports.GrowPointsYIn = GrowPointsYIn;
206
211
 
207
212
  class GrowPointsYOut extends GworPointsBase {
208
213
  onBind() {
209
- if ([ "area", "line" ].includes(this.target.type)) {
210
- const attrs = this.target.getFinalAttribute(), {from: from, to: to} = (graphic = this.target,
211
- options = this.params.options, animationParameters = this.params, {
214
+ if (super.onBind(), [ "area", "line", "polygon" ].includes(this.target.type)) {
215
+ const {from: from, to: to} = (graphic = this.target, options = this.params.options,
216
+ this.params, {
212
217
  from: {
213
218
  points: graphic.getFinalAttribute().points
214
219
  },
215
220
  to: {
216
- points: changePointsY(graphic, options, animationParameters)
221
+ points: changePointsY(graphic, options)
217
222
  }
218
223
  });
219
224
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
220
- this.animate.reSyncProps(), this.from = from || attrs, this.to = to;
225
+ this.from = null != from ? from : this.target.attribute, this.to = to;
221
226
  } else this.valid = !1;
222
- var graphic, options, animationParameters;
227
+ var graphic, options;
223
228
  }
224
229
  }
225
230