@visactor/vchart 2.0.12-alpha.5 → 2.0.13-alpha.0

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 (178) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +155 -128
  3. package/build/index.js +155 -128
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/callback-disappear.d.ts +10 -0
  7. package/cjs/animation/callback-disappear.js +25 -0
  8. package/cjs/animation/callback-disappear.js.map +1 -0
  9. package/cjs/animation/config.d.ts +0 -6
  10. package/cjs/animation/config.js +3 -29
  11. package/cjs/animation/config.js.map +1 -1
  12. package/cjs/animation/interface.d.ts +6 -3
  13. package/cjs/animation/interface.js.map +1 -1
  14. package/cjs/chart/base/base-chart.d.ts +1 -0
  15. package/cjs/chart/base/base-chart.js +7 -2
  16. package/cjs/chart/base/base-chart.js.map +1 -1
  17. package/cjs/compile/compiler.d.ts +1 -1
  18. package/cjs/compile/compiler.js +16 -15
  19. package/cjs/compile/compiler.js.map +1 -1
  20. package/cjs/compile/grammar-item.js +1 -1
  21. package/cjs/compile/interface/compilable-item.d.ts +1 -0
  22. package/cjs/compile/interface/compilable-item.js.map +1 -1
  23. package/cjs/compile/morph.js +1 -1
  24. package/cjs/compile/state-manager.js +1 -1
  25. package/cjs/compile/util.js +1 -1
  26. package/cjs/component/axis/cartesian/axis.js +4 -1
  27. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  28. package/cjs/component/geo/geo-coordinate.js +3 -2
  29. package/cjs/component/geo/geo-coordinate.js.map +1 -1
  30. package/cjs/component/marker/mark-point/base-mark-point.js +22 -20
  31. package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
  32. package/cjs/component/tooltip/utils/show-tooltip.js +10 -2
  33. package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
  34. package/cjs/constant/animate.d.ts +5 -0
  35. package/cjs/constant/animate.js +15 -0
  36. package/cjs/constant/animate.js.map +1 -0
  37. package/cjs/constant/data.js +1 -2
  38. package/cjs/constant/label.js +2 -1
  39. package/cjs/constant/word-cloud.js +1 -1
  40. package/cjs/core/expression-function.js +2 -1
  41. package/cjs/core/index.d.ts +1 -1
  42. package/cjs/core/index.js +2 -3
  43. package/cjs/core/index.js.map +1 -1
  44. package/cjs/core/vchart.d.ts +3 -0
  45. package/cjs/core/vchart.js +17 -4
  46. package/cjs/core/vchart.js.map +1 -1
  47. package/cjs/env/env.js +1 -1
  48. package/cjs/env/index.js +1 -1
  49. package/cjs/region/interface.d.ts +1 -0
  50. package/cjs/region/interface.js.map +1 -1
  51. package/cjs/series/bar/animation.js +4 -2
  52. package/cjs/series/bar/animation.js.map +1 -1
  53. package/cjs/series/base/base-series.d.ts +0 -1
  54. package/cjs/series/base/base-series.js +2 -7
  55. package/cjs/series/base/base-series.js.map +1 -1
  56. package/cjs/series/circle-packing/animation.js +2 -2
  57. package/cjs/series/circle-packing/animation.js.map +1 -1
  58. package/cjs/series/gauge/animation.js +2 -2
  59. package/cjs/series/gauge/animation.js.map +1 -1
  60. package/cjs/series/heatmap/heatmap.d.ts +1 -1
  61. package/cjs/series/heatmap/heatmap.js +2 -2
  62. package/cjs/series/heatmap/heatmap.js.map +1 -1
  63. package/cjs/series/pie/animation/animation.js +4 -2
  64. package/cjs/series/pie/animation/animation.js.map +1 -1
  65. package/cjs/series/polar/progress-like/animation.js +2 -2
  66. package/cjs/series/polar/progress-like/animation.js.map +1 -1
  67. package/cjs/series/progress/linear/animation.js +4 -2
  68. package/cjs/series/progress/linear/animation.js.map +1 -1
  69. package/cjs/series/radar/animation.js +9 -3
  70. package/cjs/series/radar/animation.js.map +1 -1
  71. package/cjs/series/range-column/animation.js +4 -2
  72. package/cjs/series/range-column/animation.js.map +1 -1
  73. package/cjs/series/rose/animation.js +4 -2
  74. package/cjs/series/rose/animation.js.map +1 -1
  75. package/cjs/series/sankey/animation.js +3 -3
  76. package/cjs/series/sankey/animation.js.map +1 -1
  77. package/cjs/series/sunburst/animation/index.js +4 -2
  78. package/cjs/series/sunburst/animation/index.js.map +1 -1
  79. package/cjs/series/treemap/animation.js +2 -2
  80. package/cjs/series/treemap/animation.js.map +1 -1
  81. package/cjs/series/venn/animation.js +3 -3
  82. package/cjs/series/venn/animation.js.map +1 -1
  83. package/cjs/series/waterfall/animation.js +4 -2
  84. package/cjs/series/waterfall/animation.js.map +1 -1
  85. package/cjs/series/word-cloud/animation.js +1 -1
  86. package/cjs/series/word-cloud/animation.js.map +1 -1
  87. package/cjs/theme/builtin/common/series/heatmap.js +1 -1
  88. package/cjs/theme/builtin/common/series/heatmap.js.map +1 -1
  89. package/cjs/util/type.d.ts +1 -0
  90. package/cjs/util/type.js +6 -2
  91. package/cjs/util/type.js.map +1 -1
  92. package/esm/animation/callback-disappear.d.ts +10 -0
  93. package/esm/animation/callback-disappear.js +17 -0
  94. package/esm/animation/callback-disappear.js.map +1 -0
  95. package/esm/animation/config.d.ts +0 -6
  96. package/esm/animation/config.js +7 -26
  97. package/esm/animation/config.js.map +1 -1
  98. package/esm/animation/interface.d.ts +6 -3
  99. package/esm/animation/interface.js.map +1 -1
  100. package/esm/chart/base/base-chart.d.ts +1 -0
  101. package/esm/chart/base/base-chart.js +7 -1
  102. package/esm/chart/base/base-chart.js.map +1 -1
  103. package/esm/compile/compiler.d.ts +1 -1
  104. package/esm/compile/compiler.js +18 -16
  105. package/esm/compile/compiler.js.map +1 -1
  106. package/esm/compile/grammar-item.js +1 -1
  107. package/esm/compile/interface/compilable-item.d.ts +1 -0
  108. package/esm/compile/interface/compilable-item.js.map +1 -1
  109. package/esm/compile/morph.js +1 -1
  110. package/esm/compile/state-manager.js +1 -1
  111. package/esm/compile/util.js +1 -1
  112. package/esm/component/axis/cartesian/axis.js +4 -1
  113. package/esm/component/axis/cartesian/axis.js.map +1 -1
  114. package/esm/component/geo/geo-coordinate.js +3 -2
  115. package/esm/component/geo/geo-coordinate.js.map +1 -1
  116. package/esm/component/marker/mark-point/base-mark-point.js +22 -20
  117. package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
  118. package/esm/component/tooltip/utils/show-tooltip.js +10 -2
  119. package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
  120. package/esm/constant/animate.d.ts +5 -0
  121. package/esm/constant/animate.js +10 -0
  122. package/esm/constant/animate.js.map +1 -0
  123. package/esm/constant/data.js +1 -2
  124. package/esm/constant/label.js +2 -1
  125. package/esm/constant/word-cloud.js +1 -1
  126. package/esm/core/expression-function.js +2 -1
  127. package/esm/core/index.d.ts +1 -1
  128. package/esm/core/index.js +2 -3
  129. package/esm/core/index.js.map +1 -1
  130. package/esm/core/vchart.d.ts +3 -0
  131. package/esm/core/vchart.js +18 -3
  132. package/esm/core/vchart.js.map +1 -1
  133. package/esm/env/env.js +1 -1
  134. package/esm/env/index.js +1 -1
  135. package/esm/region/interface.d.ts +1 -0
  136. package/esm/region/interface.js.map +1 -1
  137. package/esm/series/bar/animation.js +5 -1
  138. package/esm/series/bar/animation.js.map +1 -1
  139. package/esm/series/base/base-series.d.ts +0 -1
  140. package/esm/series/base/base-series.js +2 -6
  141. package/esm/series/base/base-series.js.map +1 -1
  142. package/esm/series/circle-packing/animation.js +3 -1
  143. package/esm/series/circle-packing/animation.js.map +1 -1
  144. package/esm/series/gauge/animation.js +3 -1
  145. package/esm/series/gauge/animation.js.map +1 -1
  146. package/esm/series/heatmap/heatmap.d.ts +1 -1
  147. package/esm/series/heatmap/heatmap.js +2 -2
  148. package/esm/series/heatmap/heatmap.js.map +1 -1
  149. package/esm/series/pie/animation/animation.js +5 -1
  150. package/esm/series/pie/animation/animation.js.map +1 -1
  151. package/esm/series/polar/progress-like/animation.js +3 -1
  152. package/esm/series/polar/progress-like/animation.js.map +1 -1
  153. package/esm/series/progress/linear/animation.js +5 -1
  154. package/esm/series/progress/linear/animation.js.map +1 -1
  155. package/esm/series/radar/animation.js +9 -3
  156. package/esm/series/radar/animation.js.map +1 -1
  157. package/esm/series/range-column/animation.js +5 -1
  158. package/esm/series/range-column/animation.js.map +1 -1
  159. package/esm/series/rose/animation.js +5 -1
  160. package/esm/series/rose/animation.js.map +1 -1
  161. package/esm/series/sankey/animation.js +3 -1
  162. package/esm/series/sankey/animation.js.map +1 -1
  163. package/esm/series/sunburst/animation/index.js +5 -1
  164. package/esm/series/sunburst/animation/index.js.map +1 -1
  165. package/esm/series/treemap/animation.js +3 -1
  166. package/esm/series/treemap/animation.js.map +1 -1
  167. package/esm/series/venn/animation.js +4 -2
  168. package/esm/series/venn/animation.js.map +1 -1
  169. package/esm/series/waterfall/animation.js +5 -1
  170. package/esm/series/waterfall/animation.js.map +1 -1
  171. package/esm/series/word-cloud/animation.js +1 -1
  172. package/esm/series/word-cloud/animation.js.map +1 -1
  173. package/esm/theme/builtin/common/series/heatmap.js +1 -1
  174. package/esm/theme/builtin/common/series/heatmap.js.map +1 -1
  175. package/esm/util/type.d.ts +1 -0
  176. package/esm/util/type.js +4 -0
  177. package/esm/util/type.js.map +1 -1
  178. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/waterfall/animation.ts"],"names":[],"mappings":";;;AACA,gDAAyD;AACzD,gDAA6C;AAI7C,MAAM,aAAa,GAAyB;IAC1C,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,MAAM,cAAc,GAAyB;IAC3C,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,SAAgB,wBAAwB,CACtC,MAA2B,EAC3B,MAA6B;IAE7B,QAAQ,MAAM,EAAE;QACd,KAAK,QAAQ;YACX,OAAO,aAAa,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,cAAc,CAAC;QACxB;YACE,OAAO,IAAA,qBAAS,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACnC;AACH,CAAC;AAZD,4DAYC;AAEM,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,iBAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,MAA2B,EAAE,MAA6B,EAAE,EAAE;QACpG,OAAO;YACL,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC;YAChD,KAAK,EAAE,IAAA,qBAAS,EAAC,MAAM,EAAE,KAAK,CAAC;YAC/B,IAAI,EAAE,IAAA,sBAAU,EAAC,MAAM,EAAE,KAAK,CAAC;YAC/B,SAAS,EAAE,IAAA,sBAAU,EAAC,MAAM,EAAE,KAAK,CAAC;SACrC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC","file":"animation.js","sourcesContent":["import type { IBarAnimationParams } from '../bar/interface';\nimport { barGrowIn, barGrowOut } from '../bar/animation';\nimport { Factory } from '../../core/factory';\nimport type { WaterfallAppearPreset } from './interface';\nimport type { IAnimationTypeConfig } from '../../animation/interface';\n\nconst Appear_FadeIn: IAnimationTypeConfig = {\n type: 'fadeIn'\n};\n\nconst Appear_ScaleIn: IAnimationTypeConfig = {\n type: 'growCenterIn'\n};\n\nexport function waterfallPresetAnimation(\n params: IBarAnimationParams,\n preset: WaterfallAppearPreset\n): IAnimationTypeConfig {\n switch (preset) {\n case 'fadeIn':\n return Appear_FadeIn;\n case 'scaleIn':\n return Appear_ScaleIn;\n default:\n return barGrowIn(params, false);\n }\n}\n\nexport const registerWaterfallAnimation = () => {\n Factory.registerAnimation('waterfall', (params: IBarAnimationParams, preset: WaterfallAppearPreset) => {\n return {\n appear: waterfallPresetAnimation(params, preset),\n enter: barGrowIn(params, false),\n exit: barGrowOut(params, false),\n disappear: barGrowOut(params, false)\n };\n });\n};\n"]}
