@visactor/react-vchart 2.1.3-alpha.4 → 2.1.3

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.
package/build/index.js CHANGED
@@ -13316,12 +13316,12 @@
13316
13316
  cursor: 1,
13317
13317
  html: 1
13318
13318
  };
13319
- class Graphic extends Node {
13319
+ class GraphicImpl extends Node {
13320
13320
  static mixin(source) {
13321
13321
  const keys = Object.keys(source);
13322
13322
  for (let i = 0; i < keys.length; ++i) {
13323
13323
  const propertyName = keys[i];
13324
- Object.defineProperty(Graphic.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));
13324
+ Object.defineProperty(this.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));
13325
13325
  }
13326
13326
  }
13327
13327
  get AABBBounds() {
@@ -14560,13 +14560,26 @@
14560
14560
  return null;
14561
14561
  }
14562
14562
  }
14563
+ GraphicImpl.userSymbolMap = {};
14564
+ const GRAPHIC_CLASS_SYMBOL = Symbol.for("@visactor/vrender-core/graphic-class");
14565
+ function createGraphicClassState() {
14566
+ return {
14567
+ Graphic: GraphicImpl
14568
+ };
14569
+ }
14570
+ function getGraphicClassState() {
14571
+ var _a;
14572
+ const globalScope = globalThis;
14573
+ return null !== (_a = globalScope[GRAPHIC_CLASS_SYMBOL]) && void 0 !== _a || (globalScope[GRAPHIC_CLASS_SYMBOL] = createGraphicClassState()), globalScope[GRAPHIC_CLASS_SYMBOL];
14574
+ }
14575
+ const Graphic = getGraphicClassState().Graphic;
14563
14576
  function backgroundNotImage(image) {
14564
14577
  return "string" == typeof image ? !(image.startsWith("<svg") || isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) : !(!image.fill && !image.stroke) || !("string" != typeof image.gradient || !Array.isArray(image.stops));
14565
14578
  }
14566
14579
  function isExternalTexture(texture) {
14567
14580
  return !!texture && ("string" == typeof texture ? !builtinTextureTypes.has(texture) && (texture.startsWith("<svg") || isValidUrl$1(texture) || texture.includes("/") || isBase64$1(texture)) : isObject$2(texture));
14568
14581
  }
14569
- Graphic.userSymbolMap = {}, Graphic.mixin(EventTarget);
14582
+ Graphic.mixin(EventTarget);
14570
14583
 
14571
14584
  const defaultThemeObj = {
14572
14585
  arc: DefaultArcAttribute,
@@ -30111,6 +30124,7 @@
30111
30124
  FederatedWheelEvent: FederatedWheelEvent,
30112
30125
  FlexLayoutPlugin: FlexLayoutPlugin,
30113
30126
  GLYPH_NUMBER_TYPE: GLYPH_NUMBER_TYPE,
30127
+ GRAPHIC_CLASS_SYMBOL: GRAPHIC_CLASS_SYMBOL,
30114
30128
  GRAPHIC_REGISTRY_SYMBOL: GRAPHIC_REGISTRY_SYMBOL,
30115
30129
  GRAPHIC_UPDATE_TAG_KEY: GRAPHIC_UPDATE_TAG_KEY,
30116
30130
  GROUP_NUMBER_TYPE: GROUP_NUMBER_TYPE,
@@ -30398,6 +30412,7 @@
30398
30412
  getDefaultCharacterConfig: getDefaultCharacterConfig,
30399
30413
  getExtraModelMatrix: getExtraModelMatrix,
30400
30414
  getFactoryState: getFactoryState,
30415
+ getGraphicClassState: getGraphicClassState,
30401
30416
  getGraphicRegistryState: getGraphicRegistryState,
30402
30417
  getLegacyBindingContext: getLegacyBindingContext,
30403
30418
  getModelMatrix: getModelMatrix,
@@ -33472,7 +33487,7 @@
33472
33487
  }
33473
33488
 
33474
33489
  var _a;
33475
- const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.1"),
33490
+ const factoryRegistryKey = Symbol.for("@visactor/vchart/factory-registry@2.1.3"),
33476
33491
  globalFactoryRegistry = globalThis;
