@visactor/vrender-components 0.22.12 → 0.22.13

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 (134) hide show
  1. package/cjs/axis/animate/group-transition.d.ts +1 -2
  2. package/cjs/axis/animate/group-transition.js +2 -2
  3. package/cjs/axis/animate/group-transition.js.map +1 -1
  4. package/cjs/axis/base.d.ts +4 -9
  5. package/cjs/axis/base.js +5 -70
  6. package/cjs/axis/base.js.map +1 -1
  7. package/cjs/axis/line.js.map +1 -1
  8. package/cjs/axis/register.js +2 -2
  9. package/cjs/axis/register.js.map +1 -1
  10. package/cjs/axis/type.d.ts +0 -4
  11. package/cjs/axis/type.js.map +1 -1
  12. package/cjs/axis/util.js +1 -2
  13. package/cjs/brush/config.js +2 -1
  14. package/cjs/crosshair/rect.js +2 -1
  15. package/cjs/crosshair/type.js +1 -2
  16. package/cjs/data-zoom/data-zoom.js.map +1 -1
  17. package/cjs/index.d.ts +1 -1
  18. package/cjs/index.js +1 -1
  19. package/cjs/index.js.map +1 -1
  20. package/cjs/indicator/register.js +2 -1
  21. package/cjs/jsx/index.js +1 -2
  22. package/cjs/label/animate/animate.d.ts +12 -1
  23. package/cjs/label/animate/animate.js +84 -1
  24. package/cjs/label/animate/animate.js.map +1 -1
  25. package/cjs/label/arc.js +6 -6
  26. package/cjs/label/arc.js.map +1 -1
  27. package/cjs/label/base.d.ts +5 -6
  28. package/cjs/label/base.js +108 -87
  29. package/cjs/label/base.js.map +1 -1
  30. package/cjs/label/index.js +1 -1
  31. package/cjs/label/line.js +1 -1
  32. package/cjs/label/polygon.js +1 -1
  33. package/cjs/label/register.d.ts +0 -1
  34. package/cjs/label/register.js +4 -8
  35. package/cjs/label/register.js.map +1 -1
  36. package/cjs/label-item/label-item.d.ts +20 -9
  37. package/cjs/label-item/label-item.js +103 -1
  38. package/cjs/label-item/label-item.js.map +1 -1
  39. package/cjs/marker/config.d.ts +18 -0
  40. package/cjs/marker/config.js +19 -1
  41. package/cjs/marker/config.js.map +1 -1
  42. package/cjs/marker/point.d.ts +18 -0
  43. package/cjs/marker/point.js +19 -16
  44. package/cjs/marker/point.js.map +1 -1
  45. package/cjs/marker/register.js +7 -8
  46. package/cjs/marker/register.js.map +1 -1
  47. package/cjs/marker/type.d.ts +11 -4
  48. package/cjs/marker/type.js.map +1 -1
  49. package/cjs/poptip/poptip.d.ts +9 -0
  50. package/cjs/poptip/poptip.js +37 -1
  51. package/cjs/poptip/poptip.js.map +1 -1
  52. package/cjs/weather/weather-box.d.ts +1 -1
  53. package/cjs/weather/weather-box.js +5 -5
  54. package/cjs/weather/weather-box.js.map +1 -1
  55. package/dist/index.es.js +13114 -14616
  56. package/es/axis/animate/group-transition.d.ts +1 -2
  57. package/es/axis/animate/group-transition.js +1 -3
  58. package/es/axis/animate/group-transition.js.map +1 -1
  59. package/es/axis/base.d.ts +4 -9
  60. package/es/axis/base.js +9 -75
  61. package/es/axis/base.js.map +1 -1
  62. package/es/axis/line.js.map +1 -1
  63. package/es/axis/register.js +1 -3
  64. package/es/axis/register.js.map +1 -1
  65. package/es/axis/type.d.ts +0 -4
  66. package/es/axis/type.js.map +1 -1
  67. package/es/axis/util.js +1 -2
  68. package/es/brush/config.js +2 -1
  69. package/es/crosshair/rect.js +2 -1
  70. package/es/crosshair/type.js +1 -2
  71. package/es/data-zoom/data-zoom.js.map +1 -1
  72. package/es/index.d.ts +1 -1
  73. package/es/index.js +1 -1
  74. package/es/index.js.map +1 -1
  75. package/es/indicator/register.js +2 -1
  76. package/es/jsx/index.js +1 -2
  77. package/es/label/animate/animate.d.ts +12 -1
  78. package/es/label/animate/animate.js +82 -0
  79. package/es/label/animate/animate.js.map +1 -1
  80. package/es/label/arc.js +6 -6
  81. package/es/label/arc.js.map +1 -1
  82. package/es/label/base.d.ts +5 -6
  83. package/es/label/base.js +108 -90
  84. package/es/label/base.js.map +1 -1
  85. package/es/label/index.js +1 -1
  86. package/es/label/line.js +1 -1
  87. package/es/label/polygon.js +1 -1
  88. package/es/label/register.d.ts +0 -1
  89. package/es/label/register.js +1 -7
  90. package/es/label/register.js.map +1 -1
  91. package/es/label-item/label-item.d.ts +20 -9
  92. package/es/label-item/label-item.js +104 -0
  93. package/es/label-item/label-item.js.map +1 -1
  94. package/es/marker/config.d.ts +18 -0
  95. package/es/marker/config.js +19 -1
  96. package/es/marker/config.js.map +1 -1
  97. package/es/marker/point.d.ts +18 -0
  98. package/es/marker/point.js +19 -16
  99. package/es/marker/point.js.map +1 -1
  100. package/es/marker/register.js +6 -8
  101. package/es/marker/register.js.map +1 -1
  102. package/es/marker/type.d.ts +11 -4
  103. package/es/marker/type.js.map +1 -1
  104. package/es/poptip/poptip.d.ts +9 -0
  105. package/es/poptip/poptip.js +38 -0
  106. package/es/poptip/poptip.js.map +1 -1
  107. package/es/weather/weather-box.d.ts +1 -1
  108. package/es/weather/weather-box.js +1 -1
  109. package/es/weather/weather-box.js.map +1 -1
  110. package/package.json +7 -8
  111. package/cjs/animation/animate-component.d.ts +0 -22
  112. package/cjs/animation/animate-component.js +0 -29
  113. package/cjs/animation/animate-component.js.map +0 -1
  114. package/cjs/animation/axis-animate.d.ts +0 -10
  115. package/cjs/animation/axis-animate.js +0 -71
  116. package/cjs/animation/axis-animate.js.map +0 -1
  117. package/cjs/animation/label-animate.d.ts +0 -10
  118. package/cjs/animation/label-animate.js +0 -81
  119. package/cjs/animation/label-animate.js.map +0 -1
  120. package/cjs/axis/animate/config.d.ts +0 -6
  121. package/cjs/axis/animate/config.js +0 -10
  122. package/cjs/axis/animate/config.js.map +0 -1
  123. package/es/animation/animate-component.d.ts +0 -22
  124. package/es/animation/animate-component.js +0 -21
  125. package/es/animation/animate-component.js.map +0 -1
  126. package/es/animation/axis-animate.d.ts +0 -10
  127. package/es/animation/axis-animate.js +0 -60
  128. package/es/animation/axis-animate.js.map +0 -1
  129. package/es/animation/label-animate.d.ts +0 -10
  130. package/es/animation/label-animate.js +0 -70
  131. package/es/animation/label-animate.js.map +0 -1
  132. package/es/axis/animate/config.d.ts +0 -6
  133. package/es/axis/animate/config.js +0 -6
  134. package/es/axis/animate/config.js.map +0 -1
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.registerAxisAnimate = exports.AxisUpdate = exports.AxisEnter = void 0;
6
-
7
- const vrender_animate_1 = require("@visactor/vrender-animate");
8
-
9
- class AxisEnter extends vrender_animate_1.AComponentAnimate {
10
- onBind() {
11
- var _a;
12
- const animator = (0, vrender_animate_1.createComponentAnimator)(this.target);
13
- this._animator = animator;
14
- const duration = this.duration, easing = this.easing, {config: config, lastScale: lastScale, getTickCoord: getTickCoord} = this.params;
15
- let ratio = 1;
16
- const currData = this.target.data;
17
- if (lastScale && getTickCoord && currData) {
18
- ratio = .7;
19
- const point = getTickCoord(lastScale.scale(currData.rawValue)), newX = this.target.attribute.x, newY = this.target.attribute.y;
20
- this.target.setAttributes({
21
- x: point.x,
22
- y: point.y
23
- }), animator.animate(this.target, {
24
- type: "to",
25
- to: {
26
- x: newX,
27
- y: newY
28
- },
29
- duration: duration,
30
- easing: easing
31
- });
32
- }
33
- animator.animate(this.target, {
34
- type: null !== (_a = config.type) && void 0 !== _a ? _a : "fadeIn",
35
- to: config.to,
36
- duration: duration * ratio,
37
- easing: easing
38
- }), this.completeBind(animator);
39
- }
40
- }
41
-
42
- exports.AxisEnter = AxisEnter;
43
-
44
- class AxisUpdate extends vrender_animate_1.AComponentAnimate {
45
- onBind() {
46
- const animator = (0, vrender_animate_1.createComponentAnimator)(this.target);
47
- this._animator = animator;
48
- const duration = this.duration, easing = this.easing, {config: config, diffAttrs: diffAttrs} = this.params;
49
- animator.animate(this.target, {
50
- type: "to",
51
- to: Object.assign({}, diffAttrs),
52
- duration: duration,
53
- easing: easing,
54
- customParameters: {
55
- diffAttrs: Object.assign({}, diffAttrs)
56
- }
57
- }), this.completeBind(animator);
58
- }
59
- deleteSelfAttr(key) {
60
- super.deleteSelfAttr(key), this._animator.deleteSelfAttr(key);
61
- }
62
- tryPreventConflict() {}
63
- }
64
-
65
- function registerAxisAnimate() {
66
- vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("axisEnter", AxisEnter),
67
- vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("axisUpdate", AxisUpdate);
68
- }
69
-
70
- exports.AxisUpdate = AxisUpdate, exports.registerAxisAnimate = registerAxisAnimate;
71
- //# sourceMappingURL=axis-animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animation/axis-animate.ts"],"names":[],"mappings":";;;AAAA,+DAAwG;AAKxG,MAAa,SAAU,SAAQ,mCAAsB;IACnD,MAAM;;QACJ,MAAM,QAAQ,GAAG,IAAA,yCAAuB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAExD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClC,IAAI,SAAS,IAAI,YAAY,IAAI,QAAQ,EAAE;YACzC,KAAK,GAAG,GAAG,CAAC;YAEZ,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YAErC,IAAI,CAAC,MAAM,CAAC,aAAa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GAAW;QACxB,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAGS,kBAAkB;QAC1B,OAAO;IACT,CAAC;CACF;AA/CD,gCA+CC;AAED,SAAgB,mBAAmB;IAEjC,iCAAe,CAAC,sBAAsB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,iCAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC;AAJD,kDAIC","file":"axis-animate.js","sourcesContent":["import { AComponentAnimate, AnimateExecutor, createComponentAnimator } from '@visactor/vrender-animate';\n\n/**\n * AxisEnter class handles the enter animation for Axis components\n */\nexport class AxisEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { config, lastScale, getTickCoord } = this.params;\n\n let ratio = 1;\n const currData = this.target.data;\n if (lastScale && getTickCoord && currData) {\n ratio = 0.7;\n\n const oldValue = lastScale.scale(currData.rawValue);\n const point = getTickCoord(oldValue);\n const newX = this.target.attribute.x;\n const newY = this.target.attribute.y;\n\n this.target.setAttributes({ x: point.x, y: point.y });\n animator.animate(this.target, {\n type: 'to',\n to: { x: newX, y: newY },\n duration,\n easing\n });\n }\n\n // if (updateEls && updateEls.length > 1) {\n // ratio = 0.5;\n // const oldData1 = updateEls[0].oldEl.data;\n // const { rawValue: oldRawValue1, value: oldValue1 } = oldData1;\n // const oldData2 = updateEls[1].oldEl.data;\n // const { rawValue: oldRawValue2, value: oldValue2 } = oldData2;\n // const data = this.target.data;\n // const { rawValue: newRawValue } = data;\n // // rawValue 是原始值,value是映射出来的值,假设是线性映射,计算一下newRawValue在old阶段的value是什么值\n // const oldValue =\n // oldValue1 + ((oldValue2 - oldValue1) * (newRawValue - oldRawValue1)) / (oldRawValue2 - oldRawValue1);\n // // 将 x 和 y 做映射\n // const oldX1 = updateEls[0].oldEl.attribute.x;\n // const oldY1 = updateEls[0].oldEl.attribute.y;\n // const oldX2 = updateEls[1].oldEl.attribute.x;\n // const oldY2 = updateEls[1].oldEl.attribute.y;\n // const oldX = oldX1 + ((oldX2 - oldX1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const oldY = oldY1 + ((oldY2 - oldY1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const newX = this.target.attribute.x;\n // const newY = this.target.attribute.y;\n\n // this.target.setAttributes({ x: oldX, y: oldY });\n // animator.animate(this.target, {\n // type: 'to',\n // to: { x: newX, y: newY },\n // duration,\n // easing\n // });\n // }\n\n animator.animate(this.target, {\n type: config.type ?? 'fadeIn',\n to: config.to,\n duration: duration * ratio,\n easing\n });\n this.completeBind(animator);\n }\n}\n\n/**\n * AxisUpdate class handles the update animation for Axis components\n */\nexport class AxisUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { config, diffAttrs } = this.params;\n // this.target.applyAnimationState(\n // ['update'],\n // [\n // {\n // name: 'update',\n // animation: {\n // type: 'to',\n // to: { ...this.props },\n // duration,\n // easing,\n // customParameters: {\n // diffAttrs: { ...this.props }\n // }\n // }\n // }\n // ]\n // );\n // console.log('this.props', this.props, { ...this.target.attribute });\n animator.animate(this.target, {\n type: 'to',\n to: { ...diffAttrs },\n duration,\n easing,\n customParameters: {\n diffAttrs: { ...diffAttrs }\n }\n });\n this.completeBind(animator);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以当需要屏蔽自身属性时,需要通过animator中执行\n deleteSelfAttr(key: string): void {\n super.deleteSelfAttr(key);\n this._animator.deleteSelfAttr(key);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerAxisAnimate() {\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('axisEnter', AxisEnter);\n AnimateExecutor.registerBuiltInAnimate('axisUpdate', AxisUpdate);\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { AComponentAnimate } from '@visactor/vrender-animate';
2
- export declare class LabelUpdate extends AComponentAnimate<any> {
3
- onBind(): void;
4
- protected tryPreventConflict(): void;
5
- }
6
- export declare class LabelEnter extends AComponentAnimate<any> {
7
- onBind(): void;
8
- protected tryPreventConflict(): void;
9
- }
10
- export declare function registerLabelAnimate(): void;
@@ -1,81 +0,0 @@
1
- "use strict";
2
-
3
- var __rest = this && this.__rest || function(s, e) {
4
- var t = {};
5
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
6
- if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
7
- var i = 0;
8
- for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
9
- }
10
- return t;
11
- };
12
-
13
- Object.defineProperty(exports, "__esModule", {
14
- value: !0
15
- }), exports.registerLabelAnimate = exports.LabelEnter = exports.LabelUpdate = void 0;
16
-
17
- const vrender_animate_1 = require("@visactor/vrender-animate");
18
-
19
- class LabelUpdate extends vrender_animate_1.AComponentAnimate {
20
- onBind() {
21
- const animator = (0, vrender_animate_1.createComponentAnimator)(this.target);
22
- this._animator = animator;
23
- const duration = this.duration, easing = this.easing, {prevText: prevText, curText: curText, prevLabelLine: prevLabelLine, curLabelLine: curLabelLine} = this.params, diff = {};
24
- for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
25
- const {text: text} = diff, rest = __rest(diff, [ "text" ]);
26
- animator.animate(prevText, {
27
- type: "to",
28
- to: rest,
29
- duration: duration,
30
- easing: easing
31
- }), animator.animate(prevText, {
32
- type: "increaseCount",
33
- to: {
34
- text: curText.attribute.text
35
- },
36
- duration: duration,
37
- easing: easing
38
- }), prevLabelLine && animator.animate(prevLabelLine, {
39
- type: "to",
40
- to: curLabelLine.attribute,
41
- duration: duration,
42
- easing: easing
43
- }), this.completeBind(animator);
44
- }
45
- tryPreventConflict() {}
46
- }
47
-
48
- exports.LabelUpdate = LabelUpdate;
49
-
50
- class LabelEnter extends vrender_animate_1.AComponentAnimate {
51
- onBind() {
52
- const animator = (0, vrender_animate_1.createComponentAnimator)(this.target);
53
- this._animator = animator;
54
- const duration = this.duration, easing = this.easing, {relatedGraphic: relatedGraphic, relatedGraphics: relatedGraphics, config: config} = this.params, {mode: mode, type: type = "fadeIn"} = config, target = this.target;
55
- let startTime = 0;
56
- "after" === mode ? relatedGraphic.animates && relatedGraphic.animates.forEach((animate => {
57
- startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());
58
- })) : "after-all" === mode ? relatedGraphics && relatedGraphics.forEach((graphic => {
59
- graphic.animates && graphic.animates.forEach((animate => {
60
- startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());
61
- }));
62
- })) : relatedGraphic.animates && relatedGraphic.animates.forEach((animate => {
63
- startTime = Math.max(startTime, animate.getStartTime());
64
- })), animator.animate(target, Object.assign(Object.assign({}, config), {
65
- duration: duration,
66
- easing: easing,
67
- startTime: startTime,
68
- type: type
69
- })), this.completeBind(animator);
70
- }
71
- tryPreventConflict() {}
72
- }
73
-
74
- function registerLabelAnimate() {
75
- vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("increaseCount", vrender_animate_1.IncreaseCount),
76
- vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate),
77
- vrender_animate_1.AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
78
- }
79
-
80
- exports.LabelEnter = LabelEnter, exports.registerLabelAnimate = registerLabelAnimate;
81
- //# sourceMappingURL=label-animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animation/label-animate.ts"],"names":[],"mappings":";;;;;;;;;;;;;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,CAAC,CAAC;wBACvF,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;SACN;aAAM;YAEL,cAAc,CAAC,QAAQ;gBACrB,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAY,EAAE,EAAE;oBAC/C,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;gBAC1D,CAAC,CAAC,CAAC;SACN;QAED,QAAQ,CAAC,OAAO,CAAC,MAAM,kCAClB,MAAM,KACT,QAAQ;YACR,MAAM;YACN,SAAS;YACT,IAAI,IACJ,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGS,kBAAkB;QAC1B,OAAO;IACT,CAAC;CACF;AAlDD,gCAkDC;AAED,SAAgB,oBAAoB;IAClC,iCAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,+BAAa,CAAC,CAAC;IAEvE,iCAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnE,iCAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC;AALD,oDAKC","file":"label-animate.js","sourcesContent":["import { AComponentAnimate, AnimateExecutor, createComponentAnimator, IncreaseCount } from '@visactor/vrender-animate';\n\n/**\n * LabelUpdate class handles the update animation for Label components\n */\nexport class LabelUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { prevText, curText, prevLabelLine, curLabelLine } = this.params;\n const diff: Record<string, any> = {};\n\n for (const key in curText.attribute) {\n if (prevText.attribute[key] !== curText.attribute[key]) {\n diff[key] = curText.attribute[key];\n }\n }\n\n const { text, ...rest } = diff;\n\n animator.animate(prevText, {\n type: 'to',\n to: rest,\n duration,\n easing\n });\n\n animator.animate(prevText, {\n type: 'increaseCount',\n to: {\n text: curText.attribute.text\n },\n duration,\n easing\n });\n\n if (prevLabelLine) {\n animator.animate(prevLabelLine, {\n type: 'to',\n to: curLabelLine.attribute,\n duration,\n easing\n });\n }\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport class LabelEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { relatedGraphic, relatedGraphics, config } = this.params;\n const { mode, type = 'fadeIn' } = config;\n\n const target = this.target;\n\n let startTime = 0;\n\n if (mode === 'after') {\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n } else if (mode === 'after-all') {\n relatedGraphics &&\n relatedGraphics.forEach((graphic: any) => {\n graphic.animates &&\n graphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n });\n } else {\n // 'same-time'\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime());\n });\n }\n\n animator.animate(target, {\n ...config,\n duration,\n easing,\n startTime,\n type\n });\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerLabelAnimate() {\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('labelUpdate', LabelUpdate);\n AnimateExecutor.registerBuiltInAnimate('labelEnter', LabelEnter);\n}\n"]}
@@ -1,6 +0,0 @@
1
- import type { EasingType } from '@visactor/vrender-core';
2
- export declare const DefaultAxisAnimation: {
3
- type: string;
4
- duration: number;
5
- easing: EasingType;
6
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: !0
5
- }), exports.DefaultAxisAnimation = void 0, exports.DefaultAxisAnimation = {
6
- type: "default",
7
- duration: 300,
8
- easing: "linear"
9
- };
10
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/axis/animate/config.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAsB;CAC/B,CAAC","file":"config.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\n\nexport const DefaultAxisAnimation = {\n type: 'default',\n duration: 300,\n easing: 'linear' as EasingType\n};\n"]}
@@ -1,22 +0,0 @@
1
- import type { EasingType } from '@visactor/vrender-core';
2
- import { AbstractComponent } from '../core/base';
3
- interface AnimateComponentAttribute {
4
- animation?: boolean | any;
5
- animationEnter?: boolean | any;
6
- animationExit?: boolean | any;
7
- animationUpdate?: boolean | any;
8
- }
9
- export interface ICommonAnimation {
10
- duration?: number;
11
- delay?: number;
12
- easing?: EasingType;
13
- }
14
- export declare abstract class AnimateComponent<T extends AnimateComponentAttribute> extends AbstractComponent<T> {
15
- protected _animationConfig?: {
16
- enter: ICommonAnimation | false;
17
- exit: ICommonAnimation | false;
18
- update: ICommonAnimation | false;
19
- };
20
- _prepareAnimate(defaultAnimation: ICommonAnimation): void;
21
- }
22
- export {};
@@ -1,21 +0,0 @@
1
- import { AbstractComponent } from "../core/base";
2
-
3
- import { isArray, isObject, merge } from "@visactor/vutils";
4
-
5
- export class AnimateComponent extends AbstractComponent {
6
- _prepareAnimate(defaultAnimation) {
7
- if (!1 !== this.attribute.animation) {
8
- const {animation: animation, animationEnter: animationEnter, animationExit: animationExit, animationUpdate: animationUpdate} = this.attribute, animationCfg = isObject(animation) ? animation : {};
9
- this._animationConfig = {
10
- enter: !1 !== animationEnter && merge({}, defaultAnimation, animationCfg, null != animationEnter ? animationEnter : {}),
11
- exit: !1 !== animationExit && merge({}, defaultAnimation, animationCfg, null != animationExit ? animationExit : {}),
12
- update: !1 !== animationUpdate && (isArray(animationUpdate) ? animationUpdate : merge({}, defaultAnimation, animationCfg, null != animationUpdate ? animationUpdate : {}))
13
- };
14
- } else this._animationConfig = {
15
- enter: !1,
16
- exit: !1,
17
- update: !1
18
- };
19
- }
20
- }
21
- //# sourceMappingURL=animate-component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animation/animate-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA2B5D,MAAM,OAAgB,gBAAsD,SAAQ,iBAAoB;IAQtG,eAAe,CAAC,gBAAkC;QAChD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,KAAK,KAAK,EAAE;YACtC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACrF,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,IAAI,CAAC,gBAAgB,GAAG;gBACtB,KAAK,EAAE,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK;gBACzG,IAAI,EAAE,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK;gBACtG,MAAM,EACJ,eAAe,KAAK,KAAK;oBACvB,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;wBACxB,CAAC,CAAC,eAAe;wBACjB,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,CAAC;oBACpE,CAAC,CAAC,KAAK;aACZ,CAAC;SACH;aAAM;YACL,IAAI,CAAC,gBAAgB,GAAG;gBACtB,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,KAAK;gBACX,MAAM,EAAE,KAAK;aACd,CAAC;SACH;IACH,CAAC;CACF","file":"animate-component.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport { AbstractComponent } from '../core/base';\nimport { isArray, isObject, merge } from '@visactor/vutils';\n\ninterface AnimateComponentAttribute {\n animation?: boolean | any;\n animationEnter?: boolean | any;\n animationExit?: boolean | any;\n animationUpdate?: boolean | any;\n}\n\n/**\n * 标签的离场动画配置\n */\nexport interface ICommonAnimation {\n /**\n * 动画执行的时长\n */\n duration?: number;\n /**\n * 动画延迟的时长\n */\n delay?: number;\n /**\n * 动画的缓动函数\n */\n easing?: EasingType;\n}\n\nexport abstract class AnimateComponent<T extends AnimateComponentAttribute> extends AbstractComponent<T> {\n // parsed animation config\n protected _animationConfig?: {\n enter: ICommonAnimation | false;\n exit: ICommonAnimation | false;\n update: ICommonAnimation | false;\n };\n\n _prepareAnimate(defaultAnimation: ICommonAnimation) {\n if (this.attribute.animation !== false) {\n const { animation, animationEnter, animationExit, animationUpdate } = this.attribute;\n const animationCfg = isObject(animation) ? animation : {};\n this._animationConfig = {\n enter: animationEnter !== false ? merge({}, defaultAnimation, animationCfg, animationEnter ?? {}) : false,\n exit: animationExit !== false ? merge({}, defaultAnimation, animationCfg, animationExit ?? {}) : false,\n update:\n animationUpdate !== false\n ? isArray(animationUpdate)\n ? animationUpdate\n : merge({}, defaultAnimation, animationCfg, animationUpdate ?? {})\n : false\n };\n } else {\n this._animationConfig = {\n enter: false,\n exit: false,\n update: false\n };\n }\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { AComponentAnimate } from '@visactor/vrender-animate';
2
- export declare class AxisEnter extends AComponentAnimate<any> {
3
- onBind(): void;
4
- }
5
- export declare class AxisUpdate extends AComponentAnimate<any> {
6
- onBind(): void;
7
- deleteSelfAttr(key: string): void;
8
- protected tryPreventConflict(): void;
9
- }
10
- export declare function registerAxisAnimate(): void;
@@ -1,60 +0,0 @@
1
- import { AComponentAnimate, AnimateExecutor, createComponentAnimator } from "@visactor/vrender-animate";
2
-
3
- export class AxisEnter extends AComponentAnimate {
4
- onBind() {
5
- var _a;
6
- const animator = createComponentAnimator(this.target);
7
- this._animator = animator;
8
- const duration = this.duration, easing = this.easing, {config: config, lastScale: lastScale, getTickCoord: getTickCoord} = this.params;
9
- let ratio = 1;
10
- const currData = this.target.data;
11
- if (lastScale && getTickCoord && currData) {
12
- ratio = .7;
13
- const point = getTickCoord(lastScale.scale(currData.rawValue)), newX = this.target.attribute.x, newY = this.target.attribute.y;
14
- this.target.setAttributes({
15
- x: point.x,
16
- y: point.y
17
- }), animator.animate(this.target, {
18
- type: "to",
19
- to: {
20
- x: newX,
21
- y: newY
22
- },
23
- duration: duration,
24
- easing: easing
25
- });
26
- }
27
- animator.animate(this.target, {
28
- type: null !== (_a = config.type) && void 0 !== _a ? _a : "fadeIn",
29
- to: config.to,
30
- duration: duration * ratio,
31
- easing: easing
32
- }), this.completeBind(animator);
33
- }
34
- }
35
-
36
- export class AxisUpdate extends AComponentAnimate {
37
- onBind() {
38
- const animator = createComponentAnimator(this.target);
39
- this._animator = animator;
40
- const duration = this.duration, easing = this.easing, {config: config, diffAttrs: diffAttrs} = this.params;
41
- animator.animate(this.target, {
42
- type: "to",
43
- to: Object.assign({}, diffAttrs),
44
- duration: duration,
45
- easing: easing,
46
- customParameters: {
47
- diffAttrs: Object.assign({}, diffAttrs)
48
- }
49
- }), this.completeBind(animator);
50
- }
51
- deleteSelfAttr(key) {
52
- super.deleteSelfAttr(key), this._animator.deleteSelfAttr(key);
53
- }
54
- tryPreventConflict() {}
55
- }
56
-
57
- export function registerAxisAnimate() {
58
- AnimateExecutor.registerBuiltInAnimate("axisEnter", AxisEnter), AnimateExecutor.registerBuiltInAnimate("axisUpdate", AxisUpdate);
59
- }
60
- //# sourceMappingURL=axis-animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animation/axis-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAKxG,MAAM,OAAO,SAAU,SAAQ,iBAAsB;IACnD,MAAM;;QACJ,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAExD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClC,IAAI,SAAS,IAAI,YAAY,IAAI,QAAQ,EAAE;YACzC,KAAK,GAAG,GAAG,CAAC;YAEZ,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YACrC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;YAErC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,KAAK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AC,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAGS,kBAAkB;QAC1B,OAAO;IACT,CAAC;CACF;AAED,MAAM,UAAU,mBAAmB;IAEjC,eAAe,CAAC,sBAAsB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","file":"axis-animate.js","sourcesContent":["import { AComponentAnimate, AnimateExecutor, createComponentAnimator } from '@visactor/vrender-animate';\n\n/**\n * AxisEnter class handles the enter animation for Axis components\n */\nexport class AxisEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { config, lastScale, getTickCoord } = this.params;\n\n let ratio = 1;\n const currData = this.target.data;\n if (lastScale && getTickCoord && currData) {\n ratio = 0.7;\n\n const oldValue = lastScale.scale(currData.rawValue);\n const point = getTickCoord(oldValue);\n const newX = this.target.attribute.x;\n const newY = this.target.attribute.y;\n\n this.target.setAttributes({ x: point.x, y: point.y });\n animator.animate(this.target, {\n type: 'to',\n to: { x: newX, y: newY },\n duration,\n easing\n });\n }\n\n // if (updateEls && updateEls.length > 1) {\n // ratio = 0.5;\n // const oldData1 = updateEls[0].oldEl.data;\n // const { rawValue: oldRawValue1, value: oldValue1 } = oldData1;\n // const oldData2 = updateEls[1].oldEl.data;\n // const { rawValue: oldRawValue2, value: oldValue2 } = oldData2;\n // const data = this.target.data;\n // const { rawValue: newRawValue } = data;\n // // rawValue 是原始值,value是映射出来的值,假设是线性映射,计算一下newRawValue在old阶段的value是什么值\n // const oldValue =\n // oldValue1 + ((oldValue2 - oldValue1) * (newRawValue - oldRawValue1)) / (oldRawValue2 - oldRawValue1);\n // // 将 x 和 y 做映射\n // const oldX1 = updateEls[0].oldEl.attribute.x;\n // const oldY1 = updateEls[0].oldEl.attribute.y;\n // const oldX2 = updateEls[1].oldEl.attribute.x;\n // const oldY2 = updateEls[1].oldEl.attribute.y;\n // const oldX = oldX1 + ((oldX2 - oldX1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const oldY = oldY1 + ((oldY2 - oldY1) * (oldValue - oldValue1)) / (oldValue2 - oldValue1);\n // const newX = this.target.attribute.x;\n // const newY = this.target.attribute.y;\n\n // this.target.setAttributes({ x: oldX, y: oldY });\n // animator.animate(this.target, {\n // type: 'to',\n // to: { x: newX, y: newY },\n // duration,\n // easing\n // });\n // }\n\n animator.animate(this.target, {\n type: config.type ?? 'fadeIn',\n to: config.to,\n duration: duration * ratio,\n easing\n });\n this.completeBind(animator);\n }\n}\n\n/**\n * AxisUpdate class handles the update animation for Axis components\n */\nexport class AxisUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n const { config, diffAttrs } = this.params;\n // this.target.applyAnimationState(\n // ['update'],\n // [\n // {\n // name: 'update',\n // animation: {\n // type: 'to',\n // to: { ...this.props },\n // duration,\n // easing,\n // customParameters: {\n // diffAttrs: { ...this.props }\n // }\n // }\n // }\n // ]\n // );\n // console.log('this.props', this.props, { ...this.target.attribute });\n animator.animate(this.target, {\n type: 'to',\n to: { ...diffAttrs },\n duration,\n easing,\n customParameters: {\n diffAttrs: { ...diffAttrs }\n }\n });\n this.completeBind(animator);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以当需要屏蔽自身属性时,需要通过animator中执行\n deleteSelfAttr(key: string): void {\n super.deleteSelfAttr(key);\n this._animator.deleteSelfAttr(key);\n }\n\n // 轴动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerAxisAnimate() {\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('axisEnter', AxisEnter);\n AnimateExecutor.registerBuiltInAnimate('axisUpdate', AxisUpdate);\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { AComponentAnimate } from '@visactor/vrender-animate';
2
- export declare class LabelUpdate extends AComponentAnimate<any> {
3
- onBind(): void;
4
- protected tryPreventConflict(): void;
5
- }
6
- export declare class LabelEnter extends AComponentAnimate<any> {
7
- onBind(): void;
8
- protected tryPreventConflict(): void;
9
- }
10
- export declare function registerLabelAnimate(): void;
@@ -1,70 +0,0 @@
1
- var __rest = this && this.__rest || function(s, e) {
2
- var t = {};
3
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
4
- if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
5
- var i = 0;
6
- for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
7
- }
8
- return t;
9
- };
10
-
11
- import { AComponentAnimate, AnimateExecutor, createComponentAnimator, IncreaseCount } from "@visactor/vrender-animate";
12
-
13
- export class LabelUpdate extends AComponentAnimate {
14
- onBind() {
15
- const animator = createComponentAnimator(this.target);
16
- this._animator = animator;
17
- const duration = this.duration, easing = this.easing, {prevText: prevText, curText: curText, prevLabelLine: prevLabelLine, curLabelLine: curLabelLine} = this.params, diff = {};
18
- for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
19
- const {text: text} = diff, rest = __rest(diff, [ "text" ]);
20
- animator.animate(prevText, {
21
- type: "to",
22
- to: rest,
23
- duration: duration,
24
- easing: easing
25
- }), animator.animate(prevText, {
26
- type: "increaseCount",
27
- to: {
28
- text: curText.attribute.text
29
- },
30
- duration: duration,
31
- easing: easing
32
- }), prevLabelLine && animator.animate(prevLabelLine, {
33
- type: "to",
34
- to: curLabelLine.attribute,
35
- duration: duration,
36
- easing: easing
37
- }), this.completeBind(animator);
38
- }
39
- tryPreventConflict() {}
40
- }
41
-
42
- export class LabelEnter extends AComponentAnimate {
43
- onBind() {
44
- const animator = createComponentAnimator(this.target);
45
- this._animator = animator;
46
- const duration = this.duration, easing = this.easing, {relatedGraphic: relatedGraphic, relatedGraphics: relatedGraphics, config: config} = this.params, {mode: mode, type: type = "fadeIn"} = config, target = this.target;
47
- let startTime = 0;
48
- "after" === mode ? relatedGraphic.animates && relatedGraphic.animates.forEach((animate => {
49
- startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());
50
- })) : "after-all" === mode ? relatedGraphics && relatedGraphics.forEach((graphic => {
51
- graphic.animates && graphic.animates.forEach((animate => {
52
- startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());
53
- }));
54
- })) : relatedGraphic.animates && relatedGraphic.animates.forEach((animate => {
55
- startTime = Math.max(startTime, animate.getStartTime());
56
- })), animator.animate(target, Object.assign(Object.assign({}, config), {
57
- duration: duration,
58
- easing: easing,
59
- startTime: startTime,
60
- type: type
61
- })), this.completeBind(animator);
62
- }
63
- tryPreventConflict() {}
64
- }
65
-
66
- export function registerLabelAnimate() {
67
- AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate),
68
- AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
69
- }
70
- //# sourceMappingURL=label-animate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/animation/label-animate.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAKvH,MAAM,OAAO,WAAY,SAAQ,iBAAsB;IACrD,MAAM;QACJ,MAAM,QAAQ,GAAG,uBAAuB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,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CAAC;SACN;QAED,QAAQ,CAAC,OAAO,CAAC,MAAM,kCAClB,MAAM,KACT,QAAQ;YACR,MAAM;YACN,SAAS;YACT,IAAI,IACJ,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGS,kBAAkB;QAC1B,OAAO;IACT,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB;IAClC,eAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IAEvE,eAAe,CAAC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnE,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACnE,CAAC","file":"label-animate.js","sourcesContent":["import { AComponentAnimate, AnimateExecutor, createComponentAnimator, IncreaseCount } from '@visactor/vrender-animate';\n\n/**\n * LabelUpdate class handles the update animation for Label components\n */\nexport class LabelUpdate extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { prevText, curText, prevLabelLine, curLabelLine } = this.params;\n const diff: Record<string, any> = {};\n\n for (const key in curText.attribute) {\n if (prevText.attribute[key] !== curText.attribute[key]) {\n diff[key] = curText.attribute[key];\n }\n }\n\n const { text, ...rest } = diff;\n\n animator.animate(prevText, {\n type: 'to',\n to: rest,\n duration,\n easing\n });\n\n animator.animate(prevText, {\n type: 'increaseCount',\n to: {\n text: curText.attribute.text\n },\n duration,\n easing\n });\n\n if (prevLabelLine) {\n animator.animate(prevLabelLine, {\n type: 'to',\n to: curLabelLine.attribute,\n duration,\n easing\n });\n }\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport class LabelEnter extends AComponentAnimate<any> {\n onBind(): void {\n const animator = createComponentAnimator(this.target);\n this._animator = animator;\n const duration = this.duration;\n const easing = this.easing;\n\n const { relatedGraphic, relatedGraphics, config } = this.params;\n const { mode, type = 'fadeIn' } = config;\n\n const target = this.target;\n\n let startTime = 0;\n\n if (mode === 'after') {\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n } else if (mode === 'after-all') {\n relatedGraphics &&\n relatedGraphics.forEach((graphic: any) => {\n graphic.animates &&\n graphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime() + animate.getTotalDuration());\n });\n });\n } else {\n // 'same-time'\n relatedGraphic.animates &&\n relatedGraphic.animates.forEach((animate: any) => {\n startTime = Math.max(startTime, animate.getStartTime());\n });\n }\n\n animator.animate(target, {\n ...config,\n duration,\n easing,\n startTime,\n type\n });\n\n this.completeBind(animator);\n }\n\n // 标签动画本身没有逻辑,具体通过animator中执行,所以本身不需要屏蔽冲突\n protected tryPreventConflict(): void {\n return;\n }\n}\n\nexport function registerLabelAnimate() {\n AnimateExecutor.registerBuiltInAnimate('increaseCount', IncreaseCount);\n // Label update animation\n AnimateExecutor.registerBuiltInAnimate('labelUpdate', LabelUpdate);\n AnimateExecutor.registerBuiltInAnimate('labelEnter', LabelEnter);\n}\n"]}
@@ -1,6 +0,0 @@
1
- import type { EasingType } from '@visactor/vrender-core';
2
- export declare const DefaultAxisAnimation: {
3
- type: string;
4
- duration: number;
5
- easing: EasingType;
6
- };
@@ -1,6 +0,0 @@
1
- export const DefaultAxisAnimation = {
2
- type: "default",
3
- duration: 300,
4
- easing: "linear"
5
- };
6
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/axis/animate/config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAsB;CAC/B,CAAC","file":"config.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\n\nexport const DefaultAxisAnimation = {\n type: 'default',\n duration: 300,\n easing: 'linear' as EasingType\n};\n"]}