@visactor/react-vchart 2.1.3-alpha.5 → 2.1.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/build/index.js +209 -71
  2. package/build/index.min.js +3 -3
  3. package/cjs/charts/AreaChart.js +1 -1
  4. package/cjs/charts/Bar3dChart.js +1 -1
  5. package/cjs/charts/BarChart.js +1 -1
  6. package/cjs/charts/BaseChart.js +1 -1
  7. package/cjs/charts/BoxPlotChart.js +1 -1
  8. package/cjs/charts/CirclePackingChart.js +1 -1
  9. package/cjs/charts/CircularProgressChart.js +1 -1
  10. package/cjs/charts/CommonChart.js +1 -1
  11. package/cjs/charts/CorrelationChart.js +1 -1
  12. package/cjs/charts/Funnel3dChart.js +1 -1
  13. package/cjs/charts/FunnelChart.js +1 -1
  14. package/cjs/charts/GaugeChart.js +1 -1
  15. package/cjs/charts/HeatmapChart.js +1 -1
  16. package/cjs/charts/Histogram3dChart.js +1 -1
  17. package/cjs/charts/HistogramChart.js +1 -2
  18. package/cjs/charts/LineChart.js +1 -1
  19. package/cjs/charts/LinearProgressChart.js +1 -1
  20. package/cjs/charts/LiquidChart.js +1 -1
  21. package/cjs/charts/MapChart.js +1 -1
  22. package/cjs/charts/MosaicChart.js +1 -1
  23. package/cjs/charts/PictogramChart.js +1 -1
  24. package/cjs/charts/Pie3dChart.js +1 -1
  25. package/cjs/charts/PieChart.js +1 -1
  26. package/cjs/charts/RadarChart.js +1 -1
  27. package/cjs/charts/RangeAreaChart.js +1 -1
  28. package/cjs/charts/RangeColumn3dChart.js +1 -1
  29. package/cjs/charts/RangeColumnChart.js +1 -1
  30. package/cjs/charts/RoseChart.js +1 -1
  31. package/cjs/charts/SankeyChart.js +1 -1
  32. package/cjs/charts/ScatterChart.js +1 -1
  33. package/cjs/charts/SequenceChart.js +1 -2
  34. package/cjs/charts/SunburstChart.js +1 -1
  35. package/cjs/charts/TreemapChart.js +1 -1
  36. package/cjs/charts/VennChart.js +1 -1
  37. package/cjs/charts/WaterfallChart.js +1 -1
  38. package/cjs/charts/WordCloud3dChart.js +1 -1
  39. package/cjs/charts/WordCloudChart.js +1 -1
  40. package/cjs/components/MarkArea.js +1 -2
  41. package/cjs/components/MarkPoint.js +2 -1
  42. package/cjs/components/tooltip/BaseTooltip.js +1 -1
  43. package/cjs/components/tooltip/CanvasTooltip.js +1 -1
  44. package/cjs/components/tooltip/Tooltip.js +1 -1
  45. package/cjs/components/tooltip/util.js +1 -1
  46. package/cjs/context/chart.js +1 -1
  47. package/cjs/context/stage.js +1 -1
  48. package/cjs/index.d.ts +1 -1
  49. package/cjs/index.js +1 -1
  50. package/cjs/index.js.map +1 -1
  51. package/cjs/series/Area.js +1 -1
  52. package/cjs/series/Bar.js +1 -1
  53. package/cjs/series/Bar3d.js +1 -1
  54. package/cjs/series/BaseSeries.js +1 -1
  55. package/cjs/series/BoxPlot.js +1 -1
  56. package/cjs/series/CirclePacking.js +1 -1
  57. package/cjs/series/CircularProgress.js +1 -1
  58. package/cjs/series/Correlation.js +2 -1
  59. package/cjs/series/Dot.js +1 -1
  60. package/cjs/series/Funnel.js +1 -1
  61. package/cjs/series/Funnel3d.js +1 -1
  62. package/cjs/series/Gauge.js +1 -1
  63. package/cjs/series/GaugePointer.js +1 -1
  64. package/cjs/series/Heatmap.js +1 -1
  65. package/cjs/series/Line.js +1 -1
  66. package/cjs/series/LinearProgress.js +1 -1
  67. package/cjs/series/Link.js +1 -1
  68. package/cjs/series/Liquid.js +1 -1
  69. package/cjs/series/Map.js +1 -1
  70. package/cjs/series/Mosaic.js +1 -1
  71. package/cjs/series/Pictogram.js +1 -1
  72. package/cjs/series/Pie.js +1 -1
  73. package/cjs/series/Pie3d.js +1 -1
  74. package/cjs/series/Radar.js +2 -1
  75. package/cjs/series/RangeArea.js +1 -1
  76. package/cjs/series/RangeColumn.js +1 -1
  77. package/cjs/series/RangeColumn3d.js +1 -1
  78. package/cjs/series/Rose.js +1 -1
  79. package/cjs/series/Sankey.js +1 -1
  80. package/cjs/series/Scatter.js +1 -1
  81. package/cjs/series/Series.js +1 -1
  82. package/esm/charts/AreaChart.js +1 -1
  83. package/esm/charts/Bar3dChart.js +1 -1
  84. package/esm/charts/BarChart.js +1 -1
  85. package/esm/charts/BaseChart.js +1 -1
  86. package/esm/charts/BoxPlotChart.js +1 -1
  87. package/esm/charts/CirclePackingChart.js +1 -1
  88. package/esm/charts/CircularProgressChart.js +1 -1
  89. package/esm/charts/CommonChart.js +1 -1
  90. package/esm/charts/CorrelationChart.js +1 -1
  91. package/esm/charts/Funnel3dChart.js +1 -1
  92. package/esm/charts/FunnelChart.js +1 -1
  93. package/esm/charts/GaugeChart.js +1 -1
  94. package/esm/charts/HeatmapChart.js +1 -1
  95. package/esm/charts/Histogram3dChart.js +1 -1
  96. package/esm/charts/HistogramChart.js +1 -2
  97. package/esm/charts/LineChart.js +1 -1
  98. package/esm/charts/LinearProgressChart.js +1 -1
  99. package/esm/charts/LiquidChart.js +1 -1
  100. package/esm/charts/MapChart.js +1 -1
  101. package/esm/charts/MosaicChart.js +1 -1
  102. package/esm/charts/PictogramChart.js +1 -1
  103. package/esm/charts/Pie3dChart.js +1 -1
  104. package/esm/charts/PieChart.js +1 -1
  105. package/esm/charts/RadarChart.js +1 -1
  106. package/esm/charts/RangeAreaChart.js +1 -1
  107. package/esm/charts/RangeColumn3dChart.js +1 -1
  108. package/esm/charts/RangeColumnChart.js +1 -1
  109. package/esm/charts/RoseChart.js +1 -1
  110. package/esm/charts/SankeyChart.js +1 -1
  111. package/esm/charts/ScatterChart.js +1 -1
  112. package/esm/charts/SequenceChart.js +1 -2
  113. package/esm/charts/SunburstChart.js +1 -1
  114. package/esm/charts/TreemapChart.js +1 -1
  115. package/esm/charts/VennChart.js +1 -1
  116. package/esm/charts/WaterfallChart.js +1 -1
  117. package/esm/charts/WordCloud3dChart.js +1 -1
  118. package/esm/charts/WordCloudChart.js +1 -1
  119. package/esm/components/MarkArea.js +1 -2
  120. package/esm/components/MarkPoint.js +2 -1
  121. package/esm/components/tooltip/BaseTooltip.js +1 -1
  122. package/esm/components/tooltip/CanvasTooltip.js +1 -1
  123. package/esm/components/tooltip/Tooltip.js +1 -1
  124. package/esm/components/tooltip/util.js +1 -1
  125. package/esm/context/chart.js +1 -1
  126. package/esm/context/stage.js +1 -1
  127. package/esm/index.d.ts +1 -1
  128. package/esm/index.js +1 -1
  129. package/esm/index.js.map +1 -1
  130. package/esm/series/Area.js +1 -1
  131. package/esm/series/Bar.js +1 -1
  132. package/esm/series/Bar3d.js +1 -1
  133. package/esm/series/BaseSeries.js +1 -1
  134. package/esm/series/BoxPlot.js +1 -1
  135. package/esm/series/CirclePacking.js +1 -1
  136. package/esm/series/CircularProgress.js +1 -1
  137. package/esm/series/Correlation.js +2 -1
  138. package/esm/series/Dot.js +1 -1
  139. package/esm/series/Funnel.js +1 -1
  140. package/esm/series/Funnel3d.js +1 -1
  141. package/esm/series/Gauge.js +1 -1
  142. package/esm/series/GaugePointer.js +1 -1
  143. package/esm/series/Heatmap.js +1 -1
  144. package/esm/series/Line.js +1 -1
  145. package/esm/series/LinearProgress.js +1 -1
  146. package/esm/series/Link.js +1 -1
  147. package/esm/series/Liquid.js +1 -1
  148. package/esm/series/Map.js +1 -1
  149. package/esm/series/Mosaic.js +1 -1
  150. package/esm/series/Pictogram.js +1 -1
  151. package/esm/series/Pie.js +1 -1
  152. package/esm/series/Pie3d.js +1 -1
  153. package/esm/series/Radar.js +2 -1
  154. package/esm/series/RangeArea.js +1 -1
  155. package/esm/series/RangeColumn.js +1 -1
  156. package/esm/series/RangeColumn3d.js +1 -1
  157. package/esm/series/Rose.js +1 -1
  158. package/esm/series/Sankey.js +1 -1
  159. package/esm/series/Scatter.js +1 -1
  160. package/esm/series/Series.js +1 -1
  161. package/package.json +5 -5
