@visactor/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.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +305 -70
- package/build/index.js +309 -70
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/animation-planner.js +1 -1
- package/cjs/animation/callback-disappear.js +1 -1
- package/cjs/animation/config.js +2 -1
- package/cjs/animation/grammar-dector.js +1 -1
- package/cjs/animation/index.js +1 -1
- package/cjs/animation/interface.js +1 -1
- package/cjs/animation/sequential-animate.js +1 -1
- package/cjs/animation/spec.js +1 -1
- package/cjs/animation/state-transition.js +1 -1
- package/cjs/animation/utils.js +1 -1
- package/cjs/chart/util.js +1 -2
- package/cjs/compile/compiler.d.ts +2 -0
- package/cjs/compile/compiler.js +23 -8
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/interface/compiler.d.ts +1 -0
- package/cjs/compile/interface/compiler.js.map +1 -1
- package/cjs/compile/state-manager.js +2 -1
- package/cjs/component/axis/cartesian/axis.d.ts +12 -0
- package/cjs/component/axis/cartesian/axis.js +48 -2
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.d.ts +1 -1
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/poptip/index.js +5 -2
- package/cjs/component/poptip/index.js.map +1 -1
- package/cjs/constant/event.js +1 -2
- package/cjs/constant/scatter.js +2 -1
- package/cjs/core/expression-function.js +1 -1
- package/cjs/core/factory-registry.d.ts +2 -1
- package/cjs/core/factory-registry.js +4 -2
- package/cjs/core/factory-registry.js.map +1 -1
- package/cjs/core/factory.d.ts +4 -1
- package/cjs/core/factory.js +5 -2
- package/cjs/core/factory.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +2 -3
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/instance-manager.js +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +13 -5
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/cjs/data/transforms/funnel.js +9 -4
- package/cjs/data/transforms/funnel.js.map +1 -1
- package/cjs/interaction/interaction.d.ts +2 -0
- package/cjs/interaction/interaction.js +19 -11
- package/cjs/interaction/interaction.js.map +1 -1
- package/cjs/mark/component.js +1 -1
- package/cjs/mark/component.js.map +1 -1
- package/cjs/mark/glyph.d.ts +1 -1
- package/cjs/mark/glyph.js +7 -6
- package/cjs/mark/glyph.js.map +1 -1
- package/cjs/series/bar/bar.d.ts +4 -0
- package/cjs/series/bar/bar.js +17 -6
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.js +1 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/funnel/interface.d.ts +6 -1
- package/cjs/series/funnel/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +3 -0
- package/cjs/series/sankey/sankey.js +26 -16
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/treemap/interface.d.ts +1 -1
- package/cjs/series/treemap/interface.js.map +1 -1
- package/cjs/theme/builtin/common/series/funnel.js +18 -0
- package/cjs/theme/builtin/common/series/funnel.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +4 -2
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/util/spec/transform.d.ts +5 -2
- package/cjs/util/spec/transform.js +7 -11
- package/cjs/util/spec/transform.js.map +1 -1
- package/esm/animation/animation-planner.js +1 -1
- package/esm/animation/callback-disappear.js +1 -1
- package/esm/animation/config.js +2 -1
- package/esm/animation/grammar-dector.js +1 -1
- package/esm/animation/index.js +1 -1
- package/esm/animation/interface.js +1 -1
- package/esm/animation/sequential-animate.js +1 -1
- package/esm/animation/spec.js +1 -1
- package/esm/animation/state-transition.js +1 -1
- package/esm/animation/utils.js +1 -1
- package/esm/chart/util.js +1 -2
- package/esm/compile/compiler.d.ts +2 -0
- package/esm/compile/compiler.js +24 -7
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/interface/compiler.d.ts +1 -0
- package/esm/compile/interface/compiler.js.map +1 -1
- package/esm/compile/state-manager.js +2 -1
- package/esm/component/axis/cartesian/axis.d.ts +12 -0
- package/esm/component/axis/cartesian/axis.js +48 -1
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.d.ts +1 -1
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/poptip/index.js +8 -2
- package/esm/component/poptip/index.js.map +1 -1
- package/esm/constant/event.js +1 -2
- package/esm/constant/scatter.js +2 -1
- package/esm/core/expression-function.js +1 -1
- package/esm/core/factory-registry.d.ts +2 -1
- package/esm/core/factory-registry.js +4 -2
- package/esm/core/factory-registry.js.map +1 -1
- package/esm/core/factory.d.ts +4 -1
- package/esm/core/factory.js +4 -2
- package/esm/core/factory.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +2 -3
- package/esm/core/index.js.map +1 -1
- package/esm/core/instance-manager.js +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +12 -5
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/esm/data/transforms/funnel.js +8 -5
- package/esm/data/transforms/funnel.js.map +1 -1
- package/esm/interaction/interaction.d.ts +2 -0
- package/esm/interaction/interaction.js +19 -11
- package/esm/interaction/interaction.js.map +1 -1
- package/esm/mark/component.js +1 -1
- package/esm/mark/component.js.map +1 -1
- package/esm/mark/glyph.d.ts +1 -1
- package/esm/mark/glyph.js +7 -6
- package/esm/mark/glyph.js.map +1 -1
- package/esm/series/bar/bar.d.ts +4 -0
- package/esm/series/bar/bar.js +16 -5
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.js +1 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/funnel/interface.d.ts +6 -1
- package/esm/series/funnel/interface.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +3 -0
- package/esm/series/sankey/sankey.js +26 -15
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/treemap/interface.d.ts +1 -1
- package/esm/series/treemap/interface.js.map +1 -1
- package/esm/theme/builtin/common/series/funnel.js +18 -0
- package/esm/theme/builtin/common/series/funnel.js.map +1 -1
- package/esm/typings/spec/common.d.ts +4 -2
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/util/spec/transform.d.ts +5 -2
- package/esm/util/spec/transform.js +7 -11
- package/esm/util/spec/transform.js.map +1 -1
- 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.
|
|
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));
|
|
@@ -33721,6 +33729,24 @@
|
|
|
33721
33729
|
fill: { type: 'palette', key: 'secondaryFontColor' },
|
|
33722
33730
|
textBaseline: 'middle'
|
|
33723
33731
|
}
|
|
33732
|
+
},
|
|
33733
|
+
conversionArrow: {
|
|
33734
|
+
line: {
|
|
33735
|
+
style: {
|
|
33736
|
+
stroke: 'black'
|
|
33737
|
+
}
|
|
33738
|
+
},
|
|
33739
|
+
symbol: {
|
|
33740
|
+
style: {
|
|
33741
|
+
fill: 'black'
|
|
33742
|
+
}
|
|
33743
|
+
},
|
|
33744
|
+
text: {
|
|
33745
|
+
style: {
|
|
33746
|
+
fontSize: 12,
|
|
33747
|
+
fill: '#606773'
|
|
33748
|
+
}
|
|
33749
|
+
}
|
|
33724
33750
|
}
|
|
33725
33751
|
};
|
|
33726
33752
|
res[is3d ? 'transform3d' : 'transform'] = {
|
|
@@ -33899,27 +33925,27 @@
|
|
|
33899
33925
|
}
|
|
33900
33926
|
return spec;
|
|
33901
33927
|
}
|
|
33902
|
-
function functionTransform(
|
|
33903
|
-
|
|
33904
|
-
|
|
33928
|
+
function functionTransform(value, registry) {
|
|
33929
|
+
var _a;
|
|
33930
|
+
if (!value) {
|
|
33931
|
+
return value;
|
|
33905
33932
|
}
|
|
33906
|
-
if (
|
|
33933
|
+
if (isString$1(value)) {
|
|
33934
|
+
return (_a = registry.getFunction(value)) !== null && _a !== void 0 ? _a : value;
|
|
33935
|
+
}
|
|
33936
|
+
if (isPlainObject$3(value)) {
|
|
33907
33937
|
const result = {};
|
|
33908
|
-
for (const key in
|
|
33909
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
33910
|
-
|
|
33911
|
-
result[key] = VChart.getFunction(spec[key]);
|
|
33912
|
-
continue;
|
|
33913
|
-
}
|
|
33914
|
-
result[key] = functionTransform(spec[key], VChart);
|
|
33938
|
+
for (const key in value) {
|
|
33939
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
33940
|
+
result[key] = functionTransform(value[key], registry);
|
|
33915
33941
|
}
|
|
33916
33942
|
}
|
|
33917
33943
|
return result;
|
|
33918
33944
|
}
|
|
33919
|
-
if (isArray$1(
|
|
33920
|
-
return
|
|
33945
|
+
if (isArray$1(value)) {
|
|
33946
|
+
return value.map(item => functionTransform(item, registry));
|
|
33921
33947
|
}
|
|
33922
|
-
return
|
|
33948
|
+
return value;
|
|
33923
33949
|
}
|
|
33924
33950
|
function transformFunctionAttribute(att, ...args) {
|
|
33925
33951
|
if (isFunction$1(att)) {
|
|
@@ -37021,6 +37047,7 @@
|
|
|
37021
37047
|
};
|
|
37022
37048
|
const createStageFromApp = (app, params) => app.createStage(params);
|
|
37023
37049
|
|
|
37050
|
+
const POPTIP_FOR_TEXT_PLUGIN_NAME = 'poptipForText';
|
|
37024
37051
|
class Compiler {
|
|
37025
37052
|
get stateAnimationConfig() {
|
|
37026
37053
|
return this._stateAnimationConfig;
|
|
@@ -37085,8 +37112,36 @@
|
|
|
37085
37112
|
getStage() {
|
|
37086
37113
|
return this._stage;
|
|
37087
37114
|
}
|
|
37115
|
+
_dedupeStagePlugin(pluginName) {
|
|
37116
|
+
var _a;
|
|
37117
|
+
const pluginService = (_a = this._stage) === null || _a === void 0 ? void 0 : _a.pluginService;
|
|
37118
|
+
if (!(pluginService === null || pluginService === void 0 ? void 0 : pluginService.findPluginsByName)) {
|
|
37119
|
+
return;
|
|
37120
|
+
}
|
|
37121
|
+
const plugins = pluginService.findPluginsByName(pluginName);
|
|
37122
|
+
if (plugins.length <= 1) {
|
|
37123
|
+
return;
|
|
37124
|
+
}
|
|
37125
|
+
const plugin = plugins[0];
|
|
37126
|
+
if (pluginService.uninstall) {
|
|
37127
|
+
pluginService.uninstall(pluginName);
|
|
37128
|
+
pluginService.register(plugin);
|
|
37129
|
+
}
|
|
37130
|
+
else {
|
|
37131
|
+
plugins.slice(1).forEach(duplicatePlugin => {
|
|
37132
|
+
pluginService.unRegister(duplicatePlugin);
|
|
37133
|
+
});
|
|
37134
|
+
}
|
|
37135
|
+
}
|
|
37136
|
+
_dedupePoptipPlugin() {
|
|
37137
|
+
var _a;
|
|
37138
|
+
if (!((_a = this._option.pluginList) === null || _a === void 0 ? void 0 : _a.includes(POPTIP_FOR_TEXT_PLUGIN_NAME))) {
|
|
37139
|
+
return;
|
|
37140
|
+
}
|
|
37141
|
+
this._dedupeStagePlugin(POPTIP_FOR_TEXT_PLUGIN_NAME);
|
|
37142
|
+
}
|
|
37088
37143
|
initView() {
|
|
37089
|
-
var _a, _b, _c, _d;
|
|
37144
|
+
var _a, _b, _c, _d, _e;
|
|
37090
37145
|
if (this._released) {
|
|
37091
37146
|
return;
|
|
37092
37147
|
}
|
|
@@ -37108,22 +37163,24 @@
|
|
|
37108
37163
|
modeParams
|
|
37109
37164
|
});
|
|
37110
37165
|
this._releaseVRenderAppRef = resolvedApp.releaseAppRef;
|
|
37166
|
+
(_a = this._option.runtimePluginInstallers) === null || _a === void 0 ? void 0 : _a.forEach(install => install(resolvedApp.app));
|
|
37111
37167
|
try {
|
|
37112
|
-
this._stage = createStageFromApp(resolvedApp.app, Object.assign({ background, width: this._width, height: this._height, container: (
|
|
37168
|
+
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
37169
|
var _a, _b, _c;
|
|
37114
37170
|
(_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.onBeforeRender();
|
|
37115
37171
|
(_c = (_b = this._option).beforeRender) === null || _c === void 0 ? void 0 : _c.call(_b, stage);
|
|
37116
37172
|
}, 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
37173
|
clickInterval: clickInterval,
|
|
37118
37174
|
autoPreventDefault: autoPreventDefault
|
|
37119
|
-
}, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((
|
|
37175
|
+
}, ReactDOM: this._option.ReactDOM, autoRefresh: isValid$1(autoRefreshDpr) ? autoRefreshDpr : !isValid$1(dpr) }, ((_d = this._option.renderHooks) !== null && _d !== void 0 ? _d : {})));
|
|
37120
37176
|
}
|
|
37121
37177
|
catch (error) {
|
|
37122
|
-
(
|
|
37178
|
+
(_e = this._releaseVRenderAppRef) === null || _e === void 0 ? void 0 : _e.call(this);
|
|
37123
37179
|
this._releaseVRenderAppRef = undefined;
|
|
37124
37180
|
throw error;
|
|
37125
37181
|
}
|
|
37126
37182
|
}
|
|
37183
|
+
this._dedupePoptipPlugin();
|
|
37127
37184
|
this._stage.enableIncrementalAutoRender();
|
|
37128
37185
|
this._stage.setTheme({
|
|
37129
37186
|
symbol: {
|
|
@@ -47776,6 +47833,7 @@
|
|
|
47776
47833
|
}
|
|
47777
47834
|
let theme = this._currentTheme;
|
|
47778
47835
|
keys.forEach((key, index) => {
|
|
47836
|
+
var _a;
|
|
47779
47837
|
if (index === 1 && (keys[0] === 'series' || keys[0] === 'component')) {
|
|
47780
47838
|
const buildInTheme = keys[0] === 'series' ? Factory.getSeriesBuiltInTheme(key) : Factory.getComponentBuiltInTheme(key);
|
|
47781
47839
|
theme = theme ? mergeSpec({}, buildInTheme, theme[key]) : buildInTheme;
|
|
@@ -47787,6 +47845,9 @@
|
|
|
47787
47845
|
theme = preprocessTheme({
|
|
47788
47846
|
[key]: theme
|
|
47789
47847
|
}, this._currentTheme.colorScheme, this._currentTheme.token)[key];
|
|
47848
|
+
if ((_a = this.getFunctionList()) === null || _a === void 0 ? void 0 : _a.length) {
|
|
47849
|
+
theme = functionTransform(theme, this);
|
|
47850
|
+
}
|
|
47790
47851
|
}
|
|
47791
47852
|
});
|
|
47792
47853
|
this._cachedProcessedTheme[cacheKey] = theme;
|
|
@@ -47825,7 +47886,13 @@
|
|
|
47825
47886
|
this._updateCurrentTheme();
|
|
47826
47887
|
this._currentSize = this.getCurrentSize();
|
|
47827
47888
|
const pluginList = [];
|
|
47889
|
+
const runtimePluginInstallers = [];
|
|
47828
47890
|
if (poptip !== false) {
|
|
47891
|
+
const poptipInstaller = Factory.getRuntimePluginInstaller('poptipForText');
|
|
47892
|
+
if (poptipInstaller) {
|
|
47893
|
+
poptipInstaller();
|
|
47894
|
+
runtimePluginInstallers.push(poptipInstaller);
|
|
47895
|
+
}
|
|
47829
47896
|
pluginList.push('poptipForText');
|
|
47830
47897
|
}
|
|
47831
47898
|
if (spec.type === "sankey") {
|
|
@@ -47843,7 +47910,8 @@
|
|
|
47843
47910
|
dom: (_e = this._container) !== null && _e !== void 0 ? _e : 'none',
|
|
47844
47911
|
canvas: renderCanvas
|
|
47845
47912
|
}, Object.assign(Object.assign({ mode: this._option.mode, stage,
|
|
47846
|
-
pluginList
|
|
47913
|
+
pluginList,
|
|
47914
|
+
runtimePluginInstallers }, restOptions), { background: this._getBackground(), onError: this._onError }));
|
|
47847
47915
|
this._compiler.setSize(this._currentSize.width, this._currentSize.height);
|
|
47848
47916
|
this._eventDispatcher = new EventDispatcher(this, this._compiler);
|
|
47849
47917
|
this._event = new Event$1(this._eventDispatcher, mode);
|
|
@@ -47851,7 +47919,7 @@
|
|
|
47851
47919
|
this._compiler.updateLayoutTag();
|
|
47852
47920
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
47853
47921
|
this._initDataSet(this._option.dataSet);
|
|
47854
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
47922
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
47855
47923
|
this._bindResizeEvent();
|
|
47856
47924
|
this._bindViewEvent();
|
|
47857
47925
|
this._initChartPlugin();
|
|
@@ -48538,7 +48606,7 @@
|
|
|
48538
48606
|
resize = true;
|
|
48539
48607
|
}
|
|
48540
48608
|
const lasAutoSize = this._autoSize;
|
|
48541
|
-
this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
|
|
48609
|
+
this._autoSize = isTrueBrowser(this._option.mode) ? ((_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true) : false;
|
|
48542
48610
|
if (this._autoSize !== lasAutoSize) {
|
|
48543
48611
|
resize = true;
|
|
48544
48612
|
}
|
|
@@ -49360,7 +49428,7 @@
|
|
|
49360
49428
|
});
|
|
49361
49429
|
};
|
|
49362
49430
|
|
|
49363
|
-
const version = "2.1.
|
|
49431
|
+
const version = "2.1.3";
|
|
49364
49432
|
|
|
49365
49433
|
const addVChartProperty = (data, op) => {
|
|
49366
49434
|
const context = op.beforeCall();
|
|
@@ -51154,6 +51222,7 @@
|
|
|
51154
51222
|
this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
|
|
51155
51223
|
});
|
|
51156
51224
|
this.initMarkStyle();
|
|
51225
|
+
this.initMarkState();
|
|
51157
51226
|
marks.forEach(mark => {
|
|
51158
51227
|
mark.commit(false);
|
|
51159
51228
|
});
|
|
@@ -55675,6 +55744,9 @@
|
|
|
55675
55744
|
}
|
|
55676
55745
|
else {
|
|
55677
55746
|
this._component.setAttributes(attrs);
|
|
55747
|
+
if (this._product && this._component.parent !== this._product) {
|
|
55748
|
+
this._product.appendChild(this._component);
|
|
55749
|
+
}
|
|
55678
55750
|
}
|
|
55679
55751
|
if (this._component) {
|
|
55680
55752
|
this._component.context = this._getCommonContext();
|
|
@@ -56416,6 +56488,9 @@
|
|
|
56416
56488
|
});
|
|
56417
56489
|
}
|
|
56418
56490
|
};
|
|
56491
|
+
this._clearContinuousBarBandwidthCache = () => {
|
|
56492
|
+
this._continuousBarBandwidthCache = undefined;
|
|
56493
|
+
};
|
|
56419
56494
|
this._transformLayoutPosition = (pos) => {
|
|
56420
56495
|
let { x, y } = pos;
|
|
56421
56496
|
if (isValidNumber$1(x)) {
|
|
@@ -56706,16 +56781,99 @@
|
|
|
56706
56781
|
const getScale = (depth = 0) => {
|
|
56707
56782
|
return this._scales[depth];
|
|
56708
56783
|
};
|
|
56784
|
+
const getBandwidth = (depth = 0) => {
|
|
56785
|
+
return this._getContinuousBarBandwidth(depth);
|
|
56786
|
+
};
|
|
56709
56787
|
return {
|
|
56710
56788
|
isContinuous: isContinuous(this._scale.type),
|
|
56711
56789
|
dataToPosition: this.dataToPosition.bind(this),
|
|
56712
56790
|
getScale,
|
|
56791
|
+
getBandwidth,
|
|
56713
56792
|
getAxisType: () => this.type,
|
|
56714
56793
|
getAxisId: () => this.id,
|
|
56715
56794
|
isInverse: () => this._inverse === true,
|
|
56716
56795
|
getSpec: () => this._spec
|
|
56717
56796
|
};
|
|
56718
56797
|
}
|
|
56798
|
+
_getContinuousBarBandwidth(depth = 0) {
|
|
56799
|
+
if (depth !== 0 || !isContinuous(this._scale.type)) {
|
|
56800
|
+
return undefined;
|
|
56801
|
+
}
|
|
56802
|
+
const scale = this._scales[0];
|
|
56803
|
+
const domain = scale.domain();
|
|
56804
|
+
const range = scale.range();
|
|
56805
|
+
const domainStart = +(domain === null || domain === void 0 ? void 0 : domain[0]);
|
|
56806
|
+
const domainEnd = +(domain === null || domain === void 0 ? void 0 : domain[domain.length - 1]);
|
|
56807
|
+
const rangeStart = +(range === null || range === void 0 ? void 0 : range[0]);
|
|
56808
|
+
const rangeEnd = +(range === null || range === void 0 ? void 0 : range[range.length - 1]);
|
|
56809
|
+
if (!Number.isFinite(domainStart) ||
|
|
56810
|
+
!Number.isFinite(domainEnd) ||
|
|
56811
|
+
!Number.isFinite(rangeStart) ||
|
|
56812
|
+
!Number.isFinite(rangeEnd) ||
|
|
56813
|
+
domainStart === domainEnd) {
|
|
56814
|
+
return undefined;
|
|
56815
|
+
}
|
|
56816
|
+
const cache = this._continuousBarBandwidthCache;
|
|
56817
|
+
if (cache &&
|
|
56818
|
+
cache.scale === scale &&
|
|
56819
|
+
cache.domainStart === domainStart &&
|
|
56820
|
+
cache.domainEnd === domainEnd &&
|
|
56821
|
+
cache.rangeStart === rangeStart &&
|
|
56822
|
+
cache.rangeEnd === rangeEnd) {
|
|
56823
|
+
return cache.bandWidth;
|
|
56824
|
+
}
|
|
56825
|
+
const valueSet = new Set();
|
|
56826
|
+
const orient = this.getOrient();
|
|
56827
|
+
eachSeries(this._regions, s => {
|
|
56828
|
+
var _a, _b, _c, _d;
|
|
56829
|
+
if (s.type !== exports.SeriesTypeEnum.bar) {
|
|
56830
|
+
return;
|
|
56831
|
+
}
|
|
56832
|
+
const barSeries = s;
|
|
56833
|
+
const field = isXAxis(orient) && barSeries.direction === "vertical"
|
|
56834
|
+
? barSeries.fieldX[0]
|
|
56835
|
+
: isYAxis(orient) && barSeries.direction === "horizontal"
|
|
56836
|
+
? barSeries.fieldY[0]
|
|
56837
|
+
: undefined;
|
|
56838
|
+
const values = (field ? (_d = (_c = (_b = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s)) === null || _b === void 0 ? void 0 : _b.latestData) === null || _c === void 0 ? void 0 : _c[field]) === null || _d === void 0 ? void 0 : _d.values : undefined);
|
|
56839
|
+
values === null || values === void 0 ? void 0 : values.forEach(value => {
|
|
56840
|
+
const numericValue = +value;
|
|
56841
|
+
if (Number.isFinite(numericValue)) {
|
|
56842
|
+
valueSet.add(numericValue);
|
|
56843
|
+
}
|
|
56844
|
+
});
|
|
56845
|
+
}, {
|
|
56846
|
+
userId: this._seriesUserId,
|
|
56847
|
+
specIndex: this._seriesIndex
|
|
56848
|
+
});
|
|
56849
|
+
const values = Array.from(valueSet).sort((a, b) => a - b);
|
|
56850
|
+
if (values.length < 2) {
|
|
56851
|
+
return undefined;
|
|
56852
|
+
}
|
|
56853
|
+
let minStep = Infinity;
|
|
56854
|
+
let lastValue = values[0];
|
|
56855
|
+
for (let i = 1; i < values.length; i++) {
|
|
56856
|
+
const value = values[i];
|
|
56857
|
+
const step = value - lastValue;
|
|
56858
|
+
if (step > 0 && step < minStep) {
|
|
56859
|
+
minStep = step;
|
|
56860
|
+
}
|
|
56861
|
+
lastValue = value;
|
|
56862
|
+
}
|
|
56863
|
+
const bandWidth = minStep < Infinity ? Math.abs(((rangeEnd - rangeStart) / (domainEnd - domainStart)) * minStep) : undefined;
|
|
56864
|
+
if (!Number.isFinite(bandWidth)) {
|
|
56865
|
+
return undefined;
|
|
56866
|
+
}
|
|
56867
|
+
this._continuousBarBandwidthCache = {
|
|
56868
|
+
scale,
|
|
56869
|
+
domainStart,
|
|
56870
|
+
domainEnd,
|
|
56871
|
+
rangeStart,
|
|
56872
|
+
rangeEnd,
|
|
56873
|
+
bandWidth
|
|
56874
|
+
};
|
|
56875
|
+
return bandWidth;
|
|
56876
|
+
}
|
|
56719
56877
|
afterCompile() {
|
|
56720
56878
|
var _a;
|
|
56721
56879
|
const product = (_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct();
|
|
@@ -56977,6 +57135,13 @@
|
|
|
56977
57135
|
}
|
|
56978
57136
|
initEvent() {
|
|
56979
57137
|
super.initEvent();
|
|
57138
|
+
eachSeries(this._regions, s => {
|
|
57139
|
+
var _a, _b;
|
|
57140
|
+
(_b = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s)) === null || _b === void 0 ? void 0 : _b.target.addListener('change', this._clearContinuousBarBandwidthCache);
|
|
57141
|
+
}, {
|
|
57142
|
+
userId: this._seriesUserId,
|
|
57143
|
+
specIndex: this._seriesIndex
|
|
57144
|
+
});
|
|
56980
57145
|
if (this._specVisible) {
|
|
56981
57146
|
this.event.on(exports.ChartEvent.layoutEnd, this._updateAxisLayout);
|
|
56982
57147
|
this.event.on(exports.ChartEvent.layoutEnd, this._fixAxisOnZero);
|
|
@@ -61330,11 +61495,28 @@
|
|
|
61330
61495
|
getStatedGraphics(trigger) {
|
|
61331
61496
|
return this._stateGraphicsByTrigger.get(trigger);
|
|
61332
61497
|
}
|
|
61498
|
+
_getMarkById(trigger) {
|
|
61499
|
+
const markById = new Map();
|
|
61500
|
+
trigger.getMarks().forEach(mark => {
|
|
61501
|
+
if (mark) {
|
|
61502
|
+
markById.set(mark.id, mark);
|
|
61503
|
+
}
|
|
61504
|
+
});
|
|
61505
|
+
return markById;
|
|
61506
|
+
}
|
|
61507
|
+
_hasAnimationByGraphicState(graphic, markById) {
|
|
61508
|
+
var _a, _b, _c;
|
|
61509
|
+
const mark = (_b = (_a = graphic.parent) === null || _a === void 0 ? void 0 : _a.mark) !== null && _b !== void 0 ? _b : markById.get(graphic.context.markId);
|
|
61510
|
+
return !!((_c = mark === null || mark === void 0 ? void 0 : mark.hasAnimationByState) === null || _c === void 0 ? void 0 : _c.call(mark, 'state'));
|
|
61511
|
+
}
|
|
61333
61512
|
updateStates(trigger, newStatedGraphics, prevStatedGraphics, state, reverseState) {
|
|
61334
61513
|
if (this._disableTriggerEvent) {
|
|
61335
61514
|
return [];
|
|
61336
61515
|
}
|
|
61337
61516
|
if (!newStatedGraphics || !newStatedGraphics.length) {
|
|
61517
|
+
if (prevStatedGraphics && prevStatedGraphics.length) {
|
|
61518
|
+
this.clearAllStatesOfTrigger(trigger, state, reverseState);
|
|
61519
|
+
}
|
|
61338
61520
|
return [];
|
|
61339
61521
|
}
|
|
61340
61522
|
if (state && reverseState) {
|
|
@@ -61358,42 +61540,36 @@
|
|
|
61358
61540
|
}
|
|
61359
61541
|
toggleReverseStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, reverseState) {
|
|
61360
61542
|
const markIdByState = trigger.getMarkIdByState();
|
|
61543
|
+
const markById = this._getMarkById(trigger);
|
|
61361
61544
|
prevStatedGraphics.forEach(g => {
|
|
61362
|
-
var _a;
|
|
61363
61545
|
const hasReverse = reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId);
|
|
61364
61546
|
if (hasReverse) {
|
|
61365
|
-
const
|
|
61366
|
-
const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
|
|
61547
|
+
const hasAnimation = this._hasAnimationByGraphicState(g, markById);
|
|
61367
61548
|
addGraphicState(g, reverseState, true, hasAnimation);
|
|
61368
61549
|
}
|
|
61369
61550
|
});
|
|
61370
61551
|
newStatedGraphics.forEach(g => {
|
|
61371
|
-
var _a;
|
|
61372
61552
|
const hasReverse = reverseState && markIdByState[reverseState] && markIdByState[reverseState].includes(g.context.markId);
|
|
61373
61553
|
if (hasReverse) {
|
|
61374
|
-
const
|
|
61375
|
-
const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
|
|
61554
|
+
const hasAnimation = this._hasAnimationByGraphicState(g, markById);
|
|
61376
61555
|
removeGraphicState(g, reverseState, hasAnimation);
|
|
61377
61556
|
}
|
|
61378
61557
|
});
|
|
61379
61558
|
}
|
|
61380
61559
|
toggleStateOfGraphics(trigger, newStatedGraphics, prevStatedGraphics, state) {
|
|
61381
61560
|
const markIdByState = trigger.getMarkIdByState();
|
|
61561
|
+
const markById = this._getMarkById(trigger);
|
|
61382
61562
|
prevStatedGraphics.forEach(g => {
|
|
61383
|
-
var _a;
|
|
61384
61563
|
const hasState = state && markIdByState[state] && markIdByState[state].includes(g.context.markId);
|
|
61385
61564
|
if (hasState) {
|
|
61386
|
-
const
|
|
61387
|
-
const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
|
|
61565
|
+
const hasAnimation = this._hasAnimationByGraphicState(g, markById);
|
|
61388
61566
|
removeGraphicState(g, state, hasAnimation);
|
|
61389
61567
|
}
|
|
61390
61568
|
});
|
|
61391
61569
|
newStatedGraphics.forEach(g => {
|
|
61392
|
-
var _a;
|
|
61393
61570
|
const hasState = state && markIdByState[state] && markIdByState[state].includes(g.context.markId);
|
|
61394
61571
|
if (hasState) {
|
|
61395
|
-
const
|
|
61396
|
-
const hasAnimation = m.hasAnimationByState && m.hasAnimationByState('state');
|
|
61572
|
+
const hasAnimation = this._hasAnimationByGraphicState(g, markById);
|
|
61397
61573
|
addGraphicState(g, state, true, hasAnimation);
|
|
61398
61574
|
}
|
|
61399
61575
|
});
|
|
@@ -65476,6 +65652,10 @@
|
|
|
65476
65652
|
function bindPoptip(container) {
|
|
65477
65653
|
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
65654
|
}
|
|
65655
|
+
function installPoptipToApp(app) {
|
|
65656
|
+
if (!app) throw new Error("installPoptipToApp requires an app instance");
|
|
65657
|
+
configureRuntimeApplicationForApp(app), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions(), installRuntimeGraphicRenderersToApp(app);
|
|
65658
|
+
}
|
|
65479
65659
|
function loadPoptip() {
|
|
65480
65660
|
bindPoptip(getLegacyBindingContext()), bindPoptip(getRuntimeInstallerBindingContext()), refreshRuntimeInstallerContributions();
|
|
65481
65661
|
}
|
|
@@ -74289,6 +74469,27 @@
|
|
|
74289
74469
|
const policy = super._getSpecUpdatePolicy();
|
|
74290
74470
|
return Object.assign(Object.assign({}, policy), { compileOnlyKeys: Object.assign(Object.assign({}, policy.compileOnlyKeys), BAR_SERIES_COMPILE_ONLY_KEYS) });
|
|
74291
74471
|
}
|
|
74472
|
+
getStatisticFields() {
|
|
74473
|
+
var _a;
|
|
74474
|
+
const fields = super.getStatisticFields();
|
|
74475
|
+
const positionAxisHelper = this.direction === "horizontal" ? this.getYAxisHelper() : this.getXAxisHelper();
|
|
74476
|
+
const positionFields = this.direction === "horizontal" ? this._fieldY : this._fieldX;
|
|
74477
|
+
const positionScale = (_a = positionAxisHelper === null || positionAxisHelper === void 0 ? void 0 : positionAxisHelper.getScale) === null || _a === void 0 ? void 0 : _a.call(positionAxisHelper, 0);
|
|
74478
|
+
if (positionScale && isContinuous(positionScale.type)) {
|
|
74479
|
+
positionFields.forEach(field => {
|
|
74480
|
+
const fieldStatistics = fields.find(entry => entry.key === field);
|
|
74481
|
+
if (fieldStatistics) {
|
|
74482
|
+
if (!fieldStatistics.operations.includes('values')) {
|
|
74483
|
+
fieldStatistics.operations.push('values');
|
|
74484
|
+
}
|
|
74485
|
+
}
|
|
74486
|
+
else {
|
|
74487
|
+
fields.push({ key: field, operations: ['values'] });
|
|
74488
|
+
}
|
|
74489
|
+
});
|
|
74490
|
+
}
|
|
74491
|
+
return fields;
|
|
74492
|
+
}
|
|
74292
74493
|
initMark() {
|
|
74293
74494
|
this._initBarBackgroundMark();
|
|
74294
74495
|
this._barMark = this._createMark(Object.assign(Object.assign({}, BarSeries.mark.bar), { name: this._barMarkName, type: this._barMarkType }), {
|
|
@@ -74725,14 +74926,19 @@
|
|
|
74725
74926
|
this._barMark.setAnimationConfig(animationConfig((_b = Factory.getAnimationInKey('bar')) === null || _b === void 0 ? void 0 : _b(barAnimationParams, appearPreset), userAnimationConfig(this._barMarkName, this._spec, this._markAttributeContext), animationParams));
|
|
74726
74927
|
}
|
|
74727
74928
|
_getBarWidth(axisHelper, scaleDepth) {
|
|
74728
|
-
var _a
|
|
74929
|
+
var _a;
|
|
74729
74930
|
const depthFromSpec = this._groups ? this._groups.fields.length : 1;
|
|
74730
74931
|
const depth = isNil$1(scaleDepth) ? depthFromSpec : Math.min(depthFromSpec, scaleDepth);
|
|
74731
|
-
const bandWidth = (_b = (_a = axisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(axisHelper, depth - 1)) !== null && _b !== void 0 ? _b : DefaultBandWidth$2;
|
|
74732
74932
|
const hasBarWidth = isValid$1(this._spec.barWidth) && depth === depthFromSpec;
|
|
74933
|
+
const useFixedWidth = hasBarWidth &&
|
|
74934
|
+
typeof this._spec.barWidth === 'number' &&
|
|
74935
|
+
typeof this._spec.barMinWidth !== 'string' &&
|
|
74936
|
+
typeof this._spec.barMaxWidth !== 'string';
|
|
74937
|
+
const axisBandWidth = useFixedWidth ? undefined : (_a = axisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(axisHelper, depth - 1);
|
|
74938
|
+
const bandWidth = axisBandWidth !== null && axisBandWidth !== void 0 ? axisBandWidth : DefaultBandWidth$2;
|
|
74733
74939
|
const hasBarMinWidth = isValid$1(this._spec.barMinWidth);
|
|
74734
74940
|
const hasBarMaxWidth = isValid$1(this._spec.barMaxWidth);
|
|
74735
|
-
let width = bandWidth;
|
|
74941
|
+
let width = axisHelper.isContinuous && !isNil$1(axisBandWidth) && !hasBarWidth ? bandWidth * 0.5 : bandWidth;
|
|
74736
74942
|
if (hasBarWidth) {
|
|
74737
74943
|
width = getActualNumValue(this._spec.barWidth, bandWidth);
|
|
74738
74944
|
}
|
|
@@ -74745,7 +74951,7 @@
|
|
|
74745
74951
|
return width;
|
|
74746
74952
|
}
|
|
74747
74953
|
_getPosition(direction, datum, scaleDepth, mark) {
|
|
74748
|
-
var _a, _b, _c, _d, _e;
|
|
74954
|
+
var _a, _b, _c, _d, _e, _f;
|
|
74749
74955
|
let axisHelper;
|
|
74750
74956
|
let sizeAttribute;
|
|
74751
74957
|
let dataToPosition;
|
|
@@ -74790,7 +74996,7 @@
|
|
|
74790
74996
|
totalWidth += totalWidth + (groupCount - 1) * gap;
|
|
74791
74997
|
}
|
|
74792
74998
|
}
|
|
74793
|
-
const center = scale.scale(datum[groupFields[0]]) + axisHelper.getBandwidth(0) / 2;
|
|
74999
|
+
const center = scale.scale(datum[groupFields[0]]) + ((_f = axisHelper.getBandwidth(0)) !== null && _f !== void 0 ? _f : bandWidth) / 2;
|
|
74794
75000
|
return center - totalWidth / 2 + offSet;
|
|
74795
75001
|
}
|
|
74796
75002
|
const continuous = isContinuous(scale.type || 'band');
|
|
@@ -77943,7 +78149,7 @@
|
|
|
77943
78149
|
class GlyphMark extends BaseMark {
|
|
77944
78150
|
constructor() {
|
|
77945
78151
|
super(...arguments);
|
|
77946
|
-
this._setStateOfGraphic = (g) => {
|
|
78152
|
+
this._setStateOfGraphic = (g, hasAnimation) => {
|
|
77947
78153
|
g.clearStates();
|
|
77948
78154
|
if (g.context.diffState === DiffState.enter || g.context.diffState === DiffState.update) {
|
|
77949
78155
|
g.glyphStateProxy = (stateName, nexStates) => {
|
|
@@ -77959,7 +78165,7 @@
|
|
|
77959
78165
|
}
|
|
77960
78166
|
return glyphAttrs;
|
|
77961
78167
|
};
|
|
77962
|
-
g.useStates(g.context.states);
|
|
78168
|
+
g.useStates(g.context.states, hasAnimation);
|
|
77963
78169
|
}
|
|
77964
78170
|
};
|
|
77965
78171
|
}
|
|
@@ -78038,12 +78244,13 @@
|
|
|
78038
78244
|
_createGraphic(attrs = {}) {
|
|
78039
78245
|
const glyph = createGlyph(attrs);
|
|
78040
78246
|
glyph.onBeforeAttributeUpdate = this._onGlyphAttributeUpdate(glyph);
|
|
78041
|
-
glyph.
|
|
78042
|
-
|
|
78043
|
-
|
|
78247
|
+
const onAttributeUpdate = glyph.onAttributeUpdate.bind(glyph);
|
|
78248
|
+
glyph.onAttributeUpdate = (context) => {
|
|
78249
|
+
onAttributeUpdate(context);
|
|
78250
|
+
if ((context === null || context === void 0 ? void 0 : context.type) === GLYPH_STATE_ATTRIBUTE_UPDATE_TYPE) {
|
|
78044
78251
|
this._syncInheritedStyleAttrs(glyph, glyph.attribute);
|
|
78045
78252
|
}
|
|
78046
|
-
}
|
|
78253
|
+
};
|
|
78047
78254
|
const subMarks = this._subMarks;
|
|
78048
78255
|
if (subMarks) {
|
|
78049
78256
|
const subGraphics = [];
|
|
@@ -89021,14 +89228,26 @@
|
|
|
89021
89228
|
if (!data || data.length === 0) {
|
|
89022
89229
|
return data;
|
|
89023
89230
|
}
|
|
89024
|
-
const { asTransformRatio, asReachRatio, asHeightRatio, asValueRatio, asNextValueRatio, asLastValueRatio, asLastValue, asCurrentValue, asNextValue
|
|
89231
|
+
const { asTransformRatio, asReachRatio, asHeightRatio, asValueRatio, asNextValueRatio, asLastValueRatio, asLastValue, asCurrentValue, asNextValue } = op;
|
|
89025
89232
|
const valueField = resolveOptionValue$2(op.valueField);
|
|
89026
89233
|
const heightVisual = (_a = resolveOptionValue$2(op.heightVisual)) !== null && _a !== void 0 ? _a : false;
|
|
89027
89234
|
const isCone = (_b = resolveOptionValue$2(op.isCone)) !== null && _b !== void 0 ? _b : true;
|
|
89028
89235
|
const range = resolveOptionValue$2(op.range);
|
|
89029
|
-
const max = data.reduce((m, d) =>
|
|
89030
|
-
|
|
89031
|
-
|
|
89236
|
+
const max = data.reduce((m, d) => {
|
|
89237
|
+
const value = Number.parseFloat(d[valueField]);
|
|
89238
|
+
return isValidNumber$1(value) ? Math.max(m, value) : m;
|
|
89239
|
+
}, -Infinity);
|
|
89240
|
+
const rangeMin = (_c = range === null || range === void 0 ? void 0 : range.min) !== null && _c !== void 0 ? _c : 0;
|
|
89241
|
+
const rangeMax = (_d = range === null || range === void 0 ? void 0 : range.max) !== null && _d !== void 0 ? _d : max;
|
|
89242
|
+
const getValueRatio = (value) => {
|
|
89243
|
+
if (!isValidNumber$1(value) || !isValidNumber$1(rangeMin) || !isValidNumber$1(rangeMax)) {
|
|
89244
|
+
return 0;
|
|
89245
|
+
}
|
|
89246
|
+
if (rangeMin === rangeMax) {
|
|
89247
|
+
return value < rangeMin ? 0 : 1;
|
|
89248
|
+
}
|
|
89249
|
+
return clamp$1((value - rangeMin) / (rangeMax - rangeMin), 0, 1);
|
|
89250
|
+
};
|
|
89032
89251
|
data.forEach((d, i) => {
|
|
89033
89252
|
var _a, _b;
|
|
89034
89253
|
const currentValue = Number.parseFloat(d[valueField]);
|
|
@@ -89036,15 +89255,16 @@
|
|
|
89036
89255
|
const nextValue = Number.parseFloat((_b = data[i + 1]) === null || _b === void 0 ? void 0 : _b[valueField]);
|
|
89037
89256
|
const transformRatio = !isValidNumber$1(nextValue * currentValue) || currentValue === 0 ? 0 : nextValue / currentValue;
|
|
89038
89257
|
const reachRatio = !isValidNumber$1(currentValue * lastValue) || lastValue === 0 ? 0 : currentValue / lastValue;
|
|
89258
|
+
const valueRatio = getValueRatio(currentValue);
|
|
89039
89259
|
asLastValue && (d[asLastValue] = lastValue);
|
|
89040
89260
|
asNextValue && (d[asNextValue] = nextValue);
|
|
89041
89261
|
asTransformRatio && (d[asTransformRatio] = transformRatio);
|
|
89042
89262
|
asReachRatio && (d[asReachRatio] = i === 0 ? 1 : reachRatio);
|
|
89043
89263
|
asHeightRatio && (d[asHeightRatio] = heightVisual === true ? transformRatio : 1 / data.length);
|
|
89044
|
-
asValueRatio && (d[asValueRatio] =
|
|
89264
|
+
asValueRatio && (d[asValueRatio] = valueRatio);
|
|
89045
89265
|
asNextValueRatio &&
|
|
89046
|
-
(d[asNextValueRatio] = i === data.length - 1 ? (isCone ? 0 : d[asValueRatio]) : nextValue
|
|
89047
|
-
asLastValueRatio && (d[asLastValueRatio] = i === 0 ? 1 : lastValue
|
|
89266
|
+
(d[asNextValueRatio] = i === data.length - 1 ? (isCone ? 0 : d[asValueRatio]) : getValueRatio(nextValue));
|
|
89267
|
+
asLastValueRatio && (d[asLastValueRatio] = i === 0 ? 1 : getValueRatio(lastValue));
|
|
89048
89268
|
asCurrentValue && (d[asCurrentValue] = currentValue);
|
|
89049
89269
|
});
|
|
89050
89270
|
return data;
|
|
@@ -91235,18 +91455,18 @@
|
|
|
91235
91455
|
highlightNodes.push(linkDatum.target);
|
|
91236
91456
|
}
|
|
91237
91457
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91238
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
|
|
91458
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
|
|
91239
91459
|
}
|
|
91240
91460
|
else if (linkDatum.target === nodeDatum.key) {
|
|
91241
91461
|
if (!highlightNodes.includes(linkDatum.source)) {
|
|
91242
91462
|
highlightNodes.push(linkDatum.source);
|
|
91243
91463
|
}
|
|
91244
91464
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91245
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
|
|
91465
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
|
|
91246
91466
|
}
|
|
91247
91467
|
else {
|
|
91248
91468
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
|
|
91249
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
91469
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
|
|
91250
91470
|
}
|
|
91251
91471
|
});
|
|
91252
91472
|
}
|
|
@@ -91266,11 +91486,11 @@
|
|
|
91266
91486
|
allLinkElements.forEach(linkEl => {
|
|
91267
91487
|
if (linkEl === graphic) {
|
|
91268
91488
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91269
|
-
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
|
|
91489
|
+
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 }, true, this._hasLinkStateAnimation());
|
|
91270
91490
|
}
|
|
91271
91491
|
else {
|
|
91272
91492
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
|
|
91273
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
91493
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
|
|
91274
91494
|
}
|
|
91275
91495
|
});
|
|
91276
91496
|
}
|
|
@@ -91384,11 +91604,11 @@
|
|
|
91384
91604
|
const linkDatum = getDatumOfGraphic(linkEl);
|
|
91385
91605
|
if (highlightLinks.includes((_a = linkDatum.key) !== null && _a !== void 0 ? _a : linkDatum.index)) {
|
|
91386
91606
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91387
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
|
|
91607
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasLinkStateAnimation());
|
|
91388
91608
|
}
|
|
91389
91609
|
else {
|
|
91390
91610
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
|
|
91391
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
91611
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
|
|
91392
91612
|
}
|
|
91393
91613
|
});
|
|
91394
91614
|
}
|
|
@@ -91437,7 +91657,7 @@
|
|
|
91437
91657
|
}, 0);
|
|
91438
91658
|
const ratio = val / linkDatum.value;
|
|
91439
91659
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91440
|
-
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
|
|
91660
|
+
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio }, true, this._hasLinkStateAnimation());
|
|
91441
91661
|
return;
|
|
91442
91662
|
}
|
|
91443
91663
|
if (upSelectedLink) {
|
|
@@ -91450,11 +91670,11 @@
|
|
|
91450
91670
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91451
91671
|
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
|
|
91452
91672
|
ratio: upSelectedLink.value / linkDatum.value
|
|
91453
|
-
});
|
|
91673
|
+
}, true, this._hasLinkStateAnimation());
|
|
91454
91674
|
return;
|
|
91455
91675
|
}
|
|
91456
91676
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
|
|
91457
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
91677
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
|
|
91458
91678
|
return;
|
|
91459
91679
|
});
|
|
91460
91680
|
if (this._nodeMark) {
|
|
@@ -91522,7 +91742,7 @@
|
|
|
91522
91742
|
const originalDatum = linkDatum.datum;
|
|
91523
91743
|
if (linkDatum.source === curLinkDatum.source && linkDatum.target === curLinkDatum.target) {
|
|
91524
91744
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91525
|
-
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 });
|
|
91745
|
+
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio: 1 }, true, this._hasLinkStateAnimation());
|
|
91526
91746
|
return;
|
|
91527
91747
|
}
|
|
91528
91748
|
const selectedDatum = originalDatum
|
|
@@ -91550,7 +91770,7 @@
|
|
|
91550
91770
|
}, 0);
|
|
91551
91771
|
const ratio = val / linkDatum.value;
|
|
91552
91772
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91553
|
-
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio });
|
|
91773
|
+
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, { ratio }, true, this._hasLinkStateAnimation());
|
|
91554
91774
|
return;
|
|
91555
91775
|
}
|
|
91556
91776
|
const upSelectedLink = upstreamLinks.find((upLink) => upLink.source === linkDatum.source && upLink.target === linkDatum.target);
|
|
@@ -91564,11 +91784,11 @@
|
|
|
91564
91784
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE);
|
|
91565
91785
|
addRuntimeState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, {
|
|
91566
91786
|
ratio: upSelectedLink.value / linkDatum.value
|
|
91567
|
-
});
|
|
91787
|
+
}, true, this._hasLinkStateAnimation());
|
|
91568
91788
|
return;
|
|
91569
91789
|
}
|
|
91570
91790
|
removeGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS);
|
|
91571
|
-
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
91791
|
+
addGraphicState(linkEl, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasLinkStateAnimation());
|
|
91572
91792
|
return;
|
|
91573
91793
|
});
|
|
91574
91794
|
this._highLightElements(allNodeElements, highlightNodes);
|
|
@@ -91580,6 +91800,16 @@
|
|
|
91580
91800
|
var _a;
|
|
91581
91801
|
return (_a = this._spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
|
|
91582
91802
|
}
|
|
91803
|
+
_hasStateAnimation(mark) {
|
|
91804
|
+
var _a;
|
|
91805
|
+
return isAnimationEnabledForSeries(this) && !!((_a = mark === null || mark === void 0 ? void 0 : mark.hasAnimationByState) === null || _a === void 0 ? void 0 : _a.call(mark, 'state'));
|
|
91806
|
+
}
|
|
91807
|
+
_hasLinkStateAnimation() {
|
|
91808
|
+
return this._hasStateAnimation(this._linkMark);
|
|
91809
|
+
}
|
|
91810
|
+
_hasNodeStateAnimation() {
|
|
91811
|
+
return this._hasStateAnimation(this._nodeMark);
|
|
91812
|
+
}
|
|
91583
91813
|
getCategoryField() {
|
|
91584
91814
|
return this._categoryField;
|
|
91585
91815
|
}
|
|
@@ -91873,10 +92103,10 @@
|
|
|
91873
92103
|
graphics.forEach(g => {
|
|
91874
92104
|
removeGraphicState(g, [exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]);
|
|
91875
92105
|
if (highlightNodes.includes(getDatumOfGraphic(g).key)) {
|
|
91876
|
-
addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true);
|
|
92106
|
+
addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS, true, this._hasNodeStateAnimation());
|
|
91877
92107
|
}
|
|
91878
92108
|
else {
|
|
91879
|
-
addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true);
|
|
92109
|
+
addGraphicState(g, exports.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE, true, this._hasNodeStateAnimation());
|
|
91880
92110
|
}
|
|
91881
92111
|
});
|
|
91882
92112
|
}
|
|
@@ -106841,8 +107071,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
106841
107071
|
Factory.registerLayout(GridLayout.type, GridLayout);
|
|
106842
107072
|
};
|
|
106843
107073
|
|
|
107074
|
+
const installPoptip = (app) => {
|
|
107075
|
+
if (app) {
|
|
107076
|
+
installPoptipToApp(app);
|
|
107077
|
+
}
|
|
107078
|
+
else {
|
|
107079
|
+
loadPoptip();
|
|
107080
|
+
}
|
|
107081
|
+
};
|
|
106844
107082
|
const registerPoptip = () => {
|
|
106845
|
-
|
|
107083
|
+
Factory.registerRuntimePluginInstaller('poptipForText', installPoptip);
|
|
107084
|
+
installPoptip();
|
|
106846
107085
|
};
|
|
106847
107086
|
|
|
106848
107087
|
const TOOLTIP_PREFIX = 'vchart-tooltip';
|