@visactor/vchart 1.12.5 → 1.12.6

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 (143) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +447 -362
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart.js +2 -2
  6. package/cjs/chart/base/base-chart.js.map +1 -1
  7. package/cjs/chart/mosaic/mosaic.d.ts +0 -1
  8. package/cjs/chart/mosaic/mosaic.js +0 -3
  9. package/cjs/chart/mosaic/mosaic.js.map +1 -1
  10. package/cjs/chart/pie/interface.d.ts +2 -2
  11. package/cjs/chart/pie/interface.js.map +1 -1
  12. package/cjs/chart/polar/interface.d.ts +2 -0
  13. package/cjs/chart/polar/interface.js.map +1 -1
  14. package/cjs/compile/mark/compilable-mark.d.ts +1 -1
  15. package/cjs/compile/mark/compilable-mark.js +4 -4
  16. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  17. package/cjs/compile/mark/interface.d.ts +1 -0
  18. package/cjs/compile/mark/interface.js.map +1 -1
  19. package/cjs/component/axis/base-axis.d.ts +1 -2
  20. package/cjs/component/axis/base-axis.js +0 -3
  21. package/cjs/component/axis/base-axis.js.map +1 -1
  22. package/cjs/component/axis/cartesian/axis.js +1 -1
  23. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  24. package/cjs/component/axis/polar/axis.d.ts +0 -1
  25. package/cjs/component/axis/polar/axis.js +4 -20
  26. package/cjs/component/axis/polar/axis.js.map +1 -1
  27. package/cjs/component/axis/polar/interface/spec.d.ts +3 -1
  28. package/cjs/component/axis/polar/interface/spec.js.map +1 -1
  29. package/cjs/component/base/base-component.js +1 -3
  30. package/cjs/component/base/base-component.js.map +1 -1
  31. package/cjs/component/custom-mark/custom-mark.d.ts +0 -1
  32. package/cjs/component/custom-mark/custom-mark.js +1 -12
  33. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  34. package/cjs/component/label/base-label.d.ts +1 -2
  35. package/cjs/component/label/base-label.js +0 -3
  36. package/cjs/component/label/base-label.js.map +1 -1
  37. package/cjs/component/label/label.d.ts +0 -1
  38. package/cjs/component/label/label.js +2 -12
  39. package/cjs/component/label/label.js.map +1 -1
  40. package/cjs/component/label/total-label.d.ts +1 -1
  41. package/cjs/component/label/total-label.js +5 -12
  42. package/cjs/component/label/total-label.js.map +1 -1
  43. package/cjs/component/label/util.d.ts +1 -1
  44. package/cjs/component/label/util.js +12 -7
  45. package/cjs/component/label/util.js.map +1 -1
  46. package/cjs/component/legend/util.d.ts +2 -2
  47. package/cjs/constant/correlation.js +1 -2
  48. package/cjs/constant/layout.js +2 -1
  49. package/cjs/core/index.d.ts +1 -1
  50. package/cjs/core/index.js +1 -1
  51. package/cjs/core/index.js.map +1 -1
  52. package/cjs/core/vchart.d.ts +1 -1
  53. package/cjs/core/vchart.js +20 -20
  54. package/cjs/core/vchart.js.map +1 -1
  55. package/cjs/region/region.js +2 -3
  56. package/cjs/region/region.js.map +1 -1
  57. package/cjs/series/base/base-series.d.ts +6 -5
  58. package/cjs/series/base/base-series.js +22 -11
  59. package/cjs/series/base/base-series.js.map +1 -1
  60. package/cjs/series/base/constant.js +1 -0
  61. package/cjs/series/base/constant.js.map +1 -1
  62. package/cjs/series/gauge/interface.d.ts +1 -1
  63. package/cjs/series/gauge/interface.js.map +1 -1
  64. package/cjs/series/polar/animation.d.ts +8 -11
  65. package/cjs/series/polar/animation.js +18 -23
  66. package/cjs/series/polar/animation.js.map +1 -1
  67. package/cjs/series/radar/animation.d.ts +0 -3
  68. package/cjs/series/radar/animation.js +4 -4
  69. package/cjs/series/radar/animation.js.map +1 -1
  70. package/cjs/series/radar/radar.js +10 -7
  71. package/cjs/series/radar/radar.js.map +1 -1
  72. package/cjs/typings/spec/common.d.ts +5 -2
  73. package/cjs/typings/spec/common.js.map +1 -1
  74. package/esm/chart/base/base-chart.js +2 -2
  75. package/esm/chart/base/base-chart.js.map +1 -1
  76. package/esm/chart/mosaic/mosaic.d.ts +0 -1
  77. package/esm/chart/mosaic/mosaic.js +0 -3
  78. package/esm/chart/mosaic/mosaic.js.map +1 -1
  79. package/esm/chart/pie/interface.d.ts +2 -2
  80. package/esm/chart/pie/interface.js.map +1 -1
  81. package/esm/chart/polar/interface.d.ts +2 -0
  82. package/esm/chart/polar/interface.js.map +1 -1
  83. package/esm/compile/mark/compilable-mark.d.ts +1 -1
  84. package/esm/compile/mark/compilable-mark.js +5 -4
  85. package/esm/compile/mark/compilable-mark.js.map +1 -1
  86. package/esm/compile/mark/interface.d.ts +1 -0
  87. package/esm/compile/mark/interface.js.map +1 -1
  88. package/esm/component/axis/base-axis.d.ts +1 -2
  89. package/esm/component/axis/base-axis.js +0 -3
  90. package/esm/component/axis/base-axis.js.map +1 -1
  91. package/esm/component/axis/cartesian/axis.js +1 -1
  92. package/esm/component/axis/cartesian/axis.js.map +1 -1
  93. package/esm/component/axis/polar/axis.d.ts +0 -1
  94. package/esm/component/axis/polar/axis.js +4 -22
  95. package/esm/component/axis/polar/axis.js.map +1 -1
  96. package/esm/component/axis/polar/interface/spec.d.ts +3 -1
  97. package/esm/component/axis/polar/interface/spec.js.map +1 -1
  98. package/esm/component/base/base-component.js +1 -3
  99. package/esm/component/base/base-component.js.map +1 -1
  100. package/esm/component/custom-mark/custom-mark.d.ts +0 -1
  101. package/esm/component/custom-mark/custom-mark.js +0 -13
  102. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  103. package/esm/component/label/base-label.d.ts +1 -2
  104. package/esm/component/label/base-label.js +0 -3
  105. package/esm/component/label/base-label.js.map +1 -1
  106. package/esm/component/label/label.d.ts +0 -1
  107. package/esm/component/label/label.js +1 -13
  108. package/esm/component/label/label.js.map +1 -1
  109. package/esm/component/label/total-label.d.ts +1 -1
  110. package/esm/component/label/total-label.js +4 -13
  111. package/esm/component/label/total-label.js.map +1 -1
  112. package/esm/component/label/util.d.ts +1 -1
  113. package/esm/component/label/util.js +12 -7
  114. package/esm/component/label/util.js.map +1 -1
  115. package/esm/component/legend/util.d.ts +2 -2
  116. package/esm/constant/correlation.js +1 -2
  117. package/esm/constant/layout.js +2 -1
  118. package/esm/core/index.d.ts +1 -1
  119. package/esm/core/index.js +1 -1
  120. package/esm/core/index.js.map +1 -1
  121. package/esm/core/vchart.d.ts +1 -1
  122. package/esm/core/vchart.js +22 -22
  123. package/esm/core/vchart.js.map +1 -1
  124. package/esm/region/region.js +2 -3
  125. package/esm/region/region.js.map +1 -1
  126. package/esm/series/base/base-series.d.ts +6 -5
  127. package/esm/series/base/base-series.js +20 -10
  128. package/esm/series/base/base-series.js.map +1 -1
  129. package/esm/series/base/constant.js +1 -0
  130. package/esm/series/base/constant.js.map +1 -1
  131. package/esm/series/gauge/interface.d.ts +1 -1
  132. package/esm/series/gauge/interface.js.map +1 -1
  133. package/esm/series/polar/animation.d.ts +8 -11
  134. package/esm/series/polar/animation.js +17 -24
  135. package/esm/series/polar/animation.js.map +1 -1
  136. package/esm/series/radar/animation.d.ts +0 -3
  137. package/esm/series/radar/animation.js +4 -4
  138. package/esm/series/radar/animation.js.map +1 -1
  139. package/esm/series/radar/radar.js +10 -7
  140. package/esm/series/radar/radar.js.map +1 -1
  141. package/esm/typings/spec/common.d.ts +5 -2
  142. package/esm/typings/spec/common.js.map +1 -1
  143. package/package.json +19 -19
package/build/index.js CHANGED
@@ -1312,12 +1312,12 @@
1312
1312
  function radianToDegree(radian) {
1313
1313
  return 180 * radian / Math.PI;
1314
1314
  }
1315
- const clampRadian$1 = function () {
1315
+ const clampRadian = function () {
1316
1316
  let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
1317
1317
  if (angle < 0) for (; angle < -tau$1;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
1318
1318
  return angle;
1319
1319
  };
1320
- const clampAngleByRadian = clampRadian$1;
1320
+ const clampAngleByRadian = clampRadian;
1321
1321
  function polarToCartesian(center, radius, angleInRadian) {
1322
1322
  return radius ? {
1323
1323
  x: center.x + radius * Math.cos(angleInRadian),
@@ -1327,6 +1327,37 @@
1327
1327
  y: center.y
1328
1328
  };
1329
1329
  }
1330
+ function cartesianToPolar(point) {
1331
+ let center = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1332
+ x: 0,
1333
+ y: 0
1334
+ };
1335
+ let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1336
+ let endAngle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2 * Math.PI;
1337
+ const {
1338
+ x: x,
1339
+ y: y
1340
+ } = point,
1341
+ {
1342
+ x: centerX,
1343
+ y: centerY
1344
+ } = center;
1345
+ let dx = x - centerX,
1346
+ dy = y - centerY;
1347
+ const radius = Math.sqrt(dx * dx + dy * dy);
1348
+ if (0 === radius) return {
1349
+ radius: 0,
1350
+ angle: 0
1351
+ };
1352
+ dx /= radius, dy /= radius;
1353
+ let radian = Math.atan2(dy, dx);
1354
+ if (radian < startAngle) for (; radian <= startAngle;) radian += 2 * Math.PI;
1355
+ if (radian > endAngle) for (; radian >= endAngle;) radian -= 2 * Math.PI;
1356
+ return {
1357
+ radius: radius,
1358
+ angle: radian
1359
+ };
1360
+ }
1330
1361
  function getAngleByPoint(center, point) {
1331
1362
  return Math.atan2(point.y - center.y, point.x - center.x);
1332
1363
  }
@@ -7849,7 +7880,7 @@
7849
7880
  this.bounds.add(cx + xmin, cy + ymin), this.bounds.add(cx + xmax, cy + ymax);
7850
7881
  }