package/build/index.js CHANGED
@@ -33487,7 +33487,7 @@
33487
33487
  }
33488
33488
 
33489
33489
  var _a;
33490
- const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.1"),
33490
+ const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.3"),
33491
33491
  globalFactoryRegistry = globalThis;
33492
33492
  const factoryRegistry = null !== (_a = globalFactoryRegistry[factoryRegistryKey]) && void 0 !== _a ? _a : globalFactoryRegistry[factoryRegistryKey] = {
33493
33493
  charts: {},
@@ -33517,6 +33517,7 @@
33517
33517
  interactionTriggers: {},
33518
33518
  composedEventMap: {},
33519
33519
  tooltipProcessors: {},
33520
+ runtimePluginInstallers: {},
33520
33521
  formatter: void 0
33521
33522
  };
33522
33523
 
@@ -33696,7 +33697,9 @@
33696
33697
  }, Factory.createTooltipProcessor = (type, tooltip) => {
33697
33698
  const Cror = Factory._tooltipProcessors[type];
33698
33699
  return Cror ? new Cror(tooltip) : null;
33699
- };
33700
+ }, Factory._runtimePluginInstallers = factoryRegistry.runtimePluginInstallers, Factory.registerRuntimePluginInstaller = (type, installer) => {
33701
+ Factory._runtimePluginInstallers[type] = installer;
33702
+ }, Factory.getRuntimePluginInstaller = type => Factory._runtimePluginInstallers[type];
33700
33703
 
33701
33704
  function mergeTheme(target, ...sources) {
33702
33705
  return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
@@ -33770,6 +33773,24 @@
33770
33773
  },
33771
33774
  textBaseline: "middle"
33772
33775
  }
33776
+ },
33777
+ conversionArrow: {
33778
+ line: {
33779
+ style: {
33780
+ stroke: "black"
33781
+ }
33782
+ },
33783
+ symbol: {
33784
+ style: {
33785
+ fill: "black"
33786
+ }
33787
+ },
33788
+ text: {
33789
+ style: {
33790
+ fontSize: 12,
33791
+ fill: "#606773"
33792
+ }
33793
+ }
33773
33794
  }
33774
33795
  };
33775
33796
  return res[is3d ? "transform3d" : "transform"] = {
@@ -33887,20 +33908,16 @@
33887
33908
  }
33888
33909
  return isArray$1(spec) ? spec.map(s => specTransform(s, special)) : spec;
33889
33910
  }
