@visactor/vrender-core 0.22.15-alpha.1 → 0.22.15

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 (441) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +40 -0
  2. package/cjs/animate/Ticker/default-ticker.js +140 -0
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -0
  4. package/cjs/animate/Ticker/index.d.ts +5 -0
  5. package/cjs/{interface/animation → animate/Ticker}/index.js +3 -3
  6. package/cjs/animate/Ticker/index.js.map +1 -0
  7. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  8. package/cjs/animate/Ticker/manual-ticker-handler.js +36 -0
  9. package/cjs/animate/Ticker/manual-ticker-handler.js.map +1 -0
  10. package/cjs/animate/Ticker/manual-ticker.d.ts +19 -0
  11. package/cjs/animate/Ticker/manual-ticker.js +37 -0
  12. package/cjs/animate/Ticker/manual-ticker.js.map +1 -0
  13. package/cjs/animate/Ticker/raf-tick-handler.d.ts +9 -0
  14. package/cjs/animate/Ticker/raf-tick-handler.js +30 -0
  15. package/cjs/animate/Ticker/raf-tick-handler.js.map +1 -0
  16. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  17. package/cjs/animate/Ticker/timeout-tick-handler.js +28 -0
  18. package/cjs/animate/Ticker/timeout-tick-handler.js.map +1 -0
  19. package/cjs/animate/Ticker/type.d.ts +6 -0
  20. package/cjs/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
  21. package/cjs/animate/Ticker/type.js.map +1 -0
  22. package/cjs/animate/animate.d.ts +147 -0
  23. package/cjs/animate/animate.js +403 -0
  24. package/cjs/animate/animate.js.map +1 -0
  25. package/cjs/animate/config.d.ts +2 -1
  26. package/cjs/animate/config.js +5 -1
  27. package/cjs/animate/config.js.map +1 -1
  28. package/cjs/animate/custom-animate.d.ts +236 -0
  29. package/cjs/animate/custom-animate.js +726 -0
  30. package/cjs/animate/custom-animate.js.map +1 -0
  31. package/cjs/animate/default-ticker.d.ts +2 -0
  32. package/cjs/animate/default-ticker.js +14 -0
  33. package/cjs/animate/default-ticker.js.map +1 -0
  34. package/cjs/animate/easing-func.d.ts +1 -0
  35. package/cjs/animate/easing-func.js +16 -0
  36. package/cjs/animate/easing-func.js.map +1 -0
  37. package/cjs/animate/easing.d.ts +49 -0
  38. package/cjs/animate/easing.js +141 -0
  39. package/cjs/animate/easing.js.map +1 -0
  40. package/cjs/animate/group-fade.d.ts +16 -0
  41. package/cjs/animate/group-fade.js +66 -0
  42. package/cjs/animate/group-fade.js.map +1 -0
  43. package/cjs/animate/index.d.ts +8 -0
  44. package/cjs/animate/index.js +24 -0
  45. package/cjs/animate/index.js.map +1 -0
  46. package/cjs/animate/morphing.d.ts +52 -0
  47. package/cjs/animate/morphing.js +292 -0
  48. package/cjs/animate/morphing.js.map +1 -0
  49. package/cjs/animate/timeline.d.ts +17 -0
  50. package/cjs/animate/timeline.js +46 -0
  51. package/cjs/animate/timeline.js.map +1 -0
  52. package/cjs/application.d.ts +1 -2
  53. package/cjs/application.js.map +1 -1
  54. package/cjs/canvas/constants.js +2 -1
  55. package/cjs/canvas/empty-context.d.ts +0 -1
  56. package/cjs/canvas/empty-context.js +0 -4
  57. package/cjs/canvas/empty-context.js.map +1 -1
  58. package/cjs/color-string/interpolate.d.ts +0 -1
  59. package/cjs/color-string/interpolate.js +4 -12
  60. package/cjs/color-string/interpolate.js.map +1 -1
  61. package/cjs/color-string/store.js +1 -2
  62. package/cjs/common/custom-path2d.js +2 -2
  63. package/cjs/common/custom-path2d.js.map +1 -1
  64. package/cjs/common/enums.d.ts +16 -0
  65. package/cjs/common/enums.js +11 -2
  66. package/cjs/common/enums.js.map +1 -1
  67. package/cjs/common/morphing-utils.js +124 -32
  68. package/cjs/common/morphing-utils.js.map +1 -1
  69. package/cjs/common/polygon.js +2 -5
  70. package/cjs/common/polygon.js.map +1 -1
  71. package/cjs/common/segment/curve/cubic-bezier.d.ts +2 -1
  72. package/cjs/common/segment/curve/cubic-bezier.js +8 -3
  73. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  74. package/cjs/common/segment/curve/quadratic-bezier.d.ts +0 -1
  75. package/cjs/common/segment/curve/quadratic-bezier.js +3 -10
  76. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  77. package/cjs/common/segment/index.d.ts +0 -1
  78. package/cjs/common/segment/index.js +1 -1
  79. package/cjs/common/segment/index.js.map +1 -1
  80. package/cjs/common/shape/arc.d.ts +1 -1
  81. package/cjs/common/shape/arc.js +3 -7
  82. package/cjs/common/shape/arc.js.map +1 -1
  83. package/cjs/common/simplify.js +2 -1
  84. package/cjs/common/sort.js +1 -1
  85. package/cjs/common/split-path.js +2 -2
  86. package/cjs/common/split-path.js.map +1 -1
  87. package/cjs/common/store.js +1 -1
  88. package/cjs/common/text.js +1 -1
  89. package/cjs/common/utils.d.ts +2 -0
  90. package/cjs/common/utils.js +9 -5
  91. package/cjs/common/utils.js.map +1 -1
  92. package/cjs/core/application.js +1 -1
  93. package/cjs/core/camera.js +1 -1
  94. package/cjs/core/global.d.ts +0 -3
  95. package/cjs/core/global.js +3 -14
  96. package/cjs/core/global.js.map +1 -1
  97. package/cjs/core/stage.d.ts +3 -8
  98. package/cjs/core/stage.js +20 -34
  99. package/cjs/core/stage.js.map +1 -1
  100. package/cjs/graphic/arc.d.ts +2 -1
  101. package/cjs/graphic/arc.js +2 -3
  102. package/cjs/graphic/arc.js.map +1 -1
  103. package/cjs/graphic/area.d.ts +2 -1
  104. package/cjs/graphic/area.js +1 -4
  105. package/cjs/graphic/area.js.map +1 -1
  106. package/cjs/graphic/circle.d.ts +2 -1
  107. package/cjs/graphic/circle.js +2 -5
  108. package/cjs/graphic/circle.js.map +1 -1
  109. package/cjs/graphic/config.js +1 -2
  110. package/cjs/graphic/config.js.map +1 -1
  111. package/cjs/graphic/graphic-service/graphic-module.js +2 -1
  112. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  113. package/cjs/graphic/graphic-service/graphic-service.js +3 -2
  114. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  115. package/cjs/graphic/graphic.d.ts +12 -9
  116. package/cjs/graphic/graphic.js +105 -48
  117. package/cjs/graphic/graphic.js.map +1 -1
  118. package/cjs/graphic/group.js +8 -8
  119. package/cjs/graphic/group.js.map +1 -1
  120. package/cjs/graphic/line.d.ts +2 -1
  121. package/cjs/graphic/line.js +1 -5
  122. package/cjs/graphic/line.js.map +1 -1
  123. package/cjs/graphic/rect.js +2 -5
  124. package/cjs/graphic/rect.js.map +1 -1
  125. package/cjs/graphic/richtext/icon.d.ts +1 -1
  126. package/cjs/graphic/richtext/icon.js.map +1 -1
  127. package/cjs/graphic/richtext/paragraph.js +2 -2
  128. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  129. package/cjs/graphic/star.d.ts +2 -1
  130. package/cjs/graphic/star.js +2 -4
  131. package/cjs/graphic/star.js.map +1 -1
  132. package/cjs/index.d.ts +3 -2
  133. package/cjs/index.js +16 -14
  134. package/cjs/index.js.map +1 -1
  135. package/cjs/interface/animate.d.ts +160 -1
  136. package/cjs/interface/animate.js +4 -1
  137. package/cjs/interface/animate.js.map +1 -1
  138. package/cjs/interface/context.d.ts +0 -1
  139. package/cjs/interface/context.js.map +1 -1
  140. package/cjs/interface/global.d.ts +0 -2
  141. package/cjs/interface/global.js.map +1 -1
  142. package/cjs/interface/graphic.d.ts +3 -11
  143. package/cjs/interface/graphic.js.map +1 -1
  144. package/cjs/interface/index.d.ts +1 -1
  145. package/cjs/interface/index.js +9 -9
  146. package/cjs/interface/index.js.map +1 -1
  147. package/cjs/interface/render.d.ts +0 -7
  148. package/cjs/interface/render.js.map +1 -1
  149. package/cjs/interface/stage.d.ts +1 -4
  150. package/cjs/interface/stage.js.map +1 -1
  151. package/cjs/modules.d.ts +1 -2
  152. package/cjs/modules.js +3 -4
  153. package/cjs/modules.js.map +1 -1
  154. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +8 -9
  155. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  156. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +11 -14
  157. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  158. package/cjs/plugins/builtin-plugin/edit-module.js +4 -4
  159. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  160. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +10 -13
  161. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  162. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  163. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  164. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  165. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  166. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  167. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  168. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  169. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  170. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +5 -6
  171. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  172. package/cjs/render/contributions/render/arc-render.d.ts +2 -4
  173. package/cjs/render/contributions/render/arc-render.js +17 -19
  174. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  175. package/cjs/render/contributions/render/area-render.js +2 -2
  176. package/cjs/render/contributions/render/area-render.js.map +1 -1
  177. package/cjs/render/contributions/render/base-render.d.ts +2 -2
  178. package/cjs/render/contributions/render/base-render.js +2 -2
  179. package/cjs/render/contributions/render/base-render.js.map +1 -1
  180. package/cjs/render/contributions/render/draw-contribution.d.ts +0 -1
  181. package/cjs/render/contributions/render/draw-contribution.js +19 -23
  182. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  183. package/cjs/render/contributions/render/draw-interceptor.js +1 -2
  184. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  185. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  186. package/cjs/render/contributions/render/group-render.js +11 -15
  187. package/cjs/render/contributions/render/group-render.js.map +1 -1
  188. package/cjs/render/contributions/render/line-render.js +1 -1
  189. package/cjs/render/contributions/render/line-render.js.map +1 -1
  190. package/cjs/render/contributions/render/rect-render.d.ts +1 -3
  191. package/cjs/render/contributions/render/rect-render.js +15 -17
  192. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  193. package/cjs/render/contributions/render/symbol-render.d.ts +2 -4
  194. package/cjs/render/contributions/render/symbol-render.js +11 -16
  195. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  196. package/cjs/render/render-service.d.ts +1 -1
  197. package/cjs/render/render-service.js.map +1 -1
  198. package/dist/index.es.js +8868 -6022
  199. package/es/animate/Ticker/default-ticker.d.ts +40 -0
  200. package/es/animate/Ticker/default-ticker.js +138 -0
  201. package/es/animate/Ticker/default-ticker.js.map +1 -0
  202. package/es/animate/Ticker/index.d.ts +5 -0
  203. package/es/animate/Ticker/index.js +10 -0
  204. package/es/animate/Ticker/index.js.map +1 -0
  205. package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  206. package/es/animate/Ticker/manual-ticker-handler.js +28 -0
  207. package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
  208. package/es/animate/Ticker/manual-ticker.d.ts +19 -0
  209. package/es/animate/Ticker/manual-ticker.js +31 -0
  210. package/es/animate/Ticker/manual-ticker.js.map +1 -0
  211. package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
  212. package/es/animate/Ticker/raf-tick-handler.js +22 -0
  213. package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
  214. package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  215. package/es/animate/Ticker/timeout-tick-handler.js +20 -0
  216. package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
  217. package/es/animate/Ticker/type.d.ts +6 -0
  218. package/es/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
  219. package/es/animate/Ticker/type.js.map +1 -0
  220. package/es/animate/animate.d.ts +147 -0
  221. package/es/animate/animate.js +398 -0
  222. package/es/animate/animate.js.map +1 -0
  223. package/es/animate/config.d.ts +2 -1
  224. package/es/animate/config.js +5 -0
  225. package/es/animate/config.js.map +1 -1
  226. package/es/animate/custom-animate.d.ts +236 -0
  227. package/es/animate/custom-animate.js +703 -0
  228. package/es/animate/custom-animate.js.map +1 -0
  229. package/es/animate/default-ticker.d.ts +2 -0
  230. package/es/animate/default-ticker.js +12 -0
  231. package/es/animate/default-ticker.js.map +1 -0
  232. package/es/animate/easing-func.d.ts +1 -0
  233. package/es/animate/easing-func.js +10 -0
  234. package/es/animate/easing-func.js.map +1 -0
  235. package/es/animate/easing.d.ts +49 -0
  236. package/es/animate/easing.js +134 -0
  237. package/es/animate/easing.js.map +1 -0
  238. package/es/animate/group-fade.d.ts +16 -0
  239. package/es/animate/group-fade.js +56 -0
  240. package/es/animate/group-fade.js.map +1 -0
  241. package/es/animate/index.d.ts +8 -0
  242. package/es/animate/index.js +16 -0
  243. package/es/animate/index.js.map +1 -0
  244. package/es/animate/morphing.d.ts +52 -0
  245. package/es/animate/morphing.js +295 -0
  246. package/es/animate/morphing.js.map +1 -0
  247. package/es/animate/timeline.d.ts +17 -0
  248. package/es/animate/timeline.js +42 -0
  249. package/es/animate/timeline.js.map +1 -0
  250. package/es/application.d.ts +1 -2
  251. package/es/application.js.map +1 -1
  252. package/es/canvas/constants.js +2 -1
  253. package/es/canvas/empty-context.d.ts +0 -1
  254. package/es/canvas/empty-context.js +0 -4
  255. package/es/canvas/empty-context.js.map +1 -1
  256. package/es/color-string/interpolate.d.ts +0 -1
  257. package/es/color-string/interpolate.js +1 -8
  258. package/es/color-string/interpolate.js.map +1 -1
  259. package/es/color-string/store.js +1 -2
  260. package/es/common/custom-path2d.js +2 -2
  261. package/es/common/custom-path2d.js.map +1 -1
  262. package/es/common/enums.d.ts +16 -0
  263. package/es/common/enums.js +20 -0
  264. package/es/common/enums.js.map +1 -1
  265. package/es/common/morphing-utils.js +124 -29
  266. package/es/common/morphing-utils.js.map +1 -1
  267. package/es/common/polygon.js +3 -6
  268. package/es/common/polygon.js.map +1 -1
  269. package/es/common/segment/curve/cubic-bezier.d.ts +2 -1
  270. package/es/common/segment/curve/cubic-bezier.js +8 -1
  271. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  272. package/es/common/segment/curve/quadratic-bezier.d.ts +0 -1
  273. package/es/common/segment/curve/quadratic-bezier.js +2 -5
  274. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  275. package/es/common/segment/index.d.ts +0 -1
  276. package/es/common/segment/index.js +0 -2
  277. package/es/common/segment/index.js.map +1 -1
  278. package/es/common/shape/arc.d.ts +1 -1
  279. package/es/common/shape/arc.js +3 -7
  280. package/es/common/shape/arc.js.map +1 -1
  281. package/es/common/simplify.js +2 -1
  282. package/es/common/sort.js +1 -1
  283. package/es/common/split-path.js +2 -2
  284. package/es/common/split-path.js.map +1 -1
  285. package/es/common/store.js +1 -1
  286. package/es/common/text.js +1 -1
  287. package/es/common/utils.d.ts +2 -0
  288. package/es/common/utils.js +5 -1
  289. package/es/common/utils.js.map +1 -1
  290. package/es/core/application.js +1 -1
  291. package/es/core/camera.js +1 -1
  292. package/es/core/global.d.ts +0 -3
  293. package/es/core/global.js +2 -15
  294. package/es/core/global.js.map +1 -1
  295. package/es/core/stage.d.ts +3 -8
  296. package/es/core/stage.js +22 -35
  297. package/es/core/stage.js.map +1 -1
  298. package/es/graphic/arc.d.ts +2 -1
  299. package/es/graphic/arc.js +2 -3
  300. package/es/graphic/arc.js.map +1 -1
  301. package/es/graphic/area.d.ts +2 -1
  302. package/es/graphic/area.js +1 -4
  303. package/es/graphic/area.js.map +1 -1
  304. package/es/graphic/circle.d.ts +2 -1
  305. package/es/graphic/circle.js +2 -4
  306. package/es/graphic/circle.js.map +1 -1
  307. package/es/graphic/config.js +1 -2
  308. package/es/graphic/config.js.map +1 -1
  309. package/es/graphic/graphic-service/graphic-module.js +1 -1
  310. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  311. package/es/graphic/graphic-service/graphic-service.js +4 -1
  312. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  313. package/es/graphic/graphic.d.ts +12 -9
  314. package/es/graphic/graphic.js +109 -52
  315. package/es/graphic/graphic.js.map +1 -1
  316. package/es/graphic/group.js +7 -7
  317. package/es/graphic/group.js.map +1 -1
  318. package/es/graphic/line.d.ts +2 -1
  319. package/es/graphic/line.js +1 -5
  320. package/es/graphic/line.js.map +1 -1
  321. package/es/graphic/rect.js +2 -5
  322. package/es/graphic/rect.js.map +1 -1
  323. package/es/graphic/richtext/icon.d.ts +1 -1
  324. package/es/graphic/richtext/icon.js.map +1 -1
  325. package/es/graphic/richtext/paragraph.js +2 -2
  326. package/es/graphic/richtext/paragraph.js.map +1 -1
  327. package/es/graphic/star.d.ts +2 -1
  328. package/es/graphic/star.js +2 -4
  329. package/es/graphic/star.js.map +1 -1
  330. package/es/index.d.ts +3 -2
  331. package/es/index.js +6 -4
  332. package/es/index.js.map +1 -1
  333. package/es/interface/animate.d.ts +160 -1
  334. package/es/interface/animate.js +1 -2
  335. package/es/interface/animate.js.map +1 -1
  336. package/es/interface/context.d.ts +0 -1
  337. package/es/interface/context.js.map +1 -1
  338. package/es/interface/global.d.ts +0 -2
  339. package/es/interface/global.js.map +1 -1
  340. package/es/interface/graphic.d.ts +3 -11
  341. package/es/interface/graphic.js.map +1 -1
  342. package/es/interface/index.d.ts +1 -1
  343. package/es/interface/index.js +2 -2
  344. package/es/interface/index.js.map +1 -1
  345. package/es/interface/render.d.ts +0 -7
  346. package/es/interface/render.js.map +1 -1
  347. package/es/interface/stage.d.ts +1 -4
  348. package/es/interface/stage.js.map +1 -1
  349. package/es/modules.d.ts +1 -2
  350. package/es/modules.js +0 -6
  351. package/es/modules.js.map +1 -1
  352. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  353. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  354. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +12 -13
  355. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  356. package/es/plugins/builtin-plugin/edit-module.js +4 -4
  357. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  358. package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -12
  359. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  360. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  361. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  362. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  363. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  364. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  365. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  366. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  367. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  368. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +5 -4
  369. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  370. package/es/render/contributions/render/arc-render.d.ts +2 -4
  371. package/es/render/contributions/render/arc-render.js +17 -19
  372. package/es/render/contributions/render/arc-render.js.map +1 -1
  373. package/es/render/contributions/render/area-render.js +2 -2
  374. package/es/render/contributions/render/area-render.js.map +1 -1
  375. package/es/render/contributions/render/base-render.d.ts +2 -2
  376. package/es/render/contributions/render/base-render.js +2 -2
  377. package/es/render/contributions/render/base-render.js.map +1 -1
  378. package/es/render/contributions/render/draw-contribution.d.ts +0 -1
  379. package/es/render/contributions/render/draw-contribution.js +19 -23
  380. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  381. package/es/render/contributions/render/draw-interceptor.js +1 -2
  382. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  383. package/es/render/contributions/render/group-render.d.ts +2 -2
  384. package/es/render/contributions/render/group-render.js +11 -15
  385. package/es/render/contributions/render/group-render.js.map +1 -1
  386. package/es/render/contributions/render/line-render.js +1 -1
  387. package/es/render/contributions/render/line-render.js.map +1 -1
  388. package/es/render/contributions/render/rect-render.d.ts +1 -3
  389. package/es/render/contributions/render/rect-render.js +14 -17
  390. package/es/render/contributions/render/rect-render.js.map +1 -1
  391. package/es/render/contributions/render/symbol-render.d.ts +2 -4
  392. package/es/render/contributions/render/symbol-render.js +11 -16
  393. package/es/render/contributions/render/symbol-render.js.map +1 -1
  394. package/es/render/render-service.d.ts +1 -1
  395. package/es/render/render-service.js.map +1 -1
  396. package/package.json +4 -4
  397. package/cjs/common/diff.d.ts +0 -1
  398. package/cjs/common/diff.js +0 -19
  399. package/cjs/common/diff.js.map +0 -1
  400. package/cjs/common/performance-raf.d.ts +0 -8
  401. package/cjs/common/performance-raf.js +0 -32
  402. package/cjs/common/performance-raf.js.map +0 -1
  403. package/cjs/interface/animation/animate.d.ts +0 -117
  404. package/cjs/interface/animation/animate.js +0 -10
  405. package/cjs/interface/animation/animate.js.map +0 -1
  406. package/cjs/interface/animation/easing.d.ts +0 -3
  407. package/cjs/interface/animation/easing.js +0 -6
  408. package/cjs/interface/animation/easing.js.map +0 -1
  409. package/cjs/interface/animation/index.d.ts +0 -5
  410. package/cjs/interface/animation/index.js.map +0 -1
  411. package/cjs/interface/animation/ticker.d.ts +0 -39
  412. package/cjs/interface/animation/ticker.js.map +0 -1
  413. package/cjs/interface/animation/timeline.d.ts +0 -17
  414. package/cjs/interface/animation/timeline.js +0 -6
  415. package/cjs/interface/animation/timeline.js.map +0 -1
  416. package/cjs/interface/animation/type.d.ts +0 -13
  417. package/cjs/interface/animation/type.js +0 -15
  418. package/cjs/interface/animation/type.js.map +0 -1
  419. package/es/common/diff.d.ts +0 -1
  420. package/es/common/diff.js +0 -11
  421. package/es/common/diff.js.map +0 -1
  422. package/es/common/performance-raf.d.ts +0 -8
  423. package/es/common/performance-raf.js +0 -24
  424. package/es/common/performance-raf.js.map +0 -1
  425. package/es/interface/animation/animate.d.ts +0 -117
  426. package/es/interface/animation/animate.js +0 -6
  427. package/es/interface/animation/animate.js.map +0 -1
  428. package/es/interface/animation/easing.d.ts +0 -3
  429. package/es/interface/animation/easing.js +0 -2
  430. package/es/interface/animation/easing.js.map +0 -1
  431. package/es/interface/animation/index.d.ts +0 -5
  432. package/es/interface/animation/index.js +0 -10
  433. package/es/interface/animation/index.js.map +0 -1
  434. package/es/interface/animation/ticker.d.ts +0 -39
  435. package/es/interface/animation/ticker.js.map +0 -1
  436. package/es/interface/animation/timeline.d.ts +0 -17
  437. package/es/interface/animation/timeline.js +0 -2
  438. package/es/interface/animation/timeline.js.map +0 -1
  439. package/es/interface/animation/type.d.ts +0 -13
  440. package/es/interface/animation/type.js +0 -14
  441. package/es/interface/animation/type.js.map +0 -1
