@visactor/vchart 2.1.3-alpha.5 → 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.
Files changed (78) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +140 -49
  3. package/build/index.js +144 -49
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/compile/compiler.d.ts +2 -0
  7. package/cjs/compile/compiler.js +23 -8
  8. package/cjs/compile/compiler.js.map +1 -1
  9. package/cjs/compile/interface/compiler.d.ts +1 -0
  10. package/cjs/compile/interface/compiler.js.map +1 -1
  11. package/cjs/component/poptip/index.js +5 -2
  12. package/cjs/component/poptip/index.js.map +1 -1
  13. package/cjs/constant/marker.js +1 -2
  14. package/cjs/constant/scatter.js +2 -1
  15. package/cjs/core/expression-function.js +1 -1
  16. package/cjs/core/factory-registry.d.ts +2 -1
  17. package/cjs/core/factory-registry.js +3 -1
  18. package/cjs/core/factory-registry.js.map +1 -1
  19. package/cjs/core/factory.d.ts +4 -1
  20. package/cjs/core/factory.js +4 -1
  21. package/cjs/core/factory.js.map +1 -1
  22. package/cjs/core/index.d.ts +1 -1
  23. package/cjs/core/index.js +1 -1
  24. package/cjs/core/index.js.map +1 -1
  25. package/cjs/core/vchart.js +9 -3
  26. package/cjs/core/vchart.js.map +1 -1
  27. package/cjs/data/data-view-utils.js +1 -1
  28. package/cjs/data/transforms/funnel.js +9 -4
  29. package/cjs/data/transforms/funnel.js.map +1 -1
  30. package/cjs/interaction/interaction.d.ts +2 -0
  31. package/cjs/interaction/interaction.js +19 -11
  32. package/cjs/interaction/interaction.js.map +1 -1
  33. package/cjs/mark/glyph.d.ts +1 -1
  34. package/cjs/mark/glyph.js +7 -6
  35. package/cjs/mark/glyph.js.map +1 -1
  36. package/cjs/series/base/base-series.js +1 -1
  37. package/cjs/series/base/base-series.js.map +1 -1
  38. package/cjs/series/funnel/interface.js.map +1 -1
  39. package/cjs/series/sankey/sankey.d.ts +3 -0
  40. package/cjs/series/sankey/sankey.js +26 -16
  41. package/cjs/series/sankey/sankey.js.map +1 -1
  42. package/esm/compile/compiler.d.ts +2 -0
  43. package/esm/compile/compiler.js +24 -7
  44. package/esm/compile/compiler.js.map +1 -1
  45. package/esm/compile/interface/compiler.d.ts +1 -0
  46. package/esm/compile/interface/compiler.js.map +1 -1
  47. package/esm/component/poptip/index.js +8 -2
  48. package/esm/component/poptip/index.js.map +1 -1
  49. package/esm/constant/marker.js +1 -2
  50. package/esm/constant/scatter.js +2 -1
  51. package/esm/core/expression-function.js +1 -1
  52. package/esm/core/factory-registry.d.ts +2 -1
  53. package/esm/core/factory-registry.js +3 -1
  54. package/esm/core/factory-registry.js.map +1 -1
  55. package/esm/core/factory.d.ts +4 -1
  56. package/esm/core/factory.js +3 -1
  57. package/esm/core/factory.js.map +1 -1
  58. package/esm/core/index.d.ts +1 -1
  59. package/esm/core/index.js +1 -1
  60. package/esm/core/index.js.map +1 -1
  61. package/esm/core/vchart.js +9 -3
  62. package/esm/core/vchart.js.map +1 -1
  63. package/esm/data/data-view-utils.js +1 -1
  64. package/esm/data/transforms/funnel.js +8 -5
  65. package/esm/data/transforms/funnel.js.map +1 -1
  66. package/esm/interaction/interaction.d.ts +2 -0
  67. package/esm/interaction/interaction.js +19 -11
  68. package/esm/interaction/interaction.js.map +1 -1
  69. package/esm/mark/glyph.d.ts +1 -1
  70. package/esm/mark/glyph.js +7 -6
  71. package/esm/mark/glyph.js.map +1 -1
  72. package/esm/series/base/base-series.js +1 -1
  73. package/esm/series/base/base-series.js.map +1 -1
  74. package/esm/series/funnel/interface.js.map +1 -1
  75. package/esm/series/sankey/sankey.d.ts +3 -0
  76. package/esm/series/sankey/sankey.js +26 -15
  77. package/esm/series/sankey/sankey.js.map +1 -1
  78. package/package.json +9 -9