33890
- function functionTransform(spec, VChart) {
33891
- if (!spec) return spec;
33892
- if (isPlainObject$3(spec)) {
33911
+ function functionTransform(value, registry) {
33912
+ var _a;
33913
+ if (!value) return value;
33914
+ if (isString$1(value)) return null !== (_a = registry.getFunction(value)) && void 0 !== _a ? _a : value;
33915
+ if (isPlainObject$3(value)) {
33893
33916
  const result = {};
33894
- for (const key in spec) if (Object.prototype.hasOwnProperty.call(spec, key)) {
33895
- if (isString$1(spec[key]) && VChart.getFunction(spec[key])) {
33896
- result[key] = VChart.getFunction(spec[key]);
33897
- continue;
33898
- }
33899
- result[key] = functionTransform(spec[key], VChart);
33900
- }
33917
+ for (const key in value) Object.prototype.hasOwnProperty.call(value, key) && (result[key] = functionTransform(value[key], registry));
33901
33918
  return result;
33902
33919
  }
33903
- return isArray$1(spec) ? spec.map(s => functionTransform(s, VChart)) : spec;
33920
+ return isArray$1(value) ? value.map(item => functionTransform(item, registry)) : value;
33904
33921
  }
33905
33922
  function transformFunctionAttribute(att, ...args) {
33906
33923
  return isFunction$1(att) ? att(...args) : att;
@@ -44017,8 +44034,23 @@
44017
44034
  getStage() {
44018
44035
  return this._stage;
44019
44036
  }
44037
+ _dedupeStagePlugin(pluginName) {
44038
+ var _a;
44039
+ const pluginService = null === (_a = this._stage) || void 0 === _a ? void 0 : _a.pluginService;
44040
+ if (!(null == pluginService ? void 0 : pluginService.findPluginsByName)) return;
44041
+ const plugins = pluginService.findPluginsByName(pluginName);
44042
+ if (plugins.length <= 1) return;
44043
+ const plugin = plugins[0];
44044
+ pluginService.uninstall ? (pluginService.uninstall(pluginName), pluginService.register(plugin)) : plugins.slice(1).forEach(duplicatePlugin => {
44045
+ pluginService.unRegister(duplicatePlugin);
44046
+ });
44047
+ }
44048
+ _dedupePoptipPlugin() {
44049
+ var _a;
44050
+ (null === (_a = this._option.pluginList) || void 0 === _a ? void 0 : _a.includes("poptipForText")) && this._dedupeStagePlugin("poptipForText");
44051
+ }
44020
44052
  initView() {
44021
- var _a, _b, _c, _d;
44053
+ var _a, _b, _c, _d, _e;
44022
44054
  if (this._released) return;
44023
44055
  if (this.isInited = !0, this._stage) return;
44024
44056
  const {
@@ -44041,14 +44073,14 @@
44041
44073
  mode: mode,
44042
44074
  modeParams: modeParams
44043
44075
  });
44044
- this._releaseVRenderAppRef = resolvedApp.releaseAppRef;
44076
+ this._releaseVRenderAppRef = resolvedApp.releaseAppRef, null === (_a = this._option.runtimePluginInstallers) || void 0 === _a || _a.forEach(install => install(resolvedApp.app));
44045
44077
  try {
44046
44078
  this._stage = createStageFromApp(resolvedApp.app, Object.assign({
44047
44079
  background: background,
44048
44080
  width: this._width,
44049
44081
  height: this._height,
44050
- container: null !== (_a = this._container.dom) && void 0 !== _a ? _a : null,
44051
- canvas: null !== (_b = this._container.canvas) && void 0 !== _b ? _b : null,
44082
+ container: null !== (_b = this._container.dom) && void 0 !== _b ? _b : null,
44083
+ canvas: null !== (_c = this._container.canvas) && void 0 !== _c ? _c : null,
44052
44084
  dpr: dpr,
44053
44085
  viewBox: this._option.viewBox,
44054
44086
  canvasControled: this._option.canvasControled,
@@ -44071,12 +44103,12 @@
44071
44103
  },
44072
44104
  ReactDOM: this._option.ReactDOM,
44073
44105
  autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr)
44074
- }, null !== (_c = this._option.renderHooks) && void 0 !== _c ? _c : {}));
44106
+ }, null !== (_d = this._option.renderHooks) && void 0 !== _d ? _d : {}));
44075
44107
  } catch (error) {
44076
- throw null === (_d = this._releaseVRenderAppRef) || void 0 === _d || _d.call(this), this._releaseVRenderAppRef = void 0, error;
44108
+ throw null === (_e = this._releaseVRenderAppRef) || void 0 === _e || _e.call(this), this._releaseVRenderAppRef = void 0, error;
44077
44109
  }
44078
44110
  }
