@visactor/vchart 2.0.22-alpha.3 → 2.0.22
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 +97 -31
- package/build/index.js +97 -31
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/interface/theme.d.ts +2 -2
- package/cjs/component/interface/theme.js.map +1 -1
- package/cjs/component/tooltip/tooltip-transformer.js +11 -9
- package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +6 -4
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/series/bar/bar.js +14 -9
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/map/map.js +18 -6
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/sankey/tooltip-helper.js +1 -1
- package/cjs/series/sankey/tooltip-helper.js.map +1 -1
- package/cjs/series/scatter/scatter.js +9 -3
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/esm/component/interface/theme.d.ts +2 -2
- package/esm/component/interface/theme.js.map +1 -1
- package/esm/component/tooltip/tooltip-transformer.js +11 -8
- package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +6 -4
- package/esm/core/vchart.js.map +1 -1
- package/esm/series/bar/bar.js +14 -8
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/map/map.js +18 -6
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/sankey/tooltip-helper.js +2 -2
- package/esm/series/sankey/tooltip-helper.js.map +1 -1
- package/esm/series/scatter/scatter.js +10 -4
- package/esm/series/scatter/scatter.js.map +1 -1
- package/package.json +4 -4
package/build/index.es.js
CHANGED
|
@@ -60939,7 +60939,7 @@ class VChart {
|
|
|
60939
60939
|
this._compiler.updateLayoutTag();
|
|
60940
60940
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60941
60941
|
this._initDataSet(this._option.dataSet);
|
|
60942
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60942
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60943
60943
|
this._bindResizeEvent();
|
|
60944
60944
|
this._bindViewEvent();
|
|
60945
60945
|
this._initChartPlugin();
|
|
@@ -61124,7 +61124,7 @@ class VChart {
|
|
|
61124
61124
|
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.setBackground(this._getBackground());
|
|
61125
61125
|
}
|
|
61126
61126
|
if (updateResult.reMake) {
|
|
61127
|
-
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
|
|
61127
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(true);
|
|
61128
61128
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
61129
61129
|
}
|
|
61130
61130
|
else if (updateResult.reCompile) {
|
|
@@ -61589,7 +61589,7 @@ class VChart {
|
|
|
61589
61589
|
resize = true;
|
|
61590
61590
|
}
|
|
61591
61591
|
const lasAutoSize = this._autoSize;
|
|
61592
|
-
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;
|
|
61592
|
+
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;
|
|
61593
61593
|
if (this._autoSize !== lasAutoSize) {
|
|
61594
61594
|
resize = true;
|
|
61595
61595
|
}
|
|
@@ -61784,9 +61784,10 @@ class VChart {
|
|
|
61784
61784
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setLayout(layout);
|
|
61785
61785
|
}
|
|
61786
61786
|
reLayout() {
|
|
61787
|
-
var _a;
|
|
61788
|
-
this._chart.resetLayoutItemTag();
|
|
61789
|
-
(
|
|
61787
|
+
var _a, _b, _c;
|
|
61788
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.resetLayoutItemTag();
|
|
61789
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.setLayoutTag(true, null, false);
|
|
61790
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.render();
|
|
61790
61791
|
}
|
|
61791
61792
|
getCompiler() {
|
|
61792
61793
|
return this._compiler;
|
|
@@ -62055,8 +62056,9 @@ class VChart {
|
|
|
62055
62056
|
]);
|
|
62056
62057
|
}
|
|
62057
62058
|
_reSetRenderState() {
|
|
62059
|
+
var _a, _b;
|
|
62058
62060
|
this._renderState = RenderStateEnum.render;
|
|
62059
|
-
this.getStage().eventSystem.resumeTriggerEvent();
|
|
62061
|
+
(_b = (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.eventSystem) === null || _b === void 0 ? void 0 : _b.resumeTriggerEvent();
|
|
62060
62062
|
}
|
|
62061
62063
|
}
|
|
62062
62064
|
VChart.InstanceManager = InstanceManager;
|
|
@@ -62174,7 +62176,7 @@ const lookup = (data, opt) => {
|
|
|
62174
62176
|
});
|
|
62175
62177
|
};
|
|
62176
62178
|
|
|
62177
|
-
const version = "2.0.
|
|
62179
|
+
const version = "2.0.22";
|
|
62178
62180
|
|
|
62179
62181
|
const addVChartProperty = (data, op) => {
|
|
62180
62182
|
const context = op.beforeCall();
|
|
@@ -73420,13 +73422,20 @@ class BarSeries extends CartesianSeries {
|
|
|
73420
73422
|
}
|
|
73421
73423
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
73422
73424
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
73425
|
+
const isVertical = this.direction === "vertical";
|
|
73423
73426
|
this._barMark.setMarkConfig({
|
|
73424
73427
|
clip: true,
|
|
73425
73428
|
clipPath: () => {
|
|
73429
|
+
const usePreCalculatedRect = !!this._shouldDoPreCalculate();
|
|
73430
|
+
if (usePreCalculatedRect) {
|
|
73431
|
+
this._calculateStackRectPosition(isVertical);
|
|
73432
|
+
}
|
|
73426
73433
|
const rectPaths = [];
|
|
73427
73434
|
this._forEachStackGroup(node => {
|
|
73428
73435
|
let min = Infinity;
|
|
73429
73436
|
let max = -Infinity;
|
|
73437
|
+
let rectMin = Infinity;
|
|
73438
|
+
let rectMax = -Infinity;
|
|
73430
73439
|
let hasPercent = false;
|
|
73431
73440
|
let minPercent = Infinity;
|
|
73432
73441
|
let maxPercent = -Infinity;
|
|
@@ -73437,6 +73446,12 @@ class BarSeries extends CartesianSeries {
|
|
|
73437
73446
|
const endPercent = datum[STACK_FIELD_END_PERCENT];
|
|
73438
73447
|
min = Math.min(min, start, end);
|
|
73439
73448
|
max = Math.max(max, start, end);
|
|
73449
|
+
if (usePreCalculatedRect) {
|
|
73450
|
+
const rectStart = datum[isVertical ? RECT_Y : RECT_X];
|
|
73451
|
+
const rectEnd = datum[isVertical ? RECT_Y1 : RECT_X1];
|
|
73452
|
+
rectMin = Math.min(rectMin, rectStart, rectEnd);
|
|
73453
|
+
rectMax = Math.max(rectMax, rectStart, rectEnd);
|
|
73454
|
+
}
|
|
73440
73455
|
if (isValid$1(startPercent) && isValid$1(endPercent)) {
|
|
73441
73456
|
hasPercent = true;
|
|
73442
73457
|
minPercent = Math.min(minPercent, startPercent, endPercent);
|
|
@@ -73451,14 +73466,14 @@ class BarSeries extends CartesianSeries {
|
|
|
73451
73466
|
: undefined));
|
|
73452
73467
|
const rectAttr = this.direction === "horizontal"
|
|
73453
73468
|
? {
|
|
73454
|
-
x: this._getBarXStart(mockDatum, xScale),
|
|
73455
|
-
x1: this._getBarXEnd(mockDatum, xScale),
|
|
73469
|
+
x: usePreCalculatedRect ? rectMin : this._getBarXStart(mockDatum, xScale),
|
|
73470
|
+
x1: usePreCalculatedRect ? rectMax : this._getBarXEnd(mockDatum, xScale),
|
|
73456
73471
|
y: this._getPosition(this.direction, mockDatum),
|
|
73457
73472
|
height: this._getBarWidth(this._yAxisHelper)
|
|
73458
73473
|
}
|
|
73459
73474
|
: {
|
|
73460
|
-
y: this._getBarYStart(mockDatum, yScale),
|
|
73461
|
-
y1: this._getBarYEnd(mockDatum, yScale),
|
|
73475
|
+
y: usePreCalculatedRect ? rectMin : this._getBarYStart(mockDatum, yScale),
|
|
73476
|
+
y1: usePreCalculatedRect ? rectMax : this._getBarYEnd(mockDatum, yScale),
|
|
73462
73477
|
x: this._getPosition(this.direction, mockDatum),
|
|
73463
73478
|
width: this._getBarWidth(this._xAxisHelper)
|
|
73464
73479
|
};
|
|
@@ -74009,7 +74024,7 @@ class ScatterSeries extends CartesianSeries {
|
|
|
74009
74024
|
}
|
|
74010
74025
|
}
|
|
74011
74026
|
handleZoom(e) {
|
|
74012
|
-
var _a, _b;
|
|
74027
|
+
var _a, _b, _c, _d;
|
|
74013
74028
|
this.getMarksWithoutRoot().forEach(mark => {
|
|
74014
74029
|
if (!mark) {
|
|
74015
74030
|
return;
|
|
@@ -74027,10 +74042,23 @@ class ScatterSeries extends CartesianSeries {
|
|
|
74027
74042
|
}
|
|
74028
74043
|
});
|
|
74029
74044
|
});
|
|
74030
|
-
const
|
|
74031
|
-
if (
|
|
74045
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
74046
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
74047
|
+
labelComponent.renderInner();
|
|
74048
|
+
}
|
|
74049
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
74050
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
74032
74051
|
vgrammarLabel.evaluate(null, null);
|
|
74033
74052
|
}
|
|
74053
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
74054
|
+
if (labelGroup && (e === null || e === void 0 ? void 0 : e.scale) && (e === null || e === void 0 ? void 0 : e.scaleCenter)) {
|
|
74055
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
74056
|
+
labelGroup.setAttributes({
|
|
74057
|
+
postMatrix: new Matrix()
|
|
74058
|
+
});
|
|
74059
|
+
}
|
|
74060
|
+
labelGroup.scale(e.scale, e.scale, e.scaleCenter);
|
|
74061
|
+
}
|
|
74034
74062
|
}
|
|
74035
74063
|
handlePan(e) {
|
|
74036
74064
|
this.handleZoom(e);
|
|
@@ -75292,7 +75320,7 @@ class MapSeries extends GeoSeries {
|
|
|
75292
75320
|
this._mapViewData = null;
|
|
75293
75321
|
}
|
|
75294
75322
|
handleZoom(e) {
|
|
75295
|
-
var _a;
|
|
75323
|
+
var _a, _b, _c, _d;
|
|
75296
75324
|
const { scale, scaleCenter } = e;
|
|
75297
75325
|
if (scale === 1) {
|
|
75298
75326
|
return;
|
|
@@ -75306,13 +75334,26 @@ class MapSeries extends GeoSeries {
|
|
|
75306
75334
|
}
|
|
75307
75335
|
pathGroup.scale(scale, scale, scaleCenter);
|
|
75308
75336
|
}
|
|
75309
|
-
const
|
|
75310
|
-
if (
|
|
75311
|
-
|
|
75337
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75338
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75339
|
+
labelComponent.renderInner();
|
|
75340
|
+
}
|
|
75341
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75342
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75343
|
+
vgrammarLabel.evaluate(null, null);
|
|
75344
|
+
}
|
|
75345
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75346
|
+
if (labelGroup && scale && scaleCenter) {
|
|
75347
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75348
|
+
labelGroup.setAttributes({
|
|
75349
|
+
postMatrix: new Matrix()
|
|
75350
|
+
});
|
|
75351
|
+
}
|
|
75352
|
+
labelGroup.scale(scale, scale, scaleCenter);
|
|
75312
75353
|
}
|
|
75313
75354
|
}
|
|
75314
75355
|
handlePan(e) {
|
|
75315
|
-
var _a;
|
|
75356
|
+
var _a, _b, _c, _d;
|
|
75316
75357
|
const { delta } = e;
|
|
75317
75358
|
if (delta[0] === 0 && delta[1] === 0) {
|
|
75318
75359
|
return;
|
|
@@ -75326,9 +75367,22 @@ class MapSeries extends GeoSeries {
|
|
|
75326
75367
|
}
|
|
75327
75368
|
pathGroup.translate(delta[0], delta[1]);
|
|
75328
75369
|
}
|
|
75329
|
-
const
|
|
75330
|
-
if (
|
|
75331
|
-
|
|
75370
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75371
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75372
|
+
labelComponent.renderInner();
|
|
75373
|
+
}
|
|
75374
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75375
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75376
|
+
vgrammarLabel.evaluate(null, null);
|
|
75377
|
+
}
|
|
75378
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75379
|
+
if (labelGroup && delta) {
|
|
75380
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75381
|
+
labelGroup.setAttributes({
|
|
75382
|
+
postMatrix: new Matrix()
|
|
75383
|
+
});
|
|
75384
|
+
}
|
|
75385
|
+
labelGroup.translate(delta[0], delta[1]);
|
|
75332
75386
|
}
|
|
75333
75387
|
}
|
|
75334
75388
|
getDatumCenter(datum) {
|
|
@@ -89376,7 +89430,7 @@ class SankeySeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
|
89376
89430
|
constructor() {
|
|
89377
89431
|
super(...arguments);
|
|
89378
89432
|
this._getDimensionData = (datum) => {
|
|
89379
|
-
if (datum.source) {
|
|
89433
|
+
if (!isNil$1(datum === null || datum === void 0 ? void 0 : datum.source) && !isNil$1(datum === null || datum === void 0 ? void 0 : datum.target)) {
|
|
89380
89434
|
if (isNumber$1(datum.source)) {
|
|
89381
89435
|
const seriesKeys = this.series.getSeriesKeys();
|
|
89382
89436
|
return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
|
|
@@ -96603,19 +96657,31 @@ const getMarkInfoList = (datum, region) => {
|
|
|
96603
96657
|
const isMarkInfo = (info) => isValid$1(info) && !isArray$1(info);
|
|
96604
96658
|
const isDimensionInfo = (info) => isValid$1(info) && isArray$1(info);
|
|
96605
96659
|
|
|
96660
|
+
const TOOLTIP_STYLE_THEME_KEYS = [
|
|
96661
|
+
'panel',
|
|
96662
|
+
'shape',
|
|
96663
|
+
'titleLabel',
|
|
96664
|
+
'keyLabel',
|
|
96665
|
+
'valueLabel',
|
|
96666
|
+
'spaceRow',
|
|
96667
|
+
'maxContentHeight',
|
|
96668
|
+
'align'
|
|
96669
|
+
];
|
|
96606
96670
|
class TooltipSpecTransformer extends BaseComponentSpecTransformer {
|
|
96607
96671
|
_shouldMergeThemeToSpec() {
|
|
96608
96672
|
return false;
|
|
96609
96673
|
}
|
|
96610
96674
|
_initTheme(spec, chartSpec) {
|
|
96611
|
-
var _a, _b, _c;
|
|
96612
96675
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
96613
|
-
|
|
96614
|
-
|
|
96615
|
-
|
|
96616
|
-
|
|
96617
|
-
|
|
96618
|
-
|
|
96676
|
+
const themeStyle = mergeSpec({}, ...TOOLTIP_STYLE_THEME_KEYS.map(key => ((theme === null || theme === void 0 ? void 0 : theme[key]) !== undefined ? { [key]: theme[key] } : undefined)), theme === null || theme === void 0 ? void 0 : theme.style);
|
|
96677
|
+
const themeSpec = mergeSpec({}, theme);
|
|
96678
|
+
TOOLTIP_STYLE_THEME_KEYS.forEach(key => {
|
|
96679
|
+
delete themeSpec[key];
|
|
96680
|
+
});
|
|
96681
|
+
delete themeSpec.style;
|
|
96682
|
+
const mergedSpec = mergeSpec({}, themeSpec, newSpec);
|
|
96683
|
+
mergedSpec.style = mergeSpec({}, themeStyle, mergedSpec.style);
|
|
96684
|
+
return { spec: mergedSpec, theme };
|
|
96619
96685
|
}
|
|
96620
96686
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
96621
96687
|
var _a, _b, _c, _d, _e, _f, _g;
|
package/build/index.js
CHANGED
|
@@ -60945,7 +60945,7 @@
|
|
|
60945
60945
|
this._compiler.updateLayoutTag();
|
|
60946
60946
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
60947
60947
|
this._initDataSet(this._option.dataSet);
|
|
60948
|
-
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
60948
|
+
this._autoSize = isTrueBrowseEnv ? ((_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true) : false;
|
|
60949
60949
|
this._bindResizeEvent();
|
|
60950
60950
|
this._bindViewEvent();
|
|
60951
60951
|
this._initChartPlugin();
|
|
@@ -61130,7 +61130,7 @@
|
|
|
61130
61130
|
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.setBackground(this._getBackground());
|
|
61131
61131
|
}
|
|
61132
61132
|
if (updateResult.reMake) {
|
|
61133
|
-
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar();
|
|
61133
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(true);
|
|
61134
61134
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
61135
61135
|
}
|
|
61136
61136
|
else if (updateResult.reCompile) {
|
|
@@ -61595,7 +61595,7 @@
|
|
|
61595
61595
|
resize = true;
|
|
61596
61596
|
}
|
|
61597
61597
|
const lasAutoSize = this._autoSize;
|
|
61598
|
-
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;
|
|
61598
|
+
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;
|
|
61599
61599
|
if (this._autoSize !== lasAutoSize) {
|
|
61600
61600
|
resize = true;
|
|
61601
61601
|
}
|
|
@@ -61790,9 +61790,10 @@
|
|
|
61790
61790
|
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setLayout(layout);
|
|
61791
61791
|
}
|
|
61792
61792
|
reLayout() {
|
|
61793
|
-
var _a;
|
|
61794
|
-
this._chart.resetLayoutItemTag();
|
|
61795
|
-
(
|
|
61793
|
+
var _a, _b, _c;
|
|
61794
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.resetLayoutItemTag();
|
|
61795
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.setLayoutTag(true, null, false);
|
|
61796
|
+
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.render();
|
|
61796
61797
|
}
|
|
61797
61798
|
getCompiler() {
|
|
61798
61799
|
return this._compiler;
|
|
@@ -62061,8 +62062,9 @@
|
|
|
62061
62062
|
]);
|
|
62062
62063
|
}
|
|
62063
62064
|
_reSetRenderState() {
|
|
62065
|
+
var _a, _b;
|
|
62064
62066
|
this._renderState = RenderStateEnum.render;
|
|
62065
|
-
this.getStage().eventSystem.resumeTriggerEvent();
|
|
62067
|
+
(_b = (_a = this.getStage()) === null || _a === void 0 ? void 0 : _a.eventSystem) === null || _b === void 0 ? void 0 : _b.resumeTriggerEvent();
|
|
62066
62068
|
}
|
|
62067
62069
|
}
|
|
62068
62070
|
VChart.InstanceManager = InstanceManager;
|
|
@@ -62180,7 +62182,7 @@
|
|
|
62180
62182
|
});
|
|
62181
62183
|
};
|
|
62182
62184
|
|
|
62183
|
-
const version = "2.0.
|
|
62185
|
+
const version = "2.0.22";
|
|
62184
62186
|
|
|
62185
62187
|
const addVChartProperty = (data, op) => {
|
|
62186
62188
|
const context = op.beforeCall();
|
|
@@ -73426,13 +73428,20 @@
|
|
|
73426
73428
|
}
|
|
73427
73429
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
73428
73430
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
73431
|
+
const isVertical = this.direction === "vertical";
|
|
73429
73432
|
this._barMark.setMarkConfig({
|
|
73430
73433
|
clip: true,
|
|
73431
73434
|
clipPath: () => {
|
|
73435
|
+
const usePreCalculatedRect = !!this._shouldDoPreCalculate();
|
|
73436
|
+
if (usePreCalculatedRect) {
|
|
73437
|
+
this._calculateStackRectPosition(isVertical);
|
|
73438
|
+
}
|
|
73432
73439
|
const rectPaths = [];
|
|
73433
73440
|
this._forEachStackGroup(node => {
|
|
73434
73441
|
let min = Infinity;
|
|
73435
73442
|
let max = -Infinity;
|
|
73443
|
+
let rectMin = Infinity;
|
|
73444
|
+
let rectMax = -Infinity;
|
|
73436
73445
|
let hasPercent = false;
|
|
73437
73446
|
let minPercent = Infinity;
|
|
73438
73447
|
let maxPercent = -Infinity;
|
|
@@ -73443,6 +73452,12 @@
|
|
|
73443
73452
|
const endPercent = datum[STACK_FIELD_END_PERCENT];
|
|
73444
73453
|
min = Math.min(min, start, end);
|
|
73445
73454
|
max = Math.max(max, start, end);
|
|
73455
|
+
if (usePreCalculatedRect) {
|
|
73456
|
+
const rectStart = datum[isVertical ? RECT_Y : RECT_X];
|
|
73457
|
+
const rectEnd = datum[isVertical ? RECT_Y1 : RECT_X1];
|
|
73458
|
+
rectMin = Math.min(rectMin, rectStart, rectEnd);
|
|
73459
|
+
rectMax = Math.max(rectMax, rectStart, rectEnd);
|
|
73460
|
+
}
|
|
73446
73461
|
if (isValid$1(startPercent) && isValid$1(endPercent)) {
|
|
73447
73462
|
hasPercent = true;
|
|
73448
73463
|
minPercent = Math.min(minPercent, startPercent, endPercent);
|
|
@@ -73457,14 +73472,14 @@
|
|
|
73457
73472
|
: undefined));
|
|
73458
73473
|
const rectAttr = this.direction === "horizontal"
|
|
73459
73474
|
? {
|
|
73460
|
-
x: this._getBarXStart(mockDatum, xScale),
|
|
73461
|
-
x1: this._getBarXEnd(mockDatum, xScale),
|
|
73475
|
+
x: usePreCalculatedRect ? rectMin : this._getBarXStart(mockDatum, xScale),
|
|
73476
|
+
x1: usePreCalculatedRect ? rectMax : this._getBarXEnd(mockDatum, xScale),
|
|
73462
73477
|
y: this._getPosition(this.direction, mockDatum),
|
|
73463
73478
|
height: this._getBarWidth(this._yAxisHelper)
|
|
73464
73479
|
}
|
|
73465
73480
|
: {
|
|
73466
|
-
y: this._getBarYStart(mockDatum, yScale),
|
|
73467
|
-
y1: this._getBarYEnd(mockDatum, yScale),
|
|
73481
|
+
y: usePreCalculatedRect ? rectMin : this._getBarYStart(mockDatum, yScale),
|
|
73482
|
+
y1: usePreCalculatedRect ? rectMax : this._getBarYEnd(mockDatum, yScale),
|
|
73468
73483
|
x: this._getPosition(this.direction, mockDatum),
|
|
73469
73484
|
width: this._getBarWidth(this._xAxisHelper)
|
|
73470
73485
|
};
|
|
@@ -74015,7 +74030,7 @@
|
|
|
74015
74030
|
}
|
|
74016
74031
|
}
|
|
74017
74032
|
handleZoom(e) {
|
|
74018
|
-
var _a, _b;
|
|
74033
|
+
var _a, _b, _c, _d;
|
|
74019
74034
|
this.getMarksWithoutRoot().forEach(mark => {
|
|
74020
74035
|
if (!mark) {
|
|
74021
74036
|
return;
|
|
@@ -74033,10 +74048,23 @@
|
|
|
74033
74048
|
}
|
|
74034
74049
|
});
|
|
74035
74050
|
});
|
|
74036
|
-
const
|
|
74037
|
-
if (
|
|
74051
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
74052
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
74053
|
+
labelComponent.renderInner();
|
|
74054
|
+
}
|
|
74055
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
74056
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
74038
74057
|
vgrammarLabel.evaluate(null, null);
|
|
74039
74058
|
}
|
|
74059
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
74060
|
+
if (labelGroup && (e === null || e === void 0 ? void 0 : e.scale) && (e === null || e === void 0 ? void 0 : e.scaleCenter)) {
|
|
74061
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
74062
|
+
labelGroup.setAttributes({
|
|
74063
|
+
postMatrix: new Matrix()
|
|
74064
|
+
});
|
|
74065
|
+
}
|
|
74066
|
+
labelGroup.scale(e.scale, e.scale, e.scaleCenter);
|
|
74067
|
+
}
|
|
74040
74068
|
}
|
|
74041
74069
|
handlePan(e) {
|
|
74042
74070
|
this.handleZoom(e);
|
|
@@ -75298,7 +75326,7 @@
|
|
|
75298
75326
|
this._mapViewData = null;
|
|
75299
75327
|
}
|
|
75300
75328
|
handleZoom(e) {
|
|
75301
|
-
var _a;
|
|
75329
|
+
var _a, _b, _c, _d;
|
|
75302
75330
|
const { scale, scaleCenter } = e;
|
|
75303
75331
|
if (scale === 1) {
|
|
75304
75332
|
return;
|
|
@@ -75312,13 +75340,26 @@
|
|
|
75312
75340
|
}
|
|
75313
75341
|
pathGroup.scale(scale, scale, scaleCenter);
|
|
75314
75342
|
}
|
|
75315
|
-
const
|
|
75316
|
-
if (
|
|
75317
|
-
|
|
75343
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75344
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75345
|
+
labelComponent.renderInner();
|
|
75346
|
+
}
|
|
75347
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75348
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75349
|
+
vgrammarLabel.evaluate(null, null);
|
|
75350
|
+
}
|
|
75351
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75352
|
+
if (labelGroup && scale && scaleCenter) {
|
|
75353
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75354
|
+
labelGroup.setAttributes({
|
|
75355
|
+
postMatrix: new Matrix()
|
|
75356
|
+
});
|
|
75357
|
+
}
|
|
75358
|
+
labelGroup.scale(scale, scale, scaleCenter);
|
|
75318
75359
|
}
|
|
75319
75360
|
}
|
|
75320
75361
|
handlePan(e) {
|
|
75321
|
-
var _a;
|
|
75362
|
+
var _a, _b, _c, _d;
|
|
75322
75363
|
const { delta } = e;
|
|
75323
75364
|
if (delta[0] === 0 && delta[1] === 0) {
|
|
75324
75365
|
return;
|
|
@@ -75332,9 +75373,22 @@
|
|
|
75332
75373
|
}
|
|
75333
75374
|
pathGroup.translate(delta[0], delta[1]);
|
|
75334
75375
|
}
|
|
75335
|
-
const
|
|
75336
|
-
if (
|
|
75337
|
-
|
|
75376
|
+
const labelComponent = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
|
|
75377
|
+
if (labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.renderInner) {
|
|
75378
|
+
labelComponent.renderInner();
|
|
75379
|
+
}
|
|
75380
|
+
const vgrammarLabel = (_b = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getComponent) === null || _b === void 0 ? void 0 : _b.call(labelComponent);
|
|
75381
|
+
if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.evaluate) {
|
|
75382
|
+
vgrammarLabel.evaluate(null, null);
|
|
75383
|
+
}
|
|
75384
|
+
const labelGroup = (_c = labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.getProduct) === null || _c === void 0 ? void 0 : _c.call(labelComponent);
|
|
75385
|
+
if (labelGroup && delta) {
|
|
75386
|
+
if (!((_d = labelGroup.attribute) === null || _d === void 0 ? void 0 : _d.postMatrix)) {
|
|
75387
|
+
labelGroup.setAttributes({
|
|
75388
|
+
postMatrix: new Matrix()
|
|
75389
|
+
});
|
|
75390
|
+
}
|
|
75391
|
+
labelGroup.translate(delta[0], delta[1]);
|
|
75338
75392
|
}
|
|
75339
75393
|
}
|
|
75340
75394
|
getDatumCenter(datum) {
|
|
@@ -89382,7 +89436,7 @@
|
|
|
89382
89436
|
constructor() {
|
|
89383
89437
|
super(...arguments);
|
|
89384
89438
|
this._getDimensionData = (datum) => {
|
|
89385
|
-
if (datum.source) {
|
|
89439
|
+
if (!isNil$1(datum === null || datum === void 0 ? void 0 : datum.source) && !isNil$1(datum === null || datum === void 0 ? void 0 : datum.target)) {
|
|
89386
89440
|
if (isNumber$1(datum.source)) {
|
|
89387
89441
|
const seriesKeys = this.series.getSeriesKeys();
|
|
89388
89442
|
return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
|
|
@@ -96609,19 +96663,31 @@
|
|
|
96609
96663
|
const isMarkInfo = (info) => isValid$1(info) && !isArray$1(info);
|
|
96610
96664
|
const isDimensionInfo = (info) => isValid$1(info) && isArray$1(info);
|
|
96611
96665
|
|
|
96666
|
+
const TOOLTIP_STYLE_THEME_KEYS = [
|
|
96667
|
+
'panel',
|
|
96668
|
+
'shape',
|
|
96669
|
+
'titleLabel',
|
|
96670
|
+
'keyLabel',
|
|
96671
|
+
'valueLabel',
|
|
96672
|
+
'spaceRow',
|
|
96673
|
+
'maxContentHeight',
|
|
96674
|
+
'align'
|
|
96675
|
+
];
|
|
96612
96676
|
class TooltipSpecTransformer extends BaseComponentSpecTransformer {
|
|
96613
96677
|
_shouldMergeThemeToSpec() {
|
|
96614
96678
|
return false;
|
|
96615
96679
|
}
|
|
96616
96680
|
_initTheme(spec, chartSpec) {
|
|
96617
|
-
var _a, _b, _c;
|
|
96618
96681
|
const { spec: newSpec, theme } = super._initTheme(spec, chartSpec);
|
|
96619
|
-
|
|
96620
|
-
|
|
96621
|
-
|
|
96622
|
-
|
|
96623
|
-
|
|
96624
|
-
|
|
96682
|
+
const themeStyle = mergeSpec({}, ...TOOLTIP_STYLE_THEME_KEYS.map(key => ((theme === null || theme === void 0 ? void 0 : theme[key]) !== undefined ? { [key]: theme[key] } : undefined)), theme === null || theme === void 0 ? void 0 : theme.style);
|
|
96683
|
+
const themeSpec = mergeSpec({}, theme);
|
|
96684
|
+
TOOLTIP_STYLE_THEME_KEYS.forEach(key => {
|
|
96685
|
+
delete themeSpec[key];
|
|
96686
|
+
});
|
|
96687
|
+
delete themeSpec.style;
|
|
96688
|
+
const mergedSpec = mergeSpec({}, themeSpec, newSpec);
|
|
96689
|
+
mergedSpec.style = mergeSpec({}, themeStyle, mergedSpec.style);
|
|
96690
|
+
return { spec: mergedSpec, theme };
|
|
96625
96691
|
}
|
|
96626
96692
|
_transformSpecAfterMergingTheme(spec, chartSpec, chartSpecInfo) {
|
|
96627
96693
|
var _a, _b, _c, _d, _e, _f, _g;
|