@visactor/vchart 2.1.0-alpha.10 → 2.1.0-alpha.11
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 +19 -6
- package/build/index.js +19 -6
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/index.js +1 -1
- package/cjs/chart/stack.js +1 -1
- package/cjs/chart/util.js +1 -1
- package/cjs/component/index.js +2 -1
- package/cjs/component/marker/base-marker.js +11 -7
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +8 -7
- 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/core/instance-manager.js +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.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/index.js +1 -1
- package/esm/chart/stack.js +1 -1
- package/esm/chart/util.js +1 -1
- package/esm/component/index.js +2 -1
- package/esm/component/marker/base-marker.js +11 -7
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +7 -7
- 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/core/instance-manager.js +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.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 +4 -4
package/build/index.es.js
CHANGED
|
@@ -108171,6 +108171,7 @@ const MARKER_DOMAIN_POSITION_SPEC_KEYS = [
|
|
|
108171
108171
|
'radius1'
|
|
108172
108172
|
];
|
|
108173
108173
|
const MARKER_LAYOUT_POSITION_SPEC_KEYS = ['position', 'positions', 'coordinatesOffset', 'regionRelative'];
|
|
108174
|
+
const MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS = ['offsetX', 'offsetY', 'confine'];
|
|
108174
108175
|
const normalizeMarkerLabelFormatMethod = (label) => {
|
|
108175
108176
|
if (Array.isArray(label)) {
|
|
108176
108177
|
return label.map(normalizeMarkerLabelFormatMethod);
|
|
@@ -108202,7 +108203,6 @@ const normalizeMarkerStyles = (value) => {
|
|
|
108202
108203
|
return normalized;
|
|
108203
108204
|
};
|
|
108204
108205
|
const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
108205
|
-
var _a;
|
|
108206
108206
|
if (!spec || typeof spec !== 'object') {
|
|
108207
108207
|
return spec;
|
|
108208
108208
|
}
|
|
@@ -108226,9 +108226,18 @@ const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
|
108226
108226
|
Object.keys(normalized).forEach(key => {
|
|
108227
108227
|
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
108228
108228
|
});
|
|
108229
|
-
const
|
|
108230
|
-
if (
|
|
108231
|
-
normalized.itemContent = Object.assign(
|
|
108229
|
+
const itemContent = normalized.itemContent;
|
|
108230
|
+
if (itemContent && typeof itemContent === 'object') {
|
|
108231
|
+
normalized.itemContent = Object.assign({}, itemContent);
|
|
108232
|
+
MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS.forEach(key => {
|
|
108233
|
+
if (key in normalized.itemContent) {
|
|
108234
|
+
normalized.itemContent[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
108235
|
+
}
|
|
108236
|
+
});
|
|
108237
|
+
const text = normalized.itemContent.text;
|
|
108238
|
+
if (text && typeof text === 'object') {
|
|
108239
|
+
normalized.itemContent.text = Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), { text: MARKER_TEXT_PLACEHOLDER });
|
|
108240
|
+
}
|
|
108232
108241
|
}
|
|
108233
108242
|
return normalized;
|
|
108234
108243
|
};
|
|
@@ -110664,6 +110673,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110664
110673
|
_createMarkerComponent() {
|
|
110665
110674
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
110666
110675
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
110676
|
+
const region = this._relativeSeries.getRegion();
|
|
110667
110677
|
const _10 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _10, restItemContent = __rest$h(_10, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
|
|
110668
110678
|
let itemContentState = null;
|
|
110669
110679
|
let itemContentStyle = null;
|
|
@@ -110713,7 +110723,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110713
110723
|
select: (_u = this._spec.interactive) !== null && _u !== void 0 ? _u : true,
|
|
110714
110724
|
position: { x: 0, y: 0 },
|
|
110715
110725
|
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
110716
|
-
itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX,
|
|
110726
|
+
itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX, region), offsetY: transformOffset(itemContent.offsetY, region) }, restItemContent), { style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext) }),
|
|
110717
110727
|
targetSymbol: {
|
|
110718
110728
|
offset: (_w = targetSymbol.offset) !== null && _w !== void 0 ? _w : 0,
|
|
110719
110729
|
visible: (_x = targetSymbol.visible) !== null && _x !== void 0 ? _x : false,
|
|
@@ -110758,6 +110768,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110758
110768
|
: data.latestData
|
|
110759
110769
|
: seriesData;
|
|
110760
110770
|
const { itemLine = {}, itemContent = {} } = this._spec;
|
|
110771
|
+
const region = this._relativeSeries.getRegion();
|
|
110761
110772
|
const { visible: itemLineVisible, line = {} } = itemLine, restItemLine = __rest$h(itemLine, ["visible", "line"]);
|
|
110762
110773
|
const itemLineAttrs = itemLineVisible !== false
|
|
110763
110774
|
? Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) })
|
|
@@ -110779,6 +110790,8 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110779
110790
|
const attribute = (_d = this._markerComponent.attribute) !== null && _d !== void 0 ? _d : {};
|
|
110780
110791
|
const textStyle = (_f = (_e = attribute.itemContent) === null || _e === void 0 ? void 0 : _e.textStyle) !== null && _f !== void 0 ? _f : {};
|
|
110781
110792
|
const specText = (_g = this._spec.itemContent.text) === null || _g === void 0 ? void 0 : _g.text;
|
|
110793
|
+
const offsetX = transformOffset(itemContent.offsetX, region);
|
|
110794
|
+
const offsetY = transformOffset(itemContent.offsetY, region);
|
|
110782
110795
|
this._markerComponent.setAttributes({
|
|
110783
110796
|
position: point === undefined ? { x: null, y: null } : point,
|
|
110784
110797
|
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)
|
|
@@ -110786,7 +110799,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
110786
110799
|
this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
|
|
110787
110800
|
: isValid$1(specText)
|
|
110788
110801
|
? specText
|
|
110789
|
-
: textStyle.text }), offsetX: computeOffsetFromRegion(point,
|
|
110802
|
+
: textStyle.text }), offsetX: computeOffsetFromRegion(point, offsetX, region), offsetY: computeOffsetFromRegion(point, offsetY, region) }),
|
|
110790
110803
|
itemLine: itemLineAttrs,
|
|
110791
110804
|
limitRect,
|
|
110792
110805
|
dx: this._layoutOffsetX,
|
package/build/index.js
CHANGED
|
@@ -108177,6 +108177,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
108177
108177
|
'radius1'
|
|
108178
108178
|
];
|
|
108179
108179
|
const MARKER_LAYOUT_POSITION_SPEC_KEYS = ['position', 'positions', 'coordinatesOffset', 'regionRelative'];
|
|
108180
|
+
const MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS = ['offsetX', 'offsetY', 'confine'];
|
|
108180
108181
|
const normalizeMarkerLabelFormatMethod = (label) => {
|
|
108181
108182
|
if (Array.isArray(label)) {
|
|
108182
108183
|
return label.map(normalizeMarkerLabelFormatMethod);
|
|
@@ -108208,7 +108209,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
108208
108209
|
return normalized;
|
|
108209
108210
|
};
|
|
108210
108211
|
const normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
108211
|
-
var _a;
|
|
108212
108212
|
if (!spec || typeof spec !== 'object') {
|
|
108213
108213
|
return spec;
|
|
108214
108214
|
}
|
|
@@ -108232,9 +108232,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
108232
108232
|
Object.keys(normalized).forEach(key => {
|
|
108233
108233
|
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
108234
108234
|
});
|
|
108235
|
-
const
|
|
108236
|
-
if (
|
|
108237
|
-
normalized.itemContent = Object.assign(
|
|
108235
|
+
const itemContent = normalized.itemContent;
|
|
108236
|
+
if (itemContent && typeof itemContent === 'object') {
|
|
108237
|
+
normalized.itemContent = Object.assign({}, itemContent);
|
|
108238
|
+
MARKER_ITEM_CONTENT_LAYOUT_SPEC_KEYS.forEach(key => {
|
|
108239
|
+
if (key in normalized.itemContent) {
|
|
108240
|
+
normalized.itemContent[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
108241
|
+
}
|
|
108242
|
+
});
|
|
108243
|
+
const text = normalized.itemContent.text;
|
|
108244
|
+
if (text && typeof text === 'object') {
|
|
108245
|
+
normalized.itemContent.text = Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), { text: MARKER_TEXT_PLACEHOLDER });
|
|
108246
|
+
}
|
|
108238
108247
|
}
|
|
108239
108248
|
return normalized;
|
|
108240
108249
|
};
|
|
@@ -110670,6 +110679,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110670
110679
|
_createMarkerComponent() {
|
|
110671
110680
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
110672
110681
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
110682
|
+
const region = this._relativeSeries.getRegion();
|
|
110673
110683
|
const _10 = itemContent, { type = 'text', text: label, symbol, image, richText, customMark, textStyle, symbolStyle, imageStyle, richTextStyle, customMarkStyle, style = {}, state = {} } = _10, restItemContent = __rest$h(_10, ["type", "text", "symbol", "image", "richText", "customMark", "textStyle", "symbolStyle", "imageStyle", "richTextStyle", "customMarkStyle", "style", "state"]);
|
|
110674
110684
|
let itemContentState = null;
|
|
110675
110685
|
let itemContentStyle = null;
|
|
@@ -110719,7 +110729,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110719
110729
|
select: (_u = this._spec.interactive) !== null && _u !== void 0 ? _u : true,
|
|
110720
110730
|
position: { x: 0, y: 0 },
|
|
110721
110731
|
clipInRange: (_v = this._spec.clip) !== null && _v !== void 0 ? _v : false,
|
|
110722
|
-
itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX,
|
|
110732
|
+
itemContent: Object.assign(Object.assign({ type, offsetX: transformOffset(itemContent.offsetX, region), offsetY: transformOffset(itemContent.offsetY, region) }, restItemContent), { style: transformStyle(itemContentStyle, this._markerData, this._markAttributeContext) }),
|
|
110723
110733
|
targetSymbol: {
|
|
110724
110734
|
offset: (_w = targetSymbol.offset) !== null && _w !== void 0 ? _w : 0,
|
|
110725
110735
|
visible: (_x = targetSymbol.visible) !== null && _x !== void 0 ? _x : false,
|
|
@@ -110764,6 +110774,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110764
110774
|
: data.latestData
|
|
110765
110775
|
: seriesData;
|
|
110766
110776
|
const { itemLine = {}, itemContent = {} } = this._spec;
|
|
110777
|
+
const region = this._relativeSeries.getRegion();
|
|
110767
110778
|
const { visible: itemLineVisible, line = {} } = itemLine, restItemLine = __rest$h(itemLine, ["visible", "line"]);
|
|
110768
110779
|
const itemLineAttrs = itemLineVisible !== false
|
|
110769
110780
|
? Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) })
|
|
@@ -110785,6 +110796,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110785
110796
|
const attribute = (_d = this._markerComponent.attribute) !== null && _d !== void 0 ? _d : {};
|
|
110786
110797
|
const textStyle = (_f = (_e = attribute.itemContent) === null || _e === void 0 ? void 0 : _e.textStyle) !== null && _f !== void 0 ? _f : {};
|
|
110787
110798
|
const specText = (_g = this._spec.itemContent.text) === null || _g === void 0 ? void 0 : _g.text;
|
|
110799
|
+
const offsetX = transformOffset(itemContent.offsetX, region);
|
|
110800
|
+
const offsetY = transformOffset(itemContent.offsetY, region);
|
|
110788
110801
|
this._markerComponent.setAttributes({
|
|
110789
110802
|
position: point === undefined ? { x: null, y: null } : point,
|
|
110790
110803
|
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)
|
|
@@ -110792,7 +110805,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
110792
110805
|
this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
|
|
110793
110806
|
: isValid$1(specText)
|
|
110794
110807
|
? specText
|
|
110795
|
-
: textStyle.text }), offsetX: computeOffsetFromRegion(point,
|
|
110808
|
+
: textStyle.text }), offsetX: computeOffsetFromRegion(point, offsetX, region), offsetY: computeOffsetFromRegion(point, offsetY, region) }),
|
|
110796
110809
|
itemLine: itemLineAttrs,
|
|
110797
110810
|
limitRect,
|
|
110798
110811
|
dx: this._layoutOffsetX,
|