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

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/config.d.ts +1 -2
  2. package/cjs/animate/config.js +1 -5
  3. package/cjs/animate/config.js.map +1 -1
  4. package/cjs/application.d.ts +2 -1
  5. package/cjs/application.js.map +1 -1
  6. package/cjs/canvas/constants.js +1 -2
  7. package/cjs/canvas/empty-context.d.ts +1 -0
  8. package/cjs/canvas/empty-context.js +4 -0
  9. package/cjs/canvas/empty-context.js.map +1 -1
  10. package/cjs/canvas/util.js +2 -1
  11. package/cjs/color-string/interpolate.d.ts +1 -0
  12. package/cjs/color-string/interpolate.js +12 -4
  13. package/cjs/color-string/interpolate.js.map +1 -1
  14. package/cjs/common/custom-path2d.js +2 -2
  15. package/cjs/common/custom-path2d.js.map +1 -1
  16. package/cjs/common/diff.d.ts +1 -0
  17. package/cjs/common/diff.js +19 -0
  18. package/cjs/common/diff.js.map +1 -0
  19. package/cjs/common/enums.d.ts +0 -16
  20. package/cjs/common/enums.js +2 -11
  21. package/cjs/common/enums.js.map +1 -1
  22. package/cjs/common/morphing-utils.js +32 -124
  23. package/cjs/common/morphing-utils.js.map +1 -1
  24. package/cjs/common/performance-raf.d.ts +8 -0
  25. package/cjs/common/performance-raf.js +32 -0
  26. package/cjs/common/performance-raf.js.map +1 -0
  27. package/cjs/common/polygon.js +5 -2
  28. package/cjs/common/polygon.js.map +1 -1
  29. package/cjs/common/segment/curve/cubic-bezier.d.ts +1 -2
  30. package/cjs/common/segment/curve/cubic-bezier.js +3 -8
  31. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  32. package/cjs/common/segment/curve/quadratic-bezier.d.ts +1 -0
  33. package/cjs/common/segment/curve/quadratic-bezier.js +10 -3
  34. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  35. package/cjs/common/segment/index.d.ts +1 -0
  36. package/cjs/common/segment/index.js +1 -1
  37. package/cjs/common/segment/index.js.map +1 -1
  38. package/cjs/common/shape/arc.d.ts +1 -1
  39. package/cjs/common/shape/arc.js +7 -3
  40. package/cjs/common/shape/arc.js.map +1 -1
  41. package/cjs/common/simplify.js +1 -2
  42. package/cjs/common/sort.js +1 -1
  43. package/cjs/common/split-path.js +2 -2
  44. package/cjs/common/split-path.js.map +1 -1
  45. package/cjs/common/store.js +1 -1
  46. package/cjs/common/text.js +1 -1
  47. package/cjs/common/utils.d.ts +0 -2
  48. package/cjs/common/utils.js +5 -9
  49. package/cjs/common/utils.js.map +1 -1
  50. package/cjs/core/application.js +1 -1
  51. package/cjs/core/camera.js +1 -1
  52. package/cjs/core/global.d.ts +3 -0
  53. package/cjs/core/global.js +14 -3
  54. package/cjs/core/global.js.map +1 -1
  55. package/cjs/core/stage.d.ts +8 -3
  56. package/cjs/core/stage.js +34 -20
  57. package/cjs/core/stage.js.map +1 -1
  58. package/cjs/graphic/arc.d.ts +1 -2
  59. package/cjs/graphic/arc.js +3 -2
  60. package/cjs/graphic/arc.js.map +1 -1
  61. package/cjs/graphic/area.d.ts +1 -2
  62. package/cjs/graphic/area.js +4 -1
  63. package/cjs/graphic/area.js.map +1 -1
  64. package/cjs/graphic/circle.d.ts +1 -2
  65. package/cjs/graphic/circle.js +5 -2
  66. package/cjs/graphic/circle.js.map +1 -1
  67. package/cjs/graphic/config.js +2 -1
  68. package/cjs/graphic/config.js.map +1 -1
  69. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  70. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  71. package/cjs/graphic/graphic-service/graphic-service.js +2 -3
  72. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  73. package/cjs/graphic/graphic.d.ts +9 -12
  74. package/cjs/graphic/graphic.js +48 -105
  75. package/cjs/graphic/graphic.js.map +1 -1
  76. package/cjs/graphic/group.js +8 -8
  77. package/cjs/graphic/group.js.map +1 -1
  78. package/cjs/graphic/line.d.ts +1 -2
  79. package/cjs/graphic/line.js +5 -1
  80. package/cjs/graphic/line.js.map +1 -1
  81. package/cjs/graphic/rect.js +5 -2
  82. package/cjs/graphic/rect.js.map +1 -1
  83. package/cjs/graphic/richtext/icon.d.ts +1 -1
  84. package/cjs/graphic/richtext/icon.js.map +1 -1
  85. package/cjs/graphic/richtext/paragraph.js +2 -2
  86. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  87. package/cjs/graphic/star.d.ts +1 -2
  88. package/cjs/graphic/star.js +4 -2
  89. package/cjs/graphic/star.js.map +1 -1
  90. package/cjs/index.d.ts +2 -3
  91. package/cjs/index.js +14 -16
  92. package/cjs/index.js.map +1 -1
  93. package/cjs/interface/animate.d.ts +1 -160
  94. package/cjs/interface/animate.js +1 -4
  95. package/cjs/interface/animate.js.map +1 -1
  96. package/cjs/interface/animation/animate.d.ts +117 -0
  97. package/cjs/interface/animation/animate.js +10 -0
  98. package/cjs/interface/animation/animate.js.map +1 -0
  99. package/cjs/interface/animation/easing.d.ts +3 -0
  100. package/cjs/interface/animation/easing.js +6 -0
  101. package/cjs/interface/animation/easing.js.map +1 -0
  102. package/cjs/interface/animation/index.d.ts +5 -0
  103. package/cjs/{animate/Ticker → interface/animation}/index.js +3 -3
  104. package/cjs/interface/animation/index.js.map +1 -0
  105. package/cjs/interface/animation/ticker.d.ts +39 -0
  106. package/cjs/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  107. package/cjs/interface/animation/ticker.js.map +1 -0
  108. package/cjs/interface/animation/timeline.d.ts +17 -0
  109. package/cjs/interface/animation/timeline.js +6 -0
  110. package/cjs/interface/animation/timeline.js.map +1 -0
  111. package/cjs/interface/animation/type.d.ts +13 -0
  112. package/cjs/interface/animation/type.js +15 -0
  113. package/cjs/interface/animation/type.js.map +1 -0
  114. package/cjs/interface/context.d.ts +1 -0
  115. package/cjs/interface/context.js.map +1 -1
  116. package/cjs/interface/global.d.ts +2 -0
  117. package/cjs/interface/global.js.map +1 -1
  118. package/cjs/interface/graphic.d.ts +11 -3
  119. package/cjs/interface/graphic.js.map +1 -1
  120. package/cjs/interface/index.d.ts +1 -1
  121. package/cjs/interface/index.js +9 -9
  122. package/cjs/interface/index.js.map +1 -1
  123. package/cjs/interface/render.d.ts +7 -0
  124. package/cjs/interface/render.js.map +1 -1
  125. package/cjs/interface/stage.d.ts +4 -1
  126. package/cjs/interface/stage.js.map +1 -1
  127. package/cjs/modules.d.ts +2 -1
  128. package/cjs/modules.js +4 -3
  129. package/cjs/modules.js.map +1 -1
  130. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  131. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  132. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  133. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  134. package/cjs/plugins/builtin-plugin/edit-module.js +4 -4
  135. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  136. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  137. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  138. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  139. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  140. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  141. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  142. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  143. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +6 -5
  144. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  145. package/cjs/render/contributions/render/arc-render.d.ts +4 -2
  146. package/cjs/render/contributions/render/arc-render.js +19 -17
  147. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  148. package/cjs/render/contributions/render/area-render.js +2 -2
  149. package/cjs/render/contributions/render/area-render.js.map +1 -1
  150. package/cjs/render/contributions/render/base-render.d.ts +2 -2
  151. package/cjs/render/contributions/render/base-render.js +2 -2
  152. package/cjs/render/contributions/render/base-render.js.map +1 -1
  153. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -0
  154. package/cjs/render/contributions/render/draw-contribution.js +23 -19
  155. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  156. package/cjs/render/contributions/render/draw-interceptor.js +2 -1
  157. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  158. package/cjs/render/contributions/render/group-render.d.ts +2 -2
  159. package/cjs/render/contributions/render/group-render.js +15 -11
  160. package/cjs/render/contributions/render/group-render.js.map +1 -1
  161. package/cjs/render/contributions/render/line-render.js +1 -1
  162. package/cjs/render/contributions/render/line-render.js.map +1 -1
  163. package/cjs/render/contributions/render/rect-render.d.ts +3 -1
  164. package/cjs/render/contributions/render/rect-render.js +17 -15
  165. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  166. package/cjs/render/contributions/render/symbol-render.d.ts +4 -2
  167. package/cjs/render/contributions/render/symbol-render.js +16 -11
  168. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  169. package/cjs/render/render-service.d.ts +1 -1
  170. package/cjs/render/render-service.js.map +1 -1
  171. package/dist/index.es.js +5992 -8838
  172. package/es/animate/config.d.ts +1 -2
  173. package/es/animate/config.js +0 -5
  174. package/es/animate/config.js.map +1 -1
  175. package/es/application.d.ts +2 -1
  176. package/es/application.js.map +1 -1
  177. package/es/canvas/constants.js +1 -2
  178. package/es/canvas/empty-context.d.ts +1 -0
  179. package/es/canvas/empty-context.js +4 -0
  180. package/es/canvas/empty-context.js.map +1 -1
  181. package/es/canvas/util.js +2 -1
  182. package/es/color-string/interpolate.d.ts +1 -0
  183. package/es/color-string/interpolate.js +8 -1
  184. package/es/color-string/interpolate.js.map +1 -1
  185. package/es/common/custom-path2d.js +2 -2
  186. package/es/common/custom-path2d.js.map +1 -1
  187. package/es/common/diff.d.ts +1 -0
  188. package/es/common/diff.js +11 -0
  189. package/es/common/diff.js.map +1 -0
  190. package/es/common/enums.d.ts +0 -16
  191. package/es/common/enums.js +0 -20
  192. package/es/common/enums.js.map +1 -1
  193. package/es/common/morphing-utils.js +29 -124
  194. package/es/common/morphing-utils.js.map +1 -1
  195. package/es/common/performance-raf.d.ts +8 -0
  196. package/es/common/performance-raf.js +24 -0
  197. package/es/common/performance-raf.js.map +1 -0
  198. package/es/common/polygon.js +6 -3
  199. package/es/common/polygon.js.map +1 -1
  200. package/es/common/segment/curve/cubic-bezier.d.ts +1 -2
  201. package/es/common/segment/curve/cubic-bezier.js +1 -8
  202. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  203. package/es/common/segment/curve/quadratic-bezier.d.ts +1 -0
  204. package/es/common/segment/curve/quadratic-bezier.js +5 -2
  205. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  206. package/es/common/segment/index.d.ts +1 -0
  207. package/es/common/segment/index.js +2 -0
  208. package/es/common/segment/index.js.map +1 -1
  209. package/es/common/shape/arc.d.ts +1 -1
  210. package/es/common/shape/arc.js +7 -3
  211. package/es/common/shape/arc.js.map +1 -1
  212. package/es/common/simplify.js +1 -2
  213. package/es/common/sort.js +1 -1
  214. package/es/common/split-path.js +2 -2
  215. package/es/common/split-path.js.map +1 -1
  216. package/es/common/store.js +1 -1
  217. package/es/common/text.js +1 -1
  218. package/es/common/utils.d.ts +0 -2
  219. package/es/common/utils.js +1 -5
  220. package/es/common/utils.js.map +1 -1
  221. package/es/core/application.js +1 -1
  222. package/es/core/camera.js +1 -1
  223. package/es/core/global.d.ts +3 -0
  224. package/es/core/global.js +15 -2
  225. package/es/core/global.js.map +1 -1
  226. package/es/core/stage.d.ts +8 -3
  227. package/es/core/stage.js +35 -22
  228. package/es/core/stage.js.map +1 -1
  229. package/es/graphic/arc.d.ts +1 -2
  230. package/es/graphic/arc.js +3 -2
  231. package/es/graphic/arc.js.map +1 -1
  232. package/es/graphic/area.d.ts +1 -2
  233. package/es/graphic/area.js +4 -1
  234. package/es/graphic/area.js.map +1 -1
  235. package/es/graphic/circle.d.ts +1 -2
  236. package/es/graphic/circle.js +4 -2
  237. package/es/graphic/circle.js.map +1 -1
  238. package/es/graphic/config.js +2 -1
  239. package/es/graphic/config.js.map +1 -1
  240. package/es/graphic/graphic-service/graphic-module.js +1 -1
  241. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  242. package/es/graphic/graphic-service/graphic-service.js +1 -4
  243. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  244. package/es/graphic/graphic.d.ts +9 -12
  245. package/es/graphic/graphic.js +52 -109
  246. package/es/graphic/graphic.js.map +1 -1
  247. package/es/graphic/group.js +7 -7
  248. package/es/graphic/group.js.map +1 -1
  249. package/es/graphic/line.d.ts +1 -2
  250. package/es/graphic/line.js +5 -1
  251. package/es/graphic/line.js.map +1 -1
  252. package/es/graphic/rect.js +5 -2
  253. package/es/graphic/rect.js.map +1 -1
  254. package/es/graphic/richtext/icon.d.ts +1 -1
  255. package/es/graphic/richtext/icon.js.map +1 -1
  256. package/es/graphic/richtext/paragraph.js +2 -2
  257. package/es/graphic/richtext/paragraph.js.map +1 -1
  258. package/es/graphic/star.d.ts +1 -2
  259. package/es/graphic/star.js +4 -2
  260. package/es/graphic/star.js.map +1 -1
  261. package/es/index.d.ts +2 -3
  262. package/es/index.js +4 -6
  263. package/es/index.js.map +1 -1
  264. package/es/interface/animate.d.ts +1 -160
  265. package/es/interface/animate.js +2 -1
  266. package/es/interface/animate.js.map +1 -1
  267. package/es/interface/animation/animate.d.ts +117 -0
  268. package/es/interface/animation/animate.js +6 -0
  269. package/es/interface/animation/animate.js.map +1 -0
  270. package/es/interface/animation/easing.d.ts +3 -0
  271. package/es/interface/animation/easing.js +2 -0
  272. package/es/interface/animation/easing.js.map +1 -0
  273. package/es/interface/animation/index.d.ts +5 -0
  274. package/es/interface/animation/index.js +10 -0
  275. package/es/interface/animation/index.js.map +1 -0
  276. package/es/interface/animation/ticker.d.ts +39 -0
  277. package/es/{animate/Ticker/type.js → interface/animation/ticker.js} +1 -1
  278. package/es/interface/animation/ticker.js.map +1 -0
  279. package/es/interface/animation/timeline.d.ts +17 -0
  280. package/es/interface/animation/timeline.js +2 -0
  281. package/es/interface/animation/timeline.js.map +1 -0
  282. package/es/interface/animation/type.d.ts +13 -0
  283. package/es/interface/animation/type.js +14 -0
  284. package/es/interface/animation/type.js.map +1 -0
  285. package/es/interface/context.d.ts +1 -0
  286. package/es/interface/context.js.map +1 -1
  287. package/es/interface/global.d.ts +2 -0
  288. package/es/interface/global.js.map +1 -1
  289. package/es/interface/graphic.d.ts +11 -3
  290. package/es/interface/graphic.js.map +1 -1
  291. package/es/interface/index.d.ts +1 -1
  292. package/es/interface/index.js +2 -2
  293. package/es/interface/index.js.map +1 -1
  294. package/es/interface/render.d.ts +7 -0
  295. package/es/interface/render.js.map +1 -1
  296. package/es/interface/stage.d.ts +4 -1
  297. package/es/interface/stage.js.map +1 -1
  298. package/es/modules.d.ts +2 -1
  299. package/es/modules.js +6 -0
  300. package/es/modules.js.map +1 -1
  301. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  302. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  303. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  304. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  305. package/es/plugins/builtin-plugin/edit-module.js +4 -4
  306. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  307. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  308. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  309. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  310. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  311. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  312. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  313. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +2 -2
  314. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +4 -5
  315. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  316. package/es/render/contributions/render/arc-render.d.ts +4 -2
  317. package/es/render/contributions/render/arc-render.js +19 -17
  318. package/es/render/contributions/render/arc-render.js.map +1 -1
  319. package/es/render/contributions/render/area-render.js +2 -2
  320. package/es/render/contributions/render/area-render.js.map +1 -1
  321. package/es/render/contributions/render/base-render.d.ts +2 -2
  322. package/es/render/contributions/render/base-render.js +2 -2
  323. package/es/render/contributions/render/base-render.js.map +1 -1
  324. package/es/render/contributions/render/draw-contribution.d.ts +1 -0
  325. package/es/render/contributions/render/draw-contribution.js +23 -19
  326. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  327. package/es/render/contributions/render/draw-interceptor.js +2 -1
  328. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  329. package/es/render/contributions/render/group-render.d.ts +2 -2
  330. package/es/render/contributions/render/group-render.js +15 -11
  331. package/es/render/contributions/render/group-render.js.map +1 -1
  332. package/es/render/contributions/render/line-render.js +1 -1
  333. package/es/render/contributions/render/line-render.js.map +1 -1
  334. package/es/render/contributions/render/rect-render.d.ts +3 -1
  335. package/es/render/contributions/render/rect-render.js +17 -14
  336. package/es/render/contributions/render/rect-render.js.map +1 -1
  337. package/es/render/contributions/render/symbol-render.d.ts +4 -2
  338. package/es/render/contributions/render/symbol-render.js +16 -11
  339. package/es/render/contributions/render/symbol-render.js.map +1 -1
  340. package/es/render/render-service.d.ts +1 -1
  341. package/es/render/render-service.js.map +1 -1
  342. package/package.json +2 -2
  343. package/cjs/animate/Ticker/default-ticker.d.ts +0 -40
  344. package/cjs/animate/Ticker/default-ticker.js +0 -140
  345. package/cjs/animate/Ticker/default-ticker.js.map +0 -1
  346. package/cjs/animate/Ticker/index.d.ts +0 -5
  347. package/cjs/animate/Ticker/index.js.map +0 -1
  348. package/cjs/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  349. package/cjs/animate/Ticker/manual-ticker-handler.js +0 -36
  350. package/cjs/animate/Ticker/manual-ticker-handler.js.map +0 -1
  351. package/cjs/animate/Ticker/manual-ticker.d.ts +0 -19
  352. package/cjs/animate/Ticker/manual-ticker.js +0 -37
  353. package/cjs/animate/Ticker/manual-ticker.js.map +0 -1
  354. package/cjs/animate/Ticker/raf-tick-handler.d.ts +0 -9
  355. package/cjs/animate/Ticker/raf-tick-handler.js +0 -30
  356. package/cjs/animate/Ticker/raf-tick-handler.js.map +0 -1
  357. package/cjs/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  358. package/cjs/animate/Ticker/timeout-tick-handler.js +0 -28
  359. package/cjs/animate/Ticker/timeout-tick-handler.js.map +0 -1
  360. package/cjs/animate/Ticker/type.d.ts +0 -6
  361. package/cjs/animate/Ticker/type.js.map +0 -1
  362. package/cjs/animate/animate.d.ts +0 -147
  363. package/cjs/animate/animate.js +0 -403
  364. package/cjs/animate/animate.js.map +0 -1
  365. package/cjs/animate/custom-animate.d.ts +0 -236
  366. package/cjs/animate/custom-animate.js +0 -726
  367. package/cjs/animate/custom-animate.js.map +0 -1
  368. package/cjs/animate/default-ticker.d.ts +0 -2
  369. package/cjs/animate/default-ticker.js +0 -14
  370. package/cjs/animate/default-ticker.js.map +0 -1
  371. package/cjs/animate/easing-func.d.ts +0 -1
  372. package/cjs/animate/easing-func.js +0 -16
  373. package/cjs/animate/easing-func.js.map +0 -1
  374. package/cjs/animate/easing.d.ts +0 -49
  375. package/cjs/animate/easing.js +0 -141
  376. package/cjs/animate/easing.js.map +0 -1
  377. package/cjs/animate/group-fade.d.ts +0 -16
  378. package/cjs/animate/group-fade.js +0 -66
  379. package/cjs/animate/group-fade.js.map +0 -1
  380. package/cjs/animate/index.d.ts +0 -8
  381. package/cjs/animate/index.js +0 -24
  382. package/cjs/animate/index.js.map +0 -1
  383. package/cjs/animate/morphing.d.ts +0 -52
  384. package/cjs/animate/morphing.js +0 -292
  385. package/cjs/animate/morphing.js.map +0 -1
  386. package/cjs/animate/timeline.d.ts +0 -17
  387. package/cjs/animate/timeline.js +0 -46
  388. package/cjs/animate/timeline.js.map +0 -1
  389. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  390. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  391. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
  392. package/es/animate/Ticker/default-ticker.d.ts +0 -40
  393. package/es/animate/Ticker/default-ticker.js +0 -138
  394. package/es/animate/Ticker/default-ticker.js.map +0 -1
  395. package/es/animate/Ticker/index.d.ts +0 -5
  396. package/es/animate/Ticker/index.js +0 -10
  397. package/es/animate/Ticker/index.js.map +0 -1
  398. package/es/animate/Ticker/manual-ticker-handler.d.ts +0 -15
  399. package/es/animate/Ticker/manual-ticker-handler.js +0 -28
  400. package/es/animate/Ticker/manual-ticker-handler.js.map +0 -1
  401. package/es/animate/Ticker/manual-ticker.d.ts +0 -19
  402. package/es/animate/Ticker/manual-ticker.js +0 -31
  403. package/es/animate/Ticker/manual-ticker.js.map +0 -1
  404. package/es/animate/Ticker/raf-tick-handler.d.ts +0 -9
  405. package/es/animate/Ticker/raf-tick-handler.js +0 -22
  406. package/es/animate/Ticker/raf-tick-handler.js.map +0 -1
  407. package/es/animate/Ticker/timeout-tick-handler.d.ts +0 -9
  408. package/es/animate/Ticker/timeout-tick-handler.js +0 -20
  409. package/es/animate/Ticker/timeout-tick-handler.js.map +0 -1
  410. package/es/animate/Ticker/type.d.ts +0 -6
  411. package/es/animate/Ticker/type.js.map +0 -1
  412. package/es/animate/animate.d.ts +0 -147
  413. package/es/animate/animate.js +0 -398
  414. package/es/animate/animate.js.map +0 -1
  415. package/es/animate/custom-animate.d.ts +0 -236
  416. package/es/animate/custom-animate.js +0 -703
  417. package/es/animate/custom-animate.js.map +0 -1
  418. package/es/animate/default-ticker.d.ts +0 -2
  419. package/es/animate/default-ticker.js +0 -12
  420. package/es/animate/default-ticker.js.map +0 -1
  421. package/es/animate/easing-func.d.ts +0 -1
  422. package/es/animate/easing-func.js +0 -10
  423. package/es/animate/easing-func.js.map +0 -1
  424. package/es/animate/easing.d.ts +0 -49
  425. package/es/animate/easing.js +0 -134
  426. package/es/animate/easing.js.map +0 -1
  427. package/es/animate/group-fade.d.ts +0 -16
  428. package/es/animate/group-fade.js +0 -56
  429. package/es/animate/group-fade.js.map +0 -1
  430. package/es/animate/index.d.ts +0 -8
  431. package/es/animate/index.js +0 -16
  432. package/es/animate/index.js.map +0 -1
  433. package/es/animate/morphing.d.ts +0 -52
  434. package/es/animate/morphing.js +0 -295
  435. package/es/animate/morphing.js.map +0 -1
  436. package/es/animate/timeline.d.ts +0 -17
  437. package/es/animate/timeline.js +0 -42
  438. package/es/animate/timeline.js.map +0 -1
  439. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  440. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  441. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
