@visactor/vchart 1.13.9-alpha.1 → 1.13.9-alpha.2

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/index.es.js CHANGED
@@ -63652,7 +63652,7 @@ const registerVChartCore = () => {
63652
63652
  };
63653
63653
  registerVChartCore();
63654
63654
 
63655
- const version = "1.13.9-alpha.1";
63655
+ const version = "1.13.9-alpha.2";
63656
63656
 
63657
63657
  const addVChartProperty = (data, op) => {
63658
63658
  const context = op.beforeCall();
@@ -98216,7 +98216,7 @@ class CartesianMarkLine extends BaseMarkLine {
98216
98216
  return { points };
98217
98217
  }
98218
98218
  _markerLayout() {
98219
- var _a, _b, _c, _d, _e;
98219
+ var _a, _b, _c, _d;
98220
98220
  const updateAttrs = this._getUpdateMarkerAttrs();
98221
98221
  if (this._spec.type === 'type-step') {
98222
98222
  const startRelativeSeries = this._startRelativeSeries;
@@ -98249,18 +98249,17 @@ class CartesianMarkLine extends BaseMarkLine {
98249
98249
  if (multiSegment && isValid$1(mainSegmentIndex)) {
98250
98250
  labelPositionAttrs = {
98251
98251
  position: 'middle',
98252
- autoRotate: false,
98253
- refX: 0,
98254
- refY: 0
98252
+ autoRotate: false
98255
98253
  };
98256
98254
  }
98257
98255
  else {
98258
- labelPositionAttrs = Object.assign(Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue)), { refX: 0, refY: 0 });
98256
+ labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
98259
98257
  }
98260
98258
  const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
98261
98259
  const prevLabelAttrs = array(markerComponentAttr.label);
98262
- const label = array((_c = updateAttrs.label) !== null && _c !== void 0 ? _c : {});
98263
- (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes({
98260
+ const updateLabels = array(updateAttrs.label);
98261
+ const labelsInSpec = array(this._spec.label);
98262
+ (_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
98264
98263
  points: multiSegment
98265
98264
  ? [
98266
98265
  [joinPoints[0], joinPoints[1]],
@@ -98268,21 +98267,29 @@ class CartesianMarkLine extends BaseMarkLine {
98268
98267
  [joinPoints[2], joinPoints[3]]
98269
98268
  ]
98270
98269
  : joinPoints,
98271
- label: label.map((labelItem, index) => {
98272
- var _a;
98273
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refX)) {
98274
- labelPositionAttrs.refX += labelItem.refX;
98270
+ label: updateLabels.map((labelItem, index) => {
98271
+ var _a, _b, _c, _d;
98272
+ let refX = 0;
98273
+ let refY = 0;
98274
+ let dx = (_a = labelPositionAttrs.dx) !== null && _a !== void 0 ? _a : 0;
98275
+ let dy = (_b = labelPositionAttrs.dy) !== null && _b !== void 0 ? _b : 0;
98276
+ const labelSpec = (_c = labelsInSpec[index]) !== null && _c !== void 0 ? _c : labelsInSpec[0];
98277
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refX)) {
98278
+ refX += labelSpec.refX;
98275
98279
  }
98276
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refY)) {
98277
- labelPositionAttrs.refY += labelItem.refY;
98280
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refY)) {
98281
+ refY += labelSpec.refY;
98278
98282
  }
98279
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dx)) {
98280
- labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + labelItem.dx;
98283
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dx)) {
98284
+ dx += labelSpec.dx;
98281
98285
  }
98282
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dy)) {
98283
- labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + labelItem.dy;
98286
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dy)) {
98287
+ dy += labelSpec.dy;
98284
98288
  }