44079
- this._stage.enableIncrementalAutoRender(), this._stage.setTheme({
44111
+ this._dedupePoptipPlugin(), this._stage.enableIncrementalAutoRender(), this._stage.setTheme({
44080
44112
  symbol: {
44081
44113
  shape: "circle",
44082
44114
  size: 8
@@ -48921,13 +48953,14 @@
48921
48953
  if (this._cachedProcessedTheme[cacheKey]) return this._cachedProcessedTheme[cacheKey];
48922
48954
  let theme = this._currentTheme;
48923
48955
  return keys.forEach((key, index) => {
48956
+ var _a;
48924
48957
  if (1 !== index || "series" !== keys[0] && "component" !== keys[0]) theme = null == theme ? void 0 : theme[key];else {
48925
48958
  const buildInTheme = "series" === keys[0] ? Factory.getSeriesBuiltInTheme(key) : Factory.getComponentBuiltInTheme(key);
48926
48959
  theme = theme ? mergeSpec({}, buildInTheme, theme[key]) : buildInTheme;
48927
48960
  }
48928
48961
  index === keys.length - 1 && isValid$1(theme) && (theme = preprocessTheme({
48929
48962
  [key]: theme
48930
- }, this._currentTheme.colorScheme, this._currentTheme.token)[key]);
48963
+ }, this._currentTheme.colorScheme, this._currentTheme.token)[key], (null === (_a = this.getFunctionList()) || void 0 === _a ? void 0 : _a.length) && (theme = functionTransform(theme, this)));
48931
48964
  }), this._cachedProcessedTheme[cacheKey] = theme, theme;
48932
48965
  }, removeUndefined(options), this._option = Object.assign(Object.assign({}, this._option), options), (null == options ? void 0 : options.optimize) && (this._option.optimize = Object.assign(Object.assign({}, this._option.optimize), options.optimize)), this._onError = null === (_a = this._option) || void 0 === _a ? void 0 : _a.onError;
48933
48966
  const _k = this._option,
@@ -48942,8 +48975,13 @@
48942
48975
  isTrueBrowseEnv = isTrueBrowser(mode);
48943
48976
  if (isTrueBrowseEnv ? registerBrowserEnv() : "node" === mode && registerNodeEnv(), isTrueBrowseEnv && dom && (this._container = isString$1(dom) ? vglobal.getElementById(dom) : dom), renderCanvas && (this._canvas = renderCanvas), stage && (this._stage = stage), "node" !== mode && !this._container && !this._canvas && !this._stage) return void (null === (_b = this._option) || void 0 === _b || _b.onError("please specify container or renderCanvas!"));
48944
48977
  this._viewBox = this._option.viewBox, this._currentThemeName = ThemeManager.getCurrentThemeName(), this._setNewSpec(spec), this._updateCurrentTheme(), this._currentSize = this.getCurrentSize();
48945
- const pluginList = [];
48946
- !1 !== poptip && pluginList.push("poptipForText"), "sankey" === spec.type && pluginList.push("scrollbar");
48978
+ const pluginList = [],
48979
+ runtimePluginInstallers = [];
48980
+ if (!1 !== poptip) {
48981
+ const poptipInstaller = Factory.getRuntimePluginInstaller("poptipForText");
48982
+ poptipInstaller && (poptipInstaller(), runtimePluginInstallers.push(poptipInstaller)), pluginList.push("poptipForText");
48983
+ }
48984
+ "sankey" === spec.type && pluginList.push("scrollbar");
48947
48985
  const logger = new Logger(null !== (_c = this._option.logLevel) && void 0 !== _c ? _c : LoggerLevel.Error);
48948
48986
  Logger.setInstance(logger), (null === (_d = this._option) || void 0 === _d ? void 0 : _d.onError) && logger.addErrorHandler((...args) => {
48949
48987
  var _a, _b;
@@ -48954,7 +48992,8 @@
48954
48992
  }, Object.assign(Object.assign({
48955
48993
  mode: this._option.mode,
48956
48994
  stage: stage,
48957
- pluginList: pluginList
48995
+ pluginList: pluginList,
48996
+ runtimePluginInstallers: runtimePluginInstallers
48958
48997
  }, restOptions), {
48959
48998
  background: this._getBackground(),
48960
48999
  onError: this._onError
@@ -50944,7 +50983,7 @@
50944
50983
  const marks = this.getMarksWithoutRoot();
50945
50984
  marks.forEach(mark => {
50946
50985
  mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
50947
- }), this.initMarkStyle(), marks.forEach(mark => {
50986
+ }), this.initMarkStyle(), this.initMarkState(), marks.forEach(mark => {
50948
50987
  mark.commit(!1);
50949
50988
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();
50950
50989
  isAnimationEnabledForSeries(this) && this.initAnimation();
@@ -54535,7 +54574,7 @@
54535
54574
  animationEnter: this._animationConfig.enter ? Array.isArray(this._animationConfig.enter) ? this._animationConfig.enter[0] : this._animationConfig.enter : void 0,
54536
54575
  animationUpdate: this._animationConfig.update ? Array.isArray(this._animationConfig.update) ? this._animationConfig.update[0] : this._animationConfig.update : void 0,
54537
54576
  animationExit: this._animationConfig.exit ? Array.isArray(this._animationConfig.exit) ? this._animationConfig.exit[0] : this._animationConfig.exit : void 0
54538
- })), this._component ? this._component.setAttributes(attrs) : (this._component = Factory.createGraphicComponent(this._componentType, attrs, {
54577
+ })), this._component ? (this._component.setAttributes(attrs), this._product && this._component.parent !== this._product && this._product.appendChild(this._component)) : (this._component = Factory.createGraphicComponent(this._componentType, attrs, {
54539
54578
  mode: this._mode,
54540
54579
  skipDefault: this._markConfig.skipTheme
54541
54580
  }), this._component && this._product.appendChild(this._component)), this._component && (this._component.context = this._getCommonContext()), this._markConfig.support3d && this._product && this._product.setMode("3d"), this.model.event.emit(HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
@@ -55109,6 +55148,8 @@
55109
55148
  specIndex: this._seriesIndex
55110
55149
  });
55111
55150
  }
55151
+ }, this._clearContinuousBarBandwidthCache = () => {
55152
+ this._continuousBarBandwidthCache = void 0;
55112
55153
  }, this._transformLayoutPosition = pos => {
55113
55154
  let {
55114
55155
  x: x,
@@ -55315,12 +55356,60 @@
55315
55356
  isContinuous: isContinuous(this._scale.type),
55316
55357
  dataToPosition: this.dataToPosition.bind(this),
55317
55358
  getScale: (depth = 0) => this._scales[depth],
55359
+ getBandwidth: (depth = 0) => this._getContinuousBarBandwidth(depth),
55318
55360
  getAxisType: () => this.type,
55319
55361
  getAxisId: () => this.id,
55320
55362
  isInverse: () => !0 === this._inverse,
55321
55363
  getSpec: () => this._spec
55322
55364
  };
55323
55365
  }
55366
+ _getContinuousBarBandwidth(depth = 0) {
55367
+ if (0 !== depth || !isContinuous(this._scale.type)) return;
55368
+ const scale = this._scales[0],
55369
+ domain = scale.domain(),
55370
+ range = scale.range(),
55371
+ domainStart = +(null == domain ? void 0 : domain[0]),
55372
+ domainEnd = +(null == domain ? void 0 : domain[domain.length - 1]),
55373
+ rangeStart = +(null == range ? void 0 : range[0]),
55374
+ rangeEnd = +(null == range ? void 0 : range[range.length - 1]);
55375
+ if (!(Number.isFinite(domainStart) && Number.isFinite(domainEnd) && Number.isFinite(rangeStart) && Number.isFinite(rangeEnd) && domainStart !== domainEnd)) return;
55376
+ const cache = this._continuousBarBandwidthCache;
55377
+ if (cache && cache.scale === scale && cache.domainStart === domainStart && cache.domainEnd === domainEnd && cache.rangeStart === rangeStart && cache.rangeEnd === rangeEnd) return cache.bandWidth;
55378
+ const valueSet = new Set(),
55379
+ orient = this.getOrient();
55380
+ eachSeries(this._regions, s => {
55381
+ var _a, _b, _c, _d;
55382
+ if (s.type !== SeriesTypeEnum.bar) return;
55383
+ const barSeries = s,
55384
+ field = isXAxis(orient) && "vertical" === barSeries.direction ? barSeries.fieldX[0] : isYAxis(orient) && "horizontal" === barSeries.direction ? barSeries.fieldY[0] : void 0,
55385
+ values = field ? null === (_d = null === (_c = null === (_b = null === (_a = s.getViewDataStatistics) || void 0 === _a ? void 0 : _a.call(s)) || void 0 === _b ? void 0 : _b.latestData) || void 0 === _c ? void 0 : _c[field]) || void 0 === _d ? void 0 : _d.values : void 0;
55386
+ null == values || values.forEach(value => {
55387
+ const numericValue = +value;
55388
+ Number.isFinite(numericValue) && valueSet.add(numericValue);
55389
+ });
55390
+ }, {
55391
+ userId: this._seriesUserId,
55392
+ specIndex: this._seriesIndex
55393
+ });
55394
+ const values = Array.from(valueSet).sort((a, b) => a - b);
55395
+ if (values.length < 2) return;
55396
+ let minStep = 1 / 0,
55397
+ lastValue = values[0];
55398
+ for (let i = 1; i < values.length; i++) {
55399
+ const value = values[i],
55400
+ step = value - lastValue;
55401
+ step > 0 && step < minStep && (minStep = step), lastValue = value;
55402
+ }
55403
+ const bandWidth = minStep < 1 / 0 ? Math.abs((rangeEnd - rangeStart) / (domainEnd - domainStart) * minStep) : void 0;
55404
+ return Number.isFinite(bandWidth) ? (this._continuousBarBandwidthCache = {
55405
+ scale: scale,
55406
+ domainStart: domainStart,
55407
+ domainEnd: domainEnd,
55408
+ rangeStart: rangeStart,
55409
+ rangeEnd: rangeEnd,
55410
+ bandWidth: bandWidth
55411
+ }, bandWidth) : void 0;
55412
+ }
55324
55413
  afterCompile() {
55325
55414
  var _a;
55326
55415
  (null === (_a = this._axisMark) || void 0 === _a ? void 0 : _a.getProduct()) && this.event.on(HOOK_EVENT.AFTER_ELEMENT_ENCODE, ({
@@ -55503,7 +55592,13 @@
55503
55592
  })] : [];
55504
55593
  }
