@visactor/vrender-components 1.1.0-alpha.2 → 1.1.0-alpha.21

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 (112) hide show
  1. package/cjs/animation/axis-animate.d.ts +1 -0
  2. package/cjs/animation/axis-animate.js +11 -4
  3. package/cjs/animation/axis-animate.js.map +1 -1
  4. package/cjs/animation/exit-release.d.ts +13 -0
  5. package/cjs/animation/exit-release.js +39 -0
  6. package/cjs/animation/exit-release.js.map +1 -0
  7. package/cjs/animation/static-truth.d.ts +2 -0
  8. package/cjs/animation/static-truth.js +21 -0
  9. package/cjs/animation/static-truth.js.map +1 -0
  10. package/cjs/axis/animate/group-transition.d.ts +2 -2
  11. package/cjs/axis/animate/group-transition.js +7 -3
  12. package/cjs/axis/animate/group-transition.js.map +1 -1
  13. package/cjs/axis/base.d.ts +6 -2
  14. package/cjs/axis/base.js +80 -30
  15. package/cjs/axis/base.js.map +1 -1
  16. package/cjs/axis/line.d.ts +1 -1
  17. package/cjs/axis/line.js +2 -2
  18. package/cjs/axis/line.js.map +1 -1
  19. package/cjs/axis/util.js +1 -2
  20. package/cjs/brush/config.js +2 -1
  21. package/cjs/core/type.d.ts +7 -0
  22. package/cjs/core/type.js.map +1 -1
  23. package/cjs/crosshair/polygon-sector.js +1 -2
  24. package/cjs/crosshair/sector.js +2 -1
  25. package/cjs/empty-tip/register.js +1 -2
  26. package/cjs/index.d.ts +1 -1
  27. package/cjs/index.js +1 -1
  28. package/cjs/index.js.map +1 -1
  29. package/cjs/indicator/config.js +2 -1
  30. package/cjs/jsx/index.js +1 -1
  31. package/cjs/label/arc.js +14 -9
  32. package/cjs/label/arc.js.map +1 -1
  33. package/cjs/label/base.d.ts +8 -1
  34. package/cjs/label/base.js +86 -10
  35. package/cjs/label/base.js.map +1 -1
  36. package/cjs/label/dataLabel.d.ts +5 -1
  37. package/cjs/label/dataLabel.js +46 -1
  38. package/cjs/label/dataLabel.js.map +1 -1
  39. package/cjs/legend/discrete/discrete.js +17 -9
  40. package/cjs/legend/discrete/discrete.js.map +1 -1
  41. package/cjs/marker/animate/call-in.js +6 -2
  42. package/cjs/marker/animate/call-in.js.map +1 -1
  43. package/cjs/marker/animate/clip-in.js +6 -2
  44. package/cjs/marker/animate/clip-in.js.map +1 -1
  45. package/cjs/marker/animate/common.js +14 -5
  46. package/cjs/marker/animate/common.js.map +1 -1
  47. package/cjs/marker/base.d.ts +6 -2
  48. package/cjs/marker/base.js +51 -9
  49. package/cjs/marker/base.js.map +1 -1
  50. package/cjs/marker/type.d.ts +2 -1
  51. package/cjs/marker/type.js.map +1 -1
  52. package/cjs/timeline/timeline.js +35 -12
  53. package/cjs/timeline/timeline.js.map +1 -1
  54. package/cjs/title/title.js +5 -2
  55. package/cjs/title/title.js.map +1 -1
  56. package/dist/index.es.js +1631 -297
  57. package/es/animation/axis-animate.d.ts +1 -0
  58. package/es/animation/axis-animate.js +12 -4
  59. package/es/animation/axis-animate.js.map +1 -1
  60. package/es/animation/exit-release.d.ts +13 -0
  61. package/es/animation/exit-release.js +31 -0
  62. package/es/animation/exit-release.js.map +1 -0
  63. package/es/animation/static-truth.d.ts +2 -0
  64. package/es/animation/static-truth.js +14 -0
  65. package/es/animation/static-truth.js.map +1 -0
  66. package/es/axis/animate/group-transition.d.ts +2 -2
  67. package/es/axis/animate/group-transition.js +7 -2
  68. package/es/axis/animate/group-transition.js.map +1 -1
  69. package/es/axis/base.d.ts +6 -2
  70. package/es/axis/base.js +81 -28
  71. package/es/axis/base.js.map +1 -1
  72. package/es/axis/line.d.ts +1 -1
  73. package/es/axis/line.js +2 -2
  74. package/es/axis/line.js.map +1 -1
  75. package/es/axis/util.js +1 -2
  76. package/es/brush/config.js +2 -1
  77. package/es/core/type.d.ts +7 -0
  78. package/es/core/type.js.map +1 -1
  79. package/es/crosshair/polygon-sector.js +1 -2
  80. package/es/crosshair/sector.js +2 -1
  81. package/es/empty-tip/register.js +1 -2
  82. package/es/index.d.ts +1 -1
  83. package/es/index.js +1 -1
  84. package/es/index.js.map +1 -1
  85. package/es/indicator/config.js +2 -1
  86. package/es/jsx/index.js +1 -1
  87. package/es/label/arc.js +14 -9
  88. package/es/label/arc.js.map +1 -1
  89. package/es/label/base.d.ts +8 -1
  90. package/es/label/base.js +88 -9
  91. package/es/label/base.js.map +1 -1
  92. package/es/label/dataLabel.d.ts +5 -1
  93. package/es/label/dataLabel.js +46 -0
  94. package/es/label/dataLabel.js.map +1 -1
  95. package/es/legend/discrete/discrete.js +18 -8
  96. package/es/legend/discrete/discrete.js.map +1 -1
  97. package/es/marker/animate/call-in.js +7 -2
  98. package/es/marker/animate/call-in.js.map +1 -1
  99. package/es/marker/animate/clip-in.js +7 -2
  100. package/es/marker/animate/clip-in.js.map +1 -1
  101. package/es/marker/animate/common.js +10 -2
  102. package/es/marker/animate/common.js.map +1 -1
  103. package/es/marker/base.d.ts +6 -2
  104. package/es/marker/base.js +51 -8
  105. package/es/marker/base.js.map +1 -1
  106. package/es/marker/type.d.ts +2 -1
  107. package/es/marker/type.js.map +1 -1
  108. package/es/timeline/timeline.js +36 -11
  109. package/es/timeline/timeline.js.map +1 -1
  110. package/es/title/title.js +5 -2
  111. package/es/title/title.js.map +1 -1
  112. package/package.json +6 -6
