@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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AM;gBACL,cAAc,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;gBAC/B,YAAY,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;aACnC;SACF;aAAM;YACL,IAAI,MAAM,KAAK,UAAU,EAAE;gBACzB,cAAc,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBACxC,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACvC;iBAAM;gBACL,cAAc,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC9B,YAAY,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACjC;SACF;QACD,KAAK,CACH,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,EACtD,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACtD,QAAQ,EACR,MAAM,EACN,EAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF;AAzDD,oDAyDC","file":"clip-graphic.js","sourcesContent":["import type { IArcGraphicAttribute, IGraphic, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';\nimport { application, AttributeUpdateType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport type { EasingType } from '../intreface/easing';\n\nexport class ClipGraphicAnimate extends ACustomAnimate<any> {\n private _group?: IGroup;\n private _clipGraphic?: IGraphic;\n protected clipFromAttribute?: any;\n protected clipToAttribute?: any;\n\n private _lastClip?: boolean;\n private _lastPath?: IGraphic[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { group: IGroup; clipGraphic: IGraphic }\n ) {\n super(null, null, duration, easing, params);\n this.clipFromAttribute = from;\n this.clipToAttribute = to;\n this._group = params?.group;\n this._clipGraphic = params?.clipGraphic;\n }\n\n onBind() {\n if (this._group && this._clipGraphic) {\n this._lastClip = this._group.attribute.clip;\n this._lastPath = this._group.attribute.path;\n this._group.setAttributes(\n {\n clip: true,\n path: [this._clipGraphic]\n },\n false,\n { type: AttributeUpdateType.ANIMATE_BIND }\n );\n }\n }\n\n onEnd() {\n if (this._group) {\n this._group.setAttributes(\n {\n clip: this._lastClip,\n path: this._lastPath\n },\n false,\n { type: AttributeUpdateType.ANIMATE_END }\n );\n }\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._clipGraphic) {\n return;\n }\n const res: any = {};\n Object.keys(this.clipFromAttribute).forEach(k => {\n res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;\n });\n this._clipGraphic.setAttributes(res, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: { ratio, end }\n });\n }\n}\n\nexport class ClipAngleAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startAngle?: number;\n radius?: number;\n orient?: 'clockwise' | 'anticlockwise';\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startAngle = params?.startAngle ?? 0;\n const orient = params?.orient ?? 'clockwise';\n\n let arcStartAngle = 0;\n let arcEndAngle = 0;\n if (orient === 'anticlockwise') {\n arcEndAngle = animationType === 'in' ? startAngle + Math.PI * 2 : startAngle;\n arcEndAngle = startAngle + Math.PI * 2;\n } else {\n arcStartAngle = startAngle;\n arcEndAngle = animationType === 'out' ? startAngle + Math.PI * 2 : startAngle;\n }\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: params?.radius ?? (width + height) / 2,\n innerRadius: 0,\n startAngle: arcStartAngle,\n endAngle: arcEndAngle,\n fill: true\n });\n let fromAttributes: Partial<IArcGraphicAttribute>;\n let toAttributes: Partial<IArcGraphicAttribute>;\n if (orient === 'anticlockwise') {\n fromAttributes = { startAngle: startAngle + Math.PI * 2 };\n toAttributes = { startAngle: startAngle };\n } else {\n fromAttributes = { endAngle: startAngle };\n toAttributes = { endAngle: startAngle + Math.PI * 2 };\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipRadiusAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startRadius?: number;\n endRadius?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startRadius = params?.startRadius ?? 0;\n const endRadius = params?.endRadius ?? Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);\n\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: animationType === 'out' ? endRadius : startRadius,\n innerRadius: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n fill: true\n });\n const fromAttributes: Partial<IArcGraphicAttribute> = { outerRadius: startRadius };\n const toAttributes: Partial<IArcGraphicAttribute> = { outerRadius: endRadius };\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipDirectionAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n direction?: 'x' | 'y';\n orient?: 'positive' | 'negative';\n width?: number;\n height?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = params?.width ?? groupAttribute.width ?? 0;\n const height = params?.height ?? groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const direction = params?.direction ?? 'x';\n const orient = params?.orient ?? 'positive';\n\n const rect = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width: animationType === 'in' && direction === 'x' ? 0 : width,\n height: animationType === 'in' && direction === 'y' ? 0 : height,\n fill: true\n });\n let fromAttributes: Partial<IRectGraphicAttribute> = {};\n let toAttributes: Partial<IRectGraphicAttribute> = {};\n if (direction === 'y') {\n if (orient === 'negative') {\n fromAttributes = { y: height, height: 0 };\n toAttributes = { y: 0, height: height };\n } else {\n fromAttributes = { height: 0 };\n toAttributes = { height: height };\n }\n } else {\n if (orient === 'negative') {\n fromAttributes = { x: width, width: 0 };\n toAttributes = { x: 0, width: width };\n } else {\n fromAttributes = { width: 0 };\n toAttributes = { width: width };\n }\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: rect }\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/clip-graphic.ts"],"names":[],"mappings":";;;AACA,yDAA2F;AAC3F,qDAAkD;AAElD,MAAa,kBAAmB,SAAQ,+BAAmB;IASzD,YACE,IAAS,EACT,EAAO,EACP,QAAgB,EAChB,MAAkB,EAClB,MAAgD;QAEhD,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC;QAC5B,IA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E,KAAK,EAAE,KAAK,EAAE,CAAC;aACjC;SACF;QACD,KAAK,CACH,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,EACtD,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACtD,QAAQ,EACR,MAAM,EACN,EAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF;AAzDD,oDAyDC","file":"clip-graphic.js","sourcesContent":["import type { IArcGraphicAttribute, IGraphic, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';\nimport { application, AttributeUpdateType, type EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class ClipGraphicAnimate extends ACustomAnimate<any> {\n private _group?: IGroup;\n private _clipGraphic?: IGraphic;\n protected clipFromAttribute?: any;\n protected clipToAttribute?: any;\n\n private _lastClip?: boolean;\n private _lastPath?: IGraphic[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { group: IGroup; clipGraphic: IGraphic }\n ) {\n super(null, {}, duration, easing, params);\n this.clipFromAttribute = from;\n this.clipToAttribute = to;\n this._group = params?.group;\n this._clipGraphic = params?.clipGraphic;\n }\n\n onBind() {\n super.onBind();\n if (this._group && this._clipGraphic) {\n this._lastClip = this._group.attribute.clip;\n this._lastPath = this._group.attribute.path;\n this._group.setAttributes(\n {\n clip: true,\n path: [this._clipGraphic]\n },\n false,\n { type: AttributeUpdateType.ANIMATE_BIND }\n );\n }\n }\n\n onEnd() {\n if (this._group) {\n this._group.setAttributes(\n {\n clip: this._lastClip,\n path: this._lastPath\n },\n false,\n { type: AttributeUpdateType.ANIMATE_END }\n );\n }\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._clipGraphic) {\n return;\n }\n const res: any = {};\n Object.keys(this.clipFromAttribute).forEach(k => {\n res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;\n });\n this._clipGraphic.setAttributes(res, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: { ratio, end }\n });\n }\n}\n\nexport class ClipAngleAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startAngle?: number;\n radius?: number;\n orient?: 'clockwise' | 'anticlockwise';\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startAngle = params?.startAngle ?? 0;\n const orient = params?.orient ?? 'clockwise';\n\n let arcStartAngle = 0;\n let arcEndAngle = 0;\n if (orient === 'anticlockwise') {\n arcEndAngle = animationType === 'in' ? startAngle + Math.PI * 2 : startAngle;\n arcEndAngle = startAngle + Math.PI * 2;\n } else {\n arcStartAngle = startAngle;\n arcEndAngle = animationType === 'out' ? startAngle + Math.PI * 2 : startAngle;\n }\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: params?.radius ?? (width + height) / 2,\n innerRadius: 0,\n startAngle: arcStartAngle,\n endAngle: arcEndAngle,\n fill: true\n });\n let fromAttributes: Partial<IArcGraphicAttribute>;\n let toAttributes: Partial<IArcGraphicAttribute>;\n if (orient === 'anticlockwise') {\n fromAttributes = { startAngle: startAngle + Math.PI * 2 };\n toAttributes = { startAngle: startAngle };\n } else {\n fromAttributes = { endAngle: startAngle };\n toAttributes = { endAngle: startAngle + Math.PI * 2 };\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipRadiusAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startRadius?: number;\n endRadius?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startRadius = params?.startRadius ?? 0;\n const endRadius = params?.endRadius ?? Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);\n\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: animationType === 'out' ? endRadius : startRadius,\n innerRadius: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n fill: true\n });\n const fromAttributes: Partial<IArcGraphicAttribute> = { outerRadius: startRadius };\n const toAttributes: Partial<IArcGraphicAttribute> = { outerRadius: endRadius };\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipDirectionAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n direction?: 'x' | 'y';\n orient?: 'positive' | 'negative';\n width?: number;\n height?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = params?.width ?? groupAttribute.width ?? 0;\n const height = params?.height ?? groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const direction = params?.direction ?? 'x';\n const orient = params?.orient ?? 'positive';\n\n const rect = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width: animationType === 'in' && direction === 'x' ? 0 : width,\n height: animationType === 'in' && direction === 'y' ? 0 : height,\n fill: true\n });\n let fromAttributes: Partial<IRectGraphicAttribute> = {};\n let toAttributes: Partial<IRectGraphicAttribute> = {};\n if (direction === 'y') {\n if (orient === 'negative') {\n fromAttributes = { y: height, height: 0 };\n toAttributes = { y: 0, height: height };\n } else {\n fromAttributes = { height: 0 };\n toAttributes = { height: height };\n }\n } else {\n if (orient === 'negative') {\n fromAttributes = { x: width, width: 0 };\n toAttributes = { x: 0, width: width };\n } else {\n fromAttributes = { width: 0 };\n toAttributes = { width: width };\n }\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: rect }\n );\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { EasingType } from '../intreface/easing';
1
+ import type { EasingType } from '@visactor/vrender-core';
2
2
  import { CommonIn, CommonOut } from './common';