1
+ {"version":3,"sources":["../src/series/waterfall/animation.ts"],"names":[],"mappings":";;;AACA,gDAAyD;AACzD,gDAA6C;AAG7C,mDAAkE;AAElE,MAAM,aAAa,GAAyB;IAC1C,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,MAAM,cAAc,GAAyB;IAC3C,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,SAAgB,wBAAwB,CACtC,MAA2B,EAC3B,MAA6B;IAE7B,QAAQ,MAAM,EAAE;QACd,KAAK,QAAQ;YACX,OAAO,aAAa,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,cAAc,CAAC;QACxB;YACE,OAAO,IAAA,qBAAS,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACnC;AACH,CAAC;AAZD,4DAYC;AAEM,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,iBAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,MAA2B,EAAE,MAA6B,EAAE,EAAE;QACpG,OAAO;YACL,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC;YAChD,KAAK,EAAE,IAAA,qBAAS,EAAC,MAAM,EAAE,KAAK,CAAC;YAC/B,IAAI,EAAE,IAAA,sBAAU,EAAC,MAAM,EAAE,KAAK,CAAC;YAC/B,SAAS,EAAE,EAAE,QAAQ,EAAE,iCAAwB,CAAC,SAAS,CAAC,QAAQ,EAAE;SACrE,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC","file":"animation.js","sourcesContent":["import type { IBarAnimationParams } from '../bar/interface';\nimport { barGrowIn, barGrowOut } from '../bar/animation';\nimport { Factory } from '../../core/factory';\nimport type { WaterfallAppearPreset } from './interface';\nimport type { IAnimationTypeConfig } from '../../animation/interface';\nimport { DEFAULT_ANIMATION_CONFIG } from '../../animation/config';\n\nconst Appear_FadeIn: IAnimationTypeConfig = {\n type: 'fadeIn'\n};\n\nconst Appear_ScaleIn: IAnimationTypeConfig = {\n type: 'growCenterIn'\n};\n\nexport function waterfallPresetAnimation(\n params: IBarAnimationParams,\n preset: WaterfallAppearPreset\n): IAnimationTypeConfig {\n switch (preset) {\n case 'fadeIn':\n return Appear_FadeIn;\n case 'scaleIn':\n return Appear_ScaleIn;\n default:\n return barGrowIn(params, false);\n }\n}\n\nexport const registerWaterfallAnimation = () => {\n Factory.registerAnimation('waterfall', (params: IBarAnimationParams, preset: WaterfallAppearPreset) => {\n return {\n appear: waterfallPresetAnimation(params, preset),\n enter: barGrowIn(params, false),\n exit: barGrowOut(params, false),\n disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration }\n };\n });\n};\n"]}
@@ -37,7 +37,7 @@ const registerWordCloudAnimation = () => {
37
37
  type: "fadeOut"
38
38
  },