package/build/index.js CHANGED
@@ -33412,9 +33412,10 @@
33412
33412
  interactionTriggers: {},
33413
33413
  composedEventMap: {},
33414
33414
  tooltipProcessors: {},
33415
+ runtimePluginInstallers: {},
33415
33416
  formatter: undefined
33416
33417
  });
33417
- const factoryRegistryVersion = "2.1.1";
33418
+ const factoryRegistryVersion = "2.1.3";
33418
33419
  const factoryRegistryKey = Symbol.for(`@visactor/vchart/factory-registry@${factoryRegistryVersion}`);
33419
33420
  const globalFactoryRegistry = globalThis;
33420
33421
  const factoryRegistry = (_a = globalFactoryRegistry[factoryRegistryKey]) !== null && _a !== void 0 ? _a : (globalFactoryRegistry[factoryRegistryKey] = createFactoryRegistry());
@@ -33657,6 +33658,13 @@
33657
33658
  }
33658
33659
  return new Cror(tooltip);
33659
33660
  };
33661
+ Factory._runtimePluginInstallers = factoryRegistry.runtimePluginInstallers;
33662
+ Factory.registerRuntimePluginInstaller = (type, installer) => {
33663
+ Factory._runtimePluginInstallers[type] = installer;
33664
+ };
33665
+ Factory.getRuntimePluginInstaller = (type) => {
33666
+ return Factory._runtimePluginInstallers[type];
33667
+ };
33660
33668
 
33661
33669
  function mergeTheme(target, ...sources) {
33662
33670
  return mergeSpec(transformThemeToMerge(target), ...sources.map(transformThemeToMerge));
@@ -37021,6 +37029,7 @@
37021
37029
  };
37022
37030
  const createStageFromApp = (app, params) => app.createStage(params);
37023
37031
 
37032
+ const POPTIP_FOR_TEXT_PLUGIN_NAME = 'poptipForText';
37024
37033
  class Compiler {
37025
37034
  get stateAnimationConfig() {
37026
37035
  return this._stateAnimationConfig;
@@ -37085,8 +37094,36 @@
37085
37094
  getStage() {
37086
37095
  return this._stage;
37087
37096
  }
37097
+ _dedupeStagePlugin(pluginName) {
37098
+ var _a;
37099
+ const pluginService = (_a = this._stage) === null || _a === void 0 ? void 0 : _a.pluginService;
37100
+ if (!(pluginService === null || pluginService === void 0 ? void 0 : pluginService.findPluginsByName)) {
37101
+ return;
37102
+ }
37103
+ const plugins = pluginService.findPluginsByName(pluginName);
37104
+ if (plugins.length <= 1) {
37105
+ return;
37106
+ }
37107
+ const plugin = plugins[0];
37108
+ if (pluginService.uninstall) {
37109
+ pluginService.uninstall(pluginName);
37110
+ pluginService.register(plugin);
37111
+ }
37112
+ else {
37113
+ plugins.slice(1).forEach(duplicatePlugin => {
37114
+ pluginService.unRegister(duplicatePlugin);
37115
+ });
37116
+ }
37117
+ }
37118
+ _dedupePoptipPlugin() {
37119
+ var _a;
37120
+ if (!((_a = this._option.pluginList) === null || _a === void 0 ? void 0 : _a.includes(POPTIP_FOR_TEXT_PLUGIN_NAME))) {
37121
+ return;
37122
+ }
37123
+ this._dedupeStagePlugin(POPTIP_FOR_TEXT_PLUGIN_NAME);
37124
+ }
37088
37125
  initView() {
37089
- var _a, _b, _c, _d;
37126
+ var _a, _b, _c, _d, _e;
37090
37127
  if (this._released) {
37091
37128
  return;
37092
37129
  }
@@ -37108,22 +37145,24 @@
37108
37145
  modeParams
37109
37146
  });
37110
37147
  this._releaseVRenderAppRef = resolvedApp.releaseAppRef;
37148
+ (_a = this._option.runtimePluginInstallers) === null || _a === void 0 ? void 0 : _a.forEach(install => install(resolvedApp.app));
37111
37149
  try {
37112
- this._stage = createStageFromApp(resolvedApp.app, Object.assign({ background, width: this._width, height: this._height, container: (_a = this._container.dom) !== null && _a !== void 0 ? _a : null, canvas: (_b = this._container.canvas) !== null && _b !== void 0 ? _b : null, dpr, viewBox: this._option.viewBox, canvasControled: this._option.canvasControled, beforeRender: (stage) => {
37150
+ this._stage = createStageFromApp(resolvedApp.app, 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) => {
37113
37151
  var _a, _b, _c;
37114
37152
  (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
37115
37153
  (_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
37116
37154
  }, 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: {
37117
37155
  clickInterval: clickInterval,
37118
37156
  autoPreventDefault: autoPreventDefault
37119
- }, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_c = this._option.renderHooks) !== null && _c !== void 0 ? _c : {})));
37157
+ }, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_d = this._option.renderHooks) !== null && _d !== void 0 ? _d : {})));
37120
37158
  }