3
3
  export interface IScaleAnimationOptions {
4
4
  direction?: 'x' | 'y' | 'xy';
@@ -6,6 +6,7 @@ export interface IScaleAnimationOptions {
6
6
  export declare class ClipIn extends CommonIn {
7
7
  valid: boolean;
8
8
  constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
9
+ onFirstRun(): void;
9
10
  }
10
11
  export declare class ClipOut extends CommonOut {
11
12
  valid: boolean;
@@ -8,7 +8,15 @@ const common_1 = require("./common");
8
8
 
9
9
  class ClipIn extends common_1.CommonIn {
10
10
  constructor(from, to, duration, easing, params) {
11
- super(from, to, duration, easing, params), this.keys = [ "clipRange" ];
11
+ super(from, to, duration, easing, params), this.keys = [ "clipRange" ], this.from = {
12
+ clipRange: 0
13
+ };
14
+ }
15
+ onFirstRun() {
16
+ var _a;
17
+ super.onFirstRun();
18
+ const {clipDimension: clipDimension} = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.options) || {};
19
+ clipDimension && (this.target.attribute.clipRangeByDimension = clipDimension);
12
20
  }
13
21
  }
14
22
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/clip.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,wBAOC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,0BAOC","file":"clip.js","sourcesContent":["import type { EasingType } from '../intreface/easing';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class ClipIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\n }\n}\n\nexport class ClipOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/clip.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAC/B,CAAC;IACD,UAAU;;QACR,KAAK,CAAC,UAAU,EAAE,CAAC;QACnB,MAAM,EAAE,aAAa,EAAE,GAAG,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,KAAI,EAAE,CAAC;QAErD,IAAI,aAAa,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,SAAiB,CAAC,oBAAoB,GAAG,aAAa,CAAC;SACrE;IACH,CAAC;CACF;AAhBD,wBAgBC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,0BAOC","file":"clip.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class ClipIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\n this.from = { clipRange: 0 };\n }\n onFirstRun(): void {\n super.onFirstRun();\n const { clipDimension } = this.params?.options || {};\n // 需要设置clipRangeByDimension\n if (clipDimension) {\n (this.target.attribute as any).clipRangeByDimension = clipDimension;\n }\n }\n}\n\nexport class ClipOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\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 { EasingType, IAnimate, IStep } from '@visactor/vrender-core';
3
2
  import { ACustomAnimate } from './custom-animate';
4
3
  export interface IScaleAnimationOptions {
5
4
  direction?: 'x' | 'y' | 'xy';
@@ -9,7 +8,6 @@ export declare class CommonIn extends ACustomAnimate<Record<string, number>> {
9
8
  keys: string[];
10
9
  constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
11
10
  onBind(): void;
12
- onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
13
11
  onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
14
12
  }
15
13
  export declare class CommonOut extends ACustomAnimate<Record<string, number>> {
@@ -11,22 +11,23 @@ class CommonIn extends custom_animate_1.ACustomAnimate {
11
11
  super(from, to, duration, easing, params);
12
12
  }
13
13
  onBind() {
14
- var _a;
15
- const attrs = this.target.getFinalAttribute(), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : {}, to = {}, from = {};
14
+ var _a, _b, _c;
15
+ super.onBind();
16
+ const attrs = this.target.getFinalAttribute(), fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {}, to = {}, from = null !== (_b = this.from) && void 0 !== _b ? _b : {};
16
17
  this.keys.forEach((key => {
17
- var _a, _b;
18
+ var _a, _b, _c;
18
19
  to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1,
19
- from[key] = null !== (_b = null == fromAttrs ? void 0 : fromAttrs[key]) && void 0 !== _b ? _b : 0;
20
- })), this.props = to, this.propKeys = this.keys, this.animate.reSyncProps(), this.from = from,
21
- this.to = to, this.target.setAttributes(from);
22
- }
23
- onEnd(cb) {
24
- super.onEnd(cb);
20
+ from[key] = null !== (_c = null !== (_b = from[key]) && void 0 !== _b ? _b : fromAttrs[key]) && void 0 !== _c ? _c : 0;
21
+ }));
22
+ const finalAttribute = this.target.getFinalAttribute();
23
+ finalAttribute && this.target.setAttributes(finalAttribute), this.props = to, this.propKeys = this.keys,
24
+ this.from = from, this.to = to, !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
25
25
  }
