@visactor/vchart 1.11.11 → 1.11.12

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.
Files changed (107) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +216 -171
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart.js +1 -1
  6. package/cjs/chart/base/base-chart.js.map +1 -1
  7. package/cjs/chart/pie/base/pie-transformer.js +2 -1
  8. package/cjs/chart/pie/base/pie-transformer.js.map +1 -1
  9. package/cjs/chart/polar/interface.d.ts +3 -2
  10. package/cjs/chart/polar/interface.js.map +1 -1
  11. package/cjs/chart/util.js +2 -1
  12. package/cjs/chart/util.js.map +1 -1
  13. package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
  14. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  15. package/cjs/component/axis/polar/axis.d.ts +2 -2
  16. package/cjs/component/axis/polar/axis.js +17 -20
  17. package/cjs/component/axis/polar/axis.js.map +1 -1
  18. package/cjs/component/axis/polar/interface/spec.d.ts +3 -2
  19. package/cjs/component/axis/polar/interface/spec.js.map +1 -1
  20. package/cjs/component/axis/polar/util/common.d.ts +3 -0
  21. package/cjs/component/axis/polar/util/common.js +10 -1
  22. package/cjs/component/axis/polar/util/common.js.map +1 -1
  23. package/cjs/component/brush/brush.js +2 -1
  24. package/cjs/component/brush/brush.js.map +1 -1
  25. package/cjs/component/legend/base-legend.js +2 -1
  26. package/cjs/component/legend/base-legend.js.map +1 -1
  27. package/cjs/core/index.d.ts +1 -1
  28. package/cjs/core/index.js +1 -1
  29. package/cjs/core/index.js.map +1 -1
  30. package/cjs/core/interface.d.ts +15 -3
  31. package/cjs/core/interface.js.map +1 -1
  32. package/cjs/core/vchart.js +9 -8
  33. package/cjs/core/vchart.js.map +1 -1
  34. package/cjs/data/transforms/pie.d.ts +4 -4
  35. package/cjs/data/transforms/pie.js +1 -1
  36. package/cjs/data/transforms/pie.js.map +1 -1
  37. package/cjs/event/events/dimension/util/cartesian.js +1 -2
  38. package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
  39. package/cjs/event/events/dimension/util/polar.js +1 -2
  40. package/cjs/event/events/dimension/util/polar.js.map +1 -1
  41. package/cjs/layout/base-layout.js +3 -2
  42. package/cjs/layout/base-layout.js.map +1 -1
  43. package/cjs/model/interface.d.ts +1 -0
  44. package/cjs/model/interface.js.map +1 -1
  45. package/cjs/series/funnel/funnel.js +1 -1
  46. package/cjs/series/funnel/funnel.js.map +1 -1
  47. package/cjs/series/gauge/gauge.js +2 -2
  48. package/cjs/series/gauge/gauge.js.map +1 -1
  49. package/cjs/series/pie/interface.d.ts +3 -0
  50. package/cjs/series/pie/interface.js.map +1 -1
  51. package/cjs/series/pie/pie.d.ts +2 -1
  52. package/cjs/series/pie/pie.js +25 -22
  53. package/cjs/series/pie/pie.js.map +1 -1
  54. package/cjs/util/env.js +1 -1
  55. package/cjs/util/env.js.map +1 -1
  56. package/esm/chart/base/base-chart.js +2 -2
  57. package/esm/chart/base/base-chart.js.map +1 -1
  58. package/esm/chart/pie/base/pie-transformer.js +2 -1
  59. package/esm/chart/pie/base/pie-transformer.js.map +1 -1
  60. package/esm/chart/polar/interface.d.ts +3 -2
  61. package/esm/chart/polar/interface.js.map +1 -1
  62. package/esm/chart/util.js +2 -1
  63. package/esm/chart/util.js.map +1 -1
  64. package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
  65. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  66. package/esm/component/axis/polar/axis.d.ts +2 -2
  67. package/esm/component/axis/polar/axis.js +19 -22
  68. package/esm/component/axis/polar/axis.js.map +1 -1
  69. package/esm/component/axis/polar/interface/spec.d.ts +3 -2
  70. package/esm/component/axis/polar/interface/spec.js.map +1 -1
  71. package/esm/component/axis/polar/util/common.d.ts +3 -0
  72. package/esm/component/axis/polar/util/common.js +8 -1
  73. package/esm/component/axis/polar/util/common.js.map +1 -1
  74. package/esm/component/brush/brush.js +2 -1
  75. package/esm/component/brush/brush.js.map +1 -1
  76. package/esm/component/legend/base-legend.js +2 -1
  77. package/esm/component/legend/base-legend.js.map +1 -1
  78. package/esm/core/index.d.ts +1 -1
  79. package/esm/core/index.js +1 -1
  80. package/esm/core/index.js.map +1 -1
  81. package/esm/core/interface.d.ts +15 -3
  82. package/esm/core/interface.js.map +1 -1
  83. package/esm/core/vchart.js +9 -8
  84. package/esm/core/vchart.js.map +1 -1
  85. package/esm/data/transforms/pie.d.ts +4 -4
  86. package/esm/data/transforms/pie.js +1 -1
  87. package/esm/data/transforms/pie.js.map +1 -1
  88. package/esm/event/events/dimension/util/cartesian.js +0 -3
  89. package/esm/event/events/dimension/util/cartesian.js.map +1 -1
  90. package/esm/event/events/dimension/util/polar.js +0 -3
  91. package/esm/event/events/dimension/util/polar.js.map +1 -1
  92. package/esm/layout/base-layout.js +3 -2
  93. package/esm/layout/base-layout.js.map +1 -1
  94. package/esm/model/interface.d.ts +1 -0
  95. package/esm/model/interface.js.map +1 -1
  96. package/esm/series/funnel/funnel.js +1 -1
  97. package/esm/series/funnel/funnel.js.map +1 -1
  98. package/esm/series/gauge/gauge.js +3 -3
  99. package/esm/series/gauge/gauge.js.map +1 -1
  100. package/esm/series/pie/interface.d.ts +3 -0
  101. package/esm/series/pie/interface.js.map +1 -1
  102. package/esm/series/pie/pie.d.ts +2 -1
  103. package/esm/series/pie/pie.js +26 -20
  104. package/esm/series/pie/pie.js.map +1 -1
  105. package/esm/util/env.js +1 -1
  106. package/esm/util/env.js.map +1 -1
  107. package/package.json +15 -15
package/build/index.js CHANGED
@@ -17531,20 +17531,21 @@
17531
17531
  this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
17532
17532
  }
17533
17533
  deal(paragraph) {
17534
- paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph)));
17534
+ let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
17535
+ paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), 0 !== paragraph.text.length && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
17535
17536
  }
