@visactor/vrender-core 0.22.12 → 0.22.14

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 (437) 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/canvas/util.js +1 -2
  59. package/cjs/color-string/interpolate.d.ts +0 -1
  60. package/cjs/color-string/interpolate.js +4 -12
  61. package/cjs/color-string/interpolate.js.map +1 -1
  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/flex-layout-plugin.js +10 -13
  159. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  160. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  161. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  162. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  163. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  164. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  165. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  166. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  167. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  168. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +5 -6
  169. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  170. package/cjs/render/contributions/render/arc-render.d.ts +2 -4
  171. package/cjs/render/contributions/render/arc-render.js +17 -19
  172. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  173. package/cjs/render/contributions/render/area-render.js +2 -2
  174. package/cjs/render/contributions/render/area-render.js.map +1 -1
  175. package/cjs/render/contributions/render/base-render.d.ts +2 -2
  176. package/cjs/render/contributions/render/base-render.js +2 -2
  177. package/cjs/render/contributions/render/base-render.js.map +1 -1
  178. package/cjs/render/contributions/render/draw-contribution.d.ts +0 -1
  179. package/cjs/render/contributions/render/draw-contribution.js +19 -23
  180. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  181. package/cjs/render/contributions/render/draw-interceptor.js +1 -2
  182. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  183. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  184. package/cjs/render/contributions/render/group-render.js +11 -15
  185. package/cjs/render/contributions/render/group-render.js.map +1 -1
  186. package/cjs/render/contributions/render/line-render.js +1 -1
  187. package/cjs/render/contributions/render/line-render.js.map +1 -1
  188. package/cjs/render/contributions/render/rect-render.d.ts +1 -3
  189. package/cjs/render/contributions/render/rect-render.js +15 -17
  190. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  191. package/cjs/render/contributions/render/symbol-render.d.ts +2 -4
  192. package/cjs/render/contributions/render/symbol-render.js +11 -16
  193. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  194. package/cjs/render/render-service.d.ts +1 -1
  195. package/cjs/render/render-service.js.map +1 -1
  196. package/dist/index.es.js +8867 -6020
  197. package/es/animate/Ticker/default-ticker.d.ts +40 -0
  198. package/es/animate/Ticker/default-ticker.js +138 -0
  199. package/es/animate/Ticker/default-ticker.js.map +1 -0
  200. package/es/animate/Ticker/index.d.ts +5 -0
  201. package/es/animate/Ticker/index.js +10 -0
  202. package/es/animate/Ticker/index.js.map +1 -0
  203. package/es/animate/Ticker/manual-ticker-handler.d.ts +15 -0
  204. package/es/animate/Ticker/manual-ticker-handler.js +28 -0
  205. package/es/animate/Ticker/manual-ticker-handler.js.map +1 -0
  206. package/es/animate/Ticker/manual-ticker.d.ts +19 -0
  207. package/es/animate/Ticker/manual-ticker.js +31 -0
  208. package/es/animate/Ticker/manual-ticker.js.map +1 -0
  209. package/es/animate/Ticker/raf-tick-handler.d.ts +9 -0
  210. package/es/animate/Ticker/raf-tick-handler.js +22 -0
  211. package/es/animate/Ticker/raf-tick-handler.js.map +1 -0
  212. package/es/animate/Ticker/timeout-tick-handler.d.ts +9 -0
  213. package/es/animate/Ticker/timeout-tick-handler.js +20 -0
  214. package/es/animate/Ticker/timeout-tick-handler.js.map +1 -0
  215. package/es/animate/Ticker/type.d.ts +6 -0
  216. package/es/{interface/animation/ticker.js → animate/Ticker/type.js} +1 -1
  217. package/es/animate/Ticker/type.js.map +1 -0
  218. package/es/animate/animate.d.ts +147 -0
  219. package/es/animate/animate.js +398 -0
  220. package/es/animate/animate.js.map +1 -0
  221. package/es/animate/config.d.ts +2 -1
  222. package/es/animate/config.js +5 -0
  223. package/es/animate/config.js.map +1 -1
  224. package/es/animate/custom-animate.d.ts +236 -0
  225. package/es/animate/custom-animate.js +703 -0
  226. package/es/animate/custom-animate.js.map +1 -0
  227. package/es/animate/default-ticker.d.ts +2 -0
  228. package/es/animate/default-ticker.js +12 -0
  229. package/es/animate/default-ticker.js.map +1 -0
  230. package/es/animate/easing-func.d.ts +1 -0
  231. package/es/animate/easing-func.js +10 -0
  232. package/es/animate/easing-func.js.map +1 -0
  233. package/es/animate/easing.d.ts +49 -0
  234. package/es/animate/easing.js +134 -0
  235. package/es/animate/easing.js.map +1 -0
  236. package/es/animate/group-fade.d.ts +16 -0
  237. package/es/animate/group-fade.js +56 -0
  238. package/es/animate/group-fade.js.map +1 -0
  239. package/es/animate/index.d.ts +8 -0
  240. package/es/animate/index.js +16 -0
  241. package/es/animate/index.js.map +1 -0
  242. package/es/animate/morphing.d.ts +52 -0
  243. package/es/animate/morphing.js +295 -0
  244. package/es/animate/morphing.js.map +1 -0
  245. package/es/animate/timeline.d.ts +17 -0
  246. package/es/animate/timeline.js +42 -0
  247. package/es/animate/timeline.js.map +1 -0
  248. package/es/application.d.ts +1 -2
  249. package/es/application.js.map +1 -1
  250. package/es/canvas/constants.js +2 -1
  251. package/es/canvas/empty-context.d.ts +0 -1
  252. package/es/canvas/empty-context.js +0 -4
  253. package/es/canvas/empty-context.js.map +1 -1
  254. package/es/canvas/util.js +1 -2
  255. package/es/color-string/interpolate.d.ts +0 -1
  256. package/es/color-string/interpolate.js +1 -8
  257. package/es/color-string/interpolate.js.map +1 -1
  258. package/es/common/custom-path2d.js +2 -2
  259. package/es/common/custom-path2d.js.map +1 -1
  260. package/es/common/enums.d.ts +16 -0
  261. package/es/common/enums.js +20 -0
  262. package/es/common/enums.js.map +1 -1
  263. package/es/common/morphing-utils.js +124 -29
  264. package/es/common/morphing-utils.js.map +1 -1
  265. package/es/common/polygon.js +3 -6
  266. package/es/common/polygon.js.map +1 -1
  267. package/es/common/segment/curve/cubic-bezier.d.ts +2 -1
  268. package/es/common/segment/curve/cubic-bezier.js +8 -1
  269. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  270. package/es/common/segment/curve/quadratic-bezier.d.ts +0 -1
  271. package/es/common/segment/curve/quadratic-bezier.js +2 -5
  272. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  273. package/es/common/segment/index.d.ts +0 -1
  274. package/es/common/segment/index.js +0 -2
  275. package/es/common/segment/index.js.map +1 -1
  276. package/es/common/shape/arc.d.ts +1 -1
  277. package/es/common/shape/arc.js +3 -7
  278. package/es/common/shape/arc.js.map +1 -1
  279. package/es/common/simplify.js +2 -1
  280. package/es/common/sort.js +1 -1
  281. package/es/common/split-path.js +2 -2
  282. package/es/common/split-path.js.map +1 -1
  283. package/es/common/store.js +1 -1
  284. package/es/common/text.js +1 -1
  285. package/es/common/utils.d.ts +2 -0
  286. package/es/common/utils.js +5 -1
  287. package/es/common/utils.js.map +1 -1
  288. package/es/core/application.js +1 -1
  289. package/es/core/camera.js +1 -1
  290. package/es/core/global.d.ts +0 -3
  291. package/es/core/global.js +2 -15
  292. package/es/core/global.js.map +1 -1
  293. package/es/core/stage.d.ts +3 -8
  294. package/es/core/stage.js +22 -35
  295. package/es/core/stage.js.map +1 -1
  296. package/es/graphic/arc.d.ts +2 -1
  297. package/es/graphic/arc.js +2 -3
  298. package/es/graphic/arc.js.map +1 -1
  299. package/es/graphic/area.d.ts +2 -1
  300. package/es/graphic/area.js +1 -4
  301. package/es/graphic/area.js.map +1 -1
  302. package/es/graphic/circle.d.ts +2 -1
  303. package/es/graphic/circle.js +2 -4
  304. package/es/graphic/circle.js.map +1 -1
  305. package/es/graphic/config.js +1 -2
  306. package/es/graphic/config.js.map +1 -1
  307. package/es/graphic/graphic-service/graphic-module.js +1 -1
  308. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  309. package/es/graphic/graphic-service/graphic-service.js +4 -1
  310. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  311. package/es/graphic/graphic.d.ts +12 -9
  312. package/es/graphic/graphic.js +109 -52
  313. package/es/graphic/graphic.js.map +1 -1
  314. package/es/graphic/group.js +7 -7
  315. package/es/graphic/group.js.map +1 -1
  316. package/es/graphic/line.d.ts +2 -1
  317. package/es/graphic/line.js +1 -5
  318. package/es/graphic/line.js.map +1 -1
  319. package/es/graphic/rect.js +2 -5
  320. package/es/graphic/rect.js.map +1 -1
  321. package/es/graphic/richtext/icon.d.ts +1 -1
  322. package/es/graphic/richtext/icon.js.map +1 -1
  323. package/es/graphic/richtext/paragraph.js +2 -2
  324. package/es/graphic/richtext/paragraph.js.map +1 -1
  325. package/es/graphic/star.d.ts +2 -1
  326. package/es/graphic/star.js +2 -4
  327. package/es/graphic/star.js.map +1 -1
  328. package/es/index.d.ts +3 -2
  329. package/es/index.js +6 -4
  330. package/es/index.js.map +1 -1
  331. package/es/interface/animate.d.ts +160 -1
  332. package/es/interface/animate.js +1 -2
  333. package/es/interface/animate.js.map +1 -1
  334. package/es/interface/context.d.ts +0 -1
  335. package/es/interface/context.js.map +1 -1
  336. package/es/interface/global.d.ts +0 -2
  337. package/es/interface/global.js.map +1 -1
  338. package/es/interface/graphic.d.ts +3 -11
  339. package/es/interface/graphic.js.map +1 -1
  340. package/es/interface/index.d.ts +1 -1
  341. package/es/interface/index.js +2 -2
  342. package/es/interface/index.js.map +1 -1
  343. package/es/interface/render.d.ts +0 -7
  344. package/es/interface/render.js.map +1 -1
  345. package/es/interface/stage.d.ts +1 -4
  346. package/es/interface/stage.js.map +1 -1
  347. package/es/modules.d.ts +1 -2
  348. package/es/modules.js +0 -6
  349. package/es/modules.js.map +1 -1
  350. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  351. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  352. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +12 -13
  353. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  354. package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -12
  355. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  356. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -0
  357. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  358. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +5 -8
  359. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  360. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +1 -0
  361. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +3 -0
  362. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +1 -0
  363. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  364. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +5 -4
  365. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  366. package/es/render/contributions/render/arc-render.d.ts +2 -4
  367. package/es/render/contributions/render/arc-render.js +17 -19
  368. package/es/render/contributions/render/arc-render.js.map +1 -1
  369. package/es/render/contributions/render/area-render.js +2 -2
  370. package/es/render/contributions/render/area-render.js.map +1 -1
  371. package/es/render/contributions/render/base-render.d.ts +2 -2
  372. package/es/render/contributions/render/base-render.js +2 -2
  373. package/es/render/contributions/render/base-render.js.map +1 -1
  374. package/es/render/contributions/render/draw-contribution.d.ts +0 -1
  375. package/es/render/contributions/render/draw-contribution.js +19 -23
  376. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  377. package/es/render/contributions/render/draw-interceptor.js +1 -2
  378. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  379. package/es/render/contributions/render/group-render.d.ts +2 -2
  380. package/es/render/contributions/render/group-render.js +11 -15
  381. package/es/render/contributions/render/group-render.js.map +1 -1
  382. package/es/render/contributions/render/line-render.js +1 -1
  383. package/es/render/contributions/render/line-render.js.map +1 -1
  384. package/es/render/contributions/render/rect-render.d.ts +1 -3
  385. package/es/render/contributions/render/rect-render.js +14 -17
  386. package/es/render/contributions/render/rect-render.js.map +1 -1
  387. package/es/render/contributions/render/symbol-render.d.ts +2 -4
  388. package/es/render/contributions/render/symbol-render.js +11 -16
  389. package/es/render/contributions/render/symbol-render.js.map +1 -1
  390. package/es/render/render-service.d.ts +1 -1
  391. package/es/render/render-service.js.map +1 -1
  392. package/package.json +2 -2
  393. package/cjs/common/diff.d.ts +0 -1
  394. package/cjs/common/diff.js +0 -19
  395. package/cjs/common/diff.js.map +0 -1
  396. package/cjs/common/performance-raf.d.ts +0 -8
  397. package/cjs/common/performance-raf.js +0 -32
  398. package/cjs/common/performance-raf.js.map +0 -1
  399. package/cjs/interface/animation/animate.d.ts +0 -117
  400. package/cjs/interface/animation/animate.js +0 -10
  401. package/cjs/interface/animation/animate.js.map +0 -1
  402. package/cjs/interface/animation/easing.d.ts +0 -3
  403. package/cjs/interface/animation/easing.js +0 -6
  404. package/cjs/interface/animation/easing.js.map +0 -1
  405. package/cjs/interface/animation/index.d.ts +0 -5
  406. package/cjs/interface/animation/index.js.map +0 -1
  407. package/cjs/interface/animation/ticker.d.ts +0 -39
  408. package/cjs/interface/animation/ticker.js.map +0 -1
  409. package/cjs/interface/animation/timeline.d.ts +0 -17
  410. package/cjs/interface/animation/timeline.js +0 -6
  411. package/cjs/interface/animation/timeline.js.map +0 -1
  412. package/cjs/interface/animation/type.d.ts +0 -13
  413. package/cjs/interface/animation/type.js +0 -15
  414. package/cjs/interface/animation/type.js.map +0 -1
  415. package/es/common/diff.d.ts +0 -1
  416. package/es/common/diff.js +0 -11
  417. package/es/common/diff.js.map +0 -1
  418. package/es/common/performance-raf.d.ts +0 -8
  419. package/es/common/performance-raf.js +0 -24
  420. package/es/common/performance-raf.js.map +0 -1
  421. package/es/interface/animation/animate.d.ts +0 -117
  422. package/es/interface/animation/animate.js +0 -6
  423. package/es/interface/animation/animate.js.map +0 -1
  424. package/es/interface/animation/easing.d.ts +0 -3
  425. package/es/interface/animation/easing.js +0 -2
  426. package/es/interface/animation/easing.js.map +0 -1
  427. package/es/interface/animation/index.d.ts +0 -5
  428. package/es/interface/animation/index.js +0 -10
  429. package/es/interface/animation/index.js.map +0 -1
  430. package/es/interface/animation/ticker.d.ts +0 -39
  431. package/es/interface/animation/ticker.js.map +0 -1
  432. package/es/interface/animation/timeline.d.ts +0 -17
  433. package/es/interface/animation/timeline.js +0 -2
  434. package/es/interface/animation/timeline.js.map +0 -1
  435. package/es/interface/animation/type.d.ts +0 -13
  436. package/es/interface/animation/type.js +0 -14
  437. package/es/interface/animation/type.js.map +0 -1
