@visactor/vchart 2.1.0-alpha.6 → 2.1.0-alpha.7
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 +51 -19
- package/build/index.js +51 -19
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +17 -13
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/component/index.js +2 -1
- package/cjs/component/marker/base-marker.js +16 -6
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +19 -6
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/constant/attribute.js +1 -2
- package/cjs/constant/scatter.js +2 -1
- package/cjs/constant/waterfall.js +1 -2
- package/cjs/core/expression-function.js +1 -1
- package/cjs/core/factory.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/data/data-view-utils.js +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +16 -13
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/component/index.js +2 -1
- package/esm/component/marker/base-marker.js +16 -6
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +19 -6
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/constant/attribute.js +1 -2
- package/esm/constant/scatter.js +2 -1
- package/esm/constant/waterfall.js +1 -2
- package/esm/core/expression-function.js +1 -1
- package/esm/core/factory.js +1 -1
- package/esm/core/index.js +1 -1
- package/esm/data/data-view-utils.js +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/package.json +5 -5
package/build/index.es.js
CHANGED
|
@@ -75977,17 +75977,10 @@ const MARKER_COMPONENT_SPEC_KEYS = {
|
|
|
75977
75977
|
[ComponentTypeEnum.markArea]: true
|
|
75978
75978
|
};
|
|
75979
75979
|
const MARKER_ADDITION_REMAKE_SPEC_KEYS = {
|
|
75980
|
-
autoRange: true,
|
|
75981
75980
|
regionId: true,
|
|
75982
75981
|
regionIndex: true,
|
|
75983
75982
|
seriesId: true,
|
|
75984
75983
|
seriesIndex: true,
|
|
75985
|
-
relativeSeriesId: true,
|
|
75986
|
-
relativeSeriesIndex: true,
|
|
75987
|
-
startRelativeSeriesId: true,
|
|
75988
|
-
startRelativeSeriesIndex: true,
|
|
75989
|
-
endRelativeSeriesId: true,
|
|
75990
|
-
endRelativeSeriesIndex: true,
|
|
75991
75984
|
specifiedDataSeriesId: true,
|
|
75992
75985
|
specifiedDataSeriesIndex: true
|
|
75993
75986
|
};
|
|
@@ -76166,10 +76159,14 @@ class BaseChart extends CompilableBase {
|
|
|
76166
76159
|
return this._components.filter(c => c.type === type);
|
|
76167
76160
|
};
|
|
76168
76161
|
this._isMarkerAdditionSpecSafeWithoutRemake = (spec) => {
|
|
76169
|
-
if (!spec || typeof spec !== 'object'
|
|
76162
|
+
if (!spec || typeof spec !== 'object') {
|
|
76170
76163
|
return false;
|
|
76171
76164
|
}
|
|
76172
|
-
|
|
76165
|
+
const markerSpec = spec;
|
|
76166
|
+
if (markerSpec.visible === false) {
|
|
76167
|
+
return false;
|
|
76168
|
+
}
|
|
76169
|
+
return !Object.keys(MARKER_ADDITION_REMAKE_SPEC_KEYS).some(key => !isNil$1(markerSpec[key]));
|
|
76173
76170
|
};
|
|
76174
76171
|
this._paddingSpec = normalizeLayoutPaddingSpec((_a = spec.padding) !== null && _a !== void 0 ? _a : option.getTheme('padding'));
|
|
76175
76172
|
this._event = new Event$1(option.eventDispatcher, option.mode);
|
|
@@ -76790,6 +76787,9 @@ class BaseChart extends CompilableBase {
|
|
|
76790
76787
|
}
|
|
76791
76788
|
return nextSpec.slice(currentSpec.length).every(this._isMarkerAdditionSpecSafeWithoutRemake);
|
|
76792
76789
|
}
|
|
76790
|
+
_isAutoRangeMarkerSpec(spec) {
|
|
76791
|
+
return !!spec && typeof spec === 'object' && spec.autoRange === true;
|
|
76792
|
+
}
|
|
76793
76793
|
_canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
76794
76794
|
return (MARKER_COMPONENT_SPEC_KEYS[key] &&
|
|
76795
76795
|
isArray$1(currentSpec) &&
|
|
@@ -76916,6 +76916,7 @@ class BaseChart extends CompilableBase {
|
|
|
76916
76916
|
_createMissingMarkerComponentsForSpecs(result, componentCache) {
|
|
76917
76917
|
var _a;
|
|
76918
76918
|
let createdCount = 0;
|
|
76919
|
+
let hasAutoRangeMarker = false;
|
|
76919
76920
|
(_a = this._specTransformer) === null || _a === void 0 ? void 0 : _a.forEachComponentInSpec(this._spec, (constructor, specInfo) => {
|
|
76920
76921
|
if (result.reMake) {
|
|
76921
76922
|
return;
|
|
@@ -76933,12 +76934,13 @@ class BaseChart extends CompilableBase {
|
|
|
76933
76934
|
componentCache[compSpecKey].componentCount++;
|
|
76934
76935
|
}
|
|
76935
76936
|
createdCount++;
|
|
76937
|
+
hasAutoRangeMarker = hasAutoRangeMarker || this._isAutoRangeMarkerSpec(specInfo.spec);
|
|
76936
76938
|
}, this._option.getSpecInfo());
|
|
76937
76939
|
if (!createdCount) {
|
|
76938
76940
|
return;
|
|
76939
76941
|
}
|
|
76940
76942
|
result.change = true;
|
|
76941
|
-
result.effects = Object.assign(Object.assign({}, result.effects), { component: true, layout: true, render: true });
|
|
76943
|
+
result.effects = Object.assign(Object.assign(Object.assign(Object.assign({}, result.effects), { component: true }), (hasAutoRangeMarker ? { scaleDomain: true } : null)), { layout: true, render: true });
|
|
76942
76944
|
}
|
|
76943
76945
|
_removeMarkerComponentsForEmptySpecs(result) {
|
|
76944
76946
|
const removedComponents = this._components.filter(component => {
|
|
@@ -107886,6 +107888,7 @@ const MARKER_FORMAT_METHOD_PLACEHOLDER = '__vchart_marker_format_method__';
|
|
|
107886
107888
|
const MARKER_COORDINATE_PLACEHOLDER = '__vchart_marker_coordinate__';
|
|
107887
107889
|
const MARKER_TEXT_PLACEHOLDER = '__vchart_marker_text__';
|
|
107888
107890
|
const MARKER_AUTO_RANGE_PLACEHOLDER = '__vchart_marker_auto_range__';
|
|
107891
|
+
const MARKER_STYLE_PLACEHOLDER = '__vchart_marker_style__';
|
|
107889
107892
|
const MARKER_DOMAIN_POSITION_SPEC_KEYS = [
|
|
107890
107893
|
'coordinate',
|
|
107891
107894
|
'coordinates',
|
|
@@ -107911,6 +107914,24 @@ const normalizeMarkerLabelFormatMethod = (label) => {
|
|
|
107911
107914
|
}
|
|
107912
107915
|
return Object.assign(Object.assign({}, label), { formatMethod: MARKER_FORMAT_METHOD_PLACEHOLDER });
|
|
107913
107916
|
};
|
|
107917
|
+
const normalizeMarkerStyles = (value) => {
|
|
107918
|
+
if (Array.isArray(value)) {
|
|
107919
|
+
return value.map(normalizeMarkerStyles);
|
|
107920
|
+
}
|
|
107921
|
+
if (!value || typeof value !== 'object') {
|
|
107922
|
+
return value;
|
|
107923
|
+
}
|
|
107924
|
+
const normalized = Object.assign({}, value);
|
|
107925
|
+
Object.keys(normalized).forEach(key => {
|
|
107926
|
+
if (key === 'style' || key.endsWith('Style')) {
|
|
107927
|
+
normalized[key] = MARKER_STYLE_PLACEHOLDER;
|
|
107928
|
+
}
|
|
107929
|
+
else {
|
|
107930
|
+
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
107931
|
+
}
|
|
107932
|
+
});
|
|
107933
|
+
return normalized;
|
|
107934
|
+
};
|
|
107914
107935
|
const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
107915
107936
|
var _a;
|
|
107916
107937
|
if (!spec || typeof spec !== 'object') {
|
|
@@ -107919,9 +107940,7 @@ const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
|
107919
107940
|
const normalized = Object.assign({}, spec);
|
|
107920
107941
|
if (options.normalizeDomainPosition) {
|
|
107921
107942
|
MARKER_DOMAIN_POSITION_SPEC_KEYS.forEach(key => {
|
|
107922
|
-
|
|
107923
|
-
normalized[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
107924
|
-
}
|
|
107943
|
+
normalized[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
107925
107944
|
});
|
|
107926
107945
|
}
|
|
107927
107946
|
if (options.normalizeAutoRange && 'autoRange' in normalized) {
|
|
@@ -107935,6 +107954,9 @@ const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
|
107935
107954
|
if ('label' in normalized) {
|
|
107936
107955
|
normalized.label = normalizeMarkerLabelFormatMethod(normalized.label);
|
|
107937
107956
|
}
|
|
107957
|
+
Object.keys(normalized).forEach(key => {
|
|
107958
|
+
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
107959
|
+
});
|
|
107938
107960
|
const text = (_a = normalized.itemContent) === null || _a === void 0 ? void 0 : _a.text;
|
|
107939
107961
|
if (text && typeof text === 'object') {
|
|
107940
107962
|
normalized.itemContent = Object.assign(Object.assign({}, normalized.itemContent), { text: Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), { text: MARKER_TEXT_PLACEHOLDER }) });
|
|
@@ -108192,6 +108214,7 @@ class BaseMarker extends BaseComponent {
|
|
|
108192
108214
|
}
|
|
108193
108215
|
reInit(spec) {
|
|
108194
108216
|
super.reInit(spec);
|
|
108217
|
+
this._releaseMarkerData();
|
|
108195
108218
|
this._bindSeries();
|
|
108196
108219
|
this._initDataView();
|
|
108197
108220
|
this._buildMarkerAttributeContext();
|
|
@@ -110454,7 +110477,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110454
110477
|
return markPoint;
|
|
110455
110478
|
}
|
|
110456
110479
|
_markerLayout() {
|
|
110457
|
-
var _a, _b, _c, _d, _e, _f;
|
|
110480
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
110458
110481
|
const spec = this._spec;
|
|
110459
110482
|
const data = this._markerData;
|
|
110460
110483
|
const relativeSeries = this._relativeSeries;
|
|
@@ -110465,8 +110488,16 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110465
110488
|
? data.latestData[0].latestData
|
|
110466
110489
|
: data.latestData
|
|
110467
110490
|
: seriesData;
|
|
110491
|
+
const { itemLine = {}, itemContent = {} } = this._spec;
|
|
110492
|
+
const { visible: itemLineVisible, line = {} } = itemLine, restItemLine = __rest$f(itemLine, ["visible", "line"]);
|
|
110493
|
+
const itemLineAttrs = itemLineVisible !== false
|
|
110494
|
+
? Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) })
|
|
110495
|
+
: {
|
|
110496
|
+
visible: false
|
|
110497
|
+
};
|
|
110498
|
+
const labelAttrs = transformLabelAttributes(Object.assign(Object.assign({}, itemContent.text), { style: merge$1({ dx: 0, dy: 0 }, (_b = (_a = itemContent.text) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : itemContent.style) }), data, this._markAttributeContext);
|
|
110468
110499
|
let limitRect;
|
|
110469
|
-
if (spec.clip || ((
|
|
110500
|
+
if (spec.clip || ((_c = spec.itemContent) === null || _c === void 0 ? void 0 : _c.confine)) {
|
|
110470
110501
|
const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);
|
|
110471
110502
|
limitRect = {
|
|
110472
110503
|
x: minX,
|
|
@@ -110476,17 +110507,18 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110476
110507
|
};
|
|
110477
110508
|
}
|
|
110478
110509
|
if (this._markerComponent) {
|
|
110479
|
-
const attribute = (
|
|
110480
|
-
const textStyle = (
|
|
110481
|
-
const specText = (
|
|
110510
|
+
const attribute = (_d = this._markerComponent.attribute) !== null && _d !== void 0 ? _d : {};
|
|
110511
|
+
const textStyle = (_f = (_e = attribute.itemContent) === null || _e === void 0 ? void 0 : _e.textStyle) !== null && _f !== void 0 ? _f : {};
|
|
110512
|
+
const specText = (_g = this._spec.itemContent.text) === null || _g === void 0 ? void 0 : _g.text;
|
|
110482
110513
|
this._markerComponent.setAttributes({
|
|
110483
110514
|
position: point === undefined ? { x: null, y: null } : point,
|
|
110484
|
-
itemContent: Object.assign(Object.assign({}, attribute.itemContent), { textStyle: Object.assign(Object.assign({}, textStyle), { text: ((
|
|
110515
|
+
itemContent: Object.assign(Object.assign({}, attribute.itemContent), { panel: (_h = labelAttrs.panel) !== null && _h !== void 0 ? _h : (_j = attribute.itemContent) === null || _j === void 0 ? void 0 : _j.panel, padding: (_k = labelAttrs.padding) !== null && _k !== void 0 ? _k : (_l = attribute.itemContent) === null || _l === void 0 ? void 0 : _l.padding, textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), ((_m = labelAttrs.textStyle) !== null && _m !== void 0 ? _m : {})), { text: ((_o = this._spec.itemContent.text) === null || _o === void 0 ? void 0 : _o.formatMethod)
|
|
110485
110516
|
?
|
|
110486
110517
|
this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
|
|
110487
110518
|
: isValid$1(specText)
|
|
110488
110519
|
? specText
|
|
110489
110520
|
: textStyle.text }), offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()), offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion()) }),
|
|
110521
|
+
itemLine: itemLineAttrs,
|
|
110490
110522
|
limitRect,
|
|
110491
110523
|
dx: this._layoutOffsetX,
|
|
110492
110524
|
dy: this._layoutOffsetY
|
package/build/index.js
CHANGED
|
@@ -75983,17 +75983,10 @@
|
|
|
75983
75983
|
[ComponentTypeEnum.markArea]: true
|
|
75984
75984
|
};
|
|
75985
75985
|
const MARKER_ADDITION_REMAKE_SPEC_KEYS = {
|
|
75986
|
-
autoRange: true,
|
|
75987
75986
|
regionId: true,
|
|
75988
75987
|
regionIndex: true,
|
|
75989
75988
|
seriesId: true,
|
|
75990
75989
|
seriesIndex: true,
|
|
75991
|
-
relativeSeriesId: true,
|
|
75992
|
-
relativeSeriesIndex: true,
|
|
75993
|
-
startRelativeSeriesId: true,
|
|
75994
|
-
startRelativeSeriesIndex: true,
|
|
75995
|
-
endRelativeSeriesId: true,
|
|
75996
|
-
endRelativeSeriesIndex: true,
|
|
75997
75990
|
specifiedDataSeriesId: true,
|
|
75998
75991
|
specifiedDataSeriesIndex: true
|
|
75999
75992
|
};
|
|
@@ -76172,10 +76165,14 @@
|
|
|
76172
76165
|
return this._components.filter(c => c.type === type);
|
|
76173
76166
|
};
|
|
76174
76167
|
this._isMarkerAdditionSpecSafeWithoutRemake = (spec) => {
|
|
76175
|
-
if (!spec || typeof spec !== 'object'
|
|
76168
|
+
if (!spec || typeof spec !== 'object') {
|
|
76176
76169
|
return false;
|
|
76177
76170
|
}
|
|
76178
|
-
|
|
76171
|
+
const markerSpec = spec;
|
|
76172
|
+
if (markerSpec.visible === false) {
|
|
76173
|
+
return false;
|
|
76174
|
+
}
|
|
76175
|
+
return !Object.keys(MARKER_ADDITION_REMAKE_SPEC_KEYS).some(key => !isNil$1(markerSpec[key]));
|
|
76179
76176
|
};
|
|
76180
76177
|
this._paddingSpec = normalizeLayoutPaddingSpec((_a = spec.padding) !== null && _a !== void 0 ? _a : option.getTheme('padding'));
|
|
76181
76178
|
this._event = new Event$1(option.eventDispatcher, option.mode);
|
|
@@ -76796,6 +76793,9 @@
|
|
|
76796
76793
|
}
|
|
76797
76794
|
return nextSpec.slice(currentSpec.length).every(this._isMarkerAdditionSpecSafeWithoutRemake);
|
|
76798
76795
|
}
|
|
76796
|
+
_isAutoRangeMarkerSpec(spec) {
|
|
76797
|
+
return !!spec && typeof spec === 'object' && spec.autoRange === true;
|
|
76798
|
+
}
|
|
76799
76799
|
_canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
76800
76800
|
return (MARKER_COMPONENT_SPEC_KEYS[key] &&
|
|
76801
76801
|
isArray$1(currentSpec) &&
|
|
@@ -76922,6 +76922,7 @@
|
|
|
76922
76922
|
_createMissingMarkerComponentsForSpecs(result, componentCache) {
|
|
76923
76923
|
var _a;
|
|
76924
76924
|
let createdCount = 0;
|
|
76925
|
+
let hasAutoRangeMarker = false;
|
|
76925
76926
|
(_a = this._specTransformer) === null || _a === void 0 ? void 0 : _a.forEachComponentInSpec(this._spec, (constructor, specInfo) => {
|
|
76926
76927
|
if (result.reMake) {
|
|
76927
76928
|
return;
|
|
@@ -76939,12 +76940,13 @@
|
|
|
76939
76940
|
componentCache[compSpecKey].componentCount++;
|
|
76940
76941
|
}
|
|
76941
76942
|
createdCount++;
|
|
76943
|
+
hasAutoRangeMarker = hasAutoRangeMarker || this._isAutoRangeMarkerSpec(specInfo.spec);
|
|
76942
76944
|
}, this._option.getSpecInfo());
|
|
76943
76945
|
if (!createdCount) {
|
|
76944
76946
|
return;
|
|
76945
76947
|
}
|
|
76946
76948
|
result.change = true;
|
|
76947
|
-
result.effects = Object.assign(Object.assign({}, result.effects), { component: true, layout: true, render: true });
|
|
76949
|
+
result.effects = Object.assign(Object.assign(Object.assign(Object.assign({}, result.effects), { component: true }), (hasAutoRangeMarker ? { scaleDomain: true } : null)), { layout: true, render: true });
|
|
76948
76950
|
}
|
|
76949
76951
|
_removeMarkerComponentsForEmptySpecs(result) {
|
|
76950
76952
|
const removedComponents = this._components.filter(component => {
|
|
@@ -107892,6 +107894,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
107892
107894
|
const MARKER_COORDINATE_PLACEHOLDER = '__vchart_marker_coordinate__';
|
|
107893
107895
|
const MARKER_TEXT_PLACEHOLDER = '__vchart_marker_text__';
|
|
107894
107896
|
const MARKER_AUTO_RANGE_PLACEHOLDER = '__vchart_marker_auto_range__';
|
|
107897
|
+
const MARKER_STYLE_PLACEHOLDER = '__vchart_marker_style__';
|
|
107895
107898
|
const MARKER_DOMAIN_POSITION_SPEC_KEYS = [
|
|
107896
107899
|
'coordinate',
|
|
107897
107900
|
'coordinates',
|
|
@@ -107917,6 +107920,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
107917
107920
|
}
|
|
107918
107921
|
return Object.assign(Object.assign({}, label), { formatMethod: MARKER_FORMAT_METHOD_PLACEHOLDER });
|
|
107919
107922
|
};
|
|
107923
|
+
const normalizeMarkerStyles = (value) => {
|
|
107924
|
+
if (Array.isArray(value)) {
|
|
107925
|
+
return value.map(normalizeMarkerStyles);
|
|
107926
|
+
}
|
|
107927
|
+
if (!value || typeof value !== 'object') {
|
|
107928
|
+
return value;
|
|
107929
|
+
}
|
|
107930
|
+
const normalized = Object.assign({}, value);
|
|
107931
|
+
Object.keys(normalized).forEach(key => {
|
|
107932
|
+
if (key === 'style' || key.endsWith('Style')) {
|
|
107933
|
+
normalized[key] = MARKER_STYLE_PLACEHOLDER;
|
|
107934
|
+
}
|
|
107935
|
+
else {
|
|
107936
|
+
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
107937
|
+
}
|
|
107938
|
+
});
|
|
107939
|
+
return normalized;
|
|
107940
|
+
};
|
|
107920
107941
|
const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
107921
107942
|
var _a;
|
|
107922
107943
|
if (!spec || typeof spec !== 'object') {
|
|
@@ -107925,9 +107946,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
107925
107946
|
const normalized = Object.assign({}, spec);
|
|
107926
107947
|
if (options.normalizeDomainPosition) {
|
|
107927
107948
|
MARKER_DOMAIN_POSITION_SPEC_KEYS.forEach(key => {
|
|
107928
|
-
|
|
107929
|
-
normalized[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
107930
|
-
}
|
|
107949
|
+
normalized[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
107931
107950
|
});
|
|
107932
107951
|
}
|
|
107933
107952
|
if (options.normalizeAutoRange && 'autoRange' in normalized) {
|
|
@@ -107941,6 +107960,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
107941
107960
|
if ('label' in normalized) {
|
|
107942
107961
|
normalized.label = normalizeMarkerLabelFormatMethod(normalized.label);
|
|
107943
107962
|
}
|
|
107963
|
+
Object.keys(normalized).forEach(key => {
|
|
107964
|
+
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
107965
|
+
});
|
|
107944
107966
|
const text = (_a = normalized.itemContent) === null || _a === void 0 ? void 0 : _a.text;
|
|
107945
107967
|
if (text && typeof text === 'object') {
|
|
107946
107968
|
normalized.itemContent = Object.assign(Object.assign({}, normalized.itemContent), { text: Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), { text: MARKER_TEXT_PLACEHOLDER }) });
|
|
@@ -108198,6 +108220,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
108198
108220
|
}
|
|
108199
108221
|
reInit(spec) {
|
|
108200
108222
|
super.reInit(spec);
|
|
108223
|
+
this._releaseMarkerData();
|
|
108201
108224
|
this._bindSeries();
|
|
108202
108225
|
this._initDataView();
|
|
108203
108226
|
this._buildMarkerAttributeContext();
|
|
@@ -110460,7 +110483,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110460
110483
|
return markPoint;
|
|
110461
110484
|
}
|
|
110462
110485
|
_markerLayout() {
|
|
110463
|
-
var _a, _b, _c, _d, _e, _f;
|
|
110486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
110464
110487
|
const spec = this._spec;
|
|
110465
110488
|
const data = this._markerData;
|
|
110466
110489
|
const relativeSeries = this._relativeSeries;
|
|
@@ -110471,8 +110494,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110471
110494
|
? data.latestData[0].latestData
|
|
110472
110495
|
: data.latestData
|
|
110473
110496
|
: seriesData;
|
|
110497
|
+
const { itemLine = {}, itemContent = {} } = this._spec;
|
|
110498
|
+
const { visible: itemLineVisible, line = {} } = itemLine, restItemLine = __rest$f(itemLine, ["visible", "line"]);
|
|
110499
|
+
const itemLineAttrs = itemLineVisible !== false
|
|
110500
|
+
? Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) })
|
|
110501
|
+
: {
|
|
110502
|
+
visible: false
|
|
110503
|
+
};
|
|
110504
|
+
const labelAttrs = transformLabelAttributes(Object.assign(Object.assign({}, itemContent.text), { style: merge$1({ dx: 0, dy: 0 }, (_b = (_a = itemContent.text) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : itemContent.style) }), data, this._markAttributeContext);
|
|
110474
110505
|
let limitRect;
|
|
110475
|
-
if (spec.clip || ((
|
|
110506
|
+
if (spec.clip || ((_c = spec.itemContent) === null || _c === void 0 ? void 0 : _c.confine)) {
|
|
110476
110507
|
const { minX, maxX, minY, maxY } = computeClipRange([relativeSeries.getRegion()]);
|
|
110477
110508
|
limitRect = {
|
|
110478
110509
|
x: minX,
|
|
@@ -110482,17 +110513,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110482
110513
|
};
|
|
110483
110514
|
}
|
|
110484
110515
|
if (this._markerComponent) {
|
|
110485
|
-
const attribute = (
|
|
110486
|
-
const textStyle = (
|
|
110487
|
-
const specText = (
|
|
110516
|
+
const attribute = (_d = this._markerComponent.attribute) !== null && _d !== void 0 ? _d : {};
|
|
110517
|
+
const textStyle = (_f = (_e = attribute.itemContent) === null || _e === void 0 ? void 0 : _e.textStyle) !== null && _f !== void 0 ? _f : {};
|
|
110518
|
+
const specText = (_g = this._spec.itemContent.text) === null || _g === void 0 ? void 0 : _g.text;
|
|
110488
110519
|
this._markerComponent.setAttributes({
|
|
110489
110520
|
position: point === undefined ? { x: null, y: null } : point,
|
|
110490
|
-
itemContent: Object.assign(Object.assign({}, attribute.itemContent), { textStyle: Object.assign(Object.assign({}, textStyle), { text: ((
|
|
110521
|
+
itemContent: Object.assign(Object.assign({}, attribute.itemContent), { panel: (_h = labelAttrs.panel) !== null && _h !== void 0 ? _h : (_j = attribute.itemContent) === null || _j === void 0 ? void 0 : _j.panel, padding: (_k = labelAttrs.padding) !== null && _k !== void 0 ? _k : (_l = attribute.itemContent) === null || _l === void 0 ? void 0 : _l.padding, textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), ((_m = labelAttrs.textStyle) !== null && _m !== void 0 ? _m : {})), { text: ((_o = this._spec.itemContent.text) === null || _o === void 0 ? void 0 : _o.formatMethod)
|
|
110491
110522
|
?
|
|
110492
110523
|
this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
|
|
110493
110524
|
: isValid$1(specText)
|
|
110494
110525
|
? specText
|
|
110495
110526
|
: textStyle.text }), offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()), offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion()) }),
|
|
110527
|
+
itemLine: itemLineAttrs,
|
|
110496
110528
|
limitRect,
|
|
110497
110529
|
dx: this._layoutOffsetX,
|
|
110498
110530
|
dy: this._layoutOffsetY
|