@visactor/vrender-animate 0.22.4

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 (303) hide show
  1. package/README.md +177 -0
  2. package/cjs/animate-extension.d.ts +15 -0
  3. package/cjs/animate-extension.js +46 -0
  4. package/cjs/animate-extension.js.map +1 -0
  5. package/cjs/animate.d.ts +71 -0
  6. package/cjs/animate.js +210 -0
  7. package/cjs/animate.js.map +1 -0
  8. package/cjs/custom/clip-graphic.d.ts +53 -0
  9. package/cjs/custom/clip-graphic.js +146 -0
  10. package/cjs/custom/clip-graphic.js.map +1 -0
  11. package/cjs/custom/clip.d.ts +13 -0
  12. package/cjs/custom/clip.js +24 -0
  13. package/cjs/custom/clip.js.map +1 -0
  14. package/cjs/custom/common.d.ts +22 -0
  15. package/cjs/custom/common.js +58 -0
  16. package/cjs/custom/common.js.map +1 -0
  17. package/cjs/custom/custom-animate.d.ts +15 -0
  18. package/cjs/custom/custom-animate.js +25 -0
  19. package/cjs/custom/custom-animate.js.map +1 -0
  20. package/cjs/custom/fade.d.ts +13 -0
  21. package/cjs/custom/fade.js +24 -0
  22. package/cjs/custom/fade.js.map +1 -0
  23. package/cjs/custom/group-fade.d.ts +16 -0
  24. package/cjs/custom/group-fade.js +66 -0
  25. package/cjs/custom/group-fade.js.map +1 -0
  26. package/cjs/custom/growAngle.d.ts +37 -0
  27. package/cjs/custom/growAngle.js +140 -0
  28. package/cjs/custom/growAngle.js.map +1 -0
  29. package/cjs/custom/growCenter.d.ts +17 -0
  30. package/cjs/custom/growCenter.js +161 -0
  31. package/cjs/custom/growCenter.js.map +1 -0
  32. package/cjs/custom/growHeight.d.ts +36 -0
  33. package/cjs/custom/growHeight.js +154 -0
  34. package/cjs/custom/growHeight.js.map +1 -0
  35. package/cjs/custom/growPoints.d.ts +52 -0
  36. package/cjs/custom/growPoints.js +227 -0
  37. package/cjs/custom/growPoints.js.map +1 -0
  38. package/cjs/custom/growRadius.d.ts +41 -0
  39. package/cjs/custom/growRadius.js +113 -0
  40. package/cjs/custom/growRadius.js.map +1 -0
  41. package/cjs/custom/growWidth.d.ts +36 -0
  42. package/cjs/custom/growWidth.js +154 -0
  43. package/cjs/custom/growWidth.js.map +1 -0
  44. package/cjs/custom/input-text.d.ts +29 -0
  45. package/cjs/custom/input-text.js +45 -0
  46. package/cjs/custom/input-text.js.map +1 -0
  47. package/cjs/custom/number.d.ts +25 -0
  48. package/cjs/custom/number.js +102 -0
  49. package/cjs/custom/number.js.map +1 -0
  50. package/cjs/custom/register.d.ts +1 -0
  51. package/cjs/custom/register.js +35 -0
  52. package/cjs/custom/register.js.map +1 -0
  53. package/cjs/custom/scale-in.d.ts +13 -0
  54. package/cjs/custom/scale-in.js +57 -0
  55. package/cjs/custom/scale-in.js.map +1 -0
  56. package/cjs/custom/scale.d.ts +20 -0
  57. package/cjs/custom/scale.js +106 -0
  58. package/cjs/custom/scale.js.map +1 -0
  59. package/cjs/custom/sphere.d.ts +20 -0
  60. package/cjs/custom/sphere.js +26 -0
  61. package/cjs/custom/sphere.js.map +1 -0
  62. package/cjs/custom/state.d.ts +13 -0
  63. package/cjs/custom/state.js +25 -0
  64. package/cjs/custom/state.js.map +1 -0
  65. package/cjs/custom/tag-points.d.ts +26 -0
  66. package/cjs/custom/tag-points.js +81 -0
  67. package/cjs/custom/tag-points.js.map +1 -0
  68. package/cjs/custom/update.d.ts +14 -0
  69. package/cjs/custom/update.js +26 -0
  70. package/cjs/custom/update.js.map +1 -0
  71. package/cjs/executor/animate-executor.d.ts +36 -0
  72. package/cjs/executor/animate-executor.js +177 -0
  73. package/cjs/executor/animate-executor.js.map +1 -0
  74. package/cjs/executor/executor.d.ts +69 -0
  75. package/cjs/executor/executor.js +6 -0
  76. package/cjs/executor/executor.js.map +1 -0
  77. package/cjs/index.d.ts +25 -0
  78. package/cjs/index.js +214 -0
  79. package/cjs/index.js.map +1 -0
  80. package/cjs/interpolate/executor.d.ts +66 -0
  81. package/cjs/interpolate/executor.js +6 -0
  82. package/cjs/interpolate/executor.js.map +1 -0
  83. package/cjs/interpolate/number.d.ts +1 -0
  84. package/cjs/interpolate/number.js +10 -0
  85. package/cjs/interpolate/number.js.map +1 -0
  86. package/cjs/interpolate/store.d.ts +32 -0
  87. package/cjs/interpolate/store.js +96 -0
  88. package/cjs/interpolate/store.js.map +1 -0
  89. package/cjs/intreface/animate.d.ts +91 -0
  90. package/cjs/intreface/animate.js +10 -0
  91. package/cjs/intreface/animate.js.map +1 -0
  92. package/cjs/intreface/easing.d.ts +3 -0
  93. package/cjs/intreface/easing.js +6 -0
  94. package/cjs/intreface/easing.js.map +1 -0
  95. package/cjs/intreface/state.d.ts +35 -0
  96. package/cjs/intreface/state.js +6 -0
  97. package/cjs/intreface/state.js.map +1 -0
  98. package/cjs/intreface/ticker.d.ts +37 -0
  99. package/cjs/intreface/ticker.js +10 -0
  100. package/cjs/intreface/ticker.js.map +1 -0
  101. package/cjs/intreface/timeline.d.ts +17 -0
  102. package/cjs/intreface/timeline.js +6 -0
  103. package/cjs/intreface/timeline.js.map +1 -0
  104. package/cjs/intreface/type.d.ts +13 -0
  105. package/cjs/intreface/type.js +15 -0
  106. package/cjs/intreface/type.js.map +1 -0
  107. package/cjs/register.d.ts +1 -0
  108. package/cjs/register.js +19 -0
  109. package/cjs/register.js.map +1 -0
  110. package/cjs/state/animation-state-machine.d.ts +22 -0
  111. package/cjs/state/animation-state-machine.js +53 -0
  112. package/cjs/state/animation-state-machine.js.map +1 -0
  113. package/cjs/state/animation-state-queue.d.ts +24 -0
  114. package/cjs/state/animation-state-queue.js +66 -0
  115. package/cjs/state/animation-state-queue.js.map +1 -0
  116. package/cjs/state/animation-state-registry.d.ts +14 -0
  117. package/cjs/state/animation-state-registry.js +53 -0
  118. package/cjs/state/animation-state-registry.js.map +1 -0
  119. package/cjs/state/animation-state.d.ts +25 -0
  120. package/cjs/state/animation-state.js +80 -0
  121. package/cjs/state/animation-state.js.map +1 -0
  122. package/cjs/state/animation-states-registry.d.ts +17 -0
  123. package/cjs/state/animation-states-registry.js +95 -0
  124. package/cjs/state/animation-states-registry.js.map +1 -0
  125. package/cjs/state/graphic-extension.d.ts +12 -0
  126. package/cjs/state/graphic-extension.js +37 -0
  127. package/cjs/state/graphic-extension.js.map +1 -0
  128. package/cjs/state/index.d.ts +3 -0
  129. package/cjs/state/index.js +22 -0
  130. package/cjs/state/index.js.map +1 -0
  131. package/cjs/state/types.d.ts +11 -0
  132. package/cjs/state/types.js +6 -0
  133. package/cjs/state/types.js.map +1 -0
  134. package/cjs/step.d.ts +49 -0
  135. package/cjs/step.js +124 -0
  136. package/cjs/step.js.map +1 -0
  137. package/cjs/ticker/default-ticker.d.ts +39 -0
  138. package/cjs/ticker/default-ticker.js +133 -0
  139. package/cjs/ticker/default-ticker.js.map +1 -0
  140. package/cjs/ticker/manual-ticker.d.ts +6 -0
  141. package/cjs/ticker/manual-ticker.js +37 -0
  142. package/cjs/ticker/manual-ticker.js.map +1 -0
  143. package/cjs/timeline.d.ts +34 -0
  144. package/cjs/timeline.js +84 -0
  145. package/cjs/timeline.js.map +1 -0
  146. package/cjs/utils/easing-func.d.ts +1 -0
  147. package/cjs/utils/easing-func.js +16 -0
  148. package/cjs/utils/easing-func.js.map +1 -0
  149. package/cjs/utils/easing.d.ts +49 -0
  150. package/cjs/utils/easing.js +141 -0
  151. package/cjs/utils/easing.js.map +1 -0
  152. package/dist/index.es.js +3824 -0
  153. package/es/animate-extension.d.ts +15 -0
  154. package/es/animate-extension.js +42 -0
  155. package/es/animate-extension.js.map +1 -0
  156. package/es/animate.d.ts +71 -0
  157. package/es/animate.js +207 -0
  158. package/es/animate.js.map +1 -0
  159. package/es/custom/clip-graphic.d.ts +53 -0
  160. package/es/custom/clip-graphic.js +134 -0
  161. package/es/custom/clip-graphic.js.map +1 -0
  162. package/es/custom/clip.d.ts +13 -0
  163. package/es/custom/clip.js +14 -0
  164. package/es/custom/clip.js.map +1 -0
  165. package/es/custom/common.d.ts +22 -0
  166. package/es/custom/common.js +48 -0
  167. package/es/custom/common.js.map +1 -0
  168. package/es/custom/custom-animate.d.ts +15 -0
  169. package/es/custom/custom-animate.js +17 -0
  170. package/es/custom/custom-animate.js.map +1 -0
  171. package/es/custom/fade.d.ts +13 -0
  172. package/es/custom/fade.js +14 -0
  173. package/es/custom/fade.js.map +1 -0
  174. package/es/custom/group-fade.d.ts +16 -0
  175. package/es/custom/group-fade.js +56 -0
  176. package/es/custom/group-fade.js.map +1 -0
  177. package/es/custom/growAngle.d.ts +37 -0
  178. package/es/custom/growAngle.js +132 -0
  179. package/es/custom/growAngle.js.map +1 -0
  180. package/es/custom/growCenter.d.ts +17 -0
  181. package/es/custom/growCenter.js +155 -0
  182. package/es/custom/growCenter.js.map +1 -0
  183. package/es/custom/growHeight.d.ts +36 -0
  184. package/es/custom/growHeight.js +144 -0
  185. package/es/custom/growHeight.js.map +1 -0
  186. package/es/custom/growPoints.d.ts +52 -0
  187. package/es/custom/growPoints.js +219 -0
  188. package/es/custom/growPoints.js.map +1 -0
  189. package/es/custom/growRadius.d.ts +41 -0
  190. package/es/custom/growRadius.js +105 -0
  191. package/es/custom/growRadius.js.map +1 -0
  192. package/es/custom/growWidth.d.ts +36 -0
  193. package/es/custom/growWidth.js +144 -0
  194. package/es/custom/growWidth.js.map +1 -0
  195. package/es/custom/input-text.d.ts +29 -0
  196. package/es/custom/input-text.js +37 -0
  197. package/es/custom/input-text.js.map +1 -0
  198. package/es/custom/number.d.ts +25 -0
  199. package/es/custom/number.js +94 -0
  200. package/es/custom/number.js.map +1 -0
  201. package/es/custom/register.d.ts +1 -0
  202. package/es/custom/register.js +39 -0
  203. package/es/custom/register.js.map +1 -0
  204. package/es/custom/scale-in.d.ts +13 -0
  205. package/es/custom/scale-in.js +49 -0
  206. package/es/custom/scale-in.js.map +1 -0
  207. package/es/custom/scale.d.ts +20 -0
  208. package/es/custom/scale.js +96 -0
  209. package/es/custom/scale.js.map +1 -0
  210. package/es/custom/sphere.d.ts +20 -0
  211. package/es/custom/sphere.js +20 -0
  212. package/es/custom/sphere.js.map +1 -0
  213. package/es/custom/state.d.ts +13 -0
  214. package/es/custom/state.js +17 -0
  215. package/es/custom/state.js.map +1 -0
  216. package/es/custom/tag-points.d.ts +26 -0
  217. package/es/custom/tag-points.js +77 -0
  218. package/es/custom/tag-points.js.map +1 -0
  219. package/es/custom/update.d.ts +14 -0
  220. package/es/custom/update.js +18 -0
  221. package/es/custom/update.js.map +1 -0
  222. package/es/executor/animate-executor.d.ts +36 -0
  223. package/es/executor/animate-executor.js +169 -0
  224. package/es/executor/animate-executor.js.map +1 -0
  225. package/es/executor/executor.d.ts +69 -0
  226. package/es/executor/executor.js +2 -0
  227. package/es/executor/executor.js.map +1 -0
  228. package/es/index.d.ts +25 -0
  229. package/es/index.js +50 -0
  230. package/es/index.js.map +1 -0
  231. package/es/interpolate/executor.d.ts +66 -0
  232. package/es/interpolate/executor.js +2 -0
  233. package/es/interpolate/executor.js.map +1 -0
  234. package/es/interpolate/number.d.ts +1 -0
  235. package/es/interpolate/number.js +4 -0
  236. package/es/interpolate/number.js.map +1 -0
  237. package/es/interpolate/store.d.ts +32 -0
  238. package/es/interpolate/store.js +88 -0
  239. package/es/interpolate/store.js.map +1 -0
  240. package/es/intreface/animate.d.ts +91 -0
  241. package/es/intreface/animate.js +6 -0
  242. package/es/intreface/animate.js.map +1 -0
  243. package/es/intreface/easing.d.ts +3 -0
  244. package/es/intreface/easing.js +2 -0
  245. package/es/intreface/easing.js.map +1 -0
  246. package/es/intreface/state.d.ts +35 -0
  247. package/es/intreface/state.js +2 -0
  248. package/es/intreface/state.js.map +1 -0
  249. package/es/intreface/ticker.d.ts +37 -0
  250. package/es/intreface/ticker.js +6 -0
  251. package/es/intreface/ticker.js.map +1 -0
  252. package/es/intreface/timeline.d.ts +17 -0
  253. package/es/intreface/timeline.js +2 -0
  254. package/es/intreface/timeline.js.map +1 -0
  255. package/es/intreface/type.d.ts +13 -0
  256. package/es/intreface/type.js +14 -0
  257. package/es/intreface/type.js.map +1 -0
  258. package/es/register.d.ts +1 -0
  259. package/es/register.js +20 -0
  260. package/es/register.js.map +1 -0
  261. package/es/state/animation-state-machine.d.ts +22 -0
  262. package/es/state/animation-state-machine.js +47 -0
  263. package/es/state/animation-state-machine.js.map +1 -0
  264. package/es/state/animation-state-queue.d.ts +24 -0
  265. package/es/state/animation-state-queue.js +58 -0
  266. package/es/state/animation-state-queue.js.map +1 -0
  267. package/es/state/animation-state-registry.d.ts +14 -0
  268. package/es/state/animation-state-registry.js +45 -0
  269. package/es/state/animation-state-registry.js.map +1 -0
  270. package/es/state/animation-state.d.ts +25 -0
  271. package/es/state/animation-state.js +72 -0
  272. package/es/state/animation-state.js.map +1 -0
  273. package/es/state/animation-states-registry.d.ts +17 -0
  274. package/es/state/animation-states-registry.js +87 -0
  275. package/es/state/animation-states-registry.js.map +1 -0
  276. package/es/state/graphic-extension.d.ts +12 -0
  277. package/es/state/graphic-extension.js +29 -0
  278. package/es/state/graphic-extension.js.map +1 -0
  279. package/es/state/index.d.ts +3 -0
  280. package/es/state/index.js +6 -0
  281. package/es/state/index.js.map +1 -0
  282. package/es/state/types.d.ts +11 -0
  283. package/es/state/types.js +2 -0
  284. package/es/state/types.js.map +1 -0
  285. package/es/step.d.ts +49 -0
  286. package/es/step.js +120 -0
  287. package/es/step.js.map +1 -0
  288. package/es/ticker/default-ticker.d.ts +39 -0
  289. package/es/ticker/default-ticker.js +129 -0
  290. package/es/ticker/default-ticker.js.map +1 -0
  291. package/es/ticker/manual-ticker.d.ts +6 -0
  292. package/es/ticker/manual-ticker.js +29 -0
  293. package/es/ticker/manual-ticker.js.map +1 -0
  294. package/es/timeline.d.ts +34 -0
  295. package/es/timeline.js +79 -0
  296. package/es/timeline.js.map +1 -0
  297. package/es/utils/easing-func.d.ts +1 -0
  298. package/es/utils/easing-func.js +8 -0
  299. package/es/utils/easing-func.js.map +1 -0
  300. package/es/utils/easing.d.ts +49 -0
  301. package/es/utils/easing.js +134 -0
  302. package/es/utils/easing.js.map +1 -0
  303. package/package.json +72 -0
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.ClipDirectionAnimate = exports.ClipRadiusAnimate = exports.ClipAngleAnimate = exports.ClipGraphicAnimate = void 0;
6
+
7
+ const vrender_core_1 = require("@visactor/vrender-core"), custom_animate_1 = require("./custom-animate");
8
+
9
+ class ClipGraphicAnimate extends custom_animate_1.ACustomAnimate {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(null, null, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to,
12
+ this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
13
+ }
14
+ onBind() {
15
+ this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip,
16
+ this._lastPath = this._group.attribute.path, this._group.setAttributes({
17
+ clip: !0,
18
+ path: [ this._clipGraphic ]
19
+ }, !1, {
20
+ type: vrender_core_1.AttributeUpdateType.ANIMATE_BIND
21
+ }));
22
+ }
23
+ onEnd() {
24
+ this._group && this._group.setAttributes({
25
+ clip: this._lastClip,
26
+ path: this._lastPath
27
+ }, !1, {
28
+ type: vrender_core_1.AttributeUpdateType.ANIMATE_END
29
+ });
30
+ }
31
+ onUpdate(end, ratio, out) {
32
+ if (!this._clipGraphic) return;
33
+ const res = {};
34
+ Object.keys(this.clipFromAttribute).forEach((k => {
35
+ res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;
36
+ })), this._clipGraphic.setAttributes(res, !1, {
37
+ type: vrender_core_1.AttributeUpdateType.ANIMATE_UPDATE,
38
+ animationState: {
39
+ ratio: ratio,
40
+ end: end
41
+ }
42
+ });
43
+ }
44
+ }
45
+
46
+ exports.ClipGraphicAnimate = ClipGraphicAnimate;
47
+
48
+ class ClipAngleAnimate extends ClipGraphicAnimate {
49
+ constructor(from, to, duration, easing, params) {
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
51
+ 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";
52
+ let arcStartAngle = 0, arcEndAngle = 0;
53
+ "anticlockwise" === orient ? (arcEndAngle = "in" === animationType ? startAngle + 2 * Math.PI : startAngle,
54
+ arcEndAngle = startAngle + 2 * Math.PI) : (arcStartAngle = startAngle, arcEndAngle = "out" === animationType ? startAngle + 2 * Math.PI : startAngle);
55
+ const arc = vrender_core_1.application.graphicService.creator.arc({
56
+ x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
57
+ y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
58
+ outerRadius: null !== (_m = null == params ? void 0 : params.radius) && void 0 !== _m ? _m : (width + height) / 2,
59
+ innerRadius: 0,
60
+ startAngle: arcStartAngle,
61
+ endAngle: arcEndAngle,
62
+ fill: !0
63
+ });
64
+ let fromAttributes, toAttributes;
65
+ "anticlockwise" === orient ? (fromAttributes = {
66
+ startAngle: startAngle + 2 * Math.PI
67
+ }, toAttributes = {
68
+ startAngle: startAngle
69
+ }) : (fromAttributes = {
70
+ endAngle: startAngle
71
+ }, toAttributes = {
72
+ endAngle: startAngle + 2 * Math.PI
73
+ }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
74
+ group: null == params ? void 0 : params.group,
75
+ clipGraphic: arc
76
+ });
77
+ }
78
+ }
79
+
80
+ exports.ClipAngleAnimate = ClipAngleAnimate;
81
+
82
+ class ClipRadiusAnimate extends ClipGraphicAnimate {
83
+ constructor(from, to, duration, easing, params) {
84
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
85
+ 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 = vrender_core_1.application.graphicService.creator.arc({
86
+ x: null !== (_j = null === (_h = null == params ? void 0 : params.center) || void 0 === _h ? void 0 : _h.x) && void 0 !== _j ? _j : width / 2,
87
+ y: null !== (_l = null === (_k = null == params ? void 0 : params.center) || void 0 === _k ? void 0 : _k.y) && void 0 !== _l ? _l : height / 2,
88
+ outerRadius: "out" === animationType ? endRadius : startRadius,
89
+ innerRadius: 0,
90
+ startAngle: 0,
91
+ endAngle: 2 * Math.PI,
92
+ fill: !0
93
+ }), fromAttributes = {
94
+ outerRadius: startRadius
95
+ }, toAttributes = {
96
+ outerRadius: endRadius
97
+ };
98
+ super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
99
+ group: null == params ? void 0 : params.group,
100
+ clipGraphic: arc
101
+ });
102
+ }
103
+ }
104
+
105
+ exports.ClipRadiusAnimate = ClipRadiusAnimate;
106
+
107
+ class ClipDirectionAnimate extends ClipGraphicAnimate {
108
+ constructor(from, to, duration, easing, params) {
109
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
110
+ 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 = vrender_core_1.application.graphicService.creator.rect({
111
+ x: 0,
112
+ y: 0,
113
+ width: "in" === animationType && "x" === direction ? 0 : width,
114
+ height: "in" === animationType && "y" === direction ? 0 : height,
115
+ fill: !0
116
+ });
117
+ let fromAttributes = {}, toAttributes = {};
118
+ "y" === direction ? "negative" === orient ? (fromAttributes = {
119
+ y: height,
120
+ height: 0
121
+ }, toAttributes = {
122
+ y: 0,
123
+ height: height
124
+ }) : (fromAttributes = {
125
+ height: 0
126
+ }, toAttributes = {
127
+ height: height
128
+ }) : "negative" === orient ? (fromAttributes = {
129
+ x: width,
130
+ width: 0
131
+ }, toAttributes = {
132
+ x: 0,
133
+ width: width
134
+ }) : (fromAttributes = {
135
+ width: 0
136
+ }, toAttributes = {
137
+ width: width
138
+ }), super("in" === animationType ? fromAttributes : toAttributes, "in" === animationType ? toAttributes : fromAttributes, duration, easing, {
139
+ group: null == params ? void 0 : params.group,
140
+ clipGraphic: rect
141
+ });
142
+ }
143
+ }
144
+
145
+ exports.ClipDirectionAnimate = ClipDirectionAnimate;
146
+ //# sourceMappingURL=clip-graphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/clip-graphic.ts"],"names":[],"mappings":";;;AACA,yDAA0E;AAC1E,qDAAkD;AAGl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AM,EAAE,MAAM,EAAE,CAAC;aACnC;SACF;aAAM;YACL,IAAI,MAAM,KAAK,UAAU,EAAE;gBACzB,cAAc,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBACxC,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACvC;iBAAM;gBACL,cAAc,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC9B,YAAY,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACjC;SACF;QACD,KAAK,CACH,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,EACtD,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EACtD,QAAQ,EACR,MAAM,EACN,EAAE,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF;AAzDD,oDAyDC","file":"clip-graphic.js","sourcesContent":["import type { IArcGraphicAttribute, IGraphic, IGroup, IRectGraphicAttribute } from '@visactor/vrender-core';\nimport { application, AttributeUpdateType } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\nimport type { EasingType } from '../intreface/easing';\n\nexport class ClipGraphicAnimate extends ACustomAnimate<any> {\n private _group?: IGroup;\n private _clipGraphic?: IGraphic;\n protected clipFromAttribute?: any;\n protected clipToAttribute?: any;\n\n private _lastClip?: boolean;\n private _lastPath?: IGraphic[];\n\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: { group: IGroup; clipGraphic: IGraphic }\n ) {\n super(null, null, duration, easing, params);\n this.clipFromAttribute = from;\n this.clipToAttribute = to;\n this._group = params?.group;\n this._clipGraphic = params?.clipGraphic;\n }\n\n onBind() {\n if (this._group && this._clipGraphic) {\n this._lastClip = this._group.attribute.clip;\n this._lastPath = this._group.attribute.path;\n this._group.setAttributes(\n {\n clip: true,\n path: [this._clipGraphic]\n },\n false,\n { type: AttributeUpdateType.ANIMATE_BIND }\n );\n }\n }\n\n onEnd() {\n if (this._group) {\n this._group.setAttributes(\n {\n clip: this._lastClip,\n path: this._lastPath\n },\n false,\n { type: AttributeUpdateType.ANIMATE_END }\n );\n }\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n if (!this._clipGraphic) {\n return;\n }\n const res: any = {};\n Object.keys(this.clipFromAttribute).forEach(k => {\n res[k] = this.clipFromAttribute[k] + (this.clipToAttribute[k] - this.clipFromAttribute[k]) * ratio;\n });\n this._clipGraphic.setAttributes(res, false, {\n type: AttributeUpdateType.ANIMATE_UPDATE,\n animationState: { ratio, end }\n });\n }\n}\n\nexport class ClipAngleAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startAngle?: number;\n radius?: number;\n orient?: 'clockwise' | 'anticlockwise';\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startAngle = params?.startAngle ?? 0;\n const orient = params?.orient ?? 'clockwise';\n\n let arcStartAngle = 0;\n let arcEndAngle = 0;\n if (orient === 'anticlockwise') {\n arcEndAngle = animationType === 'in' ? startAngle + Math.PI * 2 : startAngle;\n arcEndAngle = startAngle + Math.PI * 2;\n } else {\n arcStartAngle = startAngle;\n arcEndAngle = animationType === 'out' ? startAngle + Math.PI * 2 : startAngle;\n }\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: params?.radius ?? (width + height) / 2,\n innerRadius: 0,\n startAngle: arcStartAngle,\n endAngle: arcEndAngle,\n fill: true\n });\n let fromAttributes: Partial<IArcGraphicAttribute>;\n let toAttributes: Partial<IArcGraphicAttribute>;\n if (orient === 'anticlockwise') {\n fromAttributes = { startAngle: startAngle + Math.PI * 2 };\n toAttributes = { startAngle: startAngle };\n } else {\n fromAttributes = { endAngle: startAngle };\n toAttributes = { endAngle: startAngle + Math.PI * 2 };\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipRadiusAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n center?: { x: number; y: number };\n startRadius?: number;\n endRadius?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = groupAttribute.width ?? 0;\n const height = groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const startRadius = params?.startRadius ?? 0;\n const endRadius = params?.endRadius ?? Math.sqrt((width / 2) ** 2 + (height / 2) ** 2);\n\n const arc = application.graphicService.creator.arc({\n x: params?.center?.x ?? width / 2,\n y: params?.center?.y ?? height / 2,\n outerRadius: animationType === 'out' ? endRadius : startRadius,\n innerRadius: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n fill: true\n });\n const fromAttributes: Partial<IArcGraphicAttribute> = { outerRadius: startRadius };\n const toAttributes: Partial<IArcGraphicAttribute> = { outerRadius: endRadius };\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: arc }\n );\n }\n}\n\nexport class ClipDirectionAnimate extends ClipGraphicAnimate {\n constructor(\n from: any,\n to: any,\n duration: number,\n easing: EasingType,\n params: {\n group: IGroup;\n direction?: 'x' | 'y';\n orient?: 'positive' | 'negative';\n width?: number;\n height?: number;\n animationType?: 'in' | 'out';\n }\n ) {\n const groupAttribute = params?.group?.attribute ?? {};\n const width = params?.width ?? groupAttribute.width ?? 0;\n const height = params?.height ?? groupAttribute.height ?? 0;\n\n const animationType = params?.animationType ?? 'in';\n const direction = params?.direction ?? 'x';\n const orient = params?.orient ?? 'positive';\n\n const rect = application.graphicService.creator.rect({\n x: 0,\n y: 0,\n width: animationType === 'in' && direction === 'x' ? 0 : width,\n height: animationType === 'in' && direction === 'y' ? 0 : height,\n fill: true\n });\n let fromAttributes: Partial<IRectGraphicAttribute> = {};\n let toAttributes: Partial<IRectGraphicAttribute> = {};\n if (direction === 'y') {\n if (orient === 'negative') {\n fromAttributes = { y: height, height: 0 };\n toAttributes = { y: 0, height: height };\n } else {\n fromAttributes = { height: 0 };\n toAttributes = { height: height };\n }\n } else {\n if (orient === 'negative') {\n fromAttributes = { x: width, width: 0 };\n toAttributes = { x: 0, width: width };\n } else {\n fromAttributes = { width: 0 };\n toAttributes = { width: width };\n }\n }\n super(\n animationType === 'in' ? fromAttributes : toAttributes,\n animationType === 'in' ? toAttributes : fromAttributes,\n duration,\n easing,\n { group: params?.group, clipGraphic: rect }\n );\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { EasingType } from '../intreface/easing';
2
+ import { CommonIn, CommonOut } from './common';
3
+ export interface IScaleAnimationOptions {
4
+ direction?: 'x' | 'y' | 'xy';
5
+ }
6
+ export declare class ClipIn extends CommonIn {
7
+ valid: boolean;
8
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
9
+ }
10
+ export declare class ClipOut extends CommonOut {
11
+ valid: boolean;
12
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
13
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.ClipOut = exports.ClipIn = void 0;
6
+
7
+ const common_1 = require("./common");
8
+
9
+ class ClipIn extends common_1.CommonIn {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params), this.keys = [ "clipRange" ];
12
+ }
13
+ }
14
+
15
+ exports.ClipIn = ClipIn;
16
+
17
+ class ClipOut extends common_1.CommonOut {
18
+ constructor(from, to, duration, easing, params) {
19
+ super(from, to, duration, easing, params), this.keys = [ "clipRange" ];
20
+ }
21
+ }
22
+
23
+ exports.ClipOut = ClipOut;
24
+ //# sourceMappingURL=clip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/clip.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,wBAOC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,0BAOC","file":"clip.js","sourcesContent":["import type { EasingType } from '../intreface/easing';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class ClipIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\n }\n}\n\nexport class ClipOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['clipRange'];\n }\n}\n"]}
@@ -0,0 +1,22 @@
1
+ import type { IAnimate, IStep } from '../intreface/animate';
2
+ import type { EasingType } from '../intreface/easing';
3
+ import { ACustomAnimate } from './custom-animate';
4
+ export interface IScaleAnimationOptions {
5
+ direction?: 'x' | 'y' | 'xy';
6
+ }
7
+ export declare class CommonIn extends ACustomAnimate<Record<string, number>> {
8
+ valid: boolean;
9
+ keys: string[];
10
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
11
+ onBind(): void;
12
+ onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
13
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
14
+ }
15
+ export declare class CommonOut extends ACustomAnimate<Record<string, number>> {
16
+ valid: boolean;
17
+ keys: string[];
18
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
19
+ onBind(): void;
20
+ onEnd(cb?: (animate: IAnimate, step: IStep) => void): void;
21
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
22
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.CommonOut = exports.CommonIn = void 0;
6
+
7
+ const custom_animate_1 = require("./custom-animate");
8
+
9
+ class CommonIn extends custom_animate_1.ACustomAnimate {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params);
12
+ }
13
+ onBind() {
14
+ var _a;
15
+ const attrs = this.target.getFinalAttribute(), fromAttrs = null !== (_a = this.target.context.lastAttrs) && void 0 !== _a ? _a : {}, to = {}, from = {};
16
+ this.keys.forEach((key => {
17
+ var _a, _b;
18
+ to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1,
19
+ from[key] = null !== (_b = null == fromAttrs ? void 0 : fromAttrs[key]) && void 0 !== _b ? _b : 0;
20
+ })), this.props = to, this.propKeys = this.keys, this.animate.reSyncProps(), this.from = from,
21
+ this.to = to, this.target.setAttributes(from);
22
+ }
23
+ onEnd(cb) {
24
+ super.onEnd(cb);
25
+ }
26
+ onUpdate(end, ratio, out) {
27
+ this.propKeys.forEach((key => {
28
+ out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
29
+ })), this.target.setAttributes(out);
30
+ }
31
+ }
32
+
33
+ exports.CommonIn = CommonIn;
34
+
35
+ class CommonOut extends custom_animate_1.ACustomAnimate {
36
+ constructor(from, to, duration, easing, params) {
37
+ super(from, to, duration, easing, params);
38
+ }
39
+ onBind() {
40
+ const attrs = this.target.getFinalAttribute(), to = {}, from = {};
41
+ this.keys.forEach((key => {
42
+ var _a;
43
+ to[key] = 0, from[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1;
44
+ })), this.props = to, this.propKeys = this.keys, this.animate.reSyncProps(), this.from = from,
45
+ this.to = to, this.target.setAttributes(from);
46
+ }
47
+ onEnd(cb) {
48
+ super.onEnd(cb);
49
+ }
50
+ onUpdate(end, ratio, out) {
51
+ this.propKeys.forEach((key => {
52
+ out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
53
+ })), this.target.setAttributes(out);
54
+ }
55
+ }
56
+
57
+ exports.CommonOut = CommonOut;
58
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/common.ts"],"names":[],"mappings":";;;AAEA,qDAAkD;AAMlD,MAAa,QAAS,SAAQ,+BAAsC;IAKlE,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM;;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC9C,MAAM,SAAS,GAAG,MAAA,IAAI,CA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AAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACF;AArCD,8BAqCC","file":"common.js","sourcesContent":["import type { IAnimate, IStep } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport { ACustomAnimate } from './custom-animate';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class CommonIn extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n const fromAttrs = this.target.context.lastAttrs ?? {};\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = {};\n this.keys.forEach(key => {\n to[key] = attrs?.[key] ?? 1;\n from[key] = fromAttrs?.[key] ?? 0;\n });\n\n this.props = to;\n this.propKeys = this.keys;\n this.animate.reSyncProps();\n this.from = from;\n this.to = to;\n this.target.setAttributes(from as any);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n\nexport class CommonOut extends ACustomAnimate<Record<string, number>> {\n declare valid: boolean;\n\n keys: string[];\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n }\n\n onBind(): void {\n const attrs = this.target.getFinalAttribute();\n\n const to: Record<string, number> = {};\n const from: Record<string, number> = {};\n this.keys.forEach(key => {\n to[key] = 0;\n from[key] = attrs?.[key] ?? 1;\n });\n\n this.props = to;\n this.propKeys = this.keys;\n this.animate.reSyncProps();\n this.from = from;\n this.to = to;\n this.target.setAttributes(from as any);\n }\n\n onEnd(cb?: (animate: IAnimate, step: IStep) => void): void {\n super.onEnd(cb);\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.propKeys.forEach(key => {\n out[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;\n });\n this.target.setAttributes(out);\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ICustomAnimate } from '../intreface/animate';
2
+ import type { EasingType } from '../intreface/easing';
3
+ import type { IAnimateStepType } from '../intreface/type';
4
+ import { Step } from '../step';
5
+ export declare abstract class ACustomAnimate<T> extends Step implements ICustomAnimate {
6
+ type: IAnimateStepType;
7
+ customFrom: T;
8
+ params?: any;
9
+ props?: T;
10
+ from?: T;
11
+ to?: T;
12
+ constructor(customFrom: T, customTo: T, duration: number, easing: EasingType, params?: any);
13
+ update(end: boolean, ratio: number, out: Record<string, any>): void;
14
+ protected setProps(props: T): void;
15
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.ACustomAnimate = void 0;
6
+
7
+ const step_1 = require("../step");
8
+
9
+ class ACustomAnimate extends step_1.Step {
10
+ constructor(customFrom, customTo, duration, easing, params) {
11
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate",
12
+ this.customFrom = customFrom, this.params = params;
13
+ }
14
+ update(end, ratio, out) {
15
+ if (this.onStart(), !this.props || !this.propKeys) return;
16
+ const easedRatio = this.easing(ratio);
17
+ this.onUpdate(end, easedRatio, out);
18
+ }
19
+ setProps(props) {
20
+ this.props = props, this.propKeys = Object.keys(props), this.animate.reSyncProps();
21
+ }
22
+ }
23
+
24
+ exports.ACustomAnimate = ACustomAnimate;
25
+ //# sourceMappingURL=custom-animate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/custom-animate.ts"],"names":[],"mappings":";;;AAGA,kCAA+B;AAE/B,MAAsB,cAAkB,SAAQ,WAAI;IAUlD,YAAY,UAAa,EAAE,QAAW,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QACxF,KAAK,CAAC,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAVrD,SAAI,GAAqB,eAAe,CAAC;QAWvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAE1D,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO;SACR;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IACtC,CAAC;IAES,QAAQ,CAAC,KAAQ;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;CACF;AAhCD,wCAgCC","file":"custom-animate.js","sourcesContent":["import type { ICustomAnimate } from '../intreface/animate';\nimport type { EasingType } from '../intreface/easing';\nimport type { IAnimateStepType } from '../intreface/type';\nimport { Step } from '../step';\n\nexport abstract class ACustomAnimate<T> extends Step implements ICustomAnimate {\n type: IAnimateStepType = 'customAnimate';\n declare customFrom: T;\n declare params?: any;\n declare props?: T;\n declare from?: T;\n declare to?: T;\n\n // 为了兼容旧的api,from和to是可选的,且尽量不需要From,因为为了避免突变,From都应该从当前位置开始\n // 所以From并不会真正设置到fromProps中,而是作为customFrom参数\n constructor(customFrom: T, customTo: T, duration: number, easing: EasingType, params?: any) {\n super('customAnimate', customTo, duration, easing);\n this.customFrom = customFrom;\n this.params = params;\n }\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n // TODO 需要修复,只有在开始的时候才调用\n this.onStart();\n if (!this.props || !this.propKeys) {\n return;\n }\n // 应用缓动函数\n const easedRatio = this.easing(ratio);\n this.onUpdate(end, easedRatio, out);\n }\n\n protected setProps(props: T) {\n this.props = props;\n this.propKeys = Object.keys(props);\n this.animate.reSyncProps();\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { EasingType } from '../intreface/easing';
2
+ import { CommonIn, CommonOut } from './common';
3
+ export interface IScaleAnimationOptions {
4
+ direction?: 'x' | 'y' | 'xy';
5
+ }
6
+ export declare class FadeIn extends CommonIn {
7
+ valid: boolean;
8
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
9
+ }
10
+ export declare class FadeOut extends CommonOut {
11
+ valid: boolean;
12
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions);
13
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.FadeOut = exports.FadeIn = void 0;
6
+
7
+ const common_1 = require("./common");
8
+
9
+ class FadeIn extends common_1.CommonIn {
10
+ constructor(from, to, duration, easing, params) {
11
+ super(from, to, duration, easing, params), this.keys = [ "opacity" ];
12
+ }
13
+ }
14
+
15
+ exports.FadeIn = FadeIn;
16
+
17
+ class FadeOut extends common_1.CommonOut {
18
+ constructor(from, to, duration, easing, params) {
19
+ super(from, to, duration, easing, params), this.keys = [ "opacity" ];
20
+ }
21
+ }
22
+
23
+ exports.FadeOut = FadeOut;
24
+ //# sourceMappingURL=fade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/fade.ts"],"names":[],"mappings":";;;AACA,qCAA+C;AAM/C,MAAa,MAAO,SAAQ,iBAAQ;IAGlC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACF;AAPD,wBAOC;AAED,MAAa,OAAQ,SAAQ,kBAAS;IAGpC,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAA+B;QACrG,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACF;AAPD,0BAOC","file":"fade.js","sourcesContent":["import type { EasingType } from '../intreface/easing';\nimport { CommonIn, CommonOut } from './common';\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport class FadeIn extends CommonIn {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity'];\n }\n}\n\nexport class FadeOut extends CommonOut {\n declare valid: boolean;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params?: IScaleAnimationOptions) {\n super(from, to, duration, easing, params);\n this.keys = ['opacity'];\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import type { IGroup } from '@visactor/vrender-core';
2
+ import { ACustomAnimate } from './custom-animate';
3
+ export declare class GroupFadeIn extends ACustomAnimate<any> {
4
+ target: IGroup;
5
+ getEndProps(): Record<string, any>;
6
+ onBind(): void;
7
+ onEnd(): void;
8
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
9
+ }
10
+ export declare class GroupFadeOut extends ACustomAnimate<any> {
11
+ target: IGroup;
12
+ getEndProps(): Record<string, any>;
13
+ onBind(): void;
14
+ onEnd(): void;
15
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
16
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.GroupFadeOut = exports.GroupFadeIn = void 0;
6
+
7
+ const custom_animate_1 = require("./custom-animate");
8
+
9
+ class GroupFadeIn extends custom_animate_1.ACustomAnimate {
10
+ getEndProps() {
11
+ return {};
12
+ }
13
+ onBind() {
14
+ this.target.setTheme({
15
+ common: {
16
+ opacity: 0
17
+ }
18
+ });
19
+ }
20
+ onEnd() {
21
+ this.target.setTheme({
22
+ common: {
23
+ opacity: 1
24
+ }
25
+ });
26
+ }
27
+ onUpdate(end, ratio, out) {
28
+ this.target.setTheme({
29
+ common: {
30
+ opacity: ratio
31
+ }
32
+ });
33
+ }
34
+ }
35
+
36
+ exports.GroupFadeIn = GroupFadeIn;
37
+
38
+ class GroupFadeOut extends custom_animate_1.ACustomAnimate {
39
+ getEndProps() {
40
+ return {};
41
+ }
42
+ onBind() {
43
+ this.target.setTheme({
44
+ common: {
45
+ opacity: 1
46
+ }
47
+ });
48
+ }
49
+ onEnd() {
50
+ this.target.setTheme({
51
+ common: {
52
+ opacity: 0
53
+ }
54
+ });
55
+ }
56
+ onUpdate(end, ratio, out) {
57
+ this.target.setTheme({
58
+ common: {
59
+ opacity: 1 - ratio
60
+ }
61
+ });
62
+ }
63
+ }
64
+
65
+ exports.GroupFadeOut = GroupFadeOut;
66
+ //# sourceMappingURL=group-fade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/custom/group-fade.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAElD,MAAa,WAAY,SAAQ,+BAAmB;IAGlD,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,kCAgCC;AAED,MAAa,YAAa,SAAQ,+BAAmB;IAGnD,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC;aACX;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;QAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE;gBACN,OAAO,EAAE,CAAC,GAAG,KAAK;aACnB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAhCD,oCAgCC","file":"group-fade.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport { ACustomAnimate } from './custom-animate';\n\nexport class GroupFadeIn extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: ratio\n }\n });\n }\n}\n\nexport class GroupFadeOut extends ACustomAnimate<any> {\n declare target: IGroup;\n\n getEndProps(): Record<string, any> {\n return {};\n }\n\n onBind(): void {\n this.target.setTheme({\n common: {\n opacity: 1\n }\n });\n return;\n }\n\n onEnd(): void {\n this.target.setTheme({\n common: {\n opacity: 0\n }\n });\n return;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n this.target.setTheme({\n common: {\n opacity: 1 - ratio\n }\n });\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { type IGraphic, type IGroup } from '@visactor/vrender-core';
2
+ import type { EasingType } from '../intreface/easing';
3
+ import { ACustomAnimate } from './custom-animate';
4
+ interface IAnimationParameters {
5
+ width: number;
6
+ height: number;
7
+ group: IGroup;
8
+ elementIndex: number;
9
+ elementCount: number;
10
+ view: any;
11
+ }
12
+ type TypeAnimation<T extends IGraphic> = (graphic: T, options: any, animationParameters: IAnimationParameters) => {
13
+ from?: {
14
+ [channel: string]: any;
15
+ };
16
+ to?: {
17
+ [channel: string]: any;
18
+ };
19
+ };
20
+ export interface IGrowAngleAnimationOptions {
21
+ orient?: 'clockwise' | 'anticlockwise';
22
+ overall?: boolean | number;
23
+ }
24
+ export declare const growAngleIn: TypeAnimation<IGraphic>;
25
+ export declare const growAngleOut: TypeAnimation<IGraphic>;
26
+ export declare class GworPointsBase extends ACustomAnimate<Record<string, number>> {
27
+ valid: boolean;
28
+ constructor(from: null, to: null, duration: number, easing: EasingType, params?: any);
29
+ onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;
30
+ }
31
+ export declare class GrowAngleIn extends GworPointsBase {
32
+ onBind(): void;
33
+ }
34
+ export declare class GrowAngleOut extends GworPointsBase {
35
+ onBind(): void;
36
+ }
37
+ export {};