@@ -0,0 +1,295 @@
1
+ import { splitArc, splitCircle, splitLine, splitRect, splitPolygon, splitArea, splitPath } from "./../common/split-path";
2
+
3
+ import { CustomPath2D } from "../common/custom-path2d";
4
+
5
+ import { ACustomAnimate } from "./animate";
6
+
7
+ import { alignBezierCurves, applyTransformOnBezierCurves, findBestMorphingRotation, pathToBezierCurves } from "../common/morphing-utils";
8
+
9
+ import { application } from "../application";
10
+
11
+ import { isNil } from "@visactor/vutils";
12
+
13
+ import { interpolateColor } from "../color-string/interpolate";
14
+
15
+ import { ColorStore, ColorType } from "../color-string";
16
+
17
+ import { DefaultMorphingAnimateConfig } from "./config";
18
+
19
+ import { isTransformKey } from "../common/utils";
20
+
21
+ import { AttributeUpdateType } from "../common/enums";
22
+
23
+ const interpolateOtherAttrs = (attrs, out, ratio) => {
24
+ attrs.forEach((entry => {
25
+ if (Number.isFinite(entry.to)) out[entry.key] = entry.from + (entry.to - entry.from) * ratio; else if ("fill" === entry.key || "stroke" === entry.key) {
26
+ const color = interpolateColor(entry.from, entry.to, ratio, !1);
27
+ color && (out[entry.key] = color);
28
+ }
29
+ }));
30
+ }, interpolateMorphingData = (morphingData, path, ratio) => {
31
+ const tmpArr = [], newCp = [];
32
+ path.clear();
33
+ for (let i = 0; i < morphingData.length; i++) {
34
+ const item = morphingData[i], from = item.from, to = item.to, angle = item.rotation * ratio, fromCp = item.fromCp, toCp = item.toCp, sa = Math.sin(angle), ca = Math.cos(angle);
35
+ newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio, newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;
36
+ for (let m = 0; m < from.length; m += 2) {
37
+ const x0 = from[m], y0 = from[m + 1], x = x0 * (1 - ratio) + to[m] * ratio, y = y0 * (1 - ratio) + to[m + 1] * ratio;
38
+ tmpArr[m] = x * ca - y * sa + newCp[0], tmpArr[m + 1] = x * sa + y * ca + newCp[1];
39
+ }
40
+ let x0 = tmpArr[0], y0 = tmpArr[1];
41
+ path.moveTo(x0, y0);
42
+ for (let m = 2; m < from.length; m += 6) {
43
+ const x1 = tmpArr[m], y1 = tmpArr[m + 1], x2 = tmpArr[m + 2], y2 = tmpArr[m + 3], x3 = tmpArr[m + 4], y3 = tmpArr[m + 5];
44
+ x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3 ? path.lineTo(x3, y3) : path.bezierCurveTo(x1, y1, x2, y2, x3, y3),
45
+ x0 = x3, y0 = y3;
46
+ }
47
+ }
48
+ }, parseMorphingData = (fromPath, toPath, config) => {
49
+ const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [], toBezier = pathToBezierCurves(toPath);
50
+ config && fromBezier && (config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse()),
51
+ applyTransformOnBezierCurves(fromBezier, config.toTransfrom));
52
+ const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);
53
+ return fromPath ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI) : toBezierCurves.map(((to, index) => ({
54
+ from: fromBezierCurves[index],
55
+ to: to,
56
+ fromCp: [ 0, 0 ],
57
+ toCp: [ 0, 0 ],
58
+ rotation: 0
59
+ })));
60
+ }, validateOtherAttrs = [ "fill", "fillOpacity", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "stroke", "strokeOpacity", "lineDashOffset" ], parseOtherAnimateAttrs = (fromAttrs, toAttrs) => {
61
+ if (!fromAttrs || !toAttrs) return null;
62
+ const res = [];
63
+ let hasAttr = !1;
64
+ return Object.keys(fromAttrs).forEach((fromKey => {
65
+ if (!validateOtherAttrs.includes(fromKey)) return;
66
+ const toValue = toAttrs[fromKey];
67
+ isNil(toValue) || isNil(fromAttrs[fromKey]) || toValue === fromAttrs[fromKey] || ("fill" === fromKey || "stroke" === fromKey ? res.push({
68
+ from: "string" == typeof fromAttrs[fromKey] ? ColorStore.Get(fromAttrs[fromKey], ColorType.Color255) : fromAttrs[fromKey],
69
+ to: "string" == typeof toValue ? ColorStore.Get(toValue, ColorType.Color255) : toValue,
70
+ key: fromKey
71
+ }) : res.push({
72
+ from: fromAttrs[fromKey],
73
+ to: toValue,
74
+ key: fromKey
75
+ }), hasAttr = !0);
76
+ })), hasAttr ? res : null;
77
+ };
78
+
79
+ export class MorphingPath extends ACustomAnimate {
80
+ constructor(config, duration, easing) {
81
+ super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs,
82
+ this.saveOnEnd = config.saveOnEnd;
83
+ }
84
+ getEndProps() {
85
+ return {};
86
+ }
87
+ onBind() {
88
+ this.target.createPathProxy(), this.onUpdate(!1, 0, this.target.attribute);
89
+ }
90
+ onEnd() {}
91
+ onUpdate(end, ratio, out) {
92
+ const target = this.target, pathProxy = "function" == typeof target.pathProxy ? target.pathProxy(target.attribute) : target.pathProxy;
93
+ interpolateMorphingData(this.morphingData, pathProxy, ratio), this.otherAttrs && this.otherAttrs.length && interpolateOtherAttrs(this.otherAttrs, out, ratio),
94
+ end && !this.saveOnEnd && (this.target.pathProxy = null);
95
+ }
96
+ }
97
+
98
+ export const morphPath = (fromGraphic, toGraphic, animationConfig, fromGraphicTransform) => {
99
+ var _a, _b, _c;
100
+ if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) return __DEV__ && console.error(fromGraphic, " is not validate"),
101
+ null;
102
+ if (!toGraphic.valid || !toGraphic.toCustomPath) return __DEV__ && console.error(toGraphic, " is not validate"),
103
+ null;
104
+ let fromTransform = null == fromGraphic ? void 0 : fromGraphic.globalTransMatrix;
105
+ fromGraphicTransform && fromTransform && (fromTransform = fromGraphicTransform.clone().multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f));
106
+ const morphingData = parseMorphingData(null === (_a = null == fromGraphic ? void 0 : fromGraphic.toCustomPath) || void 0 === _a ? void 0 : _a.call(fromGraphic), toGraphic.toCustomPath(), {
107
+ fromTransform: fromTransform,
108
+ toTransfrom: toGraphic.globalTransMatrix
109
+ }), attrs = parseOtherAnimateAttrs(null == fromGraphic ? void 0 : fromGraphic.attribute, toGraphic.attribute), animate = toGraphic.animate(animationConfig);
110
+ return (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
111
+ animate.play(new MorphingPath({
112
+ morphingData: morphingData,
113
+ otherAttrs: attrs
114
+ }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing)),
115
+ animate;
116
+ };
117
+
118
+ export const oneToMultiMorph = (fromGraphic, toGraphics, animationConfig) => {
119
+ var _a;
120
+ const validateToGraphics = toGraphics.filter((graphic => graphic && graphic.toCustomPath && graphic.valid));
121
+ validateToGraphics.length || __DEV__ && console.error(validateToGraphics, " is not validate"),
122
+ fromGraphic.valid && fromGraphic.toCustomPath || __DEV__ && console.error(fromGraphic, " is not validate");
123
+ const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : splitGraphic)(fromGraphic, validateToGraphics.length, !1), oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd;
124
+ let count = validateToGraphics.length;
125
+ const onEachEnd = () => {
126
+ count--, 0 === count && oldOnEnd && oldOnEnd();
127
+ };
128
+ validateToGraphics.forEach(((toChild, index) => {
129
+ var _a;
130
+ const fromChild = childGraphics[index], delay = (null !== (_a = null == animationConfig ? void 0 : animationConfig.delay) && void 0 !== _a ? _a : 0) + ((null == animationConfig ? void 0 : animationConfig.individualDelay) ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild) : 0);
131
+ morphPath(fromChild, toChild, Object.assign({}, animationConfig, {
132
+ onEnd: onEachEnd,
133
+ delay: delay
134
+ }), fromGraphic.globalTransMatrix);
135
+ }));
136
+ };
137
+
138
+ export class MultiToOneMorphingPath extends ACustomAnimate {
139
+ constructor(config, duration, easing) {
140
+ super(0, 1, duration, easing), this.morphingData = config.morphingData, this.otherAttrs = config.otherAttrs;
141
+ }
142
+ getEndProps() {
143
+ return {};
144
+ }
145
+ onBind() {
146
+ this.addPathProxy();
147
+ }
148
+ addPathProxy() {
149
+ this.target.shadowRoot.forEachChildren((child => {
150
+ child.createPathProxy();
151
+ })), this.onUpdate(!1, 0, this.target.attribute);
152
+ }
153
+ clearPathProxy() {
154
+ this.target.shadowRoot.forEachChildren((child => {
155
+ child.pathProxy = null;
156
+ }));
157
+ }
158
+ onEnd() {}
159
+ onUpdate(end, ratio, out) {
160
+ this.target.shadowRoot.forEachChildren(((child, index) => {
161
+ var _a;
162
+ interpolateMorphingData(this.morphingData[index], "function" == typeof child.pathProxy ? child.pathProxy(child.attribute) : child.pathProxy, ratio),
163
+ (null === (_a = this.otherAttrs) || void 0 === _a ? void 0 : _a[index]) && this.otherAttrs[index].length && interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);
164
+ })), end && (this.clearPathProxy(), this.morphingData = null);
165
+ }
166
+ }
167
+
168
+ const parseShadowChildAttrs = graphicAttrs => {
169
+ const attrs = {};
170
+ return Object.keys(graphicAttrs).forEach((key => {
171
+ isTransformKey(key) || (attrs[key] = graphicAttrs[key]);
172
+ })), attrs;
173
+ }, appendShadowChildrenToGraphic = (graphic, children, count) => {
174
+ const childAttrs = parseShadowChildAttrs(graphic.attribute), shadowRoot = graphic.attachShadow();
175
+ if (children.length) shadowRoot.setTheme({
176
+ [children[0].type]: childAttrs
177
+ }), children.forEach((element => {
178
+ element.setAttributes({
179
+ pickable: !1
180
+ }), shadowRoot.appendChild(element);
181
+ })); else {
182
+ const box = graphic.AABBBounds, width = box.width(), height = box.height();
183
+ shadowRoot.setTheme({
184
+ rect: childAttrs
185
+ }), new Array(count).fill(0).forEach((el => {
186
+ const child = application.graphicService.creator.rect({
187
+ x: 0,
188
+ y: 0,
189
+ width: width,
190
+ height: height,
191
+ pickable: !1
192
+ });
193
+ shadowRoot.appendChild(child), children.push(child);
194
+ }));
195
+ }
196
+ };
197
+
198
+ export const cloneGraphic = (graphic, count, needAppend) => {
199
+ const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute), path = graphic.toCustomPath();
200
+ for (let i = 0; i < count; i++) {
201
+ const element = {
202
+ path: (new CustomPath2D).fromCustomPath2D(path)
203
+ };
204
+ children.push(application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element)));
205
+ }
206
+ return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
207
+ };
208
+
209
+ export const splitGraphic = (graphic, count, needAppend) => {
210
+ const children = [], childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);
211
+ if ("rect" === graphic.type) {
212
+ splitRect(graphic, count).forEach((element => {
213
+ children.push(application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element)));
214
+ }));
215
+ } else if ("arc" === graphic.type) {
216
+ splitArc(graphic, count).forEach((element => {
217
+ children.push(application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
218
+ }));
219
+ } else if ("circle" === graphic.type) {
220
+ splitCircle(graphic, count).forEach((element => {
221
+ children.push(application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element)));
222
+ }));
223
+ } else if ("line" === graphic.type) {
224
+ const childrenAttrs = splitLine(graphic, count), defaultSymbol = {
225
+ size: 10,
226
+ symbolType: "circle"
227
+ };
228
+ childrenAttrs.forEach((element => {
229
+ children.push(application.graphicService.creator.symbol(needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)));
230
+ }));
231
+ } else if ("polygon" === graphic.type) {
232
+ splitPolygon(graphic, count).forEach((element => {
233
+ children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
234
+ }));
235
+ } else if ("area" === graphic.type) {
236
+ splitArea(graphic, count).forEach((element => {
237
+ children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
238
+ }));
239
+ } else if ("path" === graphic.type) {
240
+ splitPath(graphic, count).forEach((element => {
241
+ "path" in element ? children.push(application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))) : children.push(application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element)));
242
+ }));
243
+ }
244
+ return needAppend && appendShadowChildrenToGraphic(graphic, children, count), children;
245
+ };
246
+
247
+ export const multiToOneMorph = (fromGraphics, toGraphic, animationConfig) => {
248
+ var _a, _b, _c;
249
+ const validateFromGraphics = fromGraphics.filter((graphic => graphic.toCustomPath && graphic.valid));
250
+ validateFromGraphics.length || __DEV__ && console.error(fromGraphics, " is not validate"),
251
+ toGraphic.valid && toGraphic.toCustomPath || __DEV__ && console.error(toGraphic, " is not validate");
252
+ const childGraphics = ("clone" === (null == animationConfig ? void 0 : animationConfig.splitPath) ? cloneGraphic : null !== (_a = null == animationConfig ? void 0 : animationConfig.splitPath) && void 0 !== _a ? _a : splitGraphic)(toGraphic, validateFromGraphics.length, !0), toAttrs = toGraphic.attribute;
253
+ toGraphic.setAttribute("visible", !1);
254
+ const morphingData = validateFromGraphics.map(((graphic, index) => parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {
255
+ fromTransform: graphic.globalTransMatrix,
256
+ toTransfrom: childGraphics[index].globalTransMatrix
257
+ }))), otherAttrs = validateFromGraphics.map(((graphic, index) => parseOtherAnimateAttrs(graphic.attribute, toAttrs)));
258
+ if (null == animationConfig ? void 0 : animationConfig.individualDelay) {
259
+ const oldOnEnd = animationConfig.onEnd;
260
+ let count = validateFromGraphics.length;
261
+ const onEachEnd = () => {
262
+ count--, 0 === count && (toGraphic.setAttributes({
263
+ visible: !0,
264
+ ratio: null
265
+ }, !1, {
266
+ type: AttributeUpdateType.ANIMATE_END
267
+ }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd());
268
+ };
269
+ childGraphics.forEach(((to, index) => {
270
+ var _a, _b, _c;
271
+ const delay = (null !== (_a = animationConfig.delay) && void 0 !== _a ? _a : 0) + animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to), animate = to.animate(Object.assign({}, animationConfig, {
272
+ onEnd: onEachEnd
273
+ }));
274
+ animate.wait(delay), animate.play(new MorphingPath({
275
+ morphingData: morphingData[index],
276
+ saveOnEnd: !0,
277
+ otherAttrs: otherAttrs[index]
278
+ }, null !== (_b = animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing));
279
+ }));
280
+ } else {
281
+ const oldOnEnd = null == animationConfig ? void 0 : animationConfig.onEnd, config = animationConfig ? Object.assign({}, animationConfig) : {};
282
+ config.onEnd = () => {
283
+ toGraphic.setAttribute("visible", !0, !1, {
284
+ type: AttributeUpdateType.ANIMATE_END
285
+ }), toGraphic.detachShadow(), oldOnEnd && oldOnEnd();
286
+ };
287
+ const animate = toGraphic.animate(config);
288
+ (null == animationConfig ? void 0 : animationConfig.delay) && animate.wait(animationConfig.delay),
289
+ animate.play(new MultiToOneMorphingPath({
290
+ morphingData: morphingData,
291
+ otherAttrs: otherAttrs
292
+ }, null !== (_b = null == animationConfig ? void 0 : animationConfig.duration) && void 0 !== _b ? _b : DefaultMorphingAnimateConfig.duration, null !== (_c = null == animationConfig ? void 0 : animationConfig.easing) && void 0 !== _c ? _c : DefaultMorphingAnimateConfig.easing));
293
+ }
294
+ };
295
+ //# sourceMappingURL=morphing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animate/morphing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,wBAAwB,CAAC;AAgBhC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAkBtD,MAAM,qBAAqB,GAAG,CAAC,KAAsB,EAAE,GAAQ,EAAE,KAAa,EAAE,EAAE;IAChF,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,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,CAAE,KAAK,CAAC;QACxC,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzE,MAAM,CAAC,KAAK,GAAG,GAAG,EAAE;YAClB,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC;YAC1F,SAAS,CAAC,YAAY,EAAE,CAAC;YAEzB,IAAI,QAAQ,EAAE;gBACZ,QAAQ,EAAE,CAAC;aACZ;QACH,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE1C,IAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,EAAE;YAC1B,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;SACrC;QAED,OAAO,CAAC,IAAI,CACV,IAAI,sBAAsB,CACxB,EAAE,YAAY,EAAE,UAAU,EAAE,EAC5B,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,mCAAI,4BAA4B,CAAC,QAAQ,EAClE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,mCAAI,4BAA4B,CAAC,MAAM,CAC/D,CACF,CAAC;KACH;AACH,CAAC,CAAC","file":"morphing.js","sourcesContent":["import {\n splitArc,\n splitCircle,\n splitLine,\n splitRect,\n splitPolygon,\n splitArea,\n splitPath\n} from './../common/split-path';\nimport type {\n ICustomPath2D,\n IGraphic,\n MorphingAnimateConfig,\n IRect,\n EasingType,\n MultiMorphingAnimateConfig,\n IArc,\n ICircle,\n IGraphicAttribute,\n ILine,\n IPolygon,\n IArea,\n IPath\n} from './../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ACustomAnimate } from './animate';\nimport {\n alignBezierCurves,\n applyTransformOnBezierCurves,\n findBestMorphingRotation,\n pathToBezierCurves\n} from '../common/morphing-utils';\nimport { application } from '../application';\nimport type { IMatrix } from '@visactor/vutils';\nimport { isNil } from '@visactor/vutils';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { ColorStore, ColorType } from '../color-string';\nimport { DefaultMorphingAnimateConfig } from './config';\nimport { isTransformKey } from '../common/utils';\nimport { AttributeUpdateType } from '../common/enums';\n\ndeclare const __DEV__: boolean;\n\ninterface MorphingDataItem {\n from: number[];\n to: number[];\n fromCp: number[];\n toCp: number[];\n rotation: number;\n}\n\ninterface OtherAttrItem {\n from: any;\n to: any;\n key: string;\n}\n\nconst interpolateOtherAttrs = (attrs: OtherAttrItem[], out: any, ratio: number) => {\n attrs.forEach(entry => {\n if (Number.isFinite(entry.to)) {\n out[entry.key] = entry.from + (entry.to - entry.from) * ratio;\n } else if (entry.key === 'fill' || entry.key === 'stroke') {\n // 保存解析的结果到step\n const color = interpolateColor(entry.from, entry.to, ratio, false);\n if (color) {\n out[entry.key] = color;\n }\n }\n });\n};\n\n/* Adapted from zrender by ecomfe\n * https://github.com/ecomfe/zrender\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/ecomfe/zrender/blob/master/src/tool/morphPath.ts\n * License: https://github.com/ecomfe/zrender/blob/master/LICENSE\n * @license\n */\nconst interpolateMorphingData = (morphingData: MorphingDataItem[], path: ICustomPath2D, ratio: number) => {\n const tmpArr: number[] = [];\n const newCp: number[] = [];\n path.clear();\n\n for (let i = 0; i < morphingData.length; i++) {\n const item = morphingData[i];\n const from = item.from;\n const to = item.to;\n const angle = item.rotation * ratio;\n const fromCp = item.fromCp;\n const toCp = item.toCp;\n const sa = Math.sin(angle);\n const ca = Math.cos(angle);\n\n newCp[0] = fromCp[0] + (toCp[0] - fromCp[0]) * ratio;\n newCp[1] = fromCp[1] + (toCp[1] - fromCp[1]) * ratio;\n\n for (let m = 0; m < from.length; m += 2) {\n const x0 = from[m];\n const y0 = from[m + 1];\n const x1 = to[m];\n const y1 = to[m + 1];\n\n const x = x0 * (1 - ratio) + x1 * ratio;\n const y = y0 * (1 - ratio) + y1 * ratio;\n\n tmpArr[m] = x * ca - y * sa + newCp[0];\n tmpArr[m + 1] = x * sa + y * ca + newCp[1];\n }\n\n let x0 = tmpArr[0];\n let y0 = tmpArr[1];\n\n path.moveTo(x0, y0);\n\n for (let m = 2; m < from.length; m += 6) {\n const x1 = tmpArr[m];\n const y1 = tmpArr[m + 1];\n const x2 = tmpArr[m + 2];\n const y2 = tmpArr[m + 3];\n const x3 = tmpArr[m + 4];\n const y3 = tmpArr[m + 5];\n\n // Is a line.\n if (x0 === x1 && y0 === y1 && x2 === x3 && y2 === y3) {\n path.lineTo(x3, y3);\n } else {\n path.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n x0 = x3;\n y0 = y3;\n }\n }\n};\n\nconst parseMorphingData = (\n fromPath: ICustomPath2D | null,\n toPath: ICustomPath2D,\n config?: {\n fromTransform?: IMatrix;\n toTransfrom: IMatrix;\n }\n) => {\n const fromBezier = fromPath ? pathToBezierCurves(fromPath) : [];\n const toBezier = pathToBezierCurves(toPath);\n\n if (config && fromBezier) {\n config.fromTransform && applyTransformOnBezierCurves(fromBezier, config.fromTransform.clone().getInverse());\n applyTransformOnBezierCurves(fromBezier, config.toTransfrom);\n // applyTransformOnBezierCurves(toBezier, config.toTransfrom.clone().getInverse());\n }\n\n const [fromBezierCurves, toBezierCurves] = alignBezierCurves(fromBezier, toBezier);\n\n return fromPath\n ? findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI)\n : toBezierCurves.map((to, index) => {\n return {\n from: fromBezierCurves[index],\n to,\n fromCp: [0, 0],\n toCp: [0, 0],\n rotation: 0\n };\n });\n};\n\nconst validateOtherAttrs = [\n 'fill',\n 'fillOpacity',\n 'shadowBlur',\n 'shadowColor',\n 'shadowOffsetX',\n 'shadowOffsetY',\n 'stroke',\n 'strokeOpacity',\n 'lineDashOffset'\n // 'lineWidth'\n];\n\nconst parseOtherAnimateAttrs = (\n fromAttrs: Partial<IGraphicAttribute> | null,\n toAttrs: Partial<IGraphicAttribute> | null\n) => {\n if (!fromAttrs || !toAttrs) {\n return null;\n }\n const res: OtherAttrItem[] = [];\n let hasAttr = false;\n\n Object.keys(fromAttrs).forEach(fromKey => {\n if (!validateOtherAttrs.includes(fromKey)) {\n return;\n }\n\n const toValue = toAttrs[fromKey];\n if (!isNil(toValue) && !isNil(fromAttrs[fromKey]) && toValue !== fromAttrs[fromKey]) {\n if (fromKey === 'fill' || fromKey === 'stroke') {\n res.push({\n from:\n typeof fromAttrs[fromKey] === 'string'\n ? ColorStore.Get(fromAttrs[fromKey] as unknown as string, ColorType.Color255)\n : fromAttrs[fromKey],\n to: typeof toValue === 'string' ? ColorStore.Get(toValue as string, ColorType.Color255) : toValue,\n key: fromKey\n });\n } else {\n res.push({ from: fromAttrs[fromKey], to: toValue, key: fromKey });\n }\n\n hasAttr = true;\n }\n });\n\n return hasAttr ? res : null;\n};\n\nexport class MorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n saveOnEnd?: boolean;\n otherAttrs?: OtherAttrItem[];\n\n constructor(\n config: { morphingData: MorphingDataItem[]; otherAttrs?: OtherAttrItem[]; saveOnEnd?: boolean },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n this.saveOnEnd = config.saveOnEnd;\n }\n\n private morphingData?: MorphingDataItem[];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n (this.target as IGraphic).createPathProxy();\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const target = this.target as IGraphic;\n const pathProxy = typeof target.pathProxy === 'function' ? target.pathProxy(target.attribute) : target.pathProxy;\n interpolateMorphingData(this.morphingData, pathProxy, ratio);\n if (this.otherAttrs && this.otherAttrs.length) {\n interpolateOtherAttrs(this.otherAttrs, out, ratio);\n }\n // 计算位置\n if (end && !this.saveOnEnd) {\n (this.target as IGraphic).pathProxy = null;\n }\n }\n}\n\nexport const morphPath = (\n fromGraphic: IGraphic | null,\n toGraphic: IGraphic,\n animationConfig?: MorphingAnimateConfig,\n fromGraphicTransform?: IMatrix\n) => {\n if (fromGraphic && (!fromGraphic.valid || !fromGraphic.toCustomPath)) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n return null;\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n return null;\n }\n\n let fromTransform = fromGraphic?.globalTransMatrix;\n\n if (fromGraphicTransform && fromTransform) {\n fromTransform = fromGraphicTransform\n .clone()\n .multiply(fromTransform.a, fromTransform.b, fromTransform.c, fromTransform.d, fromTransform.e, fromTransform.f);\n }\n const morphingData = parseMorphingData(fromGraphic?.toCustomPath?.(), toGraphic.toCustomPath(), {\n fromTransform,\n toTransfrom: toGraphic.globalTransMatrix\n });\n\n const attrs = parseOtherAnimateAttrs(fromGraphic?.attribute, toGraphic.attribute);\n const animate = toGraphic.animate(animationConfig);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MorphingPath(\n { morphingData, otherAttrs: attrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n\n return animate;\n};\n\nexport const oneToMultiMorph = (\n fromGraphic: IGraphic,\n toGraphics: IGraphic[],\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateToGraphics = toGraphics.filter(graphic => graphic && graphic.toCustomPath && graphic.valid);\n if (!validateToGraphics.length) {\n if (__DEV__) {\n console.error(validateToGraphics, ' is not validate');\n }\n }\n\n if (!fromGraphic.valid || !fromGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(fromGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(fromGraphic, validateToGraphics.length, false);\n\n const oldOnEnd = animationConfig?.onEnd;\n let count = validateToGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0 && oldOnEnd) {\n oldOnEnd();\n }\n };\n\n validateToGraphics.forEach((toChild, index) => {\n const fromChild = childGraphics[index];\n const delay =\n (animationConfig?.delay ?? 0) +\n (animationConfig?.individualDelay\n ? animationConfig.individualDelay(index, validateToGraphics.length, fromChild, toChild)\n : 0);\n morphPath(\n fromChild,\n toChild,\n Object.assign({}, animationConfig, { onEnd: onEachEnd, delay }),\n fromGraphic.globalTransMatrix\n );\n });\n};\n\nexport class MultiToOneMorphingPath extends ACustomAnimate<number> {\n declare path: CustomPath2D;\n\n otherAttrs?: OtherAttrItem[][];\n\n constructor(\n config: { morphingData: MorphingDataItem[][]; otherAttrs?: OtherAttrItem[][] },\n duration: number,\n easing: EasingType\n ) {\n super(0, 1, duration, easing);\n this.morphingData = config.morphingData;\n this.otherAttrs = config.otherAttrs;\n }\n\n private morphingData?: MorphingDataItem[][];\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.addPathProxy();\n }\n\n private addPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).createPathProxy();\n });\n\n this.onUpdate(false, 0, (this.target as IGraphic).attribute);\n }\n\n private clearPathProxy() {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren(child => {\n (child as IGraphic).pathProxy = null;\n });\n }\n\n onEnd(): void {\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n const shadowRoot = (this.target as IGraphic).shadowRoot;\n\n shadowRoot.forEachChildren((child: IGraphic, index) => {\n interpolateMorphingData(\n this.morphingData[index],\n typeof child.pathProxy === 'function' ? child.pathProxy(child.attribute) : child.pathProxy,\n ratio\n );\n\n if (this.otherAttrs?.[index] && this.otherAttrs[index].length) {\n interpolateOtherAttrs(this.otherAttrs[index], child.attribute, ratio);\n }\n });\n\n // 计算位置\n if (end) {\n this.clearPathProxy();\n this.morphingData = null;\n }\n }\n}\n\nconst parseShadowChildAttrs = (graphicAttrs: Partial<IGraphicAttribute>) => {\n const attrs: Partial<IGraphicAttribute> = {};\n\n Object.keys(graphicAttrs).forEach(key => {\n if (!isTransformKey(key)) {\n attrs[key] = graphicAttrs[key];\n }\n });\n\n // if (attrs.fill == null) {\n // attrs.fill = !!attrs.fillColor;\n // }\n // if (attrs.stroke == null) {\n // attrs.stroke = !!attrs.strokeColor;\n // }\n\n return attrs;\n};\n\nconst appendShadowChildrenToGraphic = (graphic: IGraphic, children: IGraphic[], count: number) => {\n const childAttrs = parseShadowChildAttrs(graphic.attribute);\n const shadowRoot = graphic.attachShadow();\n\n if (children.length) {\n shadowRoot.setTheme({\n [children[0].type]: childAttrs\n });\n children.forEach(element => {\n element.setAttributes({ pickable: false });\n shadowRoot.appendChild(element);\n });\n } else {\n const box = graphic.AABBBounds;\n const width = box.width();\n const height = box.height();\n\n shadowRoot.setTheme({\n rect: childAttrs\n });\n new Array(count).fill(0).forEach(el => {\n const child = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width,\n height: height,\n pickable: false\n });\n shadowRoot.appendChild(child);\n children.push(child);\n });\n }\n};\n\nexport const cloneGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n const path = graphic.toCustomPath();\n\n for (let i = 0; i < count; i++) {\n const element = {\n path: new CustomPath2D().fromCustomPath2D(path)\n };\n\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\nexport const splitGraphic = (graphic: IGraphic, count: number, needAppend?: boolean) => {\n const children: IGraphic[] = [];\n const childAttrs = needAppend ? null : parseShadowChildAttrs(graphic.attribute);\n\n if (graphic.type === 'rect') {\n const childrenAttrs = splitRect(graphic as IRect, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.rect(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'arc') {\n const childrenAttrs = splitArc(graphic as IArc, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'circle') {\n const childrenAttrs = splitCircle(graphic as ICircle, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.arc(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'line') {\n const childrenAttrs = splitLine(graphic as ILine, count);\n const defaultSymbol = { size: 10, symbolType: 'circle' };\n\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.symbol(\n needAppend ? Object.assign({}, element, defaultSymbol) : Object.assign({}, childAttrs, element, defaultSymbol)\n )\n );\n });\n } else if (graphic.type === 'polygon') {\n const childrenAttrs = splitPolygon(graphic as IPolygon, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'area') {\n const childrenAttrs = splitArea(graphic as IArea, count);\n childrenAttrs.forEach(element => {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n });\n } else if (graphic.type === 'path') {\n const childrenAttrs = splitPath(graphic as IPath, count);\n childrenAttrs.forEach(element => {\n if ('path' in element) {\n children.push(\n application.graphicService.creator.path(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n } else {\n children.push(\n application.graphicService.creator.polygon(needAppend ? element : Object.assign({}, childAttrs, element))\n );\n }\n });\n }\n\n if (needAppend) {\n appendShadowChildrenToGraphic(graphic, children, count);\n }\n\n return children;\n};\n\n/**\n * 多对一动画\n * @param fromGraphics\n * @param toGraphic\n * @param animationConfig\n */\nexport const multiToOneMorph = (\n fromGraphics: IGraphic[],\n toGraphic: IGraphic,\n animationConfig?: MultiMorphingAnimateConfig\n) => {\n const validateFromGraphics = fromGraphics.filter(graphic => graphic.toCustomPath && graphic.valid);\n if (!validateFromGraphics.length) {\n if (__DEV__) {\n console.error(fromGraphics, ' is not validate');\n }\n }\n\n if (!toGraphic.valid || !toGraphic.toCustomPath) {\n if (__DEV__) {\n console.error(toGraphic, ' is not validate');\n }\n }\n\n const childGraphics: IGraphic[] = (\n animationConfig?.splitPath === 'clone' ? cloneGraphic : animationConfig?.splitPath ?? splitGraphic\n )(toGraphic, validateFromGraphics.length, true);\n\n const toAttrs = toGraphic.attribute;\n toGraphic.setAttribute('visible', false);\n\n const morphingData = validateFromGraphics.map((graphic, index) => {\n return parseMorphingData(graphic.toCustomPath(), childGraphics[index].toCustomPath(), {\n fromTransform: graphic.globalTransMatrix,\n toTransfrom: childGraphics[index].globalTransMatrix\n });\n });\n const otherAttrs = validateFromGraphics.map((graphic, index) => {\n return parseOtherAnimateAttrs(graphic.attribute, toAttrs);\n });\n\n if (animationConfig?.individualDelay) {\n const oldOnEnd = animationConfig.onEnd;\n let count = validateFromGraphics.length;\n const onEachEnd = () => {\n count--;\n if (count === 0) {\n toGraphic.setAttributes({ visible: true, ratio: null } as any, false, {\n type: AttributeUpdateType.ANIMATE_END\n });\n toGraphic.detachShadow();\n if (oldOnEnd) {\n oldOnEnd();\n }\n }\n };\n childGraphics.forEach((to, index) => {\n const delay =\n (animationConfig.delay ?? 0) +\n animationConfig.individualDelay(index, validateFromGraphics.length, fromGraphics[index], to);\n const animate = to.animate(Object.assign({}, animationConfig, { onEnd: onEachEnd }));\n animate.wait(delay);\n\n animate.play(\n new MorphingPath(\n {\n morphingData: morphingData[index],\n saveOnEnd: true,\n otherAttrs: otherAttrs[index]\n },\n animationConfig.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n });\n } else {\n const oldOnEnd = animationConfig?.onEnd;\n const config = animationConfig ? Object.assign({}, animationConfig) : {};\n\n config.onEnd = () => {\n toGraphic.setAttribute('visible', true, false, { type: AttributeUpdateType.ANIMATE_END });\n toGraphic.detachShadow();\n\n if (oldOnEnd) {\n oldOnEnd();\n }\n };\n\n const animate = toGraphic.animate(config);\n\n if (animationConfig?.delay) {\n animate.wait(animationConfig.delay);\n }\n\n animate.play(\n new MultiToOneMorphingPath(\n { morphingData, otherAttrs },\n animationConfig?.duration ?? DefaultMorphingAnimateConfig.duration,\n animationConfig?.easing ?? DefaultMorphingAnimateConfig.easing\n )\n );\n }\n};\n"]}
@@ -0,0 +1,17 @@
1
+ import type { IAnimate, ITimeline } from '../interface';
2
+ export declare class DefaultTimeline implements ITimeline {
3
+ id: number;
4
+ protected animateHead: IAnimate | null;
5
+ protected animateTail: IAnimate | null;
6
+ protected ticker: any;
7
+ animateCount: number;
8
+ protected paused: boolean;
9
+ constructor();
10
+ addAnimate(animate: IAnimate): void;
11
+ pause(): void;
12
+ resume(): void;
13
+ tick(delta: number): void;
14
+ clear(): void;
15
+ removeAnimate(animate: IAnimate, release?: boolean): void;
16
+ }
17
+ export declare const defaultTimeline: DefaultTimeline;
@@ -0,0 +1,42 @@
1
+ import { AnimateStatus } from "../common/enums";
2
+
3
+ import { Generator } from "../common/generator";
4
+
5
+ export class DefaultTimeline {
6
+ constructor() {
7
+ this.id = Generator.GenAutoIncrementId(), this.animateHead = null, this.animateTail = null,
8
+ this.animateCount = 0, this.paused = !1;
9
+ }
10
+ addAnimate(animate) {
11
+ this.animateTail ? (this.animateTail.nextAnimate = animate, animate.prevAnimate = this.animateTail,
12
+ this.animateTail = animate, animate.nextAnimate = null) : (this.animateHead = animate,
13
+ this.animateTail = animate), this.animateCount++;
14
+ }
15
+ pause() {
16
+ this.paused = !0;
17
+ }
18
+ resume() {
19
+ this.paused = !1;
20
+ }
21
+ tick(delta) {
22
+ if (this.paused) return;
23
+ let animate = this.animateHead;
24
+ for (this.animateCount = 0; animate; ) animate.status === AnimateStatus.END ? this.removeAnimate(animate) : animate.status === AnimateStatus.RUNNING || animate.status === AnimateStatus.INITIAL ? (this.animateCount++,
25
+ animate.advance(delta)) : animate.status === AnimateStatus.PAUSED && this.animateCount++,
26
+ animate = animate.nextAnimate;
27
+ }
28
+ clear() {
29
+ let animate = this.animateHead;
30
+ for (;animate; ) animate.release(), animate = animate.nextAnimate;
31
+ this.animateHead = null, this.animateTail = null, this.animateCount = 0;
32
+ }
33
+ removeAnimate(animate, release = !0) {
34
+ animate._onRemove && animate._onRemove.forEach((cb => cb())), animate === this.animateHead ? (this.animateHead = animate.nextAnimate,
35
+ animate === this.animateTail ? this.animateTail = null : this.animateHead.prevAnimate = null) : animate === this.animateTail ? (this.animateTail = animate.prevAnimate,
36
+ this.animateTail.nextAnimate = null) : (animate.prevAnimate.nextAnimate = animate.nextAnimate,
37
+ animate.nextAnimate.prevAnimate = animate.prevAnimate), release && animate.release();
38
+ }
39
+ }
40
+
41
+ export const defaultTimeline = new DefaultTimeline;
42
+ //# sourceMappingURL=timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animate/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,MAAM,OAAO,eAAe;IAQ1B;QACE,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,UAAU,CAAC,OAA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CAAC,WAAW,CAAC;QAC/B,OAAO,OAAO,EAAE;YACd,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;SAC/B;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,aAAa,CAAC,OAAiB,EAAE,UAAmB,IAAI;QACtD,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;YAChC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACvC,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;gBAEhC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;aACzB;iBAAM;gBAEL,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;aACrC;SACF;aAAM,IAAI,OAAO,KAAK,IAAI,CAAC,WAAW,EAAE;YAEvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACvC,IAAI,CAAC,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;SAErC;aAAM;YACL,OAAO,CAAC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;YACtD,OAAO,CAAC,WAAW,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;SAIvD;QACD,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAE7B,OAAO;IACT,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","file":"timeline.js","sourcesContent":["import { AnimateStatus } from '../common/enums';\nimport { Generator } from '../common/generator';\nimport type { IAnimate, ITimeline } from '../interface';\n\n// 管理一组动画\nexport class DefaultTimeline implements ITimeline {\n declare id: number;\n protected declare animateHead: IAnimate | null;\n protected declare animateTail: IAnimate | null;\n protected declare ticker: any;\n declare animateCount: number;\n protected declare paused: boolean;\n\n constructor() {\n this.id = Generator.GenAutoIncrementId();\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n this.paused = false;\n }\n\n addAnimate(animate: IAnimate) {\n if (!this.animateTail) {\n this.animateHead = animate;\n this.animateTail = animate;\n } else {\n this.animateTail.nextAnimate = animate;\n animate.prevAnimate = this.animateTail;\n this.animateTail = animate;\n animate.nextAnimate = null;\n }\n this.animateCount++;\n }\n\n pause() {\n this.paused = true;\n }\n resume() {\n this.paused = false;\n }\n\n tick(delta: number) {\n if (this.paused) {\n return;\n }\n let animate = this.animateHead;\n this.animateCount = 0;\n while (animate) {\n if (animate.status === AnimateStatus.END) {\n this.removeAnimate(animate);\n } else if (animate.status === AnimateStatus.RUNNING || animate.status === AnimateStatus.INITIAL) {\n this.animateCount++;\n animate.advance(delta);\n } else if (animate.status === AnimateStatus.PAUSED) {\n // 暂停\n this.animateCount++;\n }\n animate = animate.nextAnimate;\n }\n }\n\n clear() {\n let animate = this.animateHead;\n while (animate) {\n animate.release();\n animate = animate.nextAnimate;\n }\n this.animateHead = null;\n this.animateTail = null;\n this.animateCount = 0;\n }\n\n removeAnimate(animate: IAnimate, release: boolean = true) {\n animate._onRemove && animate._onRemove.forEach(cb => cb());\n if (animate === this.animateHead) {\n this.animateHead = animate.nextAnimate;\n if (animate === this.animateTail) {\n // 只有一个元素\n this.animateTail = null;\n } else {\n // 有多个元素\n this.animateHead.prevAnimate = null;\n }\n } else if (animate === this.animateTail) {\n // 有多个元素\n this.animateTail = animate.prevAnimate;\n this.animateTail.nextAnimate = null;\n // animate.prevAnimate = null;\n } else {\n animate.prevAnimate.nextAnimate = animate.nextAnimate;\n animate.nextAnimate.prevAnimate = animate.prevAnimate;\n // animate不支持二次复用,不需要重置\n // animate.prevAnimate = null;\n // animate.nextAnimate = null;\n }\n release && animate.release();\n\n return;\n }\n}\n\nexport const defaultTimeline = new DefaultTimeline();\n"]}
@@ -1,11 +1,10 @@
1
1
  import type { ILayerService } from './interface/core';