39
39
  disappear: {
40
- type: "fadeOut"
40
+ duration: config_1.DEFAULT_ANIMATION_CONFIG.disappear.duration
41
41
  }
42
42
  })));
43
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/series/word-cloud/animation.ts"],"names":[],"mappings":";;;AAAA,mDAAkE;AAClE,gDAA6C;AAI7C,SAAS,gBAAgB,CAAC,QAAgB,EAAE,SAAiB,EAAE,SAAiB;IAC9E,IAAI,QAAQ,GAAG,SAAS,GAAG,SAAS,EAAE;QACpC,OAAO,QAAQ,GAAG,CAAC,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAEM,MAAM,yBAAyB,GAAG,CAAC,MAAiC,EAAwB,EAAE;IACnG,OAAO;QACL,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,GAAG;QACb,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YACxB,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;YACjD,MAAM,QAAQ,GAAG,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,KAAI,GAAG,CAAC;YAClD,MAAM,SAAS,GAAG,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,KAAI,iCAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC;YACzF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;YAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;YAC3C,OAAO,KAAK,GAAG,gBAAgB,CAAC,QAAkB,EAAE,SAAmB,EAAE,KAAK,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,yBAAyB,6BAapC;AAEF,SAAgB,wBAAwB,CACtC,MAAiC,EACjC,MAAuC;IAEvC,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,OAAO,EAAE,CAAC;KACX;IACD,QAAQ,MAAM,EAAE;QACd,KAAK,QAAQ;YACX,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC5B,KAAK,SAAS,CAAC;QACf;YACE,OAAO,IAAA,iCAAyB,EAAC,MAAM,CAAC,CAAC;KAC5C;AACH,CAAC;AAdD,4DAcC;AAEM,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,iBAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC,MAAiC,EAAE,MAA6B,EAAE,EAAE,CAAC,CAAC;QAC5G,MAAM,EAAE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC;QAChD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACzB,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAPW,QAAA,0BAA0B,8BAOrC","file":"animation.js","sourcesContent":["import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config';\nimport { Factory } from '../../core/factory';\nimport type { IWordcloudAnimationParams, WordcloudAppearPreset } from './interface';\nimport type { IAnimationTypeConfig } from '../../animation/interface';\n\nfunction computeWordDelay(duration: number, totalTime: number, wordCount: number) {\n if (duration * wordCount < totalTime) {\n return duration + (totalTime - wordCount * duration) / (wordCount - 1);\n }\n return (totalTime - duration) / (wordCount - 1);\n}\n\nexport const WordCloudScaleInAnimation = (params: IWordcloudAnimationParams): IAnimationTypeConfig => {\n return {\n type: 'scaleIn',\n duration: 200,\n delay: (datum, graphic) => {\n const animationConfig = params.animationConfig();\n const duration = animationConfig?.duration || 200;\n const totalTime = animationConfig?.totalTime || DEFAULT_ANIMATION_CONFIG.appear.duration;\n const count = graphic.context.graphicCount;\n const index = graphic.context.graphicIndex;\n return index * computeWordDelay(duration as number, totalTime as number, count);\n }\n };\n};\n\nexport function wordcloudPresetAnimation(\n params: IWordcloudAnimationParams,\n preset: WordcloudAppearPreset | boolean\n): IAnimationTypeConfig {\n if (preset === false) {\n return {};\n }\n switch (preset) {\n case 'fadeIn':\n return { type: 'fadeIn' };\n case 'scaleIn':\n default:\n return WordCloudScaleInAnimation(params);\n }\n}\n\nexport const registerWordCloudAnimation = () => {\n Factory.registerAnimation('wordCloud', (params: IWordcloudAnimationParams, preset: WordcloudAppearPreset) => ({\n appear: wordcloudPresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n disappear: { type: 'fadeOut' }\n }));\n};\n"]}
1
+ {"version":3,"sources":["../src/series/word-cloud/animation.ts"],"names":[],"mappings":";;;AAAA,mDAAkE;AAClE,gDAA6C;AAI7C,SAAS,gBAAgB,CAAC,QAAgB,EAAE,SAAiB,EAAE,SAAiB;IAC9E,IAAI,QAAQ,GAAG,SAAS,GAAG,SAAS,EAAE;QACpC,OAAO,QAAQ,GAAG,CAAC,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAEM,MAAM,yBAAyB,GAAG,CAAC,MAAiC,EAAwB,EAAE;IACnG,OAAO;QACL,IAAI,EAAE,SAAS;QACf,QAAQ,EA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E,QAAQ,EAAE,iCAAwB,CAAC,SAAS,CAAC,QAAQ,EAAE;KACrE,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAPW,QAAA,0BAA0B,8BAOrC","file":"animation.js","sourcesContent":["import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config';\nimport { Factory } from '../../core/factory';\nimport type { IWordcloudAnimationParams, WordcloudAppearPreset } from './interface';\nimport type { IAnimationTypeConfig } from '../../animation/interface';\n\nfunction computeWordDelay(duration: number, totalTime: number, wordCount: number) {\n if (duration * wordCount < totalTime) {\n return duration + (totalTime - wordCount * duration) / (wordCount - 1);\n }\n return (totalTime - duration) / (wordCount - 1);\n}\n\nexport const WordCloudScaleInAnimation = (params: IWordcloudAnimationParams): IAnimationTypeConfig => {\n return {\n type: 'scaleIn',\n duration: 200,\n delay: (datum, graphic) => {\n const animationConfig = params.animationConfig();\n const duration = animationConfig?.duration || 200;\n const totalTime = animationConfig?.totalTime || DEFAULT_ANIMATION_CONFIG.appear.duration;\n const count = graphic.context.graphicCount;\n const index = graphic.context.graphicIndex;\n return index * computeWordDelay(duration as number, totalTime as number, count);\n }\n };\n};\n\nexport function wordcloudPresetAnimation(\n params: IWordcloudAnimationParams,\n preset: WordcloudAppearPreset | boolean\n): IAnimationTypeConfig {\n if (preset === false) {\n return {};\n }\n switch (preset) {\n case 'fadeIn':\n return { type: 'fadeIn' };\n case 'scaleIn':\n default:\n return WordCloudScaleInAnimation(params);\n }\n}\n\nexport const registerWordCloudAnimation = () => {\n Factory.registerAnimation('wordCloud', (params: IWordcloudAnimationParams, preset: WordcloudAppearPreset) => ({\n appear: wordcloudPresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n disappear: { duration: DEFAULT_ANIMATION_CONFIG.disappear.duration }\n }));\n};\n"]}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  }), exports.heatmap = void 0, exports.heatmap = {
6
6
  cell: {
7
7
  style: {
8
- shape: "square",
8
+ shape: "rect",
9
9
  fillOpacity: 1
10
10
  }
11
11
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme/builtin/common/series/heatmap.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAwB;IAC1C,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,CAAC;SACf;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE,KAAK;KACf;CACF,CAAC","file":"heatmap.js","sourcesContent":["import type { IHeatmapSeriesTheme } from '../../../../series/heatmap/interface';\n\nexport const heatmap: IHeatmapSeriesTheme = {\n cell: {\n style: {\n shape: 'square',\n fillOpacity: 1\n }\n },\n cellBackground: {\n visible: false\n }\n};\n"]}
1
+ {"version":3,"sources":["../src/theme/builtin/common/series/heatmap.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAwB;IAC1C,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,CAAC;SACf;KACF;IACD,cAAc,EAAE;QACd,OAAO,EAAE,KAAK;KACf;CACF,CAAC","file":"heatmap.js","sourcesContent":["import type { IHeatmapSeriesTheme } from '../../../../series/heatmap/interface';\n\nexport const heatmap: IHeatmapSeriesTheme = {\n cell: {\n style: {\n shape: 'rect',\n fillOpacity: 1\n }\n },\n cellBackground: {\n visible: false\n }\n};\n"]}
@@ -5,3 +5,4 @@ export declare function couldBeValidNumber(v: any): boolean;
5
5
  export declare function toValidNumber(v: any): number;
6
6
  export declare function isNumeric(value: string): boolean;
7
7
  export declare function isDataDomainSpec(domain: any): domain is IDataDomainSpec[];
8
+ export declare function isClass(obj: any): boolean;
package/cjs/util/type.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.isDataDomainSpec = exports.isNumeric = exports.toValidNumber = exports.couldBeValidNumber = exports.isPlainObject = exports.isValidNumber = exports.isArrayLike = exports.isValid = exports.isNil = exports.isNull = exports.isUndefined = exports.isDate = exports.isBoolean = exports.isRegExp = exports.isNumber = exports.isString = exports.isArray = exports.isFunction = exports.isObject = void 0;
5
+ }), exports.isClass = exports.isDataDomainSpec = exports.isNumeric = exports.toValidNumber = exports.couldBeValidNumber = exports.isPlainObject = exports.isValidNumber = exports.isArrayLike = exports.isValid = exports.isNil = exports.isNull = exports.isUndefined = exports.isDate = exports.isBoolean = exports.isRegExp = exports.isNumber = exports.isString = exports.isArray = exports.isFunction = exports.isObject = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils");
8
8
 
@@ -25,6 +25,10 @@ function isDataDomainSpec(domain) {
25
25
  vutils_1.isNil)(domain[0].dataId) && (0, vutils_1.isArray)(domain[0].fields));