@@ -5,6 +5,7 @@ export declare class AxisEnter extends AComponentAnimate<any> {
5
5
  export declare class AxisUpdate extends AComponentAnimate<any> {
6
6
  onBind(): void;
7
7
  deleteSelfAttr(key: string): void;
8
+ deleteSelfAttrs(keys: string[]): void;
8
9
  protected tryPreventConflict(): void;
9
10
  }
10
11
  export declare function registerAxisAnimate(): void;
@@ -1,5 +1,7 @@
1
1
  import { AComponentAnimate, AnimateExecutor, createComponentAnimator } from "@visactor/vrender-animate";
2
2
 
3
+ import { commitUpdateAnimationTarget } from "./static-truth";
4
+
3
5
  export class AxisEnter extends AComponentAnimate {
4
6
  onBind() {
5
7
  var _a;
@@ -11,7 +13,10 @@ export class AxisEnter extends AComponentAnimate {
11
13
  if (lastScale && getTickCoord && currData) {
12
14
  ratio = .7;
13
15
  const point = getTickCoord(lastScale.scale(currData.rawValue)), newX = this.target.attribute.x, newY = this.target.attribute.y;
14
- this.target.setAttributes({
16
+ commitUpdateAnimationTarget(this.target, {
17
+ x: newX,
18
+ y: newY
19
+ }, {
15
20
  x: point.x,
16
21
  y: point.y
17
22
  }), animator.animate(this.target, {
@@ -37,8 +42,8 @@ export class AxisUpdate extends AComponentAnimate {
37
42
  onBind() {
38
43
  const animator = createComponentAnimator(this.target);
39
44
  this._animator = animator;
40
- const duration = this.duration, easing = this.easing, {config: config, diffAttrs: diffAttrs} = this.params;
41
- animator.animate(this.target, {
45
+ const duration = this.duration, easing = this.easing, {diffAttrs: diffAttrs} = this.params;
46
+ commitUpdateAnimationTarget(this.target, Object.assign({}, diffAttrs)), animator.animate(this.target, {
42
47
  type: "to",
43
48
  to: Object.assign({}, diffAttrs),
44
49
  duration: duration,
@@ -49,7 +54,10 @@ export class AxisUpdate extends AComponentAnimate {
49
54
  }), this.completeBind(animator);
50
55
  }
51
56
  deleteSelfAttr(key) {
52
- super.deleteSelfAttr(key), this._animator.deleteSelfAttr(key);
57
+ this.deleteSelfAttrs([ key ]);
58
+ }
59
+ deleteSelfAttrs(keys) {
60
+ super.deleteSelfAttrs(keys), this._animator.deleteSelfAttrs(keys);
53
61
  }
54
62
  tryPreventConflict() {}
55
63
  }
@@ -1 +1 @@
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;QA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AW,SAAQ,iBAAsB;IACpD,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,GAAG,IAAI,CAAC,MAAM,CAAC;QAmB1C,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,EAAE,IAAI;YACV,EAAE,oBAAO,SAAS,CAAE;YACpB,QAAQ;YACR,MAAM;YACN,gBAAgB,EAAE;gBAChB,SAAS,oBAAO,SAAS,CAAE;aAC5B;SACF,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGD,cAAc,CAAC,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;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
+ {"version":3,"sources":["../src/animation/axis-animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACxG,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAK7D,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,C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,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,SAAS,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QAmBlC,2BAA2B,CAAC,IAAI,CAAC,MAAM,oBAAO,SAAS,EAAG,CAAC;QAC3D,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,EAAE,IAAI;YACV,EAAE,oBAAO,SAAS,CAAE;YACpB,QAAQ;YACR,MAAM;YACN,gBAAgB,EAAE;gBAChB,SAAS,oBAAO,SAAS,CAAE;aAC5B;SACF,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAGD,cAAc,CAAC,GAAW;QACxB,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,eAAe,CAAC,IAAc;QAC5B,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACvC,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';\nimport { commitUpdateAnimationTarget } from './static-truth';\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 commitUpdateAnimationTarget(this.target, { x: newX, y: newY }, { 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 { 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 commitUpdateAnimationTarget(this.target, { ...diffAttrs });\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 this.deleteSelfAttrs([key]);\n }\n\n deleteSelfAttrs(keys: string[]): void {\n super.deleteSelfAttrs(keys);\n this._animator.deleteSelfAttrs(keys);\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"]}
@@ -0,0 +1,13 @@
1
+ import type { IAnimate, IGraphic } from '@visactor/vrender-core';
2
+ export type ExitReleaseCallbackState = {
3
+ finalized: boolean;
4
+ removeFromParent: boolean;
5
+ onComplete: (() => void)[];
6
+ };
7
+ export type AnimateExitReleaseState = ExitReleaseCallbackState & {
8
+ pendingAnimates: Set<IAnimate>;
9
+ };
10
+ export declare function collectTrackedAnimates(graphic: IGraphic, animates?: IAnimate[], visited?: Set<IAnimate>): IAnimate[];
11
+ export declare function appendExitReleaseCallback(state: ExitReleaseCallbackState | undefined, callback?: () => void): void;
12
+ export declare function runExitReleaseCallbacks(callbacks: (() => void)[]): void;
13
+ export declare function bindExitReleaseAnimates<T extends AnimateExitReleaseState>(exitAnimates: IAnimate[], getState: () => T | undefined, finalize: () => void): void;
@@ -0,0 +1,31 @@
1
+ export function collectTrackedAnimates(graphic, animates = [], visited = new Set) {
2
+ var _a, _b, _c, _d, _e;
3
+ const trackedAnimates = null !== (_c = null === (_b = (_a = graphic).getTrackedAnimates) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : graphic.animates;
4
+ return null == trackedAnimates || trackedAnimates.forEach((animate => {
5
+ animate && !visited.has(animate) && (visited.add(animate), animates.push(animate));
6
+ })), null === (_e = (_d = graphic).forEachChildren) || void 0 === _e || _e.call(_d, (child => {
7
+ collectTrackedAnimates(child, animates, visited);
8
+ })), animates;
9
+ }
10
+
11
+ export function appendExitReleaseCallback(state, callback) {
12
+ callback && (null == state || state.onComplete.push(callback));
13
+ }
14
+
15
+ export function runExitReleaseCallbacks(callbacks) {
16
+ callbacks.forEach((callback => {
17
+ callback();
18
+ }));
19
+ }
20
+
21
+ export function bindExitReleaseAnimates(exitAnimates, getState, finalize) {
22
+ const finish = animate => {
23
+ const state = getState();
24
+ state && !state.finalized && state.pendingAnimates.has(animate) && (state.pendingAnimates.delete(animate),
25
+ state.pendingAnimates.size || finalize());
26
+ };
27
+ exitAnimates.forEach((animate => {
28
+ animate.onEnd((() => finish(animate))), animate.onRemove((() => finish(animate)));
29
+ }));
30
+ }
31
+ //# sourceMappingURL=exit-release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animation/exit-release.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,sBAAsB,CACpC,OAAiB,EACjB,WAAuB,EAAE,EACzB,UAAyB,IAAI,GAAG,EAAE;;IAElC,MAAM,eAAe,GAAG,MAAA,MAAA,MAAC,OAAe,EAAC,kBAAkB,kDAAI,mCAAK,OAAe,CAAC,QAAQ,CAAC;IAE7F,eAAe,aAAf,eAA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AAC;IAEF,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC","file":"exit-release.js","sourcesContent":["import type { IAnimate, IGraphic, IGroup } from '@visactor/vrender-core';\n\nexport type ExitReleaseCallbackState = {\n finalized: boolean;\n removeFromParent: boolean;\n onComplete: (() => void)[];\n};\n\nexport type AnimateExitReleaseState = ExitReleaseCallbackState & {\n pendingAnimates: Set<IAnimate>;\n};\n\nexport function collectTrackedAnimates(\n graphic: IGraphic,\n animates: IAnimate[] = [],\n visited: Set<IAnimate> = new Set()\n): IAnimate[] {\n const trackedAnimates = (graphic as any).getTrackedAnimates?.() ?? (graphic as any).animates;\n\n trackedAnimates?.forEach((animate: IAnimate) => {\n if (animate && !visited.has(animate)) {\n visited.add(animate);\n animates.push(animate);\n }\n });\n\n (graphic as IGroup).forEachChildren?.((child: IGraphic) => {\n collectTrackedAnimates(child, animates, visited);\n });\n\n return animates;\n}\n\nexport function appendExitReleaseCallback(state: ExitReleaseCallbackState | undefined, callback?: () => void) {\n if (callback) {\n state?.onComplete.push(callback);\n }\n}\n\nexport function runExitReleaseCallbacks(callbacks: (() => void)[]) {\n callbacks.forEach(callback => {\n callback();\n });\n}\n\nexport function bindExitReleaseAnimates<T extends AnimateExitReleaseState>(\n exitAnimates: IAnimate[],\n getState: () => T | undefined,\n finalize: () => void\n) {\n const finish = (animate: IAnimate) => {\n const state = getState();\n if (!state || state.finalized || !state.pendingAnimates.has(animate)) {\n return;\n }\n\n state.pendingAnimates.delete(animate);\n if (!state.pendingAnimates.size) {\n finalize();\n }\n };\n\n exitAnimates.forEach(animate => {\n animate.onEnd(() => finish(animate));\n animate.onRemove(() => finish(animate));\n });\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { type IGraphic } from '@visactor/vrender-core';
2
+ export declare function commitUpdateAnimationTarget(graphic?: IGraphic, targetAttrs?: Record<string, any>, startAttrs?: Record<string, any>): void;
@@ -0,0 +1,14 @@
1
+ import { AttributeUpdateType } from "@visactor/vrender-core";
2
+
3
+ import { cloneDeep } from "@visactor/vutils";
4
+
5
+ export function commitUpdateAnimationTarget(graphic, targetAttrs, startAttrs) {
6
+ var _a, _b, _c, _d;
7
+ if (!graphic || !targetAttrs) return;
8
+ const committedTargetAttrs = cloneDeep(targetAttrs), transientStartAttrs = cloneDeep(null != startAttrs ? startAttrs : graphic.attribute);
9
+ graphic.setAttributes(committedTargetAttrs), null === (_b = (_a = graphic).setFinalAttributes) || void 0 === _b || _b.call(_a, committedTargetAttrs),
10
+ null === (_d = (_c = graphic).setAttributesAndPreventAnimate) || void 0 === _d || _d.call(_c, transientStartAttrs, !1, {
11
+ type: AttributeUpdateType.ANIMATE_BIND
12
+ });
13
+ }
14
+ //# sourceMappingURL=static-truth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animation/static-truth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,UAAU,2BAA2B,CACzC,OAAkB,EAClB,WAAiC,EACjC,UAAgC;;IAEhC,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,EAAE;QAC5B,OAAO;KACR;IAED,MAAM,oBAAoB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvE,OAAO,CAAC,aAAa,CAAC,oBAA2B,CAAC,CAAC;IACnD,MAAA,MAAC,OAAe,EAAC,kBAAkB,mDAAG,oBAAoB,CAAC,CAAC;IAC5D,MAAA,MAAC,OAAe,EAAC,8BAA8B,mDAAG,mBAA0B,EAAE,KAAK,EAAE;QACnF,IAAI,EAAE,mBAAmB,CAAC,YAAY;KACvC,CAAC,CAAC;AACL,CAAC","file":"static-truth.js","sourcesContent":["import { AttributeUpdateType, type IGraphic } from '@visactor/vrender-core';\nimport { cloneDeep } from '@visactor/vutils';\n\nexport function commitUpdateAnimationTarget(\n graphic?: IGraphic,\n targetAttrs?: Record<string, any>,\n startAttrs?: Record<string, any>\n) {\n if (!graphic || !targetAttrs) {\n return;\n }\n\n const committedTargetAttrs = cloneDeep(targetAttrs);\n const transientStartAttrs = cloneDeep(startAttrs ?? graphic.attribute);\n\n graphic.setAttributes(committedTargetAttrs as any);\n (graphic as any).setFinalAttributes?.(committedTargetAttrs);\n (graphic as any).setAttributesAndPreventAnimate?.(transientStartAttrs as any, false, {\n type: AttributeUpdateType.ANIMATE_BIND\n });\n}\n"]}
@@ -1,9 +1,9 @@
1
- import { AnimateMode } from '@visactor/vrender-core';
2
- import type { IGroup } from '@visactor/vrender-core';
1
+ import { AnimateMode, type IGroup } from '@visactor/vrender-core';
3
2
  import { ACustomAnimate } from '@visactor/vrender-animate';
4
3
  export declare class GroupTransition extends ACustomAnimate<any> {
5
4
  target: IGroup;
6
5
  private _newElementAttrMap;
6
+ private _started;
7
7
  mode: AnimateMode;
8
8
  onBind(): void;
9
9
  onStart(): void;
@@ -6,11 +6,14 @@ import { cloneDeep, interpolateString, isEqual, isValidNumber } from "@visactor/
6
6
 
7
7
  import { traverseGroup } from "../../util";
8
8
 
9
+ import { commitUpdateAnimationTarget } from "../../animation/static-truth";
10
+
9
11
  export class GroupTransition extends ACustomAnimate {
10
12
  constructor() {
11
13
  super(...arguments), this.mode = AnimateMode.NORMAL;
12
14
  }
13
15
  onBind() {
16
+ this._started = !1;
14
17
  const currentInnerView = this.target.getInnerView(), prevInnerView = this.target.getPrevInnerView();
15
18
  prevInnerView && (this._newElementAttrMap = {}, traverseGroup(currentInnerView, (el => {
16
19
  var _a, _b, _c, _d, _e, _f;
@@ -27,7 +30,7 @@ export class GroupTransition extends ACustomAnimate {
27
30
  fillOpacity: null !== (_b = newProps.fillOpacity) && void 0 !== _b ? _b : 1,
28
31
  strokeOpacity: null !== (_c = newProps.strokeOpacity) && void 0 !== _c ? _c : 1
29
32
  })
30
- }, el.setAttributes(oldEl.attribute);
33
+ }, commitUpdateAnimationTarget(el, this._newElementAttrMap[el.id].attrs, cloneDeep(oldEl.attribute));
31
34
  }
32
35
  } else {
33
36
  const finalOpacityAttrs = {
@@ -39,7 +42,7 @@ export class GroupTransition extends ACustomAnimate {
39
42
  state: "enter",
40
43
  node: el,
41
44
  attrs: finalOpacityAttrs
42
- }, el.setAttributes({
45
+ }, commitUpdateAnimationTarget(el, finalOpacityAttrs, {
43
46
  opacity: 0,
44
47
  fillOpacity: 0,
45
48
  strokeOpacity: 0
@@ -49,6 +52,8 @@ export class GroupTransition extends ACustomAnimate {
49
52
  })));
50
53
  }
51
54
  onStart() {
55
+ if (this._started) return;
56
+ this._started = !0;
52
57
  let duration = this.duration, easing = this.easing;
53
58
  this._newElementAttrMap && Object.keys(this._newElementAttrMap).forEach((id => {
54
59
  var _a;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/axis/animate/group-transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,OAAO,eAAgB,SAAQ,cAAmB;IAAxD;;QAIE,SAAI,GAAG,WAAW,CAAC,MAAM,CAAC;IAgG5B,CAAC;IA9FC,MAAM;QAEJ,MAAM,gBAAgB,GAAG,IAAI,CAAC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cAAc,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;gCACzD,OAAO,IAAI,CAAC;6BACb;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC;yBAED,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;qBAAM;oBACJ,IAAiB;yBACf,OAAO,EAAE;yBAET,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF","file":"group-transition.js","sourcesContent":["import { AnimateMode } from '@visactor/vrender-core';\nimport type { EasingType, IGraphic, IGroup } from '@visactor/vrender-core';\nimport { ACustomAnimate } from '@visactor/vrender-animate';\nimport type { Dict } from '@visactor/vutils';\nimport { cloneDeep, interpolateString, isEqual, isValidNumber } from '@visactor/vutils';\nimport { traverseGroup } from '../../util';\n\nexport class GroupTransition extends ACustomAnimate<any> {\n declare target: IGroup;\n\n private _newElementAttrMap: Dict<any>;\n mode = AnimateMode.NORMAL; // 组件的群组动画不需要设置走 AnimateMode.SET_ATTR_IMMEDIATELY\n\n onBind(): void {\n // @ts-ignore\n const currentInnerView = this.target.getInnerView();\n // @ts-ignore\n const prevInnerView = this.target.getPrevInnerView();\n if (!prevInnerView) {\n return;\n }\n\n this._newElementAttrMap = {};\n\n // 遍历新的场景树,将新节点属性更新为旧节点\n // TODO: 目前只处理更新场景\n traverseGroup(currentInnerView, (el: IGraphic) => {\n if ((el as IGraphic).type !== 'group' && el.id) {\n const oldEl = prevInnerView[el.id];\n if (oldEl) {\n if (!isEqual((el as IGraphic).attribute, (oldEl as IGraphic).attribute)) {\n // 更新\n const newProps = cloneDeep((el as IGraphic).attribute);\n this._newElementAttrMap[el.id] = {\n state: 'update',\n node: el,\n attrs: {\n ...newProps,\n opacity: newProps.opacity ?? 1,\n fillOpacity: newProps.fillOpacity ?? 1,\n strokeOpacity: newProps.strokeOpacity ?? 1\n }\n };\n\n (el as IGraphic).setAttributes((oldEl as IGraphic).attribute);\n }\n } else {\n // 新入场元素,进行 fadeIn 动画\n const finalOpacityAttrs = {\n opacity: el.attribute.opacity ?? 1,\n fillOpacity: el.attribute.fillOpacity ?? 1,\n strokeOpacity: el.attribute.strokeOpacity ?? 1\n };\n this._newElementAttrMap[el.id] = {\n state: 'enter',\n node: el,\n attrs: finalOpacityAttrs\n };\n (el as IGraphic).setAttributes({\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n });\n }\n }\n });\n }\n\n onStart(): void {\n let duration = this.duration;\n let easing = this.easing;\n\n // 新的场景树\n this._newElementAttrMap &&\n Object.keys(this._newElementAttrMap).forEach(id => {\n const { node, attrs, state } = this._newElementAttrMap[id];\n if (state === 'enter') {\n const { enter = {} } = this.params ?? {};\n duration = isValidNumber(enter.duration) ? enter.duration : duration;\n easing = enter.easing ? enter.easing : easing;\n }\n if ((node as IGraphic).type === 'path') {\n (node as IGraphic)\n .animate({\n interpolate(key: string, ratio: number, from: any, to: any, nextAttributes: any) {\n if (key === 'path') {\n nextAttributes.path = interpolateString(from, to)(ratio);\n return true;\n }\n\n return false;\n }\n })\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n } else {\n (node as IGraphic)\n .animate()\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n }\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // do nothing\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/axis/animate/group-transition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+C,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAa,MAAM,kBAAk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AAK,GAAG,EAAE,EAAE,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE,CAAC;oBACzC,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;oBACrE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;iBAC/C;gBACD,IAAK,IAAiB,CAAC,IAAI,KAAK,MAAM,EAAE;oBACrC,IAAiB;yBACf,OAAO,CAAC;wBACP,WAAW,CAAC,GAAW,EAAE,KAAa,EAAE,IAAS,EAAE,EAAO,EAAE,cAAmB;4BAC7E,IAAI,GAAG,KAAK,MAAM,EAAE;gCAClB,cAAc,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;gCACzD,OAAO,IAAI,CAAC;6BACb;4BAED,OAAO,KAAK,CAAC;wBACf,CAAC;qBACF,CAAC;yBAED,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;qBAAM;oBACJ,IAAiB;yBACf,OAAO,EAAE;yBAET,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAoB,CAAC,CAAC;iBAC9C;YACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAwB;IAE9D,CAAC;CACF","file":"group-transition.js","sourcesContent":["import { AnimateMode, type EasingType, type IGraphic, type IGroup } from '@visactor/vrender-core';\nimport { ACustomAnimate } from '@visactor/vrender-animate';\nimport { cloneDeep, interpolateString, isEqual, isValidNumber, type Dict } from '@visactor/vutils';\nimport { traverseGroup } from '../../util';\nimport { commitUpdateAnimationTarget } from '../../animation/static-truth';\n\nexport class GroupTransition extends ACustomAnimate<any> {\n declare target: IGroup;\n\n private _newElementAttrMap: Dict<any>;\n private _started: boolean;\n mode = AnimateMode.NORMAL; // 组件的群组动画不需要设置走 AnimateMode.SET_ATTR_IMMEDIATELY\n\n onBind(): void {\n this._started = false;\n // @ts-ignore\n const currentInnerView = this.target.getInnerView();\n // @ts-ignore\n const prevInnerView = this.target.getPrevInnerView();\n if (!prevInnerView) {\n return;\n }\n\n this._newElementAttrMap = {};\n\n // 遍历新的场景树,将新节点属性更新为旧节点\n // TODO: 目前只处理更新场景\n traverseGroup(currentInnerView, (el: IGraphic) => {\n if ((el as IGraphic).type !== 'group' && el.id) {\n const oldEl = prevInnerView[el.id];\n if (oldEl) {\n if (!isEqual((el as IGraphic).attribute, (oldEl as IGraphic).attribute)) {\n // 更新\n const newProps = cloneDeep((el as IGraphic).attribute);\n this._newElementAttrMap[el.id] = {\n state: 'update',\n node: el,\n attrs: {\n ...newProps,\n opacity: newProps.opacity ?? 1,\n fillOpacity: newProps.fillOpacity ?? 1,\n strokeOpacity: newProps.strokeOpacity ?? 1\n }\n };\n\n commitUpdateAnimationTarget(\n el as IGraphic,\n this._newElementAttrMap[el.id].attrs,\n cloneDeep((oldEl as IGraphic).attribute)\n );\n }\n } else {\n // 新入场元素,进行 fadeIn 动画\n const finalOpacityAttrs = {\n opacity: el.attribute.opacity ?? 1,\n fillOpacity: el.attribute.fillOpacity ?? 1,\n strokeOpacity: el.attribute.strokeOpacity ?? 1\n };\n this._newElementAttrMap[el.id] = {\n state: 'enter',\n node: el,\n attrs: finalOpacityAttrs\n };\n commitUpdateAnimationTarget(el as IGraphic, finalOpacityAttrs, {\n opacity: 0,\n fillOpacity: 0,\n strokeOpacity: 0\n });\n }\n }\n });\n }\n\n onStart(): void {\n if (this._started) {\n return;\n }\n this._started = true;\n\n let duration = this.duration;\n let easing = this.easing;\n\n // 新的场景树\n this._newElementAttrMap &&\n Object.keys(this._newElementAttrMap).forEach(id => {\n const { node, attrs, state } = this._newElementAttrMap[id];\n if (state === 'enter') {\n const { enter = {} } = this.params ?? {};\n duration = isValidNumber(enter.duration) ? enter.duration : duration;\n easing = enter.easing ? enter.easing : easing;\n }\n if ((node as IGraphic).type === 'path') {\n (node as IGraphic)\n .animate({\n interpolate(key: string, ratio: number, from: any, to: any, nextAttributes: any) {\n if (key === 'path') {\n nextAttributes.path = interpolateString(from, to)(ratio);\n return true;\n }\n\n return false;\n }\n })\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n } else {\n (node as IGraphic)\n .animate()\n // .wait(delay)\n .to(attrs, duration, easing as EasingType);\n }\n });\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n // do nothing\n }\n}\n"]}
package/es/axis/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { IGroup, ITextGraphicAttribute, TextAlignType, TextBaselineType, IGraphic, IText } from '@visactor/vrender-core';
2
2
  import type { Dict } from '@visactor/vutils';
3
- import type { Point } from '../core/type';
3
+ import type { ComponentExitReleaseOptions, Point } from '../core/type';
4
4
  import type { TagAttributes } from '../tag';
5
5
  import type { AxisBaseAttributes, AxisItem, TransformedAxisItem, TickLineItem } from './type';
6
6
  import { AnimateComponent } from '../animation/animate-component';
@@ -30,6 +30,7 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
30
30
  protected axisContainer: IGroup;
31
31
  private _lastHover;
32
32
  private _lastSelect;
33
+ private _exitReleaseState?;
33
34
  protected _newElementAttrMap: Dict<any>;
34
35
  protected abstract renderLine(container: IGroup): void;
35
36
  abstract isInValidValue(value: number): boolean;
@@ -45,6 +46,9 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
45
46
  textBaseline: TextBaselineType;
46
47
  };
47
48
  getBoundsWithoutRender(attributes: Partial<T>): import("@visactor/vutils").IBounds;
49
+ private _finalizeExitRelease;
50
+ private _runExitAnimationBeforeRelease;
51
+ releaseWithExitAnimation(options?: ComponentExitReleaseOptions): boolean;
48
52
  protected render(): void;
49
53
  protected _prepare(): void;
50
54
  private _bindEvent;
@@ -63,5 +67,5 @@ export declare abstract class AxisBase<T extends AxisBaseAttributes> extends Ani
63
67
  protected getLabelPosition(point: Point, vector: [number, number], text: string | number, style: Partial<ITextGraphicAttribute>): Point;
64
68
  private _transformItems;
65
69
  protected runAnimation(): void;
66
- release(): void;
70
+ release(all?: boolean): void;
67
71
  }
package/es/axis/base.js CHANGED
@@ -20,6 +20,10 @@ import { dispatchClickState, dispatchHoverState, dispatchUnHoverState } from "..
20
20
 
21
21
  import { AnimateComponent } from "../animation/animate-component";
22
22
 
23
+ import { commitUpdateAnimationTarget } from "../animation/static-truth";
24
+
25
+ import { appendExitReleaseCallback, bindExitReleaseAnimates, collectTrackedAnimates, runExitReleaseCallbacks } from "../animation/exit-release";
26
+
23
27
  import { DefaultAxisAnimation } from "./animate/config";
24
28
 
25
29
  export class AxisBase extends AnimateComponent {
@@ -50,14 +54,65 @@ export class AxisBase extends AnimateComponent {
50
54
  return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup),
51
55
  this.attribute = currentAttribute, offscreenGroup.AABBBounds;
52
56
  }
57
+ _finalizeExitRelease() {
58
+ var _a, _b;
59
+ const state = this._exitReleaseState;
60
+ if (null == state ? void 0 : state.finalized) return;
61
+ state && (state.finalized = !0);
62
+ const parent = this.parent, removeFromParent = !!(null == state ? void 0 : state.removeFromParent), callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
63
+ this._exitReleaseState = void 0, this._prevInnerView = null, this._innerView = null,
64
+ this.axisLabelsContainer = null, this.axisContainer = null, this.removeAllChild(!0),
65
+ super.release(!0), removeFromParent && (null === (_b = null != parent ? parent : this.parent) || void 0 === _b || _b.removeChild(this)),
66
+ runExitReleaseCallbacks(callbacks);
67
+ }
68
+ _runExitAnimationBeforeRelease(options = {}) {
69
+ var _a, _b, _c;
70
+ if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent,
71
+ appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
72
+ if (!this.stage || !1 === this.attribute.animation || !1 === this.attribute.animationExit || !this._innerView) return !1;
73
+ if (this._prepare(), !(null === (_a = this._animationConfig) || void 0 === _a ? void 0 : _a.exit)) return !1;
74
+ const exitTargets = new Set;
75
+ if (traverseGroup(this._innerView, (el => {
76
+ "group" !== el.type && exitTargets.add(el);
77
+ })), !exitTargets.size) return !1;
78
+ const existingAnimates = collectTrackedAnimates(this), {delay: delay = 0, duration: duration = DefaultAxisAnimation.duration, easing: easing = DefaultAxisAnimation.easing} = this._animationConfig.exit;
79
+ exitTargets.forEach((target => {
80
+ var _a, _b, _c;
81
+ const startAttrs = {
82
+ opacity: null !== (_a = target.attribute.opacity) && void 0 !== _a ? _a : 1,
83
+ fillOpacity: null !== (_b = target.attribute.fillOpacity) && void 0 !== _b ? _b : 1,
84
+ strokeOpacity: null !== (_c = target.attribute.strokeOpacity) && void 0 !== _c ? _c : 1
85
+ }, endAttrs = {
86
+ opacity: 0,
87
+ fillOpacity: 0,
88
+ strokeOpacity: 0
89
+ };
90
+ commitUpdateAnimationTarget(target, endAttrs, startAttrs), target.animate().wait(delay).to(endAttrs, duration, easing);
91
+ }));
92
+ const exitAnimates = collectTrackedAnimates(this).filter((animate => !existingAnimates.includes(animate)));
93
+ if (!exitAnimates.length) return !1;
94
+ this.setAttribute("childrenPickable", !1), null === (_c = (_b = this._innerView).removeAllEventListeners) || void 0 === _c || _c.call(_b),
95
+ this.releaseStatus = "willRelease";
96
+ const pendingAnimates = new Set(exitAnimates);
97
+ return this._exitReleaseState = {
98
+ pendingAnimates: pendingAnimates,
99
+ finalized: !1,
100
+ removeFromParent: !!options.removeFromParent,
101
+ onComplete: options.onComplete ? [ options.onComplete ] : []
102
+ }, bindExitReleaseAnimates(exitAnimates, (() => this._exitReleaseState), (() => this._finalizeExitRelease())),
103
+ !0;
104
+ }
105
+ releaseWithExitAnimation(options = {}) {
106
+ return "released" !== this.releaseStatus && this._runExitAnimationBeforeRelease(options);
107
+ }
53
108
  render() {
54
- this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView),
109
+ this._exitReleaseState || (this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView),
55
110
  this.removeAllChild(!0), this._innerView = graphicCreator.group({
56
111
  x: 0,
57
112
  y: 0,
58
113
  pickable: !1
59
114
  }), this.add(this._innerView), this._renderInner(this._innerView), this._bindEvent(),
60
- this.runAnimation();
115
+ this.runAnimation());
61
116
  }
62
117
  _prepare() {
63
118
  this._prepareAnimate(DefaultAxisAnimation);
@@ -293,32 +348,28 @@ export class AxisBase extends AnimateComponent {
293
348
  var _a;
294
349
  if ("group" !== el.type && el.id) {
295
350
  const oldEl = prevInnerView[el.id];
296
- if (el.setFinalAttributes(el.attribute), oldEl) {
351
+ if (oldEl) {
297
352
  oldEl.release();
298
- const oldAttrs = oldEl.attribute, finalAttrs = el.getFinalAttribute(), diffAttrs = diff(oldAttrs, finalAttrs);
353
+ const oldAttrs = cloneDeep(oldEl.attribute), finalAttrs = cloneDeep(el.attribute), diffAttrs = diff(oldAttrs, finalAttrs);
299
354
  let hasDiff = Object.keys(diffAttrs).length > 0;
300
- if ("opacity" in oldAttrs && finalAttrs.opacity !== oldAttrs.opacity && (diffAttrs.opacity = null !== (_a = finalAttrs.opacity) && void 0 !== _a ? _a : 1,
301
- hasDiff = !0), animationConfig.update && hasDiff) {
302
- this._newElementAttrMap[el.id] = {
303
- state: "update",
304
- node: el,
305
- attrs: el.attribute
306
- };
307
- const oldAttrs = oldEl.attribute;
308
- el.setAttributes(oldAttrs), el.applyAnimationState([ "update" ], [ {
309
- name: "update",
310
- animation: Object.assign(Object.assign({
311
- selfOnly: !0
312
- }, animationConfig.update), {
313
- type: "axisUpdate",
314
- customParameters: {
315
- config: animationConfig.update,
316
- diffAttrs: diffAttrs,
317
- lastScale: lastScale
318
- }
319
- })
320
- } ]);
321
- }
355
+ "opacity" in oldAttrs && finalAttrs.opacity !== oldAttrs.opacity && (diffAttrs.opacity = null !== (_a = finalAttrs.opacity) && void 0 !== _a ? _a : 1,
356
+ hasDiff = !0), animationConfig.update && hasDiff && (this._newElementAttrMap[el.id] = {
357
+ state: "update",
358
+ node: el,
359
+ attrs: finalAttrs
360
+ }, commitUpdateAnimationTarget(el, finalAttrs, oldAttrs), el.applyAnimationState([ "update" ], [ {
361
+ name: "update",
362
+ animation: Object.assign(Object.assign({
363
+ selfOnly: !0
364
+ }, animationConfig.update), {
365
+ type: "axisUpdate",
366
+ customParameters: {
367
+ config: animationConfig.update,
368
+ diffAttrs: diffAttrs,
369
+ lastScale: lastScale
370
+ }
371
+ })
372
+ } ]));
322
373
  } else animationConfig.enter && (this._newElementAttrMap[el.id] = {
323
374
  state: "enter",
324
375
  node: el,
@@ -339,8 +390,10 @@ export class AxisBase extends AnimateComponent {
339
390
  }));
340
391
  }
341
392
  }
342
- release() {
343
- super.release(), this._prevInnerView = null, this._innerView = null;
393
+ release(all) {
394
+ this._exitReleaseState ? this._finalizeExitRelease() : (all && this.removeAllChild(!0),
395
+ super.release(all), all && this.removeAllChild(!0), this._prevInnerView = null,
396
+ this._innerView = null);
344
397
  }
345
398
  }
346
399
  //# sourceMappingURL=base.js.map