17536
- cut(paragraph) {
17537
+ cut(paragraph, singleLine) {
17537
17538
  const availableWidth = this[this.directionKey.width] - this.lineWidth || 0,
17538
17539
  guessIndex = Math.ceil(availableWidth / paragraph[this.directionKey.width] * paragraph.length) || 0,
17539
17540
  index = getStrByWithCanvas(paragraph.text, availableWidth, paragraph.character, guessIndex, "break-word" === this.frame.wordBreak);
17540
17541
  if (0 !== index) {
17541
17542
  const [p1, p2] = seperateParagraph(paragraph, index);
17542
- this.store(p1), this.deal(p2);
17543
+ this.store(p1), singleLine ? this.send() : this.deal(p2);
17543
17544
  } else 0 !== this.lineBuffer.length && (this.send(), this.deal(paragraph));
17544
17545
  }
17545
17546
  }
17546
17547
 
17547
- const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", ...GRAPHIC_UPDATE_TAG_KEY];
17548
+ const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
17548
17549
  class RichText extends Graphic {
17549
17550
  constructor(params) {
17550
17551
  super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE;
@@ -17716,7 +17717,7 @@
17716
17717
  skip = !1;
17717
17718
  for (let i = 0; i < paragraphs.length; i++) {
17718
17719
  const p = paragraphs[i];
17719
- skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0);
17720
+ skip ? (p.overflow = !0, p.left = 1 / 0, p.top = 1 / 0, !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p)) : wrapper.deal(p, !0), frame.lines.length !== lineCount && (lineCount = frame.lines.length, wrapper.lineBuffer.length = 0, p.overflow = !0, p.left = 1e3, p.top = 1e3, frame.lines[frame.lines.length - 1].paragraphs.push(p), skip = !0), p.newLine && (skip = !1, wrapper.lineWidth = 0), wrapper.send();
17720
17721
  }
17721
17722
  } else for (let i = 0; i < paragraphs.length; i++) wrapper.deal(paragraphs[i]);
17722
17723
  wrapper.send();
@@ -17757,10 +17758,11 @@
17757
17758
  let pickIcon;
17758
17759
  return frameCache.icons.forEach(icon => {
17759
17760
  var _a, _b;
17760
- icon.AABBBounds.containsPoint({
17761
+ const bounds = icon.AABBBounds.clone();
17762
+ bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
17761
17763
  x: point.x - x,
17762
17764
  y: point.y - y
17763
- }) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x, pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y);
17765
+ }) && (pickIcon = icon, pickIcon.globalX = (null !== (_a = pickIcon.attribute.x) && void 0 !== _a ? _a : 0) + x + icon._marginArray[3], pickIcon.globalY = (null !== (_b = pickIcon.attribute.y) && void 0 !== _b ? _b : 0) + y + icon._marginArray[0]);
17764
17766
  }), pickIcon;
17765
17767
  }
17766
17768
  getNoWorkAnimateAttr() {
@@ -19864,7 +19866,7 @@
19864
19866
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
19865
19867
 
19866
19868
  const halfPi = pi$1 / 2;
19867
- function createRectPath(path, x, y, width, height, rectCornerRadius) {
19869
+ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
19868
19870
  let cornerRadius;
19869
19871
  if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
19870
19872
  const cornerRadiusArr = rectCornerRadius;
@@ -19896,27 +19898,28 @@
19896
19898
  rightBottomPoint2 = [rightBottom[0], rightBottom[1] - _cornerRadius[2]],
19897
19899
  leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]],
19898
19900
  leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
19899
- if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
19901
+ if (path.moveTo(leftTopPoint1[0], leftTopPoint1[1]), edgeCb && edgeCb[0] ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1]) : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]), !arrayEqual(rightTopPoint1, rightTopPoint2)) {
19902
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
19900
19903
  const centerX = rightTopPoint1[0],
19901
19904
  centerY = rightTopPoint1[1] + _cornerRadius[1];
19902
19905
  path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, !1);
19903
19906
  }
19904
- if (path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
19907
+ if (edgeCb && edgeCb[1] ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1]) : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]), !arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
19905
19908
  const centerX = rightBottomPoint2[0] - _cornerRadius[2],
19906
19909
  centerY = rightBottomPoint2[1];
19907
- path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
19910
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]), path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, !1);
19908
19911
  }
19909
- if (path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
19912
+ if (edgeCb && edgeCb[2] ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1]) : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]), !arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
19910
19913
  const centerX = leftBottomPoint1[0],
19911
19914
  centerY = leftBottomPoint1[1] - _cornerRadius[3];
19912
- path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi$1, !1);
19915
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]), path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi$1, !1);
19913
19916
  }
19914
- if (path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
19917
+ if (edgeCb && edgeCb[3] ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1]) : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]), !arrayEqual(leftTopPoint1, leftTopPoint2)) {
19915
19918
  const centerX = leftTopPoint1[0],
19916
19919
  centerY = leftTopPoint1[1] + _cornerRadius[0];
19917
- path.arc(centerX, centerY, _cornerRadius[0], pi$1, pi$1 + halfPi, !1);
19920
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]), path.arc(centerX, centerY, _cornerRadius[0], pi$1, pi$1 + halfPi, !1);
19918
19921
  }
19919
- return path.closePath(), path;
19922
+ return !edgeCb && path.closePath(), path;
19920
19923
  }
19921
19924
 
19922
19925
  var __decorate$1w = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -20005,14 +20008,24 @@
20005
20008
  y1: y1,
20006
20009
  x: originX = groupAttribute.x,
20007
20010
  y: originY = groupAttribute.y,
20008
- stroke = groupAttribute.stroke
20011
+ stroke = groupAttribute.stroke,
20012
+ cornerRadius = groupAttribute.cornerRadius
20009
20013
  } = rect.attribute;
20010
20014
  let {
20011
20015
  width: width,
20012
20016
  height: height
20013
20017
  } = rect.attribute;
20014
20018
  if (width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0, Array.isArray(stroke) && stroke.some(s => !1 === s)) {
20015
- if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
20019
+ if (context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute), !(0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num))) {
20020
+ let lastStroke,
20021
+ lastStrokeI = 0;
20022
+ return createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
20023
+ stroke[i] && (lastStrokeI === i - 1 && stroke[i] === lastStroke || (context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), {
20024
+ stroke: stroke[i]
20025
+ }), x, y, groupAttribute), context.beginPath(), context.moveTo(x1, y1), lastStroke = stroke[i]), lastStrokeI = i, context.lineTo(x2, y2), context.stroke(), 3 === i && context.beginPath());
20026
+ })), void context.stroke();
20027
+ }
20028
+ if (context.beginPath(), context.moveTo(x, y), stroke[0] ? context.lineTo(x + width, y) : context.moveTo(x + width, y), stroke[1] ? context.lineTo(x + width, y + height) : context.moveTo(x + width, y + height), stroke[2] ? context.lineTo(x, y + height) : context.moveTo(x, y + height), stroke[3]) {
20016
20029
  const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;
20017
20030
  context.lineTo(x, adjustY);
20018
20031
  } else context.moveTo(x, y);
@@ -20921,9 +20934,9 @@
20921
20934
  data = this.valid(area, areaAttribute, fillCb, strokeCb);
20922
20935
  if (!data) return;
20923
20936
  const {
20924
- doFill: doFill,
20925
- doStroke: doStroke
20937
+ doFill: doFill
20926
20938
  } = data,