26
26
  }
27
27
 
28
+ function isClass(obj) {
29
+ return "function" == typeof obj && /^class\s/.test(obj.toString());
30
+ }
31
+
28
32
  Object.defineProperty(exports, "isObject", {
29
33
  enumerable: !0,
30
34
  get: function() {
@@ -101,5 +105,5 @@ Object.defineProperty(exports, "isObject", {
101
105
  return vutils_1.isPlainObject;
102
106
  }
103
107
  }), exports.couldBeValidNumber = couldBeValidNumber, exports.toValidNumber = toValidNumber,
104
- exports.isNumeric = isNumeric, exports.isDataDomainSpec = isDataDomainSpec;
108
+ exports.isNumeric = isNumeric, exports.isDataDomainSpec = isDataDomainSpec, exports.isClass = isClass;
105
109
  //# sourceMappingURL=type.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/type.ts"],"names":[],"mappings":";;;AAAA,6CAgB0B;AAIxB,yFAnBA,iBAAQ,OAmBA;AACR,2FAnBA,mBAAU,OAmBA;AACV,wFAnBA,gBAAO,OAmBA;AACP,yFAnBA,iBAAQ,OAmBA;AACR,yFAnBA,iBAAQ,OAmBA;AACR,yFAnBA,iBAAQ,OAmBA;AACR,0FAnBA,kBAAS,OAmBA;AACT,uFAnBA,eAAM,OAmBA;AACN,4FAnBA,oBAAW,OAmB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AC,EAAE;QAC/C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AARD,4CAQC","file":"type.js","sourcesContent":["import {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n} from '@visactor/vutils';\nimport type { IDataDomainSpec } from '../typings';\n\nexport {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n};\n\nexport function couldBeValidNumber(v: any) {\n if (v === null || v === undefined || v === '') {\n return false;\n }\n if (isNumber(v)) {\n return true;\n }\n // eslint-disable-next-line no-self-compare\n return +v === +v;\n}\n\nexport function toValidNumber(v: any) {\n if (isValidNumber(v)) {\n return v;\n }\n const value = +v;\n return isValidNumber(value) ? value : 0;\n}\n\n/**\n * 检测一段字符串为合法数值\n */\nexport function isNumeric(value: string): boolean {\n if (typeof value !== 'string') {\n return false;\n }\n return !isNaN(Number(value)) && !isNaN(parseFloat(value));\n}\n\nexport function isDataDomainSpec(domain: any): domain is IDataDomainSpec[] {\n if (!domain || domain.length === 0) {\n return false;\n }\n if (isNil(domain[0]) || isNil(domain[0].dataId)) {\n return false;\n }\n return isArray(domain[0].fields);\n}\n"]}
1
+ {"version":3,"sources":["../src/util/type.ts"],"names":[],"mappings":";;;AAAA,6CAgB0B;AAIxB,yFAnBA,iBAAQ,OAmBA;AACR,2FAnBA,mBAAU,OAmBA;AACV,wFAnBA,gBAAO,OAmBA;AACP,yFAnBA,iBAAQ,OAmBA;AACR,yFAnBA,iBAAQ,OAmBA;AACR,yFAnBA,iBAAQ,OAmBA;AACR,0FAnBA,kBAAS,OAmBA;AACT,uFAnBA,eAAM,O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AAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;QAC/C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAA,gBAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AARD,4CAQC;AAGD,SAAgB,OAAO,CAAC,GAAQ;IAC9B,OAAO,OAAO,GAAG,KAAK,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;AACtE,CAAC;AAFD,0BAEC","file":"type.js","sourcesContent":["import {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n} from '@visactor/vutils';\nimport type { IDataDomainSpec } from '../typings';\n\nexport {\n isObject,\n isFunction,\n isArray,\n isString,\n isNumber,\n isRegExp,\n isBoolean,\n isDate,\n isUndefined,\n isNull,\n isNil,\n isValid,\n isArrayLike,\n isValidNumber,\n isPlainObject\n};\n\nexport function couldBeValidNumber(v: any) {\n if (v === null || v === undefined || v === '') {\n return false;\n }\n if (isNumber(v)) {\n return true;\n }\n // eslint-disable-next-line no-self-compare\n return +v === +v;\n}\n\nexport function toValidNumber(v: any) {\n if (isValidNumber(v)) {\n return v;\n }\n const value = +v;\n return isValidNumber(value) ? value : 0;\n}\n\n/**\n * 检测一段字符串为合法数值\n */\nexport function isNumeric(value: string): boolean {\n if (typeof value !== 'string') {\n return false;\n }\n return !isNaN(Number(value)) && !isNaN(parseFloat(value));\n}\n\nexport function isDataDomainSpec(domain: any): domain is IDataDomainSpec[] {\n if (!domain || domain.length === 0) {\n return false;\n }\n if (isNil(domain[0]) || isNil(domain[0].dataId)) {\n return false;\n }\n return isArray(domain[0].fields);\n}\n\n// 可靠的class判定函数\nexport function isClass(obj: any): boolean {\n return typeof obj === 'function' && /^class\\s/.test(obj.toString());\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { AStageAnimate } from '@visactor/vrender-animate';
2
+ import { EasingType } from '@visactor/vrender-core';
3
+ export declare class CallbackDisappearAnimate extends AStageAnimate<any> {
4
+ protected currentAnimationRatio: number;
5
+ protected animationTime: number;
6
+ constructor(from: null, to: null, duration: number, easing: EasingType, params: any);
7
+ onUpdate(end: boolean, ratio: number, out: any): void;
8
+ protected getAnimationTime(): number;
9
+ protected afterStageRender(stage: any, canvas: HTMLCanvasElement): void;
10
+ }
@@ -0,0 +1,17 @@
1
+ import { AStageAnimate } from "@visactor/vrender-animate";
2
+
3
+ export class CallbackDisappearAnimate extends AStageAnimate {
4
+ constructor(from, to, duration, easing, params) {
5
+ super(from, to, duration, easing, params), this.currentAnimationRatio = 0, this.animationTime = 0;
6
+ }
7
+ onUpdate(end, ratio, out) {
8
+ super.onUpdate(end, ratio, out), this.currentAnimationRatio = ratio, this.animationTime = ratio * Math.PI * 2;
9
+ }
10
+ getAnimationTime() {
11
+ return this.currentAnimationRatio > 0 ? this.animationTime : Date.now() / 1e3;
12
+ }
13
+ afterStageRender(stage, canvas) {
14
+ var _a, _b;
15
+ return null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.callBack) || void 0 === _b ? void 0 : _b.call(_a, stage, canvas, this.currentAnimationRatio, this.animationTime);
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/animation/callback-disappear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM1D,MAAM,OAAO,wBAAyB,SAAQ,aAAkB;IAI9D,YAAY,IAAU,EAAE,EAAQ,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAW;QACjF,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAJlC,0BAAqB,GAAG,CAAC,CAAC;QAC1B,kBAAa,GAAG,CAAC,CAAC;IAI5B,CAAC;IAED,QAAQ,CAAC,GAAY,EAAE,KAAa,EAAE,GAAQ;QAC5C,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IAKS,gBAAgB;QACxB,IAAI,IAAI,CAAC,qBAAqB,GAAG,CAAC,EAAE;YAClC,OAAO,IAAI,CAAC,aAAa,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;IAC7B,CAAC;IAES,gBAAgB,CAAC,KAAU,EAAE,MAAyB;;QAC9D,OAAO,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,QAAQ,mDAAG,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAChG,CAAC;CACF","file":"callback-disappear.js","sourcesContent":["import { AStageAnimate } from '@visactor/vrender-animate';\nimport { EasingType } from '@visactor/vrender-core';\n\n/**\n * 特效动画基类,提取公共的WebGL和Canvas 2D操作\n */\nexport class CallbackDisappearAnimate extends AStageAnimate<any> {\n protected currentAnimationRatio = 0;\n protected animationTime = 0;\n\n constructor(from: null, to: null, duration: number, easing: EasingType, params: any) {\n super(from, to, duration, easing, params);\n }\n\n onUpdate(end: boolean, ratio: number, out: any): void {\n super.onUpdate(end, ratio, out);\n this.currentAnimationRatio = ratio;\n this.animationTime = ratio * Math.PI * 2;\n }\n\n /**\n * 获取基于动画进度的时间\n */\n protected getAnimationTime(): number {\n if (this.currentAnimationRatio > 0) {\n return this.animationTime;\n }\n return Date.now() / 1000.0;\n }\n\n protected afterStageRender(stage: any, canvas: HTMLCanvasElement): void {\n return this.params?.callBack?.(stage, canvas, this.currentAnimationRatio, this.animationTime);\n }\n}\n"]}
@@ -35,9 +35,6 @@ export declare const ScaleInOutAnimation: {
35
35
  exit: {
36
36
  type: string;
37
37
  };
38
- disappear: {
39
- type: string;
40
- };
41
38
  };
42
39
  export declare const FadeInOutAnimation: {
43
40
  appear: {
@@ -49,9 +46,6 @@ export declare const FadeInOutAnimation: {
49
46
  exit: {
50
47
  type: string;
51
48
  };
52
- disappear: {
53
- type: string;
54
- };
55
49
  };
56
50
  export declare const registerScaleInOutAnimation: () => void;
57
51
  export declare const registerFadeInOutAnimation: () => void;
@@ -1,9 +1,13 @@
1
- import { TagPointsUpdate, ClipDirectionAnimate, AnimateExecutor, ScaleIn, ScaleOut, FadeIn, FadeOut, MoveIn, MoveOut, RotateIn, RotateOut, Update, State, GrowHeightIn, GrowHeightOut, GrowWidthIn, GrowWidthOut, GrowCenterIn, GrowCenterOut, GrowRadiusIn, GrowRadiusOut, GrowAngleIn, GrowAngleOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, ClipIn, ClipOut, FromTo, Dissolve, Grayscale, Distortion, Particle, Glitch, GaussianBlur, Pixelation } from "@visactor/vrender-animate";
1
+ import { TagPointsUpdate, ClipDirectionAnimate, AnimateExecutor, ScaleIn, ScaleOut, FadeIn, FadeOut, MoveIn, MoveOut, RotateIn, RotateOut, Update, State, GrowHeightIn, GrowHeightOut, GrowWidthIn, GrowWidthOut, GrowCenterIn, GrowCenterOut, GrowRadiusIn, GrowRadiusOut, GrowAngleIn, GrowAngleOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, ClipIn, ClipOut, FromTo } from "@visactor/vrender-animate";
2
2
 
3
3
  import { linePresetAnimation } from "../series/line/animation";
4
4
 
5
5
  import { Factory } from "../core/factory";
6
6
 
7
+ import { CallbackDisappearAnimate } from "./callback-disappear";
8
+
9
+ import { BuiltIn_DISAPPEAR_ANIMATE_NAME } from "../constant/animate";
10
+
7
11
  export const DEFAULT_ANIMATION_CONFIG = {
8
12
  appear: {
9
13
  duration: 1e3,
@@ -41,9 +45,6 @@ export const ScaleInOutAnimation = {
41
45
  },
42
46
  exit: {
43
47
  type: "scaleOut"
44
- },
45
- disappear: {
46
- type: "scaleOut"
47
48
  }
48
49
  };
49
50
 
@@ -56,9 +57,6 @@ export const FadeInOutAnimation = {
56
57
  },
57
58
  exit: {
58
59
  type: "fadeOut"
59
- },
60
- disappear: {
61
- type: "fadeOut"
62
60
  }
63
61
  };
64
62
 
@@ -82,17 +80,6 @@ export const registerCartesianGroupClipAnimation = () => {
82
80
  height: params.height(),
83
81
  orient: params.orient()
84
82
  })
85
- },
86
- disappear: {
87
- custom: ClipDirectionAnimate,
88
- customParameters: (datum, g) => ({
89
- animationType: "out",
90
- group: g,
91
- direction: params.direction(),
92
- width: params.width(),
93
- height: params.height(),
94
- orient: params.orient()
95
- })
96
83
  }
97
84
  })));
98
85
  };