33477
33492
  const factoryRegistry = null !== (_a = globalFactoryRegistry[factoryRegistryKey]) && void 0 !== _a ? _a : globalFactoryRegistry[factoryRegistryKey] = {
33478
33493
  charts: {},
@@ -33502,6 +33517,7 @@
33502
33517
  interactionTriggers: {},
33503
33518
  composedEventMap: {},
33504
33519
  tooltipProcessors: {},
33520
+ runtimePluginInstallers: {},
33505
33521
  formatter: void 0
33506
33522
  };
33507
33523
 
@@ -33681,7 +33697,9 @@
33681
33697
  }, Factory.createTooltipProcessor = (type, tooltip) => {
33682
33698
  const Cror = Factory._tooltipProcessors[type];
33683
33699
  return Cror ? new Cror(tooltip) : null;
33684
- };
33700
+ }, Factory._runtimePluginInstallers = factoryRegistry.runtimePluginInstallers, Factory.registerRuntimePluginInstaller = (type, installer) => {
33701
+ Factory._runtimePluginInstallers[type] = installer;
33702
+ }, Factory.getRuntimePluginInstaller = type => Factory._runtimePluginInstallers[type];
33685
33703
 
33686
33704
  function mergeTheme(target, ...sources) {
33687
33705
  return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
@@ -44002,8 +44020,23 @@
44002
44020
  getStage() {
44003
44021
  return this._stage;
44004
44022
  }
44023
+ _dedupeStagePlugin(pluginName) {
44024
+ var _a;
44025
+ const pluginService = null === (_a = this._stage) || void 0 === _a ? void 0 : _a.pluginService;
44026
+ if (!(null == pluginService ? void 0 : pluginService.findPluginsByName)) return;
44027
+ const plugins = pluginService.findPluginsByName(pluginName);
44028
+ if (plugins.length <= 1) return;
44029
+ const plugin = plugins[0];
44030
+ pluginService.uninstall ? (pluginService.uninstall(pluginName), pluginService.register(plugin)) : plugins.slice(1).forEach(duplicatePlugin => {
44031
+ pluginService.unRegister(duplicatePlugin);
44032
+ });
44033
+ }
44034
+ _dedupePoptipPlugin() {
44035
+ var _a;
44036
+ (null === (_a = this._option.pluginList) || void 0 === _a ? void 0 : _a.includes("poptipForText")) && this._dedupeStagePlugin("poptipForText");
44037
+ }
44005
44038
  initView() {
44006
- var _a, _b, _c, _d;
44039
+ var _a, _b, _c, _d, _e;
44007
44040
  if (this._released) return;
44008
44041
  if (this.isInited = !0, this._stage) return;
44009
44042
  const {
@@ -44026,14 +44059,14 @@
44026
44059
  mode: mode,
44027
44060
  modeParams: modeParams
44028
44061
  });
44029
- this._releaseVRenderAppRef = resolvedApp.releaseAppRef;
44062
+ this._releaseVRenderAppRef = resolvedApp.releaseAppRef, null === (_a = this._option.runtimePluginInstallers) || void 0 === _a || _a.forEach(install => install(resolvedApp.app));
44030
44063
  try {
44031
44064
  this._stage = createStageFromApp(resolvedApp.app, Object.assign({
44032
44065
  background: background,
44033
44066
  width: this._width,
44034
44067
  height: this._height,
44035
- container: null !== (_a = this._container.dom) && void 0 !== _a ? _a : null,
44036
- canvas: null !== (_b = this._container.canvas) && void 0 !== _b ? _b : null,
44068
+ container: null !== (_b = this._container.dom) && void 0 !== _b ? _b : null,
44069
+ canvas: null !== (_c = this._container.canvas) && void 0 !== _c ? _c : null,
44037
44070
  dpr: dpr,
44038
44071
  viewBox: this._option.viewBox,
44039
44072
  canvasControled: this._option.canvasControled,
@@ -44056,12 +44089,12 @@
44056
44089
  },
44057
44090
  ReactDOM: this._option.ReactDOM,
44058
44091
  autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr)
44059
- }, null !== (_c = this._option.renderHooks) && void 0 !== _c ? _c : {}));
44092
+ }, null !== (_d = this._option.renderHooks) && void 0 !== _d ? _d : {}));
44060
44093
  } catch (error) {
44061
- throw null === (_d = this._releaseVRenderAppRef) || void 0 === _d || _d.call(this), this._releaseVRenderAppRef = void 0, error;
44094
+ throw null === (_e = this._releaseVRenderAppRef) || void 0 === _e || _e.call(this), this._releaseVRenderAppRef = void 0, error;
44062
44095
  }