55505
55594
  initEvent() {
55506
- super.initEvent(), this._specVisible && (this.event.on(ChartEvent.layoutEnd, this._updateAxisLayout), this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero), this.event.on(ChartEvent.layoutRectUpdate, () => {
55595
+ super.initEvent(), eachSeries(this._regions, s => {
55596
+ var _a, _b;
55597
+ null === (_b = null === (_a = s.getViewDataStatistics) || void 0 === _a ? void 0 : _a.call(s)) || void 0 === _b || _b.target.addListener("change", this._clearContinuousBarBandwidthCache);
55598
+ }, {
55599
+ userId: this._seriesUserId,
55600
+ specIndex: this._seriesIndex
55601
+ }), this._specVisible && (this.event.on(ChartEvent.layoutEnd, this._updateAxisLayout), this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero), this.event.on(ChartEvent.layoutRectUpdate, () => {
55507
55602
  this._clearLayoutCache();
55508
55603
  }));
55509
55604
  }
@@ -59242,41 +59337,46 @@
59242
59337
  getStatedGraphics(trigger) {
59243
59338
  return this._stateGraphicsByTrigger.get(trigger);
59244
59339
  }
59340
+ _getMarkById(trigger) {
59341
+ const markById = new Map();
59342
+ return trigger.getMarks().forEach(mark => {
59343
+ mark && markById.set(mark.id, mark);
59344
+ }), markById;
59345
+ }
59346
+ _hasAnimationByGraphicState(graphic, markById) {
59347
+ var _a, _b, _c;
59348
+ const mark = null !== (_b = null === (_a = graphic.parent) || void 0 === _a ? void 0 : _a.mark) && void 0 !== _b ? _b : markById.get(graphic.context.markId);
59349
+ return !!(null === (_c = null == mark ? void 0 : mark.hasAnimationByState) || void 0 === _c ? void 0 : _c.call(mark, "state"));
59350
+ }
59245
59351
  updateStates(trigger, newStatedGraphics, prevStatedGraphics, state, reverseState) {
59246
- return this._disableTriggerEvent ? [] : newStatedGraphics && newStatedGraphics.length ? (state && reverseState ? prevStatedGraphics && prevStatedGraphics.length ? (this.toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState), this.toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state)) : this.addBothStateOfGraphics(trigger, newStatedGraphics, state, reverseState) : state && (prevStatedGraphics && prevStatedGraphics.length ? this.toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) : this.addStateOfGraphics(trigger, newStatedGraphics, state)), newStatedGraphics) : [];
59352
+ return this._disableTriggerEvent ? [] : newStatedGraphics && newStatedGraphics.length ? (state && reverseState ? prevStatedGraphics && prevStatedGraphics.length ? (this.toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState), this.toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state)) : this.addBothStateOfGraphics(trigger, newStatedGraphics, state, reverseState) : state && (prevStatedGraphics && prevStatedGraphics.length ? this.toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) : this.addStateOfGraphics(trigger, newStatedGraphics, state)), newStatedGraphics) : (prevStatedGraphics && prevStatedGraphics.length && this.clearAllStatesOfTrigger(trigger, state, reverseState), []);
59247
59353
  }
59248
59354
  toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState) {
59249
- const markIdByState = trigger.getMarkIdByState();
59355
+ const markIdByState = trigger.getMarkIdByState(),
59356
+ markById = this._getMarkById(trigger);
59250
59357
  prevStatedGraphics.forEach(g => {
59251
- var _a;
59252
59358
  if (reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId)) {
59253
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59254
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59359
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59255
59360
  addGraphicState(g, reverseState, !0, hasAnimation);
59256
59361
  }
59257
59362
  }), newStatedGraphics.forEach(g => {
59258
- var _a;
59259
59363
  if (reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId)) {
59260
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59261
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59364
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59262
59365
  removeGraphicState(g, reverseState, hasAnimation);
59263
59366
  }
59264
59367
  });
59265
59368
  }
59266
59369
  toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) {
59267
- const markIdByState = trigger.getMarkIdByState();
59370
+ const markIdByState = trigger.getMarkIdByState(),
59371
+ markById = this._getMarkById(trigger);
59268
59372
  prevStatedGraphics.forEach(g => {
59269
- var _a;
59270
59373
  if (state && markIdByState[state] && markIdByState[state].includes(g.context.markId)) {
59271
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59272
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59374
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59273
59375
  removeGraphicState(g, state, hasAnimation);
59274
59376
  }
59275
59377
  }), newStatedGraphics.forEach(g => {
59276
- var _a;
59277
59378
  if (state && markIdByState[state] && markIdByState[state].includes(g.context.markId)) {
59278
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59279
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59379
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59280
59380
  addGraphicState(g, state, !0, hasAnimation);
59281
59381
  }
59282
59382
  });
@@ -62416,6 +62516,10 @@
62416
62516
  function bindPoptip(container) {
62417
62517
  container.isBound(PopTipRenderContribution) || (container.bind(PopTipRenderContribution).toSelf().inSingletonScope(), container.bind(InteractiveSubRenderContribution).toService(PopTipRenderContribution)), container.isBound(PopTipPlugin) || (container.bind(PopTipPlugin).toSelf(), container.bind(AutoEnablePlugins).toService(PopTipPlugin)), container.isBound(PopTipForClipedTextPlugin) || (container.bind(PopTipForClipedTextPlugin).toSelf(), container.bind(AutoEnablePlugins).toService(PopTipForClipedTextPlugin));
62418
62518
  }
62519
+ function installPoptipToApp(app) {
62520
+ if (!app) throw new Error("installPoptipToApp requires an app instance");
62521
+ configureRuntimeApplicationForApp(app), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions(), installRuntimeGraphicRenderersToApp(app);
62522
+ }
62419
62523
  function loadPoptip() {
62420
62524
  bindPoptip(getLegacyBindingContext()), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions();
62421
62525
  }
@@ -70982,6 +71086,20 @@
70982
71086
  compileOnlyKeys: Object.assign(Object.assign({}, policy.compileOnlyKeys), BAR_SERIES_COMPILE_ONLY_KEYS)
70983
71087
  });
