@visactor/vchart 2.0.3-alpha.0 → 2.0.3-alpha.2

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 (272) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +980 -897
  3. package/build/index.js +981 -896
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/index.js +2 -1
  7. package/cjs/animation/interface.js +1 -2
  8. package/cjs/animation/utils.js +1 -1
  9. package/cjs/animation/utils.js.map +1 -1
  10. package/cjs/chart/base/base-chart-transformer.js +3 -3
  11. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  12. package/cjs/chart/base/base-chart.d.ts +1 -0
  13. package/cjs/chart/base/base-chart.js +5 -8
  14. package/cjs/chart/base/base-chart.js.map +1 -1
  15. package/cjs/chart/index.d.ts +2 -2
  16. package/cjs/chart/index.js +7 -2
  17. package/cjs/chart/index.js.map +1 -1
  18. package/cjs/chart/interface/chart.d.ts +1 -0
  19. package/cjs/chart/interface/chart.js.map +1 -1
  20. package/cjs/chart/interface/common.d.ts +1 -1
  21. package/cjs/chart/interface/common.js.map +1 -1
  22. package/cjs/chart/util.js +2 -1
  23. package/cjs/compile/compiler.d.ts +1 -0
  24. package/cjs/compile/compiler.js +13 -5
  25. package/cjs/compile/compiler.js.map +1 -1
  26. package/cjs/compile/interface/compilable-item.d.ts +1 -0
  27. package/cjs/compile/interface/compilable-item.js.map +1 -1
  28. package/cjs/compile/interface/compiler.d.ts +5 -0
  29. package/cjs/compile/interface/compiler.js.map +1 -1
  30. package/cjs/component/axis/base-axis.js +14 -13
  31. package/cjs/component/axis/base-axis.js.map +1 -1
  32. package/cjs/component/axis/cartesian/band-axis.d.ts +8 -0
  33. package/cjs/component/axis/cartesian/band-axis.js +9 -0
  34. package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
  35. package/cjs/component/axis/interface/common.js.map +1 -1
  36. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  37. package/cjs/component/axis/mixin/band-axis-mixin.js +15 -1
  38. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  39. package/cjs/component/brush/brush.js +6 -6
  40. package/cjs/component/brush/brush.js.map +1 -1
  41. package/cjs/component/brush/interface.d.ts +1 -0
  42. package/cjs/component/brush/interface.js.map +1 -1
  43. package/cjs/component/crosshair/base.d.ts +1 -1
  44. package/cjs/component/crosshair/base.js +1 -1
  45. package/cjs/component/crosshair/base.js.map +1 -1
  46. package/cjs/component/crosshair/utils/cartesian.js +2 -2
  47. package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
  48. package/cjs/component/custom-mark/custom-mark.js +6 -9
  49. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  50. package/cjs/component/data-zoom/data-filter-base-component.d.ts +0 -1
  51. package/cjs/component/data-zoom/data-filter-base-component.js +13 -19
  52. package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
  53. package/cjs/component/data-zoom/interface.d.ts +0 -3
  54. package/cjs/component/data-zoom/interface.js.map +1 -1
  55. package/cjs/component/data-zoom/util.d.ts +0 -1
  56. package/cjs/component/data-zoom/util.js +3 -4
  57. package/cjs/component/data-zoom/util.js.map +1 -1
  58. package/cjs/component/player/player.js +2 -1
  59. package/cjs/component/player/player.js.map +1 -1
  60. package/cjs/component/tooltip/tooltip.js +8 -3
  61. package/cjs/component/tooltip/tooltip.js.map +1 -1
  62. package/cjs/constant/attribute.js +1 -2
  63. package/cjs/constant/sunburst.js +2 -1
  64. package/cjs/constant/waterfall.js +1 -2
  65. package/cjs/core/index.d.ts +1 -1
  66. package/cjs/core/index.js +1 -1
  67. package/cjs/core/index.js.map +1 -1
  68. package/cjs/core/interface.d.ts +1 -0
  69. package/cjs/core/interface.js +1 -1
  70. package/cjs/core/interface.js.map +1 -1
  71. package/cjs/core/vchart.d.ts +2 -0
  72. package/cjs/core/vchart.js +42 -22
  73. package/cjs/core/vchart.js.map +1 -1
  74. package/cjs/data/initialize.js +1 -1
  75. package/cjs/data/register.js +1 -1
  76. package/cjs/data/transforms/obj-flat.js +1 -4
  77. package/cjs/data/transforms/obj-flat.js.map +1 -1
  78. package/cjs/mark/base/base-line.d.ts +1 -1
  79. package/cjs/mark/base/base-line.js.map +1 -1
  80. package/cjs/mark/base/base-mark.d.ts +6 -2
  81. package/cjs/mark/base/base-mark.js +69 -51
  82. package/cjs/mark/base/base-mark.js.map +1 -1
  83. package/cjs/mark/group.d.ts +3 -2
  84. package/cjs/mark/group.js +15 -13
  85. package/cjs/mark/group.js.map +1 -1
  86. package/cjs/mark/interface/common.d.ts +5 -2
  87. package/cjs/mark/interface/common.js.map +1 -1
  88. package/cjs/model/base-model.d.ts +5 -1
  89. package/cjs/model/base-model.js +7 -0
  90. package/cjs/model/base-model.js.map +1 -1
  91. package/cjs/model/interface.d.ts +5 -2
  92. package/cjs/model/interface.js.map +1 -1
  93. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  94. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +4 -3
  95. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  96. package/cjs/plugin/components/tooltip-handler/utils/style.js +4 -4
  97. package/cjs/plugin/components/tooltip-handler/utils/style.js.map +1 -1
  98. package/cjs/region/region.js.map +1 -1
  99. package/cjs/series/base/base-series-transformer.js +1 -1
  100. package/cjs/series/base/base-series-transformer.js.map +1 -1
  101. package/cjs/series/base/base-series.js +2 -3
  102. package/cjs/series/base/base-series.js.map +1 -1
  103. package/cjs/series/dot/dot.d.ts +0 -1
  104. package/cjs/series/dot/dot.js +6 -29
  105. package/cjs/series/dot/dot.js.map +1 -1
  106. package/cjs/series/dot/interface.d.ts +0 -1
  107. package/cjs/series/dot/interface.js.map +1 -1
  108. package/cjs/series/dot/tooltip-helper.js +2 -3
  109. package/cjs/series/dot/tooltip-helper.js.map +1 -1
  110. package/cjs/series/funnel/funnel.js +0 -2
  111. package/cjs/series/funnel/funnel.js.map +1 -1
  112. package/cjs/series/interface/type.d.ts +0 -3
  113. package/cjs/series/interface/type.js +3 -5
  114. package/cjs/series/interface/type.js.map +1 -1
  115. package/cjs/series/link/constant.js +0 -8
  116. package/cjs/series/link/constant.js.map +1 -1
  117. package/cjs/series/link/interface.d.ts +1 -10
  118. package/cjs/series/link/interface.js +1 -5
  119. package/cjs/series/link/interface.js.map +1 -1
  120. package/cjs/series/link/link.d.ts +1 -3
  121. package/cjs/series/link/link.js +16 -46
  122. package/cjs/series/link/link.js.map +1 -1
  123. package/cjs/series/map/map.js +1 -2
  124. package/cjs/series/map/map.js.map +1 -1
  125. package/cjs/series/pie/pie.js +0 -1
  126. package/cjs/series/pie/pie.js.map +1 -1
  127. package/cjs/series/sankey/sankey.d.ts +10 -10
  128. package/cjs/series/sankey/sankey.js +199 -194
  129. package/cjs/series/sankey/sankey.js.map +1 -1
  130. package/cjs/util/mark.d.ts +1 -0
  131. package/cjs/util/mark.js +10 -1
  132. package/cjs/util/mark.js.map +1 -1
  133. package/cjs/util/object.d.ts +1 -0
  134. package/cjs/util/object.js +13 -2
  135. package/cjs/util/object.js.map +1 -1
  136. package/esm/animation/index.js +2 -1
  137. package/esm/animation/interface.js +1 -2
  138. package/esm/animation/utils.js +1 -1
  139. package/esm/animation/utils.js.map +1 -1
  140. package/esm/chart/base/base-chart-transformer.js +3 -3
  141. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  142. package/esm/chart/base/base-chart.d.ts +1 -0
  143. package/esm/chart/base/base-chart.js +5 -8
  144. package/esm/chart/base/base-chart.js.map +1 -1
  145. package/esm/chart/index.d.ts +2 -2
  146. package/esm/chart/index.js +2 -2
  147. package/esm/chart/index.js.map +1 -1
  148. package/esm/chart/interface/chart.d.ts +1 -0
  149. package/esm/chart/interface/chart.js.map +1 -1
  150. package/esm/chart/interface/common.d.ts +1 -1
  151. package/esm/chart/interface/common.js.map +1 -1
  152. package/esm/chart/util.js +2 -1
  153. package/esm/compile/compiler.d.ts +1 -0
  154. package/esm/compile/compiler.js +13 -6
  155. package/esm/compile/compiler.js.map +1 -1
  156. package/esm/compile/interface/compilable-item.d.ts +1 -0
  157. package/esm/compile/interface/compilable-item.js.map +1 -1
  158. package/esm/compile/interface/compiler.d.ts +5 -0
  159. package/esm/compile/interface/compiler.js.map +1 -1
  160. package/esm/component/axis/base-axis.js +8 -8
  161. package/esm/component/axis/base-axis.js.map +1 -1
  162. package/esm/component/axis/cartesian/band-axis.d.ts +8 -0
  163. package/esm/component/axis/cartesian/band-axis.js +9 -1
  164. package/esm/component/axis/cartesian/band-axis.js.map +1 -1
  165. package/esm/component/axis/interface/common.js.map +1 -1
  166. package/esm/component/axis/mixin/band-axis-mixin.d.ts +2 -0
  167. package/esm/component/axis/mixin/band-axis-mixin.js +15 -1
  168. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  169. package/esm/component/brush/brush.js +6 -6
  170. package/esm/component/brush/brush.js.map +1 -1
  171. package/esm/component/brush/interface.d.ts +1 -0
  172. package/esm/component/brush/interface.js.map +1 -1
  173. package/esm/component/crosshair/base.d.ts +1 -1
  174. package/esm/component/crosshair/base.js +1 -1
  175. package/esm/component/crosshair/base.js.map +1 -1
  176. package/esm/component/crosshair/utils/cartesian.js +2 -2
  177. package/esm/component/crosshair/utils/cartesian.js.map +1 -1
  178. package/esm/component/custom-mark/custom-mark.js +6 -9
  179. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  180. package/esm/component/data-zoom/data-filter-base-component.d.ts +0 -1
  181. package/esm/component/data-zoom/data-filter-base-component.js +13 -18
  182. package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
  183. package/esm/component/data-zoom/interface.d.ts +0 -3
  184. package/esm/component/data-zoom/interface.js.map +1 -1
  185. package/esm/component/data-zoom/util.d.ts +0 -1
  186. package/esm/component/data-zoom/util.js +2 -5
  187. package/esm/component/data-zoom/util.js.map +1 -1
  188. package/esm/component/player/player.js +2 -1
  189. package/esm/component/player/player.js.map +1 -1
  190. package/esm/component/tooltip/tooltip.js +8 -3
  191. package/esm/component/tooltip/tooltip.js.map +1 -1
  192. package/esm/constant/attribute.js +1 -2
  193. package/esm/constant/sunburst.js +2 -1
  194. package/esm/constant/waterfall.js +1 -2
  195. package/esm/core/index.d.ts +1 -1
  196. package/esm/core/index.js +1 -1
  197. package/esm/core/index.js.map +1 -1
  198. package/esm/core/interface.d.ts +1 -0
  199. package/esm/core/interface.js +1 -1
  200. package/esm/core/interface.js.map +1 -1
  201. package/esm/core/vchart.d.ts +2 -0
  202. package/esm/core/vchart.js +42 -22
  203. package/esm/core/vchart.js.map +1 -1
  204. package/esm/data/initialize.js +1 -1
  205. package/esm/data/register.js +1 -1
  206. package/esm/data/transforms/obj-flat.js +1 -4
  207. package/esm/data/transforms/obj-flat.js.map +1 -1
  208. package/esm/mark/base/base-line.d.ts +1 -1
  209. package/esm/mark/base/base-line.js.map +1 -1
  210. package/esm/mark/base/base-mark.d.ts +6 -2
  211. package/esm/mark/base/base-mark.js +69 -50
  212. package/esm/mark/base/base-mark.js.map +1 -1
  213. package/esm/mark/group.d.ts +3 -2
  214. package/esm/mark/group.js +18 -12
  215. package/esm/mark/group.js.map +1 -1
  216. package/esm/mark/interface/common.d.ts +5 -2
  217. package/esm/mark/interface/common.js.map +1 -1
  218. package/esm/model/base-model.d.ts +5 -1
  219. package/esm/model/base-model.js +7 -0
  220. package/esm/model/base-model.js.map +1 -1
  221. package/esm/model/interface.d.ts +5 -2
  222. package/esm/model/interface.js.map +1 -1
  223. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.d.ts +1 -1
  224. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +4 -3
  225. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  226. package/esm/plugin/components/tooltip-handler/utils/style.js +5 -4
  227. package/esm/plugin/components/tooltip-handler/utils/style.js.map +1 -1
  228. package/esm/region/region.js.map +1 -1
  229. package/esm/series/base/base-series-transformer.js +1 -1
  230. package/esm/series/base/base-series-transformer.js.map +1 -1
  231. package/esm/series/base/base-series.js +2 -3
  232. package/esm/series/base/base-series.js.map +1 -1
  233. package/esm/series/dot/dot.d.ts +0 -1
  234. package/esm/series/dot/dot.js +6 -29
  235. package/esm/series/dot/dot.js.map +1 -1
  236. package/esm/series/dot/interface.d.ts +0 -1
  237. package/esm/series/dot/interface.js.map +1 -1
  238. package/esm/series/dot/tooltip-helper.js +2 -3
  239. package/esm/series/dot/tooltip-helper.js.map +1 -1
  240. package/esm/series/funnel/funnel.js +0 -2
  241. package/esm/series/funnel/funnel.js.map +1 -1
  242. package/esm/series/interface/type.d.ts +0 -3
  243. package/esm/series/interface/type.js +3 -5
  244. package/esm/series/interface/type.js.map +1 -1
  245. package/esm/series/link/constant.js +0 -8
  246. package/esm/series/link/constant.js.map +1 -1
  247. package/esm/series/link/interface.d.ts +1 -10
  248. package/esm/series/link/interface.js +1 -5
  249. package/esm/series/link/interface.js.map +1 -1
  250. package/esm/series/link/link.d.ts +1 -3
  251. package/esm/series/link/link.js +16 -48
  252. package/esm/series/link/link.js.map +1 -1
  253. package/esm/series/map/map.js +1 -2
  254. package/esm/series/map/map.js.map +1 -1
  255. package/esm/series/pie/pie.js +0 -1
  256. package/esm/series/pie/pie.js.map +1 -1
  257. package/esm/series/sankey/sankey.d.ts +10 -10
  258. package/esm/series/sankey/sankey.js +192 -187
  259. package/esm/series/sankey/sankey.js.map +1 -1
  260. package/esm/util/mark.d.ts +1 -0
  261. package/esm/util/mark.js +7 -0
  262. package/esm/util/mark.js.map +1 -1
  263. package/esm/util/object.d.ts +1 -0
  264. package/esm/util/object.js +11 -0
  265. package/esm/util/object.js.map +1 -1
  266. package/package.json +12 -12
  267. package/cjs/animation/animate-manager.d.ts +0 -1
  268. package/cjs/animation/animate-manager.js +0 -2
  269. package/cjs/animation/animate-manager.js.map +0 -1
  270. package/esm/animation/animate-manager.d.ts +0 -1
  271. package/esm/animation/animate-manager.js +0 -2
  272. package/esm/animation/animate-manager.js.map +0 -1
package/build/index.js CHANGED
@@ -14173,9 +14173,9 @@
14173
14173
  setWidthHeightWithoutTransform(aabbBounds) {
14174
14174
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
14175
14175
  }
14176
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
14176
+ setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
14177
14177
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
14178
- Object.keys(params).forEach(key => {
14178
+ (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
14179
14179
  animate.preventAttr(key);
14180
14180
  });
14181
14181
  });
@@ -14346,7 +14346,7 @@
14346
14346
  });
14347
14347
  } else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
14348
14348
  type: AttributeUpdateType.STATE
14349
- });
14349
+ }), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
14350
14350
  this._emitCustomEvent("afterStateUpdate", {
14351
14351
  type: AttributeUpdateType.STATE
14352
14352
  });
@@ -14739,7 +14739,7 @@
14739
14739
  }
14740
14740
  removeChild(child) {
14741
14741
  const data = super.removeChild(child);
14742
- return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
14742
+ return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
14743
14743
  }
14744
14744
  removeAllChild(deep = !1) {
14745
14745
  this.forEachChildren(child => {
@@ -16377,14 +16377,10 @@
16377
16377
  attrs && (Object.assign(stateAttrs, attrs.attributes), (null === (_a = attrs.subAttributes) || void 0 === _a ? void 0 : _a.length) && subAttrs.forEach((subAttrs, index) => {
16378
16378
  Object.assign(subAttrs, attrs.subAttributes[index]);
16379
16379
  }));
16380
- }), this.subGraphic.forEach((graphic, index) => {
16381
- graphic.updateNormalAttrs(subAttrs[index]), graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);
16382
16380
  }), this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation);
16383
16381
  }
16384
16382
  clearStates(hasAnimation) {
16385
- this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.subGraphic.forEach(graphic => {
16386
- graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, !0), graphic.normalAttrs = null;
16387
- }), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
16383
+ this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
16388
16384
  }
16389
16385
  clone() {
16390
16386
  const glyph = new Glyph(Object.assign({}, this.attribute));
@@ -17753,9 +17749,10 @@
17753
17749
  return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
17754
17750
  }
17755
17751
  toCustomPath() {
17756
- const points = this.attribute.points,
17757
- path = new CustomPath2D();
17758
- return points.forEach((point, index) => {
17752
+ let path = super.toCustomPath();
17753
+ if (path) return path;
17754
+ const points = this.attribute.points;
17755
+ return path = new CustomPath2D(), points.forEach((point, index) => {
17759
17756
  0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
17760
17757
  }), path.closePath(), path;
17761
17758
  }
@@ -21020,6 +21017,7 @@
21020
21017
  drawContext.updateBounds ? this.useDirtyBounds = !0 : this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;
21021
21018
  }
21022
21019
  draw(renderService, drawContext) {
21020
+ var _a;
21023
21021
  this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
21024
21022
  const {
21025
21023
  context: context,
@@ -21034,7 +21032,7 @@
21034
21032
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
21035
21033
  }
21036
21034
  const d = context.dpr % 1;
21037
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
21035
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams), renderService.renderTreeRoots.sort((a, b) => {
21038
21036
  var _a, _b;
21039
21037
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
21040
21038
  }).forEach(group => {
@@ -21170,7 +21168,7 @@
21170
21168
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
21171
21169
  }
21172
21170
  clearScreen(renderService, context, drawContext) {
21173
- var _a, _b;
21171
+ var _a, _b, _c;
21174
21172
  const {
21175
21173
  clear: clear,
21176
21174
  viewBox: viewBox
@@ -21178,9 +21176,9 @@
21178
21176
  width = viewBox.width(),
21179
21177
  height = viewBox.height();
21180
21178
  if (clear) {
21181
- context.clearRect(0, 0, width, height);
21182
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
21183
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1), stage && stage.backgroundImg && stage.resources) {
21179
+ context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearRect.call(renderService.drawParams);
21180
+ const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
21181
+ if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
21184
21182
  const res = stage.resources.get(clear);
21185
21183
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
21186
21184
  } else context.fillStyle = createColor(context, clear, {
@@ -21708,13 +21706,19 @@
21708
21706
  } else this._skipRender = 1;
21709
21707
  }, this.beforeRender = stage => {
21710
21708
  this._beforeRender && this._beforeRender(stage);
21709
+ }, this.afterClearScreen = drawParams => {
21710
+ this._afterClearScreen && this._afterClearScreen(drawParams);
21711
+ }, this.afterClearRect = drawParams => {
21712
+ this._afterClearRect && this._afterClearRect(drawParams);
21711
21713
  }, this.afterRender = stage => {
21712
21714
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
21713
21715
  }, this.afterTickCb = () => {
21714
21716
  this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
21715
21717
  }, this.params = params, this.theme = new Theme(), this.hooks = {
21716
21718
  beforeRender: new SyncHook(["stage"]),
21717
- afterRender: new SyncHook(["stage"])
21719
+ afterRender: new SyncHook(["stage"]),
21720
+ afterClearScreen: new SyncHook(["stage"]),
21721
+ afterClearRect: new SyncHook(["stage"])
21718
21722
  }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
21719
21723
  width: params.width,
21720
21724
  height: params.height,
@@ -21726,7 +21730,7 @@
21726
21730
  canvas: params.canvas
21727
21731
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
21728
21732
  main: !0
21729
- })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21733
+ })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
21730
21734
  tickRenderMode: "effect"
21731
21735
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
21732
21736
  background: this._background
@@ -22121,7 +22125,7 @@
22121
22125
  return this._cursor;