44063
44096
  }
44064
- this._stage.enableIncrementalAutoRender(), this._stage.setTheme({
44097
+ this._dedupePoptipPlugin(), this._stage.enableIncrementalAutoRender(), this._stage.setTheme({
44065
44098
  symbol: {
44066
44099
  shape: "circle",
44067
44100
  size: 8
@@ -48927,8 +48960,13 @@
48927
48960
  isTrueBrowseEnv = isTrueBrowser(mode);
48928
48961
  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!"));
48929
48962
  this._viewBox = this._option.viewBox, this._currentThemeName = ThemeManager.getCurrentThemeName(), this._setNewSpec(spec), this._updateCurrentTheme(), this._currentSize = this.getCurrentSize();
48930
- const pluginList = [];
48931
- !1 !== poptip && pluginList.push("poptipForText"), "sankey" === spec.type && pluginList.push("scrollbar");
48963
+ const pluginList = [],
48964
+ runtimePluginInstallers = [];
48965
+ if (!1 !== poptip) {
48966
+ const poptipInstaller = Factory.getRuntimePluginInstaller("poptipForText");
48967
+ poptipInstaller && (poptipInstaller(), runtimePluginInstallers.push(poptipInstaller)), pluginList.push("poptipForText");
48968
+ }
48969
+ "sankey" === spec.type && pluginList.push("scrollbar");
48932
48970
  const logger = new Logger(null !== (_c = this._option.logLevel) && void 0 !== _c ? _c : LoggerLevel.Error);
48933
48971
  Logger.setInstance(logger), (null === (_d = this._option) || void 0 === _d ? void 0 : _d.onError) && logger.addErrorHandler((...args) => {
48934
48972
  var _a, _b;
@@ -48939,7 +48977,8 @@
48939
48977
  }, Object.assign(Object.assign({
48940
48978
  mode: this._option.mode,
48941
48979
  stage: stage,
48942
- pluginList: pluginList
48980
+ pluginList: pluginList,
48981
+ runtimePluginInstallers: runtimePluginInstallers
48943
48982
  }, restOptions), {
48944
48983
  background: this._getBackground(),
48945
48984
  onError: this._onError
@@ -50929,7 +50968,7 @@
50929
50968
  const marks = this.getMarksWithoutRoot();
50930
50969
  marks.forEach(mark => {
50931
50970
  mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
50932
- }), this.initMarkStyle(), marks.forEach(mark => {
50971
+ }), this.initMarkStyle(), this.initMarkState(), marks.forEach(mark => {
50933
50972
  mark.commit(!1);
50934
50973
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();
50935
50974
  isAnimationEnabledForSeries(this) && this.initAnimation();
@@ -59227,41 +59266,46 @@
59227
59266
  getStatedGraphics(trigger) {
59228
59267
  return this._stateGraphicsByTrigger.get(trigger);
59229
59268
  }
59269
+ _getMarkById(trigger) {
59270
+ const markById = new Map();
59271
+ return trigger.getMarks().forEach(mark => {
59272
+ mark && markById.set(mark.id, mark);
59273
+ }), markById;
59274
+ }
59275
+ _hasAnimationByGraphicState(graphic, markById) {
59276
+ var _a, _b, _c;
59277
+ const mark = null !== (_b = null === (_a = graphic.parent) || void 0 === _a ? void 0 : _a.mark) && void 0 !== _b ? _b : markById.get(graphic.context.markId);
59278
+ return !!(null === (_c = null == mark ? void 0 : mark.hasAnimationByState) || void 0 === _c ? void 0 : _c.call(mark, "state"));
59279
+ }
59230
59280
  updateStates(trigger, newStatedGraphics, prevStatedGraphics, state, reverseState) {
59231
- 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) : [];
59281
+ 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), []);
59232
59282
  }
59233
59283
  toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState) {
59234
- const markIdByState = trigger.getMarkIdByState();
59284
+ const markIdByState = trigger.getMarkIdByState(),
59285
+ markById = this._getMarkById(trigger);
59235
59286
  prevStatedGraphics.forEach(g => {
59236
- var _a;
59237
59287
  if (reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId)) {
59238
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59239
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59288
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59240
59289
  addGraphicState(g, reverseState, !0, hasAnimation);
59241
59290
  }
59242
59291
  }), newStatedGraphics.forEach(g => {
59243
- var _a;
59244
59292
  if (reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId)) {
59245
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59246
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59293
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59247
59294
  removeGraphicState(g, reverseState, hasAnimation);
59248
59295
  }
59249
59296
  });
59250
59297
  }
59251
59298
  toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) {
59252
- const markIdByState = trigger.getMarkIdByState();
59299
+ const markIdByState = trigger.getMarkIdByState(),
59300
+ markById = this._getMarkById(trigger);
59253
59301
  prevStatedGraphics.forEach(g => {
59254
- var _a;
59255
59302
  if (state && markIdByState[state] && markIdByState[state].includes(g.context.markId)) {
59256
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59257
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59303
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59258
59304
  removeGraphicState(g, state, hasAnimation);
59259
59305
  }
59260
59306
  }), newStatedGraphics.forEach(g => {
59261
- var _a;
59262
59307
  if (state && markIdByState[state] && markIdByState[state].includes(g.context.markId)) {
59263
- const m = null === (_a = g.parent) || void 0 === _a ? void 0 : _a.mark,
59264
- hasAnimation = m.hasAnimationByState && m.hasAnimationByState("state");
59308
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
59265
59309
  addGraphicState(g, state, !0, hasAnimation);
59266
59310
  }
59267
59311
  });
@@ -62401,6 +62445,10 @@
62401
62445
  function bindPoptip(container) {
62402
62446
  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));
62403
62447
  }
62448
+ function installPoptipToApp(app) {
62449
+ if (!app) throw new Error("installPoptipToApp requires an app instance");
62450
+ configureRuntimeApplicationForApp(app), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions(), installRuntimeGraphicRenderersToApp(app);
62451
+ }
62404
62452
  function loadPoptip() {
62405
62453
  bindPoptip(getLegacyBindingContext()), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions();
62406
62454
  }
@@ -73714,7 +73762,7 @@
73714
73762
  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"]);
73715
73763
  class GlyphMark extends BaseMark {
73716
73764
  constructor() {
73717
- super(...arguments), this._setStateOfGraphic = g => {
73765
+ super(...arguments), this._setStateOfGraphic = (g, hasAnimation) => {
73718
73766
  g.clearStates(), g.context.diffState !== DiffState.enter && g.context.diffState !== DiffState.update || (g.glyphStateProxy = (stateName, nexStates) => {
73719
73767
  var _a;
73720
73768
  const glyphAttrs = {
@@ -73723,7 +73771,7 @@
73723
73771
  return g.glyphStates ? g.glyphStates[stateName] || (g.glyphStates[stateName] = glyphAttrs) : g.glyphStates = {
73724
73772
  [stateName]: glyphAttrs
73725
73773
  }, glyphAttrs;
73726
- }, g.useStates(g.context.states));
73774
+ }, g.useStates(g.context.states, hasAnimation));
73727
73775
  };
73728
73776
  }
73729
73777
  getSubMarks() {
@@ -73773,10 +73821,11 @@
73773
73821
  }
73774
73822
  _createGraphic(attrs = {}) {
73775
73823
  const glyph = createGlyph(attrs);
73776
- glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph), glyph.addEventListener("afterAttributeUpdate", event => {
73777
- var _a;
73778
- 2 === (null === (_a = null == event ? void 0 : event.detail) || void 0 === _a ? void 0 : _a.type) && this._syncInheritedStyleAttrs(glyph, glyph.attribute);
73779
- });
73824
+ glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph);
73825
+ const onAttributeUpdate = glyph.onAttributeUpdate.bind(glyph);
73826
+ glyph.onAttributeUpdate = context => {
73827
+ onAttributeUpdate(context), 2 === (null == context ? void 0 : context.type) && this._syncInheritedStyleAttrs(glyph, glyph.attribute);
73828
+ };
73780
73829
  const subMarks = this._subMarks;
73781
73830
  if (subMarks) {
73782
73831
  const subGraphics = [];
@@ -82537,17 +82586,22 @@
82537
82586
  heightVisual = null !== (_a = resolveOptionValue$2(op.heightVisual)) && void 0 !== _a && _a,
82538
82587
  isCone = null === (_b = resolveOptionValue$2(op.isCone)) || void 0 === _b || _b,
82539
82588
  range = resolveOptionValue$2(op.range),
82540
- max = data.reduce((m, d) => Math.max(m, Number.parseFloat(d[valueField]) || -1 / 0), -1 / 0),
82541
- min = data.reduce((m, d) => Math.min(m, Number.parseFloat(d[valueField]) || 1 / 0), 1 / 0),
82542
- 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];
82589
+ max = data.reduce((m, d) => {
82590
+ const value = Number.parseFloat(d[valueField]);
82591
+ return isValidNumber$1(value) ? Math.max(m, value) : m;
82592
+ }, -1 / 0),
82593
+ rangeMin = null !== (_c = null == range ? void 0 : range.min) && void 0 !== _c ? _c : 0,
82594
+ rangeMax = null !== (_d = null == range ? void 0 : range.max) && void 0 !== _d ? _d : max,
82595
+ 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;
82543
82596
  return data.forEach((d, i) => {
82544
82597
  var _a, _b;
82545
82598
  const currentValue = Number.parseFloat(d[valueField]),
82546
82599
  lastValue = Number.parseFloat(null === (_a = data[i - 1]) || void 0 === _a ? void 0 : _a[valueField]),
82547
82600
  nextValue = Number.parseFloat(null === (_b = data[i + 1]) || void 0 === _b ? void 0 : _b[valueField]),
82548
82601
  transformRatio = isValidNumber$1(nextValue * currentValue) && 0 !== currentValue ? nextValue / currentValue : 0,
82549
- reachRatio = isValidNumber$1(currentValue * lastValue) && 0 !== lastValue ? currentValue / lastValue : 0;
82550
- 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);
82602
+ reachRatio = isValidNumber$1(currentValue * lastValue) && 0 !== lastValue ? currentValue / lastValue : 0,
82603
+ valueRatio = getValueRatio(currentValue);
82604
+ 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);
82551
82605
  }), data;