20939
+ doStroke = data.doStroke && data.sVisible,
20927
20940
  {
20928
20941
  clipRange = areaAttribute.clipRange,
20929
20942
  closePath: closePath,
@@ -21740,7 +21753,9 @@
21740
21753
  clip: clip,
21741
21754
  baseOpacity = 1
21742
21755
  } = group.attribute;
21743
- clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
21756
+ clip ? context.save() : context.highPerformanceSave();
21757
+ const baseGlobalAlpha = context.baseGlobalAlpha;
21758
+ context.baseGlobalAlpha *= baseOpacity;
21744
21759
  const groupAttribute = getTheme$1(group, null == params ? void 0 : params.theme).group,
21745
21760
  lastModelMatrix = context.modelMatrix;
21746
21761
  if (context.camera) {
@@ -21754,7 +21769,7 @@
21754
21769
  scrollY = groupAttribute.scrollY
21755
21770
  } = group.attribute;
21756
21771
  let p;
21757
- (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
21772
+ (scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha = baseGlobalAlpha, p && p.then ? p.then(() => {
21758
21773
  clip ? context.restore() : context.highPerformanceRestore();
21759
21774
  }) : clip ? context.restore() : context.highPerformanceRestore();
21760
21775
  }
@@ -21887,7 +21902,7 @@
21887
21902
  const m = graphic.globalTransMatrix.getInverse();
21888
21903
  drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m), drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
21889
21904
  }
21890
- return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
21905
+ return drawContribution.renderGroup(graphic.shadowRoot, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && (drawContribution.dirtyBounds.copy(tempDirtyBounds), drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds)), !0;
21891
21906
  }
21892
21907
  }
21893
21908
  class DebugDrawItemInterceptorContribution {
@@ -25564,7 +25579,7 @@
25564
25579
  return isMiniAppLikeMode(mode) || mode === 'mobile-browser';
25565
25580
  }
25566
25581
  function isMiniAppLikeMode(mode) {
25567
- return mode.includes('miniApp') || mode === 'lynx' || mode === 'wx';
25582
+ return mode.includes('miniApp') || mode === 'lynx' || mode === 'wx' || mode === 'harmony';
25568
25583
  }
25569
25584
 
25570
25585
  let VChartId = 0;
@@ -26486,7 +26501,7 @@
26486
26501
  opacity = defaultParams.opacity,
26487
26502
  fill = defaultParams.fill
26488
26503
  } = attribute;
26489
- fillOpacity > 1e-12 && opacity > 1e-12 ? (_context.globalAlpha = fillOpacity * opacity * this.baseGlobalAlpha, _context.fillStyle = createColor(this, fill, params, offsetX, offsetY)) : _context.globalAlpha = fillOpacity * opacity * this.baseGlobalAlpha;
26504
+ _context.globalAlpha = fillOpacity * opacity * this.baseGlobalAlpha, fillOpacity > 1e-12 && opacity > 1e-12 && (_context.fillStyle = createColor(this, fill, params, offsetX, offsetY));
26490
26505
  }
26491
26506
  setShadowBlendStyle(params, attribute, defaultParams) {
26492
26507
  if (Array.isArray(defaultParams)) {
@@ -26529,7 +26544,7 @@
26529
26544
  strokeOpacity = defaultParams.strokeOpacity,
26530
26545
  opacity = defaultParams.opacity
26531
26546
  } = attribute;
26532
- if (strokeOpacity > 1e-12 && opacity > 1e-12) {
26547
+ if (_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, strokeOpacity > 1e-12 && opacity > 1e-12) {
26533
26548
  const {
26534
26549
  lineWidth = defaultParams.lineWidth,
26535
26550
  stroke = defaultParams.stroke,
@@ -26538,7 +26553,7 @@
26538
26553
  lineCap = defaultParams.lineCap,
26539
26554
  miterLimit = defaultParams.miterLimit
26540
26555
  } = attribute;
26541
- _context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
26556
+ _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
26542
26557
  }
26543
26558
  }
26544
26559
  setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
@@ -34531,6 +34546,21 @@
34531
34546
  labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside));
34532
34547
  return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside), text, style);
34533
34548
  }
34549
+ function getCirclePoints(center, count, radius, startAngle, endAngle) {
34550
+ const points = [],
34551
+ range = endAngle - startAngle;
34552
+ for (let i = 0; i < count; i++) {
34553
+ const angle = startAngle + i * range / count;
34554
+ points.push(polarToCartesian$1(center, radius, angle));
34555
+ }
34556
+ return points;
34557
+ }
34558
+ function getPolygonPath(points, closed) {
34559
+ let path = "";
34560
+ return 0 === points.length || (points.forEach((point, index) => {
34561
+ 0 === index ? path = `M${point.x},${point.y}` : path += `L${point.x},${point.y}`;
34562
+ }), closed && (path += "Z")), path;
34563
+ }
34534
34564
 
34535
34565
  const dispatchHoverState = (e, container, lastHover) => {
34536
34566
  const target = e.target;
@@ -35552,19 +35582,27 @@
35552
35582
  center: center,
35553
35583
  innerRadius = 0,
35554
35584
  line = {},
35555
- inside = !1
35585
+ inside = !1,
35586
+ sides: sides
35556
35587
  } = this.attribute;
35557
- let arcRadius = radius,
35588
+ let lineGraphic,
35589
+ arcRadius = radius,
35558
35590
  arcInnerRadius = innerRadius;
35559
- inside && innerRadius > 0 && (arcRadius = innerRadius, arcInnerRadius = 0);
35560
- const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), {
35591
+ if (inside && innerRadius > 0 && (arcRadius = innerRadius, arcInnerRadius = 0), isValidNumber$1(sides) && sides >= 3) {
35592
+ const gridPoints = getCirclePoints(center, sides, arcRadius, startAngle, endAngle);
35593
+ lineGraphic = graphicCreator.path(Object.assign(Object.assign({}, line.style), {
35594
+ path: getPolygonPath(gridPoints, !0)
35595
+ }));
35596
+ } else {
35597
+ const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), {
35561
35598
  startAngle: startAngle,
35562
35599
  endAngle: endAngle,
35563
35600
  radius: arcRadius,
35564
35601
  innerRadius: arcInnerRadius
35565
- }), line.style),
35566
- axisLine = graphicCreator.circle(arcAttrs);
35567
- axisLine.name = AXIS_ELEMENT_NAME.line, axisLine.id = this._getNodeId("line"), isEmpty(line.state) || (axisLine.states = merge$2({}, DEFAULT_STATES$1, line.state)), container.add(axisLine);
35602
+ }), line.style);
35603
+ lineGraphic = graphicCreator.circle(arcAttrs);
35604
+ }
35605
+ lineGraphic.name = AXIS_ELEMENT_NAME.line, lineGraphic.id = this._getNodeId("line"), isEmpty(line.state) || (lineGraphic.states = merge$2({}, DEFAULT_STATES$1, line.state)), container.add(lineGraphic);
35568
35606
  }