37121
37159
  catch (error) {
37122
- (_d = this._releaseVRenderAppRef) === null || _d === void 0 ? void 0 : _d.call(this);
37160
+ (_e = this._releaseVRenderAppRef) === null || _e === void 0 ? void 0 : _e.call(this);
37123
37161
  this._releaseVRenderAppRef = undefined;
37124
37162
  throw error;
37125
37163
  }
37126
37164
  }
37165
+ this._dedupePoptipPlugin();
37127
37166
  this._stage.enableIncrementalAutoRender();
37128
37167
  this._stage.setTheme({
37129
37168
  symbol: {
@@ -47825,7 +47864,13 @@
47825
47864
  this._updateCurrentTheme();
47826
47865
  this._currentSize = this.getCurrentSize();
47827
47866
  const pluginList = [];
47867
+ const runtimePluginInstallers = [];
47828
47868
  if (poptip !== false) {
47869
+ const poptipInstaller = Factory.getRuntimePluginInstaller('poptipForText');
47870
+ if (poptipInstaller) {
47871
+ poptipInstaller();
47872
+ runtimePluginInstallers.push(poptipInstaller);
47873
+ }
47829
47874
  pluginList.push('poptipForText');
47830
47875
  }
47831
47876
  if (spec.type === "sankey") {
@@ -47843,7 +47888,8 @@
47843
47888
  dom: (_e = this._container) !== null && _e !== void 0 ? _e : 'none',
47844
47889
  canvas: renderCanvas
47845
47890
  }, Object.assign(Object.assign({ mode: this._option.mode, stage,
47846
- pluginList }, restOptions), { background: this._getBackground(), onError: this._onError }));
47891
+ pluginList,
47892
+ runtimePluginInstallers }, restOptions), { background: this._getBackground(), onError: this._onError }));
47847
47893
  this._compiler.setSize(this._currentSize.width, this._currentSize.height);
47848
47894
  this._eventDispatcher = new EventDispatcher(this, this._compiler);
47849
47895
  this._event = new Event$1(this._eventDispatcher, mode);
@@ -49360,7 +49406,7 @@
49360
49406
  });
49361
49407
  };
49362
49408
 
49363
- const version = "2.1.1";
49409
+ const version = "2.1.3";
49364
49410
 
49365
49411
  const addVChartProperty = (data, op) => {
49366
49412
  const context = op.beforeCall();
@@ -51154,6 +51200,7 @@
51154
51200
  this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
51155
51201
  });
51156
51202
  this.initMarkStyle();