7851
7882
  arcTo(x1, y1, x2, y2, radius) {
7852
- throw new Error("不支持arcTo");
7883
+ this.bounds.add(x1, y1);
7853
7884
  }
7854
7885
  bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
7855
7886
  this.bounds.add(cp1x, cp1y), this.bounds.add(cp2x, cp2y), this.bounds.add(x, y);
@@ -8058,19 +8089,25 @@
8058
8089
  }
8059
8090
  const addArcToBezierPath$1 = (bezierPath, startAngle, endAngle, cx, cy, rx, ry) => {
8060
8091
  const delta = Math.abs(endAngle - startAngle),
8061
- len = 4 * Math.tan(delta / 4) / 3,
8062
- dir = endAngle < startAngle ? -1 : 1,
8063
- c1 = Math.cos(startAngle),
8064
- s1 = Math.sin(startAngle),
8065
- c2 = Math.cos(endAngle),
8066
- s2 = Math.sin(endAngle),
8067
- x1 = c1 * rx + cx,
8068
- y1 = s1 * ry + cy,
8069
- x4 = c2 * rx + cx,
8070
- y4 = s2 * ry + cy,
8071
- hx = rx * len * dir,
8072
- hy = ry * len * dir;
8073
- bezierPath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);
8092
+ count = delta > .5 * Math.PI ? Math.ceil(2 * delta / Math.PI) : 1,
8093
+ stepAngle = (endAngle - startAngle) / count;
8094
+ for (let i = 0; i < count; i++) {
8095
+ const sa = startAngle + stepAngle * i,
8096
+ ea = startAngle + stepAngle * (i + 1),
8097
+ len = 4 * Math.tan(Math.abs(stepAngle) / 4) / 3,
8098
+ dir = ea < sa ? -1 : 1,
8099
+ c1 = Math.cos(sa),
8100
+ s1 = Math.sin(sa),
8101
+ c2 = Math.cos(ea),
8102
+ s2 = Math.sin(ea),
8103
+ x1 = c1 * rx + cx,
8104
+ y1 = s1 * ry + cy,
8105
+ x4 = c2 * rx + cx,
8106
+ y4 = s2 * ry + cy,
8107
+ hx = rx * len * dir,
8108
+ hy = ry * len * dir;
8109
+ bezierPath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);
8110
+ }
8074
8111
  };
8075
8112
 
8076
8113
  const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
@@ -15825,6 +15862,7 @@
15825
15862
  validCheck(attribute, theme, aabbBounds, graphic) {
15826
15863
  if (!graphic) return !0;
15827
15864
  if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
15865
+ if (graphic.shadowRoot) return !0;
15828
15866
  if (!graphic.valid) return aabbBounds.clear(), !1;
15829
15867
  const {
15830
15868
  visible = theme.visible
@@ -18957,13 +18995,23 @@
18957
18995
  if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
18958
18996
  }
18959
18997
  get cliped() {
18998
+ var _a, _b;
18960
18999
  const textTheme = this.getGraphicTheme(),
18961
- attribute = this.attribute;
18962
- if (this.isMultiLine) return;
18963
- const {
18964
- maxLineWidth = textTheme.maxLineWidth
18965
- } = attribute;
18966
- return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString());
19000
+ attribute = this.attribute,
19001
+ {
19002
+ maxLineWidth = textTheme.maxLineWidth,
19003
+ text: text,
19004
+ whiteSpace = textTheme.whiteSpace
19005
+ } = attribute;
19006
+ if (!Number.isFinite(maxLineWidth)) return !1;
19007
+ if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
19008
+ let mergedText = "";
19009
+ this.cache.layoutData.lines.forEach(item => {
19010
+ mergedText += item.str;
19011
+ });
19012
+ return (Array.isArray(text) ? text.join("") : text) !== mergedText;
19013
+ }
19014
+ return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
18967
19015
  }
18968
19016
  get multilineLayout() {
18969
19017
  if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
@@ -20732,10 +20780,22 @@
20732
20780
  }
20733
20781
  draw(ctx, lastLine, x, y, drawEllipsis, drawIcon) {
20734
20782
  if (drawEllipsis && (lastLine || this.paragraphs.some(p => p.overflow))) {
20735
- let otherParagraphWidth = 0;
20783
+ let emptyOverflow = !0,
20784
+ skipEllipsis = !1;
20736
20785
  for (let i = this.paragraphs.length - 1; i >= 0; i--) {
20737
20786
  const paragraph = this.paragraphs[i];
20738
- if (paragraph.overflow) continue;
20787
+ if (paragraph.overflow) emptyOverflow = emptyOverflow && "" === paragraph.text;else if (emptyOverflow) {
20788
+ skipEllipsis = !0;
20789
+ break;
20790
+ }
20791
+ }
20792
+ let otherParagraphWidth = 0;
20793
+ if (!skipEllipsis) for (let i = this.paragraphs.length - 1; i >= 0; i--) {
20794
+ const paragraph = this.paragraphs[i];
20795
+ if (paragraph.overflow) {
20796
+ if ("" === paragraph.text) break;
20797
+ continue;
20798
+ }
20739
20799
  if (paragraph instanceof RichTextIcon) break;
20740
20800
  if ("vertical" === this.direction && "vertical" !== paragraph.direction) {
20741
20801
  paragraph.verticalEllipsis = !0;
@@ -20960,6 +21020,21 @@
20960
21020
  getFrameCache() {
20961
21021
  return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
20962
21022
  }
21023
+ get cliped() {
21024
+ const frameCache = this.getFrameCache();
21025
+ if (frameCache.actualHeight > frameCache.height) return !0;
21026
+ const {
21027
+ disableAutoWrapLine: disableAutoWrapLine
21028
+ } = this.attribute;
21029
+ if (disableAutoWrapLine) for (let i = 0; i < frameCache.lines.length; i++) {
21030
+ const l = frameCache.lines[i];
21031
+ for (let j = 0; j < l.paragraphs.length; j++) {
21032
+ const p = l.paragraphs[j];
21033
+ if (p.overflow && "" !== p.text) return !0;
21034
+ }
21035
+ }
21036
+ return !1;
21037
+ }
20963
21038
  combinedStyleToCharacter(config) {
20964
21039
  const {
20965
21040
  fill: fill,
@@ -30379,7 +30454,7 @@
30379
30454
  }
30380
30455
  function richTextAttributeTransform(attributes) {
30381
30456
  var _a, _b;
30382
- return attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.maxWidth = attributes.maxLineWidth, attributes.textConfig = attributes.text.text || attributes.text, attributes;
30457
+ return isValid$1(attributes.maxLineWidth) && (attributes.maxWidth = attributes.maxLineWidth, delete attributes.maxLineWidth), attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.textConfig = attributes.text.text || attributes.text, attributes;
30383
30458
  }
30384
30459
  function htmlAttributeTransform(attributes) {
30385
30460
  const {
@@ -30496,6 +30571,8 @@
30496
30571
  zIndex: 1
30497
30572
  }, "group");
30498
30573
  let symbol,
30574
+ tagX = -parsedPadding[3],
30575
+ tagY = -parsedPadding[0],
30499
30576
  tagWidth = parsedPadding[1] + parsedPadding[3],
30500
30577
  tagHeight = parsedPadding[0] + parsedPadding[2],
30501
30578
  textX = 0,
@@ -30530,25 +30607,7 @@
30530
30607
  x: textX,
30531
30608
  y: 0
30532
30609
  });
30533
- textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
30534
- const {
30535
- visible: bgVisible
30536
- } = panel,
30537
- backgroundStyle = __rest$d(panel, ["visible"]);
30538
- if (visible && isBoolean$1(bgVisible)) {
30539
- const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30540
- visible: bgVisible && !!text,
30541
- x: textShape.AABBBounds.x1 - parsedPadding[1],
30542
- y: textShape.AABBBounds.y1 - parsedPadding[0],
30543
- width: textShape.AABBBounds.width() + (parsedPadding[1] + parsedPadding[3]),
30544
- height: textShape.AABBBounds.height() + (parsedPadding[0] + parsedPadding[2])
30545
- }), "rect");
30546
- if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
30547
- const customShape = backgroundStyle.customShape;
30548
- bgRect.pathProxy = attrs => customShape(textShape.attribute, attrs, new CustomPath2D());
30549
- }
30550
- this._bgRect = bgRect;
30551
- }
30610
+ textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
30552
30611
  } else {
30553
30612
  const textAttrs = Object.assign(Object.assign({
30554
30613
  text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
@@ -30570,11 +30629,9 @@
30570
30629
  textAlign: textAlign,
30571
30630
  textBaseline: textBaseline
30572
30631
  } = textStyle;
30573
- (isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
30574
- let x = 0,
30575
- y = 0,
30576
- flag = 0;
30577
- "left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
30632
+ (isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2]))), tagX = 0, tagY = 0;
30633
+ let flag = 0;
30634
+ "left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (tagX -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (tagX -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2));
30578
30635
  const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
30579
30636
  shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign;
30580
30637
  if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
@@ -30618,25 +30675,25 @@
30618
30675
  });