82552
82606
  };
82553
82607
  const funnelTransform = (originData, op) => {
@@ -84272,7 +84326,7 @@
84272
84326
  if (!allLinkElements || !allLinkElements.length) return;
84273
84327
  allLinkElements.forEach((linkEl, i) => {
84274
84328
  const linkDatum = getDatumOfGraphic(linkEl);
84275
- 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));
84329
+ 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()));
84276
84330
  });
84277
84331
  }
84278
84332
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes), this._needClear = !0;
@@ -84285,7 +84339,7 @@
84285
84339
  allLinkElements.forEach(linkEl => {
84286
84340
  linkEl === graphic ? (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84287
84341
  ratio: 1
84288
- })) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0));
84342
+ }, !0, this._hasLinkStateAnimation())) : (removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation()));
84289
84343
  });
84290
84344
  }
84291
84345
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes), this._needClear = !0;
@@ -84341,7 +84395,7 @@
84341
84395
  allLinkElements.forEach((linkEl, i) => {
84342
84396
  var _a;
84343
84397
  const linkDatum = getDatumOfGraphic(linkEl);
84344
- 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));
84398
+ 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()));
84345
84399
  });
84346
84400
  }
84347
84401
  this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
@@ -84372,12 +84426,12 @@
84372
84426
  const ratio = selectedDatum.reduce((sum, d) => sum + d.value, 0) / linkDatum.value;