26
26
  onUpdate(end, ratio, out) {
27
+ const attribute = this.target.attribute;
27
28
  this.propKeys.forEach((key => {
28
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
29
- })), this.target.setAttributes(out);
29
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
30
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
30
31
  }
31
32
  }
32
33
 
@@ -37,20 +38,23 @@ class CommonOut extends custom_animate_1.ACustomAnimate {
37
38
  super(from, to, duration, easing, params);
38
39
  }
39
40
  onBind() {
40
- const attrs = this.target.getFinalAttribute(), to = {}, from = {};
41
+ super.onBind();
42
+ const attrs = this.target.attribute, to = {}, from = {};
41
43
  this.keys.forEach((key => {
42
44
  var _a;
43
- to[key] = 0, from[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1;
44
- })), this.props = to, this.propKeys = this.keys, this.animate.reSyncProps(), this.from = from,
45
- this.to = to, this.target.setAttributes(from);
45
+ to[key] = 0, from[key] = null !== (_a = attrs[key]) && void 0 !== _a ? _a : 1;
46
+ })), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to,
47
+ Object.assign(this.target.attribute, from), this.target.addUpdatePositionTag(),
48
+ this.target.addUpdateBoundTag();
46
49
  }
47
50
  onEnd(cb) {
48
51
  super.onEnd(cb);
49
52
  }