30619
30676
  }
30620
30677
  }
30621
- "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
30622
- const {
30623
- visible: bgVisible
30624
- } = panel,
30625
- backgroundStyle = __rest$d(panel, ["visible"]);
30626
- if (visible && isBoolean$1(bgVisible)) {
30627
- const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30628
- visible: bgVisible && !!text,
30629
- x: x,
30630
- y: y,
30631
- width: tagWidth,
30632
- height: tagHeight
30633
- }), "rect");
30634
- if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
30635
- const customShape = backgroundStyle.customShape;
30636
- bgRect.pathProxy = attrs => customShape(textShape.attribute, attrs, new CustomPath2D());
30637
- }
30638
- this._bgRect = bgRect;
30678
+ "middle" === textBaseline ? (tagY -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (tagY -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
30679
+ }
30680
+ const {
30681
+ visible: bgVisible
30682
+ } = panel,
30683
+ backgroundStyle = __rest$d(panel, ["visible"]);
30684
+ if (visible && isBoolean$1(bgVisible)) {
30685
+ const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30686
+ visible: bgVisible && !!text,
30687
+ width: tagWidth,
30688
+ height: tagHeight,
30689
+ x: tagX,
30690
+ y: tagY
30691
+ }), "rect");
30692
+ if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
30693
+ const customShape = backgroundStyle.customShape;
30694
+ bgRect.pathProxy = attrs => customShape(this, attrs, new CustomPath2D());
30639
30695
  }
30696
+ this._bgRect = bgRect;
30640
30697
  }
30641
30698
  this._textShape = textShape, this._symbol = symbol, this.resetStates();
30642
30699
  }
@@ -31870,7 +31927,10 @@
31870
31927
  } = text.attribute;
31871
31928
  if (line.customShape) {
31872
31929
  const customShape = line.customShape;
31873
- lineGraphic.pathProxy = attrs => customShape(text.attribute, attrs, new CustomPath2D());
31930
+ lineGraphic.pathProxy = attrs => customShape({
31931
+ text: text,
31932
+ baseMark: baseMark
31933
+ }, attrs, new CustomPath2D());
31874
31934
  }
31875
31935
  return baseMark && baseMark.attribute.fill && lineGraphic.setAttribute("stroke", baseMark.attribute.fill), this.attribute.line && !isEmpty(this.attribute.line.style) && lineGraphic.setAttributes(this.attribute.line.style), this._setStatesOfLabelLine(lineGraphic), lineGraphic;
31876
31936
  }
@@ -32531,7 +32591,7 @@
32531
32591
  };
32532
32592
  class ArcInfo {
32533
32593
  constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle, innerRadius, outerRadius, circleCenter) {
32534
- this.refDatum = refDatum, this.center = center, this.outerCenter = outerCenter, this.quadrant = quadrant, this.radian = radian, this.middleAngle = middleAngle, this.innerRadius = innerRadius, this.outerRadius = outerRadius, this.circleCenter = circleCenter, this.labelVisible = !0, this.labelLimit = 0;
32594
+ this.refDatum = refDatum, this.center = center, this.outerCenter = outerCenter, this.quadrant = quadrant, this.radian = radian, this.middleAngle = middleAngle, this.innerRadius = innerRadius, this.outerRadius = outerRadius, this.circleCenter = circleCenter, this.labelVisible = !0;
32535
32595
  }
32536
32596
  getLabelBounds() {
32537
32597
  return this.labelPosition && this.labelSize ? {
@@ -32567,7 +32627,7 @@
32567
32627
  };
32568
32628
  }
32569
32629
  _layout(texts) {
32570
- var _a;
32630
+ var _a, _b, _c;
32571
32631
  if (!texts || !texts.length) return;
32572
32632
  const labels = super._layout(texts),
32573
32633
  textBoundsArray = labels.map(label => this.getGraphicBounds(label)),
@@ -32596,11 +32656,10 @@
32596
32656
  x: basedArc.labelPosition.x,
32597
32657
  y: basedArc.labelPosition.y,
32598
32658
  angle: basedArc.angle,
32599
- maxLineWidth: basedArc.labelLimit,
32600
32659
  points: basedArc.pointA && basedArc.pointB && basedArc.pointC ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : void 0,
32601
32660
  line: basedArc.labelLine
32602
32661
  };
32603
- "richtext" === labels[i].type && (labelAttribute.width = basedArc.labelLimit), labels[i].setAttributes(labelAttribute);
32662
+ "richtext" === labels[i].type ? labelAttribute.width = null !== (_b = basedArc.labelLimit) && void 0 !== _b ? _b : labels[i].attribute.width : labelAttribute.maxLineWidth = null !== (_c = basedArc.labelLimit) && void 0 !== _c ? _c : labels[i].attribute.maxLineWidth, labels[i].setAttributes(labelAttribute);
32604
32663
  }
32605
32664
  }
32606
32665
  return labels;
@@ -32780,12 +32839,14 @@
32780
32839
  default:
32781
32840
  cx = pointB.x + flag * this._line2MinLength;
32782
32841
  }
32783
- labelWidth = Math.max(this._ellipsisWidth, labelWidth), arc.labelLimit = labelWidth, arc.pointC = {
32842
+ labelWidth = Math.max(this._ellipsisWidth, labelWidth);
32843
+ const needAdjustLimit = labelWidth < arc.labelSize.width - 1;
32844
+ arc.labelLimit = needAdjustLimit ? labelWidth : null, arc.pointC = {
32784
32845
  x: cx,
32785
32846
  y: labelPosition.y
32786
32847
  };
32787
32848
  const align = this._computeAlign(arc, attribute),
32788
- targetCenterOffset = getAlignOffset(align) * (arc.labelLimit < arc.labelSize.width ? arc.labelLimit : arc.labelSize.width);
32849
+ targetCenterOffset = getAlignOffset(align) * (needAdjustLimit ? labelWidth : arc.labelSize.width);
32789
32850
  "edge" === labelLayoutAlign ? (labelPosition.x = (flag > 0 ? plotLayout_x2 : plotLayout_x1) - flag * targetCenterOffset + flag * this._alignOffset, arc.pointC.x += flag * this._alignOffset) : labelPosition.x = cx + flag * (this._alignOffset + spaceWidth + targetCenterOffset);
32790
32851
  }
32791
32852
  _computeAlign(arc, attribute) {
@@ -33485,34 +33546,10 @@
33485
33546
  zIndex: 1
33486
33547
  };
33487
33548
 
33488
- const clampRadian = function () {
33489
- let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
33490
- if (angle < 0) for (; angle < 0;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
33491
- return angle;
33492
- };
33493
- function isInRange(a, min, max) {
33494
- return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
33495
- }
33496
- function getCircleLabelPosition(tickPosition, tickVector, text, style) {
33497
- const labelBounds = getTextBounds(Object.assign({
33498
- text: text
33499
- }, style)),
33500
- width = labelBounds.width(),
33501
- height = labelBounds.height(),
33502
- angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
33503
- PI_3_4 = 3 * Math.PI / 4,
33504
- PI_1_4 = Math.PI / 4,
33505
- PI_1_2 = Math.PI / 2,
33506
- baseX = tickPosition.x;
33507
- let dx = 0;
33508
- dx = isInRange(angle, -PI_3_4, -PI_1_4) ? ((angle + PI_3_4) / PI_1_2 - .5) * width : isInRange(angle, PI_1_4, PI_3_4) ? (.5 - (angle - PI_1_4) / PI_1_2) * width : Math.cos(angle) >= 0 ? .5 * width : .5 * -width;
33509
- const x = baseX - dx,
33510
- baseY = tickPosition.y;
33511
- let dy = 0;
33512
- dy = isInRange(angle, -PI_3_4, -PI_1_4) ? .5 * -height : isInRange(angle, PI_1_4, PI_3_4) ? .5 * height : Math.cos(angle) >= 0 ? (.5 - (PI_1_4 - angle) / PI_1_2) * height : (.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
33549
+ function getCircleLabelPosition(tickPosition, tickVector) {
33513
33550
  return {
33514
- x: x,
33515
- y: baseY - dy
33551
+ x: tickPosition.x + tickVector[0],
33552
+ y: tickPosition.y + tickVector[1]
33516
33553
  };
33517
33554
  }
33518
33555
  function getAxisBreakSymbolAttrs() {
@@ -33555,13 +33592,13 @@
33555
33592
  baseline: baseline
33556
33593
  };
33557
33594
  }
33558
- function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside, text, style) {
33595
+ function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside) {
33559
33596
  const point = polarToCartesian({
33560
33597
  x: 0,
33561
33598
  y: 0
33562
33599
  }, radius, angle),
33563
33600
  labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside));
33564
- return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside), text, style);
33601
+ return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside));
33565
33602
  }