70984
71088
  }
71089
+ getStatisticFields() {
71090
+ var _a;
71091
+ const fields = super.getStatisticFields(),
71092
+ positionAxisHelper = "horizontal" === this.direction ? this.getYAxisHelper() : this.getXAxisHelper(),
71093
+ positionFields = "horizontal" === this.direction ? this._fieldY : this._fieldX,
71094
+ positionScale = null === (_a = null == positionAxisHelper ? void 0 : positionAxisHelper.getScale) || void 0 === _a ? void 0 : _a.call(positionAxisHelper, 0);
71095
+ return positionScale && isContinuous(positionScale.type) && positionFields.forEach(field => {
71096
+ const fieldStatistics = fields.find(entry => entry.key === field);
71097
+ fieldStatistics ? fieldStatistics.operations.includes("values") || fieldStatistics.operations.push("values") : fields.push({
71098
+ key: field,
71099
+ operations: ["values"]
71100
+ });
71101
+ }), fields;
71102
+ }
70985
71103
  initMark() {
70986
71104
  this._initBarBackgroundMark(), this._barMark = this._createMark(Object.assign(Object.assign({}, BarSeries.mark.bar), {
70987
71105
  name: this._barMarkName,
@@ -71312,18 +71430,19 @@
71312
71430
  this._barMark.setAnimationConfig(animationConfig(null === (_b = Factory.getAnimationInKey("bar")) || void 0 === _b ? void 0 : _b(barAnimationParams, appearPreset), userAnimationConfig(this._barMarkName, this._spec, this._markAttributeContext), animationParams));
71313
71431
  }
71314
71432
  _getBarWidth(axisHelper, scaleDepth) {
71315
- var _a, _b;
71433
+ var _a;
71316
71434
  const depthFromSpec = this._groups ? this._groups.fields.length : 1,
71317
71435
  depth = isNil$1(scaleDepth) ? depthFromSpec : Math.min(depthFromSpec, scaleDepth),
71318
- bandWidth = null !== (_b = null === (_a = axisHelper.getBandwidth) || void 0 === _a ? void 0 : _a.call(axisHelper, depth - 1)) && void 0 !== _b ? _b : 6,
71319
71436
  hasBarWidth = isValid$1(this._spec.barWidth) && depth === depthFromSpec,
71437
+ axisBandWidth = hasBarWidth && "number" == typeof this._spec.barWidth && "string" != typeof this._spec.barMinWidth && "string" != typeof this._spec.barMaxWidth || null === (_a = axisHelper.getBandwidth) || void 0 === _a ? void 0 : _a.call(axisHelper, depth - 1),
71438
+ bandWidth = null != axisBandWidth ? axisBandWidth : 6,
71320
71439
  hasBarMinWidth = isValid$1(this._spec.barMinWidth),
71321
71440
  hasBarMaxWidth = isValid$1(this._spec.barMaxWidth);
71322
- let width = bandWidth;
71441
+ let width = !axisHelper.isContinuous || isNil$1(axisBandWidth) || hasBarWidth ? bandWidth : .5 * bandWidth;
71323
71442
  return hasBarWidth && (width = getActualNumValue(this._spec.barWidth, bandWidth)), hasBarMinWidth && (width = Math.max(width, getActualNumValue(this._spec.barMinWidth, bandWidth))), hasBarMaxWidth && (width = Math.min(width, getActualNumValue(this._spec.barMaxWidth, bandWidth))), width;
71324
71443
  }
71325
71444
  _getPosition(direction, datum, scaleDepth, mark) {
71326
- var _a, _b, _c, _d, _e;
71445
+ var _a, _b, _c, _d, _e, _f;
71327
71446
  let axisHelper, sizeAttribute, dataToPosition;
71328
71447
  "horizontal" === direction ? (axisHelper = this.getYAxisHelper(), sizeAttribute = "height", dataToPosition = "barBackground" === mark ? this.dataToBarBackgroundPositionY.bind(this) : this.dataToPositionY.bind(this)) : (axisHelper = this.getXAxisHelper(), sizeAttribute = "width", dataToPosition = "barBackground" === mark ? this.dataToBarBackgroundPositionX.bind(this) : this.dataToPositionX.bind(this));
71329
71448
  const scale = axisHelper.getScale(0),
@@ -71344,7 +71463,7 @@
71344
71463
  i = groupValues.indexOf(datum[groupField]);
71345
71464
  index === groupFields.length - 1 ? (totalWidth += groupCount * size + (groupCount - 1) * gap, offSet += i * (size + gap)) : (offSet += i * (totalWidth + gap), totalWidth += totalWidth + (groupCount - 1) * gap);
71346
71465
  }
71347
- return scale.scale(datum[groupFields[0]]) + axisHelper.getBandwidth(0) / 2 - totalWidth / 2 + offSet;
71466
+ return scale.scale(datum[groupFields[0]]) + (null !== (_f = axisHelper.getBandwidth(0)) && void 0 !== _f ? _f : bandWidth) / 2 - totalWidth / 2 + offSet;
71348
71467
  }
71349
71468
  const continuous = isContinuous(scale.type || "band");
71350
71469
  return dataToPosition(datum, depth) + .5 * (bandWidth - size) + (continuous ? -bandWidth / 2 : 0);
@@ -73729,7 +73848,7 @@
73729
73848
  const GLYPH_INHERITED_STYLE_ATTRIBUTES = new Set(["fill", "fillOpacity", "stroke", "strokeOpacity", "opacity", "lineWidth", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "shadowBlur", "shadowColor", "shadowOffsetX", "shadowOffsetY", "visible", "pickable", "cursor"]);
73730
73849
  class GlyphMark extends BaseMark {
73731
73850
  constructor() {
73732
- super(...arguments), this._setStateOfGraphic = g => {
73851
+ super(...arguments), this._setStateOfGraphic = (g, hasAnimation) => {
73733
73852
  g.clearStates(), g.context.diffState !== DiffState.enter && g.context.diffState !== DiffState.update || (g.glyphStateProxy = (stateName, nexStates) => {
73734
73853
  var _a;
73735
73854
  const glyphAttrs = {
@@ -73738,7 +73857,7 @@
73738
73857
  return g.glyphStates ? g.glyphStates[stateName] || (g.glyphStates[stateName] = glyphAttrs) : g.glyphStates = {
73739
73858
  [stateName]: glyphAttrs
73740
73859
  }, glyphAttrs;
73741
- }, g.useStates(g.context.states));
73860
+ }, g.useStates(g.context.states, hasAnimation));
73742
73861
  };
73743
73862
  }
73744
73863
  getSubMarks() {
@@ -73788,10 +73907,11 @@
73788
73907
  }
73789
73908
  _createGraphic(attrs = {}) {
73790
73909
  const glyph = createGlyph(attrs);
73791
- glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph), glyph.addEventListener("afterAttributeUpdate", event => {
73792
- var _a;
73793
- 2 === (null === (_a = null == event ? void 0 : event.detail) || void 0 === _a ? void 0 : _a.type) && this._syncInheritedStyleAttrs(glyph, glyph.attribute);
73794
- });
73910
+ glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph);
73911
+ const onAttributeUpdate = glyph.onAttributeUpdate.bind(glyph);
73912
+ glyph.onAttributeUpdate = context => {
73913
+ onAttributeUpdate(context), 2 === (null == context ? void 0 : context.type) && this._syncInheritedStyleAttrs(glyph, glyph.attribute);
73914
+ };
73795
73915
  const subMarks = this._subMarks;
73796
73916
  if (subMarks) {
73797
73917
  const subGraphics = [];
@@ -82552,17 +82672,22 @@
82552
82672
  heightVisual = null !== (_a = resolveOptionValue$2(op.heightVisual)) && void 0 !== _a && _a,
82553
82673
  isCone = null === (_b = resolveOptionValue$2(op.isCone)) || void 0 === _b || _b,
82554
82674
  range = resolveOptionValue$2(op.range),
82555
- max = data.reduce((m, d) => Math.max(m, Number.parseFloat(d[valueField]) || -1 / 0), -1 / 0),
82556
- min = data.reduce((m, d) => Math.min(m, Number.parseFloat(d[valueField]) || 1 / 0), 1 / 0),
82557
- rangeArr = [null !== (_c = null == range ? void 0 : range.min) && void 0 !== _c ? _c : min, null !== (_d = null == range ? void 0 : range.max) && void 0 !== _d ? _d : max];
82675
+ max = data.reduce((m, d) => {
82676
+ const value = Number.parseFloat(d[valueField]);
82677
+ return isValidNumber$1(value) ? Math.max(m, value) : m;
82678
+ }, -1 / 0),
82679
+ rangeMin = null !== (_c = null == range ? void 0 : range.min) && void 0 !== _c ? _c : 0,
82680
+ rangeMax = null !== (_d = null == range ? void 0 : range.max) && void 0 !== _d ? _d : max,
82681
+ getValueRatio = value => isValidNumber$1(value) && isValidNumber$1(rangeMin) && isValidNumber$1(rangeMax) ? rangeMin === rangeMax ? value < rangeMin ? 0 : 1 : clamp$1((value - rangeMin) / (rangeMax - rangeMin), 0, 1) : 0;
82558
82682
  return data.forEach((d, i) => {
82559
82683
  var _a, _b;
82560
82684
  const currentValue = Number.parseFloat(d[valueField]),
82561
82685
  lastValue = Number.parseFloat(null === (_a = data[i - 1]) || void 0 === _a ? void 0 : _a[valueField]),
82562
82686
  nextValue = Number.parseFloat(null === (_b = data[i + 1]) || void 0 === _b ? void 0 : _b[valueField]),
82563
82687
  transformRatio = isValidNumber$1(nextValue * currentValue) && 0 !== currentValue ? nextValue / currentValue : 0,
82564
- reachRatio = isValidNumber$1(currentValue * lastValue) && 0 !== lastValue ? currentValue / lastValue : 0;
82565
- asLastValue && (d[asLastValue] = lastValue), asNextValue && (d[asNextValue] = nextValue), asTransformRatio && (d[asTransformRatio] = transformRatio), asReachRatio && (d[asReachRatio] = 0 === i ? 1 : reachRatio), asHeightRatio && (d[asHeightRatio] = !0 === heightVisual ? transformRatio : 1 / data.length), asValueRatio && (d[asValueRatio] = currentValue / rangeArr[1]), asNextValueRatio && (d[asNextValueRatio] = i === data.length - 1 ? isCone ? 0 : d[asValueRatio] : nextValue / rangeArr[1]), asLastValueRatio && (d[asLastValueRatio] = 0 === i ? 1 : lastValue / rangeArr[1]), asCurrentValue && (d[asCurrentValue] = currentValue);
82688
+ reachRatio = isValidNumber$1(currentValue * lastValue) && 0 !== lastValue ? currentValue / lastValue : 0,
82689
+ valueRatio = getValueRatio(currentValue);
82690
+ asLastValue && (d[asLastValue] = lastValue), asNextValue && (d[asNextValue] = nextValue), asTransformRatio && (d[asTransformRatio] = transformRatio), asReachRatio && (d[asReachRatio] = 0 === i ? 1 : reachRatio), asHeightRatio && (d[asHeightRatio] = !0 === heightVisual ? transformRatio : 1 / data.length), asValueRatio && (d[asValueRatio] = valueRatio), asNextValueRatio && (d[asNextValueRatio] = i === data.length - 1 ? isCone ? 0 : d[asValueRatio] : getValueRatio(nextValue)), asLastValueRatio && (d[asLastValueRatio] = 0 === i ? 1 : getValueRatio(lastValue)), asCurrentValue && (d[asCurrentValue] = currentValue);
82566
82691
  }), data;
82567
82692
  };
82568
82693
  const funnelTransform = (originData, op) => {
@@ -84287,7 +84412,7 @@
84287
84412
  if (!allLinkElements || !allLinkElements.length) return;
84288
84413
  allLinkElements.forEach((linkEl, i) => {
84289
84414
  const linkDatum = getDatumOfGraphic(linkEl);
84290
- linkDatum.source === nodeDatum.key ? (highlightNodes.includes(linkDatum.target) || highlightNodes.push(linkDatum.target), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0)) : linkDatum.target === nodeDatum.key ? (highlightNodes.includes(linkDatum.source) || highlightNodes.push(linkDatum.source), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0)) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0));
84415
+ linkDatum.source === nodeDatum.key ? (highlightNodes.includes(linkDatum.target) || highlightNodes.push(linkDatum.target), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0, this._hasLinkStateAnimation())) : linkDatum.target === nodeDatum.key ? (highlightNodes.includes(linkDatum.source) || highlightNodes.push(linkDatum.source), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0, this._hasLinkStateAnimation())) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation()));
84291
84416
  });
