@visactor/vchart 1.11.12 → 1.11.13

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.js CHANGED
@@ -66854,7 +66854,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66854
66854
  registerComponentPlugin(CanvasTooltipHandler);
66855
66855
  };
66856
66856
 
66857
- const version = "1.11.12";
66857
+ const version = "1.11.13";
66858
66858
 
66859
66859
  const addVChartProperty = (data, op) => {
66860
66860
  const context = op.beforeCall();
@@ -78733,7 +78733,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78733
78733
  layoutRadius: chartSpec.layoutRadius
78734
78734
  };
78735
78735
  };
78736
- const computeLayoutRadius = (layoutRadius, getLayoutRect, getCenter, startAngle = 0, endAngle = 0 * Math.PI) => {
78736
+ const computeLayoutRadius = (getLayoutRadius, getLayoutRect, getCenter, getAngles) => {
78737
+ const layoutRadius = getLayoutRadius();
78737
78738
  if (isNumber$1(layoutRadius)) {
78738
78739
  return layoutRadius;
78739
78740
  }
@@ -78742,6 +78743,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78742
78743
  }
78743
78744
  const rect = getLayoutRect();
78744
78745
  if (layoutRadius === 'auto' && rect.width > 0 && rect.height > 0) {
78746
+ const { startAngle = 0, endAngle = 2 * Math.PI } = getAngles();
78745
78747
  return calculateMaxRadius(rect, getCenter(), startAngle, endAngle);
78746
78748
  }
78747
78749
  return Math.min(rect.width / 2, rect.height / 2);
@@ -78852,7 +78854,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78852
78854
  return field$2(ARC_END_ANGLE)(datum);
78853
78855
  }
78854
78856
  _computeLayoutRadius() {
78855
- return computeLayoutRadius(this._spec.layoutRadius, this.getLayoutRect, this.getCenter, this._startAngle, this._endAngle);
78857
+ return computeLayoutRadius(() => this._spec.layoutRadius, this.getLayoutRect, this.getCenter, () => ({ startAngle: this._startAngle, endAngle: this._endAngle }));
78856
78858
  }
78857
78859
  initMarkStyle() {
78858
78860
  const pieMark = this._pieMark;
@@ -79386,6 +79388,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79386
79388
  const region = (_a = this.getRegions()) === null || _a === void 0 ? void 0 : _a[0];
79387
79389
  return region ? region.getLayoutStartPoint() : pos;
79388
79390
  };
79391
+ this.getCenter = () => {
79392
+ var _a, _b;
79393
+ const layoutRect = this.getRefLayoutRect();
79394
+ const { width, height } = layoutRect;
79395
+ return {
79396
+ x: calcLayoutNumber((_a = this._center) === null || _a === void 0 ? void 0 : _a.x, width, layoutRect, width / 2),
79397
+ y: calcLayoutNumber((_b = this._center) === null || _b === void 0 ? void 0 : _b.y, height, layoutRect, height / 2)
79398
+ };
79399
+ };
79389
79400
  this.getRefLayoutRect = () => {
79390
79401
  return this.getRegions()[0].getLayoutRect();
79391
79402
  };
@@ -79528,15 +79539,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79528
79539
  angle: radian
79529
79540
  };
79530
79541
  }
79531
- getCenter() {
79532
- var _a, _b;
79533
- const layoutRect = this.getRefLayoutRect();
79534
- const { width, height } = layoutRect;
79535
- return {
79536
- x: calcLayoutNumber((_a = this._center) === null || _a === void 0 ? void 0 : _a.x, width, layoutRect, width / 2),
79537
- y: calcLayoutNumber((_b = this._center) === null || _b === void 0 ? void 0 : _b.y, height, layoutRect, height / 2)
79538
- };
79539
- }
79540
79542
  getOuterRadius() {
79541
79543
  return this.computeLayoutOuterRadius();
79542
79544
  }
@@ -79620,7 +79622,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79620
79622
  return undefined;
79621
79623
  }
79622
79624
  _computeLayoutRadius() {
79623
- return computeLayoutRadius(this._spec.layoutRadius, this.getRefLayoutRect, this.getCenter, this._startAngle, this._endAngle);
79625
+ return computeLayoutRadius(() => this._spec.layoutRadius, this.getRefLayoutRect, this.getCenter, () => ({ startAngle: this._startAngle, endAngle: this._endAngle }));
79624
79626
  }
79625
79627
  computeLayoutOuterRadius() {
79626
79628
  var _a;