51203
+ this.initMarkState();
51157
51204
  marks.forEach(mark => {
51158
51205
  mark.commit(false);
51159
51206
  });
@@ -61330,11 +61377,28 @@
61330
61377
  getStatedGraphics(trigger) {
61331
61378
  return this._stateGraphicsByTrigger.get(trigger);
61332
61379
  }
61380
+ _getMarkById(trigger) {
61381
+ const markById = new Map();
61382
+ trigger.getMarks().forEach(mark => {
61383
+ if (mark) {
61384
+ markById.set(mark.id, mark);
61385
+ }
61386
+ });
61387
+ return markById;
61388
+ }
61389
+ _hasAnimationByGraphicState(graphic, markById) {
61390
+ var _a, _b, _c;
61391
+ const mark = (_b = (_a = graphic.parent) === null || _a === void 0 ? void 0 : _a.mark) !== null && _b !== void 0 ? _b : markById.get(graphic.context.markId);
61392
+ return !!((_c = mark === null || mark === void 0 ? void 0 : mark.hasAnimationByState) === null || _c === void 0 ? void 0 : _c.call(mark, 'state'));
61393
+ }
61333
61394
  updateStates(trigger, newStatedGraphics, prevStatedGraphics, state, reverseState) {
61334
61395
  if (this._disableTriggerEvent) {
61335
61396
  return [];
61336
61397
  }
61337
61398
  if (!newStatedGraphics || !newStatedGraphics.length) {
61399
+ if (prevStatedGraphics && prevStatedGraphics.length) {
61400
+ this.clearAllStatesOfTrigger(trigger, state, reverseState);
61401
+ }
61338
61402
  return [];
61339
61403
  }
61340
61404
  if (state && reverseState) {
@@ -61358,42 +61422,36 @@
61358
61422
  }
61359
61423
  toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState) {
61360
61424
  const markIdByState = trigger.getMarkIdByState();
61425
+ const markById = this._getMarkById(trigger);
61361
61426
  prevStatedGraphics.forEach(g => {
61362
- var _a;
61363
61427
  const hasReverse = reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId);
61364
61428
  if (hasReverse) {
61365
- const m = (_a = g.parent) === null || _a === void 0 ? void 0 : _a.mark;
61366
- const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
61429
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
61367
61430
  addGraphicState(g, reverseState, true, hasAnimation);
61368
61431
  }
61369
61432
  });
61370
61433
  newStatedGraphics.forEach(g => {
61371
- var _a;
61372
61434
  const hasReverse = reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId);
61373
61435
  if (hasReverse) {
61374
- const m = (_a = g.parent) === null || _a === void 0 ? void 0 : _a.mark;
61375
- const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
61436
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
61376
61437
  removeGraphicState(g, reverseState, hasAnimation);
61377
61438
  }
61378
61439
  });
61379
61440
  }
61380
61441
  toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) {
61381
61442
  const markIdByState = trigger.getMarkIdByState();
61443
+ const markById = this._getMarkById(trigger);
61382
61444
  prevStatedGraphics.forEach(g => {
61383
- var _a;
61384
61445
  const hasState = state && markIdByState[state] && markIdByState[state].includes(g.context.markId);
61385
61446
  if (hasState) {
61386
- const m = (_a = g.parent) === null || _a === void 0 ? void 0 : _a.mark;
61387
- const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
61447
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
61388
61448
  removeGraphicState(g, state, hasAnimation);
61389
61449
  }
61390
61450
  });
61391
61451
  newStatedGraphics.forEach(g => {
61392
- var _a;
61393
61452
  const hasState = state && markIdByState[state] && markIdByState[state].includes(g.context.markId);
61394
61453
  if (hasState) {
61395
- const m = (_a = g.parent) === null || _a === void 0 ? void 0 : _a.mark;
61396
- const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
61454
+ const hasAnimation = this._hasAnimationByGraphicState(g, markById);
61397
61455
  addGraphicState(g, state, true, hasAnimation);
61398
61456
  }
61399
61457
  });
@@ -65476,6 +65534,10 @@
65476
65534
  function bindPoptip(container) {
65477
65535
  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));