84292
84417
  }
84293
84418
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes), this._needClear = !0;
@@ -84300,7 +84425,7 @@
84300
84425
  allLinkElements.forEach(linkEl => {
84301
84426
  linkEl === graphic ? (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84302
84427
  ratio: 1
84303
- })) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0));
84428
+ }, !0, this._hasLinkStateAnimation())) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation()));
84304
84429
  });
84305
84430
  }
84306
84431
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes), this._needClear = !0;
@@ -84356,7 +84481,7 @@
84356
84481
  allLinkElements.forEach((linkEl, i) => {
84357
84482
  var _a;
84358
84483
  const linkDatum = getDatumOfGraphic(linkEl);
84359
- highlightLinks.includes(null !== (_a = linkDatum.key) && void 0 !== _a ? _a : linkDatum.index) ? (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0)) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0));
84484
+ highlightLinks.includes(null !== (_a = linkDatum.key) && void 0 !== _a ? _a : linkDatum.index) ? (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0, this._hasLinkStateAnimation())) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation()));
84360
84485
  });
84361
84486
  }
84362
84487
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
@@ -84387,12 +84512,12 @@
84387
84512
  const ratio = selectedDatum.reduce((sum, d) => sum + d.value, 0) / linkDatum.value;
84388
84513
  return removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84389