98285
- return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { textStyle: Object.assign(Object.assign({}, (_a = prevLabelAttrs[index]) === null || _a === void 0 ? void 0 : _a.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
98289
+ return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { refX,
98290
+ refY,
98291
+ dx,
98292
+ dy, textStyle: Object.assign(Object.assign({}, (_d = prevLabelAttrs[index]) === null || _d === void 0 ? void 0 : _d.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
98286
98293
  }),
98287
98294
  limitRect,
98288
98295
  multiSegment,
@@ -98292,7 +98299,7 @@ class CartesianMarkLine extends BaseMarkLine {
98292
98299
  });
98293
98300
  }
98294
98301
  else {
98295
- (_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.setAttributes(updateAttrs);
98302
+ (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
98296
98303
  }
98297
98304
  }
98298
98305
  _computeOptions() {
package/build/index.js CHANGED
@@ -63658,7 +63658,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
63658
63658
  };
63659
63659
  registerVChartCore();
63660
63660
 
63661
- const version = "1.13.9-alpha.1";
63661
+ const version = "1.13.9-alpha.2";
63662
63662
 
63663
63663
  const addVChartProperty = (data, op) => {
63664
63664
  const context = op.beforeCall();
@@ -98222,7 +98222,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98222
98222
  return { points };
98223
98223
  }
98224
98224
  _markerLayout() {
98225
- var _a, _b, _c, _d, _e;
98225
+ var _a, _b, _c, _d;
98226
98226
  const updateAttrs = this._getUpdateMarkerAttrs();
98227
98227
  if (this._spec.type === 'type-step') {
98228
98228
  const startRelativeSeries = this._startRelativeSeries;
@@ -98255,18 +98255,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98255
98255
  if (multiSegment && isValid$1(mainSegmentIndex)) {
98256
98256
  labelPositionAttrs = {
98257
98257
  position: 'middle',
98258
- autoRotate: false,
98259
- refX: 0,
98260
- refY: 0
98258
+ autoRotate: false
98261
98259
  };
98262
98260
  }
98263
98261
  else {
98264
- labelPositionAttrs = Object.assign(Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue)), { refX: 0, refY: 0 });
98262
+ labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
98265
98263
  }
98266
98264
  const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
98267
98265
  const prevLabelAttrs = array(markerComponentAttr.label);
98268
- const label = array((_c = updateAttrs.label) !== null && _c !== void 0 ? _c : {});
98269
- (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes({
98266
+ const updateLabels = array(updateAttrs.label);
98267
+ const labelsInSpec = array(this._spec.label);
98268
+ (_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
98270
98269
  points: multiSegment
98271
98270
  ? [
98272
98271
  [joinPoints[0], joinPoints[1]],
@@ -98274,21 +98273,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98274
98273
  [joinPoints[2], joinPoints[3]]
98275
98274
  ]
98276
98275
  : joinPoints,
98277
- label: label.map((labelItem, index) => {
98278
- var _a;
98279
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refX)) {
98280
- labelPositionAttrs.refX += labelItem.refX;
98276
+ label: updateLabels.map((labelItem, index) => {
98277
+ var _a, _b, _c, _d;
98278
+ let refX = 0;
98279
+ let refY = 0;
98280
+ let dx = (_a = labelPositionAttrs.dx) !== null && _a !== void 0 ? _a : 0;
98281
+ let dy = (_b = labelPositionAttrs.dy) !== null && _b !== void 0 ? _b : 0;
98282
+ const labelSpec = (_c = labelsInSpec[index]) !== null && _c !== void 0 ? _c : labelsInSpec[0];
98283
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refX)) {
98284
+ refX += labelSpec.refX;
98281
98285
  }
98282
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refY)) {
98283
- labelPositionAttrs.refY += labelItem.refY;
98286
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refY)) {
98287
+ refY += labelSpec.refY;
98284
98288
  }
98285
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dx)) {
98286
- labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + labelItem.dx;
98289
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dx)) {
98290
+ dx += labelSpec.dx;
98287
98291
  }
98288
- if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dy)) {
98289
- labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + labelItem.dy;
98292
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dy)) {
98293
+ dy += labelSpec.dy;
98290
98294
  }
98291
- return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { textStyle: Object.assign(Object.assign({}, (_a = prevLabelAttrs[index]) === null || _a === void 0 ? void 0 : _a.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
98295
+ return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { refX,
98296
+ refY,
98297
+ dx,
98298
+ dy, textStyle: Object.assign(Object.assign({}, (_d = prevLabelAttrs[index]) === null || _d === void 0 ? void 0 : _d.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
98292
98299
  }),
98293
98300
  limitRect,
98294
98301
  multiSegment,
@@ -98298,7 +98305,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
98298
98305
  });
98299
98306
  }
98300
98307
  else {
98301
- (_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.setAttributes(updateAttrs);
98308
+ (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
98302
98309
  }
98303
98310
  }
98304
98311
  _computeOptions() {