35569
35607
  getTitleAttribute() {
35570
35608
  var _a, _b, _c;
@@ -35718,7 +35756,7 @@
35718
35756
  onStart() {
35719
35757
  let duration = this.duration,
35720
35758
  easing = this.easing;
35721
- Object.keys(this._newElementAttrMap).forEach(id => {
35759
+ this._newElementAttrMap && Object.keys(this._newElementAttrMap).forEach(id => {
35722
35760
  var _a;
35723
35761
  const {
35724
35762
  node: node,
@@ -37120,12 +37158,6 @@
37120
37158
  return convertDomainToTickData(scale.domain());
37121
37159
  };
37122
37160
 
37123
- function getLinePath(points, closed) {
37124
- let path = "";
37125
- return 0 === points.length || (points.forEach((point, index) => {
37126
- 0 === index ? path = `M${point.x},${point.y}` : path += `L${point.x},${point.y}`;
37127
- }), closed && (path += "Z")), path;
37128
- }
37129
37161
  function getArcPath(center, points, reverse, closed) {
37130
37162
  let path = "";
37131
37163
  if (!center || 0 === points.length) return path;
@@ -37148,7 +37180,7 @@
37148
37180
  const fromStart = from[0],
37149
37181
  toEnd = reversePoints[0],
37150
37182
  center = attribute.center;
37151
- regionPath = getLinePath(from, !!closed), nextPath = getLinePath(reversePoints, !!closed);
37183
+ regionPath = getPolygonPath(from, !!closed), nextPath = getPolygonPath(reversePoints, !!closed);
37152
37184
  const toEndRadius = PointService.distancePP(toEnd, center),
37153
37185
  fromStartRadius = PointService.distancePP(fromStart, center);
37154
37186
  regionPath += `A${toEndRadius},${toEndRadius},0,0,1,${toEnd.x},${toEnd.y}L${toEnd.x},${toEnd.y}`, nextPath += `A${fromStartRadius},${fromStartRadius},0,0,0,${fromStart.x},${fromStart.y}`;
@@ -37157,7 +37189,7 @@
37157
37189
  center: center
37158
37190
  } = attribute;
37159
37191
  regionPath = getArcPath(center, from, !1, !!closed), nextPath = getArcPath(center, reversePoints, !0, !!closed);
37160
- } else "line" !== type && "polygon" !== type || (regionPath = getLinePath(from, !!closed), nextPath = getLinePath(reversePoints, !!closed));
37192
+ } else "line" !== type && "polygon" !== type || (regionPath = getPolygonPath(from, !!closed), nextPath = getPolygonPath(reversePoints, !!closed));
37161
37193
  return closed ? regionPath += nextPath : (nextPath = "L" + nextPath.substring(1), regionPath += nextPath, regionPath += "Z"), regionPath;
37162
37194
  }
37163
37195
  class BaseGrid extends AbstractComponent {
@@ -37218,7 +37250,7 @@
37218
37250
  points: points
37219
37251
  } = item;
37220
37252
  let path = "";
37221
- if ("line" === type || "polygon" === type) path = getLinePath(points, !!closed);else if ("circle" === type) {
37253
+ if ("line" === type || "polygon" === type) path = getPolygonPath(points, !!closed);else if ("circle" === type) {
37222
37254
  const {
37223
37255
  center: center
37224
37256
  } = this.attribute;
@@ -37244,7 +37276,7 @@
37244
37276
  x: points[0].x + dir_x * ratio,
37245
37277
  y: points[0].y + dir_y * ratio
37246
37278
  });
37247
- const path = getLinePath(nextPoints, !!closed),
37279
+ const path = getPolygonPath(nextPoints, !!closed),
37248
37280
  deltaX = abs$1(nextPoints[0].x - nextPoints[1].x),
37249
37281
  deltaY = abs$1(nextPoints[0].y - nextPoints[1].y),
37250
37282
  shape = graphicCreator.path(Object.assign({
@@ -37294,15 +37326,6 @@
37294
37326
  }
37295
37327
  };
37296
37328
 
37297
- function getCirclePoints(center, count, radius, startAngle, endAngle) {
37298
- const points = [],
37299
- range = endAngle - startAngle;
37300
- for (let i = 0; i < count; i++) {
37301
- const angle = startAngle + i * range / count;
37302
- points.push(polarToCartesian$1(center, radius, angle));
37303
- }
37304
- return points;
37305
- }
37306
37329
  loadLineAxisGridComponent();
37307
37330
  class LineAxisGrid extends BaseGrid {
37308
37331
  constructor(attributes, options) {
@@ -37317,12 +37340,13 @@
37317
37340
  gridPoints = [point, this.getVerticalCoord(point, length, !0)];
37318
37341
  } else if ("circle" === gridType || "polygon" === gridType) {
37319
37342
  const {
37320
- center: center,
37321
- sides = 6,
37322
- startAngle = POLAR_START_ANGLE$1,
37323
- endAngle = POLAR_END_ANGLE$1
37324
- } = this.attribute;
37325
- gridPoints = getCirclePoints(center, sides, PointService.distancePP(center, point), startAngle, endAngle);
37343
+ center: center,
37344
+ sides = 6,
37345
+ startAngle = POLAR_START_ANGLE$1,
37346
+ endAngle = POLAR_END_ANGLE$1
37347
+ } = this.attribute,
37348
+ distance = PointService.distancePP(center, point);
37349
+ gridPoints = getCirclePoints(center, sides, distance, startAngle, endAngle);
37326
37350
  }
37327
37351
  return gridPoints;
37328
37352
  }
@@ -40709,12 +40733,13 @@
40709
40733
  _createPager(compStyle) {
40710
40734
  var _a, _b;
40711
40735
  const {
40712
- disableTriggerEvent: disableTriggerEvent,
40713
- maxRow: maxRow
40714
- } = this.attribute;
40736
+ disableTriggerEvent: disableTriggerEvent,
40737
+ maxRow: maxRow
40738
+ } = this.attribute,
40739
+ estimateTotal = num => num <= 99 ? 99 : num <= 999 ? 999 : 9999;
40715
40740
  return this._itemContext.isHorizontal ? new Pager(Object.assign(Object.assign({
40716
40741
  layout: 1 === maxRow ? "horizontal" : "vertical",
40717
- total: 99
40742
+ total: estimateTotal(this._itemContext.pages)
40718
40743
  }, merge$2({
40719
40744
  handler: {
40720
40745
  preShape: "triangleUp",
@@ -40725,7 +40750,7 @@
40725
40750
  disableTriggerEvent: disableTriggerEvent
40726
40751
  })) : new Pager(Object.assign({
40727
40752
  layout: "horizontal",
40728
- total: 99,
40753
+ total: estimateTotal(this._itemContext.pages),
40729
40754
  disableTriggerEvent: disableTriggerEvent,
40730
40755
  defaultCurrent: null === (_b = this.attribute.pager) || void 0 === _b ? void 0 : _b.defaultCurrent
40731
40756
  }, compStyle));
@@ -55877,10 +55902,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55877
55902
  if (!chart) {
55878
55903
  return null;
55879
55904
  }
55880
- const series = getFirstSeries(chart.getRegionsInIndex(), 'polar');
55881
- if (!series) {
55882
- return null;
55883
- }
55884
55905
  const { x, y } = pos;
55885
55906
  const angleAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'angle', pos);
55886
55907
  const radiusAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'radius', pos);
@@ -56025,10 +56046,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
56025
56046
  if (!chart) {
56026
56047
  return null;
56027
56048
  }
56028
- const series = getFirstSeries(chart.getRegionsInIndex(), 'cartesian');
56029
- if (!series) {
56030
- return null;
56031
- }
56032
56049
  const { x, y } = pos;
56033
56050
  const xAxisList = (_a = getAxis(chart, (cmp) => isXAxis(cmp.getOrient()), pos)) !== null && _a !== void 0 ? _a : [];
56034
56051
  const yAxisList = (_b = getAxis(chart, (cmp) => isYAxis(cmp.getOrient()), pos)) !== null && _b !== void 0 ? _b : [];
@@ -57556,7 +57573,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57556
57573
  reRender: merge('reRender'),
57557
57574
  reSize: merge('reSize'),
57558
57575
  reTransformSpec: merge('reTransformSpec'),
57559
- changeTheme: merge('changeTheme')
57576
+ changeTheme: merge('changeTheme'),
57577
+ changeBackground: merge('changeBackground')
57560
57578
  });
57561
57579
  return target;
57562
57580
  }
@@ -59684,9 +59702,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59684
59702
  const regionWidth = Math.max(Math.min(regionRelativeTotalWidth, ...regionItems.map(region => { var _a; return (_a = region.maxWidth) !== null && _a !== void 0 ? _a : Number.MAX_VALUE; })), 0);
59685
59703
  const regionHeight = Math.max(Math.min(regionRelativeTotalHeight, ...regionItems.map(region => { var _a; return (_a = region.maxHeight) !== null && _a !== void 0 ? _a : Number.MAX_VALUE; })), 0);
59686
59704
  regionItems.forEach(region => {
59705
+ const width = regionWidth - region.layoutPaddingLeft - region.layoutPaddingRight;
59706
+ const height = regionHeight - region.layoutPaddingTop - region.layoutPaddingBottom;
59687
59707
  region.setLayoutRect({
59688
- width: regionWidth,
59689
- height: regionHeight
59708
+ width: width,
59709
+ height: height
59690
59710
  });
59691
59711
  region.setLayoutStartPosition({
59692
59712
  x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
@@ -61610,7 +61630,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61610
61630
  return this._beforeRender(option);
61611
61631
  }
61612
61632
  _reCompile(updateResult, morphConfig) {
61613
- var _a, _b, _c, _d, _e, _f, _g, _h;
61633
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
61614
61634
  if (updateResult.reMake) {
61615
61635
  this._releaseData();
61616
61636
  this._initDataSet();
@@ -61621,7 +61641,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61621
61641
  this._setCurrentTheme();
61622
61642
  this._setFontFamilyTheme((_b = this._currentTheme) === null || _b === void 0 ? void 0 : _b.fontFamily);
61623
61643
  }
61624
- (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(((_d = this._option) === null || _d === void 0 ? void 0 : _d.animation) === false || ((_e = this._spec) === null || _e === void 0 ? void 0 : _e.animation) === false);
61644
+ else if (updateResult.changeBackground) {
61645
+ (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.setBackground(this._getBackground());
61646
+ }
61647
+ (_d = this._compiler) === null || _d === void 0 ? void 0 : _d.releaseGrammar(((_e = this._option) === null || _e === void 0 ? void 0 : _e.animation) === false || ((_f = this._spec) === null || _f === void 0 ? void 0 : _f.animation) === false);
61625
61648
  this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
61626
61649
  if (updateResult.reSize) {
61627
61650
  this._doResize();
@@ -61630,11 +61653,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61630
61653
  else {
61631
61654
  if (updateResult.changeTheme) {
61632
61655
  this._setCurrentTheme();
61633
- this._setFontFamilyTheme((_f = this._currentTheme) === null || _f === void 0 ? void 0 : _f.fontFamily);
61656
+ this._setFontFamilyTheme((_g = this._currentTheme) === null || _g === void 0 ? void 0 : _g.fontFamily);
61657
+ }
61658
+ else if (updateResult.changeBackground) {
61659
+ (_h = this._compiler) === null || _h === void 0 ? void 0 : _h.setBackground(this._getBackground());
61634
61660
  }
61635
61661
  if (updateResult.reCompile) {
61636
- (_g = this._compiler) === null || _g === void 0 ? void 0 : _g.clear({ chart: this._chart, vChart: this }, !this._option.animation || !this._spec.animation);
61637
- (_h = this._compiler) === null || _h === void 0 ? void 0 : _h.compile({ chart: this._chart, vChart: this }, {});
61662
+ (_j = this._compiler) === null || _j === void 0 ? void 0 : _j.clear({ chart: this._chart, vChart: this }, !this._option.animation || !this._spec.animation);
61663
+ (_k = this._compiler) === null || _k === void 0 ? void 0 : _k.compile({ chart: this._chart, vChart: this }, {});
61638
61664
  }
61639
61665
  if (updateResult.reSize) {
61640
61666
  const { width, height } = this.getCurrentSize();
@@ -61905,6 +61931,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61905
61931
  if (!isEqual$1(lastSpec.theme, this._spec.theme)) {
61906
61932
  result.changeTheme = true;
61907
61933
  }
61934
+ else if (!isEqual$1(this._spec.background, lastSpec.background)) {
61935
+ result.reMake = true;
61936
+ result.changeBackground = true;
61937
+ }
61908
61938
  const reSize = this._shouldChartResize(lastSpec);
61909
61939
  result.reSize = reSize;
61910
61940
  (_b = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.getVGrammarView()) === null || _b === void 0 ? void 0 : _b.updateLayoutTag();
@@ -66824,7 +66854,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
66824
66854
  registerComponentPlugin(CanvasTooltipHandler);
66825
66855
  };
66826
66856
 
66827
- const version = "1.11.11";
66857
+ const version = "1.11.12";
66828
66858
 
66829
66859
  const addVChartProperty = (data, op) => {
66830
66860
  const context = op.beforeCall();
@@ -70750,7 +70780,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
70750
70780
  rangeSize = isX ? this._option.getChartViewRect().width : this._option.getChartViewRect().height;
70751
70781
  }
70752
70782
  tickCount = tick.tickCount({
70753
- rangeSize,
70783
+ axisLength: rangeSize,
70754
70784
  labelStyle: this._spec.label && this._spec.label.style
70755
70785
  });
70756
70786
  }
@@ -72540,9 +72570,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72540
72570
  var _a, _b;
72541
72571
  this._paddingSpec = normalizeLayoutPaddingSpec((_a = this._spec.padding) !== null && _a !== void 0 ? _a : (_b = this._option) === null || _b === void 0 ? void 0 : _b.getTheme().padding);
72542
72572
  this._updateLayoutRect(this._viewBox);
72543
- if (!isEqual$1(this._spec.background, oldSpec.background)) {
72544
- result.reMake = true;
72545
- }
72546
72573
  }
72547
72574
  updateDataSpec() {
72548
72575
  if (!this._spec.data) {
@@ -78386,7 +78413,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78386
78413
  if (!data || data.length === 0) {
78387
78414
  return data;
78388
78415
  }
78389
- const { angleField, startAngle, endAngle, minAngle, asStartAngle, asEndAngle, asMiddleAngle, asRadian, asRatio, asQuadrant, asK } = op;
78416
+ const { asStartAngle, asEndAngle, asMiddleAngle, asRadian, asRatio, asQuadrant, asK } = op;
78417
+ const angleField = op.angleField();
78418
+ const startAngle = op.startAngle();
78419
+ const endAngle = op.endAngle();
78420
+ const minAngle = op.minAngle();
78390
78421
  const appendArcInfo = (data, startAngle, angle) => {
78391
78422
  data[asStartAngle] = startAngle;
78392
78423
  data[asEndAngle] = startAngle + angle;
@@ -78679,12 +78710,57 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78679
78710
  }
78680
78711
  }
78681
78712
 
78713
+ const getPolarAxisInfo = (spec, chartSpec) => {
78714
+ var _a, _b, _c, _d, _e, _f;
78715
+ const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : (spec.orient === 'angle' ? 'band' : 'linear');
78716
+ const componentName = `${ComponentTypeEnum.polarAxis}-${axisType}`;
78717
+ const startAngleFromSpec = (_b = spec.startAngle) !== null && _b !== void 0 ? _b : chartSpec.startAngle;
78718
+ const endAngleFromSpec = (_c = spec.endAngle) !== null && _c !== void 0 ? _c : chartSpec.endAngle;
78719
+ return {
78720
+ axisType,
78721
+ componentName,
78722
+ startAngle: startAngleFromSpec !== null && startAngleFromSpec !== void 0 ? startAngleFromSpec : POLAR_START_ANGLE,
78723
+ endAngle: endAngleFromSpec !== null && endAngleFromSpec !== void 0 ? endAngleFromSpec : (isValid$1(startAngleFromSpec) ? startAngleFromSpec + 360 : POLAR_END_ANGLE),
78724
+ center: isValid$1(chartSpec.center)
78725
+ ? chartSpec.center
78726
+ : isValid$1(chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerX) || isValid$1(chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerY)
78727
+ ? {
78728
+ x: chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerX,
78729
+ y: chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerY
78730
+ }
78731
+ : undefined,
78732
+ outerRadius: (_f = (_e = (_d = spec.radius) !== null && _d !== void 0 ? _d : chartSpec.outerRadius) !== null && _e !== void 0 ? _e : chartSpec.radius) !== null && _f !== void 0 ? _f : POLAR_DEFAULT_RADIUS,
78733
+ layoutRadius: chartSpec.layoutRadius
78734
+ };
78735
+ };
78736
+ const computeLayoutRadius = (layoutRadius, getLayoutRect, getCenter, startAngle = 0, endAngle = 0 * Math.PI) => {
78737
+ if (isNumber$1(layoutRadius)) {
78738
+ return layoutRadius;
78739
+ }
78740
+ else if (isFunction$1(layoutRadius)) {
78741
+ return layoutRadius(getLayoutRect(), getCenter());
78742
+ }
78743
+ const rect = getLayoutRect();
78744
+ if (layoutRadius === 'auto' && rect.width > 0 && rect.height > 0) {
78745
+ return calculateMaxRadius(rect, getCenter(), startAngle, endAngle);
78746
+ }
78747
+ return Math.min(rect.width / 2, rect.height / 2);
78748
+ };
78749
+
78682
78750
  class BasePieSeries extends PolarSeries {
78683
78751
  constructor() {
78684
78752
  super(...arguments);
78685
78753
  this.transformerConstructor = PieSeriesSpecTransformer;
78686
78754
  this._pieMarkName = "pie";
78687
78755
  this._pieMarkType = "arc";
78756
+ this.getCenter = () => {
78757
+ var _a, _b, _c, _d;
78758
+ const { width, height } = this._region.getLayoutRect();
78759
+ return {
78760
+ x: (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.centerX) !== null && _b !== void 0 ? _b : width / 2,
78761
+ y: (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.centerY) !== null && _d !== void 0 ? _d : height / 2
78762
+ };
78763
+ };
78688
78764
  this._startAngle = POLAR_START_RADIAN;
78689
78765
  this._endAngle = POLAR_END_RADIAN;
78690
78766
  this._pieMark = null;
@@ -78701,14 +78777,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78701
78777
  return polarToCartesian$1(center, (radius + innerRadius) / 2, angle);
78702
78778
  };
78703
78779
  }
78704
- getCenter() {
78705
- var _a, _b, _c, _d;
78706
- const { width, height } = this._region.getLayoutRect();
78707
- return {
78708
- x: (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.centerX) !== null && _b !== void 0 ? _b : width / 2,
78709
- y: (_d = (_c = this._spec) === null || _c === void 0 ? void 0 : _c.centerY) !== null && _d !== void 0 ? _d : height / 2
78710
- };
78711
- }
78712
78780
  _buildMarkAttributeContext() {
78713
78781
  super._buildMarkAttributeContext();
78714
78782
  this._markAttributeContext.getCenter = () => ({
@@ -78745,10 +78813,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78745
78813
  viewData.transform({
78746
78814
  type: 'pie',
78747
78815
  options: {
78748
- angleField: this._angleField[0],
78749
- startAngle: this._startAngle,
78750
- endAngle: this._endAngle,
78751
- minAngle: isValid$1(this._spec.minAngle) ? degreeToRadian(this._spec.minAngle) : 0,
78816
+ angleField: () => this._angleField[0],
78817
+ startAngle: () => this._startAngle,
78818
+ endAngle: () => this._endAngle,
78819
+ minAngle: () => (isValid$1(this._spec.minAngle) ? degreeToRadian(this._spec.minAngle) : 0),
78752
78820
  asStartAngle: ARC_START_ANGLE,
78753
78821
  asEndAngle: ARC_END_ANGLE,
78754
78822
  asRatio: ARC_RATIO,
@@ -78783,6 +78851,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78783
78851
  endAngleScale(datum) {
78784
78852
  return field$2(ARC_END_ANGLE)(datum);
78785
78853
  }
78854
+ _computeLayoutRadius() {
78855
+ return computeLayoutRadius(this._spec.layoutRadius, this.getLayoutRect, this.getCenter, this._startAngle, this._endAngle);
78856
+ }
78786
78857
  initMarkStyle() {
78787
78858
  const pieMark = this._pieMark;
78788
78859
  if (pieMark) {
@@ -78899,28 +78970,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
78899
78970
  }
78900
78971
  _compareSpec(spec, prevSpec, ignoreCheckKeys) {
78901
78972
  ignoreCheckKeys = ignoreCheckKeys !== null && ignoreCheckKeys !== void 0 ? ignoreCheckKeys : { data: true };
78902
- ignoreCheckKeys.centerX = true;
78903
- ignoreCheckKeys.centerX = true;
78904
- ignoreCheckKeys.centerY = true;
78905
- ignoreCheckKeys.centerOffset = true;
78906
- ignoreCheckKeys.radius = true;
78907
- ignoreCheckKeys.innerRadius = true;
78908
- ignoreCheckKeys.cornerRadius = true;
78909
- ignoreCheckKeys.startAngle = true;
78910
- ignoreCheckKeys.endAngle = true;
78911
- ignoreCheckKeys.padAngle = true;
78912
- const { centerX, centerY, centerOffset, radius, innerRadius, cornerRadius, startAngle, endAngle, padAngle } = prevSpec;
78973
+ const defaultIgnoreKeys = [
78974
+ 'centerX',
78975
+ 'centerY',
78976
+ 'centerOffset',
78977
+ 'radius',
78978
+ 'innerRadius',
78979
+ 'cornerRadius',
78980
+ 'startAngle',
78981
+ 'endAngle',
78982
+ 'padAngle'
78983
+ ];
78984
+ defaultIgnoreKeys.forEach(key => {
78985
+ ignoreCheckKeys[key] = true;
78986
+ });
78913
78987
  const result = super._compareSpec(spec, prevSpec, ignoreCheckKeys);
78914
78988
  spec = spec !== null && spec !== void 0 ? spec : {};
78915
- if (spec.centerY !== centerY ||
78916
- spec.centerX !== centerX ||
78917
- spec.centerOffset !== centerOffset ||
78918
- spec.radius !== radius ||
78919
- spec.innerRadius !== innerRadius ||
78920
- spec.cornerRadius !== cornerRadius ||
78921
- spec.startAngle !== startAngle ||
78922
- spec.endAngle !== endAngle ||
78923
- spec.padAngle !== padAngle) {
78989
+ if (defaultIgnoreKeys.some(key => spec[key] !== prevSpec[key])) {
78924
78990
  result.reRender = true;
78925
78991
  result.change = true;
78926
78992
  }
@@ -79194,30 +79260,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79194
79260
  }
79195
79261
  }
79196
79262
 
79197
- const getPolarAxisInfo = (spec, chartSpec) => {
79198
- var _a, _b, _c, _d, _e, _f;
79199
- const axisType = (_a = spec.type) !== null && _a !== void 0 ? _a : (spec.orient === 'angle' ? 'band' : 'linear');
79200
- const componentName = `${ComponentTypeEnum.polarAxis}-${axisType}`;
79201
- const startAngleFromSpec = (_b = spec.startAngle) !== null && _b !== void 0 ? _b : chartSpec.startAngle;
79202
- const endAngleFromSpec = (_c = spec.endAngle) !== null && _c !== void 0 ? _c : chartSpec.endAngle;
79203
- return {
79204
- axisType,
79205
- componentName,
79206
- startAngle: startAngleFromSpec !== null && startAngleFromSpec !== void 0 ? startAngleFromSpec : POLAR_START_ANGLE,
79207
- endAngle: endAngleFromSpec !== null && endAngleFromSpec !== void 0 ? endAngleFromSpec : (isValid$1(startAngleFromSpec) ? startAngleFromSpec + 360 : POLAR_END_ANGLE),
79208
- center: isValid$1(chartSpec.center)
79209
- ? chartSpec.center
79210
- : isValid$1(chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerX) || isValid$1(chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerY)
79211
- ? {
79212
- x: chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerX,
79213
- y: chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerY
79214
- }
79215
- : undefined,
79216
- outerRadius: (_f = (_e = (_d = spec.radius) !== null && _d !== void 0 ? _d : chartSpec.outerRadius) !== null && _e !== void 0 ? _e : chartSpec.radius) !== null && _f !== void 0 ? _f : POLAR_DEFAULT_RADIUS,
79217
- layoutRadius: chartSpec.layoutRadius
79218
- };
79219
- };
79220
-
79221
79263
  class PolarAxis extends AxisComponent {
79222
79264
  get center() {
79223
79265
  return this._center;
@@ -79261,7 +79303,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79261
79303
  }
79262
79304
  const specInfos = [];
79263
79305
  let angleAxisIndex;
79306
+ let radiusAxisIndex;
79264
79307
  const radiusAxisSpecInfos = [];
79308
+ const angleAxisSpecInfos = [];
79265
79309
  axesSpec.forEach((s, i) => {
79266
79310
  if (!isValidPolarAxis(s)) {
79267
79311
  return;
@@ -79282,14 +79326,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79282
79326
  specInfos.push(info);
79283
79327
  if (s.orient === 'radius') {
79284
79328
  radiusAxisSpecInfos.push(info);
79329
+ radiusAxisIndex = i;
79285
79330
  }
79286
79331
  else {
79332
+ angleAxisSpecInfos.push(info);
79287
79333
  angleAxisIndex = i;
79288
79334
  }
79289
79335
  });
79290
79336
  radiusAxisSpecInfos.forEach(info => {
79291
79337
  info.angleAxisIndex = angleAxisIndex;
79292
79338
  });
79339
+ angleAxisSpecInfos.forEach(info => {
79340
+ info.radiusAxisIndex = radiusAxisIndex;
79341
+ });
79293
79342
  return specInfos;
79294
79343
  }
79295
79344
  static createComponent(specInfo, options) {
@@ -79337,6 +79386,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79337
79386
  const region = (_a = this.getRegions()) === null || _a === void 0 ? void 0 : _a[0];
79338
79387
  return region ? region.getLayoutStartPoint() : pos;
79339
79388
  };
79389
+ this.getRefLayoutRect = () => {
79390
+ return this.getRegions()[0].getLayoutRect();
79391
+ };
79340
79392
  this._coordinateType = 'polar';
79341
79393
  }
79342
79394
  setAttrFromSpec() {
@@ -79433,7 +79485,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79433
79485
  coordToPoint: this.coordToPoint.bind(this),
79434
79486
  pointToCoord: this.pointToCoord.bind(this),
79435
79487
  center: this.getCenter.bind(this),
79436
- layoutRadius: this.computeLayoutRadius.bind(this),
79488
+ layoutRadius: this._computeLayoutRadius.bind(this),
79437
79489
  getScale,
79438
79490
  getAxisId: () => this.id,
79439
79491
  getSpec: () => this._spec
@@ -79524,6 +79576,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79524
79576
  return this._startAngle;
79525
79577
  }
79526
79578
  _layoutAngleAxis() {
79579
+ var _a, _b, _c;
79527
79580
  const center = this.getCenter();
79528
79581
  const radius = this.computeLayoutOuterRadius();
79529
79582
  const innerRadius = this.computeLayoutInnerRadius();
@@ -79531,7 +79584,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79531
79584
  const items = this.getLabelItems(angleRange);
79532
79585
  const commonAttrs = Object.assign(Object.assign({}, this.getLayoutStartPoint()), { inside: this._spec.inside, center,
79533
79586
  radius,
79534
- innerRadius, startAngle: this._startAngle, endAngle: this._endAngle });
79587
+ innerRadius, startAngle: this._startAngle, endAngle: this._endAngle, sides: ((_c = (_b = (_a = this._getRelatedAxis(this._option.radiusAxisIndex)) === null || _a === void 0 ? void 0 : _a.getSpec()) === null || _b === void 0 ? void 0 : _b.grid) === null || _c === void 0 ? void 0 : _c.smooth)
79588
+ ? undefined
79589
+ : this.getScale().domain().length });
79535
79590
  const attrs = Object.assign(Object.assign({}, commonAttrs), { title: {
79536
79591
  text: this._spec.title.text || this._dataFieldText
79537
79592
  }, items, orient: 'angle' });
@@ -79554,44 +79609,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
79554
79609
  text: this._spec.title.text || this._dataFieldText
79555
79610
  }, items, orient: 'radius' });
79556
79611
  if ((_a = this._spec.grid) === null || _a === void 0 ? void 0 : _a.visible) {
79557
- attrs.grid = Object.assign({ items: items[0], type: ((_b = this._spec.grid) === null || _b === void 0 ? void 0 : _b.smooth) ? 'circle' : 'polygon', center, closed: true, sides: (_c = this._getRelatedAngleAxis()) === null || _c === void 0 ? void 0 : _c.getScale().domain().length, startAngle: this._startAngle, endAngle: this._endAngle }, commonAttrs);
79612
+ attrs.grid = Object.assign({ items: items[0], type: ((_b = this._spec.grid) === null || _b === void 0 ? void 0 : _b.smooth) ? 'circle' : 'polygon', center, closed: true, sides: (_c = this._getRelatedAxis(this._option.angleAxisIndex)) === null || _c === void 0 ? void 0 : _c.getScale().domain().length, startAngle: this._startAngle, endAngle: this._endAngle }, commonAttrs);
79558
79613
  }
79559
79614
  this._update(attrs);
79560
79615
  }
79561
- _getRelatedAngleAxis() {
79562
- const index = this._option.angleAxisIndex;
79616
+ _getRelatedAxis(index) {
79563
79617
  if (isValid$1(index)) {
79564
79618
  return this._option.getComponentByIndex(this.specKey, index);
79565
79619
  }
79566
79620
  return undefined;
79567
79621
  }
79568
- computeLayoutRadius() {
79569
- const layoutRect = this.getRefLayoutRect();
79570
- if (isNumber$1(this._spec.layoutRadius)) {
79571
- return this._spec.layoutRadius;
79572
- }
79573
- else if (isFunction$1(this._spec.layoutRadius)) {
79574
- return this._spec.layoutRadius(layoutRect, this.getCenter());
79575
- }
79576
- const { width, height } = layoutRect;
79577
- if (this._spec.layoutRadius === 'auto' && width > 0 && height > 0) {
79578
- return calculateMaxRadius(layoutRect, this.getCenter(), this._startAngle, this._endAngle);
79579
- }
79580
- return Math.min(width / 2, height / 2);
79622
+ _computeLayoutRadius() {
79623
+ return computeLayoutRadius(this._spec.layoutRadius, this.getRefLayoutRect, this.getCenter, this._startAngle, this._endAngle);
79581
79624
  }
79582
79625
  computeLayoutOuterRadius() {
79583
79626
  var _a;
79584
79627
  const radius = (_a = this._spec.outerRadius) !== null && _a !== void 0 ? _a : this._spec.radius;
79585
79628
  const outerRadius = radius !== null && radius !== void 0 ? radius : this.getRefSeriesRadius().outerRadius;
79586
- return this.computeLayoutRadius() * outerRadius;
79629
+ return this._computeLayoutRadius() * outerRadius;
79587
79630
  }
79588
79631
  computeLayoutInnerRadius() {
79589
79632
  var _a;
79590
79633
  const innerRadius = (_a = this._spec.innerRadius) !== null && _a !== void 0 ? _a : this.getRefSeriesRadius().innerRadius;
79591
- return this.computeLayoutRadius() * innerRadius;
79592
- }
79593
- getRefLayoutRect() {
79594
- return this.getRegions()[0].getLayoutRect();
79634
+ return this._computeLayoutRadius() * innerRadius;
79595
79635
  }
79596
79636
  getRefSeriesRadius() {
79597
79637
  let outerRadius = POLAR_DEFAULT_RADIUS;
@@ -84232,7 +84272,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
84232
84272
  else {
84233
84273
  this._funnelAlign = ['left', 'right'].includes(this._spec.funnelAlign) ? this._spec.funnelAlign : 'center';
84234
84274
  }
84235
- if (this._spec.categoryField) {
84275
+ if (!this._seriesField && this._spec.categoryField) {
84236
84276
  this.setSeriesField(this._spec.categoryField);
84237
84277
  }
84238
84278
  }
@@ -89121,12 +89161,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89121
89161
  _getAngleValueStartWithoutMask(datum) {
89122
89162
  const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
89123
89163
  const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
89124
- return Math.min(startAngle + this._padAngle / 2, (startAngle + endAngle) / 2);
89164
+ return clamper(startAngle, (startAngle + endAngle) / 2)(startAngle + (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
89125
89165
  }
89126
89166
  _getAngleValueEndWithoutMask(datum) {
89127
89167
  const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
89128
89168
  const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
89129
- return Math.max(endAngle - this._padAngle / 2, (startAngle + endAngle) / 2);
89169
+ return clamper(endAngle, (startAngle + endAngle) / 2)(endAngle - (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
89130
89170
  }
89131
89171
  _getAngleValueStartWithoutPadAngle(datum) {
89132
89172
  return isValid$1(datum[SEGMENT_FIELD_START])
@@ -91485,7 +91525,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91485
91525
  return false;
91486
91526
  }
91487
91527
  _getDefaultSeriesSpec(spec) {
91488
- return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField || spec.seriesField, valueField: spec.valueField || spec.angleField, center: spec.center, centerOffset: spec.centerOffset, cornerRadius: spec.cornerRadius, padAngle: spec.padAngle, minAngle: spec.minAngle });
91528
+ return Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField || spec.seriesField, valueField: spec.valueField || spec.angleField, center: spec.center, centerOffset: spec.centerOffset, cornerRadius: spec.cornerRadius, padAngle: spec.padAngle, minAngle: spec.minAngle, layoutRadius: spec.layoutRadius });
91489
91529
  }
91490
91530
  }
91491
91531
 
@@ -93113,6 +93153,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93113
93153
  }
93114
93154
  getBoundsInRect(rect, fullSpace) {
93115
93155
  if (!this._visible) {
93156
+ if (this._legendComponent && this._legendComponent.parent) {
93157
+ this._legendComponent.parent.removeChild(this._legendComponent);
93158
+ this._legendComponent = null;
93159
+ }
93116
93160
  return { x1: 0, y1: 0, x2: 0, y2: 0 };
93117
93161
  }
93118
93162
  const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
@@ -100345,9 +100389,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100345
100389
  return data;
100346
100390
  }
100347
100391
  _extendDatumOutOfBrush(elementsMap) {
100392
+ var _a;
100348
100393
  const data = [];
100349
100394
  for (const elementKey in elementsMap) {
100350
- data.push(elementsMap[elementKey].data[0]);
100395
+ data.push((_a = elementsMap[elementKey].data) === null || _a === void 0 ? void 0 : _a[0]);
100351
100396
  }
100352
100397
  return data;
100353
100398
  }