84373
84427
  return removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84374
84428
  ratio: ratio
84375
- });
84429
+ }, !0, this._hasLinkStateAnimation());
84376
84430
  }
84377
84431
  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, {
84378
84432
  ratio: upSelectedLink.value / linkDatum.value
84379
- });
84380
- removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0);
84433
+ }, !0, this._hasLinkStateAnimation());
84434
+ removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation());
84381
84435
  }), this._nodeMark && this._highLightElements(this._nodeMark.getGraphics(), highlightNodes);
84382
84436
  }
84383
84437
  this._needClear = !0;
@@ -84417,7 +84471,7 @@
84417
84471
  originalDatum = linkDatum.datum;
84418
84472
  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, {
84419
84473
  ratio: 1
84420
- });
84474
+ }, !0, this._hasLinkStateAnimation());
84421
84475
  const selectedDatum = originalDatum ? originalDatum.filter(entry => {
84422
84476
  const parentKeysList = entry.parents.map(item => item.key);
84423
84477
  return parentKeysList.includes(curLinkDatum.source) && parentKeysList.includes(curLinkDatum.target);
@@ -84430,13 +84484,13 @@
84430
84484
  })).reduce((sum, d) => sum + d.value, 0) / linkDatum.value;
84431
84485
  return removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE), void addRuntimeState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