65478
65536
  }
65537
+ function installPoptipToApp(app) {
65538
+ if (!app) throw new Error("installPoptipToApp requires an app instance");
65539
+ configureRuntimeApplicationForApp(app), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions(), installRuntimeGraphicRenderersToApp(app);
65540
+ }
65479
65541
  function loadPoptip() {
65480
65542
  bindPoptip(getLegacyBindingContext()), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions();
65481
65543
  }
@@ -77943,7 +78005,7 @@
77943
78005
  class GlyphMark extends BaseMark {
77944
78006
  constructor() {
77945
78007
  super(...arguments);
77946
- this._setStateOfGraphic = (g) => {
78008
+ this._setStateOfGraphic = (g, hasAnimation) => {
77947
78009
  g.clearStates();
77948
78010
  if (g.context.diffState === DiffState.enter || g.context.diffState === DiffState.update) {
77949
78011
  g.glyphStateProxy = (stateName, nexStates) => {
@@ -77959,7 +78021,7 @@
77959
78021
  }
77960
78022
  return glyphAttrs;
77961
78023
  };
77962
- g.useStates(g.context.states);
78024
+ g.useStates(g.context.states, hasAnimation);
77963
78025
  }
77964
78026
  };
77965
78027
  }
@@ -78038,12 +78100,13 @@
78038
78100
  _createGraphic(attrs = {}) {
78039
78101
  const glyph = createGlyph(attrs);
78040
78102
  glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph);
78041
- glyph.addEventListener('afterAttributeUpdate', (event) => {
78042
- var _a;
78043
- if (((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.type) === GLYPH_STATE_ATTRIBUTE_UPDATE_TYPE) {
78103
+ const onAttributeUpdate = glyph.onAttributeUpdate.bind(glyph);
78104
+ glyph.onAttributeUpdate = (context) => {
78105
+ onAttributeUpdate(context);
78106
+ if ((context === null || context === void 0 ? void 0 : context.type) === GLYPH_STATE_ATTRIBUTE_UPDATE_TYPE) {
78044
78107
  this._syncInheritedStyleAttrs(glyph, glyph.attribute);
78045
78108
  }
78046
- });
78109
+ };
78047
78110
  const subMarks = this._subMarks;
78048
78111
  if (subMarks) {
78049
78112
  const subGraphics = [];
@@ -89021,14 +89084,26 @@
89021
89084
  if (!data || data.length === 0) {
89022
89085
  return data;
89023
89086
  }
89024
- const { asTransformRatio, asReachRatio, asHeightRatio, asValueRatio, asNextValueRatio, asLastValueRatio, asLastValue, asCurrentValue, asNextValue, } = op;
89087
+ const { asTransformRatio, asReachRatio, asHeightRatio, asValueRatio, asNextValueRatio, asLastValueRatio, asLastValue, asCurrentValue, asNextValue } = op;
89025
89088
  const valueField = resolveOptionValue$2(op.valueField);
89026
89089
  const heightVisual = (_a = resolveOptionValue$2(op.heightVisual)) !== null && _a !== void 0 ? _a : false;
89027
89090
  const isCone = (_b = resolveOptionValue$2(op.isCone)) !== null && _b !== void 0 ? _b : true;
89028
89091
  const range = resolveOptionValue$2(op.range);
89029
- const max = data.reduce((m, d) => Math.max(m, Number.parseFloat(d[valueField]) || -Infinity), -Infinity);
89030
- const min = data.reduce((m, d) => Math.min(m, Number.parseFloat(d[valueField]) || Infinity), Infinity);
89031
- const rangeArr = [(_c = range === null || range === void 0 ? void 0 : range.min) !== null && _c !== void 0 ? _c : min, (_d = range === null || range === void 0 ? void 0 : range.max) !== null && _d !== void 0 ? _d : max];
89092
+ const max = data.reduce((m, d) => {
89093
+ const value = Number.parseFloat(d[valueField]);
89094
+ return isValidNumber$1(value) ? Math.max(m, value) : m;
89095
+ }, -Infinity);
89096
+ const rangeMin = (_c = range === null || range === void 0 ? void 0 : range.min) !== null && _c !== void 0 ? _c : 0;
89097
+ const rangeMax = (_d = range === null || range === void 0 ? void 0 : range.max) !== null && _d !== void 0 ? _d : max;
89098
+ const getValueRatio = (value) => {
89099
+ if (!isValidNumber$1(value) || !isValidNumber$1(rangeMin) || !isValidNumber$1(rangeMax)) {
89100
+ return 0;
89101
+ }
89102
+ if (rangeMin === rangeMax) {
89103
+ return value < rangeMin ? 0 : 1;
89104
+ }
89105
+ return clamp$1((value - rangeMin) / (rangeMax - rangeMin), 0, 1);
89106
+ };
89032
89107
  data.forEach((d, i) => {
89033
89108
  var _a, _b;
89034
89109
  const currentValue = Number.parseFloat(d[valueField]);
@@ -89036,15 +89111,16 @@
89036
89111
  const nextValue = Number.parseFloat((_b = data[i + 1]) === null || _b === void 0 ? void 0 : _b[valueField]);
89037
89112
  const transformRatio = !isValidNumber$1(nextValue * currentValue) || currentValue === 0 ? 0 : nextValue / currentValue;
89038
89113
  const reachRatio = !isValidNumber$1(currentValue * lastValue) || lastValue === 0 ? 0 : currentValue / lastValue;
89114
+ const valueRatio = getValueRatio(currentValue);
89039
89115
  asLastValue && (d[asLastValue] = lastValue);
89040
89116
  asNextValue && (d[asNextValue] = nextValue);
89041
89117
  asTransformRatio && (d[asTransformRatio] = transformRatio);
89042
89118
  asReachRatio && (d[asReachRatio] = i === 0 ? 1 : reachRatio);
89043
89119
  asHeightRatio && (d[asHeightRatio] = heightVisual === true ? transformRatio : 1 / data.length);
89044
- asValueRatio && (d[asValueRatio] = currentValue / rangeArr[1]);
89120
+ asValueRatio && (d[asValueRatio] = valueRatio);
89045
89121
  asNextValueRatio &&
89046
- (d[asNextValueRatio] = i === data.length - 1 ? (isCone ? 0 : d[asValueRatio]) : nextValue / rangeArr[1]);
89047
- asLastValueRatio && (d[asLastValueRatio] = i === 0 ? 1 : lastValue / rangeArr[1]);
89122
+ (d[asNextValueRatio] = i === data.length - 1 ? (isCone ? 0 : d[asValueRatio]) : getValueRatio(nextValue));
89123
+ asLastValueRatio && (d[asLastValueRatio] = i === 0 ? 1 : getValueRatio(lastValue));
89048
89124
  asCurrentValue && (d[asCurrentValue] = currentValue);
89049
89125
  });
89050
89126
  return data;
@@ -91235,18 +91311,18 @@
91235
91311
  highlightNodes.push(linkDatum.target);
91236
91312
  }
91237
91313
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91238
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
91314
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
91239
91315
  }
91240
91316
  else if (linkDatum.target === nodeDatum.key) {
91241
91317
  if (!highlightNodes.includes(linkDatum.source)) {
91242
91318
  highlightNodes.push(linkDatum.source);
91243
91319
  }
91244
91320
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91245
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
91321
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
91246
91322
  }
91247
91323
  else {
91248
91324
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
91249
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91325
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
91250
91326
  }
91251
91327
  });