50
53
  onUpdate(end, ratio, out) {
54
+ const attribute = this.target.attribute;
51
55
  this.propKeys.forEach((key => {
52
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
53
- })), this.target.setAttributes(out);
56
+ attribute[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
57
+ })), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
54
58
  }
55
59
  }
56
60
 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,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAW,CAAC,CAAC;IACzC,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;AArCD,8BAqCC","file":"common.js","sourcesContent":["import type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class CommonIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const fromAttrs = this.target.context.lastAttrs ?? {};\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = {};\n this.keys.forEach(key => {\n to[key] = attrs?.[key] ?? 1;\n from[key] = fromAttrs?.[key] ?? 0;\n });\n\n this.props = to;\n this.propKeys = this.keys;\n this.animate.reSyncProps();\n this.from = from;\n this.to = to;\n this.target.setAttributes(from as any);\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 CommonOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = {};\n this.keys.forEach(key => {\n to[key] = 0;\n from[key] = attrs?.[key] ?? 1;\n });\n\n this.props = to;\n this.propKeys = this.keys;\n this.animate.reSyncProps();\n this.from = from;\n this.to = to;\n this.target.setAttributes(from as any);\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/common.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAMlD,MAAa,QAAS,SAAQ,+BAAsC;IAKlE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9C,MAAM,SAAS,GAAwB,MAAA,IAAI,CAAC,MAAM,CAAC,SAAS,mCAAI,EAAE,CAAC;QAEnE,MAAM,EAAE,GAA2B,EAAE,CAAC;QACtC,MAAM,IAAI,GAA2B,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;QAC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AwB;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;AA3CD,8BA2CC","file":"common.js","sourcesContent":["import type { EasingType, IAnimate, IStep } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class CommonIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const attrs = this.target.getFinalAttribute();\n const fromAttrs: Record<string, any> = this.target.attribute ?? {};\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = this.from ?? {};\n this.keys.forEach(key => {\n to[key] = attrs?.[key] ?? 1;\n from[key] = from[key] ?? fromAttrs[key] ?? 0;\n });\n\n // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n const finalAttribute = this.target.getFinalAttribute();\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n\n this.props = to;\n this.propKeys = this.keys;\n this.from = from;\n this.to = to;\n\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(from);\n }\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 CommonOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n super.onBind();\n const attrs: Record<string, any> = this.target.attribute;\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = {};\n this.keys.forEach(key => {\n to[key] = 0;\n from[key] = attrs[key] ?? 1;\n });\n\n this.props = to;\n this.propKeys = this.keys;\n this.from = from;\n this.to = to;\n\n Object.assign(this.target.attribute, from);\n this.target.addUpdatePositionTag();\n this.target.addUpdateBoundTag();\n // this.target.setAttributes(from as any);\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 { ICustomAnimate } from '../intreface/animate';
2
- import type { EasingType } from '../intreface/easing';
3
- import type { IAnimateStepType } from '../intreface/type';
1
+ import type { ComponentAnimator } from '../component';
2
+ import type { EasingType, IAnimateStepType, ICustomAnimate } from '@visactor/vrender-core';
4
3
  import { Step } from '../step';
5
4
  export declare abstract class ACustomAnimate<T> extends Step implements ICustomAnimate {
6
5
  type: IAnimateStepType;
@@ -13,3 +12,8 @@ export declare abstract class ACustomAnimate<T> extends Step implements ICustomA
13
12
  update(end: boolean, ratio: number, out: Record<string, any>): void;
14
13
  protected setProps(props: T): void;
15
14
  }
15
+ export declare abstract class AComponentAnimate<T> extends ACustomAnimate<T> {
16
+ protected _animator: ComponentAnimator;
17
+ completeBind(animator: ComponentAnimator): void;
18
+ stop(): void;
19
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.ACustomAnimate = void 0;
5
+ }), exports.AComponentAnimate = exports.ACustomAnimate = void 0;
6
6
 
7
7
  const step_1 = require("../step");
8
8
 