@@ -118,10 +105,7 @@ const lineOrAreaAnimation = (params, preset) => ({
118
105
  customParameters: {
119
106
  clipRangeByDimension: "horizontal" === params.direction ? "y" : "x"
120
107
  }
121
- } ],
122
- disappear: {
123
- type: "clipOut"
124
- }
108
+ } ]
125
109
  });
126
110
 
127
111
  export const registerLineAnimation = () => {
@@ -164,9 +148,6 @@ export const registerPolygonAnimation = () => {
164
148
  };
165
149
 
166
150
  export const registerStageAnimation = () => {
167
- AnimateExecutor.registerBuiltInAnimate("distortion", Distortion), AnimateExecutor.registerBuiltInAnimate("particle", Particle),
168
- AnimateExecutor.registerBuiltInAnimate("pixelation", Pixelation), AnimateExecutor.registerBuiltInAnimate("gaussianBlur", GaussianBlur),
169
- AnimateExecutor.registerBuiltInAnimate("glitch", Glitch), AnimateExecutor.registerBuiltInAnimate("grayscale", Grayscale),
170
- AnimateExecutor.registerBuiltInAnimate("dissolve", Dissolve);
151
+ AnimateExecutor.registerBuiltInAnimate(BuiltIn_DISAPPEAR_ANIMATE_NAME, CallbackDisappearAnimate);
171
152
  };
172
153
  //# sourceMappingURL=config.js.map
@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AAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjE,eAAe,CAAC,sBAAsB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC7D,eAAe,CAAC,sBAAsB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjE,eAAe,CAAC,sBAAsB,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IACrE,eAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,eAAe,CAAC,sBAAsB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAC/D,eAAe,CAAC,sBAAsB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC,CAAC","file":"config.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IGraphic } from '@visactor/vrender-core';\nimport {\n TagPointsUpdate,\n ClipDirectionAnimate,\n AnimateExecutor,\n ScaleIn,\n ScaleOut,\n FadeIn,\n FadeOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n Update,\n State,\n GrowHeightIn,\n GrowHeightOut,\n GrowWidthIn,\n GrowWidthOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n ClipIn,\n ClipOut,\n FromTo,\n Dissolve,\n Grayscale,\n Distortion,\n Particle,\n Glitch,\n GaussianBlur,\n Pixelation\n} from '@visactor/vrender-animate';\n\nimport type { ILineAnimationParams, LineAppearPreset } from '../series/line/interface';\nimport { linePresetAnimation } from '../series/line/animation';\nimport type { MarkAnimationSpec, ICartesianGroupAnimationParams } from './interface';\nimport { Factory } from '../core/factory';\nimport { Direction } from '../typings/space';\n\nexport const DEFAULT_ANIMATION_CONFIG = {\n appear: {\n duration: 1000,\n easing: 'cubicOut'\n },\n update: {\n type: 'update',\n duration: 300,\n easing: 'linear'\n },\n enter: {\n duration: 300,\n easing: 'linear'\n },\n exit: {\n duration: 300,\n easing: 'linear'\n },\n disappear: {\n duration: 500,\n easing: 'cubicIn'\n },\n state: {\n duration: 300,\n easing: 'linear'\n }\n};\n\nexport const ScaleInOutAnimation = {\n appear: { type: 'scaleIn' },\n enter: { type: 'scaleIn' },\n exit: { type: 'scaleOut' },\n disappear: { type: 'scaleOut' }\n};\n\nexport const FadeInOutAnimation = {\n appear: { type: 'fadeIn' },\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n disappear: { type: 'fadeOut' }\n};\n\nexport const registerScaleInOutAnimation = () => {\n Factory.registerAnimation('scaleInOut', () => ScaleInOutAnimation);\n};\n\nexport const registerFadeInOutAnimation = () => {\n Factory.registerAnimation('fadeInOut', () => FadeInOutAnimation);\n};\n\nexport const registerCartesianGroupClipAnimation = () => {\n Factory.registerAnimation('cartesianGroupClip', (params?: ICartesianGroupAnimationParams) => {\n return {\n appear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'in',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n },\n disappear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'out',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n }\n };\n });\n};\n\nconst lineOrAreaAnimation = (params: ILineAnimationParams, preset: LineAppearPreset) => {\n return {\n appear: linePresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n update: [\n {\n type: 'update',\n options: { excludeChannels: ['points', 'defined', 'segments'] }\n },\n {\n channel: ['points', 'segments'],\n custom: TagPointsUpdate,\n duration: DEFAULT_ANIMATION_CONFIG.update.duration,\n easing: DEFAULT_ANIMATION_CONFIG.update.easing,\n customParameters: {\n clipRangeByDimension: params.direction === Direction.horizontal ? 'y' : 'x'\n }\n }\n ],\n disappear: { type: 'clipOut' }\n } as MarkAnimationSpec;\n};\n\nexport const registerLineAnimation = () => {\n Factory.registerAnimation('line', lineOrAreaAnimation);\n};\n\nexport const registerAreaAnimation = () => {\n Factory.registerAnimation('area', lineOrAreaAnimation);\n};\n\nexport const registerBuiltInAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n};\n\nexport const registerRectAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n};\n\nexport const registerArcAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n};\n\nexport const registerLineOrAreaAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n};\n\nexport const registerPolygonAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n};\n\nexport const registerStageAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('distortion', Distortion);\n AnimateExecutor.registerBuiltInAnimate('particle', Particle);\n AnimateExecutor.registerBuiltInAnimate('pixelation', Pixelation);\n AnimateExecutor.registerBuiltInAnimate('gaussianBlur', GaussianBlur);\n AnimateExecutor.registerBuiltInAnimate('glitch', Glitch);\n AnimateExecutor.registerBuiltInAnimate('grayscale', Grayscale);\n AnimateExecutor.registerBuiltInAnimate('dissolve', Dissolve);\n};\n"]}
1
+ {"version":3,"sources":["../src/animation/config.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,EACN,OAAO,EACP,MAAM,E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AAgB,EAAE,cAAc,CAAC,CAAC;IACzE,eAAe,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,eAAe,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,eAAe,CAAC,sBAAsB,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,eAAe,CAAC,sBAAsB,CAAC,8BAA8B,EAAE,wBAAwB,CAAC,CAAC;AACnG,CAAC,CAAC","file":"config.js","sourcesContent":["/* eslint-disable no-duplicate-imports */\nimport type { IGraphic } from '@visactor/vrender-core';\nimport {\n TagPointsUpdate,\n ClipDirectionAnimate,\n AnimateExecutor,\n ScaleIn,\n ScaleOut,\n FadeIn,\n FadeOut,\n MoveIn,\n MoveOut,\n RotateIn,\n RotateOut,\n Update,\n State,\n GrowHeightIn,\n GrowHeightOut,\n GrowWidthIn,\n GrowWidthOut,\n GrowCenterIn,\n GrowCenterOut,\n GrowRadiusIn,\n GrowRadiusOut,\n GrowAngleIn,\n GrowAngleOut,\n GrowPointsIn,\n GrowPointsOut,\n GrowPointsXIn,\n GrowPointsXOut,\n GrowPointsYIn,\n GrowPointsYOut,\n ClipIn,\n ClipOut,\n FromTo\n} from '@visactor/vrender-animate';\n\nimport type { ILineAnimationParams, LineAppearPreset } from '../series/line/interface';\nimport { linePresetAnimation } from '../series/line/animation';\nimport type { MarkAnimationSpec, ICartesianGroupAnimationParams } from './interface';\nimport { Factory } from '../core/factory';\nimport { Direction } from '../typings/space';\nimport { CallbackDisappearAnimate } from './callback-disappear';\nimport { BuiltIn_DISAPPEAR_ANIMATE_NAME } from '../constant/animate';\n\nexport const DEFAULT_ANIMATION_CONFIG = {\n appear: {\n duration: 1000,\n easing: 'cubicOut'\n },\n update: {\n type: 'update',\n duration: 300,\n easing: 'linear'\n },\n enter: {\n duration: 300,\n easing: 'linear'\n },\n exit: {\n duration: 300,\n easing: 'linear'\n },\n disappear: {\n duration: 500,\n easing: 'cubicIn'\n },\n state: {\n duration: 300,\n easing: 'linear'\n }\n};\n\nexport const ScaleInOutAnimation = {\n appear: { type: 'scaleIn' },\n enter: { type: 'scaleIn' },\n exit: { type: 'scaleOut' }\n};\n\nexport const FadeInOutAnimation = {\n appear: { type: 'fadeIn' },\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' }\n};\n\nexport const registerScaleInOutAnimation = () => {\n Factory.registerAnimation('scaleInOut', () => ScaleInOutAnimation);\n};\n\nexport const registerFadeInOutAnimation = () => {\n Factory.registerAnimation('fadeInOut', () => FadeInOutAnimation);\n};\n\nexport const registerCartesianGroupClipAnimation = () => {\n Factory.registerAnimation('cartesianGroupClip', (params?: ICartesianGroupAnimationParams) => {\n return {\n appear: {\n custom: ClipDirectionAnimate,\n customParameters: (datum: any, g: IGraphic) => {\n return {\n animationType: 'in',\n group: g,\n direction: params.direction(),\n width: params.width(),\n height: params.height(),\n orient: params.orient()\n };\n }\n }\n };\n });\n};\n\nconst lineOrAreaAnimation = (params: ILineAnimationParams, preset: LineAppearPreset) => {\n return {\n appear: linePresetAnimation(params, preset),\n enter: { type: 'fadeIn' },\n exit: { type: 'fadeOut' },\n update: [\n {\n type: 'update',\n options: { excludeChannels: ['points', 'defined', 'segments'] }\n },\n {\n channel: ['points', 'segments'],\n custom: TagPointsUpdate,\n duration: DEFAULT_ANIMATION_CONFIG.update.duration,\n easing: DEFAULT_ANIMATION_CONFIG.update.easing,\n customParameters: {\n clipRangeByDimension: params.direction === Direction.horizontal ? 'y' : 'x'\n }\n }\n ]\n } as MarkAnimationSpec;\n};\n\nexport const registerLineAnimation = () => {\n Factory.registerAnimation('line', lineOrAreaAnimation);\n};\n\nexport const registerAreaAnimation = () => {\n Factory.registerAnimation('area', lineOrAreaAnimation);\n};\n\nexport const registerBuiltInAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('scaleIn', ScaleIn);\n AnimateExecutor.registerBuiltInAnimate('scaleOut', ScaleOut);\n AnimateExecutor.registerBuiltInAnimate('fadeIn', FadeIn);\n AnimateExecutor.registerBuiltInAnimate('fadeOut', FadeOut);\n AnimateExecutor.registerBuiltInAnimate('moveIn', MoveIn);\n AnimateExecutor.registerBuiltInAnimate('moveOut', MoveOut);\n AnimateExecutor.registerBuiltInAnimate('rotateIn', RotateIn);\n AnimateExecutor.registerBuiltInAnimate('rotateOut', RotateOut);\n AnimateExecutor.registerBuiltInAnimate('update', Update);\n AnimateExecutor.registerBuiltInAnimate('state', State);\n AnimateExecutor.registerBuiltInAnimate('fromTo', FromTo);\n};\n\nexport const registerRectAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growHeightIn', GrowHeightIn);\n AnimateExecutor.registerBuiltInAnimate('growHeightOut', GrowHeightOut);\n AnimateExecutor.registerBuiltInAnimate('growWidthIn', GrowWidthIn);\n AnimateExecutor.registerBuiltInAnimate('growWidthOut', GrowWidthOut);\n AnimateExecutor.registerBuiltInAnimate('growCenterIn', GrowCenterIn);\n AnimateExecutor.registerBuiltInAnimate('growCenterOut', GrowCenterOut);\n};\n\nexport const registerArcAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growRadiusIn', GrowRadiusIn);\n AnimateExecutor.registerBuiltInAnimate('growRadiusOut', GrowRadiusOut);\n AnimateExecutor.registerBuiltInAnimate('growAngleIn', GrowAngleIn);\n AnimateExecutor.registerBuiltInAnimate('growAngleOut', GrowAngleOut);\n};\n\nexport const registerLineOrAreaAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsIn', GrowPointsIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsXIn', GrowPointsXIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsXOut', GrowPointsXOut);\n AnimateExecutor.registerBuiltInAnimate('growPointsYIn', GrowPointsYIn);\n AnimateExecutor.registerBuiltInAnimate('growPointsYOut', GrowPointsYOut);\n AnimateExecutor.registerBuiltInAnimate('clipIn', ClipIn);\n AnimateExecutor.registerBuiltInAnimate('clipOut', ClipOut);\n};\n\nexport const registerPolygonAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate('growPointsOut', GrowPointsOut);\n};\n\nexport const registerStageAnimation = () => {\n AnimateExecutor.registerBuiltInAnimate(BuiltIn_DISAPPEAR_ANIMATE_NAME, CallbackDisappearAnimate);\n};\n"]}
@@ -1,5 +1,5 @@
1
- import type { ACustomAnimate } from '@visactor/vrender-animate';
2
- import type { IGraphic, EasingType } from '@visactor/vrender-core';
1
+ import type { ACustomAnimate, AStageAnimate } from '@visactor/vrender-animate';
2
+ import type { IGraphic, EasingType, IStage } from '@visactor/vrender-core';
3
3
  import type { IMark, IMarkGraphic } from '../mark/interface/common';
4
4
  import type { BaseMark } from '../mark';
5
5
  export declare enum AnimationStateEnum {
@@ -101,8 +101,11 @@ export interface IAnimationTimeline {
101
101
  controlOptions?: IAnimationControlOptions;
102
102
  }
103
103
  export type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;
104
+ export type IStageAnimationCallback = (stage: IStage, canvas: HTMLCanvasElement, ratio: number, time: number) => void;
104
105
  export interface MarkAnimationSpec {
105
- disappear?: IAnimationConfig | IAnimationConfig[];
106
+ disappear?: IAnimationConfig & {
107
+ callBack?: IStageAnimationCallback | AStageAnimate<any>;
108
+ };
106
109
  appear?: IAnimationConfig | IAnimationConfig[];
107
110
  enter?: IAnimationConfig | IAnimationConfig[];
108
111
  exit?: IAnimationConfig | IAnimationConfig[];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animation/interface.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;IACvB,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uCAAiB,CAAA;IAEjB,mCAAa,CAAA;AACf,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B","file":"interface.js","sourcesContent":["import type { ACustomAnimate } from '@visactor/vrender-animate';\nimport type { IGraphic, EasingType } from '@visactor/vrender-core';\nimport type { IMark, IMarkGraphic } from '../mark/interface/common';\nimport type { BaseMark } from '../mark';\n\nexport enum AnimationStateEnum {\n appear = 'appear',\n disappear = 'disappear',\n enter = 'enter',\n update = 'update',\n state = 'state',\n exit = 'exit',\n normal = 'normal',\n // for hack\n none = 'none'\n}\n\nexport type IAnimationState = keyof typeof AnimationStateEnum;\n\nexport interface IAnimateState {\n animationState: { callback: (datum: any, element: any) => AnimationStateEnum };\n}\n\nexport interface ICartesianGroupAnimationParams {\n direction: () => 'x' | 'y';\n orient: () => 'positive' | 'negative';\n width: () => number;\n height: () => number;\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n g: IGraphic,\n parameters: IAnimationParameters\n) => boolean | void;\n\nexport type GraphicFunctionCallback<T> = (datum: any, g: IGraphic, params: any) => T;\n\nexport type GraphicFunctionValueType<T> = GraphicFunctionCallback<T> | T;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\nexport interface CommonAnimationConfigItem {\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n\n easing?: EasingType;\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n oneByOne?: GraphicFunctionValueType<boolean | number>;\n startTime?: GraphicFunctionValueType<number>;\n totalTime?: GraphicFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: GraphicFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n /** 该动画是否需要忽略子图元 */\n selfOnly?: boolean;\n}\n\nexport interface TypeAnimationConfig extends CommonAnimationConfigItem {\n type: string;\n}\n\nexport type IAnimationChannelFunction = (datum: any, g: IGraphic, mark: IMark) => any;\n\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\n\nexport interface ChannelAnimationConfig extends CommonAnimationConfigItem {\n channel: IAnimationChannelAttrs | string[];\n}\n\nexport type IAnimationTypeConfig = TypeAnimationConfig | ChannelAnimationConfig | CommonAnimationConfigItem;\n\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport type IAnimationEffect = {\n type?: string;\n channel?: IAnimationChannelAttrs | string[];\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n easing?: EasingType;\n options?: GraphicFunctionValueType<any>;\n};\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n}\n\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: GraphicFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: GraphicFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: GraphicFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: GraphicFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: GraphicFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, graphicA: IGraphic, graphicB: IGraphic) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\nexport interface MarkAnimationSpec {\n disappear?: IAnimationConfig | IAnimationConfig[];\n appear?: IAnimationConfig | IAnimationConfig[];\n enter?: IAnimationConfig | IAnimationConfig[];\n exit?: IAnimationConfig | IAnimationConfig[];\n update?: IAnimationConfig | IAnimationConfig[];\n normal?: IAnimationConfig | IAnimationConfig[];\n state?: IStateAnimationConfig;\n}\n\nexport type MarkAnimationType = keyof MarkAnimationSpec;\n\n/**\n * 动画拆分策略接口\n * 用于定义如何拆分一个动画更新为多个步骤\n */\nexport interface IAnimationSplitStrategy {\n /**\n * 策略名称\n */\n name: string;\n\n /**\n * 检查是否应该应用此策略\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 是否应用此策略\n */\n shouldApply: (mark: BaseMark<any>, graphic: IMarkGraphic) => boolean;\n\n /**\n * 拆分动画更新\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 拆分后的动画更新数组(每个元素包含一组属性和执行顺序)\n */\n split: (\n mark: BaseMark<any>,\n graphic: IMarkGraphic\n ) => Array<{\n attrs: Record<string, any>;\n order: number;\n }>;\n}\n"]}
1
+ {"version":3,"sources":["../src/animation/interface.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;IACvB,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,qCAAe,CAAA;IACf,mCAAa,CAAA;IACb,uCAAiB,CAAA;IAEjB,mCAAa,CAAA;AACf,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B","file":"interface.js","sourcesContent":["import type { ACustomAnimate, AStageAnimate } from '@visactor/vrender-animate';\nimport type { IGraphic, EasingType, IStage } from '@visactor/vrender-core';\nimport type { IMark, IMarkGraphic } from '../mark/interface/common';\nimport type { BaseMark } from '../mark';\n\nexport enum AnimationStateEnum {\n appear = 'appear',\n disappear = 'disappear',\n enter = 'enter',\n update = 'update',\n state = 'state',\n exit = 'exit',\n normal = 'normal',\n // for hack\n none = 'none'\n}\n\nexport type IAnimationState = keyof typeof AnimationStateEnum;\n\nexport interface IAnimateState {\n animationState: { callback: (datum: any, element: any) => AnimationStateEnum };\n}\n\nexport interface ICartesianGroupAnimationParams {\n direction: () => 'x' | 'y';\n orient: () => 'positive' | 'negative';\n width: () => number;\n height: () => number;\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n g: IGraphic,\n parameters: IAnimationParameters\n) => boolean | void;\n\nexport type GraphicFunctionCallback<T> = (datum: any, g: IGraphic, params: any) => T;\n\nexport type GraphicFunctionValueType<T> = GraphicFunctionCallback<T> | T;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\nexport interface CommonAnimationConfigItem {\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n\n easing?: EasingType;\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n oneByOne?: GraphicFunctionValueType<boolean | number>;\n startTime?: GraphicFunctionValueType<number>;\n totalTime?: GraphicFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: GraphicFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n /** 该动画是否需要忽略子图元 */\n selfOnly?: boolean;\n}\n\nexport interface TypeAnimationConfig extends CommonAnimationConfigItem {\n type: string;\n}\n\nexport type IAnimationChannelFunction = (datum: any, g: IGraphic, mark: IMark) => any;\n\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\n\nexport interface ChannelAnimationConfig extends CommonAnimationConfigItem {\n channel: IAnimationChannelAttrs | string[];\n}\n\nexport type IAnimationTypeConfig = TypeAnimationConfig | ChannelAnimationConfig | CommonAnimationConfigItem;\n\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport type IAnimationEffect = {\n type?: string;\n channel?: IAnimationChannelAttrs | string[];\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: GraphicFunctionValueType<any>;\n easing?: EasingType;\n options?: GraphicFunctionValueType<any>;\n};\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: GraphicFunctionValueType<number>;\n delay?: GraphicFunctionValueType<number>;\n delayAfter?: GraphicFunctionValueType<number>;\n}\n\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: GraphicFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: GraphicFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: GraphicFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: GraphicFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: GraphicFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, graphicA: IGraphic, graphicB: IGraphic) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\nexport type IStageAnimationCallback = (stage: IStage, canvas: HTMLCanvasElement, ratio: number, time: number) => void;\n\nexport interface MarkAnimationSpec {\n disappear?: IAnimationConfig & {\n callBack?: IStageAnimationCallback | AStageAnimate<any>;\n };\n appear?: IAnimationConfig | IAnimationConfig[];\n enter?: IAnimationConfig | IAnimationConfig[];\n exit?: IAnimationConfig | IAnimationConfig[];\n update?: IAnimationConfig | IAnimationConfig[];\n normal?: IAnimationConfig | IAnimationConfig[];\n state?: IStateAnimationConfig;\n}\n\nexport type MarkAnimationType = keyof MarkAnimationSpec;\n\n/**\n * 动画拆分策略接口\n * 用于定义如何拆分一个动画更新为多个步骤\n */\nexport interface IAnimationSplitStrategy {\n /**\n * 策略名称\n */\n name: string;\n\n /**\n * 检查是否应该应用此策略\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 是否应用此策略\n */\n shouldApply: (mark: BaseMark<any>, graphic: IMarkGraphic) => boolean;\n\n /**\n * 拆分动画更新\n * @param mark 图表标记\n * @param graphic 图形元素\n * @returns 拆分后的动画更新数组(每个元素包含一组属性和执行顺序)\n */\n split: (\n mark: BaseMark<any>,\n graphic: IMarkGraphic\n ) => Array<{\n attrs: Record<string, any>;\n order: number;\n }>;\n}\n"]}
@@ -62,6 +62,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
62
62
  created(transformer: Maybe<IChartSpecTransformer>): void;
63
63
  _initInteractions(): void;
64
64
  init(): void;
65
+ initStageAnimation(): void;
65
66
  reDataFlow(): void;
66
67
  onResize(width: number, height: number, reRender?: boolean): void;
67
68
  updateViewBox(viewBox: IBoundsLike, reLayout: boolean): void;
@@ -48,6 +48,8 @@ import { LayoutZIndex } from "../../constant/layout";
48
48
 
49
49
  import { Interaction } from "../../interaction/interaction";
50
50
 
51
+ import { animationConfig, userAnimationConfig } from "../../animation/utils";
52
+
51
53
  export class BaseChart extends CompilableBase {
52
54
  getSpec() {
53
55
  return this._spec;
@@ -186,7 +188,11 @@ export class BaseChart extends CompilableBase {
186
188
  this._series.forEach((s => s.init({}))), this._components.forEach((c => c.init({
187
189
  dataSet: this._dataSet
188
190
  }))), this._initEvent(), null === (_d = this._initStack) || void 0 === _d || _d.call(this),
189
- this.reDataFlow(), this._initInteractions();
191
+ this.reDataFlow(), this._initInteractions(), this.initStageAnimation();
192
+ }
193
+ initStageAnimation() {
194
+ const compiler = this._option.getCompiler();
195
+ (null == compiler ? void 0 : compiler.setStageAnimationConfig) && compiler.setStageAnimationConfig(animationConfig({}, userAnimationConfig("stage", this._spec, {}), null));
190
196
  }
191
197
  reDataFlow() {
192
198
  this._series.forEach((s => {