@visactor/vchart 2.0.9 → 2.0.10-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 +37 -30
- package/build/index.js +37 -30
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/axis/base-axis.js +2 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.js +2 -2
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +3 -3
- package/cjs/component/tooltip/utils/show-tooltip.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/series/base/base-series.js +3 -3
- package/cjs/series/base/base-series.js.map +1 -1
- package/esm/component/axis/base-axis.js +2 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.js +2 -2
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +3 -3
- package/esm/component/tooltip/utils/show-tooltip.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/series/base/base-series.js +3 -3
- package/esm/series/base/base-series.js.map +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -18042,9 +18042,10 @@ let Symbol$1 = class Symbol extends Graphic {
|
|
|
18042
18042
|
}
|
|
18043
18043
|
updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
|
|
18044
18044
|
const {
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
|
|
18045
|
+
size = symbolTheme.size
|
|
18046
|
+
} = attribute,
|
|
18047
|
+
symbolClass = this.getParsedPath();
|
|
18048
|
+
return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
|
|
18048
18049
|
}
|
|
18049
18050
|
needUpdateTags(keys) {
|
|
18050
18051
|
return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
|
|
@@ -18053,8 +18054,9 @@ let Symbol$1 = class Symbol extends Graphic {
|
|
|
18053
18054
|
return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
|
|
18054
18055
|
}
|
|
18055
18056
|
toCustomPath() {
|
|
18056
|
-
const symbolInstance = this.getParsedPath()
|
|
18057
|
-
|
|
18057
|
+
const symbolInstance = this.getParsedPath();
|
|
18058
|
+
if (!symbolInstance) return null;
|
|
18059
|
+
const size = this.attribute.size,
|
|
18058
18060
|
formattedSize = isArray$1(size) ? size : [size, size];
|
|
18059
18061
|
return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
|
|
18060
18062
|
}
|
|
@@ -24019,7 +24021,7 @@ class Stage extends Group$1 {
|
|
|
24019
24021
|
}));
|
|
24020
24022
|
}
|
|
24021
24023
|
enableAutoRefresh() {
|
|
24022
|
-
this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24024
|
+
this.autoRefresh || "node" === this.global.env || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24023
24025
|
}
|
|
24024
24026
|
disableAutoRefresh() {
|
|
24025
24027
|
this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
|
|
@@ -42398,7 +42400,7 @@ const polarAngleAxisDiscreteTicks = (scale, op) => {
|
|
|
42398
42400
|
labelStyle: labelStyle
|
|
42399
42401
|
} = op,
|
|
42400
42402
|
radius = null == getRadius ? void 0 : getRadius();
|
|
42401
|
-
if (!radius) return convertDomainToTickData(scale.domain());
|
|
42403
|
+
if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
|
|
42402
42404
|
let scaleTicks;
|
|
42403
42405
|
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
|
|
42404
42406
|
const range = scale.range(),
|
|
@@ -43579,20 +43581,23 @@ class LabelBase extends AnimateComponent {
|
|
|
43579
43581
|
{
|
|
43580
43582
|
enter: enter
|
|
43581
43583
|
} = this._animationConfig;
|
|
43582
|
-
[text, labelLine].filter(Boolean).forEach(item =>
|
|
43583
|
-
|
|
43584
|
-
|
|
43585
|
-
|
|
43586
|
-
|
|
43587
|
-
|
|
43588
|
-
|
|
43589
|
-
|
|
43590
|
-
|
|
43591
|
-
|
|
43592
|
-
|
|
43593
|
-
|
|
43594
|
-
|
|
43595
|
-
|
|
43584
|
+
[text, labelLine].filter(Boolean).forEach(item => {
|
|
43585
|
+
var _a;
|
|
43586
|
+
null === (_a = item.setFinalAttributes) || void 0 === _a || _a.call(item, item.attribute), item.applyAnimationState(["enter"], [{
|
|
43587
|
+
name: "enter",
|
|
43588
|
+
animation: Object.assign(Object.assign({}, enter), {
|
|
43589
|
+
type: "labelEnter",
|
|
43590
|
+
selfOnly: !0,
|
|
43591
|
+
customParameters: {
|
|
43592
|
+
relatedGraphic: relatedGraphic,
|
|
43593
|
+
relatedGraphics: this._idToGraphic,
|
|
43594
|
+
config: Object.assign(Object.assign({}, enter), {
|
|
43595
|
+
type: item === text ? enter.type : "fadeIn"
|
|
43596
|
+
})
|
|
43597
|
+
}
|
|
43598
|
+
})
|
|
43599
|
+
}]);
|
|
43600
|
+
});
|
|
43596
43601
|
}
|
|
43597
43602
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
43598
43603
|
const {
|
|
@@ -61389,7 +61394,7 @@ const lookup = (data, opt) => {
|
|
|
61389
61394
|
});
|
|
61390
61395
|
};
|
|
61391
61396
|
|
|
61392
|
-
const version = "2.0.
|
|
61397
|
+
const version = "2.0.10-alpha.0";
|
|
61393
61398
|
|
|
61394
61399
|
const addVChartProperty = (data, op) => {
|
|
61395
61400
|
const context = op.beforeCall();
|
|
@@ -62760,7 +62765,7 @@ class BaseSeries extends BaseModel {
|
|
|
62760
62765
|
if (isValid$1(spec.id)) {
|
|
62761
62766
|
mark.setUserId(spec.id);
|
|
62762
62767
|
}
|
|
62763
|
-
if (options.hasAnimation) {
|
|
62768
|
+
if (options.hasAnimation && spec.animation !== false) {
|
|
62764
62769
|
const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
|
|
62765
62770
|
mark.setAnimationConfig(config);
|
|
62766
62771
|
}
|
|
@@ -62770,7 +62775,7 @@ class BaseSeries extends BaseModel {
|
|
|
62770
62775
|
this._createExtensionMark(s, mark, namePrefix, i, options);
|
|
62771
62776
|
});
|
|
62772
62777
|
}
|
|
62773
|
-
|
|
62778
|
+
if (!isNil$1(spec.dataId) || !isNil$1(spec.dataIndex)) {
|
|
62774
62779
|
const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);
|
|
62775
62780
|
if (dataView === this._rawData) {
|
|
62776
62781
|
mark.setData(this._data);
|
|
@@ -66075,7 +66080,7 @@ class AxisComponent extends BaseComponent {
|
|
|
66075
66080
|
_getGridAttributes() {
|
|
66076
66081
|
const spec = this._spec;
|
|
66077
66082
|
return {
|
|
66078
|
-
alternateColor: spec.grid.alternateColor,
|
|
66083
|
+
alternateColor: isFunction$1(spec.grid.alternateColor) ? spec.grid.alternateColor() : spec.grid.alternateColor,
|
|
66079
66084
|
alignWithLabel: spec.grid.alignWithLabel,
|
|
66080
66085
|
style: isFunction$1(spec.grid.style)
|
|
66081
66086
|
? (datum, index) => {
|
|
@@ -66089,7 +66094,9 @@ class AxisComponent extends BaseComponent {
|
|
|
66089
66094
|
: {
|
|
66090
66095
|
type: 'line',
|
|
66091
66096
|
visible: spec.subGrid.visible,
|
|
66092
|
-
alternateColor: spec.subGrid.alternateColor
|
|
66097
|
+
alternateColor: isFunction$1(spec.subGrid.alternateColor)
|
|
66098
|
+
? spec.subGrid.alternateColor()
|
|
66099
|
+
: spec.subGrid.alternateColor,
|
|
66093
66100
|
style: transformToGraphic(spec.subGrid.style)
|
|
66094
66101
|
}
|
|
66095
66102
|
};
|
|
@@ -95117,7 +95124,7 @@ const hasData = (data) => {
|
|
|
95117
95124
|
return Object.keys(data).length > 0;
|
|
95118
95125
|
};
|
|
95119
95126
|
function showTooltip(datum, options, component) {
|
|
95120
|
-
var _a, _b, _c;
|
|
95127
|
+
var _a, _b, _c, _d, _e, _f;
|
|
95121
95128
|
const opt = Object.assign({ regionIndex: 0 }, options);
|
|
95122
95129
|
const componentOptions = component.getOption();
|
|
95123
95130
|
const region = componentOptions.getRegionsInUserIdOrIndex(isValid$1(opt.regionId) ? [opt.regionId] : undefined, isValid$1(opt.regionIndex) ? [opt.regionIndex] : undefined)[0];
|
|
@@ -95200,7 +95207,7 @@ function showTooltip(datum, options, component) {
|
|
|
95200
95207
|
}),
|
|
95201
95208
|
item: undefined
|
|
95202
95209
|
};
|
|
95203
|
-
component.processor.dimension.showTooltip(mockDimensionInfo, mockParams, false);
|
|
95210
|
+
(_e = (_d = (_c = component.processor) === null || _c === void 0 ? void 0 : _c.dimension) === null || _d === void 0 ? void 0 : _d.showTooltip) === null || _e === void 0 ? void 0 : _e.call(_d, mockDimensionInfo, mockParams, false);
|
|
95204
95211
|
const vchart = componentOptions.globalInstance;
|
|
95205
95212
|
if (VChart.globalConfig.uniqueTooltip) {
|
|
95206
95213
|
VChart.hideTooltip(vchart.id);
|
|
@@ -95229,7 +95236,7 @@ function showTooltip(datum, options, component) {
|
|
|
95229
95236
|
changePositionOnly: false,
|
|
95230
95237
|
tooltip: null,
|
|
95231
95238
|
dimensionInfo: mockDimensionInfo,
|
|
95232
|
-
chart: (
|
|
95239
|
+
chart: (_f = componentOptions.globalInstance.getChart()) !== null && _f !== void 0 ? _f : undefined,
|
|
95233
95240
|
datum: mockDatum,
|
|
95234
95241
|
model: info.series,
|
|
95235
95242
|
source: Event_Source_Type.chart,
|
|
@@ -103135,10 +103142,10 @@ class CustomMark extends BaseComponent {
|
|
|
103135
103142
|
if (isValid$1(spec.dataId) || isValidNumber$1(spec.dataIndex)) {
|
|
103136
103143
|
const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
|
|
103137
103144
|
if (dataview) {
|
|
103145
|
+
mark.setDataView(dataview);
|
|
103138
103146
|
dataview.target.addListener('change', () => {
|
|
103139
103147
|
mark.getData().updateData();
|
|
103140
103148
|
});
|
|
103141
|
-
mark.setDataView(dataview);
|
|
103142
103149
|
}
|
|
103143
103150
|
}
|
|
103144
103151
|
}
|
package/build/index.js
CHANGED
|
@@ -18048,9 +18048,10 @@
|
|
|
18048
18048
|
}
|
|
18049
18049
|
updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
|
|
18050
18050
|
const {
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18051
|
+
size = symbolTheme.size
|
|
18052
|
+
} = attribute,
|
|
18053
|
+
symbolClass = this.getParsedPath();
|
|
18054
|
+
return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
|
|
18054
18055
|
}
|
|
18055
18056
|
needUpdateTags(keys) {
|
|
18056
18057
|
return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
|
|
@@ -18059,8 +18060,9 @@
|
|
|
18059
18060
|
return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
|
|
18060
18061
|
}
|
|
18061
18062
|
toCustomPath() {
|
|
18062
|
-
const symbolInstance = this.getParsedPath()
|
|
18063
|
-
|
|
18063
|
+
const symbolInstance = this.getParsedPath();
|
|
18064
|
+
if (!symbolInstance) return null;
|
|
18065
|
+
const size = this.attribute.size,
|
|
18064
18066
|
formattedSize = isArray$1(size) ? size : [size, size];
|
|
18065
18067
|
return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
|
|
18066
18068
|
}
|
|
@@ -24025,7 +24027,7 @@
|
|
|
24025
24027
|
}));
|
|
24026
24028
|
}
|
|
24027
24029
|
enableAutoRefresh() {
|
|
24028
|
-
this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24030
|
+
this.autoRefresh || "node" === this.global.env || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24029
24031
|
}
|
|
24030
24032
|
disableAutoRefresh() {
|
|
24031
24033
|
this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
|
|
@@ -42404,7 +42406,7 @@
|
|
|
42404
42406
|
labelStyle: labelStyle
|
|
42405
42407
|
} = op,
|
|
42406
42408
|
radius = null == getRadius ? void 0 : getRadius();
|
|
42407
|
-
if (!radius) return convertDomainToTickData(scale.domain());
|
|
42409
|
+
if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
|
|
42408
42410
|
let scaleTicks;
|
|
42409
42411
|
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
|
|
42410
42412
|
const range = scale.range(),
|
|
@@ -43585,20 +43587,23 @@
|
|
|
43585
43587
|
{
|
|
43586
43588
|
enter: enter
|
|
43587
43589
|
} = this._animationConfig;
|
|
43588
|
-
[text, labelLine].filter(Boolean).forEach(item =>
|
|
43589
|
-
|
|
43590
|
-
|
|
43591
|
-
|
|
43592
|
-
|
|
43593
|
-
|
|
43594
|
-
|
|
43595
|
-
|
|
43596
|
-
|
|
43597
|
-
|
|
43598
|
-
|
|
43599
|
-
|
|
43600
|
-
|
|
43601
|
-
|
|
43590
|
+
[text, labelLine].filter(Boolean).forEach(item => {
|
|
43591
|
+
var _a;
|
|
43592
|
+
null === (_a = item.setFinalAttributes) || void 0 === _a || _a.call(item, item.attribute), item.applyAnimationState(["enter"], [{
|
|
43593
|
+
name: "enter",
|
|
43594
|
+
animation: Object.assign(Object.assign({}, enter), {
|
|
43595
|
+
type: "labelEnter",
|
|
43596
|
+
selfOnly: !0,
|
|
43597
|
+
customParameters: {
|
|
43598
|
+
relatedGraphic: relatedGraphic,
|
|
43599
|
+
relatedGraphics: this._idToGraphic,
|
|
43600
|
+
config: Object.assign(Object.assign({}, enter), {
|
|
43601
|
+
type: item === text ? enter.type : "fadeIn"
|
|
43602
|
+
})
|
|
43603
|
+
}
|
|
43604
|
+
})
|
|
43605
|
+
}]);
|
|
43606
|
+
});
|
|
43602
43607
|
}
|
|
43603
43608
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
43604
43609
|
const {
|
|
@@ -61395,7 +61400,7 @@
|
|
|
61395
61400
|
});
|
|
61396
61401
|
};
|
|
61397
61402
|
|
|
61398
|
-
const version = "2.0.
|
|
61403
|
+
const version = "2.0.10-alpha.0";
|
|
61399
61404
|
|
|
61400
61405
|
const addVChartProperty = (data, op) => {
|
|
61401
61406
|
const context = op.beforeCall();
|
|
@@ -62766,7 +62771,7 @@
|
|
|
62766
62771
|
if (isValid$1(spec.id)) {
|
|
62767
62772
|
mark.setUserId(spec.id);
|
|
62768
62773
|
}
|
|
62769
|
-
if (options.hasAnimation) {
|
|
62774
|
+
if (options.hasAnimation && spec.animation !== false) {
|
|
62770
62775
|
const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
|
|
62771
62776
|
mark.setAnimationConfig(config);
|
|
62772
62777
|
}
|
|
@@ -62776,7 +62781,7 @@
|
|
|
62776
62781
|
this._createExtensionMark(s, mark, namePrefix, i, options);
|
|
62777
62782
|
});
|
|
62778
62783
|
}
|
|
62779
|
-
|
|
62784
|
+
if (!isNil$1(spec.dataId) || !isNil$1(spec.dataIndex)) {
|
|
62780
62785
|
const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);
|
|
62781
62786
|
if (dataView === this._rawData) {
|
|
62782
62787
|
mark.setData(this._data);
|
|
@@ -66081,7 +66086,7 @@
|
|
|
66081
66086
|
_getGridAttributes() {
|
|
66082
66087
|
const spec = this._spec;
|
|
66083
66088
|
return {
|
|
66084
|
-
alternateColor: spec.grid.alternateColor,
|
|
66089
|
+
alternateColor: isFunction$1(spec.grid.alternateColor) ? spec.grid.alternateColor() : spec.grid.alternateColor,
|
|
66085
66090
|
alignWithLabel: spec.grid.alignWithLabel,
|
|
66086
66091
|
style: isFunction$1(spec.grid.style)
|
|
66087
66092
|
? (datum, index) => {
|
|
@@ -66095,7 +66100,9 @@
|
|
|
66095
66100
|
: {
|
|
66096
66101
|
type: 'line',
|
|
66097
66102
|
visible: spec.subGrid.visible,
|
|
66098
|
-
alternateColor: spec.subGrid.alternateColor
|
|
66103
|
+
alternateColor: isFunction$1(spec.subGrid.alternateColor)
|
|
66104
|
+
? spec.subGrid.alternateColor()
|
|
66105
|
+
: spec.subGrid.alternateColor,
|
|
66099
66106
|
style: transformToGraphic(spec.subGrid.style)
|
|
66100
66107
|
}
|
|
66101
66108
|
};
|
|
@@ -95123,7 +95130,7 @@
|
|
|
95123
95130
|
return Object.keys(data).length > 0;
|
|
95124
95131
|
};
|
|
95125
95132
|
function showTooltip(datum, options, component) {
|
|
95126
|
-
var _a, _b, _c;
|
|
95133
|
+
var _a, _b, _c, _d, _e, _f;
|
|
95127
95134
|
const opt = Object.assign({ regionIndex: 0 }, options);
|
|
95128
95135
|
const componentOptions = component.getOption();
|
|
95129
95136
|
const region = componentOptions.getRegionsInUserIdOrIndex(isValid$1(opt.regionId) ? [opt.regionId] : undefined, isValid$1(opt.regionIndex) ? [opt.regionIndex] : undefined)[0];
|
|
@@ -95206,7 +95213,7 @@
|
|
|
95206
95213
|
}),
|
|
95207
95214
|
item: undefined
|
|
95208
95215
|
};
|
|
95209
|
-
component.processor.dimension.showTooltip(mockDimensionInfo, mockParams, false);
|
|
95216
|
+
(_e = (_d = (_c = component.processor) === null || _c === void 0 ? void 0 : _c.dimension) === null || _d === void 0 ? void 0 : _d.showTooltip) === null || _e === void 0 ? void 0 : _e.call(_d, mockDimensionInfo, mockParams, false);
|
|
95210
95217
|
const vchart = componentOptions.globalInstance;
|
|
95211
95218
|
if (VChart.globalConfig.uniqueTooltip) {
|
|
95212
95219
|
VChart.hideTooltip(vchart.id);
|
|
@@ -95235,7 +95242,7 @@
|
|
|
95235
95242
|
changePositionOnly: false,
|
|
95236
95243
|
tooltip: null,
|
|
95237
95244
|
dimensionInfo: mockDimensionInfo,
|
|
95238
|
-
chart: (
|
|
95245
|
+
chart: (_f = componentOptions.globalInstance.getChart()) !== null && _f !== void 0 ? _f : undefined,
|
|
95239
95246
|
datum: mockDatum,
|
|
95240
95247
|
model: info.series,
|
|
95241
95248
|
source: Event_Source_Type.chart,
|
|
@@ -103141,10 +103148,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103141
103148
|
if (isValid$1(spec.dataId) || isValidNumber$1(spec.dataIndex)) {
|
|
103142
103149
|
const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
|
|
103143
103150
|
if (dataview) {
|
|
103151
|
+
mark.setDataView(dataview);
|
|
103144
103152
|
dataview.target.addListener('change', () => {
|
|
103145
103153
|
mark.getData().updateData();
|
|
103146
103154
|
});
|
|
103147
|
-
mark.setDataView(dataview);
|
|
103148
103155
|
}
|
|
103149
103156
|
}
|
|
103150
103157
|
}
|