@@ -14,7 +14,7 @@ class ACustomAnimate extends step_1.Step {
14
14
  update(end, ratio, out) {
15
15
  if (this.onStart(), !this.props || !this.propKeys) return;
16
16
  const easedRatio = this.easing(ratio);
17
- this.onUpdate(end, easedRatio, out);
17
+ this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
18
18
  }
19
19
  setProps(props) {
20
20
  this.props = props, this.propKeys = Object.keys(props), this.animate.reSyncProps();
@@ -22,4 +22,15 @@ class ACustomAnimate extends step_1.Step {
22
22
  }
23
23
 
24
24
  exports.ACustomAnimate = ACustomAnimate;
25
+
26
+ class AComponentAnimate extends ACustomAnimate {
27
+ completeBind(animator) {
28
+ this.setStartTime(0), this._animator && this._animator.start(), this.setDuration(animator.getDuration());
29
+ }
30
+ stop() {
31
+ this._animator && this._animator.stop();
32
+ }
33
+ }
34
+
35
+ exports.AComponentAnimate = AComponentAnimate;
25
36
  //# sourceMappingURL=custom-animate.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/custom-animate.ts"],"names":[],"mappings":";;;AAGA,kCAA+B;AAE/B,MAAsB,cAAkB,SAAQ,WAAI;IAUlD,YAAY,UAAa,EAAE,QAAW,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QACxF,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAVrD,SAAI,GAAqB,eAAe,CAAC;QAWvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAE1D,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO;SACR;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IAES,QAAQ,CAAC,KAAQ;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;CACF;AAhCD,wCAgCC","file":"custom-animate.js","sourcesContent":["import type { ICustomAnimate } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport type { IAnimateStepType } from '../intreface/type';\nimport { Step } from '../step';\n\nexport abstract class ACustomAnimate<T> extends Step implements ICustomAnimate {\n type: IAnimateStepType = 'customAnimate';\n declare customFrom: T;\n declare params?: any;\n declare props?: T;\n declare from?: T;\n declare to?: T;\n\n // 为了兼容旧的api,from和to是可选的,且尽量不需要From,因为为了避免突变,From都应该从当前位置开始\n // 所以From并不会真正设置到fromProps中,而是作为customFrom参数\n constructor(customFrom: T, customTo: T, duration: number, easing: EasingType, params?: any) {\n super('customAnimate', customTo, duration, easing);\n this.customFrom = customFrom;\n this.params = params;\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n // TODO 需要修复,只有在开始的时候才调用\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.onUpdate(end, easedRatio, out);\n }\n\n protected setProps(props: T) {\n this.props = props;\n this.propKeys = Object.keys(props);\n this.animate.reSyncProps();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/custom-animate.ts"],"names":[],"mappings":";;;AAEA,kCAA+B;AAE/B,MAAsB,cAAkB,SAAQ,WAAI;IAUlD,YAAY,UAAa,EAAE,QAAW,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QACxF,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAVrD,SAAI,GAAqB,eAAe,CAAC;QAWvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAE1D,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO;SACR;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAES,QAAQ,CAAC,KAAQ;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;CACF;AAjCD,wCAiCC;AAED,MAAsB,iBAAqB,SAAQ,cAAiB;IAGlE,YAAY,CAAC,QAA2B;QACtC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI;QACF,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF;AAZD,8CAYC","file":"custom-animate.js","sourcesContent":["import type { ComponentAnimator } from '../component';\nimport type { EasingType, IAnimateStepType, ICustomAnimate } from '@visactor/vrender-core';\nimport { Step } from '../step';\n\nexport abstract class ACustomAnimate<T> extends Step implements ICustomAnimate {\n type: IAnimateStepType = 'customAnimate';\n declare customFrom: T;\n declare params?: any;\n declare props?: T;\n declare from?: T;\n declare to?: T;\n\n // 为了兼容旧的api,from和to是可选的,且尽量不需要From,因为为了避免突变,From都应该从当前位置开始\n // 所以From并不会真正设置到fromProps中,而是作为customFrom参数\n constructor(customFrom: T, customTo: T, duration: number, easing: EasingType, params?: any) {\n super('customAnimate', customTo, duration, easing);\n this.customFrom = customFrom;\n this.params = params;\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n // TODO 需要修复,只有在开始的时候才调用\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.onUpdate(end, easedRatio, out);\n this.syncAttributeUpdate();\n }\n\n protected setProps(props: T) {\n this.props = props;\n this.propKeys = Object.keys(props);\n this.animate.reSyncProps();\n }\n}\n\nexport abstract class AComponentAnimate<T> extends ACustomAnimate<T> {\n protected _animator: ComponentAnimator;\n\n completeBind(animator: ComponentAnimator): void {\n this.setStartTime(0);\n this._animator && this._animator.start();\n this.setDuration(animator.getDuration());\n }\n\n stop(): void {\n this._animator && this._animator.stop();\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { EasingType } from '../intreface/easing';
1
+ import type { EasingType } from '@visactor/vrender-core';
2
2
  import { CommonIn, CommonOut } from './common';
3
3
  export interface IScaleAnimationOptions {
4
4
  direction?: 'x' | 'y' | 'xy';
@@ -8,7 +8,12 @@ const common_1 = require("./common");
8
8
 
9
9
  class FadeIn extends common_1.CommonIn {
10
10
  constructor(from, to, duration, easing, params) {
11
- super(from, to, duration, easing, params), this.keys = [ "opacity" ];
11
+ super(from, to, duration, easing, params), this.keys = [ "opacity", "fillOpacity", "strokeOpacity" ],
12
+ this.from = {
13
+ opacity: 0,
14
+ fillOpacity: 0,
15
+ strokeOpacity: 0
16
+ };
12
17
  }
13
18
  }
14
19
 
@@ -16,7 +21,7 @@ exports.FadeIn = FadeIn;
16
21
 
17
22
  class FadeOut extends common_1.CommonOut {
18
23
  constructor(from, to, duration, easing, params) {
19
- super(from, to, duration, easing, params), this.keys = [ "opacity" ];
24
+ super(from, to, duration, easing, params), this.keys = [ "opacity", "fillOpacity", "strokeOpacity" ];
20
25
  }
21
26
  }
22
27
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/fade.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACF;AAPD,wBAOC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACF;AAPD,0BAOC","file":"fade.js","sourcesContent":["import type { EasingType } from '../intreface/easing';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class FadeIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity'];\n }\n}\n\nexport class FadeOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity'];\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/custom/fade.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;IAC/D,CAAC;CACF;AARD,wBAQC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;CACF;AAPD,0BAOC","file":"fade.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class FadeIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity', 'fillOpacity', 'strokeOpacity'];\n this.from = { opacity: 0, fillOpacity: 0, strokeOpacity: 0 };\n }\n}\n\nexport class FadeOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity', 'fillOpacity', 'strokeOpacity'];\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { EasingType } from '@visactor/vrender-core';
2
+ import { ACustomAnimate } from './custom-animate';
3
+ export declare class FromTo extends ACustomAnimate<Record<string, number>> {
4
+ valid: boolean;
5
+ keys: string[];
6
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
7
+ onBind(): void;
8
+ onFirstRun(): void;
9
+ update(end: boolean, ratio: number, out: Record<string, any>): void;
10
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.FromTo = void 0;
6
+
7
+ const custom_animate_1 = require("./custom-animate");
8
+
9
+ class FromTo extends custom_animate_1.ACustomAnimate {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params), this.from = null != from ? from : {};
12
+ }
13
+ onBind() {
14
+ var _a, _b;
15
+ super.onBind(), Object.keys(this.from).forEach((key => {
16
+ null == this.props[key] && (this.props[key] = this.target.getGraphicAttribute(key));
17
+ }));
18
+ const finalAttribute = this.target.getFinalAttribute();
19
+ "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute),
20
+ !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
21
+ }
22
+ onFirstRun() {
23
+ this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
24
+ const startProps = this.animate.getStartProps();
25
+ this.propKeys && this.propKeys.forEach((key => {
26
+ var _a;
27
+ this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
28
+ })), this.target.setAttributes(this.from);
29
+ }
30
+ update(end, ratio, out) {
31
+ if (this.onStart(), !this.props || !this.propKeys) return;
32
+ const easedRatio = this.easing(ratio);
33
+ this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.from, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach(((func, index) => {
34
+ if (!this.animate.validAttr(this.propKeys[index])) return;
35
+ const key = this.propKeys[index];
36
+ func(key, this.from[key], this.props[key], easedRatio, this, this.target);
37
+ })), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
38
+ }
39
+ }
40
+
41
+ exports.FromTo = FromTo;
42
+ //# sourceMappingURL=fromTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/fromTo.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAElD,MAAa,MAAO,SAAQ,+BAAsC;IAKhE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAClF,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC;IACzB,CAAC;IAED,MAAM;;QACJ,KAAK,CAAC,MAAM,EAAE,CAAC;QAGf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;aACxD;QACH,CAAC,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,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAC9F,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAEtD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;oBACjD,OAAO;iBACR;gBACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACjC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAChC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACP,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;CACF;AA7ED,wBA6EC","file":"fromTo.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class FromTo extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: any) {\n super(from, to, duration, easing, params);\n this.from = from ?? {};\n }\n\n onBind(): void {\n super.onBind();\n\n // 如果存在from,不存在to,那么需要设置给props\n Object.keys(this.from).forEach(key => {\n if (this.props[key] == null) {\n this.props[key] = this.target.getGraphicAttribute(key);\n }\n });\n\n const finalAttribute = this.target.getFinalAttribute();\n // 如果入场动画,那么需要设置属性\n if (this.target.context?.animationState === 'appear') {\n if (finalAttribute) {\n this.target.setAttributes(finalAttribute);\n }\n }\n if (this.params.controlOptions?.immediatelyApply !== false) {\n this.target.setAttributes(this.from);\n }\n }\n\n onFirstRun(): void {\n // 获取上一步的属性值作为起始值\n this.from = { ...this.getLastProps(), ...this.from };\n const startProps = this.animate.getStartProps();\n this.propKeys &&\n this.propKeys.forEach(key => {\n this.from[key] = this.from[key] ?? startProps[key];\n });\n // TODO:比较hack\n // 如果是入场动画,那么还需要设置属性\n // if (this.target.context?.animationState === 'appear') {\n // // 用于入场的时候设置属性(因为有动画的时候VChart不会再设置属性了)\n // const finalAttribute = this.target.getFinalAttribute();\n // this.target.setAttributes(finalAttribute);\n // }\n this.target.setAttributes(this.from);\n }\n\n /**\n * 更新执行的时候调用\n * 如果跳帧了就不一定会执行\n */\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n // TODO 需要修复,只有在开始的时候才调用\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.animate.interpolateUpdateFunction\n ? this.animate.interpolateUpdateFunction(this.from, this.props, easedRatio, this, this.target)\n : this.interpolateUpdateFunctions.forEach((func, index) => {\n // 如果这个属性被屏蔽了,直接跳过\n if (!this.animate.validAttr(this.propKeys[index])) {\n return;\n }\n const key = this.propKeys[index];\n const fromValue = this.from[key];\n const toValue = this.props[key];\n func(key, fromValue, toValue, easedRatio, this, this.target);\n });\n this.onUpdate(end, easedRatio, out);\n this.syncAttributeUpdate();\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { EasingType } from '@visactor/vrender-core';
2
+ import { CommonIn, CommonOut } from './common';
3
+ export declare class GroupFadeIn extends CommonIn {
4
+ valid: boolean;
5
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
6
+ }
7
+ export declare class GroupFadeOut extends CommonOut {
8
+ valid: boolean;
9
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
10
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.GroupFadeOut = exports.GroupFadeIn = void 0;
6
+
7
+ const common_1 = require("./common");
8
+
9
+ class GroupFadeIn extends common_1.CommonIn {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params), this.keys = [ "baseOpacity" ], this.from = {
12
+ baseOpacity: 0
13
+ };
14
+ }
15
+ }
16
+
17
+ exports.GroupFadeIn = GroupFadeIn;
18
+
19
+ class GroupFadeOut extends common_1.CommonOut {
20
+ constructor(from, to, duration, easing, params) {
21
+ super(from, to, duration, easing, params), this.keys = [ "baseOpacity" ];
22
+ }
23
+ }
24
+
25
+ exports.GroupFadeOut = GroupFadeOut;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/groupFade.ts"],"names":[],"mappings":";;;AAEA,qCAA+C;AAE/C,MAAa,WAAY,SAAQ,iBAAQ;IAGvC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAClF,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;IACjC,CAAC;CACF;AARD,kCAQC;AAED,MAAa,YAAa,SAAQ,kBAAS;IAGzC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAClF,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9B,CAAC;CACF;AAPD,oCAOC","file":"groupFade.js","sourcesContent":["import type { EasingType, IGroup } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport { CommonIn, CommonOut } from './common';\n\nexport class GroupFadeIn extends CommonIn {\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 this.keys = ['baseOpacity'];\n this.from = { baseOpacity: 0 };\n }\n}\n\nexport class GroupFadeOut extends CommonOut {\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 this.keys = ['baseOpacity'];\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
- import { type IGraphic, type IGroup } from '@visactor/vrender-core';
2
- import type { EasingType } from '../intreface/easing';
1
+ import { type IGraphic, type IGroup, type EasingType } from '@visactor/vrender-core';
3
2
  import { ACustomAnimate } from './custom-animate';
4
3
  interface IAnimationParameters {
5
4
  width: number;
@@ -23,15 +22,21 @@ export interface IGrowAngleAnimationOptions {
23
22
  }
24
23
  export declare const growAngleIn: TypeAnimation<IGraphic>;
25
24
  export declare const growAngleOut: TypeAnimation<IGraphic>;
26
- export declare class GworPointsBase extends ACustomAnimate<Record<string, number>> {
25
+ export declare class GrowAngleBase extends ACustomAnimate<Record<string, number>> {
27
26
  valid: boolean;
27
+ _updateFunction: (ratio: number) => void;
28
28
  constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
29
+ determineUpdateFunction(): void;
30
+ deleteSelfAttr(key: string): void;
31
+ updateStartAngle(ratio: number): void;
32
+ updateEndAngle(ratio: number): void;
33
+ updateAngle(ratio: number): void;
29
34
  onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
30
35
  }
31
- export declare class GrowAngleIn extends GworPointsBase {
36
+ export declare class GrowAngleIn extends GrowAngleBase {
32
37
  onBind(): void;
33
38
  }
34
- export declare class GrowAngleOut extends GworPointsBase {
39
+ export declare class GrowAngleOut extends GrowAngleBase {
35
40
  onBind(): void;
36
41
  }
37
42
  export {};
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.GrowAngleOut = exports.GrowAngleIn = exports.GworPointsBase = exports.growAngleOut = exports.growAngleIn = void 0;
5
+ }), exports.GrowAngleOut = exports.GrowAngleIn = exports.GrowAngleBase = exports.growAngleOut = exports.growAngleIn = void 0;
6
6
 
7
7
  const custom_animate_1 = require("./custom-animate"), vutils_1 = require("@visactor/vutils"), growAngleInIndividual = (graphic, options, animationParameters) => {
8
8
  const attrs = graphic.getFinalAttribute();
@@ -55,7 +55,7 @@ const custom_animate_1 = require("./custom-animate"), vutils_1 = require("@visac
55
55
  exports.growAngleIn = growAngleIn;
56
56
 
57
57
  const growAngleOutIndividual = (graphic, options, animationParameters) => {
58
- const attrs = graphic.getFinalAttribute();
58
+ const attrs = graphic.attribute;
59
59
  return options && "anticlockwise" === options.orient ? {
60
60
  from: {
61
61
  startAngle: attrs.startAngle
@@ -72,7 +72,7 @@ const growAngleOutIndividual = (graphic, options, animationParameters) => {
72
72
  }
73
73
  };
74
74
  }, growAngleOutOverall = (graphic, options, animationParameters) => {
75
- const attrs = graphic.getFinalAttribute();
75
+ const attrs = graphic.attribute;
76
76
  if (options && "anticlockwise" === options.orient) {
77
77
  const overallValue = (0, vutils_1.isNumber)(options.overall) ? options.overall : 2 * Math.PI;
78
78
  return {
@@ -104,37 +104,58 @@ const growAngleOutIndividual = (graphic, options, animationParameters) => {
104
104
 
105
105
  exports.growAngleOut = growAngleOut;
106
106
 
107
- class GworPointsBase extends custom_animate_1.ACustomAnimate {
107
+ class GrowAngleBase extends custom_animate_1.ACustomAnimate {
108
108
  constructor(from, to, duration, easing, params) {
109
109
  super(from, to, duration, easing, params);
110
110
  }
111
+ determineUpdateFunction() {
112
+ this.propKeys ? this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateAngle : "startAngle" === this.propKeys[0] ? this._updateFunction = this.updateStartAngle : "endAngle" === this.propKeys[0] ? this._updateFunction = this.updateEndAngle : this.valid = !1 : this.valid = !1;
113
+ }
114
+ deleteSelfAttr(key) {
115
+ delete this.props[key], this.fromProps && delete this.fromProps[key];
116
+ const index = this.propKeys.indexOf(key);
117
+ -1 !== index && this.propKeys.splice(index, 1), this.propKeys && this.propKeys.length > 1 ? this._updateFunction = this.updateAngle : "startAngle" === this.propKeys[0] ? this._updateFunction = this.updateStartAngle : "endAngle" === this.propKeys[0] ? this._updateFunction = this.updateEndAngle : this._updateFunction = null;
118
+ }
119
+ updateStartAngle(ratio) {
120
+ this.target.attribute.startAngle = this.from.startAngle + (this.to.startAngle - this.from.startAngle) * ratio;
121
+ }
122
+ updateEndAngle(ratio) {
123
+ this.target.attribute.endAngle = this.from.endAngle + (this.to.endAngle - this.from.endAngle) * ratio;
124
+ }
125
+ updateAngle(ratio) {
126
+ this.updateStartAngle(ratio), this.updateEndAngle(ratio);
127
+ }
111
128
  onUpdate(end, ratio, out) {
112
- this.propKeys.forEach((key => {
113
- out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
114
- })), this.target.setAttributes(out);
129
+ this._updateFunction && (this._updateFunction(ratio), this.target.addUpdateShapeAndBoundsTag());
115
130
  }
116
131
  }
117
132
 
118
- exports.GworPointsBase = GworPointsBase;
133
+ exports.GrowAngleBase = GrowAngleBase;
119
134
 
120
- class GrowAngleIn extends GworPointsBase {
135
+ class GrowAngleIn extends GrowAngleBase {
121
136
  onBind() {
122
- var _a;
123
- const {from: from, to: to} = (0, exports.growAngleIn)(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
137
+ var _a, _b;
138
+ super.onBind();
139
+ const {from: from, to: to} = (0, exports.growAngleIn)(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;
124
140
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
125
- this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
141
+ this.from = fromAttrs, this.to = to;
142
+ const finalAttribute = this.target.getFinalAttribute();
143
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs),
144
+ this.determineUpdateFunction();
126
145
  }
127
146
  }
128
147
 
129
148
  exports.GrowAngleIn = GrowAngleIn;
130
149
 
131
- class GrowAngleOut extends GworPointsBase {
150
+ class GrowAngleOut extends GrowAngleBase {
132
151
  onBind() {
133
- var _a;
134
- const {from: from, to: to} = (0, exports.growAngleOut)(this.target, this.params.options, this.params), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : from;
152
+ super.onBind();
153
+ const {from: from, to: to} = (0, exports.growAngleOut)(this.target, this.params.options, this.params), fromAttrs = from;
135
154
  this.props = to, this.propKeys = Object.keys(to).filter((key => null != to[key])),
136
- this.animate.reSyncProps(), this.from = fromAttrs, this.to = to, this.target.setAttributes(fromAttrs);
155
+ this.from = null != fromAttrs ? fromAttrs : this.target.attribute, this.to = to,
156
+ this.determineUpdateFunction();
137
157
  }
138
158
  }
139
159
 
140
- exports.GrowAngleOut = GrowAngleOut;
160
+ exports.GrowAngleOut = GrowAngleOut;
161
+ //# sourceMappingURL=growAngle.js.map