@@ -1,703 +0,0 @@
1
- import { clamp, getDecimalPlaces, isArray, isNumber, isValidNumber, pi, pi2, Point, PointService } from "@visactor/vutils";
2
-
3
- import { application } from "../application";
4
-
5
- import { AttributeUpdateType } from "../common/enums";
6
-
7
- import { CustomPath2D } from "../common/custom-path2d";
8
-
9
- import { ACustomAnimate } from "./animate";
10
-
11
- import { Easing } from "./easing";
12
-
13
- import { pointInterpolation } from "../common/utils";
14
-
15
- import { divideCubic } from "../common/segment/curve/cubic-bezier";
16
-
17
- export class IncreaseCount extends ACustomAnimate {
18
- constructor(from, to, duration, easing, params) {
19
- super(from, to, duration, easing, params);
20
- }
21
- getEndProps() {
22
- return !1 === this.valid ? {} : {
23
- text: this.to
24
- };
25
- }
26
- onBind() {
27
- var _a, _b, _c, _d, _e, _f, _g, _h;
28
- this.fromNumber = isNumber(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text),
29
- this.toNumber = isNumber(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text),
30
- Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1),
31
- !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
32
- }
33
- onEnd() {}
34
- onUpdate(end, ratio, out) {
35
- var _a;
36
- !1 !== this.valid && (out.text = end ? null === (_a = this.to) || void 0 === _a ? void 0 : _a.text : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
37
- }
38
- }
39
-
40
- var Direction;
41
-
42
- !function(Direction) {
43
- Direction[Direction.LEFT_TO_RIGHT = 0] = "LEFT_TO_RIGHT", Direction[Direction.RIGHT_TO_LEFT = 1] = "RIGHT_TO_LEFT",
44
- Direction[Direction.TOP_TO_BOTTOM = 2] = "TOP_TO_BOTTOM", Direction[Direction.BOTTOM_TO_TOP = 3] = "BOTTOM_TO_TOP",
45
- Direction[Direction.STROKE = 4] = "STROKE";
46
- }(Direction || (Direction = {}));
47
-
48
- export class FadeInPlus extends ACustomAnimate {
49
- constructor(from, to, duration, easing, params) {
50
- super(from, to, duration, easing, params);
51
- const {direction: direction = Direction.LEFT_TO_RIGHT, fill: fill = !0, stroke: stroke = !0} = params || {};
52
- this.direction = direction, this.fill = fill, this.stroke = stroke, this.fillGradient = {
53
- gradient: "linear",
54
- stops: []
55
- }, this.strokeGradient = {
56
- gradient: "linear",
57
- stops: []
58
- };
59
- }
60
- getEndProps() {
61
- return {
62
- fill: this.toFill,
63
- stroke: this.toStroke
64
- };
65
- }
66
- onBind() {
67
- this.toFill = this.target.getComputedAttribute("fill"), this.toStroke = this.target.getComputedAttribute("stroke");
68
- }
69
- onEnd() {}
70
- onUpdate(end, ratio, out) {
71
- if (this.toFill && this.toStroke) switch (this.direction) {
72
- case Direction.RIGHT_TO_LEFT:
73
- this.rightToLeft(end, ratio, out);
74
- break;
75
-
76
- case Direction.TOP_TO_BOTTOM:
77
- this.topToBottom(end, ratio, out);
78
- break;
79
-
80
- case Direction.BOTTOM_TO_TOP:
81
- this.bottomToTop(end, ratio, out);
82
- break;
83
-
84
- case Direction.STROKE:
85
- this.strokePath(end, ratio, out);
86
- break;
87
-
88
- default:
89
- this.leftToRight(end, ratio, out);
90
- }
91
- }
92
- leftToRight(end, ratio, out) {
93
- if (this.fill) {
94
- const toFillColor = this.toFill;
95
- this.fillGradient.x0 = 0, this.fillGradient.y0 = 0, this.fillGradient.x1 = 1, this.fillGradient.y1 = 0,
96
- this.fillGradient.stops = [ {
97
- offset: 0,
98
- color: toFillColor
99
- }, {
100
- offset: ratio,
101
- color: toFillColor
102
- }, {
103
- offset: Math.min(1, 2 * ratio),
104
- color: "transparent"
105
- } ], out.fill = this.fillGradient;
106
- }
107
- if (this.stroke) {
108
- const toStrokeColor = this.toStroke;
109
- this.strokeGradient.x0 = 0, this.strokeGradient.y0 = 0, this.strokeGradient.x1 = 1,
110
- this.strokeGradient.y1 = 0, this.strokeGradient.stops = [ {
111
- offset: 0,
112
- color: toStrokeColor
113
- }, {
114
- offset: ratio,
115
- color: toStrokeColor
116
- }, {
117
- offset: Math.min(1, 6 * ratio),
118
- color: "transparent"
119
- } ], out.stroke = this.strokeGradient;
120
- }
121
- }
122
- strokePath(end, ratio, out) {
123
- if (this.fill) {
124
- const toFillColor = this.toFill;
125
- this.fillGradient.x0 = 0, this.fillGradient.y0 = 0, this.fillGradient.x1 = 1, this.fillGradient.y1 = 0,
126
- this.fillGradient.stops = [ {
127
- offset: 0,
128
- color: toFillColor
129
- }, {
130
- offset: ratio,
131
- color: toFillColor
132
- }, {
133
- offset: Math.min(1, 2 * ratio),
134
- color: "transparent"
135
- } ], out.fill = this.fillGradient;
136
- }
137
- if (this.stroke) {
138
- const dashLen = 300, offset = ratio * dashLen;
139
- out.lineDash = [ offset, dashLen - offset ];
140
- }
141
- }
142
- rightToLeft(end, ratio, out) {}
143
- topToBottom(end, ratio, out) {}
144
- bottomToTop(end, ratio, out) {}
145
- }
146
-
147
- export class InputText extends ACustomAnimate {
148
- constructor() {
149
- super(...arguments), this.fromText = "", this.toText = "";
150
- }
151
- getEndProps() {
152
- return !1 === this.valid ? {} : {
153
- text: this.to
154
- };
155
- }
156
- onBind() {
157
- var _a, _b, _c;
158
- this.fromText = null !== (_b = null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) && void 0 !== _b ? _b : "",
159
- this.toText = (null === (_c = this.to) || void 0 === _c ? void 0 : _c.text) || "",
160
- (!this.toText || isArray(this.toText) && 0 === this.toText.length) && (this.valid = !1),
161
- isArray(this.toText) && (this.toText = this.toText.map((item => (item || "").toString())));
162
- }
163
- onEnd() {
164
- this.target.detachShadow();
165
- }
166
- onUpdate(end, ratio, out) {
167
- if (!1 === this.valid) return;
168
- const fromCount = this.fromText.length, toTextIsArray = isArray(this.toText), toCount = toTextIsArray ? this.toText.reduce(((c, t) => c + (t || "").length), 0) : this.toText.length, count = Math.ceil(fromCount + (toCount - fromCount) * ratio);
169
- if (toTextIsArray) {
170
- out.text = [];
171
- let len = 0;
172
- this.toText.forEach((t => {
173
- len + t.length > count ? (out.text.push(t.substr(0, count - len)), len = count) : (out.text.push(t),
174
- len += t.length);
175
- }));
176
- } else out.text = this.toText.substr(0, count);
177
- }
178
- }
179
-
180
- export class StreamLight extends ACustomAnimate {
181
- constructor(from, to, duration, easing, params) {
182
- super(from, to, duration, easing, params);
183
- }
184
- getEndProps() {
185
- return {};
186
- }
187
- onStart() {
188
- this.target && ("rect" === this.target.type ? this.onStartRect() : "line" === this.target.type ? this.onStartLineOrArea("line") : "area" === this.target.type && this.onStartLineOrArea("area"));
189
- }
190
- onStartLineOrArea(type) {
191
- var _a;
192
- const root = this.target.attachShadow(), line = application.graphicService.creator[type](Object.assign({}, null === (_a = this.params) || void 0 === _a ? void 0 : _a.attribute));
193
- this[type] = line, line.pathProxy = new CustomPath2D, root.add(line);
194
- }
195
- onStartRect() {
196
- var _a, _b, _c;
197
- const root = this.target.attachShadow(), isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, sizeAttr = isHorizontal ? "height" : "width", otherSizeAttr = isHorizontal ? "width" : "height", size = this.target.AABBBounds[sizeAttr](), y = isHorizontal ? 0 : this.target.AABBBounds.y1, rect = application.graphicService.creator.rect(Object.assign(Object.assign({
198
- [sizeAttr]: size,
199
- fill: "#bcdeff",
200
- shadowBlur: 30,
201
- shadowColor: "#bcdeff"
202
- }, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
203
- x: 0,
204
- y: y,
205
- [otherSizeAttr]: 0
206
- }));
207
- this.rect = rect, root.add(rect);
208
- }
209
- onBind() {}
210
- onEnd() {
211
- this.target.detachShadow();
212
- }
213
- onUpdate(end, ratio, out) {
214
- return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
215
- }
216
- onUpdateRect(end, ratio, out) {
217
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
218
- const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, parentAttr = this.target.attribute;
219
- if (isHorizontal) {
220
- const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : Math.abs(parentAttr.x1 - parentAttr.x)) && void 0 !== _d ? _d : 250, streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth, maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60, startX = -maxLength, currentX = startX + (streamLength - startX) * ratio, x = Math.max(currentX, 0), w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX), width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
221
- this.rect.setAttributes({
222
- x: x,
223
- width: width,
224
- dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
225
- }, !1, {
226
- type: AttributeUpdateType.ANIMATE_PLAY,
227
- animationState: {
228
- ratio: ratio,
229
- end: end
230
- }
231
- });
232
- } else {
233
- const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : Math.abs(parentAttr.y1 - parentAttr.y)) && void 0 !== _l ? _l : 250, streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight, maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60, currentY = parentHeight - (streamLength + maxLength) * ratio;
234
- let y = Math.min(currentY, parentHeight);
235
- const h = Math.min(parentHeight - currentY, maxLength);
236
- let height;
237
- y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
238
- y: y,
239
- height: height,
240
- dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
241
- }, !1, {
242
- type: AttributeUpdateType.ANIMATE_PLAY,
243
- animationState: {
244
- ratio: ratio,
245
- end: end
246
- }
247
- });
248
- }
249
- }
250
- onUpdateLineOrArea(end, ratio, out) {
251
- const target = this.line || this.area;
252
- if (!target) return;
253
- const customPath = target.pathProxy, targetLine = this.target;
254
- targetLine.cache || targetLine.cacheArea ? this._onUpdateLineOrAreaWithCache(customPath, targetLine, end, ratio, out) : this._onUpdateLineWithoutCache(customPath, targetLine, end, ratio, out);
255
- const targetAttrs = targetLine.attribute;
256
- target.setAttributes(Object.assign({
257
- stroke: targetAttrs.stroke
258
- }, target.attribute)), target.addUpdateBoundTag();
259
- }
260
- _onUpdateLineOrAreaWithCache(customPath, g, end, ratio, out) {
261
- var _a, _b;
262
- if (customPath.clear(), "line" === g.type) {
263
- let cache = g.cache;
264
- Array.isArray(cache) || (cache = [ cache ]);
265
- const totalLen = cache.reduce(((l, c) => l + c.getLength()), 0), curves = [];
266
- return cache.forEach((c => {
267
- c.curves.forEach((ci => curves.push(ci)));
268
- })), this._updateCurves(customPath, curves, totalLen, ratio);
269
- }
270
- if ("area" === g.type && (null === (_b = null === (_a = g.cacheArea) || void 0 === _a ? void 0 : _a.top) || void 0 === _b ? void 0 : _b.curves)) {
271
- const cache = g.cacheArea, totalLen = cache.top.curves.reduce(((a, b) => a + b.getLength()), 0);
272
- return this._updateCurves(customPath, cache.top.curves, totalLen, ratio);
273
- }
274
- }
275
- _updateCurves(customPath, curves, totalLen, ratio) {
276
- var _a, _b;
277
- const startLen = totalLen * ratio, endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen);
278
- let lastLen = 0, start = !1;
279
- for (let i = 0; i < curves.length; i++) if (!1 !== curves[i].defined) {
280
- const curveItem = curves[i], len = curveItem.getLength(), startPercent = 1 - (lastLen + len - startLen) / len;
281
- let curveForStart, endPercent = 1 - (lastLen + len - endLen) / len;
282
- if (lastLen < startLen && lastLen + len > startLen) if (start = !0, curveItem.p2 && curveItem.p3) {
283
- const [_, curve2] = divideCubic(curveItem, startPercent);
284
- customPath.moveTo(curve2.p0.x, curve2.p0.y), curveForStart = curve2;
285
- } else {
286
- const p = curveItem.getPointAt(startPercent);
287
- customPath.moveTo(p.x, p.y);
288
- }
289
- if (lastLen < endLen && lastLen + len > endLen) {
290
- if (curveItem.p2 && curveItem.p3) {
291
- curveForStart && (endPercent = (endLen - startLen) / curveForStart.getLength());
292
- const [curve1] = divideCubic(curveForStart || curveItem, endPercent);
293
- customPath.bezierCurveTo(curve1.p1.x, curve1.p1.y, curve1.p2.x, curve1.p2.y, curve1.p3.x, curve1.p3.y);
294
- } else {
295
- const p = curveItem.getPointAt(endPercent);
296
- customPath.lineTo(p.x, p.y);
297
- }
298
- break;
299
- }
300
- if (start) if (curveItem.p2 && curveItem.p3) {
301
- const curve = curveForStart || curveItem;
302
- customPath.bezierCurveTo(curve.p1.x, curve.p1.y, curve.p2.x, curve.p2.y, curve.p3.x, curve.p3.y);
303
- } else customPath.lineTo(curveItem.p1.x, curveItem.p1.y);
304
- lastLen += len;
305
- }
306
- }
307
- _onUpdateLineWithoutCache(customPath, line, end, ratio, out) {
308
- var _a, _b;
309
- const {points: points, curveType: curveType} = line.attribute;
310
- if (!points || points.length < 2 || "linear" !== curveType) return;
311
- let totalLen = 0;
312
- for (let i = 1; i < points.length; i++) totalLen += PointService.distancePP(points[i], points[i - 1]);
313
- const startLen = totalLen * ratio, endLen = Math.min(null !== (_b = startLen + (null === (_a = this.params) || void 0 === _a ? void 0 : _a.streamLength)) && void 0 !== _b ? _b : 10, totalLen), nextPoints = [];
314
- let lastLen = 0;
315
- for (let i = 1; i < points.length; i++) {
316
- const len = PointService.distancePP(points[i], points[i - 1]);
317
- if (lastLen < startLen && lastLen + len > startLen && nextPoints.push(PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - startLen) / len)),
318
- lastLen < endLen && lastLen + len > endLen) {
319
- nextPoints.push(PointService.pointAtPP(points[i - 1], points[i], 1 - (lastLen + len - endLen) / len));
320
- break;
321
- }
322
- nextPoints.length && nextPoints.push(points[i]), lastLen += len;
323
- }
324
- if (nextPoints.length && !(nextPoints.length < 2)) {
325
- customPath.clear(), customPath.moveTo(nextPoints[0].x, nextPoints[0].y);
326
- for (let i = 1; i < nextPoints.length; i++) customPath.lineTo(nextPoints[i].x, nextPoints[i].y);
327
- }
328
- }
329
- }
330
-
331
- export class Meteor extends ACustomAnimate {
332
- get lastPos() {
333
- return this.posList[this.posList.length - 1];
334
- }
335
- constructor(size, duration, easing, params) {
336
- super(null, null, duration, easing, params), this.size = size, this.posList = [];
337
- }
338
- onBind() {
339
- const root = this.target.attachShadow();
340
- this.root = root;
341
- for (let i = 0; i < this.size; i++) {
342
- const g = this.target.clone(), scale = Math.min((this.size - i) / this.size * 3, 1), opacity = Math.min(.2 + .7 / this.size);
343
- g.setAttributes({
344
- x: 0,
345
- y: 0,
346
- dx: 0,
347
- dy: 0,
348
- scaleX: scale,
349
- scaleY: scale,
350
- opacity: opacity
351
- }, !1, {
352
- type: AttributeUpdateType.ANIMATE_BIND
353
- }), root.add(g);
354
- }
355
- }
356
- onUpdate(end, ratio, out) {
357
- if (end) return this.target.detachShadow(), void (this.posList.length = 0);
358
- const x = this.target.getComputedAttribute("x"), y = this.target.getComputedAttribute("y"), nextPos = new Point(x, y);
359
- this.posList.length ? (this.target.shadowRoot.forEachChildren(((g, i) => {
360
- const pos = this.posList[Math.max(this.posList.length - i - 1, 0)];
361
- g.setAttributes({
362
- x: pos.x - x,
363
- y: pos.y - y
364
- }, !1);
365
- })), this.posList.push(nextPos)) : this.posList.push(nextPos);
366
- }
367
- }
368
-
369
- export class MotionPath extends ACustomAnimate {
370
- constructor(from, to, duration, easing, params) {
371
- var _a;
372
- super(from, to, duration, easing, params), params && (this.pathLength = params.path.getLength(),
373
- this.path = params.path, this.distance = params.distance, this.to = params.distance * this.pathLength,
374
- this.initAngle = null !== (_a = params.initAngle) && void 0 !== _a ? _a : 0, this.changeAngle = !!params.changeAngle,
375
- this.cb = params.cb);
376
- }
377
- onUpdate(end, ratio, out) {
378
- const at = this.to * ratio, {pos: pos, angle: angle} = this.path.getAttrAt(at);
379
- out.x = pos.x, out.y = pos.y, this.changeAngle && (out.angle = angle + this.initAngle),
380
- this.cb && this.cb(this.from, this.to, ratio, this.target);
381
- }
382
- }
383
-
384
- export class TagPointsUpdate extends ACustomAnimate {
385
- constructor(from, to, duration, easing, params) {
386
- var _a, _b;
387
- super(from, to, duration, easing, params), this.newPointAnimateType = null !== (_a = null == params ? void 0 : params.newPointAnimateType) && void 0 !== _a ? _a : "grow",
388
- this.clipRangeByDimension = null !== (_b = null == params ? void 0 : params.clipRangeByDimension) && void 0 !== _b ? _b : "x";
389
- }
390
- getPoints(attribute, cache = !1) {
391
- if (attribute.points) return attribute.points;
392
- if (attribute.segments) {
393
- const points = [];
394
- return this.segmentsCache || (this.segmentsCache = []), attribute.segments.map((segment => {
395
- var _a, _b;
396
- segment.points && points.push(...segment.points), cache && this.segmentsCache.push(null !== (_b = null === (_a = segment.points) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0);
397
- })), points;
398
- }
399
- return [];
400
- }
401
- onBind() {
402
- const originFromPoints = this.getPoints(this.from), originToPoints = this.getPoints(this.to, !0);
403
- this.fromPoints = originFromPoints ? Array.isArray(originFromPoints) ? originFromPoints : [ originFromPoints ] : [],
404
- this.toPoints = originToPoints ? Array.isArray(originToPoints) ? originToPoints : [ originToPoints ] : [];
405
- const tagMap = new Map;
406
- this.fromPoints.forEach((point => {
407
- point.context && tagMap.set(point.context, point);
408
- }));
409
- let firstMatchedPoint, lastMatchedPoint, firstMatchedIndex = 1 / 0, lastMatchedIndex = -1 / 0;
410
- for (let i = 0; i < this.toPoints.length; i += 1) if (tagMap.has(this.toPoints[i].context)) {
411
- firstMatchedIndex = i, firstMatchedPoint = tagMap.get(this.toPoints[i].context);
412
- break;
413
- }
414
- for (let i = this.toPoints.length - 1; i >= 0; i -= 1) if (tagMap.has(this.toPoints[i].context)) {
415
- lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
416
- break;
417
- }
418
- "clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension],
419
- 1 === this.clipRange && (this.shrinkClipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension]),
420
- isValidNumber(this.clipRange) ? this.clipRange = clamp(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
421
- let prevMatchedPoint = this.toPoints[0];
422
- this.interpolatePoints = this.toPoints.map(((point, index) => {
423
- const matchedPoint = tagMap.get(point.context);
424
- return matchedPoint ? (prevMatchedPoint = matchedPoint, [ matchedPoint, point ]) : "appear" === this.newPointAnimateType || "clip" === this.newPointAnimateType ? [ point, point ] : index < firstMatchedIndex && firstMatchedPoint ? [ firstMatchedPoint, point ] : index > lastMatchedIndex && lastMatchedPoint ? [ lastMatchedPoint, point ] : [ prevMatchedPoint, point ];
425
- })), this.points = this.interpolatePoints.map((interpolate => {
426
- const fromPoint = interpolate[0], toPoint = interpolate[1], newPoint = new Point(fromPoint.x, fromPoint.y, fromPoint.x1, fromPoint.y1);
427
- return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
428
- }));
429
- }
430
- onFirstRun() {
431
- const lastClipRange = this.target.attribute.clipRange;
432
- isValidNumber(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
433
- }
434
- onUpdate(end, ratio, out) {
435
- if (end) Object.keys(this.to).forEach((k => {
436
- out[k] = this.to[k];
437
- })); else {
438
- if (this.points = this.points.map(((point, index) => {
439
- const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
440
- return newPoint.context = point.context, newPoint;
441
- })), this.clipRange) {
442
- if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints,
443
- out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
444
- out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
445
- }
446
- if (this.segmentsCache && this.to.segments) {
447
- let start = 0;
448
- out.segments = this.to.segments.map(((segment, index) => {
449
- const end = start + this.segmentsCache[index], points = this.points.slice(start, end);
450
- return start = end, Object.assign(Object.assign({}, segment), {
451
- points: points
452
- });
453
- }));
454
- } else out.points = this.points;
455
- }
456
- }
457
- }
458
-
459
- export class GraphicAnimate extends ACustomAnimate {
460
- constructor(from, to, duration, easing, params) {
461
- super(from, to, duration, easing, params), this.graphic = null == params ? void 0 : params.graphic;
462
- }
463
- onUpdate(end, ratio, out) {
464
- this.graphic && Object.keys(this.from).forEach((k => {
465
- out[k] = this.from[k] + (this.to[k] - this.from[k]) * ratio;
466
- }));
467
- }
468
- }
469
-
470
- export class ClipGraphicAnimate extends ACustomAnimate {
471
- constructor(from, to, duration, easing, params) {
472
- super(null, null, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to,
473
- this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
474
- }
475
- onBind() {
476
- this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip,
477
- this._lastPath = this._group.attribute.path, this._group.setAttributes({
478
- clip: !0,
479
- path: [ this._clipGraphic ]
480
- }, !1, {
481
- type: AttributeUpdateType.ANIMATE_BIND
482
- }));
483
- }
484
- onEnd() {
485
- this._group && this._group.setAttributes({
486
- clip: this._lastClip,
487
- path: this._lastPath
488
- }, !1, {
489
- type: AttributeUpdateType.ANIMATE_END
490
- });
491
- }
492
- onUpdate(end, ratio, out) {
493
- if (!this._clipGraphic) return;
494
- const res = {};
495
- Object.keys(this.clipFromAttribute).forEach((k => {
496
- res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;
497
- })), this._clipGraphic.setAttributes(res, !1, {
498
- type: AttributeUpdateType.ANIMATE_UPDATE,
499
- animationState: {
500
- ratio: ratio,
501
- end: end
502
- }
503
- });
504
- }
505
- }
506
-
507
- export class ClipAngleAnimate extends ClipGraphicAnimate {
508
- constructor(from, to, duration, easing, params) {
509
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
510
- const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_c = groupAttribute.width) && void 0 !== _c ? _c : 0, height = null !== (_d = groupAttribute.height) && void 0 !== _d ? _d : 0, animationType = null !== (_e = null == params ? void 0 : params.animationType) && void 0 !== _e ? _e : "in", startAngle = null !== (_f = null == params ? void 0 : params.startAngle) && void 0 !== _f ? _f : 0, orient = null !== (_g = null == params ? void 0 : params.orient) && void 0 !== _g ? _g : "clockwise";
511
- let arcStartAngle = 0, arcEndAngle = 0;
512
- "anticlockwise" === orient ? (arcEndAngle = "in" === animationType ? startAngle + 2 * Math.PI : startAngle,
513
- arcEndAngle = startAngle + 2 * Math.PI) : (arcStartAngle = startAngle, arcEndAngle = "out" === animationType ? startAngle + 2 * Math.PI : startAngle);
514
- const arc = application.graphicService.creator.arc({
515
- x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
516
- y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
517
- outerRadius: null !== (_m = null == params ? void 0 : params.radius) && void 0 !== _m ? _m : (width + height) / 2,
518
- innerRadius: 0,
519
- startAngle: arcStartAngle,
520
- endAngle: arcEndAngle,
521
- fill: !0
522
- });
523
- let fromAttributes, toAttributes;
524
- "anticlockwise" === orient ? (fromAttributes = {
525
- startAngle: startAngle + 2 * Math.PI
526
- }, toAttributes = {
527
- startAngle: startAngle
528
- }) : (fromAttributes = {
529
- endAngle: startAngle
530
- }, toAttributes = {
531
- endAngle: startAngle + 2 * Math.PI
532
- }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
533
- group: null == params ? void 0 : params.group,
534
- clipGraphic: arc
535
- });
536
- }
537
- }
538
-
539
- export class ClipRadiusAnimate extends ClipGraphicAnimate {
540
- constructor(from, to, duration, easing, params) {
541
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
542
- const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_c = groupAttribute.width) && void 0 !== _c ? _c : 0, height = null !== (_d = groupAttribute.height) && void 0 !== _d ? _d : 0, animationType = null !== (_e = null == params ? void 0 : params.animationType) && void 0 !== _e ? _e : "in", startRadius = null !== (_f = null == params ? void 0 : params.startRadius) && void 0 !== _f ? _f : 0, endRadius = null !== (_g = null == params ? void 0 : params.endRadius) && void 0 !== _g ? _g : Math.sqrt((width / 2) ** 2 + (height / 2) ** 2), arc = application.graphicService.creator.arc({
543
- x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
544
- y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
545
- outerRadius: "out" === animationType ? endRadius : startRadius,
546
- innerRadius: 0,
547
- startAngle: 0,
548
- endAngle: 2 * Math.PI,
549
- fill: !0
550
- }), fromAttributes = {
551
- outerRadius: startRadius
552
- }, toAttributes = {
553
- outerRadius: endRadius
554
- };
555
- super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
556
- group: null == params ? void 0 : params.group,
557
- clipGraphic: arc
558
- });
559
- }
560
- }
561
-
562
- export class ClipDirectionAnimate extends ClipGraphicAnimate {
563
- constructor(from, to, duration, easing, params) {
564
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
565
- const groupAttribute = null !== (_b = null === (_a = null == params ? void 0 : params.group) || void 0 === _a ? void 0 : _a.attribute) && void 0 !== _b ? _b : {}, width = null !== (_d = null !== (_c = null == params ? void 0 : params.width) && void 0 !== _c ? _c : groupAttribute.width) && void 0 !== _d ? _d : 0, height = null !== (_f = null !== (_e = null == params ? void 0 : params.height) && void 0 !== _e ? _e : groupAttribute.height) && void 0 !== _f ? _f : 0, animationType = null !== (_g = null == params ? void 0 : params.animationType) && void 0 !== _g ? _g : "in", direction = null !== (_h = null == params ? void 0 : params.direction) && void 0 !== _h ? _h : "x", orient = null !== (_j = null == params ? void 0 : params.orient) && void 0 !== _j ? _j : "positive", rect = application.graphicService.creator.rect({
566
- x: 0,
567
- y: 0,
568
- width: "in" === animationType && "x" === direction ? 0 : width,
569
- height: "in" === animationType && "y" === direction ? 0 : height,
570
- fill: !0
571
- });
572
- let fromAttributes = {}, toAttributes = {};
573
- "y" === direction ? "negative" === orient ? (fromAttributes = {
574
- y: height,
575
- height: 0
576
- }, toAttributes = {
577
- y: 0,
578
- height: height
579
- }) : (fromAttributes = {
580
- height: 0
581
- }, toAttributes = {
582
- height: height
583
- }) : "negative" === orient ? (fromAttributes = {
584
- x: width,
585
- width: 0
586
- }, toAttributes = {
587
- x: 0,
588
- width: width
589
- }) : (fromAttributes = {
590
- width: 0
591
- }, toAttributes = {
592
- width: width
593
- }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
594
- group: null == params ? void 0 : params.group,
595
- clipGraphic: rect
596
- });
597
- }
598
- }
599
-
600
- export class RotateBySphereAnimate extends ACustomAnimate {
601
- onStart() {
602
- const {center: center, r: r} = "function" == typeof this.params ? this.params() : this.params, startX = this.target.getComputedAttribute("x"), startY = this.target.getComputedAttribute("y"), startZ = this.target.getComputedAttribute("z"), phi = Math.acos((startY - center.y) / r);
603
- let theta = Math.acos((startX - center.x) / r / Math.sin(phi));
604
- startZ - center.z < 0 && (theta = pi2 - theta), this.theta = theta, this.phi = phi;
605
- }
606
- onBind() {}
607
- onEnd() {}
608
- onUpdate(end, ratio, out) {
609
- if (null == this.phi || null == this.theta) return;
610
- const {center: center, r: r, cb: cb} = "function" == typeof this.params ? this.params() : this.params, deltaAngle = 2 * Math.PI * ratio, theta = this.theta + deltaAngle, phi = this.phi, x = r * Math.sin(phi) * Math.cos(theta) + center.x, y = r * Math.cos(phi) + center.y, z = r * Math.sin(phi) * Math.sin(theta) + center.z;
611
- for (out.x = x, out.y = y, out.z = z, out.alpha = theta + pi / 2; out.alpha > pi2; ) out.alpha -= pi2;
612
- out.alpha = pi2 - out.alpha, out.zIndex = -1e4 * out.z, cb && cb(out);
613
- }
614
- }
615
-
616
- export class AttributeAnimate extends ACustomAnimate {
617
- constructor(to, duration, easing) {
618
- super({}, to, duration, easing);
619
- }
620
- getEndProps() {
621
- return this.to;
622
- }
623
- onBind() {
624
- Object.keys(this.to).forEach((k => {
625
- this.from[k] = this.target.getComputedAttribute(k);
626
- }));
627
- }
628
- onEnd() {}
629
- onUpdate(end, ratio, out) {
630
- this.target.stepInterpolate(this.subAnimate, this.subAnimate.animate, out, this.step, ratio, end, this.to, this.from);
631
- }
632
- }
633
-
634
- export class AnimateGroup extends ACustomAnimate {
635
- constructor(duration, customAnimates) {
636
- super(null, null, duration, "linear"), this.customAnimates = customAnimates;
637
- }
638
- initAnimates() {
639
- this.customAnimates.forEach((a => {
640
- a.step = this.step, a.subAnimate = this.subAnimate, a.target = this.target;
641
- }));
642
- }
643
- getEndProps() {
644
- const props = {};
645
- return this.customAnimates.forEach((a => {
646
- Object.assign(props, a.getEndProps());
647
- })), props;
648
- }
649
- onBind() {
650
- this.initAnimates(), this.customAnimates.forEach((a => {
651
- a.onBind();
652
- }));
653
- }
654
- onEnd() {
655
- this.customAnimates.forEach((a => {
656
- a.onEnd();
657
- }));
658
- }
659
- onStart() {
660
- this.customAnimates.forEach((a => {
661
- a.onStart();
662
- }));
663
- }
664
- onUpdate(end, ratio, out) {
665
- this.updating || (this.updating = !0, this.customAnimates.forEach((a => {
666
- const easing = a.easing, easingFunc = "string" == typeof easing ? Easing[easing] : easing;
667
- ratio = easingFunc(ratio), a.onUpdate(end, ratio, out);
668
- })), this.updating = !1);
669
- }
670
- }
671
-
672
- export class AnimateGroup1 extends ACustomAnimate {
673
- constructor(duration, customAnimates) {
674
- super(null, null, duration, "linear"), this.customAnimates = customAnimates;
675
- }
676
- initAnimates() {
677
- this.customAnimates.forEach((a => {
678
- a.step = this.step, a.subAnimate = this.subAnimate, a.target = this.target;
679
- }));
680
- }
681
- getEndProps() {
682
- const props = {};
683
- return this.customAnimates.forEach((a => {
684
- Object.assign(props, a.getEndProps());
685
- })), props;
686
- }
687
- onBind() {
688
- this.initAnimates(), this.customAnimates.forEach((a => {
689
- a.onBind();
690
- }));
691
- }
692
- onEnd() {
693
- this.customAnimates.forEach((a => {
694
- a.onEnd();
695
- }));
696
- }
697
- onUpdate(end, ratio, out) {
698
- this.updating || (this.updating = !0, this.customAnimates.forEach((a => {
699
- const easing = a.easing, easingFunc = "string" == typeof easing ? Easing[easing] : easing;
700
- ratio = easingFunc(ratio), a.onUpdate(end, ratio, out);
701
- })), this.updating = !1);
702
- }
703
- }