84432
84486
  ratio: ratio
84433
- });
84487
+ }, !0, this._hasLinkStateAnimation());
84434
84488
  }
84435
84489
  const upSelectedLink = upstreamLinks.find(upLink => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
84436
84490
  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, {
84437
84491
  ratio: upSelectedLink.value / linkDatum.value
84438
- });
84439
- removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0);
84492
+ }, !0, this._hasLinkStateAnimation());
84493
+ removeGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS), addGraphicState(linkEl, STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, !0, this._hasLinkStateAnimation());
84440
84494
  }), this._highLightElements(allNodeElements, highlightNodes);
84441
84495
  }
84442
84496
  this._needClear = !0;
@@ -84446,6 +84500,16 @@
84446
84500
  var _a;
84447
84501
  return null !== (_a = this._spec.direction) && void 0 !== _a ? _a : "horizontal";
84448
84502
  }
84503
+ _hasStateAnimation(mark) {
84504
+ var _a;
84505
+ return isAnimationEnabledForSeries(this) && !!(null === (_a = null == mark ? void 0 : mark.hasAnimationByState) || void 0 === _a ? void 0 : _a.call(mark, "state"));
84506
+ }
84507
+ _hasLinkStateAnimation() {
84508
+ return this._hasStateAnimation(this._linkMark);
84509
+ }
84510
+ _hasNodeStateAnimation() {
84511
+ return this._hasStateAnimation(this._nodeMark);
84512
+ }
84449
84513
  getCategoryField() {
84450
84514
  return this._categoryField;
84451
84515
  }
@@ -84690,7 +84754,7 @@
84690
84754
  }
84691
84755
  _highLightElements(graphics, highlightNodes) {
84692
84756
  graphics && graphics.length && graphics.forEach(g => {
84693
- 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);
84757
+ 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());
84694
84758
  });
84695
84759
  }
84696
84760
  initTooltip() {
@@ -96452,8 +96516,11 @@
96452
96516
  Factory.registerLayout(GridLayout.type, GridLayout);
96453
96517
  };
96454
96518
 
96519
+ const installPoptip = app => {
96520
+ app ? installPoptipToApp(app) : loadPoptip();
96521
+ };
96455
96522
  const registerPoptip = () => {
96456
- loadPoptip();
96523
+ Factory.registerRuntimePluginInstaller("poptipForText", installPoptip), installPoptip();
96457
96524
  };
96458
96525
 
96459
96526
  const TOOLTIP_PREFIX = "vchart-tooltip";
@@ -101055,7 +101122,7 @@
101055
101122
 
101056
101123
  const VChartSimple = createChart('VChartSimple');
101057
101124
 
101058
- const version = "2.1.1";
101125
+ const version = "2.1.3";
101059
101126
 
101060
101127
  exports.Area = Area;
101061
101128
  exports.AreaChart = AreaChart;