@@ -1,117 +0,0 @@
1
- import type { IGraphic } from '../graphic';
2
- import type { EasingType, EasingTypeFunc } from './easing';
3
- import type { AnimateStatus, IAnimateStepType } from './type';
4
- import type { ITimeline } from './timeline';
5
- export interface ICustomAnimate extends IStep {
6
- type: IAnimateStepType;
7
- }
8
- export interface IStep {
9
- type: IAnimateStepType;
10
- prev?: IStep;
11
- duration: number;
12
- next?: IStep;
13
- props?: Record<string, any>;
14
- fromParsedProps?: Record<string, any>;
15
- toParsedProps?: Record<string, any>;
16
- fromProps?: Record<string, any>;
17
- propKeys?: string[];
18
- easing?: EasingTypeFunc;
19
- append: (step: IStep) => void;
20
- getLastProps: () => any;
21
- animate: IAnimate;
22
- setDuration: (duration: number, updateDownstream?: boolean) => void;
23
- getDuration: () => number;
24
- determineInterpolateUpdateFunction: () => void;
25
- setStartTime: (time: number, updateDownstream?: boolean) => void;
26
- getStartTime: () => number;
27
- bind: (target: IGraphic, animate: IAnimate) => void;
28
- onBind: () => void;
29
- onFirstRun: () => void;
30
- onStart: () => void;
31
- onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;
32
- update: (end: boolean, ratio: number, out: Record<string, any>) => void;
33
- onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;
34
- getEndProps: () => Record<string, any> | void;
35
- getFromProps: () => Record<string, any> | void;
36
- getMergedEndProps: () => Record<string, any> | void;
37
- deleteSelfAttr: (key: string) => void;
38
- stop: () => void;
39
- }
40
- export interface IAnimate {
41
- readonly id: string | number;
42
- status: AnimateStatus;
43
- target: IGraphic;
44
- priority: number;
45
- interpolateUpdateFunction: ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void) | null;
46
- _onStart?: (() => void)[];
47
- _onFrame?: ((step: IStep, ratio: number) => void)[];
48
- _onEnd?: (() => void)[];
49
- _onRemove?: (() => void)[];
50
- getStartProps: () => Record<string, any>;
51
- getEndProps: () => Record<string, any>;
52
- setTimeline: (timeline: ITimeline) => void;
53
- getTimeline: () => ITimeline;
54
- readonly timeline: ITimeline;
55
- bind: (target: IGraphic) => this;
56
- to: (props: Record<string, any>, duration: number, easing: EasingType) => this;
57
- from: (props: Record<string, any>, duration: number, easing: EasingType) => this;
58
- pause: () => void;
59
- resume: () => void;
60
- onStart: (cb?: () => void) => void;
61
- onEnd: (cb?: () => void) => void;
62
- onFrame: (cb: (step: IStep, ratio: number) => void) => void;
63
- onRemove: (cb?: () => void) => void;
64
- preventAttr: (key: string) => void;
65
- preventAttrs: (key: string[]) => void;
66
- validAttr: (key: string) => boolean;
67
- runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;
68
- customInterpolate: (key: string, ratio: number, from: any, to: any, target: IGraphic, ret: Record<string, any>) => boolean;
69
- play: (customAnimate: ICustomAnimate) => this;
70
- getFromValue: () => Record<string, any>;
71
- getToValue: () => Record<string, any>;
72
- stop: (type?: 'start' | 'end' | Record<string, any>) => void;
73
- release: () => void;
74
- getDuration: () => number;
75
- getTotalDuration: () => number;
76
- getStartTime: () => number;
77
- wait: (delay: number) => this;
78
- afterAll: (list: IAnimate[]) => this;
79
- after: (animate: IAnimate) => this;
80
- parallel: (animate: IAnimate) => this;
81
- getLoop: () => number;
82
- loop: (n: number | boolean) => IAnimate;
83
- bounce: (b: boolean) => IAnimate;
84
- advance: (delta: number) => void;
85
- startAt: (t: number) => IAnimate;
86
- reSyncProps: () => void;
87
- updateDuration: () => void;
88
- }
89
- export declare enum AnimateMode {
90
- NORMAL = 0,
91
- SET_ATTR_IMMEDIATELY = 1
92
- }
93
- export interface IAnimateTarget {
94
- onAnimateBind?: (animte: IAnimate) => void;
95
- getComputedAttribute: (name: string) => any;
96
- getDefaultAttribute: (name: string) => any;
97
- onStop: (props?: Record<string, any>) => void;
98
- animates: Map<string | number, IAnimate>;
99
- [key: string]: any;
100
- }
101
- export interface BaseAnimateConfig {
102
- id?: number | string;
103
- interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;
104
- onStart?: () => void;
105
- onFrame?: (step: IStep, ratio: number) => void;
106
- onEnd?: () => void;
107
- onRemove?: () => void;
108
- }
109
- export interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {
110
- duration?: number;
111
- easing?: EasingType;
112
- delay?: number;
113
- }
114
- export interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {
115
- splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);
116
- individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;
117
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- var AnimateMode;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: !0
7
- }), exports.AnimateMode = void 0, function(AnimateMode) {
8
- AnimateMode[AnimateMode.NORMAL = 0] = "NORMAL", AnimateMode[AnimateMode.SET_ATTR_IMMEDIATELY = 1] = "SET_ATTR_IMMEDIATELY";
9
- }(AnimateMode = exports.AnimateMode || (exports.AnimateMode = {}));
10
- //# sourceMappingURL=animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":";;;AAsKA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n\n // 停止\n stop: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export type EasingTypeStr = 'linear' | 'quadIn' | 'quadOut' | 'quadInOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceOut' | 'bounceIn' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'expoIn' | 'expoOut' | 'expoInOut' | 'easeInOutQuad' | 'easeOutElastic' | 'easeInOutElastic' | '';
2
- export type EasingTypeFunc = (t: number) => number;
3
- export type EasingType = EasingTypeStr | EasingTypeFunc;
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- });
6
- //# sourceMappingURL=easing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/easing.ts"],"names":[],"mappings":"","file":"easing.js","sourcesContent":["export type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n // @since 0.21.0\n | 'easeInOutQuad'\n | 'easeOutElastic'\n | 'easeInOutElastic'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n"]}
@@ -1,5 +0,0 @@
1
- export * from './animate';
2
- export * from './ticker';
3
- export * from './timeline';
4
- export * from './type';
5
- export * from './easing';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,6CAA2B;AAC3B,yCAAuB;AACvB,2CAAyB","file":"index.js","sourcesContent":["export * from './animate';\nexport * from './ticker';\nexport * from './timeline';\nexport * from './type';\nexport * from './easing';\n"]}
@@ -1,39 +0,0 @@
1
- import type { EventEmitter } from '@visactor/vutils';
2
- import type { ITimeline } from './timeline';
3
- import type { IStage } from '../stage';
4
- export type TickerMode = 'raf' | 'timeout' | 'manual';
5
- export declare enum STATUS {
6
- INITIAL = 0,
7
- RUNNING = 1,
8
- PAUSE = 2
9
- }
10
- export interface ITickHandler {
11
- tick: (interval: number, cb: (handler: ITickHandler) => void) => void;
12
- tickTo?: (t: number, cb: (handler: ITickHandler, params?: {
13
- once: boolean;
14
- }) => void) => void;
15
- getTime: () => number;
16
- release: () => void;
17
- }
18
- export interface ITickerHandlerStatic {
19
- new (): ITickHandler;
20
- }
21
- export interface ITicker extends EventEmitter {
22
- setFPS?: (fps: number) => void;
23
- setInterval?: (interval: number) => void;
24
- getFPS?: () => number;
25
- getInterval?: () => number;
26
- tick: (interval: number) => void;
27
- tickAt?: (time: number) => void;
28
- pause: () => boolean;
29
- resume: () => boolean;
30
- start: (force?: boolean) => boolean;
31
- stop: () => void;
32
- addTimeline: (timeline: ITimeline) => void;
33
- remTimeline: (timeline: ITimeline) => void;
34
- trySyncTickStatus: () => void;
35
- getTimelines: () => ITimeline[];
36
- release: () => void;
37
- bindStage: (stage: IStage) => void;
38
- autoStop: boolean;
39
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/ticker.ts"],"names":[],"mappings":";;;AAUA,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,yCAAW,CAAA;IACX,yCAAW,CAAA;IACX,qCAAS,CAAA;AACX,CAAC,EAJW,MAAM,GAAN,cAAM,KAAN,cAAM,QAIjB","file":"ticker.js","sourcesContent":["/**\n * Ticker Types for Animation Graph\n */\n\nimport type { EventEmitter } from '@visactor/vutils';\nimport type { ITimeline } from './timeline';\nimport type { IStage } from '../stage';\n\nexport type TickerMode = 'raf' | 'timeout' | 'manual';\n\nexport enum STATUS {\n INITIAL = 0, // initial represents initial state\n RUNNING = 1, // running represents executing\n PAUSE = 2 // PAUSE represents tick continues but functions are not executed\n}\n\nexport interface ITickHandler {\n /**\n * Start executing tick\n * @param interval Delay in ms\n * @param cb Callback to execute\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void;\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // Get current time\n release: () => void;\n}\n\nexport interface ITickerHandlerStatic {\n new (): ITickHandler;\n}\n\nexport interface ITicker extends EventEmitter {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * Start ticking, if force is true, start regardless;\n * otherwise, don't start if timeline is empty\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n trySyncTickStatus: () => void;\n getTimelines: () => ITimeline[];\n release: () => void;\n\n bindStage: (stage: IStage) => void;\n\n // Whether to automatically stop, default is true\n autoStop: boolean;\n}\n"]}
@@ -1,17 +0,0 @@
1
- import type { IAnimate } from './animate';
2
- export interface ITimeline {
3
- id: number;
4
- isGlobal?: boolean;
5
- animateCount: number;
6
- addAnimate: (animate: IAnimate) => void;
7
- removeAnimate: (animate: IAnimate, release?: boolean) => void;
8
- tick: (delta: number) => void;
9
- clear: () => void;
10
- pause: () => void;
11
- resume: () => void;
12
- getTotalDuration: () => number;
13
- getPlaySpeed: () => number;
14
- setPlaySpeed: (speed: number) => void;
15
- getPlayState: () => 'playing' | 'paused' | 'stopped';
16
- isRunning: () => boolean;
17
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- });
6
- //# sourceMappingURL=timeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/timeline.ts"],"names":[],"mappings":"","file":"timeline.js","sourcesContent":["import type { IAnimate } from './animate';\n\nexport interface ITimeline {\n id: number;\n isGlobal?: boolean;\n // 包含的动画数量(animate数组的数量),包含所有动画\n animateCount: number;\n // 添加动画\n addAnimate: (animate: IAnimate) => void;\n // 移除动画\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n // 更新动画\n tick: (delta: number) => void;\n // 清除动画\n clear: () => void;\n // 暂停动画\n pause: () => void;\n // 恢复动画\n resume: () => void;\n // 获取动画总时长\n getTotalDuration: () => number;\n // 获取动画的播放速度\n getPlaySpeed: () => number;\n // 设置动画的播放速度\n setPlaySpeed: (speed: number) => void;\n // 获取动画的播放状态\n getPlayState: () => 'playing' | 'paused' | 'stopped';\n // 获取动画是否正在运行\n isRunning: () => boolean;\n}\n"]}
@@ -1,13 +0,0 @@
1
- export declare enum AnimateStepType {
2
- wait = "wait",
3
- from = "from",
4
- to = "to",
5
- customAnimate = "customAnimate"
6
- }
7
- export declare enum AnimateStatus {
8
- INITIAL = 0,
9
- RUNNING = 1,
10
- PAUSED = 2,
11
- END = 3
12
- }
13
- export type IAnimateStepType = keyof typeof AnimateStepType;
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- var AnimateStepType, AnimateStatus;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: !0
7
- }), exports.AnimateStatus = exports.AnimateStepType = void 0, function(AnimateStepType) {
8
- AnimateStepType.wait = "wait", AnimateStepType.from = "from", AnimateStepType.to = "to",
9
- AnimateStepType.customAnimate = "customAnimate";
10
- }(AnimateStepType = exports.AnimateStepType || (exports.AnimateStepType = {})),
11
- function(AnimateStatus) {
12
- AnimateStatus[AnimateStatus.INITIAL = 0] = "INITIAL", AnimateStatus[AnimateStatus.RUNNING = 1] = "RUNNING",
13
- AnimateStatus[AnimateStatus.PAUSED = 2] = "PAUSED", AnimateStatus[AnimateStatus.END = 3] = "END";
14
- }(AnimateStatus = exports.AnimateStatus || (exports.AnimateStatus = {}));
15
- //# sourceMappingURL=type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/type.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,4BAAS,CAAA;IACT,kDAA+B,CAAA;AACjC,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B;AAED,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,uDAAW,CAAA;IACX,qDAAU,CAAA;IACV,+CAAO,CAAA;AACT,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB","file":"type.js","sourcesContent":["export enum AnimateStepType {\n wait = 'wait',\n from = 'from',\n to = 'to',\n customAnimate = 'customAnimate'\n}\n\nexport enum AnimateStatus {\n INITIAL = 0,\n RUNNING = 1,\n PAUSED = 2,\n END = 3\n}\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n"]}
@@ -1 +0,0 @@
1
- export declare function diff<T extends Record<string, any>>(oldAttrs: T, newAttrs: T, getAttr?: (attr: keyof T) => any): Record<string, any>;
package/es/common/diff.js DELETED
@@ -1,11 +0,0 @@
1
- import { isEqual } from "@visactor/vutils";
2
-
3
- export function diff(oldAttrs, newAttrs, getAttr) {
4
- const diffObj = {};
5
- for (const key in newAttrs) key in oldAttrs && isEqual(oldAttrs[key], newAttrs[key]) || (diffObj[key] = newAttrs[key]);
6
- if (getAttr) for (const key in oldAttrs) if (!(key in newAttrs)) {
7
- const value = getAttr(key);
8
- void 0 !== value && (diffObj[key] = value);
9
- }
10
- return diffObj;
11
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAS3C,MAAM,UAAU,IAAI,CAClB,QAAW,EACX,QAAW,EACX,OAAgC;IAEhC,MAAM,OAAO,GAAwB,EAAE,CAAC;IAGxC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;QAE1B,IAAI,CAAC,CAAC,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE;YAChE,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;SAC9B;KACF;IAGD,IAAI,OAAO,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;YAC1B,IAAI,CAAC,CAAC,GAAG,IAAI,QAAQ,CAAC,EAAE;gBACtB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC3B,IAAI,KAAK,KAAK,SAAS,EAAE;oBACvB,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;iBACtB;aACF;SACF;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","file":"diff.js","sourcesContent":["import { isEqual } from '@visactor/vutils';\n\n/**\n * 比较两个对象的差异,深比较,返回差异的对象\n * @param oldAttrs 原始对象\n * @param newAttrs 目标对象\n * @param getAttr 获取属性值的函数(在于oldAttrs里有,newAttrs里没有的属性,调用函数获取,可选)\n * @returns 差异的对象\n */\nexport function diff<T extends Record<string, any>>(\n oldAttrs: T,\n newAttrs: T,\n getAttr?: (attr: keyof T) => any\n): Record<string, any> {\n const diffObj: Record<string, any> = {};\n\n // 处理newAttrs中的属性\n for (const key in newAttrs) {\n // 如果oldAttrs不存在该属性或者属性值不同\n if (!(key in oldAttrs) || !isEqual(oldAttrs[key], newAttrs[key])) {\n diffObj[key] = newAttrs[key];\n }\n }\n\n // 处理oldAttrs中有但newAttrs中没有的属性\n if (getAttr) {\n for (const key in oldAttrs) {\n if (!(key in newAttrs)) {\n const value = getAttr(key);\n if (value !== undefined) {\n diffObj[key] = value;\n }\n }\n }\n }\n\n return diffObj;\n}\n"]}
@@ -1,8 +0,0 @@
1
- export declare class PerformanceRAF {
2
- nextAnimationFrameCbs: Map<number, FrameRequestCallback>;
3
- private _rafHandle;
4
- addAnimationFrameCb(callback: FrameRequestCallback): number;
5
- removeAnimationFrameCb(index: number): boolean;
6
- protected runAnimationFrame: (time: number) => void;
7
- protected tryRunAnimationFrameNextFrame: () => void;
8
- }
@@ -1,24 +0,0 @@
1
- import { application } from "../application";
2
-
3
- let idx = 0;
4
-
5
- export class PerformanceRAF {
6
- constructor() {
7
- this.nextAnimationFrameCbs = new Map, this._rafHandle = null, this.runAnimationFrame = time => {
8
- this._rafHandle = null;
9
- const cbs = this.nextAnimationFrameCbs;
10
- this.nextAnimationFrameCbs = new Map, cbs.forEach((cb => cb(time)));
11
- }, this.tryRunAnimationFrameNextFrame = () => {
12
- null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.size && (this._rafHandle = application.global.getRequestAnimationFrame()(this.runAnimationFrame));
13
- };
14
- }
15
- addAnimationFrameCb(callback) {
16
- return this.nextAnimationFrameCbs.set(++idx, callback), this.tryRunAnimationFrameNextFrame(),
17
- idx;
18
- }
19
- removeAnimationFrameCb(index) {
20
- return !!this.nextAnimationFrameCbs.has(index) && (this.nextAnimationFrameCbs.delete(index),
21
- !0);
22
- }
23
- }
24
- //# sourceMappingURL=performance-raf.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common/performance-raf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,IAAI,GAAG,GAAG,CAAC,CAAC;AAKZ,MAAM,OAAO,cAAc;IAA3B;QACE,0BAAqB,GAAsC,IAAI,GAAG,EAAE,CAAC;QAC7D,eAAU,GAAkB,IAAI,CAAC;QAsB/B,sBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;YAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,MAAM,GAAG,GAAG,IAAI,CAAC,qBAAqB,CAAC;YACvC,IAAI,CAAC,qBAAqB,GAAG,IAAI,GAAG,EAAE,CAAC;YACvC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC;QAEQ,kCAA6B,GAAG,GAAG,EAAE;YAC7C,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAE;gBACrE,OAAO;aACR;YACD,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC1F,CAAC,CAAC;IACJ,CAAC;IAjCC,mBAAmB,CAAC,QAA8B;QAChD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEhD,IAAI,CAAC,6BAA6B,EAAE,CAAC;QACrC,OAAO,GAAG,CAAC;IACb,CAAC;IAOD,sBAAsB,CAAC,KAAa;QAClC,IAAI,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACzC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CAeF","file":"performance-raf.js","sourcesContent":["import { application } from '../application';\n\nlet idx = 0;\n\n/**\n * 性能优化,将requestAnimationFrame的回调函数存储起来,在下一帧执行\n */\nexport class PerformanceRAF {\n nextAnimationFrameCbs: Map<number, FrameRequestCallback> = new Map();\n private _rafHandle: number | null = null;\n\n addAnimationFrameCb(callback: FrameRequestCallback) {\n this.nextAnimationFrameCbs.set(++idx, callback);\n // 下一帧执行nextAnimationFrameCbs\n this.tryRunAnimationFrameNextFrame();\n return idx;\n }\n\n /**\n * 移除指定索引的回调函数\n * @param index raf索引,从1开始,相当于内部nextAnimationFrameCbs的idx + 1\n * @returns 是否移除成功\n */\n removeAnimationFrameCb(index: number): boolean {\n if (this.nextAnimationFrameCbs.has(index)) {\n this.nextAnimationFrameCbs.delete(index);\n return true;\n }\n return false;\n }\n\n protected runAnimationFrame = (time: number) => {\n this._rafHandle = null;\n const cbs = this.nextAnimationFrameCbs;\n this.nextAnimationFrameCbs = new Map();\n cbs.forEach(cb => cb(time));\n };\n\n protected tryRunAnimationFrameNextFrame = () => {\n if (this._rafHandle !== null || this.nextAnimationFrameCbs.size === 0) {\n return;\n }\n this._rafHandle = application.global.getRequestAnimationFrame()(this.runAnimationFrame);\n };\n}\n"]}
@@ -1,117 +0,0 @@
1
- import type { IGraphic } from '../graphic';
2
- import type { EasingType, EasingTypeFunc } from './easing';
3
- import type { AnimateStatus, IAnimateStepType } from './type';
4
- import type { ITimeline } from './timeline';
5
- export interface ICustomAnimate extends IStep {
6
- type: IAnimateStepType;
7
- }
8
- export interface IStep {
9
- type: IAnimateStepType;
10
- prev?: IStep;
11
- duration: number;
12
- next?: IStep;
13
- props?: Record<string, any>;
14
- fromParsedProps?: Record<string, any>;
15
- toParsedProps?: Record<string, any>;
16
- fromProps?: Record<string, any>;
17
- propKeys?: string[];
18
- easing?: EasingTypeFunc;
19
- append: (step: IStep) => void;
20
- getLastProps: () => any;
21
- animate: IAnimate;
22
- setDuration: (duration: number, updateDownstream?: boolean) => void;
23
- getDuration: () => number;
24
- determineInterpolateUpdateFunction: () => void;
25
- setStartTime: (time: number, updateDownstream?: boolean) => void;
26
- getStartTime: () => number;
27
- bind: (target: IGraphic, animate: IAnimate) => void;
28
- onBind: () => void;
29
- onFirstRun: () => void;
30
- onStart: () => void;
31
- onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;
32
- update: (end: boolean, ratio: number, out: Record<string, any>) => void;
33
- onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;
34
- getEndProps: () => Record<string, any> | void;
35
- getFromProps: () => Record<string, any> | void;
36
- getMergedEndProps: () => Record<string, any> | void;
37
- deleteSelfAttr: (key: string) => void;
38
- stop: () => void;
39
- }
40
- export interface IAnimate {
41
- readonly id: string | number;
42
- status: AnimateStatus;
43
- target: IGraphic;
44
- priority: number;
45
- interpolateUpdateFunction: ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void) | null;
46
- _onStart?: (() => void)[];
47
- _onFrame?: ((step: IStep, ratio: number) => void)[];
48
- _onEnd?: (() => void)[];
49
- _onRemove?: (() => void)[];
50
- getStartProps: () => Record<string, any>;
51
- getEndProps: () => Record<string, any>;
52
- setTimeline: (timeline: ITimeline) => void;
53
- getTimeline: () => ITimeline;
54
- readonly timeline: ITimeline;
55
- bind: (target: IGraphic) => this;
56
- to: (props: Record<string, any>, duration: number, easing: EasingType) => this;
57
- from: (props: Record<string, any>, duration: number, easing: EasingType) => this;
58
- pause: () => void;
59
- resume: () => void;
60
- onStart: (cb?: () => void) => void;
61
- onEnd: (cb?: () => void) => void;
62
- onFrame: (cb: (step: IStep, ratio: number) => void) => void;
63
- onRemove: (cb?: () => void) => void;
64
- preventAttr: (key: string) => void;
65
- preventAttrs: (key: string[]) => void;
66
- validAttr: (key: string) => boolean;
67
- runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;
68
- customInterpolate: (key: string, ratio: number, from: any, to: any, target: IGraphic, ret: Record<string, any>) => boolean;
69
- play: (customAnimate: ICustomAnimate) => this;
70
- getFromValue: () => Record<string, any>;
71
- getToValue: () => Record<string, any>;
72
- stop: (type?: 'start' | 'end' | Record<string, any>) => void;
73
- release: () => void;
74
- getDuration: () => number;
75
- getTotalDuration: () => number;
76
- getStartTime: () => number;
77
- wait: (delay: number) => this;
78
- afterAll: (list: IAnimate[]) => this;
79
- after: (animate: IAnimate) => this;
80
- parallel: (animate: IAnimate) => this;
81
- getLoop: () => number;
82
- loop: (n: number | boolean) => IAnimate;
83
- bounce: (b: boolean) => IAnimate;
84
- advance: (delta: number) => void;
85
- startAt: (t: number) => IAnimate;
86
- reSyncProps: () => void;
87
- updateDuration: () => void;
88
- }
89
- export declare enum AnimateMode {
90
- NORMAL = 0,
91
- SET_ATTR_IMMEDIATELY = 1
92
- }
93
- export interface IAnimateTarget {
94
- onAnimateBind?: (animte: IAnimate) => void;
95
- getComputedAttribute: (name: string) => any;
96
- getDefaultAttribute: (name: string) => any;
97
- onStop: (props?: Record<string, any>) => void;
98
- animates: Map<string | number, IAnimate>;
99
- [key: string]: any;
100
- }
101
- export interface BaseAnimateConfig {
102
- id?: number | string;
103
- interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;
104
- onStart?: () => void;
105
- onFrame?: (step: IStep, ratio: number) => void;
106
- onEnd?: () => void;
107
- onRemove?: () => void;
108
- }
109
- export interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {
110
- duration?: number;
111
- easing?: EasingType;
112
- delay?: number;
113
- }
114
- export interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {
115
- splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);
116
- individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;
117
- }
@@ -1,6 +0,0 @@
1
- export var AnimateMode;
2
-
3
- !function(AnimateMode) {
4
- AnimateMode[AnimateMode.NORMAL = 0] = "NORMAL", AnimateMode[AnimateMode.SET_ATTR_IMMEDIATELY = 1] = "SET_ATTR_IMMEDIATELY";
5
- }(AnimateMode || (AnimateMode = {}));
6
- //# sourceMappingURL=animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/animate.ts"],"names":[],"mappings":"AAsKA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,iDAAe,CAAA;IACf,6EAA6B,CAAA;AAC/B,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB","file":"animate.js","sourcesContent":["import type { IGraphic } from '../graphic';\nimport type { EasingType, EasingTypeFunc } from './easing';\nimport type { AnimateStatus, IAnimateStepType } from './type';\nimport type { ITimeline } from './timeline';\n\nexport interface ICustomAnimate extends IStep {\n type: IAnimateStepType;\n}\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 链表,下一个\n next?: IStep;\n // 属性\n props?: Record<string, any>;\n // 解析后的属性(用于性能优化,避免每次tick都解析)\n fromParsedProps?: Record<string, any>;\n toParsedProps?: Record<string, any>;\n fromProps?: Record<string, any>;\n // 解析后的属性列表(用于性能优化,避免每次tick都解析)\n propKeys?: string[];\n // 缓动函数\n easing?: EasingTypeFunc;\n\n // 添加一个\n append: (step: IStep) => void;\n // 获取上一个props,用于完成这次的fromValue 和 toValue的插值\n getLastProps: () => any;\n\n animate: IAnimate;\n\n // 设置持续时间\n setDuration: (duration: number, updateDownstream?: boolean) => void;\n // 获取持续时间\n getDuration: () => number;\n // 确定插值更新函数(在开始的时候就确定,避免每次tick都解析)\n determineInterpolateUpdateFunction: () => void;\n\n // 设置开始时间\n setStartTime: (time: number, updateDownstream?: boolean) => void;\n // 获取开始时间\n getStartTime: () => number;\n\n bind: (target: IGraphic, animate: IAnimate) => void;\n // 在第一次绑定到Animate的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: (cb?: (animate: IAnimate, step: IStep) => void) => void;\n // 更新执行的时候调用(如果有循环,那每个周期都会调用)\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n\n // 屏蔽自身属性,会直接从props等内容里删除掉\n deleteSelfAttr: (key: string) => void;\n\n // 停止\n stop: () => void;\n}\n\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n target: IGraphic;\n priority: number;\n interpolateUpdateFunction:\n | ((from: Record<string, any>, to: Record<string, any>, ratio: number, step: IStep, target: IGraphic) => void)\n | null;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n // 设置timeline\n setTimeline: (timeline: ITimeline) => void;\n // 获取timeline\n getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IGraphic) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb?: () => void) => void;\n onEnd: (cb?: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n onRemove: (cb?: () => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IGraphic,\n ret: Record<string, any>\n ) => boolean;\n play: (customAnimate: ICustomAnimate) => this;\n\n getFromValue: () => Record<string, any>;\n getToValue: () => Record<string, any>;\n // 停止,可以设置停止后设置target的属性为开始的值(fromValue),还是结束的值(toValue)\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n getTotalDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // 等待delay\n wait: (delay: number) => this;\n\n /* 动画编排 */\n // 所有动画结束后执行\n afterAll: (list: IAnimate[]) => this;\n // 在某个动画结束后执行\n after: (animate: IAnimate) => this;\n // 并行执行\n parallel: (animate: IAnimate) => this;\n\n getLoop: () => number;\n\n // 反转动画\n // reversed: (r: boolean) => IAnimate;\n // 循环动画\n loop: (n: number | boolean) => IAnimate;\n // 反弹动画\n bounce: (b: boolean) => IAnimate;\n\n advance: (delta: number) => void;\n\n // 设置开始时间(startAt之前是完全不会进入动画生命周期的)\n // 它和wait不一样,如果调用的是wait,wait过程中还算是一个动画阶段,只是空的阶段,而startAt之前是完全不会进入动画生命周期的\n startAt: (t: number) => IAnimate;\n\n // 重新同步和计算props,用于内部某些step发生了变更后,重新计算自身\n reSyncProps: () => void;\n\n // 更新duration\n updateDuration: () => void;\n}\n\nexport enum AnimateMode {\n NORMAL = 0b0000,\n SET_ATTR_IMMEDIATELY = 0b0001\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export type EasingTypeStr = 'linear' | 'quadIn' | 'quadOut' | 'quadInOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceOut' | 'bounceIn' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'expoIn' | 'expoOut' | 'expoInOut' | 'easeInOutQuad' | 'easeOutElastic' | 'easeInOutElastic' | '';
2
- export type EasingTypeFunc = (t: number) => number;
3
- export type EasingType = EasingTypeStr | EasingTypeFunc;
@@ -1,2 +0,0 @@
1
- export { };
2
- //# sourceMappingURL=easing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/easing.ts"],"names":[],"mappings":"","file":"easing.js","sourcesContent":["export type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n // @since 0.21.0\n | 'easeInOutQuad'\n | 'easeOutElastic'\n | 'easeInOutElastic'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n"]}
@@ -1,5 +0,0 @@
1
- export * from './animate';
2
- export * from './ticker';
3
- export * from './timeline';
4
- export * from './type';
5
- export * from './easing';
@@ -1,10 +0,0 @@
1
- export * from "./animate";
2
-
3
- export * from "./ticker";
4
-
5
- export * from "./timeline";
6
-
7
- export * from "./type";
8
-
9
- export * from "./easing";
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC","file":"index.js","sourcesContent":["export * from './animate';\nexport * from './ticker';\nexport * from './timeline';\nexport * from './type';\nexport * from './easing';\n"]}
@@ -1,39 +0,0 @@
1
- import type { EventEmitter } from '@visactor/vutils';
2
- import type { ITimeline } from './timeline';
3
- import type { IStage } from '../stage';
4
- export type TickerMode = 'raf' | 'timeout' | 'manual';
5
- export declare enum STATUS {
6
- INITIAL = 0,
7
- RUNNING = 1,
8
- PAUSE = 2
9
- }
10
- export interface ITickHandler {
11
- tick: (interval: number, cb: (handler: ITickHandler) => void) => void;
12
- tickTo?: (t: number, cb: (handler: ITickHandler, params?: {
13
- once: boolean;
14
- }) => void) => void;
15
- getTime: () => number;
16
- release: () => void;
17
- }
18
- export interface ITickerHandlerStatic {
19
- new (): ITickHandler;
20
- }
21
- export interface ITicker extends EventEmitter {
22
- setFPS?: (fps: number) => void;
23
- setInterval?: (interval: number) => void;
24
- getFPS?: () => number;
25
- getInterval?: () => number;
26
- tick: (interval: number) => void;
27
- tickAt?: (time: number) => void;
28
- pause: () => boolean;
29
- resume: () => boolean;
30
- start: (force?: boolean) => boolean;
31
- stop: () => void;
32
- addTimeline: (timeline: ITimeline) => void;
33
- remTimeline: (timeline: ITimeline) => void;
34
- trySyncTickStatus: () => void;
35
- getTimelines: () => ITimeline[];
36
- release: () => void;
37
- bindStage: (stage: IStage) => void;
38
- autoStop: boolean;
39
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/ticker.ts"],"names":[],"mappings":"AAUA,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,yCAAW,CAAA;IACX,yCAAW,CAAA;IACX,qCAAS,CAAA;AACX,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB","file":"ticker.js","sourcesContent":["/**\n * Ticker Types for Animation Graph\n */\n\nimport type { EventEmitter } from '@visactor/vutils';\nimport type { ITimeline } from './timeline';\nimport type { IStage } from '../stage';\n\nexport type TickerMode = 'raf' | 'timeout' | 'manual';\n\nexport enum STATUS {\n INITIAL = 0, // initial represents initial state\n RUNNING = 1, // running represents executing\n PAUSE = 2 // PAUSE represents tick continues but functions are not executed\n}\n\nexport interface ITickHandler {\n /**\n * Start executing tick\n * @param interval Delay in ms\n * @param cb Callback to execute\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void;\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // Get current time\n release: () => void;\n}\n\nexport interface ITickerHandlerStatic {\n new (): ITickHandler;\n}\n\nexport interface ITicker extends EventEmitter {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * Start ticking, if force is true, start regardless;\n * otherwise, don't start if timeline is empty\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n trySyncTickStatus: () => void;\n getTimelines: () => ITimeline[];\n release: () => void;\n\n bindStage: (stage: IStage) => void;\n\n // Whether to automatically stop, default is true\n autoStop: boolean;\n}\n"]}
@@ -1,17 +0,0 @@
1
- import type { IAnimate } from './animate';
2
- export interface ITimeline {
3
- id: number;
4
- isGlobal?: boolean;
5
- animateCount: number;
6
- addAnimate: (animate: IAnimate) => void;
7
- removeAnimate: (animate: IAnimate, release?: boolean) => void;
8
- tick: (delta: number) => void;
9
- clear: () => void;
10
- pause: () => void;
11
- resume: () => void;
12
- getTotalDuration: () => number;
13
- getPlaySpeed: () => number;
14
- setPlaySpeed: (speed: number) => void;
15
- getPlayState: () => 'playing' | 'paused' | 'stopped';
16
- isRunning: () => boolean;
17
- }
@@ -1,2 +0,0 @@
1
- export { };
2
- //# sourceMappingURL=timeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/interface/animation/timeline.ts"],"names":[],"mappings":"","file":"timeline.js","sourcesContent":["import type { IAnimate } from './animate';\n\nexport interface ITimeline {\n id: number;\n isGlobal?: boolean;\n // 包含的动画数量(animate数组的数量),包含所有动画\n animateCount: number;\n // 添加动画\n addAnimate: (animate: IAnimate) => void;\n // 移除动画\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n // 更新动画\n tick: (delta: number) => void;\n // 清除动画\n clear: () => void;\n // 暂停动画\n pause: () => void;\n // 恢复动画\n resume: () => void;\n // 获取动画总时长\n getTotalDuration: () => number;\n // 获取动画的播放速度\n getPlaySpeed: () => number;\n // 设置动画的播放速度\n setPlaySpeed: (speed: number) => void;\n // 获取动画的播放状态\n getPlayState: () => 'playing' | 'paused' | 'stopped';\n // 获取动画是否正在运行\n isRunning: () => boolean;\n}\n"]}
@@ -1,13 +0,0 @@
1
- export declare enum AnimateStepType {
2
- wait = "wait",
3
- from = "from",
4
- to = "to",
5
- customAnimate = "customAnimate"
6
- }
7
- export declare enum AnimateStatus {
8
- INITIAL = 0,
9
- RUNNING = 1,
10
- PAUSED = 2,
11
- END = 3
12
- }
13
- export type IAnimateStepType = keyof typeof AnimateStepType;