84514
  ratio: ratio
84390
- });
84515
+ }, !0, this._hasLinkStateAnimation());
84391
84516
  }
84392
84517
  if (upSelectedLink) return highlightNodes.includes(linkDatum.source) || highlightNodes.push(linkDatum.source), highlightNodes.includes(linkDatum.target) || highlightNodes.push(linkDatum.target), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84393
84518
  ratio: upSelectedLink.value / linkDatum.value
84394
- });
84395
- removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0);
84519
+ }, !0, this._hasLinkStateAnimation());
84520
+ removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation());
84396
84521
  }), this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
84397
84522
  }
84398
84523
  this._needClear = !0;
@@ -84432,7 +84557,7 @@
84432
84557
  originalDatum = linkDatum.datum;
84433
84558
  if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) return removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84434
84559
  ratio: 1
84435
- });
84560
+ }, !0, this._hasLinkStateAnimation());
84436
84561
  const selectedDatum = originalDatum ? originalDatum.filter(entry => {
84437
84562
  const parentKeysList = entry.parents.map(item => item.key);
84438
84563
  return parentKeysList.includes(curLinkDatum.source) && parentKeysList.includes(curLinkDatum.target);
@@ -84445,13 +84570,13 @@
84445
84570
  })).reduce((sum, d) => sum + d.value, 0) / linkDatum.value;
84446
84571
  return removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84447
84572
  ratio: ratio
84448
- });
84573
+ }, !0, this._hasLinkStateAnimation());
84449
84574
  }
84450
84575
  const upSelectedLink = upstreamLinks.find(upLink => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
84451
84576
  if (upSelectedLink) return highlightNodes.includes(linkDatum.source) || highlightNodes.push(linkDatum.source), highlightNodes.includes(linkDatum.target) || highlightNodes.push(linkDatum.target), removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84452
84577
  ratio: upSelectedLink.value / linkDatum.value
84453
- });
84454
- removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0);
84578
+ }, !0, this._hasLinkStateAnimation());
84579
+ removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation());
84455
84580
  }), this._highLightElements(allNodeElements, highlightNodes);
84456
84581
  }
84457
84582
  this._needClear = !0;
@@ -84461,6 +84586,16 @@
84461
84586
  var _a;
84462
84587
  return null !== (_a = this._spec.direction) && void 0 !== _a ? _a : "horizontal";
84463
84588
  }
84589
+ _hasStateAnimation(mark) {
84590
+ var _a;
84591
+ return isAnimationEnabledForSeries(this) && !!(null === (_a = null == mark ? void 0 : mark.hasAnimationByState) || void 0 === _a ? void 0 : _a.call(mark, "state"));
84592
+ }
84593
+ _hasLinkStateAnimation() {
84594
+ return this._hasStateAnimation(this._linkMark);
84595
+ }
84596
+ _hasNodeStateAnimation() {
84597
+ return this._hasStateAnimation(this._nodeMark);
84598
+ }
84464
84599
  getCategoryField() {
84465
84600
  return this._categoryField;
84466
84601
  }
@@ -84705,7 +84840,7 @@
84705
84840
  }
84706
84841
  _highLightElements(graphics, highlightNodes) {
84707
84842
  graphics && graphics.length && graphics.forEach(g => {
84708
- removeGraphicState(g, [STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]), highlightNodes.includes(getDatumOfGraphic(g).key) ? addGraphicState(g, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0) : addGraphicState(g, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0);
84843
+ removeGraphicState(g, [STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]), highlightNodes.includes(getDatumOfGraphic(g).key) ? addGraphicState(g, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, !0, this._hasNodeStateAnimation()) : addGraphicState(g, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasNodeStateAnimation());
84709
84844
  });
84710
84845
  }
84711
84846
  initTooltip() {
@@ -96467,8 +96602,11 @@
96467
96602
  Factory.registerLayout(GridLayout.type, GridLayout);
96468
96603
  };
96469
96604
 
96605
+ const installPoptip = app => {
96606
+ app ? installPoptipToApp(app) : loadPoptip();
96607
+ };
96470
96608
  const registerPoptip = () => {
96471
- loadPoptip();
96609
+ Factory.registerRuntimePluginInstaller("poptipForText", installPoptip), installPoptip();
96472
96610
  };
96473
96611
 
96474
96612
  const TOOLTIP_PREFIX = "vchart-tooltip";
@@ -101070,7 +101208,7 @@
101070
101208
 
101071
101209
  const VChartSimple = createChart('VChartSimple');
101072
101210
 
101073
- const version = "2.1.1";
101211
+ const version = "2.1.3";
101074
101212
 
101075
101213
  exports.Area = Area;
101076
101214
  exports.AreaChart = AreaChart;