22122
22126
  }
22123
22127
  eventPointTransform(e) {
22124
- const point = this.global.mapToCanvasPoint(e, this.window.getContext().canvas.nativeCanvas);
22128
+ const point = this.global.mapToCanvasPoint(e, this.window);
22125
22129
  return this.stage.window.pointTransform(point.x, point.y);
22126
22130
  }
22127
22131
  pauseTriggerEvent() {
@@ -31734,7 +31738,7 @@
31734
31738
  return this._animateCount;
31735
31739
  }
31736
31740
  constructor() {
31737
- super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
31741
+ super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
31738
31742
  }
31739
31743
  isRunning() {
31740
31744
  return !this.paused && this._animateCount > 0;
@@ -31763,10 +31767,11 @@
31763
31767
  }
31764
31768
  tick(delta) {
31765
31769
  if (this.paused) return;
31770
+ this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
31766
31771
  const scaledDelta = delta * this._playSpeed;
31767
31772
  this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
31768
31773
  animate.status === AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== AnimateStatus.RUNNING && animate.status !== AnimateStatus.INITIAL || animate.advance(scaledDelta);
31769
- }), 0 === this._animateCount && this.emit("animationEnd");
31774
+ }), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
31770
31775
  }
31771
31776
  clear() {
31772
31777
  this.forEachAccessAnimate(animate => {
@@ -31830,7 +31835,9 @@
31830
31835
  return this._timeline;
31831
31836
  }
31832
31837
  bind(target) {
31833
- return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
31838
+ return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
31839
+ this.stop(), this.target.animates.delete(this.id);
31840
+ }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
31834
31841
  }
31835
31842
  to(props, duration = 300, easing = "linear") {
31836
31843
  const step = new Step(AnimateStepType.to, props, duration, easing);
@@ -32044,8 +32051,8 @@
32044
32051
  }
32045
32052
  init() {
32046
32053
  this.interval = 16, this.status = STATUS$1.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
32047
- this.initHandler();
32048
- }), application.global.env && this.initHandler();
32054
+ this.initHandler(!1);
32055
+ }), application.global.env && this.initHandler(!1);
32049
32056
  }
32050
32057
  addTimeline(timeline) {
32051
32058
  this.timelines.push(timeline);
@@ -32056,10 +32063,11 @@
32056
32063
  getTimelines() {
32057
32064
  return this.timelines;
32058
32065
  }
32059
- initHandler() {
32060
- this.setupTickHandler();
32066
+ initHandler(force = !1) {
32067
+ this.setupTickHandler(force);
32061
32068
  }
32062
- setupTickHandler() {
32069
+ setupTickHandler(force = !1) {
32070
+ if (!force && this.tickerHandler) return !0;
32063
32071
  const handler = new RAFTickHandler();
32064
32072
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
32065
32073
  }
@@ -32110,7 +32118,7 @@
32110
32118
  return this.status = STATUS$1.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
32111
32119
  }
32112
32120
  stop() {
32113
- this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
32121
+ this.status = STATUS$1.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
32114
32122
  }
32115
32123
  trySyncTickStatus() {
32116
32124
  this.status === STATUS$1.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === STATUS$1.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
@@ -32120,7 +32128,8 @@
32120
32128
  this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
32121
32129
  }
32122
32130
  checkSkip(delta) {
32123
- if ("performance" === this.stage.params.optimize.tickRenderMode) return !1;
32131
+ var _a, _b, _c;
32132
+ if ("performance" === (null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.params) || void 0 === _b ? void 0 : _b.optimize) || void 0 === _c ? void 0 : _c.tickRenderMode)) return !1;
32124
32133
  return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
32125
32134
  }
32126
32135
  }
@@ -32418,10 +32427,11 @@
32418
32427
  _handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
32419
32428
  var _a, _b, _c, _d;
32420
32429
  if (custom && customType) {
32421
- const customParams = this.resolveValue(customParameters, graphic, {
32430
+ const customParams = Object.assign({
32422
32431
  width: graphic.stage.width,
32423
- height: graphic.stage.height
32424
- }),
32432
+ height: graphic.stage.height,
32433
+ group: this._target.parent
32434
+ }, this.resolveValue(customParameters, graphic)),
32425
32435
  objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
32426
32436
  customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
32427
32437
  } else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
@@ -32639,6 +32649,14 @@
32639
32649
  state.executor.stop();
32640
32650
  }), this.stateList = null;
32641
32651
  }
32652
+ reApplyState(state) {
32653
+ var _a;
32654
+ const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
32655
+ if (stateInfo) {
32656
+ const stateList = this.stateList.slice();
32657
+ stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
32658
+ }
32659
+ }
32642
32660
  }
32643
32661
 
32644
32662
  class GraphicStateExtension {
@@ -32669,11 +32687,20 @@
32669
32687
  applyUnhighlightState(animationConfig, callback) {
32670
32688
  return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
32671
32689
  }
32672
- stopAnimationState(state, type) {
32673
- return this._getAnimationStateManager(this).stopState(state, type), this;
32690
+ stopAnimationState(state, type, deep = !1) {
32691
+ return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
32692
+ child.stopAnimationState(state, type, deep);
32693
+ }), this;
32674
32694
  }
32675
32695
  clearAnimationStates() {
32676
- return this._getAnimationStateManager(this).clearState(), this;
32696
+ const stateManager = this._animationStateManager;
32697
+ return stateManager && stateManager.clearState(), this;
32698
+ }
32699
+ reApplyAnimationState(state, deep = !1) {
32700
+ const stateManager = this._animationStateManager;
32701
+ return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
32702
+ child.reApplyAnimationState(state, deep);
32703
+ }), this;
32677
32704
  }
32678
32705
  static extend(graphic) {
32679
32706
  return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
@@ -32686,7 +32713,6 @@
32686
32713
  }
32687
32714
  animate(params) {
32688
32715
  var _a, _b, _c;
32689
- this.animates || (this.animates = new Map());
32690
32716
  const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
32691
32717
  if (animate.bind(this), params) {
32692
32718
  const {
@@ -32696,9 +32722,7 @@
32696
32722
  } = params;
32697
32723
  null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
32698
32724
  }
32699
- return this.animates.set(animate.id, animate), animate.onRemove(() => {
32700
- animate.stop(), this.animates.delete(animate.id);
32701
- }), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
32725
+ return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
32702
32726
  }
32703
32727
  createTimeline() {
32704
32728
  return new DefaultTimeline();
@@ -32729,6 +32753,21 @@
32729
32753
  getGraphicAttribute(key, prev = !1) {
32730
32754
  return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
32731
32755
  }
32756
+ pauseAnimation(deep = !1) {
32757
+ this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
32758
+ child.pauseAnimation(deep);
32759
+ });
32760
+ }
32761
+ resumeAnimation(deep = !1) {
32762
+ this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
32763
+ child.resumeAnimation(deep);
32764
+ });
32765
+ }
32766
+ stopAnimation(deep = !1) {
32767
+ this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
32768
+ child.stopAnimation(deep);
32769
+ });
32770
+ }
32732
32771
  }
32733
32772
 