33566
33603
  function getCirclePoints(center, count, radius, startAngle, endAngle) {
33567
33604
  const points = [],
@@ -33753,10 +33790,6 @@
33753
33790
  getVerticalCoord(point, offset, inside) {
33754
33791
  return getVerticalCoord(point, this.getVerticalVector(offset, inside, point));
33755
33792
  }
33756
- getTextAlign(vector) {
33757
- let align = "center";
33758
- return isNumberClose(vector[0], 0) ? isNumberClose(vector[1], 0) ? Object.is(vector[1], -0) ? align = "start" : Object.is(vector[0], -0) && (align = "end") : align = "center" : vector[0] > 0 ? align = "start" : vector[0] < 0 && (align = "end"), align;
33759
- }
33760
33793
  getTickLineItems() {
33761
33794
  const {
33762
33795
  tick: tick
@@ -34360,6 +34393,10 @@
34360
34393
  const axisLineGroup = new Segment(lineAttrs);
34361
34394
  axisLineGroup.name = AXIS_ELEMENT_NAME.line, axisLineGroup.id = this._getNodeId("line"), container.add(axisLineGroup);
34362
34395
  }
34396
+ getTextAlign(vector) {
34397
+ let align = "center";
34398
+ return isNumberClose(vector[0], 0) ? isNumberClose(vector[1], 0) ? Object.is(vector[1], -0) ? align = "start" : Object.is(vector[0], -0) && (align = "end") : align = "center" : vector[0] > 0 ? align = "start" : vector[0] < 0 && (align = "end"), align;
34399
+ }
34363
34400
  getTitleAttribute() {
34364
34401
  var _a, _b, _c;
34365
34402
  const _d = this.attribute.title,
@@ -34684,6 +34721,70 @@
34684
34721
  }
34685
34722
  }
34686
34723
 
34724
+ function findSiblingLabels(labels, selfIndex) {
34725
+ const len = labels.length;
34726
+ return {
34727
+ prevLabel: selfIndex >= 1 ? labels[selfIndex - 1] : labels[len - 1],
34728
+ nextLabel: selfIndex < len - 1 ? labels[selfIndex + 1] : labels[0]
34729
+ };
34730
+ }
34731
+ function adjustMaxLineWidth(label, maxLineWidth, ellipsis) {
34732
+ var _a;
34733
+ label.setAttributes({
34734
+ maxLineWidth: maxLineWidth,
34735
+ ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis
34736
+ });
34737
+ }
34738
+ function adjustMaxHeight(labels, selfIndex, bounds) {
34739
+ const siblings = [];
34740
+ if (labels.length >= 3) {
34741
+ const {
34742
+ prevLabel: prevLabel,
34743
+ nextLabel: nextLabel
34744
+ } = findSiblingLabels(labels, selfIndex);
34745
+ siblings.push(prevLabel, nextLabel);
34746
+ } else 2 === labels.length && siblings.push(labels[0 === selfIndex ? 1 : 0]);
34747
+ const label = labels[selfIndex];
34748
+ let heightLimit = Math.min(Math.abs(label.attribute.y - bounds.y1), Math.abs(label.attribute.y - bounds.y2));
34749
+ siblings.forEach(sibling => {
34750
+ heightLimit = Math.min(heightLimit, Math.abs(sibling.attribute.y - label.attribute.y));
34751
+ }), heightLimit > 0 && label.setAttributes({
34752
+ whiteSpace: "normal",
34753
+ heightLimit: heightLimit
34754
+ });
34755
+ }
34756
+ function circleAutoLimit(labels, config) {
34757
+ const {
34758
+ ellipsis: ellipsis,
34759
+ inside: inside,
34760
+ bounds: bounds,
34761
+ autoWrap: autoWrap,
34762
+ center: center
34763
+ } = config;
34764
+ inside || labels.forEach((label, index) => {
34765
+ const {
34766
+ x: x,
34767
+ y: y
34768
+ } = label.attribute,
34769
+ b = label.AABBBounds;
34770
+ if (isNumberClose(x, center.x)) {
34771
+ if (y > bounds.y2 || y < bounds.y1) return void adjustMaxLineWidth(label, 0, ellipsis);
34772
+ const boxWidth = bounds.x2 - bounds.x1;
34773
+ if (labels.length >= 3) {
34774
+ const {
34775
+ prevLabel: prevLabel,
34776
+ nextLabel: nextLabel
34777
+ } = findSiblingLabels(labels, index);
34778
+ let leftX = prevLabel.attribute.x,
34779
+ rightX = nextLabel.attribute.x;
34780
+ leftX > rightX && (leftX = nextLabel.attribute.x, rightX = prevLabel.attribute.x);
34781
+ const maxWidth = leftX === rightX ? boxWidth : x >= leftX && x <= rightX ? rightX - leftX : Math.min(Math.abs(leftX - x), Math.abs(rightX - x));
34782
+ label.AABBBounds.width() > maxWidth && adjustMaxLineWidth(label, maxWidth, ellipsis);
34783
+ } else label.AABBBounds.width() > boxWidth && adjustMaxLineWidth(label, boxWidth, ellipsis);
34784
+ } else x > center.x && b.x2 > bounds.x2 ? (adjustMaxLineWidth(label, bounds.x2 - x, ellipsis), autoWrap && adjustMaxHeight(labels, index, bounds)) : x < center.x && b.x1 < bounds.x1 && (adjustMaxLineWidth(label, x - bounds.x1, ellipsis), autoWrap && adjustMaxHeight(labels, index, bounds));
34785
+ });
34786
+ }
34787
+
34687
34788
  var __rest$4 = undefined && undefined.__rest || function (s, e) {
34688
34789
  var t = {};
34689
34790
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
@@ -34815,21 +34916,71 @@
34815
34916
  }
34816
34917
  return subTickLineItems;
34817
34918
  }
34818
- getTextBaseline(vector) {
34819
- let base = "middle";
34820
- return isNumberClose(vector[1], 0) ? base = "middle" : vector[1] > 0 && vector[1] > Math.abs(vector[0]) ? base = "top" : vector[1] < 0 && Math.abs(vector[1]) > Math.abs(vector[0]) && (base = "bottom"), base;
34821
- }
34822
34919
  beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
34823
- handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
34920
+ handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
34921
+ if (isEmpty(labelShapes)) return;
34922
+ const {
34923
+ inside: inside,
34924
+ radius: radius,
34925
+ center: center,
34926
+ width: width,
34927
+ height: height,
34928
+ label: label,
34929
+ orient: orient
34930
+ } = this.attribute,
34931
+ bounds = width && height ? {
34932
+ x1: 0,
34933
+ y1: 0,
34934
+ x2: width,
34935
+ y2: height
34936
+ } : {
34937
+ x1: center.x - radius,
34938
+ y1: center.y - radius,
34939
+ x2: center.x + radius,
34940
+ y2: center.y + radius
34941
+ },
34942
+ {
34943
+ layoutFunc: layoutFunc,
34944
+ autoLimit: autoLimit,
34945
+ limitEllipsis: limitEllipsis,
34946
+ autoHide: autoHide$1,
34947
+ autoHideMethod: autoHideMethod,
34948
+ autoHideSeparation: autoHideSeparation,
34949
+ autoWrap: autoWrap
34950
+ } = label;
34951
+ isFunction$1(layoutFunc) ? layoutFunc(labelShapes, labelData, layer, this) : ((autoLimit || autoWrap) && circleAutoLimit(labelShapes, {
34952
+ inside: inside,
34953
+ autoWrap: autoWrap,
34954
+ bounds: bounds,
34955
+ ellipsis: limitEllipsis,
34956
+ center: center
34957
+ }), autoHide$1 && autoHide(labelShapes, {
34958
+ orient: orient,
34959
+ method: autoHideMethod,
34960
+ separation: autoHideSeparation
34961
+ }));
34962
+ }
34824
34963
  afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
34964
+ getTextBaseline(vector) {
34965
+ return Math.abs(vector[1] / vector[0]) < .3 ? "middle" : vector[1] < 0 ? "bottom" : vector[1] > 0 ? "top" : "middle";
34966
+ }
34825
34967
  getLabelAlign(vector, inside, angle) {
34826
- return {
34968
+ return isNumberClose(vector[0], 0) ? {
34969
+ textAlign: "center",
34970
+ textBaseline: vector[1] > 0 ? "top" : "bottom"
34971
+ } : vector[0] < 0 ? {
34972
+ textAlign: "right",
34973
+ textBaseline: this.getTextBaseline(vector)
34974
+ } : vector[0] > 0 ? {
34975
+ textAlign: "left",
34976
+ textBaseline: this.getTextBaseline(vector)
34977
+ } : {
34827
34978
  textAlign: "center",
34828
34979
  textBaseline: "middle"
34829
34980
  };
34830
34981
  }
34831
34982
  getLabelPosition(point, vector, text, style) {
34832
- return getCircleLabelPosition(point, vector, text, style);
34983
+ return point;
34833
34984
  }
34834
34985
  }
34835
34986
  CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(CircleAxis, CircleAxisMixin);
@@ -36173,32 +36324,33 @@
36173
36324
  } = op,
36174
36325
  radius = null == getRadius ? void 0 : getRadius(),
36175
36326
  labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
36176
- textMeasure = initTextMeasure$1(labelStyle),
36177
- labelBoundsList = domain.map(v => {
36178
- var _a, _b;
36179
- const str = labelFormatter ? labelFormatter(v) : `${v}`,
36180
- {
36181
- width: width,
36182
- height: height
36183
- } = textMeasure.quickMeasure(str),
36184
- textWidth = Math.max(width, MIN_TICK_GAP),
36185
- textHeight = Math.max(height, MIN_TICK_GAP),
36186
- angle = scale.scale(v);
36187
- let textX = 0,
36188
- textY = 0;
36189
- const orient_align = null !== (_a = labelStyle.textAlign) && void 0 !== _a ? _a : "center",
36190
- orient_baseline = null !== (_b = labelStyle.textBaseline) && void 0 !== _b ? _b : "middle",
36191
- {
36192
- x: x,
36193
- y: y
36194
- } = getPolarAngleLabelPosition(angle, {
36195
- x: 0,
36196
- y: 0
36197
- }, radius, labelOffset, inside, str, labelStyle);
36198
- textX = x + ("right" === orient_align ? -textWidth : "center" === orient_align ? -textWidth / 2 : 0), textY = y + ("bottom" === orient_baseline ? -textHeight : "middle" === orient_baseline ? -textHeight / 2 : 0);
36199
- return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
36200
- });
36201
- return labelBoundsList;
36327
+ textMeasure = initTextMeasure$1(labelStyle);
36328
+ return domain.map(v => {
36329
+ const str = labelFormatter ? labelFormatter(v) : `${v}`,
36330
+ {
36331
+ width: width,
36332
+ height: height
36333
+ } = textMeasure.quickMeasure(str),
36334
+ textWidth = Math.max(width, MIN_TICK_GAP),
36335
+ textHeight = Math.max(height, MIN_TICK_GAP),
36336
+ angle = scale.scale(v),
36337
+ center = {
36338
+ x: 0,
36339
+ y: 0
36340
+ };
36341
+ let textX = 0,
36342
+ textY = 0;
36343
+ const orient = {
36344
+ align: labelStyle.textAlign,
36345
+ baseline: labelStyle.textBaseline
36346
+ },
36347
+ {
36348
+ x: x,
36349
+ y: y
36350
+ } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);
36351
+ orient.align || (isNumberClose(x, center.x) ? orient.baseline || (orient.baseline = y > center.y ? "top" : "bottom") : x > center.x ? orient.align = "left" : x < center.x && (orient.align = "right")), textX = x + ("right" === orient.align ? -textWidth : "left" === orient.align ? 0 : -textWidth / 2), textY = y + ("bottom" === orient.baseline ? -textHeight : "top" === orient.baseline ? 0 : -textHeight / 2);
36352
+ return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
36353
+ });
36202
36354
  };