91252
91328
  }
@@ -91266,11 +91342,11 @@
91266
91342
  allLinkElements.forEach(linkEl => {
91267
91343
  if (linkEl === graphic) {
91268
91344
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91269
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
91345
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 }, true, this._hasLinkStateAnimation());
91270
91346
  }
91271
91347
  else {
91272
91348
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
91273
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91349
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
91274
91350
  }
91275
91351
  });
91276
91352
  }
@@ -91384,11 +91460,11 @@
91384
91460
  const linkDatum = getDatumOfGraphic(linkEl);
91385
91461
  if (highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
91386
91462
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91387
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
91463
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
91388
91464
  }
91389
91465
  else {
91390
91466
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
91391
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91467
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
91392
91468
  }
91393
91469
  });
91394
91470
  }
@@ -91437,7 +91513,7 @@
91437
91513
  }, 0);
91438
91514
  const ratio = val / linkDatum.value;
91439
91515
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91440
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
91516
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio }, true, this._hasLinkStateAnimation());
91441
91517
  return;
91442
91518
  }
91443
91519
  if (upSelectedLink) {
@@ -91450,11 +91526,11 @@
91450
91526
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91451
91527
  addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
91452
91528
  ratio: upSelectedLink.value / linkDatum.value
91453
- });
91529
+ }, true, this._hasLinkStateAnimation());
91454
91530
  return;