32734
32773
  function registerAnimate$1() {
@@ -32737,7 +32776,7 @@
32737
32776
 
32738
32777
  class ACustomAnimate extends Step {
32739
32778
  constructor(customFrom, customTo, duration, easing, params) {
32740
- super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
32779
+ super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
32741
32780
  }
32742
32781
  update(end, ratio, out) {
32743
32782
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -33657,7 +33696,7 @@
33657
33696
  }
33658
33697
  class GrowAngleIn extends GrowAngleBase {
33659
33698
  onBind() {
33660
- var _a, _b;
33699
+ var _a, _b, _c;
33661
33700
  super.onBind();
33662
33701
  const {
33663
33702
  from: from,
@@ -33666,7 +33705,7 @@
33666
33705
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
33667
33706
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
33668
33707
  const finalAttribute = this.target.getFinalAttribute();
33669
- finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
33708
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
33670
33709
  }
33671
33710
  }
33672
33711
  class GrowAngleOut extends GrowAngleBase {
@@ -33809,7 +33848,7 @@
33809
33848
  super(from, to, duration, easing, params);
33810
33849
  }
33811
33850
  onBind() {
33812
- var _a, _b;
33851
+ var _a, _b, _c;
33813
33852
  super.onBind();
33814
33853
  const {
33815
33854
  from: from,
@@ -33818,7 +33857,7 @@
33818
33857
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
33819
33858
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
33820
33859
  const finalAttribute = this.target.getFinalAttribute();
33821
- finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
33860
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
33822
33861
  }
33823
33862
  onEnd(cb) {
33824
33863
  super.onEnd(cb);
@@ -33916,7 +33955,7 @@
33916
33955
  super(from, to, duration, easing, params);
33917
33956
  }
33918
33957
  onBind() {
33919
- var _a, _b;
33958
+ var _a, _b, _c;
33920
33959
  super.onBind();
33921
33960
  const {
33922
33961
  from: from,
@@ -33925,7 +33964,7 @@
33925
33964
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
33926
33965
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
33927
33966
  const finalAttribute = this.target.getFinalAttribute();
33928
- finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
33967
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
33929
33968
  }
33930
33969
  onEnd(cb) {
33931
33970
  super.onEnd(cb);
@@ -34274,7 +34313,7 @@
34274
34313
  }
34275
34314
  class GrowRadiusIn extends GrowPointsBase {
34276
34315
  onBind() {
34277
- var _a, _b;
34316
+ var _a, _b, _c;
34278
34317
  super.onBind();
34279
34318
  const {
34280
34319
  from: from,
@@ -34283,7 +34322,7 @@
34283
34322
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34284
34323
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
34285
34324
  const finalAttribute = this.target.getFinalAttribute();
34286
- finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
34325
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
34287
34326
  }
34288
34327
  }
34289
34328
  class GrowRadiusOut extends GrowPointsBase {
@@ -34398,7 +34437,7 @@
34398
34437
  super(from, to, duration, easing, params);
34399
34438
  }
34400
34439
  onBind() {
34401
- var _a, _b;
34440
+ var _a, _b, _c;
34402
34441
  super.onBind();
34403
34442
  const {
34404
34443
  from: from,
@@ -34407,7 +34446,7 @@
34407
34446
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
34408
34447
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
34409
34448
  const finalAttribute = this.target.getFinalAttribute();
34410
- finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
34449
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
34411
34450
  }
34412
34451
  onEnd(cb) {
34413
34452
  super.onEnd(cb);
@@ -35776,16 +35815,15 @@
35776
35815
  changedY = 0;
35777
35816
  "negative" === orient && (changedX = null !== (_a = layoutRect.width) && void 0 !== _a ? _a : graphic.stage.viewWidth, changedY = null !== (_b = layoutRect.height) && void 0 !== _b ? _b : graphic.stage.viewHeight), changedX += offset, changedY += offset;
35778
35817
  const point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
35779
- fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
35780
- fromY = point && isValidNumber$1(point.y) ? point.y : changedY,
35781
- finalAttrs = graphic.getFinalAttribute(),
35782
- finalAttrsX = excludeChannels.includes("x") ? graphic.attribute.x : finalAttrs.x,
35783
- finalAttrsY = excludeChannels.includes("y") ? graphic.attribute.y : finalAttrs.y;
35818
+ finalAttrsX = graphic.getGraphicAttribute("x"),
35819
+ finalAttrsY = graphic.getGraphicAttribute("y"),
35820
+ fromX = excludeChannels.includes("x") ? finalAttrsX : point && isValidNumber$1(point.x) ? point.x : changedX,
35821
+ fromY = excludeChannels.includes("y") ? finalAttrsY : point && isValidNumber$1(point.y) ? point.y : changedY;
35784
35822
  switch (direction) {
35785
35823
  case "x":
35786
35824
  return {
35787
35825
  from: {
35788
- x: fromX
35826
+ x: excludeChannels.includes("x") ? finalAttrsX : fromX
35789
35827
  },
35790
35828
  to: {
35791
35829
  x: finalAttrsX
@@ -35814,25 +35852,26 @@
35814
35852
  }
35815
35853
  };
35816
35854
  const moveOut = (graphic, options, animationParameters) => {
35817
- var _a, _b, _c, _d, _e, _f;
35855
+ var _a, _b, _c, _d;
35818
35856
  const {
35819
35857
  offset = 0,
35820
35858
  orient: orient,
35821
35859
  direction: direction,
35822
35860
  point: pointOpt
35823
35861
  } = null != options ? options : {},
35824
- groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
35825
- groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
35862
+ groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
35863
+ groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
35864
+ groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
35826
35865
  changedX = ("negative" === orient ? groupWidth : 0) + offset,
35827
35866
  changedY = ("negative" === orient ? groupHeight : 0) + offset,
35828
- point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, animationParameters) : pointOpt,
35867
+ point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
35829
35868
  fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
35830
35869
  fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
35831
35870
  switch (direction) {
35832
35871
  case "x":
35833
35872
  return {
35834
35873
  from: {
35835
- x: graphic.attribute.x
35874
+ x: graphic.getGraphicAttribute("x")
35836
35875
  },
35837
35876
  to: {
35838
35877
  x: fromX
@@ -35841,7 +35880,7 @@
35841
35880
  case "y":
35842
35881
  return {
35843
35882
  from: {
35844
- y: graphic.attribute.y
35883
+ y: graphic.getGraphicAttribute("y")
35845
35884
  },
35846
35885
  to: {
35847
35886
  y: fromY
@@ -35850,8 +35889,8 @@
35850
35889
  default:
35851
35890
  return {
35852
35891
  from: {
35853
- x: graphic.attribute.x,
35854
- y: graphic.attribute.y
35892
+ x: graphic.getGraphicAttribute("x"),
35893
+ y: graphic.getGraphicAttribute("y")
35855
35894
  },
35856
35895
  to: {
35857
35896
  x: fromX,
@@ -35998,6 +36037,9 @@
35998
36037
  this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
35999
36038
  }), this.target.setAttributes(this.from);
36000
36039
  }
36040
+ deleteSelfAttr(key) {
36041
+ super.deleteSelfAttr(key), delete this.from[key];
36042
+ }
36001
36043
  update(end, ratio, out) {
36002
36044
  if (this.onStart(), !this.props || !this.propKeys) return;
36003
36045
  const easedRatio = this.easing(ratio);
@@ -36066,9 +36108,8 @@
36066
36108
  w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
36067
36109
  width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
36068
36110
  this.rect.setAttributes({
36069
- x: x,
36070
- width: width,
36071
- dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
36111
+ x: x + Math.min(parentAttr.x1 - parentAttr.x, 0),
36112
+ width: width
36072
36113
  }, !1, {
36073
36114
  type: AttributeUpdateType.ANIMATE_PLAY,
36074
36115
  animationState: {
@@ -36085,9 +36126,8 @@
36085
36126
  const h = Math.min(parentHeight - currentY, maxLength);
36086
36127
  let height;
36087
36128
  y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
36088
- y: y,
36089
- height: height,
36090
- dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
36129
+ y: y + Math.min(parentAttr.y1 - parentAttr.y, 0),
36130
+ height: height
36091
36131
  }, !1, {
36092
36132
  type: AttributeUpdateType.ANIMATE_PLAY,
36093
36133
  animationState: {
@@ -37304,7 +37344,9 @@
37304
37344
  space = bandSpace(n, this._paddingInner, this._paddingOuter);
37305
37345
  return this._step = (stop - start) / Math.max(1, space || 1), this._round && (this._step = Math.floor(this._step)), start += (stop - start - this._step * (n - this._paddingInner)) * this._align, this.isBandwidthFixed() || (this._bandwidth = this._step * (1 - this._paddingInner)), this._round && (start = Math.round(start), this.isBandwidthFixed() || (this._bandwidth = Math.round(this._bandwidth))), this._bandRangeState = {
37306
37346
  reverse: reverse,
37307
- start: reverse ? start + this._step * (n - 1) : start,
37347
+ start: reverse ? clamp$1(start + this._step * (n - 1), wholeRange[1], wholeRange[0]) : clamp$1(start, wholeRange[0], wholeRange[1]),
37348
+ min: reverse ? wholeRange[1] : wholeRange[0],
37349
+ max: stop,
37308
37350
  count: n
37309
37351
  }, this.generateFishEyeTransform(), this;
37310
37352
  }
@@ -37321,10 +37363,12 @@
37321
37363
  const {
37322
37364
  count: count,
37323
37365
  start: start,
37324
- reverse: reverse
37366
+ reverse: reverse,
37367
+ min: min,
37368
+ max: max
37325
37369
  } = this._bandRangeState,
37326
37370
  output = start + (reverse ? -1 : 1) * ((i - 1) % count) * this._step;
37327
- return this._fishEyeTransform ? this._fishEyeTransform(output) : output;
37371
+ return clamp$1(this._fishEyeTransform ? this._fishEyeTransform(output) : output, min, max);
37328
37372
  }
37329
37373
  _calculateWholeRange(range, changeProperty) {
37330
37374
  if (this._wholeRange) return this._wholeRange;
@@ -38779,7 +38823,8 @@
38779
38823
  prevText: prevText,
38780
38824
  curText: curText,
38781
38825
  prevLabelLine: prevLabelLine,
38782
- curLabelLine: curLabelLine
38826
+ curLabelLine: curLabelLine,
38827
+ increaseEffect = !0
38783
38828
  } = this.params,
38784
38829
  diff = {};
38785
38830
  for (const key in curText.attribute) prevText.attribute[key] !== curText.attribute[key] && (diff[key] = curText.attribute[key]);
@@ -38789,7 +38834,7 @@
38789
38834
  to: rest,
38790
38835
  duration: duration,
38791
38836
  easing: easing
38792
- }), animator.animate(prevText, {
38837
+ }), !1 !== increaseEffect && animator.animate(prevText, {
38793
38838
  type: "increaseCount",
38794
38839
  to: {
38795
38840
  text: curText.attribute.text
@@ -39483,16 +39528,15 @@
39483
39528
  } = currentLabel;
39484
39529
  prevText.applyAnimationState(["update"], [{
39485
39530
  name: "update",
39486
- animation: Object.assign(Object.assign({
39487
- type: "labelUpdate"
39488
- }, this._animationConfig.update), {
39489
- customParameters: {
39531
+ animation: {
39532
+ type: "labelUpdate",
39533
+ customParameters: Object.assign(Object.assign({}, this._animationConfig.update), {
39490
39534
  prevText: prevText,
39491
39535
  curText: curText,
39492
39536
  prevLabelLine: prevLabelLine,
39493
39537
  curLabelLine: curLabelLine
39494
- }
39495
- })
39538
+ })
39539
+ }
39496
39540
  }]);
39497
39541
  }
39498
39542
  _syncStateWithRelatedGraphic(relatedGraphic) {
@@ -47251,6 +47295,22 @@
47251
47295
  return value;
47252
47296
  };
47253
47297
  }
47298
+ function removeUndefined(obj, deep = false) {
47299
+ if (obj === null || typeof obj !== 'object') {
47300
+ return obj;
47301
+ }
47302
+ for (const key in obj) {
47303
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
47304
+ if (obj[key] === undefined) {
47305
+ delete obj[key];
47306
+ continue;
47307
+ }
47308
+ if (deep) {
47309
+ removeUndefined(obj[key], deep);
47310
+ }
47311
+ }
47312
+ }
47313
+ }
47254
47314
 
47255
47315
  exports.SeriesTypeForThemeEnum = void 0;
47256
47316
  (function (SeriesTypeForThemeEnum) {
@@ -47291,7 +47351,6 @@
47291
47351
  SeriesTypeEnum["dot"] = "dot";
47292
47352
  SeriesTypeEnum["geo"] = "geo";
47293
47353
  SeriesTypeEnum["link"] = "link";
47294
- SeriesTypeEnum["curveLink"] = "curveLink";
47295
47354
  SeriesTypeEnum["map"] = "map";
47296
47355
  SeriesTypeEnum["pie"] = "pie";
47297
47356
  SeriesTypeEnum["radar"] = "radar";
@@ -47346,8 +47405,6 @@
47346
47405
  SeriesMarkNameEnum["cell"] = "cell";
47347
47406
  SeriesMarkNameEnum["cellBackground"] = "cellBackground";
47348
47407
  SeriesMarkNameEnum["link"] = "link";
47349
- SeriesMarkNameEnum["curveLink"] = "curveLink";
47350
- SeriesMarkNameEnum["imageLabel"] = "imageLabel";
47351
47408
  SeriesMarkNameEnum["arrow"] = "arrow";
47352
47409
  SeriesMarkNameEnum["pie"] = "pie";
47353
47410
  SeriesMarkNameEnum["labelLine"] = "labelLine";
@@ -49113,6 +49170,16 @@
49113
49170
  }
49114
49171
  return null;
49115
49172
  };
49173
+ const getDiffAttributesOfGraphic = (g, newAttrs) => {
49174
+ const prevAttrs = g.getAttributes(true);
49175
+ const diffAttrs = {};
49176
+ Object.keys(newAttrs).forEach(key => {
49177
+ if (prevAttrs[key] !== newAttrs[key]) {
49178
+ diffAttrs[key] = newAttrs[key];
49179
+ }
49180
+ });
49181
+ return diffAttrs;
49182
+ };
49116
49183
 
49117
49184
  let Event$1 = class Event {
49118
49185
  getComposedEventMap() {
@@ -50014,6 +50081,28 @@
50014
50081
  return attrs;
50015
50082
  };
50016
50083
 
50084
+ function toRenderMode(mode) {
50085
+ switch (mode) {
50086
+ case exports.RenderModeEnum['desktop-browser']:
50087
+ case exports.RenderModeEnum['mobile-browser']:
50088
+ return 'browser';
50089
+ case exports.RenderModeEnum.node:
50090
+ case exports.RenderModeEnum.worker:
50091
+ return 'node';
50092
+ case exports.RenderModeEnum.miniApp:
50093
+ case exports.RenderModeEnum['desktop-miniApp']:
50094
+ return 'feishu';
50095
+ case exports.RenderModeEnum.lynx:
50096
+ return 'lynx';
50097
+ case exports.RenderModeEnum.wx:
50098
+ return 'wx';
50099
+ case exports.RenderModeEnum.tt:
50100
+ return 'tt';
50101
+ case exports.RenderModeEnum.harmony:
50102
+ return 'harmony';
50103
+ }
50104
+ return 'browser';
50105
+ }
50017
50106
  function traverseGroupMark(group, apply, filter, leafFirst, stop) {
50018
50107
  const traverse = (mark) => {
50019
50108
  if (!leafFirst) {
@@ -50187,6 +50276,9 @@
50187
50276
  this._container = container;
50188
50277
  this._option = option;
50189
50278
  }
50279
+ getChart() {
50280
+ return this._compileChart;
50281
+ }
50190
50282
  getCanvas() {
50191
50283
  var _a;
50192
50284
  return (_a = this._stage) === null || _a === void 0 ? void 0 : _a.window.getNativeHandler().nativeCanvas;
@@ -50195,7 +50287,7 @@
50195
50287
  return this._stage;
50196
50288
  }
50197
50289
  initView() {
50198
- var _a, _b, _c;
50290
+ var _a, _b, _c, _d;
50199
50291
  if (this._released) {
50200
50292
  return;
50201
50293
  }
@@ -50203,34 +50295,17 @@
50203
50295
  if (this._stage) {
50204
50296
  return;
50205
50297
  }
50206
- const { autoRefreshDpr, dpr, mode, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
50298
+ const { autoRefreshDpr, dpr, mode, modeParams, gestureConfig, interactive, clickInterval, autoPreventDefault, background } = this._option;
50299
+ vglobal.setEnv(toRenderMode(mode), modeParams !== null && modeParams !== void 0 ? modeParams : {});
50207
50300
  this._stage =
50208
- (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage({
50209
- background,
50210
- width: this._width,
50211
- height: this._height,
50212
- container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null,
50213
- canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null,
50214
- dpr,
50215
- viewBox: this._option.viewBox,
50216
- canvasControled: this._option.canvasControled,
50217
- beforeRender: this._option.beforeRender,
50218
- afterRender: this._option.afterRender,
50219
- disableDirtyBounds: true,
50220
- autoRender: true,
50221
- ticker: this._option.ticker,
50222
- pluginList: this._option.pluginList,
50223
- enableHtmlAttribute: this._option.enableHtmlAttribute,
50224
- optimize: this._option.optimize,
50225
- supportsTouchEvents: this._option.supportsTouchEvents,
50226
- supportsPointerEvents: this._option.supportsPointerEvents,
50227
- event: {
50301
+ (_a = this._option.stage) !== null && _a !== void 0 ? _a : new Stage(Object.assign({ background, width: this._width, height: this._height, container: (_b = this._container.dom) !== null && _b !== void 0 ? _b : null, canvas: (_c = this._container.canvas) !== null && _c !== void 0 ? _c : null, dpr, viewBox: this._option.viewBox, canvasControled: this._option.canvasControled, beforeRender: (stage) => {
50302
+ var _a, _b, _c;
50303
+ (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
50304
+ (_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
50305
+ }, afterRender: this._option.afterRender, disableDirtyBounds: true, autoRender: true, ticker: this._option.ticker, pluginList: this._option.pluginList, enableHtmlAttribute: this._option.enableHtmlAttribute, optimize: this._option.optimize, supportsTouchEvents: this._option.supportsTouchEvents, supportsPointerEvents: this._option.supportsPointerEvents, event: {
50228
50306
  clickInterval: clickInterval,
50229
50307
  autoPreventDefault: autoPreventDefault
50230
- },
50231
- ReactDOM: this._option.ReactDOM,
50232
- autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr)
50233
- });
50308
+ }, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_d = this._option.renderHooks) !== null && _d !== void 0 ? _d : {})));
50234
50309
  this._stage.enableIncrementalAutoRender();
50235
50310
  this._stage.setTheme({
50236
50311
  symbol: {
@@ -51061,6 +51136,8 @@
51061
51136
  }
51062
51137
  onEvaluateEnd(ctx) {
51063
51138
  }
51139
+ onBeforeRender() {
51140
+ }
51064
51141
  onDataUpdate() {
51065
51142
  }
51066
51143
  beforeRelease() {
@@ -51188,6 +51265,12 @@
51188
51265
  }
51189
51266
  return index;
51190
51267
  }
51268
+ updateAnimateStateCallback(callback) {
51269
+ this._aniamtionStateCallback = callback;
51270
+ }
51271
+ getAnimationStateCallback() {
51272
+ return this._aniamtionStateCallback;
51273
+ }
51191
51274
  }
51192
51275
 
51193
51276
  class LayoutItem {
@@ -53211,26 +53294,39 @@
53211
53294
  }
53212
53295
  setAnimationConfig(config) {
53213
53296
  const defaultPrams = this.type === 'group' ? { selfOnly: true } : {};
53297
+ const formatAnimationCfg = (cfg) => {
53298
+ var _a;
53299
+ const options = (_a = cfg.options) !== null && _a !== void 0 ? _a : {};
53300
+ return Object.assign(Object.assign(Object.assign({}, defaultPrams), cfg), { options: (datum, graphic, customParams) => {
53301
+ var _a, _b;
53302
+ const _options = typeof options === 'function' ? options(datum, graphic, customParams) : options;
53303
+ if (graphic && graphic.context && graphic.context.compiler && isValid$1(graphic.context.modelId)) {
53304
+ const model = (_a = graphic.context.compiler.getChart()) === null || _a === void 0 ? void 0 : _a.getModelById(graphic.context.modelId);
53305
+ return Object.assign(Object.assign({}, _options), { layoutRect: (_b = model === null || model === void 0 ? void 0 : model.getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(model) });
53306
+ }
53307
+ return Object.assign({}, _options);
53308
+ } });
53309
+ };
53214
53310
  const animationConfig = {};
53215
53311
  Object.keys(config).forEach(key => {
53216
53312
  const value = config[key];
53217
53313
  if (isArray$1(value)) {
53218
- animationConfig[key] = value.map(item => {
53219
- var _a;
53220
- const options = (_a = item.options) !== null && _a !== void 0 ? _a : {};
53221
- return Object.assign(Object.assign(Object.assign({}, defaultPrams), item), { options: (...args) => {
53222
- var _a, _b;
53223
- const _options = typeof options === 'function' ? options(...args) : options;
53224
- return Object.assign(Object.assign({}, _options), { layoutRect: (_b = (_a = this.model).getLayoutRect) === null || _b === void 0 ? void 0 : _b.call(_a) });
53225
- } });
53226
- });
53314
+ animationConfig[key] = value.map(formatAnimationCfg);
53227
53315
  }
53228
- else {
53229
- animationConfig[key] = Object.assign(Object.assign({}, defaultPrams), config[key]);
53316
+ else if (isValid$1(value)) {
53317
+ animationConfig[key] = formatAnimationCfg(value);
53230
53318
  }
53231
53319
  });
53232
53320
  this._animationConfig = animationConfig;
53233
53321
  }
53322
+ disableAnimationByState(state) {
53323
+ const states = array(state);
53324
+ this._disabledAnimationStates = [...new Set([...this._disabledAnimationStates, ...states])];
53325
+ }
53326
+ enableAnimationByState(state) {
53327
+ const states = array(state);
53328
+ this._disabledAnimationStates = this._disabledAnimationStates.filter(s => !states.includes(s));
53329
+ }
53234
53330
  setSkipBeforeLayouted(skip) {
53235
53331
  this._skipBeforeLayouted = skip;
53236
53332
  }
@@ -53365,6 +53461,7 @@
53365
53461
  this._visible = true;
53366
53462
  this.stateStyle = {};
53367
53463
  this._unCompileChannel = {};
53464
+ this._disabledAnimationStates = [];
53368
53465
  this._skipBeforeLayouted = false;
53369
53466
  this._extensionChannel = {};
53370
53467
  this._computeExChannel = {};
@@ -53782,6 +53879,7 @@
53782
53879
  }
53783
53880
  _getCommonContext() {
53784
53881
  return {
53882
+ compiler: this.getCompiler(),
53785
53883
  markType: this.type,
53786
53884
  markId: this.id,
53787
53885
  modelId: this.model.id,
@@ -53855,17 +53953,19 @@
53855
53953
  this._dataByGroup = groupData(data, this._groupKeyGetter);
53856
53954
  }
53857
53955
  createAnimationStateList(type, animationConfig) {
53956
+ var _a;
53858
53957
  let config = animationConfig[type];
53859
53958
  if (config && Array.isArray(config)) {
53860
53959
  config = config.length === 1 ? config[0] : config;
53861
53960
  }
53862
53961
  if (Array.isArray(config)) {
53863
- config = config.map((item, index) => {
53962
+ return config.map((item, index) => {
53864
53963
  var _a;
53865
53964
  return (Object.assign(Object.assign({}, item), { priority: (_a = item.priority) !== null && _a !== void 0 ? _a : Infinity }));
53866
53965
  });
53867
53966
  }
53868
- return config;
53967
+ return config
53968
+ ? Object.assign(Object.assign({}, config), { priority: type === 'normal' ? (_a = config.priority) !== null && _a !== void 0 ? _a : Infinity : config.priority }) : config;
53869
53969
  }
53870
53970
  tryRunMorphing(graphics) {
53871
53971
  if (this._lastMark) {
@@ -53949,13 +54049,34 @@
53949
54049
  this._product.applyAnimationState(['normal'], [normalConfig]);
53950
54050
  }
53951
54051
  }
54052
+ _setAnimationState(g) {
54053
+ var _a, _b, _c;
54054
+ const callback = (this.type === "component"
54055
+ ? this.model.getAnimationStateCallback()
54056
+ : (_c = (_b = (_a = this.model).getRegion) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.getAnimationStateCallback()) ||
54057
+ ((g) => {
54058
+ var _a;
54059
+ const diffState = (_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState;
54060
+ return diffState === AnimationStateEnum.exit
54061
+ ? AnimationStateEnum.exit
54062
+ : diffState === AnimationStateEnum.update
54063
+ ? AnimationStateEnum.update
54064
+ : AnimationStateEnum.appear;
54065
+ });
54066
+ const customizedState = callback(g);
54067
+ g.context.animationState = customizedState !== null && customizedState !== void 0 ? customizedState : g.context.diffState;
54068
+ if (g.context.animationState === DiffState.exit) {
54069
+ g.context.reusing = true;
54070
+ g.animates && g.animates.forEach((a) => a.stop());
54071
+ }
54072
+ }
53952
54073
  _runJoin(data) {
53953
54074
  const newGroupedData = this._getDataByKey(data);
53954
54075
  const prevGroupedData = this._prevDataByKey;
53955
- const newGraphics = [];
54076
+ const allGraphics = [];
53956
54077
  const enterGraphics = new Set(this._graphics.filter(g => g.context.diffState === DiffState.enter));
53957
54078
  const callback = (key, newData, prevData) => {
53958
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
54079
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53959
54080
  let g;
53960
54081
  let diffState;
53961
54082
  if (isNil$1(newData)) {
@@ -53973,23 +54094,20 @@
53973
54094
  }
53974
54095
  diffState = DiffState.enter;
53975
54096
  g.isExiting = false;
53976
- if (((_a = g.context) === null || _a === void 0 ? void 0 : _a.diffState) === DiffState.exit) {
53977
- g.context.reusing = true;
53978
- g.animates && g.animates.forEach((a) => a.stop());
53979
- }
53980
54097
  this._graphicMap.set(key, g);
53981
- newGraphics.push(g);
54098
+ allGraphics.push(g);
53982
54099
  }
53983
54100
  else {
53984
54101
  g = this._graphicMap.get(key);
53985
54102
  if (g) {
53986
54103
  diffState = DiffState.update;
53987
- newGraphics.push(g);
54104
+ allGraphics.push(g);
53988
54105
  }
53989
54106
  }
53990
54107
  if (g) {
53991
- g.context = Object.assign(Object.assign({}, this._getCommonContext()), { diffState, reusing: (_b = g.context) === null || _b === void 0 ? void 0 : _b.reusing, originalFieldX: (_c = g.context) === null || _c === void 0 ? void 0 : _c.originalFieldX, originalFieldY: (_d = g.context) === null || _d === void 0 ? void 0 : _d.originalFieldY, fieldX: (_e = g.context) === null || _e === void 0 ? void 0 : _e.fieldX, fieldY: (_f = g.context) === null || _f === void 0 ? void 0 : _f.fieldY, animationState: diffState, data: newData !== null && newData !== void 0 ? newData : (_g = g.context) === null || _g === void 0 ? void 0 : _g.data, uniqueKey: key, key: newData ? this._keyGetter(newData[0]) : (_h = g.context) === null || _h === void 0 ? void 0 : _h.key, groupKey: newData ? this._groupKeyGetter(newData[0]) : (_j = g.context) === null || _j === void 0 ? void 0 : _j.groupKey, indexKey: '__VCHART_DEFAULT_DATA_INDEX', stateAnimateConfig: (_k = this.getAnimationConfig()) === null || _k === void 0 ? void 0 : _k.state });
53992
54108
  enterGraphics.delete(g);
54109
+ g.context = Object.assign(Object.assign({}, this._getCommonContext()), { diffState, reusing: (_a = g.context) === null || _a === void 0 ? void 0 : _a.reusing, originalFieldX: (_b = g.context) === null || _b === void 0 ? void 0 : _b.originalFieldX, originalFieldY: (_c = g.context) === null || _c === void 0 ? void 0 : _c.originalFieldY, fieldX: (_d = g.context) === null || _d === void 0 ? void 0 : _d.fieldX, fieldY: (_e = g.context) === null || _e === void 0 ? void 0 : _e.fieldY, data: newData !== null && newData !== void 0 ? newData : (_f = g.context) === null || _f === void 0 ? void 0 : _f.data, uniqueKey: key, key: newData ? this._keyGetter(newData[0]) : (_g = g.context) === null || _g === void 0 ? void 0 : _g.key, groupKey: newData ? this._groupKeyGetter(newData[0]) : (_h = g.context) === null || _h === void 0 ? void 0 : _h.groupKey, indexKey: '__VCHART_DEFAULT_DATA_INDEX', stateAnimateConfig: (_j = this.getAnimationConfig()) === null || _j === void 0 ? void 0 : _j.state });
54110
+ this._setAnimationState(g);
53993
54111
  }
53994
54112
  return g;
53995
54113
  };
@@ -54027,13 +54145,13 @@
54027
54145
  }
54028
54146
  g.release();
54029
54147
  });
54030
- const graphicCount = newGraphics.length;
54031
- newGraphics.forEach((g, index) => {
54148
+ const graphicCount = allGraphics.length;
54149
+ allGraphics.forEach((g, index) => {
54032
54150
  g.context.graphicCount = graphicCount;
54033
54151
  g.context.graphicIndex = index;
54034
54152
  });
54035
54153
  this._dataByKey = newGroupedData;
54036
- this._graphics = newGraphics;
54154
+ this._graphics = allGraphics;
54037
54155
  this.needClear = true;
54038
54156
  }
54039
54157
  _runEncoderOfGraphic(styles, g, attrs = {}) {
@@ -54116,13 +54234,7 @@
54116
54234
  }
54117
54235
  }
54118
54236
  else {
54119
- const prevAttrs = g.getAttributes(true);
54120
- const diffAttrs = {};
54121
- Object.keys(finalAttrs).forEach(key => {
54122
- if (prevAttrs[key] !== finalAttrs[key]) {
54123
- diffAttrs[key] = finalAttrs[key];
54124
- }
54125
- });
54237
+ const diffAttrs = getDiffAttributesOfGraphic(g, finalAttrs);
54126
54238
  g.context.diffAttrs = diffAttrs;
54127
54239
  if (g.context.reusing) {
54128
54240
  g.context.lastAttrs = g.attribute;
@@ -54291,24 +54403,25 @@
54291
54403
  }
54292
54404
  };
54293
54405
  this._graphicMap.forEach((g, key) => {
54294
- if (g.context.diffState === DiffState.exit && !g.isExiting) {
54295
- if (this.hasAnimationByState('exit')) {
54296
- g.isExiting = true;
54297
- const animationConfig = this.getAnimationConfig();
54298
- if (animationConfig.exit && animationConfig.exit.length) {
54299
- const exitConfigList = animationConfig.exit.map((item, index) => ({
54300
- name: `exit_${index}`,
54301
- animation: Object.assign(Object.assign({}, item), { customParameters: g.context })
54302
- }));
54303
- g.applyAnimationState(['exit'], [exitConfigList.length === 1 ? exitConfigList[0] : exitConfigList], () => {
54304
- doRemove(g, key);
54305
- });
54306
- }
54307
- }
54308
- else {
54309
- doRemove(g, key);
54406
+ if (g.context.diffState !== DiffState.exit || g.isExiting) {
54407
+ return;
54408
+ }
54409
+ if (g.context.animationState === DiffState.exit && this.hasAnimationByState('exit')) {
54410
+ g.isExiting = true;
54411
+ const animationConfig = this.getAnimationConfig();
54412
+ if (animationConfig.exit && animationConfig.exit.length) {
54413
+ const exitConfigList = animationConfig.exit.map((item, index) => ({
54414
+ name: `exit_${index}`,
54415
+ animation: Object.assign(Object.assign({}, item), { customParameters: g.context })
54416
+ }));
54417
+ g.applyAnimationState(['exit'], [exitConfigList.length === 1 ? exitConfigList[0] : exitConfigList], () => {
54418
+ doRemove(g, key);
54419
+ });
54310
54420
  }
54311
54421
  }
54422
+ else {
54423
+ doRemove(g, key);
54424
+ }
54312
54425
  });
54313
54426
  }
54314
54427
  isProgressive() {
@@ -54453,15 +54566,11 @@
54453
54566
  this._runProgressiveStep();
54454
54567
  }
54455
54568
  }
54456
- updateAnimationState(callback) {
54457
- if (this._graphics && this._graphics.length) {
54458
- this._graphics.forEach(g => {
54459
- g.context.animationState = callback(g);
54460
- });
54461
- }
54462
- }
54463
54569
  hasAnimationByState(state) {
54464
- if (!state || !this._animationConfig || !this._animationConfig[state]) {
54570
+ if (!state ||
54571
+ !this._animationConfig ||
54572
+ !this._animationConfig[state] ||
54573
+ this._disabledAnimationStates.includes(state)) {
54465
54574
  return false;
54466
54575
  }
54467
54576
  const stateAnimationConfig = this._animationConfig[state];
@@ -54478,11 +54587,36 @@
54478
54587
  }
54479
54588
  }
54480
54589
 
54590
+ exports.MarkTypeEnum = void 0;
54591
+ (function (MarkTypeEnum) {
54592
+ MarkTypeEnum["group"] = "group";
54593
+ MarkTypeEnum["symbol"] = "symbol";
54594
+ MarkTypeEnum["rule"] = "rule";
54595
+ MarkTypeEnum["line"] = "line";
54596
+ MarkTypeEnum["text"] = "text";
54597
+ MarkTypeEnum["rect"] = "rect";
54598
+ MarkTypeEnum["image"] = "image";
54599
+ MarkTypeEnum["path"] = "path";
54600
+ MarkTypeEnum["area"] = "area";
54601
+ MarkTypeEnum["arc"] = "arc";
54602
+ MarkTypeEnum["polygon"] = "polygon";
54603
+ MarkTypeEnum["boxPlot"] = "boxPlot";
54604
+ MarkTypeEnum["linkPath"] = "linkPath";
54605
+ MarkTypeEnum["cell"] = "cell";
54606
+ MarkTypeEnum["ripple"] = "ripple";
54607
+ MarkTypeEnum["liquid"] = "liquid";
54608
+ MarkTypeEnum["component"] = "component";
54609
+ MarkTypeEnum["dataLabel"] = "dataLabel";
54610
+ MarkTypeEnum["label"] = "label";
54611
+ MarkTypeEnum["pictogram"] = "pictogram";
54612
+ })(exports.MarkTypeEnum || (exports.MarkTypeEnum = {}));
54613
+
54481
54614
  class GroupMark extends BaseMark {
54482
54615
  constructor() {
54483
54616
  super(...arguments);
54484
54617
  this.type = GroupMark.type;
54485
54618
  this._marks = [];
54619
+ this._diffState = DiffState.enter;
54486
54620
  }
54487
54621
  getMarks() {
54488
54622
  return this._marks;
@@ -54545,10 +54679,28 @@
54545
54679
  return;
54546
54680
  }
54547
54681
  const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
54548
- this._product.context = Object.assign(Object.assign({}, this._product.context), this._getCommonContext());
54549
- this._product.setAttributes(this._getAttrsFromConfig(style));
54682
+ this._product.context = Object.assign(Object.assign(Object.assign({}, this._product.context), this._getCommonContext()), { diffState: this._diffState });
54683
+ this._setAnimationState(this._product);
54684
+ const newAttrs = this._getAttrsFromConfig(style);
54685
+ if (this._product.context.diffState === DiffState.update) {
54686
+ const hasAnimation = this.hasAnimation();
54687
+ const diffAttrs = getDiffAttributesOfGraphic(this._product, newAttrs);
54688
+ this._product.context.diffAttrs = diffAttrs;
54689
+ if (!this.hasAnimationByState(this._product.context.animationState)) {
54690
+ hasAnimation ? this._product.setAttributesAndPreventAnimate(diffAttrs) : this._product.setAttributes(diffAttrs);
54691
+ }
54692
+ if (hasAnimation) {
54693
+ this._product.setFinalAttributes(newAttrs);
54694
+ }
54695
+ }
54696
+ else {
54697
+ this._product.setAttributes(newAttrs);
54698
+ }
54550
54699
  this.needClear = true;
54551
54700
  }
54701
+ clearExitGraphics() {
54702
+ this._diffState = DiffState.update;
54703
+ }
54552
54704
  render() {
54553
54705
  if (this._isCommited) {
54554
54706
  log(`render mark: ${this.getProductId()}, type is ${this.type}`);
@@ -54559,16 +54711,6 @@
54559
54711
  mark.render();
54560
54712
  });
54561
54713
  }
54562
- updateAnimationState(callback) {
54563
- this.getGraphics().forEach(g => {
54564
- if (g) {
54565
- g.context = Object.assign(Object.assign({}, g.context), { animationState: callback(g) });
54566
- }
54567
- });
54568
- this.getMarks().forEach(mark => {
54569
- mark.updateAnimationState(callback);
54570
- });
54571
- }
54572
54714
  release() {
54573
54715
  super.release();
54574
54716
  this.removeProduct();
@@ -55466,7 +55608,6 @@
55466
55608
  if (!this._beforeRender(option)) {
55467
55609
  return self;
55468
55610
  }
55469
- this._updateAnimateState(true);
55470
55611
  (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.render(option.morphConfig);
55471
55612
  this._updateAnimateState(false);
55472
55613
  this._afterRender();
@@ -55538,7 +55679,8 @@
55538
55679
  this._cachedProcessedTheme[cacheKey] = theme;
55539
55680
  return theme;
55540
55681
  };
55541
- this._option = Object.assign(Object.assign(Object.assign({}, this._option), { animation: spec.animation !== false }), options);
55682
+ removeUndefined(options);
55683
+ this._option = Object.assign(Object.assign({}, this._option), options);
55542
55684
  if (options === null || options === void 0 ? void 0 : options.optimize) {
55543
55685
  this._option.optimize = Object.assign(Object.assign({}, this._option.optimize), options.optimize);
55544
55686
  }
@@ -55763,7 +55905,7 @@
55763
55905
  return this._beforeRender(option);
55764
55906
  }
55765
55907
  _reCompile(updateResult, morphConfig) {
55766
- var _a, _b, _c, _d, _e;
55908
+ var _a, _b, _c, _d, _e, _f, _g;
55767
55909
  if (updateResult.reMake) {
55768
55910
  this._releaseData();
55769
55911
  this._initDataSet();
@@ -55783,20 +55925,16 @@
55783
55925
  if (updateResult.reMake) {
55784
55926
  (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
55785
55927
  this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
55786
- if (updateResult.reSize) {
55787
- this._doResize();
55788
- }
55789
55928
  }
55790
- else {
55791
- if (updateResult.reCompile) {
55792
- (_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
55793
- (_e = this._compiler) === null || _e === void 0 ? void 0 : _e.compile({ chart: this._chart, vChart: this });
55794
- }
55795
- if (updateResult.reSize) {
55796
- const { width, height } = this.getCurrentSize();
55797
- this._chart.onResize(width, height, false);
55798
- this._compiler.resize(width, height, false);
55799
- }
55929
+ else if (updateResult.reCompile) {
55930
+ (_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
55931
+ (_e = this._compiler) === null || _e === void 0 ? void 0 : _e.compile({ chart: this._chart, vChart: this });
55932
+ }
55933
+ if (updateResult.reSize) {
55934
+ const { width, height } = this.getCurrentSize();
55935
+ this._currentSize = { width, height };
55936
+ (_f = this._chart) === null || _f === void 0 ? void 0 : _f.onResize(width, height, false);
55937
+ (_g = this._compiler) === null || _g === void 0 ? void 0 : _g.resize(width, height, false);
55800
55938
  }
55801
55939
  }
55802
55940
  _beforeRender(option = {}) {
@@ -55855,17 +55993,21 @@
55855
55993
  });
55856
55994
  }
55857
55995
  _updateAnimateState(initial) {
55858
- if (this._option.animation) {
55996
+ var _a, _b;
55997
+ if (this.isAnimationEnable()) {
55859
55998
  const updateGraphicAnimationState = (graphic) => {
55860
55999
  var _a;
55861
56000
  const diffState = (_a = graphic.context) === null || _a === void 0 ? void 0 : _a.diffState;
55862
56001
  if (initial) {
55863
- return diffState === 'exit' ? undefined : AnimationStateEnum.appear;
56002
+ return diffState === 'exit' ? AnimationStateEnum.none : AnimationStateEnum.appear;
55864
56003
  }
55865
56004
  return diffState;
55866
56005
  };
55867
- this._compiler.getRootMarks().forEach(mark => {
55868
- mark.updateAnimationState(updateGraphicAnimationState);
56006
+ (_a = this._chart) === null || _a === void 0 ? void 0 : _a.getAllRegions().forEach(region => {
56007
+ region.updateAnimateStateCallback(updateGraphicAnimationState);
56008
+ });
56009
+ (_b = this._chart) === null || _b === void 0 ? void 0 : _b.getAllComponents().forEach(component => {
56010
+ component.updateAnimateStateCallback(updateGraphicAnimationState);
55869
56011
  });
55870
56012
  }
55871
56013
  }
@@ -55949,11 +56091,11 @@
55949
56091
  }
55950
56092
  if (this._chart) {
55951
56093
  this._chart.updateData(id, data, true, parserOptions);
55952
- this._compiler.render();
55953
56094
  if (userUpdateOptions === null || userUpdateOptions === void 0 ? void 0 : userUpdateOptions.reAnimate) {
55954
56095
  this.stopAnimation();
55955
56096
  this._updateAnimateState(true);
55956
56097
  }
56098
+ this._compiler.render();
55957
56099
  return this;
55958
56100
  }
55959
56101
  this._spec.data = array(this._spec.data);
@@ -55964,11 +56106,11 @@
55964
56106
  if (this._chart) {
55965
56107
  this._chart.updateFullData(data);
55966
56108
  if (reRender) {
55967
- this._compiler.render();
55968
56109
  if (userUpdateOptions === null || userUpdateOptions === void 0 ? void 0 : userUpdateOptions.reAnimate) {
55969
56110
  this.stopAnimation();
55970
56111
  this._updateAnimateState(true);
55971
56112
  }
56113
+ this._compiler.render();
55972
56114
  }
55973
56115
  return this;
55974
56116
  }
@@ -56488,10 +56630,20 @@
56488
56630
  return (_a = this._chart) === null || _a === void 0 ? void 0 : _a.setDimensionIndex(value, opt);
56489
56631
  }
56490
56632
  stopAnimation() {
56633
+ var _a;
56634
+ (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.stopAnimation(true);
56635
+ }
56636
+ reRunNormalAnimation() {
56637
+ var _a;
56638
+ (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.reApplyAnimationState('normal', true);
56491
56639
  }
56492
56640
  pauseAnimation() {
56641
+ var _a;
56642
+ (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.pauseAnimation(true);
56493
56643
  }
56494
56644
  resumeAnimation() {
56645
+ var _a;
56646
+ (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.resumeAnimation(true);
56495
56647
  }
56496
56648
  convertDatumToPosition(datum, dataLinkInfo = {}, isRelativeToCanvas = false, checkInViewData) {
56497
56649
  var _a;
@@ -56638,6 +56790,12 @@
56638
56790
  _getMode() {
56639
56791
  return this._option.mode || exports.RenderModeEnum['desktop-browser'];
56640
56792
  }
56793
+ isAnimationEnable() {
56794
+ if ('animation' in this._option) {
56795
+ return !!this._option.animation;
56796
+ }
56797
+ return this._spec.animation !== false;
56798
+ }
56641
56799
  _getChartOption(type) {
56642
56800
  return {
56643
56801
  type,
@@ -56651,7 +56809,6 @@
56651
56809
  modeParams: this._option.modeParams,
56652
56810
  getCompiler: () => this._compiler,
56653
56811
  viewBox: this._viewBox,
56654
- animation: this._option.animation,
56655
56812
  getTheme: this.getTheme,
56656
56813
  getSpecInfo: () => { var _a; return (_a = this._specInfo) !== null && _a !== void 0 ? _a : {}; },
56657
56814
  layout: this._option.layout,
@@ -56775,7 +56932,7 @@
56775
56932
  });
56776
56933
  };
56777
56934
 
56778
- const version = "2.0.3-alpha.0";
56935
+ const version = "2.0.3-alpha.2";
56779
56936
 
56780
56937
  const addVChartProperty = (data, op) => {
56781
56938
  const context = op.beforeCall();
@@ -57539,7 +57696,7 @@
57539
57696
  if (seriesSpec.animation === false) {
57540
57697
  return false;
57541
57698
  }
57542
- if (((_b = (_a = series.getChart()) === null || _a === void 0 ? void 0 : _a.getOption()) === null || _b === void 0 ? void 0 : _b.animation) === false) {
57699
+ if (((_b = (_a = series.getOption()) === null || _a === void 0 ? void 0 : _a.globalInstance) === null || _b === void 0 ? void 0 : _b.isAnimationEnable()) === false) {
57543
57700
  return false;
57544
57701
  }
57545
57702
  let animationThreshold = (_c = seriesSpec.animationThreshold) !== null && _c !== void 0 ? _c : Number.MAX_SAFE_INTEGER;
@@ -57623,7 +57780,7 @@
57623
57780
  if (labelSpec && labelSpec.visible) {
57624
57781
  const { animation = true, animationUpdate: labelAnimationUpdate = true, animationEnter: labelAnimationEnter = true, animationExit: labelAnimationExit = true } = labelSpec;
57625
57782
  const { animationUpdate = true, animationEnter = true, animationExit = true } = spec;
57626
- const animationEnabled = (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.animation) !== null && _b !== void 0 ? _b : spec.animation) !== null && _c !== void 0 ? _c : labelSpec.animation;
57783
+ const animationEnabled = (_c = (_b = (_a = this._option.globalInstance) === null || _a === void 0 ? void 0 : _a.isAnimationEnable()) !== null && _b !== void 0 ? _b : spec.animation) !== null && _c !== void 0 ? _c : labelSpec.animation;
57627
57784
  const labelAnimationEnabled = !!animationEnabled && !!hasAnimation;
57628
57785
  this.addLabelSpec(isFunction$1(markName) ? markName(labelSpec) : markName, Object.assign(Object.assign({}, labelSpec), { animation: labelAnimationEnabled ? animation : false, animationUpdate: labelAnimationEnabled && animationUpdate && labelAnimationUpdate ? animationUpdate : false, animationEnter: labelAnimationEnabled && animationEnter && labelAnimationEnter ? animationEnter : false, animationExit: labelAnimationEnabled && animationEnter && labelAnimationExit ? animationExit : false, getStyleHandler: (series) => { var _a; return (_a = series[styleHandlerName]) === null || _a === void 0 ? void 0 : _a.bind(series); } }), head);
57629
57786
  }
@@ -58588,14 +58745,11 @@
58588
58745
  }
58589
58746
  if (isNil$1(dataView)) {
58590
58747
  m.setData(this._data);
58591
- m.setSkipBeforeLayouted(true);
58592
58748
  }
58593
58749
  else if (dataView !== false) {
58594
58750
  m.setDataView(dataView);
58595
58751
  }
58596
- if (isBoolean$1(skipBeforeLayouted)) {
58597
- m.setSkipBeforeLayouted(skipBeforeLayouted);
58598
- }
58752
+ m.setSkipBeforeLayouted(skipBeforeLayouted !== false);
58599
58753
  if (!isNil$1(groupKey)) {
58600
58754
  m.setGroupKey(groupKey);
58601
58755
  }
@@ -59820,30 +59974,6 @@
59820
59974
 
59821
59975
  const lineSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), lineLikeSeriesMark);
59822
59976
 
59823
- exports.MarkTypeEnum = void 0;
59824
- (function (MarkTypeEnum) {
59825
- MarkTypeEnum["group"] = "group";
59826
- MarkTypeEnum["symbol"] = "symbol";
59827
- MarkTypeEnum["rule"] = "rule";
59828
- MarkTypeEnum["line"] = "line";
59829
- MarkTypeEnum["text"] = "text";
59830
- MarkTypeEnum["rect"] = "rect";
59831
- MarkTypeEnum["image"] = "image";
59832
- MarkTypeEnum["path"] = "path";
59833
- MarkTypeEnum["area"] = "area";
59834
- MarkTypeEnum["arc"] = "arc";
59835
- MarkTypeEnum["polygon"] = "polygon";
59836
- MarkTypeEnum["boxPlot"] = "boxPlot";
59837
- MarkTypeEnum["linkPath"] = "linkPath";
59838
- MarkTypeEnum["cell"] = "cell";
59839
- MarkTypeEnum["ripple"] = "ripple";
59840
- MarkTypeEnum["liquid"] = "liquid";
59841
- MarkTypeEnum["component"] = "component";
59842
- MarkTypeEnum["dataLabel"] = "dataLabel";
59843
- MarkTypeEnum["label"] = "label";
59844
- MarkTypeEnum["pictogram"] = "pictogram";
59845
- })(exports.MarkTypeEnum || (exports.MarkTypeEnum = {}));
59846
-
59847
59977
  const isStopsEqual = (prev, next) => {
59848
59978
  var _a, _b;
59849
59979
  if (prev === next) {
@@ -61098,7 +61228,7 @@
61098
61228
  return [(_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct(), (_b = this._gridMark) === null || _b === void 0 ? void 0 : _b.getProduct()].filter(isValid$1);
61099
61229
  }
61100
61230
  created() {
61101
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
61231
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
61102
61232
  super.created();
61103
61233
  this.setSeriesAndRegionsFromSpec();
61104
61234
  this.initEvent();
@@ -61135,15 +61265,15 @@
61135
61265
  this._marks.addMark(gridMark);
61136
61266
  this._gridMark = gridMark;
61137
61267
  }
61138
- if (this._option.animation !== false &&
61268
+ if (((_h = this._option.globalInstance) === null || _h === void 0 ? void 0 : _h.isAnimationEnable()) &&
61139
61269
  get$1(this._option.getChart().getSpec(), 'animation') !== false &&
61140
61270
  this._spec.animation === true) {
61141
- const axisAnimateConfig = animationConfig((_h = Factory.getAnimationInKey('axis')) === null || _h === void 0 ? void 0 : _h(), {
61142
- appear: (_k = (_j = this._spec.animationAppear) !== null && _j !== void 0 ? _j : get$1(this._option.getChart().getSpec(), 'animationAppear.axis')) !== null && _k !== void 0 ? _k : get$1(this._option.getChart().getSpec(), 'animationAppear'),
61143
- disappear: (_m = (_l = this._spec.animationDisappear) !== null && _l !== void 0 ? _l : get$1(this._option.getChart().getSpec(), 'animationDisappear.axis')) !== null && _m !== void 0 ? _m : get$1(this._option.getChart().getSpec(), 'animationDisappear'),
61144
- enter: (_p = (_o = this._spec.animationEnter) !== null && _o !== void 0 ? _o : get$1(this._option.getChart().getSpec(), 'animationEnter.axis')) !== null && _p !== void 0 ? _p : get$1(this._option.getChart().getSpec(), 'animationEnter'),
61145
- exit: (_r = (_q = this._spec.animationExit) !== null && _q !== void 0 ? _q : get$1(this._option.getChart().getSpec(), 'animationExit.axis')) !== null && _r !== void 0 ? _r : get$1(this._option.getChart().getSpec(), 'animationExit'),
61146
- update: (_t = (_s = this._spec.animationUpdate) !== null && _s !== void 0 ? _s : get$1(this._option.getChart().getSpec(), 'animationUpdate.axis')) !== null && _t !== void 0 ? _t : get$1(this._option.getChart().getSpec(), 'animationUpdate')
61271
+ const axisAnimateConfig = animationConfig((_j = Factory.getAnimationInKey('axis')) === null || _j === void 0 ? void 0 : _j(), {
61272
+ appear: (_l = (_k = this._spec.animationAppear) !== null && _k !== void 0 ? _k : get$1(this._option.getChart().getSpec(), 'animationAppear.axis')) !== null && _l !== void 0 ? _l : get$1(this._option.getChart().getSpec(), 'animationAppear'),
61273
+ disappear: (_o = (_m = this._spec.animationDisappear) !== null && _m !== void 0 ? _m : get$1(this._option.getChart().getSpec(), 'animationDisappear.axis')) !== null && _o !== void 0 ? _o : get$1(this._option.getChart().getSpec(), 'animationDisappear'),
61274
+ enter: (_q = (_p = this._spec.animationEnter) !== null && _p !== void 0 ? _p : get$1(this._option.getChart().getSpec(), 'animationEnter.axis')) !== null && _q !== void 0 ? _q : get$1(this._option.getChart().getSpec(), 'animationEnter'),
61275
+ exit: (_s = (_r = this._spec.animationExit) !== null && _r !== void 0 ? _r : get$1(this._option.getChart().getSpec(), 'animationExit.axis')) !== null && _s !== void 0 ? _s : get$1(this._option.getChart().getSpec(), 'animationExit'),
61276
+ update: (_u = (_t = this._spec.animationUpdate) !== null && _t !== void 0 ? _t : get$1(this._option.getChart().getSpec(), 'animationUpdate.axis')) !== null && _u !== void 0 ? _u : get$1(this._option.getChart().getSpec(), 'animationUpdate')
61147
61277
  });
61148
61278
  if (axisAnimateConfig.enter) {
61149
61279
  axisAnimateConfig.update[0].customParameters = {
@@ -63010,6 +63140,24 @@
63010
63140
  };
63011
63141
  }
63012
63142
  }
63143
+ _updateData() {
63144
+ var _a, _b, _c;
63145
+ const tickTransformType = this.registerTicksTransform();
63146
+ if (this._spec.showAllGroupLayers && this._scales.length > 1) {
63147
+ const layers = (_a = this._spec.layers) !== null && _a !== void 0 ? _a : [];
63148
+ Object.keys(this._tickDataMap).forEach(layer => {
63149
+ const layerConfig = layers[this._scales.length - 1 - +layer] || {};
63150
+ const tickData = this._tickDataMap[layer];
63151
+ const tickTransform = tickData === null || tickData === void 0 ? void 0 : tickData.getDataView().transformsArr.find((t) => t.type === tickTransformType);
63152
+ tickTransform &&
63153
+ (tickTransform.options = Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig));
63154
+ });
63155
+ }
63156
+ else {
63157
+ const tickTransform = (_c = (_b = this._tickData) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.getDataView().transformsArr.find(t => t.type === tickTransformType);
63158
+ tickTransform && (tickTransform.options = this._tickTransformOption());
63159
+ }
63160
+ }
63013
63161
  dataToPosition(values, cfg = {}) {
63014
63162
  var _a, _b;
63015
63163
  if (values.length === 0 || this._scales.length === 0) {
@@ -63102,7 +63250,7 @@
63102
63250
  getLabelItems(length) {
63103
63251
  const labelItems = [];
63104
63252
  let preData = [];
63105
- this._scales.forEach((scale, index) => {
63253
+ (this._spec.showAllGroupLayers ? this._scales : [this._scales[0]]).forEach((scale, index) => {
63106
63254
  var _a;
63107
63255
  const tickData = this._tickDataMap[index];
63108
63256
  const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
@@ -63284,6 +63432,20 @@
63284
63432
  minBandSize
63285
63433
  };
63286
63434
  }
63435
+ _compareSpec(spec, prevSpec) {
63436
+ const result = super._compareSpec(spec, prevSpec);
63437
+ if (result.reMake) {
63438
+ return result;
63439
+ }
63440
+ if ((prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.showAllGroupLayers) !== (spec === null || spec === void 0 ? void 0 : spec.showAllGroupLayers) || !isEqual(prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.layers, spec === null || spec === void 0 ? void 0 : spec.layers)) {
63441
+ result.reMake = true;
63442
+ }
63443
+ return result;
63444
+ }
63445
+ reInit(spec) {
63446
+ super.reInit();
63447
+ this === null || this === void 0 ? void 0 : this._updateData();
63448
+ }
63287
63449
  }
63288
63450
  CartesianBandAxis.type = ComponentTypeEnum.cartesianBandAxis;
63289
63451
  CartesianBandAxis.specKey = 'axes';
@@ -64926,6 +65088,10 @@
64926
65088
  const elements = [...this._components, ...this._regions, ...this._series];
64927
65089
  elements.forEach(element => element.onEvaluateEnd(option));
64928
65090
  }
65091
+ onBeforeRender() {
65092
+ const elements = [...this._components, ...this._regions, ...this._series];
65093
+ elements.forEach(element => element.onBeforeRender());
65094
+ }
64929
65095
  getLayoutElements() {
64930
65096
  return this.getAllModels()
64931
65097
  .map(i => i.layout)
@@ -65391,17 +65557,11 @@
65391
65557
  }
65392
65558
  _enableMarkAnimation(states) {
65393
65559
  const marks = this.getAllMarks();
65394
- marks.forEach(mark => {
65395
- const product = mark.getProduct();
65396
- if (product && product.animate) ;
65397
- });
65560
+ marks.forEach(mark => mark.enableAnimationByState(states));
65398
65561
  }
65399
65562
  _disableMarkAnimation(states) {
65400
65563
  const marks = this.getAllMarks();
65401
- marks.forEach(mark => {
65402
- const product = mark.getProduct();
65403
- if (product && product.animate) ;
65404
- });
65564
+ marks.forEach(mark => mark.disableAnimationByState(states));
65405
65565
  }
65406
65566
  filterGraphicsByDatum(datum, opt = {}) {
65407
65567
  var _a;
@@ -65656,15 +65816,15 @@
65656
65816
  return true;
65657
65817
  }
65658
65818
  _getDefaultSeriesSpec(chartSpec, pickKeys, pickKeys2) {
65659
- var _a, _b, _c, _d;
65819
+ var _a, _b, _c, _d, _e;
65660
65820
  const series = {
65661
65821
  dataKey: chartSpec.dataKey,
65662
65822
  hover: chartSpec.hover,
65663
65823
  select: chartSpec.select,
65664
65824
  label: chartSpec.label,
65665
65825
  seriesStyle: chartSpec.seriesStyle,
65666
- animation: (_a = chartSpec.animation) !== null && _a !== void 0 ? _a : this._option.animation,
65667
- animationThreshold: (_b = chartSpec.animationThreshold) !== null && _b !== void 0 ? _b : (_d = (_c = this._option).getTheme) === null || _d === void 0 ? void 0 : _d.call(_c, 'animationThreshold'),
65826
+ animation: (_a = chartSpec.animation) !== null && _a !== void 0 ? _a : (_b = this._option.globalInstance) === null || _b === void 0 ? void 0 : _b.isAnimationEnable(),
65827
+ animationThreshold: (_c = chartSpec.animationThreshold) !== null && _c !== void 0 ? _c : (_e = (_d = this._option).getTheme) === null || _e === void 0 ? void 0 : _e.call(_d, 'animationThreshold'),
65668
65828
  animationAppear: chartSpec.animationAppear,
65669
65829
  animationDisappear: chartSpec.animationDisappear,
65670
65830
  animationEnter: chartSpec.animationEnter,
@@ -66284,7 +66444,7 @@
66284
66444
  layoutStartPoint = { x: 0, y: 0 };
66285
66445
  }
66286
66446
  Object.keys(stateByField).forEach(field => {
66287
- var _a, _b, _c, _d, _e;
66447
+ var _a, _b, _c, _d, _e, _f;
66288
66448
  const { currentValue, cacheInfo, labelsComp, attributes, coordKey } = stateByField[field];
66289
66449
  let axis = null;
66290
66450
  let coord = 0;
@@ -66296,8 +66456,8 @@
66296
66456
  item.axis.getLayoutStartPoint()[coordKey] -
66297
66457
  layoutStartPoint[coordKey];
66298
66458
  axis = item.axis;
66299
- axisLabel = (_e = (_d = (_c = (_b = (_a = axis
66300
- .getVRenderComponents()[0]) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children[0]) === null || _c === void 0 ? void 0 : _c.getChildByName('axis-label-container')) === null || _d === void 0 ? void 0 : _d.getChildByName('axis-label-container-layer-0')) === null || _e === void 0 ? void 0 : _e.children[0];
66459
+ axisLabel = (_f = (_e = (_d = (_c = (_b = (_a = axis
66460
+ .getVRenderComponents()[0]) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children[0]) === null || _c === void 0 ? void 0 : _c.children[0]) === null || _d === void 0 ? void 0 : _d.getChildByName('axis-label-container')) === null || _e === void 0 ? void 0 : _e.getChildByName('axis-label-container-layer-0')) === null || _f === void 0 ? void 0 : _f.children[0];
66301
66461
  }
66302
66462
  const isVisible = !!currentValue.size && Number.isFinite(coord) && !Number.isNaN(coord);
66303
66463
  const useCache = enableRemain && !isVisible && isValid$1(cacheInfo);
@@ -69675,8 +69835,7 @@
69675
69835
  initMark() {
69676
69836
  this._pathMark = this._createMark(MapSeries.mark.area, {
69677
69837
  groupKey: this.getDimensionField()[0],
69678
- isSeriesMark: true,
69679
- skipBeforeLayouted: true
69838
+ isSeriesMark: true
69680
69839
  }, {
69681
69840
  morph: shouldMarkDoMorph(this._spec, MapSeries.mark.area.name),
69682
69841
  morphElementKey: this.getDimensionField()[0]
@@ -73162,7 +73321,6 @@
73162
73321
  this._pieMark = this._createMark(Object.assign(Object.assign({}, BasePieSeries.mark.pie), { name: this._pieMarkName, type: this._pieMarkType }), {
73163
73322
  key: DEFAULT_DATA_KEY,
73164
73323
  groupKey: this._seriesField,
73165
- skipBeforeLayouted: true,
73166
73324
  isSeriesMark: true
73167
73325
  }, {
73168
73326
  morph: shouldMarkDoMorph(this._spec, this._pieMarkName),
@@ -74627,17 +74785,16 @@
74627
74785
  const userUpdateContent = (_c = (_b = (_a = this.spec) === null || _a === void 0 ? void 0 : _a[activeType]) === null || _b === void 0 ? void 0 : _b.updateContent) !== null && _c !== void 0 ? _c : (_d = chartTooltipSpec === null || chartTooltipSpec === void 0 ? void 0 : chartTooltipSpec[activeType]) === null || _d === void 0 ? void 0 : _d.updateContent;
74628
74786
  if (res && !userUpdateContent) {
74629
74787
  res.updateContent = (prev, datum, params) => {
74630
- var _a, _b;
74631
74788
  const childrenContent = [];
74632
74789
  const childrenPrev = prev.filter((p) => p.key === 'children');
74633
74790
  childrenPrev.length > 0 &&
74634
- ((_b = (_a = childrenPrev === null || childrenPrev === void 0 ? void 0 : childrenPrev[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.forEach((element) => {
74791
+ childrenPrev[0].value.forEach((element) => {
74635
74792
  let flag = true;
74636
74793
  for (const key in element) {
74637
74794
  childrenContent.push(Object.assign(Object.assign({}, childrenPrev[0]), { shapeType: 'circle', hasShape: flag, key: key, value: element[key] + '' }));
74638
74795
  flag = false;
74639
74796
  }
74640
- }));
74797
+ });
74641
74798
  return prev.concat(childrenContent);
74642
74799
  };
74643
74800
  }
@@ -74660,21 +74817,13 @@
74660
74817
  }
74661
74818
  }
74662
74819
  const dataOp = datum[op];
74663
- if (dataOp && dataOp.length > 0) {
74664
- dataOp === null || dataOp === void 0 ? void 0 : dataOp.forEach((d, i) => {
74665
- result.push(Object.assign({}, dataKeyObj, d, {
74666
- [DEFAULT_DATA_INDEX]: index,
74667
- [DEFAULT_DATA_KEY]: `${dataKey}_${i}`
74668
- }));
74669
- index++;
74670
- });
74671
- }
74672
- else {
74673
- result.push(Object.assign({}, dataKeyObj, {
74820
+ dataOp === null || dataOp === void 0 ? void 0 : dataOp.forEach((d, i) => {
74821
+ result.push(Object.assign({}, dataKeyObj, d, {
74674
74822
  [DEFAULT_DATA_INDEX]: index,
74675
- [DEFAULT_DATA_KEY]: dataKey
74823
+ [DEFAULT_DATA_KEY]: `${dataKey}_${i}`
74676
74824
  }));
74677
- }
74825
+ index++;
74826
+ });
74678
74827
  });
74679
74828
  return result;
74680
74829
  };
@@ -74767,7 +74916,7 @@
74767
74916
  }
74768
74917
  }
74769
74918
  initData() {
74770
- var _a, _b;
74919
+ var _a;
74771
74920
  super.initData();
74772
74921
  this._xDimensionStatisticsDomain = this.getRawData().latestData.map((d) => d[this._fieldY[0]]);
74773
74922
  registerDataSetInstanceTransform(this._option.dataSet, 'objFlat', objFlat);
@@ -74778,31 +74927,9 @@
74778
74927
  options: 'dots',
74779
74928
  level: exports.TransformLevel.dotObjFlat
74780
74929
  }, false);
74781
- (_b = this.getRawData()) === null || _b === void 0 ? void 0 : _b.transform({
74782
- type: 'objFlat',
74783
- options: 'dots',
74784
- level: exports.TransformLevel.dotObjFlat
74785
- }, false);
74786
- }
74787
- _statisticViewData() {
74788
- var _a;
74789
- super._statisticViewData();
74790
- (_a = this._viewDataStatistics) === null || _a === void 0 ? void 0 : _a.transform({
74791
- type: 'objFlat',
74792
- options: 'dots',
74793
- level: exports.TransformLevel.dotObjFlat
74794
- }, false);
74795
74930
  }
74796
74931
  getStatisticFields() {
74797
- const result = [{ key: this._fieldY[0], operations: ['values'], customize: this._xDimensionStatisticsDomain }];
74798
- const { linearMode = true } = this._spec;
74799
- if (linearMode) {
74800
- result.push({ key: this._fieldX[0], operations: ['min', 'max'] });
74801
- }
74802
- else {
74803
- result.push({ key: this._fieldX[0], operations: ['values'] });
74804
- }
74805
- return result;
74932
+ return [{ key: this._fieldY[0], operations: ['values'], customize: this._xDimensionStatisticsDomain }];
74806
74933
  }
74807
74934
  setAttrFromSpec() {
74808
74935
  var _a;
@@ -74847,21 +74974,20 @@
74847
74974
  });
74848
74975
  }
74849
74976
  initMarkStyle() {
74850
- var _a, _b;
74851
74977
  const clipMark = this._clipMark;
74852
74978
  if (clipMark) {
74853
74979
  this.setMarkStyle(clipMark, {
74854
- x: -((_a = this._spec.leftAppendPadding) !== null && _a !== void 0 ? _a : 0),
74980
+ x: -this._spec.leftAppendPadding,
74855
74981
  y: 0,
74856
74982
  width: 10000,
74857
- height: () => { var _a; return (_a = this._spec.clipHeight) !== null && _a !== void 0 ? _a : this._region.getLayoutRect().height; }
74983
+ height: this._spec.clipHeight
74858
74984
  }, 'normal', exports.AttributeLevel.Series);
74859
74985
  clipMark.setMarkConfig({ interactive: false, clip: true });
74860
74986
  }
74861
74987
  const containerMark = this._containerMark;
74862
74988
  if (containerMark) {
74863
74989
  this.setMarkStyle(containerMark, {
74864
- x: (_b = this._spec.leftAppendPadding) !== null && _b !== void 0 ? _b : 0
74990
+ x: this._spec.leftAppendPadding
74865
74991
  }, 'normal', exports.AttributeLevel.Series);
74866
74992
  containerMark.setMarkConfig({ interactive: false });
74867
74993
  }
@@ -75086,13 +75212,7 @@
75086
75212
  }
75087
75213
  }
75088
75214
 
75089
- var LinkType;
75090
- (function (LinkType) {
75091
- LinkType["line"] = "line";
75092
- LinkType["curve"] = "curve";
75093
- })(LinkType || (LinkType = {}));
75094
-
75095
- const linkSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["group"]: { name: "group", type: "group" }, ["link"]: { name: "link", type: "rule" }, ["curveLink"]: { name: "curveLink", type: "path" }, ["arrow"]: { name: "arrow", type: "symbol" }, ["imageLabel"]: { name: "imageLabel", type: "image" } });
75215
+ const linkSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { ["group"]: { name: "group", type: "group" }, ["link"]: { name: "link", type: "rule" }, ["arrow"]: { name: "arrow", type: "symbol" } });
75096
75216
 
75097
75217
  const linkDotInfo = (data, op) => {
75098
75218
  const { infoKey, fields, linkData, dotData } = op;
@@ -75134,7 +75254,6 @@
75134
75254
  constructor() {
75135
75255
  super(...arguments);
75136
75256
  this.type = exports.SeriesTypeEnum.link;
75137
- this._curveLinkCountMap = {};
75138
75257
  }
75139
75258
  getFromField() {
75140
75259
  return this._fromField;
@@ -75205,12 +75324,11 @@
75205
75324
  this.setDotSeriesSpec(this._spec.dotSeriesSpec);
75206
75325
  }
75207
75326
  initMark() {
75208
- const { linkType = LinkType.line, imageLabelField } = this._spec;
75209
75327
  this._clipMark = this._createMark(LinkSeries.mark.group);
75210
75328
  this._containerMark = this._createMark(LinkSeries.mark.group, {
75211
75329
  parent: this._clipMark
75212
75330
  });
75213
- this._linkMark = this._createMark(linkType === LinkType.curve ? LinkSeries.mark.curveLink : LinkSeries.mark.link, {
75331
+ this._linkMark = this._createMark(LinkSeries.mark.link, {
75214
75332
  skipBeforeLayouted: false,
75215
75333
  parent: this._containerMark
75216
75334
  });
@@ -75219,23 +75337,16 @@
75219
75337
  isSeriesMark: true,
75220
75338
  parent: this._containerMark
75221
75339
  });
75222
- if (imageLabelField) {
75223
- this._imageLabelMark = this._createMark(LinkSeries.mark.imageLabel, {
75224
- skipBeforeLayouted: false,
75225
- isSeriesMark: true,
75226
- parent: this._containerMark
75227
- });
75228
- }
75229
75340
  }
75230
75341
  initMarkStyle() {
75231
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
75342
+ var _a, _b, _c, _d;
75232
75343
  const clipMark = this._clipMark;
75233
75344
  if (clipMark) {
75234
75345
  this.setMarkStyle(clipMark, {
75235
- x: -((_a = this._spec.leftAppendPadding) !== null && _a !== void 0 ? _a : 0),
75346
+ x: -this._spec.leftAppendPadding,
75236
75347
  y: 0,
75237
75348
  width: 10000,
75238
- height: () => { var _a; return (_a = this._spec.clipHeight) !== null && _a !== void 0 ? _a : this._region.getLayoutRect().height; }
75349
+ height: this._spec.clipHeight
75239
75350
  }, 'normal', exports.AttributeLevel.Series);
75240
75351
  clipMark.setMarkConfig({ interactive: false, clip: true });
75241
75352
  }
@@ -75248,43 +75359,19 @@
75248
75359
  containerMark.setMarkConfig({ interactive: false });
75249
75360
  }
75250
75361
  const linkMark = this._linkMark;
75251
- const { linkType = LinkType.line } = this._spec;
75252
75362
  if (linkMark) {
75253
- if (linkType === LinkType.curve) {
75254
- this.setMarkStyle(linkMark, {
75255
- stroke: (_d = (_c = (_b = this._spec.link) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.stroke) !== null && _d !== void 0 ? _d : this.getColorAttribute(),
75256
- strokeOpacity: this.dataToOpacity.bind(this),
75257
- path: (datum) => {
75258
- const fromX = this.dataToPositionXFrom(datum);
75259
- const fromY = this.dataToPositionYFrom(datum);
75260
- const toX = this.dataToPositionXTo(datum);
75261
- const toY = this.dataToPositionYTo(datum);
75262
- const curveLinkCount = this._curveLinkCountMap[`${fromX}-${fromY}-${toX}-${toY}`] || 1;
75263
- this._curveLinkCountMap[`${fromX}-${fromY}-${toX}-${toY}`] = curveLinkCount + 1;
75264
- const curveRatio = 0.5 + curveLinkCount * 0.1;
75265
- const controlX1 = fromX + (toX - fromX) * 0.7;
75266
- const controlY1 = fromY;
75267
- const controlX2 = toX - (toX - fromX) * curveRatio;
75268
- const controlY2 = toY;
75269
- return `M ${fromX} ${fromY} C ${controlX1} ${controlY1}, ${controlX2} ${controlY2}, ${toX} ${toY}`;
75270
- },
75271
- lineWidth: (_f = (_e = this._spec.link.style) === null || _e === void 0 ? void 0 : _e.lineWidth) !== null && _f !== void 0 ? _f : 1
75272
- }, 'normal', exports.AttributeLevel.Series);
75273
- }
75274
- else {
75275
- this.setMarkStyle(linkMark, {
75276
- stroke: this.getColorAttribute(),
75277
- strokeOpacity: this.dataToOpacity.bind(this),
75278
- x: this.dataToPositionXFrom.bind(this),
75279
- y: this.dataToPositionYFrom.bind(this),
75280
- x1: this.dataToPositionXTo.bind(this),
75281
- y1: this.dataToPositionYTo.bind(this)
75282
- }, 'normal', exports.AttributeLevel.Series);
75283
- }
75363
+ this.setMarkStyle(linkMark, {
75364
+ stroke: this.getColorAttribute(),
75365
+ strokeOpacity: this.dataToOpacity.bind(this),
75366
+ x: this.dataToPositionXFrom.bind(this),
75367
+ y: this.dataToPositionYFrom.bind(this),
75368
+ x1: this.dataToPositionXTo.bind(this),
75369
+ y1: this.dataToPositionYTo.bind(this)
75370
+ }, 'normal', exports.AttributeLevel.Series);
75284
75371
  }
75285
75372
  const arrowMark = this._arrowMark;
75286
75373
  if (arrowMark) {
75287
- const arrowSize = (_k = (_j = (_h = (_g = this._theme) === null || _g === void 0 ? void 0 : _g.arrow) === null || _h === void 0 ? void 0 : _h.style) === null || _j === void 0 ? void 0 : _j.size) !== null && _k !== void 0 ? _k : 10;
75374
+ const arrowSize = (_d = (_c = (_b = (_a = this._theme) === null || _a === void 0 ? void 0 : _a.arrow) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 10;
75288
75375
  this.setMarkStyle(arrowMark, {
75289
75376
  x: this.dataToPositionXTo.bind(this),
75290
75377
  y: (datum) => this.dataToPositionArrowYTo(datum, arrowSize),
@@ -75296,44 +75383,18 @@
75296
75383
  }
75297
75384
  }, 'normal', exports.AttributeLevel.Series);
75298
75385
  }
75299
- const imageLabelMark = this._imageLabelMark;
75300
- if (imageLabelMark) {
75301
- const { style = {} } = this._spec.imageLabel;
75302
- const { width = 40, height = 40 } = style;
75303
- this.setMarkStyle(imageLabelMark, {
75304
- x: datum => {
75305
- return (this.dataToPositionXFrom(datum) + this.dataToPositionXTo(datum)) / 2 - width / 2;
75306
- },
75307
- y: datum => {
75308
- return (this.dataToPositionYFrom(datum) + this.dataToPositionYTo(datum)) / 2 - height / 2;
75309
- },
75310
- width,
75311
- height,
75312
- image: datum => {
75313
- return datum[this._spec.imageLabelField];
75314
- }
75315
- }, 'normal', exports.AttributeLevel.Series);
75316
- }
75317
75386
  }
75318
75387
  afterInitMark() {
75319
75388
  super.afterInitMark();
75320
75389
  }
75321
75390
  dataToPositionXFrom(datum) {
75322
- var _a, _b, _c, _d;
75323
75391
  if (!this._xAxisHelper) {
75324
75392
  return Number.NaN;
75325
75393
  }
75326
75394
  const { dataToPosition } = this._xAxisHelper;
75327
- const allowExtend = this._spec.allowExtend;
75328
- const bandSize = (_c = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getBandwidth) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) !== null && _c !== void 0 ? _c : 0;
75329
- const { style = {} } = (_d = this._dotSeriesSpec.symbol) !== null && _d !== void 0 ? _d : {};
75330
- const { size: dotSize = 10 } = style;
75331
- return (dataToPosition(this.getDatumPositionValues(datum, this._fromField + '_xField'), {
75395
+ return dataToPosition(this.getDatumPositionValues(datum, this._fromField + '_xField'), {
75332
75396
  bandPosition: this._bandPosition
75333
- }) +
75334
- (allowExtend && (!datum.isExtend || datum.isExtend === 'left')
75335
- ? -(array(bandSize)[0] + dotSize) / 2
75336
- : 0));
75397
+ });
75337
75398
  }
75338
75399
  dataToPositionYFrom(datum) {
75339
75400
  if (!this._yAxisHelper) {
@@ -75343,21 +75404,13 @@
75343
75404
  return dataToPosition(this.getDatumPositionValues(datum, this._fromField + '_yField'));
75344
75405
  }
75345
75406
  dataToPositionXTo(datum) {
75346
- var _a, _b, _c, _d;
75347
75407
  if (!this._xAxisHelper) {
75348
75408
  return Number.NaN;
75349
75409
  }
75350
75410
  const { dataToPosition } = this._xAxisHelper;
75351
- const allowExtend = this._spec.allowExtend;
75352
- const bandSize = (_c = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getBandwidth) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) !== null && _c !== void 0 ? _c : 0;
75353
- const { style = {} } = (_d = this._dotSeriesSpec.symbol) !== null && _d !== void 0 ? _d : {};
75354
- const { size: dotSize = 10 } = style;
75355
- return (dataToPosition(this.getDatumPositionValues(datum, this._toField + '_xField'), {
75411
+ return dataToPosition(this.getDatumPositionValues(datum, this._toField + '_xField'), {
75356
75412
  bandPosition: this._bandPosition
75357
- }) +
75358
- (allowExtend && (!datum.isExtend || datum.isExtend === 'right')
75359
- ? (array(bandSize)[0] + dotSize) / 2
75360
- : 0));
75413
+ });
75361
75414
  }
75362
75415
  dataToPositionYTo(datum) {
75363
75416
  if (!this._yAxisHelper) {
@@ -75379,10 +75432,9 @@
75379
75432
  }) + offset);
75380
75433
  }
75381
75434
  dataToOpacity(datum) {
75382
- if (!this._spec.allowExtend &&
75383
- (this.isPositionXOuterRange(datum, this._fromField + '_xField') ||
75384
- this.isPositionXOuterRange(datum, this._toField + '_xField') ||
75385
- datum[this._fromField] === datum[this._toField])) {
75435
+ if (this.isPositionXOuterRange(datum, this._fromField + '_xField') ||
75436
+ this.isPositionXOuterRange(datum, this._toField + '_xField') ||
75437
+ datum[this._fromField] === datum[this._toField]) {
75386
75438
  return 0;
75387
75439
  }
75388
75440
  return 1;
@@ -76896,6 +76948,72 @@
76896
76948
  isNil$1(node.value) && ((null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) ? node.value = calculateNodeValue(node.children) : node.value = 0), sum += Math.abs(node.value);
76897
76949
  }), sum;
76898
76950
  };
76951
+ function makeHierarchicNodes(originalNodes, nodeKeyFunc, nodes = [], nodeMap = {}, originalLinks) {
76952
+ calculateNodeValue(originalNodes);
76953
+ const doSubTree = (subTree, depth, parents) => {
76954
+ subTree.forEach((node, index) => {
76955
+ const nodeKey = nodeKeyFunc ? nodeKeyFunc(node) : parents ? `${parents[parents.length - 1].key}-${index}` : `${depth}-${index}`,
76956
+ nodeValue = isNil$1(node.value) ? 0 : toValidNumber$1(node.value);
76957
+ if (nodeMap[nodeKey]) nodeMap[nodeKey].value = void 0;else {
76958
+ const nodeElement = {
76959
+ depth: depth,
76960
+ datum: node,
76961
+ index: index,
76962
+ key: nodeKey,
76963
+ value: nodeValue,
76964
+ sourceLinks: [],
76965
+ targetLinks: []
76966
+ };
76967
+ nodeMap[nodeKey] = nodeElement, nodes.push(nodeElement);
76968
+ }
76969
+ parents && originalLinks && originalLinks.push({
76970
+ source: parents[parents.length - 1].key,
76971
+ target: nodeKey,
76972
+ value: nodeValue,
76973
+ parents: parents
76974
+ }), node.children && node.children.length && doSubTree(node.children, depth + 1, parents ? parents.concat([nodeMap[nodeKey]]) : [nodeMap[nodeKey]]);
76975
+ });
76976
+ };
76977
+ return doSubTree(originalNodes, 0, null), nodes;
76978
+ }
76979
+ function computeHierarchicNodeLinks(originalNodes, nodeKeyFunc) {
76980
+ const nodes = [],
76981
+ links = [],
76982
+ nodeMap = {},
76983
+ linkMap = {},
76984
+ originalLinks = [];
76985
+ return makeHierarchicNodes(originalNodes, nodeKeyFunc, nodes, nodeMap, originalLinks), originalLinks.forEach((link, index) => {
76986
+ const key = `${link.source}-${link.target}`,
76987
+ linkDatum = pickWithout(link, ["parents"]);
76988
+ if (linkDatum.parents = link.parents.map(node => pickWithout(node, ["sourceLinks", "targetLinks"])), linkMap[key]) return linkMap[key].value += toValidNumber$1(link.value), void linkMap[key].datum.push(linkDatum);
76989
+ const linkElement = {
76990
+ index: index,
76991
+ key: `${link.source}-${link.target}`,
76992
+ source: link.source,
76993
+ target: link.target,
76994
+ datum: [linkDatum],
76995
+ value: link.value,
76996
+ parents: link.parents.map(parent => parent.key)
76997
+ };
76998
+ links.push(linkElement), nodeMap[link.source].sourceLinks.push(linkElement), nodeMap[link.target].targetLinks.push(linkElement), linkMap[key] = linkElement;
76999
+ }), {
77000
+ nodes: nodes,
77001
+ links: links,
77002
+ nodeMap: nodeMap
77003
+ };
77004
+ }
77005
+ function computeNodeValues(nodes) {
77006
+ for (let i = 0, len = nodes.length; i < len; i++) {
77007
+ const node = nodes[i];
77008
+ node.value = Math.max(isNil$1(node.value) ? 0 : toValidNumber$1(node.value), node.sourceLinks.reduce((sum, link) => {
77009
+ var _a;
77010
+ return sum + (null !== (_a = toValidNumber$1(link.value)) && void 0 !== _a ? _a : 0);
77011
+ }, 0), node.targetLinks.reduce((sum, link) => {
77012
+ var _a;
77013
+ return sum + (null !== (_a = toValidNumber$1(link.value)) && void 0 !== _a ? _a : 0);
77014
+ }, 0));
77015
+ }
77016
+ }
76899
77017
 
76900
77018
  function left(node) {
76901
77019
  return node.depth;
@@ -77029,55 +77147,7 @@
77029
77147
  };
77030
77148
  }
77031
77149
  computeHierarchicNodeLinks(originalNodes) {
77032
- const nodes = [],
77033
- links = [],
77034
- nodeMap = {},
77035
- linkMap = {},
77036
- originalLinks = [];
77037
- calculateNodeValue(originalNodes);
77038
- const doSubTree = (subTree, depth, parents) => {
77039
- subTree.forEach((node, index) => {
77040
- const nodeKey = this._getNodeKey ? this._getNodeKey(node) : parents ? `${parents[parents.length - 1].key}-${index}` : `${depth}-${index}`,
77041
- nodeValue = isNil$1(node.value) ? 0 : toValidNumber$1(node.value);
77042
- if (nodeMap[nodeKey]) nodeMap[nodeKey].value = void 0;else {
77043
- const nodeElement = {
77044
- depth: depth,
77045
- datum: node,
77046
- index: index,
77047
- key: nodeKey,
77048
- value: nodeValue,
77049
- sourceLinks: [],
77050
- targetLinks: []
77051
- };
77052
- nodeMap[nodeKey] = nodeElement, nodes.push(nodeElement);
77053
- }
77054
- parents && originalLinks.push({
77055
- source: parents[parents.length - 1].key,
77056
- target: nodeKey,
77057
- value: nodeValue,
77058
- parents: parents
77059
- }), node.children && node.children.length && doSubTree(node.children, depth + 1, parents ? parents.concat([nodeMap[nodeKey]]) : [nodeMap[nodeKey]]);
77060
- });
77061
- };
77062
- return doSubTree(originalNodes, 0, null), originalLinks.forEach((link, index) => {
77063
- const key = `${link.source}-${link.target}`,
77064
- linkDatum = pickWithout(link, ["parents"]);
77065
- if (linkDatum.parents = link.parents.map(node => pickWithout(node, ["sourceLinks", "targetLinks"])), linkMap[key]) return linkMap[key].value += toValidNumber$1(link.value), void linkMap[key].datum.push(linkDatum);
77066
- const linkElement = {
77067
- index: index,
77068
- key: `${link.source}-${link.target}`,
77069
- source: link.source,
77070
- target: link.target,
77071
- datum: [linkDatum],
77072
- value: link.value,
77073
- parents: link.parents.map(parent => parent.key)
77074
- };
77075
- links.push(linkElement), nodeMap[link.source].sourceLinks.push(linkElement), nodeMap[link.target].targetLinks.push(linkElement), linkMap[key] = linkElement;
77076
- }), {
77077
- nodes: nodes,
77078
- links: links,
77079
- nodeMap: nodeMap
77080
- };
77150
+ return computeHierarchicNodeLinks(originalNodes, this._getNodeKey);
77081
77151
  }
77082
77152
  computeSourceTargetNodeLinks(data) {
77083
77153
  const nodes = [],
@@ -77147,16 +77217,7 @@
77147
77217
  };
77148
77218
  }
77149
77219
  computeNodeValues(nodes) {
77150
- for (let i = 0, len = nodes.length; i < len; i++) {
77151
- const node = nodes[i];
77152
- node.value = Math.max(isNil$1(node.value) ? 0 : toValidNumber$1(node.value), node.sourceLinks.reduce((sum, link) => {
77153
- var _a;
77154
- return sum + (null !== (_a = toValidNumber$1(link.value)) && void 0 !== _a ? _a : 0);
77155
- }, 0), node.targetLinks.reduce((sum, link) => {
77156
- var _a;
77157
- return sum + (null !== (_a = toValidNumber$1(link.value)) && void 0 !== _a ? _a : 0);
77158
- }, 0));
77159
- }
77220
+ return computeNodeValues(nodes);
77160
77221
  }
77161
77222
  computeNodeDepths(nodes) {
77162
77223
  var _a;
@@ -78221,7 +78282,7 @@
78221
78282
  return ret;
78222
78283
  }
78223
78284
 
78224
- function scaleSolution(solution, width, height, x0, y0) {
78285
+ function scaleSolution(solution, width, height, x0, y0, hasEmptySet = !1) {
78225
78286
  width = Math.max(width, 1), height = Math.max(height, 1);
78226
78287
  const circles = [],
78227
78288
  setIds = [];
@@ -78231,9 +78292,20 @@
78231
78292
  yRange = bounds.yRange;
78232
78293
  if (xRange.max === xRange.min || yRange.max === yRange.min) return console.log("not scaling solution: zero size detected"), solution;
78233
78294
  const xScaling = width / (xRange.max - xRange.min),
78234
- yScaling = height / (yRange.max - yRange.min),
78235
- scaling = Math.min(yScaling, xScaling),
78236
- xOffset = (width - (xRange.max - xRange.min) * scaling) / 2,
78295
+ yScaling = height / (yRange.max - yRange.min);
78296
+ let scaling;
78297
+ if (hasEmptySet) {
78298
+ const containerRadius = Math.min(width, height) / 2,
78299
+ centerX = (xRange.min + xRange.max) / 2,
78300
+ centerY = (yRange.min + yRange.max) / 2;
78301
+ let diagramRadius = 0;
78302
+ for (const circle of circles) {
78303
+ const maxDistanceForThisCircle = Math.sqrt(Math.pow(circle.x - centerX, 2) + Math.pow(circle.y - centerY, 2)) + circle.radius;
78304
+ diagramRadius = Math.max(diagramRadius, maxDistanceForThisCircle);
78305
+ }
78306
+ scaling = containerRadius / diagramRadius;
78307
+ } else scaling = Math.min(yScaling, xScaling);
78308
+ const xOffset = (width - (xRange.max - xRange.min) * scaling) / 2,
78237
78309
  yOffset = (height - (yRange.max - yRange.min) * scaling) / 2,
78238
78310
  scaled = {};
78239
78311
  for (let i = 0; i < circles.length; ++i) {
@@ -78448,21 +78520,39 @@
78448
78520
  setField = "sets",
78449
78521
  valueField = "size",
78450
78522
  orientation = Math.PI / 2,
78451
- orientationOrder = null
78523
+ orientationOrder = null,
78524
+ emptySetKey: emptySetKey
78452
78525
  } = options;
78453
78526
  let circles = {},
78454
78527
  textCenters = {};
78455
- if (upstreamData.length > 0) {
78456
- const vennData = upstreamData.map(area => ({
78528
+ const hasEmptySet = upstreamData.some(area => {
78529
+ const sets = array(area[setField]);
78530
+ return !sets || 0 === sets.length;
78531
+ }),
78532
+ nonEmptyData = hasEmptySet ? upstreamData.filter(area => !isEmpty(array(area[setField]))) : upstreamData;
78533
+ if (nonEmptyData.length > 0) {
78534
+ const vennData = nonEmptyData.map(area => ({
78457
78535
  sets: array(area[setField]),
78458
78536
  size: area[valueField]
78459
78537
  }));
78460
78538
  let solution = venn$1(vennData, options);
78461
- solution = normalizeSolution(solution, orientation, orientationOrder), circles = scaleSolution(solution, x1 - x0, y1 - y0, x0, y0), textCenters = computeTextCenters(circles, vennData);
78539
+ solution = normalizeSolution(solution, orientation, orientationOrder), circles = scaleSolution(solution, x1 - x0, y1 - y0, x0, y0, hasEmptySet), textCenters = computeTextCenters(circles, vennData);
78462
78540
  }
78463
78541
  return upstreamData.map(area => {
78464
- const sets = array(area[setField]),
78465
- key = sets.toString(),
78542
+ const sets = array(area[setField]);
78543
+ if (!sets || 0 === sets.length) return Object.assign(Object.assign({}, area), {
78544
+ datum: area,
78545
+ sets: sets,
78546
+ key: emptySetKey || "others",
78547
+ size: area[valueField],
78548
+ labelX: void 0,
78549
+ labelY: void 0,
78550
+ type: "circle",
78551
+ x: x0 + (x1 - x0) / 2,
78552
+ y: y0 + (y1 - y0) / 2,
78553
+ radius: Math.min(x1 - x0, y1 - y0) / 2
78554
+ });
78555
+ const key = sets.toString(),
78466
78556
  textCenter = textCenters[key],
78467
78557
  basicDatum = Object.assign(Object.assign({}, area), {
78468
78558
  datum: area,
@@ -80927,7 +81017,6 @@
80927
81017
  if (this._spec.isTransform) {
80928
81018
  this._funnelTransformMark = this._createMark(Object.assign(Object.assign({}, FunnelSeries.mark.transform), { name: this._transformMarkName, type: this._transformMarkType }), {
80929
81019
  themeSpec: (_b = this._theme) === null || _b === void 0 ? void 0 : _b.transform,
80930
- skipBeforeLayouted: true,
80931
81020
  noSeparateStyle: true
80932
81021
  });
80933
81022
  if (this._funnelTransformMark) {
@@ -80940,7 +81029,6 @@
80940
81029
  this._funnelOuterLabelMark.label = this._createMark(FunnelSeries.mark.outerLabel, {
80941
81030
  themeSpec: (_h = this._theme) === null || _h === void 0 ? void 0 : _h.outerLabel,
80942
81031
  markSpec: this._spec.outerLabel,
80943
- skipBeforeLayouted: true,
80944
81032
  noSeparateStyle: true,
80945
81033
  parent: false
80946
81034
  });
@@ -82848,380 +82936,6 @@
82848
82936
  }
82849
82937
  }
82850
82938
  };
82851
- this._handleClearEmpty = () => {
82852
- var _a, _b;
82853
- if (!this._needClear) {
82854
- return;
82855
- }
82856
- const allNodeElements = (_a = this._nodeMark) === null || _a === void 0 ? void 0 : _a.getGraphics();
82857
- if (!allNodeElements || !allNodeElements.length) {
82858
- return;
82859
- }
82860
- const allLinkElements = (_b = this._linkMark) === null || _b === void 0 ? void 0 : _b.getGraphics();
82861
- if (!allLinkElements || !allLinkElements.length) {
82862
- return;
82863
- }
82864
- allNodeElements.forEach(el => {
82865
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
82866
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
82867
- });
82868
- allLinkElements.forEach(el => {
82869
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
82870
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
82871
- });
82872
- this._needClear = false;
82873
- };
82874
- this._handleNodeAdjacencyClick = (graphic) => {
82875
- const nodeDatum = getDatumOfGraphic(graphic);
82876
- const highlightNodes = [nodeDatum.key];
82877
- if (this._linkMark) {
82878
- const allLinkElements = this._linkMark.getGraphics();
82879
- if (!allLinkElements || !allLinkElements.length) {
82880
- return;
82881
- }
82882
- allLinkElements.forEach((linkEl, i) => {
82883
- const linkDatum = getDatumOfGraphic(linkEl);
82884
- if (linkDatum.source === nodeDatum.key) {
82885
- if (!highlightNodes.includes(linkDatum.target)) {
82886
- highlightNodes.push(linkDatum.target);
82887
- }
82888
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
82889
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
82890
- }
82891
- else if (linkDatum.target === nodeDatum.key) {
82892
- if (!highlightNodes.includes(linkDatum.source)) {
82893
- highlightNodes.push(linkDatum.source);
82894
- }
82895
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
82896
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
82897
- }
82898
- else {
82899
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
82900
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
82901
- }
82902
- });
82903
- }
82904
- if (this._nodeMark) {
82905
- this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
82906
- }
82907
- this._needClear = true;
82908
- };
82909
- this._handleLinkAdjacencyClick = (graphic) => {
82910
- const curLinkDatum = getDatumOfGraphic(graphic);
82911
- const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
82912
- if (this._linkMark) {
82913
- const allLinkElements = this._linkMark.getGraphics();
82914
- if (!allLinkElements || !allLinkElements.length) {
82915
- return;
82916
- }
82917
- allLinkElements.forEach(linkEl => {
82918
- if (linkEl === graphic) {
82919
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
82920
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
82921
- }
82922
- else {
82923
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
82924
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
82925
- }
82926
- });
82927
- }
82928
- if (this._nodeMark) {
82929
- this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
82930
- }
82931
- this._needClear = true;
82932
- };
82933
- this._handleNodeRelatedClick = (graphic) => {
82934
- var _a;
82935
- const nodeDatum = getDatumOfGraphic(graphic);
82936
- const allNodeElements = this._nodeMark.getGraphics();
82937
- if (!allNodeElements || !allNodeElements.length) {
82938
- return;
82939
- }
82940
- const allLinkElements = this._linkMark.getGraphics();
82941
- if (!allLinkElements || !allLinkElements.length) {
82942
- return;
82943
- }
82944
- const father = ((_a = getDatumOfGraphic(allLinkElements[0])) === null || _a === void 0 ? void 0 : _a.parents) ? 'parents' : 'source';
82945
- if (father === 'source') {
82946
- const highlightNodes = [nodeDatum.key];
82947
- const highlightLinks = [];
82948
- allLinkElements.forEach((linkEl, i) => {
82949
- var _a, _b, _c, _d;
82950
- const linkDatum = getDatumOfGraphic(linkEl);
82951
- const father = (linkDatum === null || linkDatum === void 0 ? void 0 : linkDatum.parents) ? 'parents' : 'source';
82952
- if (array(linkDatum[father]).includes(nodeDatum.key)) {
82953
- if (!highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
82954
- highlightLinks.push((_b = linkDatum.key) !== null && _b !== void 0 ? _b : linkDatum.index);
82955
- }
82956
- if (!highlightNodes.includes(linkDatum.source)) {
82957
- highlightNodes.push(linkDatum.source);
82958
- }
82959
- if (!highlightNodes.includes(linkDatum.target)) {
82960
- highlightNodes.push(linkDatum.target);
82961
- const targetNode = allNodeElements.find(nodeElement => {
82962
- return nodeElement.data[0].key === linkDatum.target;
82963
- });
82964
- let targetNodeSourceLinks = targetNode.data[0].sourceLinks;
82965
- while ((targetNodeSourceLinks === null || targetNodeSourceLinks === void 0 ? void 0 : targetNodeSourceLinks.length) > 0) {
82966
- const newTargetNodeSourceLinks = [];
82967
- targetNodeSourceLinks.forEach((targetNodeSourceLinkDatum) => {
82968
- var _a, _b;
82969
- if (!highlightLinks.includes((_a = targetNodeSourceLinkDatum.key) !== null && _a !== void 0 ? _a : targetNodeSourceLinkDatum.index)) {
82970
- highlightLinks.push((_b = targetNodeSourceLinkDatum.key) !== null && _b !== void 0 ? _b : targetNodeSourceLinkDatum.index);
82971
- if (!highlightNodes.includes(targetNodeSourceLinkDatum.target)) {
82972
- highlightNodes.push(targetNodeSourceLinkDatum.target);
82973
- const sourceNodeTemp = allNodeElements.find(nodeElement => {
82974
- return nodeElement.data[0].key === targetNodeSourceLinkDatum.target;
82975
- });
82976
- newTargetNodeSourceLinks.push(sourceNodeTemp.data[0].targetLinks);
82977
- }
82978
- else {
82979
- return;
82980
- }
82981
- }
82982
- else {
82983
- return;
82984
- }
82985
- });
82986
- targetNodeSourceLinks = newTargetNodeSourceLinks;
82987
- return;
82988
- }
82989
- }
82990
- }
82991
- else if (linkDatum.target === nodeDatum.key) {
82992
- if (!highlightLinks.includes((_c = linkDatum.key) !== null && _c !== void 0 ? _c : linkDatum.index)) {
82993
- highlightLinks.push((_d = linkDatum.key) !== null && _d !== void 0 ? _d : linkDatum.index);
82994
- }
82995
- if (!highlightNodes.includes(linkDatum.source)) {
82996
- highlightNodes.push(linkDatum.source);
82997
- const sourceNode = allNodeElements.find(nodeElement => {
82998
- return nodeElement.data[0].key === linkDatum.source;
82999
- });
83000
- let sourceNodeTargetLinks = sourceNode.data[0].targetLinks;
83001
- while ((sourceNodeTargetLinks === null || sourceNodeTargetLinks === void 0 ? void 0 : sourceNodeTargetLinks.length) > 0) {
83002
- const newSourceNodeTargetLinks = [];
83003
- sourceNodeTargetLinks.forEach((sourceNodeTargetLinkDatum) => {
83004
- var _a, _b;
83005
- if (!highlightLinks.includes((_a = sourceNodeTargetLinkDatum.key) !== null && _a !== void 0 ? _a : sourceNodeTargetLinkDatum.index)) {
83006
- highlightLinks.push((_b = sourceNodeTargetLinkDatum.key) !== null && _b !== void 0 ? _b : sourceNodeTargetLinkDatum.index);
83007
- if (!highlightNodes.includes(sourceNodeTargetLinkDatum.source)) {
83008
- highlightNodes.push(sourceNodeTargetLinkDatum.source);
83009
- const sourceNodeTemp = allNodeElements.find(nodeElement => {
83010
- return nodeElement.data[0].key === sourceNodeTargetLinkDatum.source;
83011
- });
83012
- newSourceNodeTargetLinks.push(sourceNodeTemp.data[0].targetLinks);
83013
- }
83014
- else {
83015
- return;
83016
- }
83017
- }
83018
- else {
83019
- return;
83020
- }
83021
- });
83022
- sourceNodeTargetLinks = newSourceNodeTargetLinks;
83023
- return;
83024
- }
83025
- }
83026
- }
83027
- });
83028
- if (this._linkMark) {
83029
- const allLinkElements = this._linkMark.getGraphics();
83030
- if (!allLinkElements || !allLinkElements.length) {
83031
- return;
83032
- }
83033
- allLinkElements.forEach((linkEl, i) => {
83034
- var _a;
83035
- const linkDatum = getDatumOfGraphic(linkEl);
83036
- if (highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
83037
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83038
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
83039
- }
83040
- else {
83041
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83042
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83043
- }
83044
- });
83045
- }
83046
- if (this._nodeMark) {
83047
- this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83048
- }
83049
- }
83050
- else {
83051
- const highlightNodes = [nodeDatum.key];
83052
- const upstreamLinks = nodeDatum.targetLinks.reduce((res, link) => {
83053
- const dividedLinks = array(link.datum);
83054
- dividedLinks.forEach(dividedLink => {
83055
- const parents = dividedLink.parents;
83056
- const len = parents.length;
83057
- for (let i = 0; i < len; i++) {
83058
- const source = parents[i].key;
83059
- const target = parents[i + 1] ? parents[i + 1].key : nodeDatum.key;
83060
- const value = dividedLink.value;
83061
- const existingItem = res.find(item => item.source === source && item.target === target);
83062
- if (existingItem) {
83063
- existingItem.value += value;
83064
- }
83065
- else {
83066
- res.push({ source, target, value });
83067
- }
83068
- }
83069
- });
83070
- return res;
83071
- }, []);
83072
- allLinkElements.forEach((linkEl, i) => {
83073
- const linkDatum = getDatumOfGraphic(linkEl);
83074
- const originalDatum = linkDatum.datum;
83075
- const selectedDatum = originalDatum
83076
- ? originalDatum.filter((entry) => entry[father].some((par) => par.key === nodeDatum.key))
83077
- : null;
83078
- const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
83079
- if (selectedDatum && selectedDatum.length) {
83080
- if (!highlightNodes.includes(linkDatum.source)) {
83081
- highlightNodes.push(linkDatum.source);
83082
- }
83083
- if (!highlightNodes.includes(linkDatum.target)) {
83084
- highlightNodes.push(linkDatum.target);
83085
- }
83086
- const val = selectedDatum.reduce((sum, d) => {
83087
- return (sum += d.value);
83088
- }, 0);
83089
- const ratio = val / linkDatum.value;
83090
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83091
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
83092
- return;
83093
- }
83094
- if (upSelectedLink) {
83095
- if (!highlightNodes.includes(linkDatum.source)) {
83096
- highlightNodes.push(linkDatum.source);
83097
- }
83098
- if (!highlightNodes.includes(linkDatum.target)) {
83099
- highlightNodes.push(linkDatum.target);
83100
- }
83101
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83102
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
83103
- ratio: upSelectedLink.value / linkDatum.value
83104
- });
83105
- return;
83106
- }
83107
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83108
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83109
- return;
83110
- });
83111
- if (this._nodeMark) {
83112
- this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83113
- }
83114
- }
83115
- this._needClear = true;
83116
- };
83117
- this._handleLinkRelatedClick = (graphic) => {
83118
- const allNodeElements = this._nodeMark.getGraphics();
83119
- if (!allNodeElements || !allNodeElements.length) {
83120
- return;
83121
- }
83122
- const allLinkElements = this._linkMark.getGraphics();
83123
- if (!allLinkElements || !allLinkElements.length) {
83124
- return;
83125
- }
83126
- const father = getDatumOfGraphic(graphic) ? 'parents' : 'source';
83127
- if (father === 'source') {
83128
- if (this._linkMark) {
83129
- allLinkElements.forEach(linkEl => {
83130
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83131
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83132
- });
83133
- }
83134
- if (this._nodeMark) {
83135
- allNodeElements.forEach(el => {
83136
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83137
- el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83138
- });
83139
- }
83140
- }
83141
- else {
83142
- const curLinkDatum = getDatumOfGraphic(graphic);
83143
- const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
83144
- const upstreamLinks = [];
83145
- const dividedLinks = array(curLinkDatum.datum);
83146
- dividedLinks.forEach(dividedLink => {
83147
- const parents = dividedLink.parents;
83148
- const len = parents.length;
83149
- for (let i = 0; i < len - 1; i++) {
83150
- const source = parents[i].key;
83151
- const target = parents[i + 1].key;
83152
- const value = dividedLink.value;
83153
- const existingItem = upstreamLinks.find(item => item.source === source && item.target === target);
83154
- upstreamLinks.push({
83155
- source: parents[i].key,
83156
- target: parents[i + 1].key,
83157
- value: dividedLink.value
83158
- });
83159
- if (existingItem) {
83160
- existingItem.value += value;
83161
- }
83162
- else {
83163
- upstreamLinks.push({ source, target, value });
83164
- }
83165
- }
83166
- });
83167
- allLinkElements.forEach(linkEl => {
83168
- const linkDatum = getDatumOfGraphic(linkEl);
83169
- const originalDatum = linkDatum.datum;
83170
- if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
83171
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83172
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
83173
- return;
83174
- }
83175
- const selectedDatum = originalDatum
83176
- ? originalDatum.filter((entry) => {
83177
- const parentKeysList = entry.parents.map((item) => item.key);
83178
- return parentKeysList.includes(curLinkDatum.source) && parentKeysList.includes(curLinkDatum.target);
83179
- })
83180
- : null;
83181
- if (selectedDatum && selectedDatum.length) {
83182
- if (!highlightNodes.includes(linkDatum.source)) {
83183
- highlightNodes.push(linkDatum.source);
83184
- }
83185
- if (!highlightNodes.includes(linkDatum.target)) {
83186
- highlightNodes.push(linkDatum.target);
83187
- }
83188
- const val = selectedDatum
83189
- .filter((entry) => {
83190
- return entry.parents.some((par, index) => {
83191
- var _a;
83192
- return par.key === curLinkDatum.source && ((_a = entry.parents[index + 1]) === null || _a === void 0 ? void 0 : _a.key) === curLinkDatum.target;
83193
- });
83194
- })
83195
- .reduce((sum, d) => {
83196
- return (sum += d.value);
83197
- }, 0);
83198
- const ratio = val / linkDatum.value;
83199
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83200
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
83201
- return;
83202
- }
83203
- const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
83204
- if (upSelectedLink) {
83205
- if (!highlightNodes.includes(linkDatum.source)) {
83206
- highlightNodes.push(linkDatum.source);
83207
- }
83208
- if (!highlightNodes.includes(linkDatum.target)) {
83209
- highlightNodes.push(linkDatum.target);
83210
- }
83211
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83212
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
83213
- ratio: upSelectedLink.value / linkDatum.value
83214
- });
83215
- return;
83216
- }
83217
- linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83218
- linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83219
- return;
83220
- });
83221
- this._highLightElements(allNodeElements, highlightNodes);
83222
- }
83223
- this._needClear = true;
83224
- };
83225
82939
  }
83226
82940
  get direction() {
83227
82941
  var _a;
@@ -83511,6 +83225,380 @@
83511
83225
  linksSeriesDataUpdate() {
83512
83226
  this._linkMark.getData().updateData();
83513
83227
  }
83228
+ _handleClearEmpty() {
83229
+ var _a, _b;
83230
+ if (!this._needClear) {
83231
+ return;
83232
+ }
83233
+ const allNodeElements = (_a = this._nodeMark) === null || _a === void 0 ? void 0 : _a.getGraphics();
83234
+ if (!allNodeElements || !allNodeElements.length) {
83235
+ return;
83236
+ }
83237
+ const allLinkElements = (_b = this._linkMark) === null || _b === void 0 ? void 0 : _b.getGraphics();
83238
+ if (!allLinkElements || !allLinkElements.length) {
83239
+ return;
83240
+ }
83241
+ allNodeElements.forEach(el => {
83242
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83243
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83244
+ });
83245
+ allLinkElements.forEach(el => {
83246
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83247
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83248
+ });
83249
+ this._needClear = false;
83250
+ }
83251
+ _handleNodeAdjacencyClick(graphic) {
83252
+ const nodeDatum = getDatumOfGraphic(graphic);
83253
+ const highlightNodes = [nodeDatum.key];
83254
+ if (this._linkMark) {
83255
+ const allLinkElements = this._linkMark.getGraphics();
83256
+ if (!allLinkElements || !allLinkElements.length) {
83257
+ return;
83258
+ }
83259
+ allLinkElements.forEach((linkEl, i) => {
83260
+ const linkDatum = getDatumOfGraphic(linkEl);
83261
+ if (linkDatum.source === nodeDatum.key) {
83262
+ if (!highlightNodes.includes(linkDatum.target)) {
83263
+ highlightNodes.push(linkDatum.target);
83264
+ }
83265
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83266
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
83267
+ }
83268
+ else if (linkDatum.target === nodeDatum.key) {
83269
+ if (!highlightNodes.includes(linkDatum.source)) {
83270
+ highlightNodes.push(linkDatum.source);
83271
+ }
83272
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83273
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
83274
+ }
83275
+ else {
83276
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83277
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83278
+ }
83279
+ });
83280
+ }
83281
+ if (this._nodeMark) {
83282
+ this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83283
+ }
83284
+ this._needClear = true;
83285
+ }
83286
+ _handleLinkAdjacencyClick(graphic) {
83287
+ const curLinkDatum = getDatumOfGraphic(graphic);
83288
+ const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
83289
+ if (this._linkMark) {
83290
+ const allLinkElements = this._linkMark.getGraphics();
83291
+ if (!allLinkElements || !allLinkElements.length) {
83292
+ return;
83293
+ }
83294
+ allLinkElements.forEach(linkEl => {
83295
+ if (linkEl === graphic) {
83296
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83297
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
83298
+ }
83299
+ else {
83300
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83301
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83302
+ }
83303
+ });
83304
+ }
83305
+ if (this._nodeMark) {
83306
+ this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83307
+ }
83308
+ this._needClear = true;
83309
+ }
83310
+ _handleNodeRelatedClick(graphic) {
83311
+ var _a;
83312
+ const nodeDatum = getDatumOfGraphic(graphic);
83313
+ const allNodeElements = this._nodeMark.getGraphics();
83314
+ if (!allNodeElements || !allNodeElements.length) {
83315
+ return;
83316
+ }
83317
+ const allLinkElements = this._linkMark.getGraphics();
83318
+ if (!allLinkElements || !allLinkElements.length) {
83319
+ return;
83320
+ }
83321
+ const father = ((_a = getDatumOfGraphic(allLinkElements[0])) === null || _a === void 0 ? void 0 : _a.parents) ? 'parents' : 'source';
83322
+ if (father === 'source') {
83323
+ const highlightNodes = [nodeDatum.key];
83324
+ const highlightLinks = [];
83325
+ allLinkElements.forEach((linkEl, i) => {
83326
+ var _a, _b, _c, _d;
83327
+ const linkDatum = getDatumOfGraphic(linkEl);
83328
+ const father = (linkDatum === null || linkDatum === void 0 ? void 0 : linkDatum.parents) ? 'parents' : 'source';
83329
+ if (array(linkDatum[father]).includes(nodeDatum.key)) {
83330
+ if (!highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
83331
+ highlightLinks.push((_b = linkDatum.key) !== null && _b !== void 0 ? _b : linkDatum.index);
83332
+ }
83333
+ if (!highlightNodes.includes(linkDatum.source)) {
83334
+ highlightNodes.push(linkDatum.source);
83335
+ }
83336
+ if (!highlightNodes.includes(linkDatum.target)) {
83337
+ highlightNodes.push(linkDatum.target);
83338
+ const targetNode = allNodeElements.find(nodeElement => {
83339
+ return nodeElement.data[0].key === linkDatum.target;
83340
+ });
83341
+ let targetNodeSourceLinks = targetNode.data[0].sourceLinks;
83342
+ while ((targetNodeSourceLinks === null || targetNodeSourceLinks === void 0 ? void 0 : targetNodeSourceLinks.length) > 0) {
83343
+ const newTargetNodeSourceLinks = [];
83344
+ targetNodeSourceLinks.forEach((targetNodeSourceLinkDatum) => {
83345
+ var _a, _b;
83346
+ if (!highlightLinks.includes((_a = targetNodeSourceLinkDatum.key) !== null && _a !== void 0 ? _a : targetNodeSourceLinkDatum.index)) {
83347
+ highlightLinks.push((_b = targetNodeSourceLinkDatum.key) !== null && _b !== void 0 ? _b : targetNodeSourceLinkDatum.index);
83348
+ if (!highlightNodes.includes(targetNodeSourceLinkDatum.target)) {
83349
+ highlightNodes.push(targetNodeSourceLinkDatum.target);
83350
+ const sourceNodeTemp = allNodeElements.find(nodeElement => {
83351
+ return nodeElement.data[0].key === targetNodeSourceLinkDatum.target;
83352
+ });
83353
+ newTargetNodeSourceLinks.push(sourceNodeTemp.data[0].targetLinks);
83354
+ }
83355
+ else {
83356
+ return;
83357
+ }
83358
+ }
83359
+ else {
83360
+ return;
83361
+ }
83362
+ });
83363
+ targetNodeSourceLinks = newTargetNodeSourceLinks;
83364
+ return;
83365
+ }
83366
+ }
83367
+ }
83368
+ else if (linkDatum.target === nodeDatum.key) {
83369
+ if (!highlightLinks.includes((_c = linkDatum.key) !== null && _c !== void 0 ? _c : linkDatum.index)) {
83370
+ highlightLinks.push((_d = linkDatum.key) !== null && _d !== void 0 ? _d : linkDatum.index);
83371
+ }
83372
+ if (!highlightNodes.includes(linkDatum.source)) {
83373
+ highlightNodes.push(linkDatum.source);
83374
+ const sourceNode = allNodeElements.find(nodeElement => {
83375
+ return nodeElement.data[0].key === linkDatum.source;
83376
+ });
83377
+ let sourceNodeTargetLinks = sourceNode.data[0].targetLinks;
83378
+ while ((sourceNodeTargetLinks === null || sourceNodeTargetLinks === void 0 ? void 0 : sourceNodeTargetLinks.length) > 0) {
83379
+ const newSourceNodeTargetLinks = [];
83380
+ sourceNodeTargetLinks.forEach((sourceNodeTargetLinkDatum) => {
83381
+ var _a, _b;
83382
+ if (!highlightLinks.includes((_a = sourceNodeTargetLinkDatum.key) !== null && _a !== void 0 ? _a : sourceNodeTargetLinkDatum.index)) {
83383
+ highlightLinks.push((_b = sourceNodeTargetLinkDatum.key) !== null && _b !== void 0 ? _b : sourceNodeTargetLinkDatum.index);
83384
+ if (!highlightNodes.includes(sourceNodeTargetLinkDatum.source)) {
83385
+ highlightNodes.push(sourceNodeTargetLinkDatum.source);
83386
+ const sourceNodeTemp = allNodeElements.find(nodeElement => {
83387
+ return nodeElement.data[0].key === sourceNodeTargetLinkDatum.source;
83388
+ });
83389
+ newSourceNodeTargetLinks.push(sourceNodeTemp.data[0].targetLinks);
83390
+ }
83391
+ else {
83392
+ return;
83393
+ }
83394
+ }
83395
+ else {
83396
+ return;
83397
+ }
83398
+ });
83399
+ sourceNodeTargetLinks = newSourceNodeTargetLinks;
83400
+ return;
83401
+ }
83402
+ }
83403
+ }
83404
+ });
83405
+ if (this._linkMark) {
83406
+ const allLinkElements = this._linkMark.getGraphics();
83407
+ if (!allLinkElements || !allLinkElements.length) {
83408
+ return;
83409
+ }
83410
+ allLinkElements.forEach((linkEl, i) => {
83411
+ var _a;
83412
+ const linkDatum = getDatumOfGraphic(linkEl);
83413
+ if (highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
83414
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83415
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
83416
+ }
83417
+ else {
83418
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83419
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83420
+ }
83421
+ });
83422
+ }
83423
+ if (this._nodeMark) {
83424
+ this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83425
+ }
83426
+ }
83427
+ else {
83428
+ const highlightNodes = [nodeDatum.key];
83429
+ const upstreamLinks = nodeDatum.targetLinks.reduce((res, link) => {
83430
+ const dividedLinks = array(link.datum);
83431
+ dividedLinks.forEach(dividedLink => {
83432
+ const parents = dividedLink.parents;
83433
+ const len = parents.length;
83434
+ for (let i = 0; i < len; i++) {
83435
+ const source = parents[i].key;
83436
+ const target = parents[i + 1] ? parents[i + 1].key : nodeDatum.key;
83437
+ const value = dividedLink.value;
83438
+ const existingItem = res.find(item => item.source === source && item.target === target);
83439
+ if (existingItem) {
83440
+ existingItem.value += value;
83441
+ }
83442
+ else {
83443
+ res.push({ source, target, value });
83444
+ }
83445
+ }
83446
+ });
83447
+ return res;
83448
+ }, []);
83449
+ allLinkElements.forEach((linkEl, i) => {
83450
+ const linkDatum = getDatumOfGraphic(linkEl);
83451
+ const originalDatum = linkDatum.datum;
83452
+ const selectedDatum = originalDatum
83453
+ ? originalDatum.filter((entry) => entry[father].some((par) => par.key === nodeDatum.key))
83454
+ : null;
83455
+ const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
83456
+ if (selectedDatum && selectedDatum.length) {
83457
+ if (!highlightNodes.includes(linkDatum.source)) {
83458
+ highlightNodes.push(linkDatum.source);
83459
+ }
83460
+ if (!highlightNodes.includes(linkDatum.target)) {
83461
+ highlightNodes.push(linkDatum.target);
83462
+ }
83463
+ const val = selectedDatum.reduce((sum, d) => {
83464
+ return (sum += d.value);
83465
+ }, 0);
83466
+ const ratio = val / linkDatum.value;
83467
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83468
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
83469
+ return;
83470
+ }
83471
+ if (upSelectedLink) {
83472
+ if (!highlightNodes.includes(linkDatum.source)) {
83473
+ highlightNodes.push(linkDatum.source);
83474
+ }
83475
+ if (!highlightNodes.includes(linkDatum.target)) {
83476
+ highlightNodes.push(linkDatum.target);
83477
+ }
83478
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83479
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
83480
+ ratio: upSelectedLink.value / linkDatum.value
83481
+ });
83482
+ return;
83483
+ }
83484
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83485
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83486
+ return;
83487
+ });
83488
+ if (this._nodeMark) {
83489
+ this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
83490
+ }
83491
+ }
83492
+ this._needClear = true;
83493
+ }
83494
+ _handleLinkRelatedClick(graphic) {
83495
+ const allNodeElements = this._nodeMark.getGraphics();
83496
+ if (!allNodeElements || !allNodeElements.length) {
83497
+ return;
83498
+ }
83499
+ const allLinkElements = this._linkMark.getGraphics();
83500
+ if (!allLinkElements || !allLinkElements.length) {
83501
+ return;
83502
+ }
83503
+ const father = getDatumOfGraphic(graphic) ? 'parents' : 'source';
83504
+ if (father === 'source') {
83505
+ if (this._linkMark) {
83506
+ allLinkElements.forEach(linkEl => {
83507
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83508
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83509
+ });
83510
+ }
83511
+ if (this._nodeMark) {
83512
+ allNodeElements.forEach(el => {
83513
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83514
+ el.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83515
+ });
83516
+ }
83517
+ }
83518
+ else {
83519
+ const curLinkDatum = getDatumOfGraphic(graphic);
83520
+ const highlightNodes = [curLinkDatum.source, curLinkDatum.target];
83521
+ const upstreamLinks = [];
83522
+ const dividedLinks = array(curLinkDatum.datum);
83523
+ dividedLinks.forEach(dividedLink => {
83524
+ const parents = dividedLink.parents;
83525
+ const len = parents.length;
83526
+ for (let i = 0; i < len - 1; i++) {
83527
+ const source = parents[i].key;
83528
+ const target = parents[i + 1].key;
83529
+ const value = dividedLink.value;
83530
+ const existingItem = upstreamLinks.find(item => item.source === source && item.target === target);
83531
+ upstreamLinks.push({
83532
+ source: parents[i].key,
83533
+ target: parents[i + 1].key,
83534
+ value: dividedLink.value
83535
+ });
83536
+ if (existingItem) {
83537
+ existingItem.value += value;
83538
+ }
83539
+ else {
83540
+ upstreamLinks.push({ source, target, value });
83541
+ }
83542
+ }
83543
+ });
83544
+ allLinkElements.forEach(linkEl => {
83545
+ const linkDatum = getDatumOfGraphic(linkEl);
83546
+ const originalDatum = linkDatum.datum;
83547
+ if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
83548
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83549
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
83550
+ return;
83551
+ }
83552
+ const selectedDatum = originalDatum
83553
+ ? originalDatum.filter((entry) => {
83554
+ const parentKeysList = entry.parents.map((item) => item.key);
83555
+ return parentKeysList.includes(curLinkDatum.source) && parentKeysList.includes(curLinkDatum.target);
83556
+ })
83557
+ : null;
83558
+ if (selectedDatum && selectedDatum.length) {
83559
+ if (!highlightNodes.includes(linkDatum.source)) {
83560
+ highlightNodes.push(linkDatum.source);
83561
+ }
83562
+ if (!highlightNodes.includes(linkDatum.target)) {
83563
+ highlightNodes.push(linkDatum.target);
83564
+ }
83565
+ const val = selectedDatum
83566
+ .filter((entry) => {
83567
+ return entry.parents.some((par, index) => {
83568
+ var _a;
83569
+ return par.key === curLinkDatum.source && ((_a = entry.parents[index + 1]) === null || _a === void 0 ? void 0 : _a.key) === curLinkDatum.target;
83570
+ });
83571
+ })
83572
+ .reduce((sum, d) => {
83573
+ return (sum += d.value);
83574
+ }, 0);
83575
+ const ratio = val / linkDatum.value;
83576
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83577
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
83578
+ return;
83579
+ }
83580
+ const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
83581
+ if (upSelectedLink) {
83582
+ if (!highlightNodes.includes(linkDatum.source)) {
83583
+ highlightNodes.push(linkDatum.source);
83584
+ }
83585
+ if (!highlightNodes.includes(linkDatum.target)) {
83586
+ highlightNodes.push(linkDatum.target);
83587
+ }
83588
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
83589
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
83590
+ ratio: upSelectedLink.value / linkDatum.value
83591
+ });
83592
+ return;
83593
+ }
83594
+ linkEl.removeState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
83595
+ linkEl.addState(exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
83596
+ return;
83597
+ });
83598
+ this._highLightElements(allNodeElements, highlightNodes);
83599
+ }
83600
+ this._needClear = true;
83601
+ }
83514
83602
  _highLightElements(graphics, highlightNodes) {
83515
83603
  if (!graphics || !graphics.length) {
83516
83604
  return;
@@ -89681,11 +89769,15 @@
89681
89769
  });
89682
89770
  };
89683
89771
  this._handleClickToLock = (params) => {
89772
+ var _a, _b;
89684
89773
  if (this._clickLock) {
89685
89774
  this._handleChartMouseOut(params);
89686
89775
  this._clickLock = false;
89687
89776
  }
89688
89777
  else {
89778
+ if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
89779
+ return;
89780
+ }
89689
89781
  this._clickLock = true;
89690
89782
  }
89691
89783
  };
@@ -89984,6 +90076,9 @@
89984
90076
  return;
89985
90077
  }
89986
90078
  this._isEnterTooltip = false;
90079
+ if (this._spec.triggerOff === 'none') {
90080
+ return;
90081
+ }
89987
90082
  if (this._cacheEnterableRect) {
89988
90083
  const newRect = (_a = container.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(container);
89989
90084
  if (newRect &&
@@ -90000,7 +90095,10 @@
90000
90095
  const activeType = this._spec.activeType;
90001
90096
  this.processor = {};
90002
90097
  activeType.forEach(type => {
90003
- this.processor[type] = Factory.createTooltipProcessor(type, this);
90098
+ const instance = Factory.createTooltipProcessor(type, this);
90099
+ if (instance) {
90100
+ this.processor[type] = instance;
90101
+ }
90004
90102
  });
90005
90103
  }
90006
90104
  _initEvent() {
@@ -90428,7 +90526,7 @@
90428
90526
  this.event.off(eventName, handler);
90429
90527
  }
90430
90528
  }
90431
- updateLayoutAttribute() {
90529
+ onBeforeRender() {
90432
90530
  this._limitBounds = null;
90433
90531
  this._showDefaultCrosshair();
90434
90532
  }
@@ -91312,7 +91410,7 @@
91312
91410
  return data.filter(filter);
91313
91411
  };
91314
91412
  const dataFilterComputeDomain = (data, op) => {
91315
- const { stateFields, valueFields, dataCollection, isCategoryState, seriesTypes } = op.input;
91413
+ const { stateFields, valueFields, dataCollection, isCategoryState } = op.input;
91316
91414
  const { stateField, valueField } = op.output;
91317
91415
  const resultObj = {};
91318
91416
  const resultData = [];
@@ -91333,8 +91431,7 @@
91333
91431
  }
91334
91432
  });
91335
91433
  }
91336
- const data = seriesTypes[i] === 'dot' ? objFlat(dv.latestData, 'dots') : dv.latestData;
91337
- data.forEach((d) => {
91434
+ dv.latestData.forEach((d) => {
91338
91435
  array(stateFields[i]).forEach(state => {
91339
91436
  if (!isNil$1(d[state])) {
91340
91437
  if (isNil$1(resultObj[d[state]])) {
@@ -91419,39 +91516,30 @@
91419
91516
  const axisScale = axis.getScale();
91420
91517
  const reverse = this._isReverse();
91421
91518
  const newRangeFactor = reverse ? [1 - this._end, 1 - this._start] : [this._start, this._end];
91422
- const linkedAxis = this._linkedAxisComponent;
91423
91519
  if (reverse) {
91424
91520
  switch (tag) {
91425
91521
  case 'startHandler':
91426
91522
  axis.scaleRangeFactorEnd(newRangeFactor[1]);
91427
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorEnd(newRangeFactor[1]);
91428
91523
  break;
91429
91524
  case 'endHandler':
91430
91525
  axis.scaleRangeFactorStart(newRangeFactor[0]);
91431
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorStart(newRangeFactor[0]);
91432
91526
  break;
91433
91527
  default:
91434
91528
  axis.scaleRangeFactorStart(newRangeFactor[0], true);
91435
91529
  axis.scaleRangeFactorEnd(newRangeFactor[1]);
91436
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorStart(newRangeFactor[0], true);
91437
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorEnd(newRangeFactor[1]);
91438
91530
  }
91439
91531
  }
91440
91532
  else {
91441
91533
  switch (tag) {
91442
91534
  case 'startHandler':
91443
91535
  axis.scaleRangeFactorStart(newRangeFactor[0]);
91444
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorStart(newRangeFactor[0]);
91445
91536
  break;
91446
91537
  case 'endHandler':
91447
91538
  axis.scaleRangeFactorEnd(newRangeFactor[1]);
91448
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorEnd(newRangeFactor[1]);
91449
91539
  break;
91450
91540
  default:
91451
91541
  axis.scaleRangeFactorEnd(newRangeFactor[1], true);
91452
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorEnd(newRangeFactor[1], true);
91453
91542
  axis.scaleRangeFactorStart(newRangeFactor[0]);
91454
- linkedAxis === null || linkedAxis === void 0 ? void 0 : linkedAxis.scaleRangeFactorStart(newRangeFactor[0]);
91455
91543
  }
91456
91544
  }
91457
91545
  const newFactor = axisScale.rangeFactor();
@@ -91633,12 +91721,6 @@
91633
91721
  else if (isValid$1(this._spec.axisIndex)) {
91634
91722
  this._relatedAxisComponent = this._option.getComponentByIndex('axes', this._spec.axisIndex);
91635
91723
  }
91636
- if (isValid$1(this._spec.linkedAxisId)) {
91637
- this._linkedAxisComponent = this._option.getComponentByUserId(this._spec.linkedAxisId);
91638
- }
91639
- else if (isValid$1(this._spec.linkedAxisIndex)) {
91640
- this._linkedAxisComponent = this._option.getComponentByIndex('axes', this._spec.linkedAxisIndex);
91641
- }
91642
91724
  if (isNil$1(this._spec.field) && !this._relatedAxisComponent) {
91643
91725
  const axes = this._option.getComponentsByKey('axes');
91644
91726
  const sameOrientAxis = axes.find((cm) => cm._orient === this._orient);
@@ -91721,15 +91803,11 @@
91721
91803
  const dataCollection = [];
91722
91804
  const stateFields = [];
91723
91805
  const valueFields = [];
91724
- const seriesTypes = [];
91725
91806
  let isCategoryState;
91726
91807
  if (this._relatedAxisComponent) {
91727
91808
  const originalStateFields = {};
91728
91809
  eachSeries(this._regions, s => {
91729
91810
  var _a, _b;
91730
- if (s.type === 'link') {
91731
- return;
91732
- }
91733
91811
  const xAxisHelper = s.coordinate === 'cartesian'
91734
91812
  ? s.getXAxisHelper()
91735
91813
  : s.coordinate === 'polar'
@@ -91752,7 +91830,6 @@
91752
91830
  : yAxisHelper;
91753
91831
  const valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
91754
91832
  dataCollection.push(s.getRawData());
91755
- seriesTypes.push(s.type);
91756
91833
  const seriesSpec = s.getSpec();
91757
91834
  const xField = s.coordinate === 'cartesian'
91758
91835
  ? array(seriesSpec.xField)
@@ -91771,7 +91848,7 @@
91771
91848
  }
91772
91849
  if (this._valueField) {
91773
91850
  const valueField = s.type === 'link' ? ['from_yField'] : valueAxisHelper === xAxisHelper ? xField : yField;
91774
- if (isContinuous(valueAxisHelper.getScale(0).type) || s.type === 'dot') {
91851
+ if (isContinuous(valueAxisHelper.getScale(0).type)) {
91775
91852
  valueFields.push(...valueField);
91776
91853
  }
91777
91854
  }
@@ -91804,8 +91881,7 @@
91804
91881
  dataCollection: dataCollection,
91805
91882
  stateFields,
91806
91883
  valueFields,
91807
- isCategoryState,
91808
- seriesTypes
91884
+ isCategoryState
91809
91885
  },
91810
91886
  output: {
91811
91887
  stateField: this._stateField,
@@ -91813,9 +91889,9 @@
91813
91889
  }
91814
91890
  }
91815
91891
  }, false);
91892
+ this._data = new CompilableData(this._option, data);
91816
91893
  data.reRunAllTransform();
91817
91894
  dataSet.multipleDataViewAddListener(dataCollection, 'change', this._handleDataCollectionChange.bind(this));
91818
- this._data = new CompilableData(this._option, data);
91819
91895
  }
91820
91896
  setAttrFromSpec() {
91821
91897
  var _a;
@@ -92013,7 +92089,7 @@
92013
92089
  _initCommonEvent() {
92014
92090
  var _a, _b, _c, _d, _e, _f, _g;
92015
92091
  const delayType = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.delayType) !== null && _b !== void 0 ? _b : 'throttle';
92016
- const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? ((_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30) : 0;
92092
+ const delayTime = isValid$1((_c = this._spec) === null || _c === void 0 ? void 0 : _c.delayType) ? (_e = (_d = this._spec) === null || _d === void 0 ? void 0 : _d.delayTime) !== null && _e !== void 0 ? _e : 30 : 0;
92017
92093
  const realTime = (_g = (_f = this._spec) === null || _f === void 0 ? void 0 : _f.realTime) !== null && _g !== void 0 ? _g : true;
92018
92094
  const option = { delayType, delayTime, realTime, allowComponentZoom: true };
92019
92095
  if (this._zoomAttr.enable) {
@@ -95161,6 +95237,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95161
95237
  this._option.globalInstance.on(exports.ChartEvent.rendered, () => {
95162
95238
  var _a;
95163
95239
  if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.auto) {
95240
+ this._playerComponent.pause();
95164
95241
  this._playerComponent.play();
95165
95242
  }
95166
95243
  });
@@ -96552,6 +96629,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96552
96629
  var _a;
96553
96630
  this._setRegionMarkPickable(region, true);
96554
96631
  const { operateMask } = e.detail;
96632
+ const { updateElementsState = true } = this._spec;
96555
96633
  if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
96556
96634
  if (this._spec.onBrushEnd(e) === true) {
96557
96635
  this.clearGraphic();
@@ -96565,7 +96643,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96565
96643
  }
96566
96644
  else {
96567
96645
  const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
96568
- if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
96646
+ if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || !updateElementsState) {
96569
96647
  this._setAxisAndDataZoom(operateMask, region);
96570
96648
  }
96571
96649
  this._emitEvent(exports.ChartEvent.brushEnd, region);
@@ -96574,8 +96652,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96574
96652
  brush.addEventListener(IOperateType.moveEnd, (e) => {
96575
96653
  this._setRegionMarkPickable(region, true);
96576
96654
  const { operateMask } = e.detail;
96655
+ const { updateElementsState = true } = this._spec;
96577
96656
  const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
96578
- if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
96657
+ if ((!this._spec.zoomWhenEmpty && inBrushData.length > 0) || updateElementsState) {
96579
96658
  this._setAxisAndDataZoom(operateMask, region);
96580
96659
  }
96581
96660
  this._emitEvent(exports.ChartEvent.brushEnd, region);
@@ -96617,8 +96696,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96617
96696
  }
96618
96697
  _handleBrushChange(region, e) {
96619
96698
  const { operateMask } = e.detail;
96620
- this._reconfigItem(operateMask, region);
96621
- this._reconfigLinkedItem(operateMask, region);
96699
+ const { updateElementsState = true } = this._spec;
96700
+ if (updateElementsState) {
96701
+ this._reconfigItem(operateMask, region);
96702
+ this._reconfigLinkedItem(operateMask, region);
96703
+ }
96622
96704
  }
96623
96705
  _extendDataInBrush(elementsMap) {
96624
96706
  var _a, _b;
@@ -96954,7 +97036,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96954
97036
  if (!this._spec) {
96955
97037
  return;
96956
97038
  }
96957
- const hasAnimation = this._option.animation !== false;
96958
97039
  let parentMark = null;
96959
97040
  if (this._spec.parent) {
96960
97041
  const mark = this.getChart()
@@ -96964,12 +97045,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96964
97045
  parentMark = mark;
96965
97046
  }
96966
97047
  }
96967
- this._createExtensionMark(this._spec, parentMark, `${PREFIX}_series_${this.id}_extensionMark`, 0, {
96968
- hasAnimation
96969
- });
97048
+ this._createExtensionMark(this._spec, parentMark, `${PREFIX}_series_${this.id}_extensionMark`, 0);
96970
97049
  }
96971
- _createExtensionMark(spec, parentMark, namePrefix, index = 0, options) {
96972
- var _a;
97050
+ _createExtensionMark(spec, parentMark, namePrefix, index = 0) {
97051
+ var _a, _b;
96973
97052
  const mark = this._createMark({
96974
97053
  type: spec.type,
96975
97054
  name: isValid$1(spec.name) ? `${spec.name}` : `${namePrefix}_${index}`
@@ -96985,7 +97064,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96985
97064
  if (isValid$1(spec.id)) {
96986
97065
  mark.setUserId(spec.id);
96987
97066
  }
96988
- if (options.hasAnimation && spec.animation) {
97067
+ if (((_a = this._option.globalInstance) === null || _a === void 0 ? void 0 : _a.isAnimationEnable()) && spec.animation) {
96989
97068
  const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
96990
97069
  mark.setAnimationConfig(config);
96991
97070
  }
@@ -96998,8 +97077,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96998
97077
  this.initMarkStyleWithSpec(mark, spec);
96999
97078
  if (spec.type === 'group') {
97000
97079
  namePrefix = `${namePrefix}_${index}`;
97001
- (_a = spec.children) === null || _a === void 0 ? void 0 : _a.forEach((s, i) => {
97002
- this._createExtensionMark(s, mark, namePrefix, i, options);
97080
+ (_b = spec.children) === null || _b === void 0 ? void 0 : _b.forEach((s, i) => {
97081
+ this._createExtensionMark(s, mark, namePrefix, i);
97003
97082
  });
97004
97083
  }
97005
97084
  if (isValid$1(spec.dataId) || isValidNumber$1(spec.dataIndex)) {
@@ -97869,14 +97948,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97869
97948
  const marginKey = align === 'right' ? 'marginLeft' : 'marginRight';
97870
97949
  if (align === 'right') {
97871
97950
  panelStyle.direction = 'rtl';
97872
- titleStyle.textAlign = 'right';
97873
- keyStyle.textAlign = 'right';
97874
- valueStyle.textAlign = 'left';
97875
97951
  }
97876
- else {
97877
- titleStyle.textAlign = 'left';
97878
- keyStyle.textAlign = 'left';
97879
- valueStyle.textAlign = 'right';
97952
+ if (isNil$1(titleStyle.textAlign)) {
97953
+ titleStyle.textAlign = align === 'right' ? 'right' : 'left';
97954
+ }
97955
+ if (isNil$1(keyStyle.textAlign)) {
97956
+ keyStyle.textAlign = align === 'right' ? 'right' : 'left';
97957
+ }
97958
+ if (isNil$1(valueStyle.textAlign)) {
97959
+ valueStyle.textAlign = align === 'right' ? 'left' : 'right';
97880
97960
  }
97881
97961
  shapeStyle[marginKey] = getPixelPropertyStr((_b = shape.spacing) !== null && _b !== void 0 ? _b : DEFAULT_SHAPE_SPACING);
97882
97962
  keyStyle[marginKey] = getPixelPropertyStr((_c = keyLabel.spacing) !== null && _c !== void 0 ? _c : DEFAULT_KEY_SPACING);
@@ -98067,7 +98147,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98067
98147
  if (!changePositionOnly) {
98068
98148
  this._updateDomStringByCol(actualTooltip);
98069
98149
  }
98070
- this._updateDomStyle('height');
98150
+ this._updateDomStyle('height', changePositionOnly);
98071
98151
  const rect = (_a = this._rootDom) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
98072
98152
  return {
98073
98153
  width: rect === null || rect === void 0 ? void 0 : rect.width,
@@ -98212,7 +98292,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98212
98292
  contentDom.parentNode.removeChild(contentDom);
98213
98293
  }
98214
98294
  }
98215
- _updateDomStyle(sizeKey = 'width') {
98295
+ _updateDomStyle(sizeKey = 'width', refreshSize) {
98216
98296
  var _a, _b, _c, _d, _e;
98217
98297
  const rootDom = this._rootDom;
98218
98298
  const contentDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
@@ -98255,6 +98335,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98255
98335
  const row = rows[i];
98256
98336
  const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
98257
98337
  for (let j = 0; j < cols.length; j++) {
98338
+ if (refreshSize) {
98339
+ cols[j].style[sizeKey] = 'initial';
98340
+ }
98258
98341
  const width = cols[j].getBoundingClientRect()[sizeKey];
98259
98342
  if (widthByCol[j] === undefined || widthByCol[j] < width) {
98260
98343
  widthByCol[j] = width;
@@ -98286,7 +98369,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98286
98369
  }
98287
98370
  if (this.getVisibility()) {
98288
98371
  this._updateDomStringByCol(this._tooltipActual);
98289
- this._updateDomStyle('height');
98372
+ this._updateDomStyle('height', false);
98290
98373
  }
98291
98374
  }
98292
98375
  _updatePosition({ x, y }) {
@@ -100356,6 +100439,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100356
100439
  exports.STACK_FIELD_TOTAL_PERCENT = STACK_FIELD_TOTAL_PERCENT;
100357
100440
  exports.STACK_FIELD_TOTAL_TOP = STACK_FIELD_TOTAL_TOP;
100358
100441
  exports.SankeyChart = SankeyChart;
100442
+ exports.SankeyChartSpecTransformer = SankeyChartSpecTransformer;
100359
100443
  exports.SankeySeries = SankeySeries;
100360
100444
  exports.ScatterChart = ScatterChart;
100361
100445
  exports.ScatterSeries = ScatterSeries;
@@ -100422,6 +100506,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100422
100506
  exports.getCombinedSizeOfRegions = getCombinedSizeOfRegions;
100423
100507
  exports.getDataScheme = getDataScheme;
100424
100508
  exports.getDatumOfGraphic = getDatumOfGraphic;
100509
+ exports.getDiffAttributesOfGraphic = getDiffAttributesOfGraphic;
100425
100510
  exports.getDimensionInfoByValue = getDimensionInfoByValue;
100426
100511
  exports.getFieldAlias = getFieldAlias;
100427
100512
  exports.getFunnelTheme = getFunnelTheme;