36203
36355
  const polarAngleAxisDiscreteTicks = (scale, op) => {
36204
36356
  const {
@@ -36958,6 +37110,7 @@
36958
37110
  return !1;
36959
37111
  }
36960
37112
  setTextAttr(startTextBounds, endTextBounds) {
37113
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36961
37114
  const {
36962
37115
  startTextStyle: startTextStyle,
36963
37116
  endTextStyle: endTextStyle
@@ -36997,10 +37150,10 @@
36997
37150
  y: position.y + height / 2
36998
37151
  }, startTextAlignStyle = {
36999
37152
  textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "left" : "right",
37000
- textBaseline: "middle"
37153
+ textBaseline: null !== (_b = null === (_a = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _a ? void 0 : _a.textBaseline) && void 0 !== _b ? _b : "middle"
37001
37154
  }, endTextAlignStyle = {
37002
37155
  textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "right" : "left",
37003
- textBaseline: "middle"
37156
+ textBaseline: null !== (_d = null === (_c = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _c ? void 0 : _c.textBaseline) && void 0 !== _d ? _d : "middle"
37004
37157
  }) : (startTextPosition = {
37005
37158
  x: position.x + width / 2,
37006
37159
  y: position.y + start * height
@@ -37008,10 +37161,10 @@
37008
37161
  x: position.x + width / 2,
37009
37162
  y: position.y + end * height
37010
37163
  }, startTextAlignStyle = {
37011
- textAlign: "center",
37164
+ textAlign: null !== (_f = null === (_e = null == restStartTextStyle ? void 0 : restStartTextStyle.textStyle) || void 0 === _e ? void 0 : _e.textAlign) && void 0 !== _f ? _f : "center",
37012
37165
  textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "top" : "bottom"
37013
37166
  }, endTextAlignStyle = {
37014
- textAlign: "center",
37167
+ textAlign: null !== (_h = null === (_g = null == restEndTextStyle ? void 0 : restEndTextStyle.textStyle) || void 0 === _g ? void 0 : _g.textAlign) && void 0 !== _h ? _h : "center",
37015
37168
  textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "bottom" : "top"
37016
37169
  }), this._startText = this.maybeAddLabel(this._container, merge$2({}, restStartTextStyle, {
37017
37170
  text: startTextValue,
@@ -48432,12 +48585,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
48432
48585
  const NAME_PREFIX = "@";
48433
48586
  const ID_PREFIX = "#";
48434
48587
 
48435
- function getExtendedEvents(view, event, item, type, source) {
48588
+ function getExtendedEvents(view, event, type, source) {
48589
+ var _a, _b;
48436
48590
  if (source === EVENT_SOURCE_WINDOW) {
48437
48591
  const e = event.changedTouches ? event.changedTouches[0] : event;
48438
48592
  point(e);
48439
48593
  }
48440
- return event.element = item, event;
48594
+ let element = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey];
48595
+ if (!element && source === EVENT_SOURCE_VIEW) {
48596
+ let target = event.target;
48597
+ const rootGraphic = null === (_b = view.rootMark) || void 0 === _b ? void 0 : _b.graphicItem;
48598
+ for (; (null == target ? void 0 : target.parent) && target.parent !== rootGraphic;) if (target = target.parent, target[BridgeElementKey]) {
48599
+ element = target[BridgeElementKey];
48600
+ break;
48601
+ }
48602
+ }
48603
+ return event.element = element, event;
48441
48604
  }
48442
48605
 
48443
48606
  class Signal extends GrammarBase {
@@ -48861,12 +49024,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
48861
49024
  init(stage, parameters) {
48862
49025
  var _b, _c, _d, _e, _f;
48863
49026
  if (this._delegateEvent || (this._delegateEvent = (event, type) => {
48864
- var _a;
48865
- const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey];
48866
- if ((null == activeElement ? void 0 : activeElement.mark) === this) {
48867
- const extendedEvt = getExtendedEvents(this.view, event, activeElement, type, EVENT_SOURCE_VIEW);
48868
- this.emitGrammarEvent(type, extendedEvt, activeElement);
48869
- }
49027
+ const extendedEvt = getExtendedEvents(this.view, event, type, EVENT_SOURCE_VIEW),
49028
+ activeElement = event.element;
49029
+ (null == activeElement ? void 0 : activeElement.mark) === this && this.emitGrammarEvent(type, extendedEvt, activeElement);
48870
49030
  }, this.initEvent()), null === (_b = this.initAnimate) || void 0 === _b || _b.call(this, this.spec), !this.group) {
48871
49031
  const group = getGrammarOutput(this.spec.group, parameters);
48872
49032
  this.group = group, group && group.appendChild(this);
@@ -50243,10 +50403,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50243
50403
  const size = _this._getContainerSize();
50244
50404
  size && _this.resize(size.width, size.height);
50245
50405
  }, 100), this.delegateEvent = (event, type) => {
50246
- var _a;
50247
- const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey],
50248
- extendedEvt = getExtendedEvents(this, event, activeElement, type, EVENT_SOURCE_VIEW);
50249
- this.emit(type, extendedEvt, activeElement);
50406
+ const extendedEvt = getExtendedEvents(this, event, type, EVENT_SOURCE_VIEW);
50407
+ this.emit(type, extendedEvt, event.element);
50250
50408
  }, this.handleProgressiveFrame = () => {
50251
50409
  this._progressiveMarks.length && this._progressiveMarks.forEach(mark => {
50252
50410
  mark.isDoingProgressive() && mark.evaluateProgressive();
@@ -50630,7 +50788,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50630
50788
  var _b;
50631
50789
  const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType,
50632
50790
  enableMarkMorphConfig = diff.prev.every(mark => mark.getMorphConfig().morph) && diff.next.every(mark => mark.getMorphConfig().morph);
50633
- runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll ? null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
50791
+ this.morph && (runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll) ? null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
50634
50792
  prev: diff.prev,
50635
50793
  next: diff.next
50636
50794
  }) : matched && runningConfig.reuse && (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(), diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0]));
@@ -50723,7 +50881,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50723
50881
  resize(width, height) {
50724
50882
  let render = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
50725
50883
  let needDataflow = !1;
50726
- return width !== this.width() && (needDataflow = !0, this.updateSignal(SIGNAL_WIDTH, width)), height !== this.height() && (needDataflow = !0, this.updateSignal(SIGNAL_HEIGHT, height)), needDataflow && (render ? this.evaluate() : this._dataflow.evaluate()), this;
50884
+ return width !== this.width() && (needDataflow = !0, this.updateSignal(SIGNAL_WIDTH, width)), height !== this.height() && (needDataflow = !0, this.updateSignal(SIGNAL_HEIGHT, height)), needDataflow && (render ? this.evaluate({
50885
+ morph: !1
50886
+ }) : this._dataflow.evaluate()), this;
50727
50887
  }
50728
50888
  _resizeRenderer() {
50729
50889
  const width = this.width(),
@@ -57821,12 +57981,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57821
57981
  compileMarks(group) {
57822
57982
  this.getMarks().forEach(m => {
57823
57983
  var _a;
57824
- m.compile({ group });
57825
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
57826
- context: {
57827
- model: this
57828
- }
57829
- }).layout((group, children, parentLayoutBounds, options) => {
57984
+ m.compile({ group, context: { model: this } });
57985
+ (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.layout((group, children, parentLayoutBounds, options) => {
57830
57986
  });
57831
57987
  });
57832
57988
  }
@@ -59034,7 +59190,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59034
59190
  this.compileState();
59035
59191
  this.compileEncode();
59036
59192
  this.compileAnimation();
59037
- this.compileContext();
59193
+ this.compileContext(option === null || option === void 0 ? void 0 : option.context);
59038
59194
  this.compileTransform();
59039
59195
  }
59040
59196
  _initProduct(group) {
@@ -59149,16 +59305,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59149
59305
  }
59150
59306
  }
59151
59307
  }
59152
- compileContext() {
59308
+ compileContext(extraContext) {
59153
59309
  const config = {
59154
59310
  interactive: this.getInteractive(),
59155
59311
  zIndex: this.getZIndex(),
59156
- context: {
59157
- markId: this.id,
59158
- modelId: this.model.id,
59159
- markUserId: this._userId,
59160
- modelUserId: this.model.userId
59161
- },
59312
+ context: Object.assign({ markId: this.id, modelId: this.model.id, markUserId: this._userId, modelUserId: this.model.userId }, extraContext),
59162
59313
  skipTheme: this.getSkipTheme(),
59163
59314
  support3d: this.getSupport3d(),
59164
59315
  enableSegments: !!this._enableSegments,
@@ -59921,7 +60072,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59921
60072
  return this._dataSet;
59922
60073
  }
59923
60074
  constructor(spec, options) {
59924
- var _a, _b, _c, _d, _e, _f;
60075
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59925
60076
  this.id = createID();
59926
60077
  this._userEvents = [];
59927
60078
  this._autoSize = true;
@@ -59936,9 +60087,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59936
60087
  };
59937
60088
  this._observer = null;
59938
60089
  this._context = {};
59939
- this._onResize = debounce((...args) => {
59940
- this._doResize();
59941
- }, 100);
60090
+ this._doResize = () => {
60091
+ const { width, height } = this.getCurrentSize();
60092
+ if (this._currentSize.width !== width || this._currentSize.height !== height) {
60093
+ this._currentSize = { width, height };
60094
+ this.resizeSync(width, height);
60095
+ }
60096
+ };
59942
60097
  this._renderSync = (option = {}) => {
59943
60098
  var _a;
59944
60099
  const self = this;
@@ -59953,6 +60108,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59953
60108
  var _a, _b;
59954
60109
  const lastSpec = this._spec;
59955
60110
  const result = {
60111
+ changeBackground: false,
59956
60112
  reTransformSpec: false,
59957
60113
  change: false,
59958
60114
  reMake: false,
@@ -59987,7 +60143,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59987
60143
  };
59988
60144
  this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
59989
60145
  this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
59990
- const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$e(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
60146
+ const _j = this._option, { dom, renderCanvas, mode, stage, poptip } = _j, restOptions = __rest$e(_j, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
59991
60147
  const isTrueBrowseEnv = isTrueBrowser(mode);
59992
60148
  if (isTrueBrowseEnv) {
59993
60149
  registerBrowserEnv();
@@ -60028,6 +60184,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60028
60184
  this._bindVGrammarViewEvent();
60029
60185
  this._initChartPlugin();
60030
60186
  InstanceManager.registerInstance(this);
60187
+ (_h = (_g = this._option.performanceHook) === null || _g === void 0 ? void 0 : _g.afterCreateVChart) === null || _h === void 0 ? void 0 : _h.call(_g, this);
60031
60188
  }
60032
60189
  _setNewSpec(spec, forceMerge) {
60033
60190
  if (!spec) {
@@ -60118,13 +60275,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60118
60275
  });
60119
60276
  }
60120
60277
  _bindResizeEvent() {
60121
- var _a;
60278
+ var _a, _b;
60122
60279
  if (this._autoSize) {
60280
+ this._onResize = throttle(this._doResize, (_a = this._option.resizeDelay) !== null && _a !== void 0 ? _a : 100);
60123
60281
  if (this._container) {
60124
60282
  const ResizeObserverWindow = window.ResizeObserver;
60125
60283
  if (ResizeObserverWindow) {
60126
60284
  this._observer = new ResizeObserverWindow(this._onResize);
60127
- (_a = this._observer) === null || _a === void 0 ? void 0 : _a.observe(this._container);
60285
+ (_b = this._observer) === null || _b === void 0 ? void 0 : _b.observe(this._container);
60128
60286
  }
60129
60287
  }
60130
60288
  window.addEventListener('resize', this._onResize);
@@ -60151,13 +60309,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60151
60309
  height: (_d = (_c = this._currentSize) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : DEFAULT_CHART_HEIGHT
60152
60310
  });
60153
60311
  }
60154
- _doResize() {
60155
- const { width, height } = this.getCurrentSize();
60156
- if (this._currentSize.width !== width || this._currentSize.height !== height) {
60157
- this._currentSize = { width, height };
60158
- this.resizeSync(width, height);
60159
- }
60160
- }
60161
60312
  _initDataSet(dataSet) {
60162
60313
  if (dataSet instanceof DataSet) {
60163
60314
  this._dataSet = dataSet;
@@ -60200,7 +60351,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60200
60351
  return this._beforeRender(option);
60201
60352
  }
60202
60353
  _reCompile(updateResult, morphConfig) {
60203
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60354
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
60204
60355
  if (updateResult.reMake) {
60205
60356
  this._releaseData();
60206
60357
  this._initDataSet();
@@ -60229,8 +60380,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60229
60380
  (_h = this._compiler) === null || _h === void 0 ? void 0 : _h.setBackground(this._getBackground());
60230
60381
  }
60231
60382
  if (updateResult.reCompile) {
60232
- (_j = this._compiler) === null || _j === void 0 ? void 0 : _j.clear({ chart: this._chart, vChart: this }, !this._option.animation || !this._spec.animation);
60233
- (_k = this._compiler) === null || _k === void 0 ? void 0 : _k.compile({ chart: this._chart, vChart: this }, {});
60383
+ (_j = this._compiler) === null || _j === void 0 ? void 0 : _j.clear({ chart: this._chart, vChart: this }, ((_k = this._option) === null || _k === void 0 ? void 0 : _k.animation) === false || ((_l = this._spec) === null || _l === void 0 ? void 0 : _l.animation) === false);
60384
+ (_m = this._compiler) === null || _m === void 0 ? void 0 : _m.compile({ chart: this._chart, vChart: this }, {});
60234
60385
  }
60235
60386
  if (updateResult.reSize) {
60236
60387
  const { width, height } = this.getCurrentSize();
@@ -60252,9 +60403,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60252
60403
  this._initChartSpec(this._spec, 'render');
60253
60404
  }
60254
60405
  this._chartPluginApply('onBeforeInitChart', this._spec, actionSource);
60255
- (_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeInitializeChart) === null || _b === void 0 ? void 0 : _b.call(_a);
60406
+ (_b = (_a = this._option.performanceHook) === null || _a === void 0 ? void 0 : _a.beforeInitializeChart) === null || _b === void 0 ? void 0 : _b.call(_a, this);
60256
60407
  this._initChart(this._spec);
60257
- (_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterInitializeChart) === null || _d === void 0 ? void 0 : _d.call(_c);
60408
+ (_d = (_c = this._option.performanceHook) === null || _c === void 0 ? void 0 : _c.afterInitializeChart) === null || _d === void 0 ? void 0 : _d.call(_c, this);
60258
60409
  if (!this._chart || !this._compiler) {
60259
60410
  return false;
60260
60411
  }
@@ -61145,7 +61296,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61145
61296
  };
61146
61297
  registerVChartCore();
61147
61298
 
61148
- const version = "1.12.5";
61299
+ const version = "1.12.6";
61149
61300
 
61150
61301
  const addVChartProperty = (data, op) => {
61151
61302
  const context = op.beforeCall();
@@ -61541,6 +61692,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61541
61692
  data: true
61542
61693
  };
61543
61694
  const defaultSeriesCompileCheckKeys = {
61695
+ invalidType: true,
61544
61696
  animation: true,
61545
61697
  animationAppear: true,
61546
61698
  animationEnter: true,
@@ -62794,8 +62946,34 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62794
62946
  initTooltip() {
62795
62947
  this._tooltipHelper = new BaseSeriesTooltipHelper(this);
62796
62948
  }
62949
+ _compareExtensionMarksSpec(newMarks, prevMarks, compareResult) {
62950
+ if (newMarks.length !== prevMarks.length ||
62951
+ prevMarks.some((prev, index) => {
62952
+ return prev.type !== newMarks[index].type || prev.id !== newMarks[index].id;
62953
+ })) {
62954
+ compareResult.reMake = true;
62955
+ }
62956
+ else if (prevMarks.some((prev, index) => {
62957
+ return prev.visible !== newMarks[index].visible;
62958
+ })) {
62959
+ compareResult.reCompile = true;
62960
+ }
62961
+ }
62962
+ _compareLabelSpec(newLabels, prevLabels, compareResult) {
62963
+ if (newLabels.length !== prevLabels.length ||
62964
+ prevLabels.some((prev, index) => {
62965
+ return prev.labelLayout !== newLabels[index].labelLayout;
62966
+ })) {
62967
+ compareResult.reMake = true;
62968
+ }
62969
+ else if (!compareResult.reCompile &&
62970
+ prevLabels.some((prev, index) => {
62971
+ return !isEqual(prev, newLabels[index]);
62972
+ })) {
62973
+ compareResult.reCompile = true;
62974
+ }
62975
+ }
62797
62976
  _compareSpec(spec, prevSpec, ignoreCheckKeys) {
62798
- var _a, _b;
62799
62977
  const result = super._compareSpec(spec, prevSpec);
62800
62978
  const currentKeys = Object.keys(prevSpec || {}).sort();
62801
62979
  const nextKeys = Object.keys(spec || {}).sort();
@@ -62803,36 +62981,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62803
62981
  result.reMake = true;
62804
62982
  return result;
62805
62983
  }
62806
- ignoreCheckKeys = Object.assign(Object.assign(Object.assign({}, defaultSeriesIgnoreCheckKeys), defaultSeriesCompileCheckKeys), ignoreCheckKeys);
62807
- ignoreCheckKeys.invalidType = true;
62808
- if (spec.invalidType !== prevSpec.invalidType) {
62809
- result.reCompile = true;
62810
- }
62811
- ignoreCheckKeys.extensionMark = true;
62812
- if (array(spec.extensionMark).length !== array(prevSpec.extensionMark).length ||
62813
- ((_a = prevSpec.extensionMark) === null || _a === void 0 ? void 0 : _a.some((mark, index) => mark.type !== spec.extensionMark[index].type || mark.id !== spec.extensionMark[index].id))) {
62814
- result.reMake = true;
62815
- }
62984
+ const ignores = Object.assign(Object.assign(Object.assign(Object.assign({}, defaultSeriesIgnoreCheckKeys), defaultSeriesCompileCheckKeys), ignoreCheckKeys), { extensionMark: true, label: true, totalLabel: true });
62985
+ this._compareExtensionMarksSpec(array(spec.extensionMark), array(prevSpec.extensionMark), result);
62986
+ !result.reMake && this._compareLabelSpec(array(spec.label), array(prevSpec.label), result);
62987
+ !result.reMake &&
62988
+ this._compareLabelSpec(array(spec.totalLabel), array(prevSpec.totalLabel), result);
62816
62989
  if (result.reMake) {
62817
62990
  return result;
62818
62991
  }
62819
- if ((_b = prevSpec.extensionMark) === null || _b === void 0 ? void 0 : _b.some((mark, index) => mark.visible !== spec.extensionMark[index].visible)) {
62820
- result.reCompile = true;
62821
- }
62822
- if (this._marks.getMarks().some(m => {
62823
- var _a, _b;
62824
- ignoreCheckKeys[m.name] = true;
62825
- return ((_a = prevSpec[m.name]) === null || _a === void 0 ? void 0 : _a.visible) !== ((_b = spec[m.name]) === null || _b === void 0 ? void 0 : _b.visible);
62826
- })) {
62992
+ if (!result.reCompile &&
62993
+ this._marks.getMarks().some(m => {
62994
+ var _a, _b;
62995
+ ignores[m.name] = true;
62996
+ return ((_a = prevSpec[m.name]) === null || _a === void 0 ? void 0 : _a.visible) !== ((_b = spec[m.name]) === null || _b === void 0 ? void 0 : _b.visible);
62997
+ })) {
62827
62998
  result.reCompile = true;
62828
62999
  }
62829
- if (currentKeys.some((k) => {
62830
- return defaultSeriesCompileCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
62831
- })) {
63000
+ if (!result.reCompile &&
63001
+ currentKeys.some((k) => {
63002
+ return defaultSeriesCompileCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
63003
+ })) {
62832
63004
  result.reCompile = true;
62833
63005
  }
62834
63006
  if (currentKeys.some((k) => {
62835
- return !ignoreCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
63007
+ return !ignores[k] && !isEqual(spec[k], prevSpec[k]);
62836
63008
  })) {
62837
63009
  result.reMake = true;
62838
63010
  return result;
@@ -64714,13 +64886,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64714
64886
  }
64715
64887
  compileMarks(group) {
64716
64888
  this.getMarks().forEach(m => {
64717
- var _a;
64718
- m.compile({ group });
64719
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
64720
- context: {
64721
- model: this
64722
- }
64723
- });
64889
+ m.compile({ group, context: { model: this } });
64724
64890
  });
64725
64891
  }
64726
64892
  reAppendComponents() {
@@ -65015,11 +65181,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65015
65181
  });
65016
65182
  return result;
65017
65183
  }
65018
- _delegateAxisContainerEvent(component) {
65019
- if (component.listenerCount('*') === 0) {
65020
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
65021
- }
65022
- }
65023
65184
  _getAxisAttributes() {
65024
65185
  const spec = this._spec;
65025
65186
  const axisAttrs = {
@@ -65614,7 +65775,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65614
65775
  this.pluginService && plugin.onDidLayoutVertical && plugin.onDidLayoutVertical(this.pluginService, this);
65615
65776
  });
65616
65777
  }
65617
- this._delegateAxisContainerEvent(product.getGroupGraphicItem());
65618
65778
  if (this._unitText) {
65619
65779
  const { x, y } = this.getLayoutStartPoint();
65620
65780
  const pos = isXAxis(this._orient)
@@ -68143,13 +68303,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68143
68303
  if (!this._backgroundMark) {
68144
68304
  return;
68145
68305
  }
68146
- this._backgroundMark.compile();
68147
- (_a = this._backgroundMark
68148
- .getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
68149
- context: {
68150
- model: this
68151
- }
68152
- }).layout(() => {
68306
+ this._backgroundMark.compile({ context: { model: this } });
68307
+ (_a = this._backgroundMark.getProduct()) === null || _a === void 0 ? void 0 : _a.layout(() => {
68153
68308
  });
68154
68309
  }
68155
68310
  compileRegions() {
@@ -72324,15 +72479,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72324
72479
  ? (_c = series.getXAxisHelper()) === null || _c === void 0 ? void 0 : _c.isInverse()
72325
72480
  : (_d = series.getYAxisHelper()) === null || _d === void 0 ? void 0 : _d.isInverse();
72326
72481
  let position = originPosition;
72327
- if (isString$1(originPosition) && originPosition === 'outside') {
72328
- position = (data) => {
72329
- const { data: datum } = data;
72482
+ position = (datum) => {
72483
+ var _a;
72484
+ const { data } = datum;
72485
+ const labelPosition = (_a = (typeof labelSpec.position === 'function'
72486
+ ? labelSpec.position(data)
72487
+ : labelSpec.position)) !== null && _a !== void 0 ? _a : 'outside';
72488
+ if (labelPosition === 'outside') {
72330
72489
  const dataField = series.getMeasureField()[0];
72331
72490
  const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
72332
- const index = ((datum === null || datum === void 0 ? void 0 : datum[dataField]) >= 0 && isInverse) || ((datum === null || datum === void 0 ? void 0 : datum[dataField]) < 0 && !isInverse) ? 1 : 0;
72491
+ const index = ((data === null || data === void 0 ? void 0 : data[dataField]) >= 0 && isInverse) || ((data === null || data === void 0 ? void 0 : data[dataField]) < 0 && !isInverse) ? 1 : 0;
72333
72492
  return positionMap[direction][index];
72334
- };
72335
- }
72493
+ }
72494
+ return labelPosition;
72495
+ };
72336
72496
  let overlap;
72337
72497
  if (labelSpec.overlap === false) {
72338
72498
  overlap = false;
@@ -75173,17 +75333,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75173
75333
  var _a;
75174
75334
  return Object.assign(Object.assign({}, super._tickTransformOption()), { noDecimal: (_a = this._tick) === null || _a === void 0 ? void 0 : _a.noDecimals, startAngle: this.startAngle, labelOffset: getAxisLabelOffset(this._spec), getRadius: () => this.getOuterRadius(), inside: this._spec.inside });
75175
75335
  }
75176
- afterCompile() {
75177
- var _a;
75178
- const product = (_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct();
75179
- if (product) {
75180
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
75181
- if (this._isLayout === false) {
75182
- this._delegateAxisContainerEvent(product.getGroupGraphicItem());
75183
- }
75184
- });
75185
- }
75186
- }
75187
75336
  updateScaleRange() {
75188
75337
  const prevRange = this._scale.range();
75189
75338
  let newRange;
@@ -75269,29 +75418,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75269
75418
  return polarToCartesian(center, point.radius, point.angle);
75270
75419
  }
75271
75420
  pointToCoord(point) {
75272
- const { x: centerX, y: centerY } = this.getCenter();
75273
- let dx = point.x - centerX;
75274
- let dy = point.y - centerY;
75421
+ const center = this.getCenter();
75275
75422
  const startAngle = this._startAngle;
75276
75423
  const endAngle = this._endAngle;
75277
- const radius = Math.sqrt(dx * dx + dy * dy);
75278
- dx /= radius;
75279
- dy /= radius;
75280
- let radian = Math.atan2(dy, dx);
75281
- if (radian < startAngle) {
75282
- while (radian <= startAngle) {
75283
- radian += Math.PI * 2;
75284
- }
75285
- }
75286
- if (radian > endAngle) {
75287
- while (radian >= endAngle) {
75288
- radian -= Math.PI * 2;
75289
- }
75290
- }
75291
- return {
75292
- radius,
75293
- angle: radian
75294
- };
75424
+ return cartesianToPolar(point, center, startAngle, endAngle);
75295
75425
  }
75296
75426
  getOuterRadius() {
75297
75427
  return this.computeLayoutOuterRadius();
@@ -75343,7 +75473,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75343
75473
  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)
75344
75474
  ? undefined
75345
75475
  : this.getScale().domain().length });
75346
- const attrs = Object.assign(Object.assign({}, commonAttrs), { title: {
75476
+ const attrs = Object.assign(Object.assign(Object.assign({}, commonAttrs), this.getRefLayoutRect()), { title: {
75347
75477
  text: this._spec.title.text || this._dataFieldText
75348
75478
  }, items, orient: 'angle' });
75349
75479
  if (this._spec.grid.visible) {
@@ -75648,23 +75778,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75648
75778
  class PolarPointUpdate extends ACustomAnimate {
75649
75779
  constructor(from, to, duration, easing, params) {
75650
75780
  super(from, to, duration, easing, params);
75651
- const pointToCoord = this.params.pointToCoord;
75652
- const coordToPoint = this.params.coordToPoint;
75653
- if (!isFunction$1(pointToCoord) || !isFunction$1(coordToPoint)) {
75781
+ this._center = to.center;
75782
+ this._prevCenter = from.center;
75783
+ if (!this._center || !this._prevCenter) {
75654
75784
  this.valid = false;
75655
75785
  }
75656
- this._pointToCoord = pointToCoord;
75657
- this._coordToPoint = coordToPoint;
75658
75786
  }
75659
75787
  getEndProps() {
75660
75788
  if (this.valid === false) {
75661
75789
  return {};
75662
75790
  }
75663
- return this._coordToPoint({ angle: this._toAngle, radius: this._toRadius });
75791
+ return polarToCartesian(this._center, this._toRadius, this._toAngle);
75664
75792
  }
75665
75793
  onBind() {
75666
- const { angle: fromAngle, radius: fromRadius } = this._pointToCoord(this.from);
75667
- const { angle: toAngle, radius: toRadius } = this._pointToCoord(this.to);
75794
+ const { angle: fromAngle, radius: fromRadius } = cartesianToPolar(this.from, this._prevCenter);
75795
+ const { angle: toAngle, radius: toRadius } = cartesianToPolar(this.to, this._center);
75668
75796
  if (!isValidNumber$1(toAngle * toRadius)) {
75669
75797
  this.valid = false;
75670
75798
  }
@@ -75686,12 +75814,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75686
75814
  const { x, y } = this.getEndProps();
75687
75815
  out.x = x;
75688
75816
  out.y = y;
75817
+ out.center = this._center;
75689
75818
  }
75690
75819
  else {
75691
- const { x, y } = this._coordToPoint({
75692
- angle: this._fromAngle + (this._toAngle - this._fromAngle) * ratio,
75693
- radius: this._fromRadius + (this._toRadius - this._fromRadius) * ratio
75694
- });
75820
+ const { x, y } = polarToCartesian({
75821
+ x: this._prevCenter.x + (this._center.x - this._prevCenter.x) * ratio,
75822
+ y: this._prevCenter.y + (this._center.y - this._prevCenter.y) * ratio
75823
+ }, this._fromRadius + (this._toRadius - this._fromRadius) * ratio, this._fromAngle + (this._toAngle - this._fromAngle) * ratio);
75695
75824
  out.x = x;
75696
75825
  out.y = y;
75697
75826
  }
@@ -75700,14 +75829,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75700
75829
  class PolarTagPointsUpdate extends TagPointsUpdate {
75701
75830
  constructor(from, to, duration, easing, params) {
75702
75831
  super(from, to, duration, easing, params);
75703
- const pointToCoord = this.params.pointToCoord;
75704
- const coordToPoint = this.params.coordToPoint;
75705
- this._pointToCoord = pointToCoord;
75706
- this._coordToPoint = coordToPoint;
75832
+ this._center = to.center;
75833
+ this._prevCenter = from.center;
75707
75834
  }
75708
75835
  onUpdate(end, ratio, out) {
75709
75836
  this.points = this.points.map((point, index) => {
75710
75837
  const newPoint = this.polarPointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
75838
+ if (end) {
75839
+ out.center = this._center;
75840
+ }
75711
75841
  newPoint.context = point.context;
75712
75842
  return newPoint;
75713
75843
  });
@@ -75717,8 +75847,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75717
75847
  if (!isValidPoint(pointA) && !isValidPoint(pointB)) {
75718
75848
  return pointB;
75719
75849
  }
75720
- const polarPointA = this._pointToCoord(pointA);
75721
- const polarPointB = this._pointToCoord(pointB);
75850
+ const polarPointA = cartesianToPolar(pointA, this._prevCenter);
75851
+ const polarPointB = cartesianToPolar(pointB, this._center);
75722
75852
  let angleA = normalizeAngle(polarPointA.angle);
75723
75853
  let angleB = normalizeAngle(polarPointB.angle);
75724
75854
  if (!isValidNumber$1(angleA) && isValidNumber$1(angleB)) {
@@ -75729,7 +75859,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75729
75859
  }
75730
75860
  const angle = angleA + (angleB - angleA) * ratio;
75731
75861
  const radius = polarPointA.radius + (polarPointB.radius - polarPointA.radius) * ratio;
75732
- return this._coordToPoint({ angle, radius });
75862
+ return polarToCartesian({
75863
+ x: this._prevCenter.x + (this._center.x - this._prevCenter.x) * ratio,
75864
+ y: this._prevCenter.y + (this._center.y - this._prevCenter.y) * ratio
75865
+ }, radius, angle);
75733
75866
  }
75734
75867
  polarPointInterpolation(pointA, pointB, ratio) {
75735
75868
  const { x, y } = this._interpolationSinglePoint(pointA, pointB, ratio);
@@ -75820,10 +75953,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75820
75953
  disappear: preset === 'clipIn' ? undefined : radarPresetAnimation(params, preset, 'out'),
75821
75954
  update: [
75822
75955
  {
75823
- options: { excludeChannels: ['points', 'defined'] }
75956
+ options: { excludeChannels: ['points', 'defined', 'center'] }
75824
75957
  },
75825
75958
  {
75826
- channel: ['points'],
75959
+ channel: ['points', 'center'],
75827
75960
  custom: PolarTagPointsUpdate,
75828
75961
  customParameters: params,
75829
75962
  duration: DEFAULT_ANIMATION_CONFIG.update.duration,
@@ -75839,10 +75972,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75839
75972
  disappear: preset === 'clipIn' ? undefined : radarSymbolPresetAnimation(params, preset, 'out'),
75840
75973
  update: [
75841
75974
  {
75842
- options: { excludeChannels: ['x', 'y'] }
75975
+ options: { excludeChannels: ['x', 'y', 'center'] }
75843
75976
  },
75844
75977
  {
75845
- channel: ['x', 'y'],
75978
+ channel: ['x', 'y', 'center'],
75846
75979
  custom: PolarPointUpdate,
75847
75980
  customParameters: params,
75848
75981
  duration: DEFAULT_ANIMATION_CONFIG.update.duration,
@@ -75892,6 +76025,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75892
76025
  this.initAreaMarkStyle();
75893
76026
  this.initLineMarkStyle();
75894
76027
  this.initSymbolMarkStyle();
76028
+ [this._lineMark, this._symbolMark, this._areaMark].forEach(mark => {
76029
+ if (mark) {
76030
+ this.setMarkStyle(mark, {
76031
+ center: () => {
76032
+ var _a;
76033
+ return (_a = this.angleAxisHelper) === null || _a === void 0 ? void 0 : _a.center();
76034
+ }
76035
+ });
76036
+ }
76037
+ });
75895
76038
  }
75896
76039
  initAreaMark(progressive, isSeriesMark) {
75897
76040
  var _a, _b;
@@ -75963,9 +76106,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75963
76106
  const rect = this.getLayoutRect();
75964
76107
  return Math.min(rect.width, rect.height);
75965
76108
  },
75966
- startAngle: isValid$1(this._spec.startAngle) ? degreeToRadian(this._spec.startAngle) : POLAR_START_RADIAN,
75967
- pointToCoord: (point) => { var _a; return (_a = this.angleAxisHelper) === null || _a === void 0 ? void 0 : _a.pointToCoord(point); },
75968
- coordToPoint: (coord) => this.angleAxisHelper.coordToPoint(coord)
76109
+ startAngle: isValid$1(this._spec.startAngle) ? degreeToRadian(this._spec.startAngle) : POLAR_START_RADIAN
75969
76110
  };
75970
76111
  const appearPreset = ((_c = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.animationAppear) === null || _b === void 0 ? void 0 : _b.preset) !== null && _c !== void 0 ? _c : 'clipIn');
75971
76112
  if (appearPreset === 'clipIn') {
@@ -96043,11 +96184,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96043
96184
  _getNeedClearVRenderComponents() {
96044
96185
  return [];
96045
96186
  }
96046
- _delegateLabelEvent(component) {
96047
- if (component.listenerCount('*') === 0) {
96048
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
96049
- }
96050
- }
96051
96187
  }
96052
96188
  BaseLabelComponent.type = ComponentTypeEnum.label;
96053
96189
 
@@ -96158,18 +96294,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96158
96294
  this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, enableAnimation);
96159
96295
  };
96160
96296
  }
96161
- afterCompile() {
96162
- this._labelComponentMap.forEach((info, component) => {
96163
- const product = component.getProduct();
96164
- if (product) {
96165
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
96166
- if (this._isLayout === false) {
96167
- this._delegateLabelEvent(product.getGroupGraphicItem());
96168
- }
96169
- });
96170
- }
96171
- });
96172
- }
96173
96297
  _initTextMark() {
96174
96298
  if (!this._labelInfoMap) {
96175
96299
  this._labelInfoMap = new Map();
@@ -96344,7 +96468,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96344
96468
  }
96345
96469
  compileMarks() {
96346
96470
  this.getMarks().forEach(m => {
96347
- var _a;
96348
96471
  const labelInfo = this._labelComponentMap.get(m)();
96349
96472
  let group;
96350
96473
  if (isArray$1(labelInfo)) {
@@ -96353,13 +96476,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96353
96476
  else {
96354
96477
  group = labelInfo.series.getRegion().getGroupMark().getProduct();
96355
96478
  }
96356
- m.compile({ group });
96357
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
96358
- context: {
96359
- model: this,
96360
- labelInfo
96361
- }
96362
- });
96479
+ m.compile({ group, context: { model: this, labelInfo } });
96363
96480
  });
96364
96481
  }
96365
96482
  getVRenderComponents() {
@@ -96418,6 +96535,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96418
96535
  this._initTextMark();
96419
96536
  this._initLabelComponent();
96420
96537
  }
96538
+ reInit(spec) {
96539
+ super.reInit(spec);
96540
+ this._initTextMark();
96541
+ }
96421
96542
  _initTextMark() {
96422
96543
  var _a;
96423
96544
  const series = this._getSeries();
@@ -96453,18 +96574,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96453
96574
  this._marks.addMark(component);
96454
96575
  }
96455
96576
  }
96456
- afterCompile() {
96457
- this._marks.forEach((componentMark, index) => {
96458
- const product = componentMark.getProduct();
96459
- if (product) {
96460
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
96461
- if (this._isLayout === false) {
96462
- this._delegateLabelEvent(product.getGroupGraphicItem());
96463
- }
96464
- });
96465
- }
96466
- });
96467
- }
96468
96577
  updateLayoutAttribute() {
96469
96578
  super.updateLayoutAttribute();
96470
96579
  const series = this._getSeries();
@@ -96506,14 +96615,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96506
96615
  }
96507
96616
  compileMarks() {
96508
96617
  this.getMarks().forEach(m => {
96509
- var _a;
96510
96618
  const group = this._regions[0].getGroupMark().getProduct();
96511
- m.compile({ group });
96512
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
96513
- context: {
96514
- model: this
96515
- }
96516
- });
96619
+ m.compile({ group, context: { model: this } });
96517
96620
  });
96518
96621
  }
96519
96622
  getVRenderComponents() {
@@ -97483,21 +97586,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97483
97586
  }
97484
97587
  onRender(ctx) {
97485
97588
  }
97486
- afterCompile() {
97487
- this.getMarks().forEach(mark => {
97488
- const product = mark.getProduct();
97489
- if (product) {
97490
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
97491
- if (this._isLayout === false) {
97492
- const component = product.getGroupGraphicItem();
97493
- if ((component === null || component === void 0 ? void 0 : component.listenerCount('*')) === 0) {
97494
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
97495
- }
97496
- }
97497
- });
97498
- }
97499
- });
97500
- }
97501
97589
  _getMarkAttributeContext() {
97502
97590
  return {
97503
97591
  vchart: this._option.globalInstance,
@@ -100900,9 +100988,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
100900
100988
  });
100901
100989
  };
100902
100990
  }
100903
- afterCompile() {
100904
- super.afterCompile();
100905
- }
100906
100991
  _beforeInit() {
100907
100992
  if (this._dataSet) {
100908
100993
  registerDataSetInstanceTransform(this._dataSet, 'stackSplit', stackSplit);