91455
91531
  }
91456
91532
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
91457
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91533
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
91458
91534
  return;
91459
91535
  });
91460
91536
  if (this._nodeMark) {
@@ -91522,7 +91598,7 @@
91522
91598
  const originalDatum = linkDatum.datum;
91523
91599
  if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
91524
91600
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91525
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
91601
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 }, true, this._hasLinkStateAnimation());
91526
91602
  return;
91527
91603
  }
91528
91604
  const selectedDatum = originalDatum
@@ -91550,7 +91626,7 @@
91550
91626
  }, 0);
91551
91627
  const ratio = val / linkDatum.value;
91552
91628
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91553
- addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
91629
+ addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio }, true, this._hasLinkStateAnimation());
91554
91630
  return;
91555
91631
  }
91556
91632
  const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
@@ -91564,11 +91640,11 @@
91564
91640
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
91565
91641
  addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
91566
91642
  ratio: upSelectedLink.value / linkDatum.value
91567
- });
91643
+ }, true, this._hasLinkStateAnimation());
91568
91644
  return;
91569
91645
  }
91570
91646
  removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
91571
- addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91647
+ addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
91572
91648
  return;
91573
91649
  });
91574
91650
  this._highLightElements(allNodeElements, highlightNodes);
@@ -91580,6 +91656,16 @@
91580
91656
  var _a;
91581
91657
  return (_a = this._spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
91582
91658
  }
91659
+ _hasStateAnimation(mark) {
91660
+ var _a;
91661
+ return isAnimationEnabledForSeries(this) && !!((_a = mark === null || mark === void 0 ? void 0 : mark.hasAnimationByState) === null || _a === void 0 ? void 0 : _a.call(mark, 'state'));
91662
+ }
91663
+ _hasLinkStateAnimation() {
91664
+ return this._hasStateAnimation(this._linkMark);
91665
+ }
91666
+ _hasNodeStateAnimation() {
91667
+ return this._hasStateAnimation(this._nodeMark);
91668
+ }
91583
91669
  getCategoryField() {
91584
91670
  return this._categoryField;
91585
91671
  }
@@ -91873,10 +91959,10 @@
91873
91959
  graphics.forEach(g => {
91874
91960
  removeGraphicState(g, [exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]);
91875
91961
  if (highlightNodes.includes(getDatumOfGraphic(g).key)) {
91876
- addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
91962
+ addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasNodeStateAnimation());
91877
91963
  }
91878
91964
  else {
91879
- addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
91965
+ addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasNodeStateAnimation());
91880
91966
  }
91881
91967
  });
91882
91968
  }
@@ -106841,8 +106927,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
106841
106927
  Factory.registerLayout(GridLayout.type, GridLayout);
106842
106928
  };
106843
106929
 
106930
+ const installPoptip = (app) => {
106931
+ if (app) {
106932
+ installPoptipToApp(app);
106933
+ }
106934
+ else {
106935
+ loadPoptip();
106936
+ }
106937
+ };
106844
106938
  const registerPoptip = () => {
106845
- loadPoptip();
106939
+ Factory.registerRuntimePluginInstaller('poptipForText', installPoptip);
106940
+ installPoptip();
106846
106941
  };
106847
106942
 
106848
106943
  const TOOLTIP_PREFIX = 'vchart-tooltip';