2
2
  import type { IGraphicUtil, ITransformUtil } from './interface/core';
3
- import type { IGlobal, IGraphicService, IRenderService } from './interface';
3
+ import type { IGlobal, IGraphicService } from './interface';
4
4
  export declare class Application {
5
5
  global: IGlobal;
6
6
  graphicUtil: IGraphicUtil;
7
7
  graphicService: IGraphicService;
8
- renderService: IRenderService;
9
8
  transformUtil: ITransformUtil;
10
9
  layerService: ILayerService;
11
10
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/application.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,WAAW;CAOvB;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","file":"application.js","sourcesContent":["import type { ILayerService } from './interface/core';\nimport type { IGraphicUtil, ITransformUtil } from './interface/core';\nimport type { IGlobal, IGraphicService, IRenderService } from './interface';\n\nexport class Application {\n global: IGlobal;\n graphicUtil: IGraphicUtil;\n graphicService: IGraphicService;\n renderService: IRenderService;\n transformUtil: ITransformUtil;\n layerService: ILayerService;\n}\n\nexport const application = new Application();\n"]}
1
+ {"version":3,"sources":["../src/application.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,WAAW;CAMvB;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC","file":"application.js","sourcesContent":["import type { ILayerService } from './interface/core';\nimport type { IGraphicUtil, ITransformUtil } from './interface/core';\nimport type { IGlobal, IGraphicService } from './interface';\n\nexport class Application {\n global: IGlobal;\n graphicUtil: IGraphicUtil;\n graphicService: IGraphicService;\n transformUtil: ITransformUtil;\n layerService: ILayerService;\n}\n\nexport const application = new Application();\n"]}
@@ -1,3 +1,4 @@
1
1
  export const CanvasFactory = Symbol.for("CanvasFactory");
2
2
 
3
- export const Context2dFactory = Symbol.for("Context2dFactory");
3
+ export const Context2dFactory = Symbol.for("Context2dFactory");
4
+ //# sourceMappingURL=constants.js.map
@@ -33,7 +33,6 @@ export declare class EmptyContext2d implements IContext2d {
33
33
  get currentMatrix(): Matrix;
34
34
  cloneMatrix(m: Matrix): IMatrix;
35
35
  clear(): void;
36
- reset(): void;
37
36
  restore(): void;
38
37
  highPerformanceRestore(): void;
39
38
  rotate(rad: number, setTransform?: boolean): void;
@@ -49,10 +49,6 @@ let EmptyContext2d = class {
49
49
  clear() {
50
50
  this.save(), this.resetTransform(), this.restore();
51
51
  }
52
- reset() {
53
- this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0),
54
- this.stack.length = 0;
55
- }
56
52
  restore() {
57
53
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop(),
58
54
  this.setTransformForCurrent());