@visactor/vchart 1.12.4 → 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 (259) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +639 -811
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base/base-chart-transformer.js +4 -4
  6. package/cjs/chart/base/base-chart-transformer.js.map +1 -1
  7. package/cjs/chart/base/base-chart.js +2 -2
  8. package/cjs/chart/base/base-chart.js.map +1 -1
  9. package/cjs/chart/mosaic/mosaic.d.ts +0 -1
  10. package/cjs/chart/mosaic/mosaic.js +0 -3
  11. package/cjs/chart/mosaic/mosaic.js.map +1 -1
  12. package/cjs/chart/pie/interface.d.ts +2 -2
  13. package/cjs/chart/pie/interface.js.map +1 -1
  14. package/cjs/chart/polar/interface.d.ts +2 -0
  15. package/cjs/chart/polar/interface.js.map +1 -1
  16. package/cjs/compile/mark/compilable-mark.d.ts +1 -4
  17. package/cjs/compile/mark/compilable-mark.js +6 -13
  18. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  19. package/cjs/compile/mark/interface.d.ts +1 -2
  20. package/cjs/compile/mark/interface.js.map +1 -1
  21. package/cjs/component/axis/base-axis.d.ts +1 -2
  22. package/cjs/component/axis/base-axis.js +0 -3
  23. package/cjs/component/axis/base-axis.js.map +1 -1
  24. package/cjs/component/axis/cartesian/axis.d.ts +1 -0
  25. package/cjs/component/axis/cartesian/axis.js +29 -2
  26. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  27. package/cjs/component/axis/polar/axis.d.ts +0 -1
  28. package/cjs/component/axis/polar/axis.js +7 -37
  29. package/cjs/component/axis/polar/axis.js.map +1 -1
  30. package/cjs/component/axis/polar/interface/spec.d.ts +3 -1
  31. package/cjs/component/axis/polar/interface/spec.js.map +1 -1
  32. package/cjs/component/axis/polar/util/common.js +1 -1
  33. package/cjs/component/axis/polar/util/common.js.map +1 -1
  34. package/cjs/component/base/base-component.js +1 -3
  35. package/cjs/component/base/base-component.js.map +1 -1
  36. package/cjs/component/brush/brush.js +2 -8
  37. package/cjs/component/brush/brush.js.map +1 -1
  38. package/cjs/component/crosshair/cartesian.js +2 -18
  39. package/cjs/component/crosshair/cartesian.js.map +1 -1
  40. package/cjs/component/crosshair/polar.js +2 -18
  41. package/cjs/component/crosshair/polar.js.map +1 -1
  42. package/cjs/component/custom-mark/custom-mark.d.ts +1 -4
  43. package/cjs/component/custom-mark/custom-mark.js +3 -28
  44. package/cjs/component/custom-mark/custom-mark.js.map +1 -1
  45. package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +0 -3
  46. package/cjs/component/data-zoom/data-zoom/data-zoom.js +0 -19
  47. package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  48. package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +0 -3
  49. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +0 -19
  50. package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  51. package/cjs/component/indicator/indicator.js +2 -18
  52. package/cjs/component/indicator/indicator.js.map +1 -1
  53. package/cjs/component/interface/common.d.ts +1 -1
  54. package/cjs/component/interface/common.js.map +1 -1
  55. package/cjs/component/label/base-label.d.ts +1 -2
  56. package/cjs/component/label/base-label.js +0 -3
  57. package/cjs/component/label/base-label.js.map +1 -1
  58. package/cjs/component/label/interface.d.ts +2 -2
  59. package/cjs/component/label/interface.js.map +1 -1
  60. package/cjs/component/label/label.d.ts +0 -1
  61. package/cjs/component/label/label.js +2 -12
  62. package/cjs/component/label/label.js.map +1 -1
  63. package/cjs/component/label/total-label.d.ts +1 -1
  64. package/cjs/component/label/total-label.js +5 -12
  65. package/cjs/component/label/total-label.js.map +1 -1
  66. package/cjs/component/label/util.d.ts +1 -1
  67. package/cjs/component/label/util.js +12 -7
  68. package/cjs/component/label/util.js.map +1 -1
  69. package/cjs/component/legend/continuous/legend.js +6 -18
  70. package/cjs/component/legend/continuous/legend.js.map +1 -1
  71. package/cjs/component/legend/discrete/legend.js +1 -17
  72. package/cjs/component/legend/discrete/legend.js.map +1 -1
  73. package/cjs/component/legend/util.d.ts +2 -2
  74. package/cjs/component/map-label/component.js +3 -8
  75. package/cjs/component/map-label/component.js.map +1 -1
  76. package/cjs/component/marker/base-marker.js +2 -18
  77. package/cjs/component/marker/base-marker.js.map +1 -1
  78. package/cjs/component/player/player.d.ts +1 -3
  79. package/cjs/component/player/player.js +0 -9
  80. package/cjs/component/player/player.js.map +1 -1
  81. package/cjs/component/title/title.js +2 -18
  82. package/cjs/component/title/title.js.map +1 -1
  83. package/cjs/component/tooltip/tooltip.d.ts +1 -3
  84. package/cjs/component/tooltip/tooltip.js +0 -19
  85. package/cjs/component/tooltip/tooltip.js.map +1 -1
  86. package/cjs/component/util.d.ts +3 -0
  87. package/cjs/component/util.js +16 -1
  88. package/cjs/component/util.js.map +1 -1
  89. package/cjs/constant/correlation.js +1 -2
  90. package/cjs/constant/layout.js +2 -1
  91. package/cjs/core/index.d.ts +1 -1
  92. package/cjs/core/index.js +1 -1
  93. package/cjs/core/index.js.map +1 -1
  94. package/cjs/core/vchart.d.ts +1 -1
  95. package/cjs/core/vchart.js +20 -20
  96. package/cjs/core/vchart.js.map +1 -1
  97. package/cjs/event/event-dispatcher.js +1 -9
  98. package/cjs/event/event-dispatcher.js.map +1 -1
  99. package/cjs/region/region.js +2 -3
  100. package/cjs/region/region.js.map +1 -1
  101. package/cjs/series/base/base-series-transformer.js +7 -4
  102. package/cjs/series/base/base-series-transformer.js.map +1 -1
  103. package/cjs/series/base/base-series.d.ts +6 -5
  104. package/cjs/series/base/base-series.js +25 -16
  105. package/cjs/series/base/base-series.js.map +1 -1
  106. package/cjs/series/base/constant.js +1 -0
  107. package/cjs/series/base/constant.js.map +1 -1
  108. package/cjs/series/dot/dot.d.ts +0 -1
  109. package/cjs/series/dot/dot.js +0 -5
  110. package/cjs/series/dot/dot.js.map +1 -1
  111. package/cjs/series/gauge/interface.d.ts +1 -1
  112. package/cjs/series/gauge/interface.js.map +1 -1
  113. package/cjs/series/polar/animation.d.ts +9 -11
  114. package/cjs/series/polar/animation.js +28 -35
  115. package/cjs/series/polar/animation.js.map +1 -1
  116. package/cjs/series/polar/polar.js +9 -2
  117. package/cjs/series/polar/polar.js.map +1 -1
  118. package/cjs/series/radar/animation.d.ts +0 -3
  119. package/cjs/series/radar/animation.js +4 -4
  120. package/cjs/series/radar/animation.js.map +1 -1
  121. package/cjs/series/radar/radar.js +11 -7
  122. package/cjs/series/radar/radar.js.map +1 -1
  123. package/cjs/series/word-cloud/base.js +21 -10
  124. package/cjs/series/word-cloud/base.js.map +1 -1
  125. package/cjs/theme/builtin/common/mark.js +2 -0
  126. package/cjs/theme/builtin/common/mark.js.map +1 -1
  127. package/cjs/typings/spec/common.d.ts +6 -2
  128. package/cjs/typings/spec/common.js.map +1 -1
  129. package/cjs/util/math.d.ts +1 -0
  130. package/cjs/util/math.js +7 -2
  131. package/cjs/util/math.js.map +1 -1
  132. package/esm/chart/base/base-chart-transformer.js +5 -3
  133. package/esm/chart/base/base-chart-transformer.js.map +1 -1
  134. package/esm/chart/base/base-chart.js +2 -2
  135. package/esm/chart/base/base-chart.js.map +1 -1
  136. package/esm/chart/mosaic/mosaic.d.ts +0 -1
  137. package/esm/chart/mosaic/mosaic.js +0 -3
  138. package/esm/chart/mosaic/mosaic.js.map +1 -1
  139. package/esm/chart/pie/interface.d.ts +2 -2
  140. package/esm/chart/pie/interface.js.map +1 -1
  141. package/esm/chart/polar/interface.d.ts +2 -0
  142. package/esm/chart/polar/interface.js.map +1 -1
  143. package/esm/compile/mark/compilable-mark.d.ts +1 -4
  144. package/esm/compile/mark/compilable-mark.js +7 -13
  145. package/esm/compile/mark/compilable-mark.js.map +1 -1
  146. package/esm/compile/mark/interface.d.ts +1 -2
  147. package/esm/compile/mark/interface.js.map +1 -1
  148. package/esm/component/axis/base-axis.d.ts +1 -2
  149. package/esm/component/axis/base-axis.js +0 -3
  150. package/esm/component/axis/base-axis.js.map +1 -1
  151. package/esm/component/axis/cartesian/axis.d.ts +1 -0
  152. package/esm/component/axis/cartesian/axis.js +29 -2
  153. package/esm/component/axis/cartesian/axis.js.map +1 -1
  154. package/esm/component/axis/polar/axis.d.ts +0 -1
  155. package/esm/component/axis/polar/axis.js +7 -38
  156. package/esm/component/axis/polar/axis.js.map +1 -1
  157. package/esm/component/axis/polar/interface/spec.d.ts +3 -1
  158. package/esm/component/axis/polar/interface/spec.js.map +1 -1
  159. package/esm/component/axis/polar/util/common.js +2 -2
  160. package/esm/component/axis/polar/util/common.js.map +1 -1
  161. package/esm/component/base/base-component.js +1 -3
  162. package/esm/component/base/base-component.js.map +1 -1
  163. package/esm/component/brush/brush.js +4 -8
  164. package/esm/component/brush/brush.js.map +1 -1
  165. package/esm/component/crosshair/cartesian.js +4 -18
  166. package/esm/component/crosshair/cartesian.js.map +1 -1
  167. package/esm/component/crosshair/polar.js +4 -18
  168. package/esm/component/crosshair/polar.js.map +1 -1
  169. package/esm/component/custom-mark/custom-mark.d.ts +1 -4
  170. package/esm/component/custom-mark/custom-mark.js +3 -30
  171. package/esm/component/custom-mark/custom-mark.js.map +1 -1
  172. package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +0 -3
  173. package/esm/component/data-zoom/data-zoom/data-zoom.js +1 -20
  174. package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
  175. package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +0 -3
  176. package/esm/component/data-zoom/scroll-bar/scroll-bar.js +1 -20
  177. package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
  178. package/esm/component/indicator/indicator.js +4 -18
  179. package/esm/component/indicator/indicator.js.map +1 -1
  180. package/esm/component/interface/common.d.ts +1 -1
  181. package/esm/component/interface/common.js.map +1 -1
  182. package/esm/component/label/base-label.d.ts +1 -2
  183. package/esm/component/label/base-label.js +0 -3
  184. package/esm/component/label/base-label.js.map +1 -1
  185. package/esm/component/label/interface.d.ts +2 -2
  186. package/esm/component/label/interface.js.map +1 -1
  187. package/esm/component/label/label.d.ts +0 -1
  188. package/esm/component/label/label.js +1 -13
  189. package/esm/component/label/label.js.map +1 -1
  190. package/esm/component/label/total-label.d.ts +1 -1
  191. package/esm/component/label/total-label.js +4 -13
  192. package/esm/component/label/total-label.js.map +1 -1
  193. package/esm/component/label/util.d.ts +1 -1
  194. package/esm/component/label/util.js +12 -7
  195. package/esm/component/label/util.js.map +1 -1
  196. package/esm/component/legend/continuous/legend.js +7 -18
  197. package/esm/component/legend/continuous/legend.js.map +1 -1
  198. package/esm/component/legend/discrete/legend.js +3 -19
  199. package/esm/component/legend/discrete/legend.js.map +1 -1
  200. package/esm/component/legend/util.d.ts +2 -2
  201. package/esm/component/map-label/component.js +3 -7
  202. package/esm/component/map-label/component.js.map +1 -1
  203. package/esm/component/marker/base-marker.js +4 -18
  204. package/esm/component/marker/base-marker.js.map +1 -1
  205. package/esm/component/player/player.d.ts +1 -3
  206. package/esm/component/player/player.js +1 -10
  207. package/esm/component/player/player.js.map +1 -1
  208. package/esm/component/title/title.js +4 -18
  209. package/esm/component/title/title.js.map +1 -1
  210. package/esm/component/tooltip/tooltip.d.ts +1 -3
  211. package/esm/component/tooltip/tooltip.js +1 -20
  212. package/esm/component/tooltip/tooltip.js.map +1 -1
  213. package/esm/component/util.d.ts +3 -0
  214. package/esm/component/util.js +14 -1
  215. package/esm/component/util.js.map +1 -1
  216. package/esm/constant/correlation.js +1 -2
  217. package/esm/constant/layout.js +2 -1
  218. package/esm/core/index.d.ts +1 -1
  219. package/esm/core/index.js +1 -1
  220. package/esm/core/index.js.map +1 -1
  221. package/esm/core/vchart.d.ts +1 -1
  222. package/esm/core/vchart.js +22 -22
  223. package/esm/core/vchart.js.map +1 -1
  224. package/esm/event/event-dispatcher.js +1 -9
  225. package/esm/event/event-dispatcher.js.map +1 -1
  226. package/esm/region/region.js +2 -3
  227. package/esm/region/region.js.map +1 -1
  228. package/esm/series/base/base-series-transformer.js +7 -4
  229. package/esm/series/base/base-series-transformer.js.map +1 -1
  230. package/esm/series/base/base-series.d.ts +6 -5
  231. package/esm/series/base/base-series.js +23 -15
  232. package/esm/series/base/base-series.js.map +1 -1
  233. package/esm/series/base/constant.js +1 -0
  234. package/esm/series/base/constant.js.map +1 -1
  235. package/esm/series/dot/dot.d.ts +0 -1
  236. package/esm/series/dot/dot.js +0 -5
  237. package/esm/series/dot/dot.js.map +1 -1
  238. package/esm/series/gauge/interface.d.ts +1 -1
  239. package/esm/series/gauge/interface.js.map +1 -1
  240. package/esm/series/polar/animation.d.ts +9 -11
  241. package/esm/series/polar/animation.js +27 -35
  242. package/esm/series/polar/animation.js.map +1 -1
  243. package/esm/series/polar/polar.js +9 -1
  244. package/esm/series/polar/polar.js.map +1 -1
  245. package/esm/series/radar/animation.d.ts +0 -3
  246. package/esm/series/radar/animation.js +4 -4
  247. package/esm/series/radar/animation.js.map +1 -1
  248. package/esm/series/radar/radar.js +11 -7
  249. package/esm/series/radar/radar.js.map +1 -1
  250. package/esm/series/word-cloud/base.js +20 -10
  251. package/esm/series/word-cloud/base.js.map +1 -1
  252. package/esm/theme/builtin/common/mark.js +2 -0
  253. package/esm/theme/builtin/common/mark.js.map +1 -1
  254. package/esm/typings/spec/common.d.ts +6 -2
  255. package/esm/typings/spec/common.js.map +1 -1
  256. package/esm/util/math.d.ts +1 -0
  257. package/esm/util/math.js +4 -0
  258. package/esm/util/math.js.map +1 -1
  259. package/package.json +17 -17
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;
@@ -20829,7 +20889,13 @@
20829
20889
  const RICHTEXT_UPDATE_TAG_KEY = ["width", "height", "ellipsis", "wordBreak", "verticalDirection", "maxHeight", "maxWidth", "textAlign", "textBaseline", "textConfig", "layoutDirection", "fill", "stroke", "fontSize", ...GRAPHIC_UPDATE_TAG_KEY];
20830
20890
  class RichText extends Graphic {
20831
20891
  constructor(params) {
20832
- super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE;
20892
+ super(params), this.type = "richtext", this._currentHoverIcon = null, this.numberType = RICHTEXT_NUMBER_TYPE, this.onBeforeAttributeUpdate = (val, attributes, key) => {
20893
+ for (const key in val) if ("hoverIconId" === key) {
20894
+ if (val[key] === attributes[key]) continue;
20895
+ const icon = this._frameCache.icons.get(val[key]);
20896
+ this.updateHoverIconState(icon);
20897
+ }
20898
+ };
20833
20899
  }
20834
20900
  get width() {
20835
20901
  var _a;
@@ -20954,6 +21020,21 @@
20954
21020
  getFrameCache() {
20955
21021
  return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
20956
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
+ }
20957
21038
  combinedStyleToCharacter(config) {
20958
21039
  const {
20959
21040
  fill: fill,
@@ -21000,8 +21081,9 @@
21000
21081
  paragraphs = [],
21001
21082
  textConfig = null != tc ? tc : _tc;
21002
21083
  for (let i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
21003
- const config = this.combinedStyleToCharacter(textConfig[i]),
21004
- iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
21084
+ const config = this.combinedStyleToCharacter(textConfig[i]);
21085
+ config.lineWidth = void 0;
21086
+ const iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
21005
21087
  if (iconCache) paragraphs.push(iconCache);else {
21006
21088
  const icon = new RichTextIcon(config);
21007
21089
  icon.successCallback = () => {
@@ -21051,14 +21133,16 @@
21051
21133
  }
21052
21134
  bindIconEvent() {
21053
21135
  this.addEventListener("pointermove", e => {
21054
- var _a, _b, _c, _d, _e;
21055
21136
  const pickedIcon = this.pickIcon(e.global);
21056
- pickedIcon && pickedIcon === this._currentHoverIcon || (pickedIcon ? (null === (_a = this._currentHoverIcon) || void 0 === _a || _a.setHoverState(!1), this._currentHoverIcon = pickedIcon, this._currentHoverIcon.setHoverState(!0), null === (_b = this.stage) || void 0 === _b || _b.setCursor(pickedIcon.attribute.cursor), null === (_c = this.stage) || void 0 === _c || _c.renderNextFrame()) : !pickedIcon && this._currentHoverIcon && (this._currentHoverIcon.setHoverState(!1), this._currentHoverIcon = null, null === (_d = this.stage) || void 0 === _d || _d.setCursor(), null === (_e = this.stage) || void 0 === _e || _e.renderNextFrame()));
21137
+ pickedIcon && pickedIcon === this._currentHoverIcon || (pickedIcon ? this.setAttribute("hoverIconId", pickedIcon.richtextId) : !pickedIcon && this._currentHoverIcon && this.setAttribute("hoverIconId", void 0));
21057
21138
  }), this.addEventListener("pointerleave", e => {
21058
- var _a, _b;
21059
- this._currentHoverIcon && (this._currentHoverIcon.setHoverState(!1), this._currentHoverIcon = null, null === (_a = this.stage) || void 0 === _a || _a.setCursor(), null === (_b = this.stage) || void 0 === _b || _b.renderNextFrame());
21139
+ this._currentHoverIcon && this.setAttribute("hoverIconId", void 0);
21060
21140
  });
21061
21141
  }
21142
+ updateHoverIconState(pickedIcon) {
21143
+ var _a, _b, _c, _d, _e;
21144
+ pickedIcon ? (null === (_a = this._currentHoverIcon) || void 0 === _a || _a.setHoverState(!1), this._currentHoverIcon = pickedIcon, this._currentHoverIcon.setHoverState(!0), null === (_b = this.stage) || void 0 === _b || _b.setCursor(pickedIcon.attribute.cursor), null === (_c = this.stage) || void 0 === _c || _c.renderNextFrame()) : (this._currentHoverIcon.setHoverState(!1), this._currentHoverIcon = null, null === (_d = this.stage) || void 0 === _d || _d.setCursor(), null === (_e = this.stage) || void 0 === _e || _e.renderNextFrame());
21145
+ }
21062
21146
  pickIcon(point) {
21063
21147
  const frameCache = this.getFrameCache(),
21064
21148
  {
@@ -21066,7 +21150,7 @@
21066
21150
  f: y
21067
21151
  } = this.globalTransMatrix;
21068
21152
  let pickIcon;
21069
- return frameCache.icons.forEach(icon => {
21153
+ return frameCache.icons.forEach((icon, key) => {
21070
21154
  var _a, _b;
21071
21155
  const bounds = icon.AABBBounds.clone();
21072
21156
  bounds.translate(icon._marginArray[3], icon._marginArray[0]), bounds.containsPoint({
@@ -22712,7 +22796,8 @@
22712
22796
  });
22713
22797
  }
22714
22798
  pauseRender() {
22715
- this._skipRender = -1;
22799
+ let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
22800
+ this._skipRender = sr;
22716
22801
  }
22717
22802
  resumeRender() {
22718
22803
  this._skipRender = 0;
@@ -23019,8 +23104,7 @@
23019
23104
  }
23020
23105
  pick(x, y) {
23021
23106
  if ("released" === this.releaseStatus) return;
23022
- this.pickerService || (this.pickerService = container.get(PickerService));
23023
- const result = this.pickerService.pick(this.children, new Point(x, y), {
23107
+ const result = this.getPickerService().pick(this.children, new Point(x, y), {
23024
23108
  bounds: this.AABBBounds
23025
23109
  });
23026
23110
  return !(!(null == result ? void 0 : result.graphic) && !(null == result ? void 0 : result.group)) && result;
@@ -23105,6 +23189,9 @@
23105
23189
  resumeTriggerEvent() {
23106
23190
  this._eventSystem && this._eventSystem.resumeTriggerEvent();
23107
23191
  }
23192
+ getPickerService() {
23193
+ return this.pickerService || (this.pickerService = container.get(PickerService)), this.pickerService;
23194
+ }
23108
23195
  }
23109
23196
 
23110
23197
  function createStage(params) {
@@ -30367,7 +30454,7 @@
30367
30454
  }
30368
30455
  function richTextAttributeTransform(attributes) {
30369
30456
  var _a, _b;
30370
- 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;
30371
30458
  }
30372
30459
  function htmlAttributeTransform(attributes) {
30373
30460
  const {
@@ -30484,6 +30571,8 @@
30484
30571
  zIndex: 1
30485
30572
  }, "group");
30486
30573
  let symbol,
30574
+ tagX = -parsedPadding[3],
30575
+ tagY = -parsedPadding[0],
30487
30576
  tagWidth = parsedPadding[1] + parsedPadding[3],
30488
30577
  tagHeight = parsedPadding[0] + parsedPadding[2],
30489
30578
  textX = 0,
@@ -30518,25 +30607,7 @@
30518
30607
  x: textX,
30519
30608
  y: 0
30520
30609
  });
30521
- textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
30522
- const {
30523
- visible: bgVisible
30524
- } = panel,
30525
- backgroundStyle = __rest$d(panel, ["visible"]);
30526
- if (visible && isBoolean$1(bgVisible)) {
30527
- const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30528
- visible: bgVisible && !!text,
30529
- x: textShape.AABBBounds.x1 - parsedPadding[1],
30530
- y: textShape.AABBBounds.y1 - parsedPadding[0],
30531
- width: textShape.AABBBounds.width() + (parsedPadding[1] + parsedPadding[3]),
30532
- height: textShape.AABBBounds.height() + (parsedPadding[0] + parsedPadding[2])
30533
- }), "rect");
30534
- if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
30535
- const customShape = backgroundStyle.customShape;
30536
- bgRect.pathProxy = attrs => customShape(textShape.attribute, attrs, new CustomPath2D());
30537
- }
30538
- this._bgRect = bgRect;
30539
- }
30610
+ textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext"), tagWidth += textShape.AABBBounds.width(), tagHeight += textShape.AABBBounds.height(), tagX += textShape.AABBBounds.x1, tagY += textShape.AABBBounds.y1;
30540
30611
  } else {
30541
30612
  const textAttrs = Object.assign(Object.assign({
30542
30613
  text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
@@ -30558,11 +30629,9 @@
30558
30629
  textAlign: textAlign,
30559
30630
  textBaseline: textBaseline
30560
30631
  } = textStyle;
30561
- (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])));
30562
- let x = 0,
30563
- y = 0,
30564
- flag = 0;
30565
- "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));
30566
30635
  const shouldRight = "right" === containerTextAlign || "end" === containerTextAlign,
30567
30636
  shouldLeft = "left" === containerTextAlign || "start" === containerTextAlign;
30568
30637
  if ((containerTextAlign ? "center" === containerTextAlign : textAlwaysCenter) && flag) {
@@ -30606,25 +30675,25 @@
30606
30675
  });
30607
30676
  }
30608
30677
  }
30609
- "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));
30610
- const {
30611
- visible: bgVisible
30612
- } = panel,
30613
- backgroundStyle = __rest$d(panel, ["visible"]);
30614
- if (visible && isBoolean$1(bgVisible)) {
30615
- const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
30616
- visible: bgVisible && !!text,
30617
- x: x,
30618
- y: y,
30619
- width: tagWidth,
30620
- height: tagHeight
30621
- }), "rect");
30622
- if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
30623
- const customShape = backgroundStyle.customShape;
30624
- bgRect.pathProxy = attrs => customShape(textShape.attribute, attrs, new CustomPath2D());
30625
- }
30626
- 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());
30627
30695
  }
30696
+ this._bgRect = bgRect;
30628
30697
  }
30629
30698
  this._textShape = textShape, this._symbol = symbol, this.resetStates();
30630
30699
  }
@@ -31858,7 +31927,10 @@
31858
31927
  } = text.attribute;
31859
31928
  if (line.customShape) {
31860
31929
  const customShape = line.customShape;
31861
- lineGraphic.pathProxy = attrs => customShape(text.attribute, attrs, new CustomPath2D());
31930
+ lineGraphic.pathProxy = attrs => customShape({
31931
+ text: text,
31932
+ baseMark: baseMark
31933
+ }, attrs, new CustomPath2D());
31862
31934
  }
31863
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;
31864
31936
  }
@@ -32252,7 +32324,7 @@
32252
32324
  default:
32253
32325
  if (this._isCollectionBase) {
32254
32326
  const point = this._idToPoint.get(text.attribute.id);
32255
- !point || text.animates && text.animates.has("label-animate") || !relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, null === (_c = this.stage) || void 0 === _c ? void 0 : _c.pickerService) || (text.animate({
32327
+ !point || text.animates && text.animates.has("label-animate") || !relatedGraphic.containsPoint(point.x, point.y, IContainPointMode.LOCAL, null === (_c = this.stage) || void 0 === _c ? void 0 : _c.getPickerService()) || (text.animate({
32256
32328
  onStart: onStart
32257
32329
  }).wait(delay).to(to, duration, easing), labelLine && labelLine.animate().wait(delay).to(to, duration, easing));
32258
32330
  } else detail.animationState.isFirstFrameOfStep && (text.animate({
@@ -32519,7 +32591,7 @@
32519
32591
  };
32520
32592
  class ArcInfo {
32521
32593
  constructor(refDatum, center, outerCenter, quadrant, radian, middleAngle, innerRadius, outerRadius, circleCenter) {
32522
- 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;
32523
32595
  }
32524
32596
  getLabelBounds() {
32525
32597
  return this.labelPosition && this.labelSize ? {
@@ -32555,7 +32627,7 @@
32555
32627
  };
32556
32628
  }
32557
32629
  _layout(texts) {
32558
- var _a;
32630
+ var _a, _b, _c;
32559
32631
  if (!texts || !texts.length) return;
32560
32632
  const labels = super._layout(texts),
32561
32633
  textBoundsArray = labels.map(label => this.getGraphicBounds(label)),
@@ -32584,11 +32656,10 @@
32584
32656
  x: basedArc.labelPosition.x,
32585
32657
  y: basedArc.labelPosition.y,
32586
32658
  angle: basedArc.angle,
32587
- maxLineWidth: basedArc.labelLimit,
32588
32659
  points: basedArc.pointA && basedArc.pointB && basedArc.pointC ? [basedArc.pointA, basedArc.pointB, basedArc.pointC] : void 0,
32589
32660
  line: basedArc.labelLine
32590
32661
  };
32591
- "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);
32592
32663
  }
32593
32664
  }
32594
32665
  return labels;
@@ -32768,12 +32839,14 @@
32768
32839
  default:
32769
32840
  cx = pointB.x + flag * this._line2MinLength;
32770
32841
  }
32771
- 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 = {
32772
32845
  x: cx,
32773
32846
  y: labelPosition.y
32774
32847
  };
32775
32848
  const align = this._computeAlign(arc, attribute),
32776
- targetCenterOffset = getAlignOffset(align) * (arc.labelLimit < arc.labelSize.width ? arc.labelLimit : arc.labelSize.width);
32849
+ targetCenterOffset = getAlignOffset(align) * (needAdjustLimit ? labelWidth : arc.labelSize.width);
32777
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);
32778
32851
  }
32779
32852
  _computeAlign(arc, attribute) {
@@ -33473,34 +33546,10 @@
33473
33546
  zIndex: 1
33474
33547
  };
33475
33548
 
33476
- const clampRadian = function () {
33477
- let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
33478
- if (angle < 0) for (; angle < 0;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
33479
- return angle;
33480
- };
33481
- function isInRange(a, min, max) {
33482
- return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
33483
- }
33484
- function getCircleLabelPosition(tickPosition, tickVector, text, style) {
33485
- const labelBounds = getTextBounds(Object.assign({
33486
- text: text
33487
- }, style)),
33488
- width = labelBounds.width(),
33489
- height = labelBounds.height(),
33490
- angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
33491
- PI_3_4 = 3 * Math.PI / 4,
33492
- PI_1_4 = Math.PI / 4,
33493
- PI_1_2 = Math.PI / 2,
33494
- baseX = tickPosition.x;
33495
- let dx = 0;
33496
- 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;
33497
- const x = baseX - dx,
33498
- baseY = tickPosition.y;
33499
- let dy = 0;
33500
- 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) {
33501
33550
  return {
33502
- x: x,
33503
- y: baseY - dy
33551
+ x: tickPosition.x + tickVector[0],
33552
+ y: tickPosition.y + tickVector[1]
33504
33553
  };
33505
33554
  }
33506
33555
  function getAxisBreakSymbolAttrs() {
@@ -33543,13 +33592,13 @@
33543
33592
  baseline: baseline
33544
33593
  };
33545
33594
  }
33546
- function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside, text, style) {
33595
+ function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside) {
33547
33596
  const point = polarToCartesian({
33548
33597
  x: 0,
33549
33598
  y: 0
33550
33599
  }, radius, angle),
33551
33600
  labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside));
33552
- return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside), text, style);
33601
+ return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside));
33553
33602
  }
33554
33603
  function getCirclePoints(center, count, radius, startAngle, endAngle) {
33555
33604
  const points = [],
@@ -33741,10 +33790,6 @@
33741
33790
  getVerticalCoord(point, offset, inside) {
33742
33791
  return getVerticalCoord(point, this.getVerticalVector(offset, inside, point));
33743
33792
  }
33744
- getTextAlign(vector) {
33745
- let align = "center";
33746
- 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;
33747
- }
33748
33793
  getTickLineItems() {
33749
33794
  const {
33750
33795
  tick: tick
@@ -34348,6 +34393,10 @@
34348
34393
  const axisLineGroup = new Segment(lineAttrs);
34349
34394
  axisLineGroup.name = AXIS_ELEMENT_NAME.line, axisLineGroup.id = this._getNodeId("line"), container.add(axisLineGroup);
34350
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
+ }
34351
34400
  getTitleAttribute() {
34352
34401
  var _a, _b, _c;
34353
34402
  const _d = this.attribute.title,
@@ -34672,6 +34721,70 @@
34672
34721
  }
34673
34722
  }
34674
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
+
34675
34788
  var __rest$4 = undefined && undefined.__rest || function (s, e) {
34676
34789
  var t = {};
34677
34790
  for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
@@ -34803,21 +34916,71 @@
34803
34916
  }
34804
34917
  return subTickLineItems;
34805
34918
  }
34806
- getTextBaseline(vector) {
34807
- let base = "middle";
34808
- 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;
34809
- }
34810
34919
  beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {}
34811
- 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
+ }
34812
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
+ }
34813
34967
  getLabelAlign(vector, inside, angle) {
34814
- 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
+ } : {
34815
34978
  textAlign: "center",
34816
34979
  textBaseline: "middle"
34817
34980
  };
34818
34981
  }
34819
34982
  getLabelPosition(point, vector, text, style) {
34820
- return getCircleLabelPosition(point, vector, text, style);
34983
+ return point;
34821
34984
  }
34822
34985
  }
34823
34986
  CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(CircleAxis, CircleAxisMixin);
@@ -36161,32 +36324,33 @@
36161
36324
  } = op,
36162
36325
  radius = null == getRadius ? void 0 : getRadius(),
36163
36326
  labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
36164
- textMeasure = initTextMeasure$1(labelStyle),
36165
- labelBoundsList = domain.map(v => {
36166
- var _a, _b;
36167
- const str = labelFormatter ? labelFormatter(v) : `${v}`,
36168
- {
36169
- width: width,
36170
- height: height
36171
- } = textMeasure.quickMeasure(str),
36172
- textWidth = Math.max(width, MIN_TICK_GAP),
36173
- textHeight = Math.max(height, MIN_TICK_GAP),
36174
- angle = scale.scale(v);
36175
- let textX = 0,
36176
- textY = 0;
36177
- const orient_align = null !== (_a = labelStyle.textAlign) && void 0 !== _a ? _a : "center",
36178
- orient_baseline = null !== (_b = labelStyle.textBaseline) && void 0 !== _b ? _b : "middle",
36179
- {
36180
- x: x,
36181
- y: y
36182
- } = getPolarAngleLabelPosition(angle, {
36183
- x: 0,
36184
- y: 0
36185
- }, radius, labelOffset, inside, str, labelStyle);
36186
- textX = x + ("right" === orient_align ? -textWidth : "center" === orient_align ? -textWidth / 2 : 0), textY = y + ("bottom" === orient_baseline ? -textHeight : "middle" === orient_baseline ? -textHeight / 2 : 0);
36187
- return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
36188
- });
36189
- 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
+ });
36190
36354
  };
36191
36355
  const polarAngleAxisDiscreteTicks = (scale, op) => {
36192
36356
  const {
@@ -36946,6 +37110,7 @@
36946
37110
  return !1;
36947
37111
  }
36948
37112
  setTextAttr(startTextBounds, endTextBounds) {
37113
+ var _a, _b, _c, _d, _e, _f, _g, _h;
36949
37114
  const {
36950
37115
  startTextStyle: startTextStyle,
36951
37116
  endTextStyle: endTextStyle
@@ -36985,10 +37150,10 @@
36985
37150
  y: position.y + height / 2
36986
37151
  }, startTextAlignStyle = {
36987
37152
  textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "left" : "right",
36988
- 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"
36989
37154
  }, endTextAlignStyle = {
36990
37155
  textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "right" : "left",
36991
- 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"
36992
37157
  }) : (startTextPosition = {
36993
37158
  x: position.x + width / 2,
36994
37159
  y: position.y + start * height
@@ -36996,10 +37161,10 @@
36996
37161
  x: position.x + width / 2,
36997
37162
  y: position.y + end * height
36998
37163
  }, startTextAlignStyle = {
36999
- 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",
37000
37165
  textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, "start") ? "top" : "bottom"
37001
37166
  }, endTextAlignStyle = {
37002
- 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",
37003
37168
  textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, "end") ? "bottom" : "top"
37004
37169
  }), this._startText = this.maybeAddLabel(this._container, merge$2({}, restStartTextStyle, {
37005
37170
  text: startTextValue,
@@ -42844,6 +43009,9 @@
42844
43009
  }
42845
43010
  return seats.map(entry => entry / digits);
42846
43011
  }
43012
+ function isValidPoint(p) {
43013
+ return isValidNumber$1(p.x) && isValidNumber$1(p.y);
43014
+ }
42847
43015
 
42848
43016
  function eachSeries(regions, callback, filter) {
42849
43017
  let flag = false;
@@ -44212,11 +44380,13 @@
44212
44380
  },
44213
44381
  word: {
44214
44382
  style: {
44383
+ fontWeight: null,
44215
44384
  fontSize: null
44216
44385
  }
44217
44386
  },
44218
44387
  fillingWord: {
44219
44388
  style: {
44389
+ fontWeight: null,
44220
44390
  fontSize: null
44221
44391
  }
44222
44392
  },
@@ -48415,12 +48585,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
48415
48585
  const NAME_PREFIX = "@";
48416
48586
  const ID_PREFIX = "#";
48417
48587
 
48418
- function getExtendedEvents(view, event, item, type, source) {
48588
+ function getExtendedEvents(view, event, type, source) {
48589
+ var _a, _b;
48419
48590
  if (source === EVENT_SOURCE_WINDOW) {
48420
48591
  const e = event.changedTouches ? event.changedTouches[0] : event;
48421
48592
  point(e);
48422
48593
  }
48423
- 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;
48424
48604
  }
48425
48605
 
48426
48606
  class Signal extends GrammarBase {
@@ -48844,12 +49024,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
48844
49024
  init(stage, parameters) {
48845
49025
  var _b, _c, _d, _e, _f;
48846
49026
  if (this._delegateEvent || (this._delegateEvent = (event, type) => {
48847
- var _a;
48848
- const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey];
48849
- if ((null == activeElement ? void 0 : activeElement.mark) === this) {
48850
- const extendedEvt = getExtendedEvents(this.view, event, activeElement, type, EVENT_SOURCE_VIEW);
48851
- this.emitGrammarEvent(type, extendedEvt, activeElement);
48852
- }
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);
48853
49030
  }, this.initEvent()), null === (_b = this.initAnimate) || void 0 === _b || _b.call(this, this.spec), !this.group) {
48854
49031
  const group = getGrammarOutput(this.spec.group, parameters);
48855
49032
  this.group = group, group && group.appendChild(this);
@@ -50226,10 +50403,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50226
50403
  const size = _this._getContainerSize();
50227
50404
  size && _this.resize(size.width, size.height);
50228
50405
  }, 100), this.delegateEvent = (event, type) => {
50229
- var _a;
50230
- const activeElement = null === (_a = event.target) || void 0 === _a ? void 0 : _a[BridgeElementKey],
50231
- extendedEvt = getExtendedEvents(this, event, activeElement, type, EVENT_SOURCE_VIEW);
50232
- this.emit(type, extendedEvt, activeElement);
50406
+ const extendedEvt = getExtendedEvents(this, event, type, EVENT_SOURCE_VIEW);
50407
+ this.emit(type, extendedEvt, event.element);
50233
50408
  }, this.handleProgressiveFrame = () => {
50234
50409
  this._progressiveMarks.length && this._progressiveMarks.forEach(mark => {
50235
50410
  mark.isDoingProgressive() && mark.evaluateProgressive();
@@ -50613,7 +50788,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50613
50788
  var _b;
50614
50789
  const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType,
50615
50790
  enableMarkMorphConfig = diff.prev.every(mark => mark.getMorphConfig().morph) && diff.next.every(mark => mark.getMorphConfig().morph);
50616
- 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, {
50617
50792
  prev: diff.prev,
50618
50793
  next: diff.next
50619
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]));
@@ -50706,7 +50881,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50706
50881
  resize(width, height) {
50707
50882
  let render = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
50708
50883
  let needDataflow = !1;
50709
- 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;
50710
50887
  }
50711
50888
  _resizeRenderer() {
50712
50889
  const width = this.width(),
@@ -50793,7 +50970,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
50793
50970
  if (this._progressiveMarks && this._progressiveMarks.some(mark => mark.isDoingProgressive())) {
50794
50971
  const raf = vglobal.getRequestAnimationFrame();
50795
50972
  this._progressiveRafId = raf(this.handleProgressiveFrame);
50796
- } else this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive()) ? this.animate.animate() : this._progressiveMarks && (this._progressiveMarks = null);
50973
+ } else this._progressiveMarks && this.animate && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive()) ? this.animate.animate() : this._progressiveMarks && (this._progressiveMarks = null);
50797
50974
  }
50798
50975
  clearProgressive() {
50799
50976
  if (this._progressiveRafId) {
@@ -55108,15 +55285,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
55108
55285
  discreteLegend: 'legend',
55109
55286
  continuousLegend: 'legend',
55110
55287
  colorLegend: 'legend',
55111
- sizeLegend: 'legend',
55112
- label: 'label',
55113
- markLine: 'markLine',
55114
- markArea: 'markArea',
55115
- markPoint: 'markPoint',
55116
- polarMarkLine: 'polarMarkLine',
55117
- polarMarkArea: 'polarMarkArea',
55118
- polarMarkPoint: 'polarMarkPoint',
55119
- geoMarkPoint: 'geoMarkPoint'
55288
+ sizeLegend: 'legend'
55120
55289
  };
55121
55290
  class EventDispatcher {
55122
55291
  constructor(vchart, compiler) {
@@ -57812,12 +57981,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
57812
57981
  compileMarks(group) {
57813
57982
  this.getMarks().forEach(m => {
57814
57983
  var _a;
57815
- m.compile({ group });
57816
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
57817
- context: {
57818
- model: this
57819
- }
57820
- }).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) => {
57821
57986
  });
57822
57987
  });
57823
57988
  }
@@ -58862,12 +59027,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
58862
59027
  setSupport3d(support3d) {
58863
59028
  this._support3d = support3d;
58864
59029
  }
58865
- getFacet() {
58866
- return this._facet;
58867
- }
58868
- setFacet(facet) {
58869
- this._facet = facet;
58870
- }
58871
59030
  getInteractive() {
58872
59031
  return this._interactive;
58873
59032
  }
@@ -59031,7 +59190,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59031
59190
  this.compileState();
59032
59191
  this.compileEncode();
59033
59192
  this.compileAnimation();
59034
- this.compileContext();
59193
+ this.compileContext(option === null || option === void 0 ? void 0 : option.context);
59035
59194
  this.compileTransform();
59036
59195
  }
59037
59196
  _initProduct(group) {
@@ -59047,14 +59206,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59047
59206
  return `${this.name}_${this.id}`;
59048
59207
  }
59049
59208
  compileData() {
59050
- var _a;
59051
59209
  if (isNil$1(this._data)) {
59052
59210
  return;
59053
59211
  }
59054
59212
  this._data.compile();
59055
59213
  const dataProduct = this._data.getProduct();
59056
59214
  if (isValid$1(this._product) && isValid$1(dataProduct)) {
59057
- this._product.join(dataProduct, this.key, undefined, (_a = this._groupKey) !== null && _a !== void 0 ? _a : this._facet);
59215
+ this._product.join(dataProduct, this.key, undefined, this.getGroupKey());
59058
59216
  }
59059
59217
  }
59060
59218
  updateStaticEncode() {
@@ -59073,7 +59231,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59073
59231
  if (this._unCompileChannel[key]) {
59074
59232
  return;
59075
59233
  }
59076
- if (this._option.noSeparateStyle || isStateAttrChangeable(key, normalStyle, this.getFacet())) {
59234
+ if (this._option.noSeparateStyle || isStateAttrChangeable(key, normalStyle, this.getGroupKey())) {
59077
59235
  updateStyles[key] = {
59078
59236
  callback: this.compileCommonAttributeCallback(key, 'normal'),
59079
59237
  dependency: [this.stateKeyToSignalName('markUpdateRank')]
@@ -59147,16 +59305,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59147
59305
  }
59148
59306
  }
59149
59307
  }
59150
- compileContext() {
59308
+ compileContext(extraContext) {
59151
59309
  const config = {
59152
59310
  interactive: this.getInteractive(),
59153
59311
  zIndex: this.getZIndex(),
59154
- context: {
59155
- markId: this.id,
59156
- modelId: this.model.id,
59157
- markUserId: this._userId,
59158
- modelUserId: this.model.userId
59159
- },
59312
+ context: Object.assign({ markId: this.id, modelId: this.model.id, markUserId: this._userId, modelUserId: this.model.userId }, extraContext),
59160
59313
  skipTheme: this.getSkipTheme(),
59161
59314
  support3d: this.getSupport3d(),
59162
59315
  enableSegments: !!this._enableSegments,
@@ -59919,7 +60072,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59919
60072
  return this._dataSet;
59920
60073
  }
59921
60074
  constructor(spec, options) {
59922
- var _a, _b, _c, _d, _e, _f;
60075
+ var _a, _b, _c, _d, _e, _f, _g, _h;
59923
60076
  this.id = createID();
59924
60077
  this._userEvents = [];
59925
60078
  this._autoSize = true;
@@ -59934,9 +60087,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59934
60087
  };
59935
60088
  this._observer = null;
59936
60089
  this._context = {};
59937
- this._onResize = debounce((...args) => {
59938
- this._doResize();
59939
- }, 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
+ };
59940
60097
  this._renderSync = (option = {}) => {
59941
60098
  var _a;
59942
60099
  const self = this;
@@ -59951,6 +60108,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59951
60108
  var _a, _b;
59952
60109
  const lastSpec = this._spec;
59953
60110
  const result = {
60111
+ changeBackground: false,
59954
60112
  reTransformSpec: false,
59955
60113
  change: false,
59956
60114
  reMake: false,
@@ -59985,7 +60143,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
59985
60143
  };
59986
60144
  this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
59987
60145
  this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
59988
- 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"]);
59989
60147
  const isTrueBrowseEnv = isTrueBrowser(mode);
59990
60148
  if (isTrueBrowseEnv) {
59991
60149
  registerBrowserEnv();
@@ -60026,6 +60184,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60026
60184
  this._bindVGrammarViewEvent();
60027
60185
  this._initChartPlugin();
60028
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);
60029
60188
  }
60030
60189
  _setNewSpec(spec, forceMerge) {
60031
60190
  if (!spec) {
@@ -60116,13 +60275,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60116
60275
  });
60117
60276
  }
60118
60277
  _bindResizeEvent() {
60119
- var _a;
60278
+ var _a, _b;
60120
60279
  if (this._autoSize) {
60280
+ this._onResize = throttle(this._doResize, (_a = this._option.resizeDelay) !== null && _a !== void 0 ? _a : 100);
60121
60281
  if (this._container) {
60122
60282
  const ResizeObserverWindow = window.ResizeObserver;
60123
60283
  if (ResizeObserverWindow) {
60124
60284
  this._observer = new ResizeObserverWindow(this._onResize);
60125
- (_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);
60126
60286
  }
60127
60287
  }
60128
60288
  window.addEventListener('resize', this._onResize);
@@ -60149,13 +60309,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60149
60309
  height: (_d = (_c = this._currentSize) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : DEFAULT_CHART_HEIGHT
60150
60310
  });
60151
60311
  }
60152
- _doResize() {
60153
- const { width, height } = this.getCurrentSize();
60154
- if (this._currentSize.width !== width || this._currentSize.height !== height) {
60155
- this._currentSize = { width, height };
60156
- this.resizeSync(width, height);
60157
- }
60158
- }
60159
60312
  _initDataSet(dataSet) {
60160
60313
  if (dataSet instanceof DataSet) {
60161
60314
  this._dataSet = dataSet;
@@ -60198,7 +60351,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60198
60351
  return this._beforeRender(option);
60199
60352
  }
60200
60353
  _reCompile(updateResult, morphConfig) {
60201
- 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;
60202
60355
  if (updateResult.reMake) {
60203
60356
  this._releaseData();
60204
60357
  this._initDataSet();
@@ -60227,8 +60380,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60227
60380
  (_h = this._compiler) === null || _h === void 0 ? void 0 : _h.setBackground(this._getBackground());
60228
60381
  }
60229
60382
  if (updateResult.reCompile) {
60230
- (_j = this._compiler) === null || _j === void 0 ? void 0 : _j.clear({ chart: this._chart, vChart: this }, !this._option.animation || !this._spec.animation);
60231
- (_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 }, {});
60232
60385
  }
60233
60386
  if (updateResult.reSize) {
60234
60387
  const { width, height } = this.getCurrentSize();
@@ -60250,9 +60403,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
60250
60403
  this._initChartSpec(this._spec, 'render');
60251
60404
  }
60252
60405
  this._chartPluginApply('onBeforeInitChart', this._spec, actionSource);
60253
- (_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);
60254
60407
  this._initChart(this._spec);
60255
- (_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);
60256
60409
  if (!this._chart || !this._compiler) {
60257
60410
  return false;
60258
60411
  }
@@ -61143,7 +61296,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61143
61296
  };
61144
61297
  registerVChartCore();
61145
61298
 
61146
- const version = "1.12.4";
61299
+ const version = "1.12.6";
61147
61300
 
61148
61301
  const addVChartProperty = (data, op) => {
61149
61302
  const context = op.beforeCall();
@@ -61539,6 +61692,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
61539
61692
  data: true
61540
61693
  };
61541
61694
  const defaultSeriesCompileCheckKeys = {
61695
+ invalidType: true,
61542
61696
  animation: true,
61543
61697
  animationAppear: true,
61544
61698
  animationEnter: true,
@@ -62004,16 +62158,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62004
62158
  this.stack = true;
62005
62159
  }
62006
62160
  }
62007
- _addMarkLabelSpec(spec, markName, labelSpecKey = 'label', styleHandlerName = 'initLabelMarkStyle', hasAnimation, head) {
62161
+ _addMarkLabelSpec(spec, markName, labelSpecKey = 'label', styleHandlerName = 'initLabelMarkStyle', hasAnimation = true, head) {
62008
62162
  if (!spec) {
62009
62163
  return;
62010
62164
  }
62011
62165
  const labels = array(spec[labelSpecKey]);
62012
62166
  labels.forEach(labelSpec => {
62013
- var _a, _b, _c, _d;
62167
+ var _a, _b, _c;
62014
62168
  if (labelSpec && labelSpec.visible) {
62015
- const animationEnabled = (_d = (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.animation) !== null && _b !== void 0 ? _b : spec.animation) !== null && _c !== void 0 ? _c : labelSpec.animation) !== null && _d !== void 0 ? _d : true;
62016
- this.addLabelSpec(markName, Object.assign(Object.assign({}, labelSpec), { animation: animationEnabled && hasAnimation, getStyleHandler: (series) => { var _a; return (_a = series[styleHandlerName]) === null || _a === void 0 ? void 0 : _a.bind(series); } }), head);
62169
+ const { animation = true, animationUpdate: labelAnimationUpdate = true, animationEnter: labelAnimationEnter = true, animationExit: labelAnimationExit = true } = labelSpec;
62170
+ const { animationUpdate = true, animationEnter = true, animationExit = true } = spec;
62171
+ const animationEnabled = (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.animation) !== null && _b !== void 0 ? _b : spec.animation) !== null && _c !== void 0 ? _c : labelSpec.animation;
62172
+ const labelAnimationEnabled = !!animationEnabled && !!hasAnimation;
62173
+ this.addLabelSpec(markName, Object.assign(Object.assign({}, labelSpec), { animation: labelAnimationEnabled ? animation : false, animationUpdate: labelAnimationEnabled && animationUpdate && labelAnimationUpdate ? animationUpdate : false, animationEnter: labelAnimationEnabled && animationEnter && labelAnimationEnter ? animationEnter : false, animationExit: labelAnimationEnabled && animationEnter && labelAnimationExit ? animationExit : false, getStyleHandler: (series) => { var _a; return (_a = series[styleHandlerName]) === null || _a === void 0 ? void 0 : _a.bind(series); } }), head);
62017
62174
  }
62018
62175
  });
62019
62176
  }
@@ -62128,13 +62285,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62128
62285
  setSeriesField(field) {
62129
62286
  if (isValid$1(field)) {
62130
62287
  this._seriesField = field;
62131
- this.getMarks()
62132
- .filter(m => {
62133
- return m.getDataView() === this.getViewData();
62134
- })
62135
- .forEach(m => {
62136
- m.setFacet(this._seriesField);
62137
- });
62138
62288
  }
62139
62289
  }
62140
62290
  getGroups() {
@@ -62533,7 +62683,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62533
62683
  }
62534
62684
  _createExtensionMark(spec, parentMark, namePrefix, index, options) {
62535
62685
  var _a;
62536
- const mark = this._createMark({ type: spec.type, name: `${namePrefix}_${index}` }, {
62686
+ const mark = this._createMark({ type: spec.type, name: isValid$1(spec.name) ? `${spec.name}` : `${namePrefix}_${index}` }, {
62537
62687
  skipBeforeLayouted: true,
62538
62688
  markSpec: spec,
62539
62689
  parent: parentMark,
@@ -62546,6 +62696,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62546
62696
  if (!mark) {
62547
62697
  return;
62548
62698
  }
62699
+ if (isValid$1(spec.id)) {
62700
+ mark.setUserId(spec.id);
62701
+ }
62549
62702
  if (options.hasAnimation) {
62550
62703
  const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
62551
62704
  mark.setAnimationConfig(config);
@@ -62793,8 +62946,34 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62793
62946
  initTooltip() {
62794
62947
  this._tooltipHelper = new BaseSeriesTooltipHelper(this);
62795
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
+ }
62796
62976
  _compareSpec(spec, prevSpec, ignoreCheckKeys) {
62797
- var _a, _b;
62798
62977
  const result = super._compareSpec(spec, prevSpec);
62799
62978
  const currentKeys = Object.keys(prevSpec || {}).sort();
62800
62979
  const nextKeys = Object.keys(spec || {}).sort();
@@ -62802,36 +62981,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
62802
62981
  result.reMake = true;
62803
62982
  return result;
62804
62983
  }
62805
- ignoreCheckKeys = Object.assign(Object.assign(Object.assign({}, defaultSeriesIgnoreCheckKeys), defaultSeriesCompileCheckKeys), ignoreCheckKeys);
62806
- ignoreCheckKeys.invalidType = true;
62807
- if (spec.invalidType !== prevSpec.invalidType) {
62808
- result.reCompile = true;
62809
- }
62810
- ignoreCheckKeys.extensionMark = true;
62811
- if (array(spec.extensionMark).length !== array(prevSpec.extensionMark).length ||
62812
- ((_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))) {
62813
- result.reMake = true;
62814
- }
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);
62815
62989
  if (result.reMake) {
62816
62990
  return result;
62817
62991
  }
62818
- if ((_b = prevSpec.extensionMark) === null || _b === void 0 ? void 0 : _b.some((mark, index) => mark.visible !== spec.extensionMark[index].visible)) {
62819
- result.reCompile = true;
62820
- }
62821
- if (this._marks.getMarks().some(m => {
62822
- var _a, _b;
62823
- ignoreCheckKeys[m.name] = true;
62824
- 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);
62825
- })) {
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
+ })) {
62826
62998
  result.reCompile = true;
62827
62999
  }
62828
- if (currentKeys.some((k) => {
62829
- return defaultSeriesCompileCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
62830
- })) {
63000
+ if (!result.reCompile &&
63001
+ currentKeys.some((k) => {
63002
+ return defaultSeriesCompileCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
63003
+ })) {
62831
63004
  result.reCompile = true;
62832
63005
  }
62833
63006
  if (currentKeys.some((k) => {
62834
- return !ignoreCheckKeys[k] && !isEqual(spec[k], prevSpec[k]);
63007
+ return !ignores[k] && !isEqual(spec[k], prevSpec[k]);
62835
63008
  })) {
62836
63009
  result.reMake = true;
62837
63010
  return result;
@@ -64343,6 +64516,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64343
64516
  }
64344
64517
  return {};
64345
64518
  }
64519
+ const getSpecInfo = (chartSpec, specKey, compType, filter) => {
64520
+ if (isNil$1(chartSpec[specKey])) {
64521
+ return undefined;
64522
+ }
64523
+ const isArraySpec = isArray$1(chartSpec[specKey]);
64524
+ const spec = isArraySpec ? chartSpec[specKey] : [chartSpec[specKey]];
64525
+ const specInfos = [];
64526
+ spec.forEach((s, i) => {
64527
+ if (s && (!filter || filter(s))) {
64528
+ specInfos.push({
64529
+ spec: s,
64530
+ specPath: isArraySpec ? [specKey, i] : [specKey],
64531
+ specInfoPath: ['component', specKey, i],
64532
+ type: compType
64533
+ });
64534
+ }
64535
+ });
64536
+ return specInfos;
64537
+ };
64346
64538
 
64347
64539
  const DEFAULT_TITLE_STYLE = {
64348
64540
  left: {
@@ -64694,13 +64886,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64694
64886
  }
64695
64887
  compileMarks(group) {
64696
64888
  this.getMarks().forEach(m => {
64697
- var _a;
64698
- m.compile({ group });
64699
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
64700
- context: {
64701
- model: this
64702
- }
64703
- });
64889
+ m.compile({ group, context: { model: this } });
64704
64890
  });
64705
64891
  }
64706
64892
  reAppendComponents() {
@@ -64995,11 +65181,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
64995
65181
  });
64996
65182
  return result;
64997
65183
  }
64998
- _delegateAxisContainerEvent(component) {
64999
- if (component.listenerCount('*') === 0) {
65000
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
65001
- }
65002
- }
65003
65184
  _getAxisAttributes() {
65004
65185
  const spec = this._spec;
65005
65186
  const axisAttrs = {
@@ -65594,7 +65775,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65594
65775
  this.pluginService && plugin.onDidLayoutVertical && plugin.onDidLayoutVertical(this.pluginService, this);
65595
65776
  });
65596
65777
  }
65597
- this._delegateAxisContainerEvent(product.getGroupGraphicItem());
65598
65778
  if (this._unitText) {
65599
65779
  const { x, y } = this.getLayoutStartPoint();
65600
65780
  const pos = isXAxis(this._orient)
@@ -65846,7 +66026,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65846
66026
  },
65847
66027
  items,
65848
66028
  verticalLimitSize: this._verticalLimitSize,
65849
- verticalMinSize
66029
+ verticalMinSize,
66030
+ label: {
66031
+ overflowLimitLength: this._getLabelOverflowLimit(isX)
66032
+ }
65850
66033
  };
65851
66034
  if (!ignoreGrid) {
65852
66035
  attrs.grid = {
@@ -65990,6 +66173,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
65990
66173
  _getNeedClearVRenderComponents() {
65991
66174
  return this._unitText ? [this._unitText] : [];
65992
66175
  }
66176
+ _getLabelOverflowLimit(isX) {
66177
+ var _a, _b;
66178
+ if (isX && ((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.visible) !== false && ((_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.autoLimit) === true) {
66179
+ const axesComponents = this._option.getComponentsByKey('axes');
66180
+ const relativeRegions = this.getRegions();
66181
+ const relativeAxes = axesComponents.filter(item => {
66182
+ const orient = item.getOrient();
66183
+ return ((orient === 'left' || orient === 'right') &&
66184
+ item.getRegions().some(region => relativeRegions.includes(region)));
66185
+ });
66186
+ let leftLimitLength = 0;
66187
+ let rightLimitLength = 0;
66188
+ const startX = this.getLayoutStartPoint().x;
66189
+ const endX = startX + this.getLayoutRect().width;
66190
+ relativeAxes.forEach(axis => {
66191
+ const relativeStartX = axis.getLayoutStartPoint().x;
66192
+ if (axis.getOrient() === 'left' && relativeStartX === startX) {
66193
+ const leftAxisWidth = axis.getLayoutRect().width;
66194
+ leftLimitLength = Math.max(leftLimitLength, leftAxisWidth);
66195
+ }
66196
+ else if (relativeStartX === endX) {
66197
+ const rightAxisWidth = axis.getLayoutRect().width;
66198
+ rightLimitLength = Math.max(rightLimitLength, rightAxisWidth);
66199
+ }
66200
+ });
66201
+ return { left: leftLimitLength, right: rightLimitLength };
66202
+ }
66203
+ return undefined;
66204
+ }
65993
66205
  }
65994
66206
  CartesianAxis.type = ComponentTypeEnum.cartesianAxis;
65995
66207
  CartesianAxis.specKey = 'axes';
@@ -68091,13 +68303,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68091
68303
  if (!this._backgroundMark) {
68092
68304
  return;
68093
68305
  }
68094
- this._backgroundMark.compile();
68095
- (_a = this._backgroundMark
68096
- .getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
68097
- context: {
68098
- model: this
68099
- }
68100
- }).layout(() => {
68306
+ this._backgroundMark.compile({ context: { model: this } });
68307
+ (_a = this._backgroundMark.getProduct()) === null || _a === void 0 ? void 0 : _a.layout(() => {
68101
68308
  });
68102
68309
  }
68103
68310
  compileRegions() {
@@ -68574,13 +68781,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
68574
68781
  }
68575
68782
  otherComponents.forEach(C => {
68576
68783
  var _a;
68577
- (_a = C.getSpecInfo(chartSpec, chartSpecInfo)) === null || _a === void 0 ? void 0 : _a.forEach(info => {
68784
+ (_a = (C.getSpecInfo ? C.getSpecInfo(chartSpec, chartSpecInfo) : getSpecInfo(chartSpec, C.specKey, C.type))) === null || _a === void 0 ? void 0 : _a.forEach(info => {
68578
68785
  results.push(callbackfn(C, info, chartSpecInfo));
68579
68786
  });
68580
68787
  });
68581
- (_c = tooltip === null || tooltip === void 0 ? void 0 : tooltip.getSpecInfo(chartSpec, chartSpecInfo)) === null || _c === void 0 ? void 0 : _c.forEach(info => {
68582
- results.push(callbackfn(tooltip, info, chartSpecInfo));
68583
- });
68788
+ if (tooltip) {
68789
+ (_c = getSpecInfo(chartSpec, tooltip.specKey, tooltip.type)) === null || _c === void 0 ? void 0 : _c.forEach(info => {
68790
+ results.push(callbackfn(tooltip, info, chartSpecInfo));
68791
+ });
68792
+ }
68584
68793
  return results;
68585
68794
  }
68586
68795
  transformSeriesSpec(spec) {
@@ -72270,15 +72479,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
72270
72479
  ? (_c = series.getXAxisHelper()) === null || _c === void 0 ? void 0 : _c.isInverse()
72271
72480
  : (_d = series.getYAxisHelper()) === null || _d === void 0 ? void 0 : _d.isInverse();
72272
72481
  let position = originPosition;
72273
- if (isString$1(originPosition) && originPosition === 'outside') {
72274
- position = (data) => {
72275
- 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') {
72276
72489
  const dataField = series.getMeasureField()[0];
72277
72490
  const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
72278
- 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;
72279
72492
  return positionMap[direction][index];
72280
- };
72281
- }
72493
+ }
72494
+ return labelPosition;
72495
+ };
72282
72496
  let overlap;
72283
72497
  if (labelSpec.overlap === false) {
72284
72498
  overlap = false;
@@ -73929,8 +74143,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
73929
74143
  if (isNil$1(angleValue) || isNil$1(radiusValue) || !this.angleAxisHelper || !this.radiusAxisHelper) {
73930
74144
  return { x: Number.NaN, y: Number.NaN };
73931
74145
  }
73932
- const angle = this.angleAxisHelper.dataToPosition(array(angleValue));
73933
74146
  const radius = this.radiusAxisHelper.dataToPosition(array(radiusValue));
74147
+ if (radius < 0) {
74148
+ if (this._invalidType === 'break' || this._invalidType === 'link') {
74149
+ return { x: Number.NaN, y: Number.NaN };
74150
+ }
74151
+ else if (this._invalidType === 'zero') {
74152
+ return this.angleAxisHelper.center();
74153
+ }
74154
+ }
74155
+ const angle = this.angleAxisHelper.dataToPosition(array(angleValue));
73934
74156
  return this.angleAxisHelper.coordToPoint({ angle, radius });
73935
74157
  }
73936
74158
  dataToPosition(datum, checkInViewData) {
@@ -74403,7 +74625,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74403
74625
  y: chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.centerY
74404
74626
  }
74405
74627
  : undefined,
74406
- 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,
74628
+ outerRadius: (_f = (_e = (_d = spec.outerRadius) !== null && _d !== void 0 ? _d : spec.radius) !== null && _e !== void 0 ? _e : chartSpec.outerRadius) !== null && _f !== void 0 ? _f : chartSpec.radius,
74407
74629
  layoutRadius: chartSpec.layoutRadius
74408
74630
  };
74409
74631
  };
@@ -74982,30 +75204,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
74982
75204
  return this._groupScales;
74983
75205
  }
74984
75206
  static getSpecInfo(chartSpec) {
74985
- const axesSpec = chartSpec[this.specKey];
74986
- if (!axesSpec) {
75207
+ if (!chartSpec[this.specKey]) {
74987
75208
  return null;
74988
75209
  }
74989
- if (!isArray$1(axesSpec)) {
74990
- if (!isValidPolarAxis(axesSpec)) {
74991
- return null;
74992
- }
74993
- const { axisType, componentName, startAngle, endAngle, center, outerRadius, layoutRadius } = getPolarAxisInfo(axesSpec, chartSpec);
74994
- axesSpec.center = center;
74995
- axesSpec.startAngle = startAngle;
74996
- axesSpec.endAngle = endAngle;
74997
- axesSpec.outerRadius = outerRadius;
74998
- axesSpec.type = axisType;
74999
- axesSpec.layoutRadius = layoutRadius;
75000
- return [
75001
- {
75002
- spec: axesSpec,
75003
- specPath: [this.specKey],
75004
- specInfoPath: ['component', this.specKey, 0],
75005
- type: componentName
75006
- }
75007
- ];
75008
- }
75210
+ const isArraySpec = isArray$1(chartSpec[this.specKey]);
75211
+ const axesSpec = isArraySpec ? chartSpec[this.specKey] : [chartSpec[this.specKey]];
75009
75212
  const specInfos = [];
75010
75213
  let angleAxisIndex;
75011
75214
  let radiusAxisIndex;
@@ -75024,7 +75227,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75024
75227
  s.layoutRadius = layoutRadius;
75025
75228
  const info = {
75026
75229
  spec: s,
75027
- specPath: [this.specKey, i],
75230
+ specPath: isArraySpec ? [this.specKey, i] : [this.specKey],
75028
75231
  specInfoPath: ['component', this.specKey, i],
75029
75232
  type: componentName
75030
75233
  };
@@ -75130,17 +75333,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75130
75333
  var _a;
75131
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 });
75132
75335
  }
75133
- afterCompile() {
75134
- var _a;
75135
- const product = (_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct();
75136
- if (product) {
75137
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
75138
- if (this._isLayout === false) {
75139
- this._delegateAxisContainerEvent(product.getGroupGraphicItem());
75140
- }
75141
- });
75142
- }
75143
- }
75144
75336
  updateScaleRange() {
75145
75337
  const prevRange = this._scale.range();
75146
75338
  let newRange;
@@ -75226,29 +75418,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75226
75418
  return polarToCartesian(center, point.radius, point.angle);
75227
75419
  }
75228
75420
  pointToCoord(point) {
75229
- const { x: centerX, y: centerY } = this.getCenter();
75230
- let dx = point.x - centerX;
75231
- let dy = point.y - centerY;
75421
+ const center = this.getCenter();
75232
75422
  const startAngle = this._startAngle;
75233
75423
  const endAngle = this._endAngle;
75234
- const radius = Math.sqrt(dx * dx + dy * dy);
75235
- dx /= radius;
75236
- dy /= radius;
75237
- let radian = Math.atan2(dy, dx);
75238
- if (radian < startAngle) {
75239
- while (radian <= startAngle) {
75240
- radian += Math.PI * 2;
75241
- }
75242
- }
75243
- if (radian > endAngle) {
75244
- while (radian >= endAngle) {
75245
- radian -= Math.PI * 2;
75246
- }
75247
- }
75248
- return {
75249
- radius,
75250
- angle: radian
75251
- };
75424
+ return cartesianToPolar(point, center, startAngle, endAngle);
75252
75425
  }
75253
75426
  getOuterRadius() {
75254
75427
  return this.computeLayoutOuterRadius();
@@ -75300,7 +75473,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75300
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)
75301
75474
  ? undefined
75302
75475
  : this.getScale().domain().length });
75303
- const attrs = Object.assign(Object.assign({}, commonAttrs), { title: {
75476
+ const attrs = Object.assign(Object.assign(Object.assign({}, commonAttrs), this.getRefLayoutRect()), { title: {
75304
75477
  text: this._spec.title.text || this._dataFieldText
75305
75478
  }, items, orient: 'angle' });
75306
75479
  if (this._spec.grid.visible) {
@@ -75605,23 +75778,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75605
75778
  class PolarPointUpdate extends ACustomAnimate {
75606
75779
  constructor(from, to, duration, easing, params) {
75607
75780
  super(from, to, duration, easing, params);
75608
- const pointToCoord = this.params.pointToCoord;
75609
- const coordToPoint = this.params.coordToPoint;
75610
- if (!isFunction$1(pointToCoord) || !isFunction$1(coordToPoint)) {
75781
+ this._center = to.center;
75782
+ this._prevCenter = from.center;
75783
+ if (!this._center || !this._prevCenter) {
75611
75784
  this.valid = false;
75612
75785
  }
75613
- this._pointToCoord = pointToCoord;
75614
- this._coordToPoint = coordToPoint;
75615
75786
  }
75616
75787
  getEndProps() {
75617
75788
  if (this.valid === false) {
75618
75789
  return {};
75619
75790
  }
75620
- return this._coordToPoint({ angle: this._toAngle, radius: this._toRadius });
75791
+ return polarToCartesian(this._center, this._toRadius, this._toAngle);
75621
75792
  }
75622
75793
  onBind() {
75623
- const { angle: fromAngle, radius: fromRadius } = this._pointToCoord(this.from);
75624
- 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);
75625
75796
  if (!isValidNumber$1(toAngle * toRadius)) {
75626
75797
  this.valid = false;
75627
75798
  }
@@ -75643,12 +75814,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75643
75814
  const { x, y } = this.getEndProps();
75644
75815
  out.x = x;
75645
75816
  out.y = y;
75817
+ out.center = this._center;
75646
75818
  }
75647
75819
  else {
75648
- const { x, y } = this._coordToPoint({
75649
- angle: this._fromAngle + (this._toAngle - this._fromAngle) * ratio,
75650
- radius: this._fromRadius + (this._toRadius - this._fromRadius) * ratio
75651
- });
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);
75652
75824
  out.x = x;
75653
75825
  out.y = y;
75654
75826
  }
@@ -75657,46 +75829,50 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75657
75829
  class PolarTagPointsUpdate extends TagPointsUpdate {
75658
75830
  constructor(from, to, duration, easing, params) {
75659
75831
  super(from, to, duration, easing, params);
75660
- const pointToCoord = this.params.pointToCoord;
75661
- const coordToPoint = this.params.coordToPoint;
75662
- this._pointToCoord = pointToCoord;
75663
- this._coordToPoint = coordToPoint;
75832
+ this._center = to.center;
75833
+ this._prevCenter = from.center;
75664
75834
  }
75665
75835
  onUpdate(end, ratio, out) {
75666
75836
  this.points = this.points.map((point, index) => {
75667
75837
  const newPoint = this.polarPointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
75838
+ if (end) {
75839
+ out.center = this._center;
75840
+ }
75668
75841
  newPoint.context = point.context;
75669
75842
  return newPoint;
75670
75843
  });
75671
75844
  out.points = this.points;
75672
75845
  }
75846
+ _interpolationSinglePoint(pointA, pointB, ratio) {
75847
+ if (!isValidPoint(pointA) && !isValidPoint(pointB)) {
75848
+ return pointB;
75849
+ }
75850
+ const polarPointA = cartesianToPolar(pointA, this._prevCenter);
75851
+ const polarPointB = cartesianToPolar(pointB, this._center);
75852
+ let angleA = normalizeAngle(polarPointA.angle);
75853
+ let angleB = normalizeAngle(polarPointB.angle);
75854
+ if (!isValidNumber$1(angleA) && isValidNumber$1(angleB)) {
75855
+ angleA = angleB;
75856
+ }
75857
+ if (isValidNumber$1(angleA) && !isValidNumber$1(angleB)) {
75858
+ angleB = angleA;
75859
+ }
75860
+ const angle = angleA + (angleB - angleA) * ratio;
75861
+ const radius = polarPointA.radius + (polarPointB.radius - polarPointA.radius) * ratio;
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);
75866
+ }
75673
75867
  polarPointInterpolation(pointA, pointB, ratio) {
75674
- const polarPointA0 = this._pointToCoord(pointA);
75675
- const polarPointA1 = this._pointToCoord({ x: pointA.x1, y: pointA.y1 });
75676
- let angleA0 = normalizeAngle(polarPointA0.angle);
75677
- let angleA1 = normalizeAngle(polarPointA1.angle);
75678
- const polarPointB0 = this._pointToCoord(pointB);
75679
- const polarPointB1 = this._pointToCoord({ x: pointB.x1, y: pointB.y1 });
75680
- let angleB0 = normalizeAngle(polarPointB0.angle);
75681
- let angleB1 = normalizeAngle(polarPointB1.angle);
75682
- if (!isValidNumber$1(angleA0) && isValidNumber$1(angleB0)) {
75683
- angleA0 = angleB0;
75684
- }
75685
- if (isValidNumber$1(angleA0) && !isValidNumber$1(angleB0)) {
75686
- angleB0 = angleA0;
75687
- }
75688
- if (!isValidNumber$1(angleA1) && isValidNumber$1(angleB1)) {
75689
- angleA1 = angleB1;
75690
- }
75691
- if (isValidNumber$1(angleA1) && !isValidNumber$1(angleB1)) {
75692
- angleB1 = angleA1;
75693
- }
75694
- const angle0 = angleA0 + (angleB0 - angleA0) * ratio;
75695
- const radius0 = polarPointA0.radius + (polarPointB0.radius - polarPointA0.radius) * ratio;
75696
- const angle1 = angleA1 + (angleB1 - angleA1) * ratio;
75697
- const radius1 = polarPointA1.radius + (polarPointB1.radius - polarPointA1.radius) * ratio;
75698
- const { x, y } = this._coordToPoint({ angle: angle0, radius: radius0 });
75699
- const { x: x1, y: y1 } = this._coordToPoint({ angle: angle1, radius: radius1 });
75868
+ const { x, y } = this._interpolationSinglePoint(pointA, pointB, ratio);
75869
+ const { x: x1, y: y1 } = this._interpolationSinglePoint({
75870
+ x: pointA.x1,
75871
+ y: pointA.y1
75872
+ }, {
75873
+ x: pointB.x1,
75874
+ y: pointB.y1
75875
+ }, ratio);
75700
75876
  const point = new Point(x, y, x1, y1);
75701
75877
  point.defined = pointB.defined;
75702
75878
  return point;
@@ -75777,10 +75953,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75777
75953
  disappear: preset === 'clipIn' ? undefined : radarPresetAnimation(params, preset, 'out'),
75778
75954
  update: [
75779
75955
  {
75780
- options: { excludeChannels: ['points', 'defined'] }
75956
+ options: { excludeChannels: ['points', 'defined', 'center'] }
75781
75957
  },
75782
75958
  {
75783
- channel: ['points'],
75959
+ channel: ['points', 'center'],
75784
75960
  custom: PolarTagPointsUpdate,
75785
75961
  customParameters: params,
75786
75962
  duration: DEFAULT_ANIMATION_CONFIG.update.duration,
@@ -75796,10 +75972,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75796
75972
  disappear: preset === 'clipIn' ? undefined : radarSymbolPresetAnimation(params, preset, 'out'),
75797
75973
  update: [
75798
75974
  {
75799
- options: { excludeChannels: ['x', 'y'] }
75975
+ options: { excludeChannels: ['x', 'y', 'center'] }
75800
75976
  },
75801
75977
  {
75802
- channel: ['x', 'y'],
75978
+ channel: ['x', 'y', 'center'],
75803
75979
  custom: PolarPointUpdate,
75804
75980
  customParameters: params,
75805
75981
  duration: DEFAULT_ANIMATION_CONFIG.update.duration,
@@ -75849,10 +76025,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75849
76025
  this.initAreaMarkStyle();
75850
76026
  this.initLineMarkStyle();
75851
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
+ });
75852
76038
  }
75853
76039
  initAreaMark(progressive, isSeriesMark) {
75854
76040
  var _a, _b;
75855
76041
  this._areaMark = this._createMark(RadarSeries.mark.area, {
76042
+ groupKey: this._seriesField,
75856
76043
  progressive,
75857
76044
  isSeriesMark,
75858
76045
  customShape: (_a = this._spec.area) === null || _a === void 0 ? void 0 : _a.customShape,
@@ -75919,9 +76106,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
75919
76106
  const rect = this.getLayoutRect();
75920
76107
  return Math.min(rect.width, rect.height);
75921
76108
  },
75922
- startAngle: isValid$1(this._spec.startAngle) ? degreeToRadian(this._spec.startAngle) : POLAR_START_RADIAN,
75923
- pointToCoord: (point) => { var _a; return (_a = this.angleAxisHelper) === null || _a === void 0 ? void 0 : _a.pointToCoord(point); },
75924
- coordToPoint: (coord) => this.angleAxisHelper.coordToPoint(coord)
76109
+ startAngle: isValid$1(this._spec.startAngle) ? degreeToRadian(this._spec.startAngle) : POLAR_START_RADIAN
75925
76110
  };
75926
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');
75927
76112
  if (appearPreset === 'clipIn') {
@@ -76124,14 +76309,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
76124
76309
  level: TransformLevel.dotObjFlat
76125
76310
  }, false);
76126
76311
  }
76127
- setSeriesField(field) {
76128
- if (isValid$1(field)) {
76129
- this._seriesField = field;
76130
- this.getMarksInType(["line", "area"]).forEach(m => {
76131
- m.setFacet(this._seriesField);
76132
- });
76133
- }
76134
- }
76135
76312
  getStatisticFields() {
76136
76313
  return [{ key: this._fieldY[0], operations: ['values'], customize: this._xDimensionStatisticsDomain }];
76137
76314
  }
@@ -77617,7 +77794,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
77617
77794
  this._wordMark.getProduct().transform(wordCloudTransforms);
77618
77795
  }
77619
77796
  _getCommonTransformOptions() {
77620
- var _a, _b, _c, _d, _e, _f, _g, _h;
77797
+ var _a, _b, _c, _d, _e, _f;
77621
77798
  const { width, height } = this._region.getLayoutRect();
77622
77799
  const wordSpec = (_a = this._spec.word) !== null && _a !== void 0 ? _a : {};
77623
77800
  const wordStyleSpec = (_b = wordSpec.style) !== null && _b !== void 0 ? _b : {};
@@ -77637,13 +77814,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
77637
77814
  fontSize: this._valueField ? { field: this._valueField } : this._fontSizeRange[0],
77638
77815
  fontSizeRange: this._fontSizeRange === 'auto' ? null : this._fontSizeRange,
77639
77816
  padding: (_e = (_d = this._spec.word) === null || _d === void 0 ? void 0 : _d.padding) !== null && _e !== void 0 ? _e : DEFAULT_FONT_PADDING,
77640
- fontFamily: (_g = (_f = this._spec.fontFamilyField) !== null && _f !== void 0 ? _f : wordStyleSpec.fontFamily) !== null && _g !== void 0 ? _g : this._defaultFontFamily,
77641
- fontWeight: this._spec.fontWeightField
77817
+ fontFamily: isValid$1(this._spec.fontFamilyField)
77818
+ ? { field: this._spec.fontFamilyField }
77819
+ : (_f = wordStyleSpec.fontFamily) !== null && _f !== void 0 ? _f : this._defaultFontFamily,
77820
+ fontWeight: isValid$1(this._spec.fontWeightField)
77642
77821
  ? { field: this._spec.fontWeightField }
77643
- : this._valueField
77644
- ? this._calculateFontWeight
77645
- : wordStyleSpec.fontWeight,
77646
- fontStyle: (_h = this._spec.fontStyleField) !== null && _h !== void 0 ? _h : wordStyleSpec.fontStyle
77822
+ : isValid$1(wordStyleSpec.fontWeight)
77823
+ ? wordStyleSpec.fontWeight
77824
+ : isValid$1(this._valueField)
77825
+ ? this._calculateFontWeight
77826
+ : 'normal',
77827
+ fontStyle: isValid$1(this._spec.fontStyleField) ? { field: this._spec.fontStyleField } : wordStyleSpec.fontStyle
77647
77828
  };
77648
77829
  }
77649
77830
  _wordCloudTransformOption() {
@@ -77651,10 +77832,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
77651
77832
  return Object.assign(Object.assign({}, this._getCommonTransformOptions()), { layoutType: this._wordCloudConfig.layoutMode, rotate: this._rotateAngles, randomVisible: (_a = this._spec.random) !== null && _a !== void 0 ? _a : DEFAULT_RANDOM, clip: this._wordCloudConfig.drawOutOfBound === 'clip', shrink: this._wordCloudConfig.zoomToFit.shrink, enlarge: this._wordCloudConfig.zoomToFit.enlarge, minFontSize: this._wordCloudConfig.zoomToFit.fontSizeLimitMin, progressiveTime: this._wordCloudConfig.progressiveTime, progressiveStep: this._wordCloudConfig.progressiveStep, repeatFill: this._wordCloudConfig.zoomToFit.repeat });
77652
77833
  }
77653
77834
  _wordCloudShapeTransformOption() {
77654
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77835
+ var _a, _b, _c, _d, _e, _f;
77655
77836
  const fillingWordStyleSpec = (_b = (_a = this._spec.fillingWord) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
77656
77837
  const wordCloudShapeConfig = (_c = this._wordCloudShapeConfig) !== null && _c !== void 0 ? _c : {};
77657
- return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: (_e = (_d = wordCloudShapeConfig.fillingFontFamilyField) !== null && _d !== void 0 ? _d : fillingWordStyleSpec.fontFamily) !== null && _e !== void 0 ? _e : this._defaultFontFamily, fillingPadding: (_g = (_f = this._spec.fillingWord) === null || _f === void 0 ? void 0 : _f.padding) !== null && _g !== void 0 ? _g : DEFAULT_FONT_PADDING, fillingFontStyle: (_h = wordCloudShapeConfig.fillingFontStyleField) !== null && _h !== void 0 ? _h : fillingWordStyleSpec.fontStyle, fillingFontWeight: (_j = wordCloudShapeConfig.fillingFontWeightField) !== null && _j !== void 0 ? _j : fillingWordStyleSpec.fontWeight });
77838
+ return Object.assign(Object.assign(Object.assign({}, wordCloudShapeConfig), this._getCommonTransformOptions()), { rotateList: this._rotateAngles, fillingRotateList: wordCloudShapeConfig.fillingRotateAngles, fillingFontFamily: isValid$1(wordCloudShapeConfig.fillingFontFamilyField)
77839
+ ? { field: wordCloudShapeConfig.fillingFontFamilyField }
77840
+ : (_d = fillingWordStyleSpec.fontFamily) !== null && _d !== void 0 ? _d : this._defaultFontFamily, fillingPadding: (_f = (_e = this._spec.fillingWord) === null || _e === void 0 ? void 0 : _e.padding) !== null && _f !== void 0 ? _f : DEFAULT_FONT_PADDING, fillingFontStyle: isValid$1(wordCloudShapeConfig.fillingFontStyleField)
77841
+ ? { field: wordCloudShapeConfig.fillingFontStyleField }
77842
+ : fillingWordStyleSpec.fontStyle, fillingFontWeight: isValid$1(wordCloudShapeConfig.fillingFontWeightField)
77843
+ ? {
77844
+ field: wordCloudShapeConfig.fillingFontWeightField
77845
+ }
77846
+ : fillingWordStyleSpec.fontWeight });
77658
77847
  }
77659
77848
  getStatisticFields() {
77660
77849
  const fields = [];
@@ -77820,7 +78009,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
77820
78009
  maxFailCount = Math.min(this.options.maxFailCount, this.originalData.length);
77821
78010
  for (; i < this.data.length && this.failCount < maxFailCount;) {
77822
78011
  const drawn = this.layoutWord(i);
77823
- if (curWordTryCount++, (drawn || curWordTryCount >= maxSingleWordTryCount) && (i++, curWordTryCount = 0, this.failCount = drawn ? 0 : this.failCount + 1), this.progressiveIndex = i, this.exceedTime()) break;
78012
+ if (curWordTryCount++, (drawn || curWordTryCount > maxSingleWordTryCount) && (i++, curWordTryCount = 0, this.failCount = drawn ? 0 : this.failCount + 1), this.progressiveIndex = i, this.exceedTime()) break;
77824
78013
  i === this.data.length && this.failCount < maxFailCount && this.options.repeatFill && this.canRepeat() && (this.data = [...this.data, ...this.originalData.map(entry => Object.assign(Object.assign({}, entry), {
77825
78014
  isFill: !0
77826
78015
  }))], this.isTryRepeatFill = !0);
@@ -88891,35 +89080,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
88891
89080
  this.name = ComponentTypeEnum.discreteLegend;
88892
89081
  }
88893
89082
  static getSpecInfo(chartSpec) {
88894
- const legendSpec = chartSpec[this.specKey];
88895
- if (!legendSpec) {
88896
- return undefined;
88897
- }
88898
- if (!isArray$1(legendSpec)) {
88899
- if (!legendSpec.type || legendSpec.type === 'discrete') {
88900
- return [
88901
- {
88902
- spec: legendSpec,
88903
- specPath: [this.specKey],
88904
- specInfoPath: ['component', this.specKey, 0],
88905
- type: ComponentTypeEnum.discreteLegend
88906
- }
88907
- ];
88908
- }
88909
- return undefined;
88910
- }
88911
- const specInfos = [];
88912
- legendSpec.forEach((s, i) => {
88913
- if (!s.type || s.type === 'discrete') {
88914
- specInfos.push({
88915
- spec: s,
88916
- specPath: [this.specKey, i],
88917
- specInfoPath: ['component', this.specKey, i],
88918
- type: ComponentTypeEnum.discreteLegend
88919
- });
88920
- }
89083
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
89084
+ return !s.type || s.type === 'discrete';
88921
89085
  });
88922
- return specInfos;
88923
89086
  }
88924
89087
  init(option) {
88925
89088
  super.init(option);
@@ -89220,35 +89383,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
89220
89383
  const SIZE = [2, 10];
89221
89384
  class ContinuousLegend extends BaseLegend {
89222
89385
  static getSpecInfo(chartSpec) {
89223
- const legendSpec = chartSpec[this.specKey];
89224
- if (!legendSpec) {
89225
- return undefined;
89226
- }
89227
- if (!isArray$1(legendSpec)) {
89228
- if (isContinuousLegend(legendSpec.type)) {
89229
- return [
89230
- {
89231
- spec: legendSpec,
89232
- specPath: [this.specKey],
89233
- specInfoPath: ['component', this.specKey, 0],
89234
- type: legendSpec.type === 'color' ? ComponentTypeEnum.colorLegend : ComponentTypeEnum.sizeLegend
89235
- }
89236
- ];
89237
- }
89238
- return undefined;
89239
- }
89240
- const specInfos = [];
89241
- legendSpec.forEach((s, i) => {
89242
- if (isContinuousLegend(s.type)) {
89243
- specInfos.push({
89244
- spec: s,
89245
- specPath: [this.specKey, i],
89246
- specInfoPath: ['component', this.specKey, i],
89247
- type: s.type === 'color' ? ComponentTypeEnum.colorLegend : ComponentTypeEnum.sizeLegend
89248
- });
89249
- }
89386
+ const infos = getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
89387
+ return isContinuousLegend(s.type);
89250
89388
  });
89251
- return specInfos;
89389
+ if (infos) {
89390
+ infos.forEach(info => {
89391
+ info.type = info.spec.type === 'color' ? ComponentTypeEnum.colorLegend : ComponentTypeEnum.sizeLegend;
89392
+ });
89393
+ }
89394
+ return infos;
89252
89395
  }
89253
89396
  constructor(spec, options) {
89254
89397
  super(spec, options);
@@ -90649,32 +90792,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
90649
90792
  return 1;
90650
90793
  };
90651
90794
  }
90652
- static getSpecInfo(chartSpec) {
90653
- const tooltipSpec = chartSpec[this.specKey];
90654
- if (!tooltipSpec) {
90655
- return null;
90656
- }
90657
- if (!isArray$1(tooltipSpec)) {
90658
- return [
90659
- {
90660
- spec: tooltipSpec,
90661
- specPath: [this.specKey],
90662
- specInfoPath: ['component', this.specKey, 0],
90663
- type: ComponentTypeEnum.tooltip
90664
- }
90665
- ];
90666
- }
90667
- const specInfos = [];
90668
- tooltipSpec.forEach((s, i) => {
90669
- specInfos.push({
90670
- spec: s,
90671
- specPath: [this.specKey, i],
90672
- specInfoPath: ['component', this.specKey, i],
90673
- type: ComponentTypeEnum.tooltip
90674
- });
90675
- });
90676
- return specInfos;
90677
- }
90678
90795
  isTooltipShown() {
90679
90796
  return this._isTooltipShown;
90680
90797
  }
@@ -91611,36 +91728,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
91611
91728
 
91612
91729
  class CartesianCrossHair extends BaseCrossHair {
91613
91730
  static getSpecInfo(chartSpec) {
91614
- const crosshairSpec = chartSpec[this.specKey];
91615
- if (isNil$1(crosshairSpec)) {
91616
- return undefined;
91617
- }
91618
- if (!isArray$1(crosshairSpec)) {
91619
- if ((crosshairSpec.xField && crosshairSpec.xField.visible !== false) ||
91620
- (crosshairSpec.yField && crosshairSpec.yField.visible !== false)) {
91621
- return [
91622
- {
91623
- spec: crosshairSpec,
91624
- specPath: [this.specKey],
91625
- specInfoPath: ['component', this.specKey, 0],
91626
- type: ComponentTypeEnum.cartesianCrosshair
91627
- }
91628
- ];
91629
- }
91630
- return undefined;
91631
- }
91632
- const specInfos = [];
91633
- crosshairSpec.forEach((s, i) => {
91634
- if ((s.xField && s.xField.visible !== false) || (s.yField && s.yField.visible !== false)) {
91635
- specInfos.push({
91636
- spec: s,
91637
- specPath: [this.specKey, i],
91638
- specInfoPath: ['component', this.specKey, i],
91639
- type: ComponentTypeEnum.cartesianCrosshair
91640
- });
91641
- }
91731
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
91732
+ return (s.xField && s.xField.visible !== false) || (s.yField && s.yField.visible !== false);
91642
91733
  });
91643
- return specInfos;
91644
91734
  }
91645
91735
  constructor(spec, options) {
91646
91736
  super(spec, options);
@@ -92107,36 +92197,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
92107
92197
 
92108
92198
  class PolarCrossHair extends BaseCrossHair {
92109
92199
  static getSpecInfo(chartSpec) {
92110
- const crosshairSpec = chartSpec[this.specKey];
92111
- if (isNil$1(crosshairSpec)) {
92112
- return undefined;
92113
- }
92114
- if (!isArray$1(crosshairSpec)) {
92115
- if ((crosshairSpec.categoryField && crosshairSpec.categoryField.visible !== false) ||
92116
- (crosshairSpec.valueField && crosshairSpec.valueField.visible !== false)) {
92117
- return [
92118
- {
92119
- spec: crosshairSpec,
92120
- specPath: [this.specKey],
92121
- specInfoPath: ['component', this.specKey, 0],
92122
- type: ComponentTypeEnum.polarCrosshair
92123
- }
92124
- ];
92125
- }
92126
- return undefined;
92127
- }
92128
- const specInfos = [];
92129
- crosshairSpec.forEach((s, i) => {
92130
- if ((s.categoryField && s.categoryField.visible !== false) || (s.valueField && s.valueField.visible !== false)) {
92131
- specInfos.push({
92132
- spec: s,
92133
- specPath: [this.specKey, i],
92134
- specInfoPath: ['component', this.specKey, i],
92135
- type: ComponentTypeEnum.polarCrosshair
92136
- });
92137
- }
92200
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
92201
+ return (s.categoryField && s.categoryField.visible !== false) || (s.valueField && s.valueField.visible !== false);
92138
92202
  });
92139
- return specInfos;
92140
92203
  }
92141
92204
  constructor(spec, options) {
92142
92205
  super(spec, options);
@@ -93248,32 +93311,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93248
93311
  }
93249
93312
 
93250
93313
  class DataZoom extends DataFilterBaseComponent {
93251
- static getSpecInfo(chartSpec) {
93252
- const compSpec = chartSpec[this.specKey];
93253
- if (isNil$1(compSpec)) {
93254
- return undefined;
93255
- }
93256
- if (!isArray$1(compSpec)) {
93257
- return [
93258
- {
93259
- spec: compSpec,
93260
- specPath: [this.specKey],
93261
- specInfoPath: ['component', this.specKey, 0],
93262
- type: ComponentTypeEnum.dataZoom
93263
- }
93264
- ];
93265
- }
93266
- const specInfos = [];
93267
- compSpec.forEach((s, i) => {
93268
- specInfos.push({
93269
- spec: s,
93270
- specPath: [this.specKey, i],
93271
- specInfoPath: ['component', this.specKey, i],
93272
- type: ComponentTypeEnum.dataZoom
93273
- });
93274
- });
93275
- return specInfos;
93276
- }
93277
93314
  constructor(spec, options) {
93278
93315
  var _a;
93279
93316
  super(spec, options);
@@ -93625,32 +93662,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93625
93662
  };
93626
93663
 
93627
93664
  class ScrollBar extends DataFilterBaseComponent {
93628
- static getSpecInfo(chartSpec) {
93629
- const compSpec = chartSpec[this.specKey];
93630
- if (isNil$1(compSpec)) {
93631
- return undefined;
93632
- }
93633
- if (!isArray$1(compSpec)) {
93634
- return [
93635
- {
93636
- spec: compSpec,
93637
- specPath: [this.specKey],
93638
- specInfoPath: ['component', this.specKey, 0],
93639
- type: ComponentTypeEnum.scrollBar
93640
- }
93641
- ];
93642
- }
93643
- const specInfos = [];
93644
- compSpec.forEach((s, i) => {
93645
- specInfos.push({
93646
- spec: s,
93647
- specPath: [this.specKey, i],
93648
- specInfoPath: ['component', this.specKey, i],
93649
- type: ComponentTypeEnum.scrollBar
93650
- });
93651
- });
93652
- return specInfos;
93653
- }
93654
93665
  constructor(spec, options) {
93655
93666
  var _a;
93656
93667
  super(spec, options);
@@ -93829,35 +93840,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
93829
93840
  this._activeDatum = null;
93830
93841
  }
93831
93842
  static getSpecInfo(chartSpec) {
93832
- if (this.type !== Indicator.type) {
93833
- return null;
93834
- }
93835
- const indicatorSpec = chartSpec[this.specKey];
93836
- if (!isArray$1(indicatorSpec)) {
93837
- if (indicatorSpec.visible === false) {
93838
- return [];
93839
- }
93840
- return [
93841
- {
93842
- spec: indicatorSpec,
93843
- specPath: [this.specKey],
93844
- specInfoPath: ['component', this.specKey, 0],
93845
- type: ComponentTypeEnum.indicator
93846
- }
93847
- ];
93848
- }
93849
- const specInfos = [];
93850
- indicatorSpec.forEach((s, i) => {
93851
- if (s && s.visible !== false) {
93852
- specInfos.push({
93853
- spec: s,
93854
- specPath: [this.specKey, i],
93855
- specInfoPath: ['component', this.specKey, i],
93856
- type: ComponentTypeEnum.indicator
93857
- });
93858
- }
93843
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
93844
+ return s && s.visible !== false;
93859
93845
  });
93860
- return specInfos;
93861
93846
  }
93862
93847
  created() {
93863
93848
  super.created();
@@ -94754,34 +94739,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
94754
94739
  return 'cartesian';
94755
94740
  }
94756
94741
  static getSpecInfo(chartSpec) {
94757
- const markerSpec = chartSpec[this.specKey];
94758
- if (isEmpty(markerSpec)) {
94759
- return undefined;
94760
- }
94761
- if (!isArray$1(markerSpec) &&
94762
- markerSpec.visible !== false &&
94763
- this._getMarkerCoordinateType(markerSpec) === this.coordinateType) {
94764
- return [
94765
- {
94766
- spec: markerSpec,
94767
- specPath: [this.specKey],
94768
- specInfoPath: ['component', this.specKey, 0],
94769
- type: this.type
94770
- }
94771
- ];
94772
- }
94773
- const specInfos = [];
94774
- array(markerSpec).forEach((m, i) => {
94775
- if (m.visible !== false && this._getMarkerCoordinateType(m) === this.coordinateType) {
94776
- specInfos.push({
94777
- spec: m,
94778
- specPath: [this.specKey, i],
94779
- specInfoPath: ['component', this.specKey, i],
94780
- type: this.type
94781
- });
94782
- }
94742
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
94743
+ return s.visible !== false && this._getMarkerCoordinateType(s) === this.coordinateType;
94783
94744
  });
94784
- return specInfos;
94785
94745
  }
94786
94746
  created() {
94787
94747
  super.created();
@@ -95449,32 +95409,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
95449
95409
  this._layout && (this._layout.layoutOrient = this._orient);
95450
95410
  }
95451
95411
  static getSpecInfo(chartSpec) {
95452
- const titleSpec = chartSpec[this.specKey];
95453
- if (!titleSpec || titleSpec.visible === false) {
95454
- return null;
95455
- }
95456
- if (!isArray$1(titleSpec)) {
95457
- return [
95458
- {
95459
- spec: titleSpec,
95460
- specPath: [this.specKey],
95461
- specInfoPath: ['component', this.specKey, 0],
95462
- type: ComponentTypeEnum.title
95463
- }
95464
- ];
95465
- }
95466
- const specInfos = [];
95467
- titleSpec.forEach((s, i) => {
95468
- if (s.visible !== false) {
95469
- specInfos.push({
95470
- spec: s,
95471
- specPath: [this.specKey, i],
95472
- specInfoPath: ['component', this.specKey, i],
95473
- type: ComponentTypeEnum.title
95474
- });
95475
- }
95412
+ return getSpecInfo(chartSpec, this.specKey, ComponentTypeEnum.title, (s) => {
95413
+ return s.visible !== false;
95476
95414
  });
95477
- return specInfos;
95478
95415
  }
95479
95416
  onRender(ctx) {
95480
95417
  }
@@ -96084,20 +96021,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96084
96021
  set layoutOrient(v) {
96085
96022
  this._orient = v;
96086
96023
  }
96087
- static getSpecInfo(chartSpec) {
96088
- const playerSpec = chartSpec[this.specKey];
96089
- if (isNil$1(playerSpec)) {
96090
- return null;
96091
- }
96092
- return [
96093
- {
96094
- spec: playerSpec,
96095
- specPath: [this.specKey],
96096
- specInfoPath: ['component', this.specKey, 0],
96097
- type: ComponentTypeEnum.player
96098
- }
96099
- ];
96100
- }
96101
96024
  setAttrFromSpec() {
96102
96025
  var _a, _b, _c, _d, _e, _f, _g, _h;
96103
96026
  super.setAttrFromSpec();
@@ -96261,11 +96184,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96261
96184
  _getNeedClearVRenderComponents() {
96262
96185
  return [];
96263
96186
  }
96264
- _delegateLabelEvent(component) {
96265
- if (component.listenerCount('*') === 0) {
96266
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
96267
- }
96268
- }
96269
96187
  }
96270
96188
  BaseLabelComponent.type = ComponentTypeEnum.label;
96271
96189
 
@@ -96376,18 +96294,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96376
96294
  this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, enableAnimation);
96377
96295
  };
96378
96296
  }
96379
- afterCompile() {
96380
- this._labelComponentMap.forEach((info, component) => {
96381
- const product = component.getProduct();
96382
- if (product) {
96383
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
96384
- if (this._isLayout === false) {
96385
- this._delegateLabelEvent(product.getGroupGraphicItem());
96386
- }
96387
- });
96388
- }
96389
- });
96390
- }
96391
96297
  _initTextMark() {
96392
96298
  if (!this._labelInfoMap) {
96393
96299
  this._labelInfoMap = new Map();
@@ -96562,7 +96468,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96562
96468
  }
96563
96469
  compileMarks() {
96564
96470
  this.getMarks().forEach(m => {
96565
- var _a;
96566
96471
  const labelInfo = this._labelComponentMap.get(m)();
96567
96472
  let group;
96568
96473
  if (isArray$1(labelInfo)) {
@@ -96571,13 +96476,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96571
96476
  else {
96572
96477
  group = labelInfo.series.getRegion().getGroupMark().getProduct();
96573
96478
  }
96574
- m.compile({ group });
96575
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
96576
- context: {
96577
- model: this,
96578
- labelInfo
96579
- }
96580
- });
96479
+ m.compile({ group, context: { model: this, labelInfo } });
96581
96480
  });
96582
96481
  }
96583
96482
  getVRenderComponents() {
@@ -96636,6 +96535,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96636
96535
  this._initTextMark();
96637
96536
  this._initLabelComponent();
96638
96537
  }
96538
+ reInit(spec) {
96539
+ super.reInit(spec);
96540
+ this._initTextMark();
96541
+ }
96639
96542
  _initTextMark() {
96640
96543
  var _a;
96641
96544
  const series = this._getSeries();
@@ -96671,18 +96574,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96671
96574
  this._marks.addMark(component);
96672
96575
  }
96673
96576
  }
96674
- afterCompile() {
96675
- this._marks.forEach((componentMark, index) => {
96676
- const product = componentMark.getProduct();
96677
- if (product) {
96678
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
96679
- if (this._isLayout === false) {
96680
- this._delegateLabelEvent(product.getGroupGraphicItem());
96681
- }
96682
- });
96683
- }
96684
- });
96685
- }
96686
96577
  updateLayoutAttribute() {
96687
96578
  super.updateLayoutAttribute();
96688
96579
  const series = this._getSeries();
@@ -96724,14 +96615,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
96724
96615
  }
96725
96616
  compileMarks() {
96726
96617
  this.getMarks().forEach(m => {
96727
- var _a;
96728
96618
  const group = this._regions[0].getGroupMark().getProduct();
96729
- m.compile({ group });
96730
- (_a = m.getProduct()) === null || _a === void 0 ? void 0 : _a.configure({
96731
- context: {
96732
- model: this
96733
- }
96734
- });
96619
+ m.compile({ group, context: { model: this } });
96735
96620
  });
96736
96621
  }
96737
96622
  getVRenderComponents() {
@@ -97076,18 +96961,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97076
96961
  });
97077
96962
  }
97078
96963
  static getSpecInfo(chartSpec) {
97079
- const brushSpec = chartSpec[this.specKey];
97080
- if (isNil$1(brushSpec) || brushSpec.visible === false) {
97081
- return undefined;
97082
- }
97083
- return [
97084
- {
97085
- spec: brushSpec,
97086
- specPath: [this.specKey],
97087
- specInfoPath: ['component', this.specKey, 0],
97088
- type: ComponentTypeEnum.brush
97089
- }
97090
- ];
96964
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
96965
+ return s.visible !== false;
96966
+ });
97091
96967
  }
97092
96968
  created() {
97093
96969
  super.created();
@@ -97606,30 +97482,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97606
97482
  this.layoutZIndex = LayoutZIndex.CustomMark;
97607
97483
  this.layoutLevel = LayoutLevel.CustomMark;
97608
97484
  }
97609
- static getSpecInfo(chartSpec) {
97610
- const spec = chartSpec[this.specKey];
97611
- if (!spec) {
97612
- return null;
97613
- }
97614
- if (!isArray$1(spec)) {
97615
- return [
97616
- {
97617
- spec,
97618
- specPath: [this.specKey],
97619
- specInfoPath: ['component', this.specKey, 0],
97620
- type: ComponentTypeEnum.customMark
97621
- }
97622
- ];
97623
- }
97624
- return spec.map((specItem, i) => {
97625
- return {
97626
- spec: specItem,
97627
- specPath: [this.specKey, i],
97628
- specInfoPath: ['component', this.specKey, i],
97629
- type: ComponentTypeEnum.customMark
97630
- };
97631
- });
97632
- }
97633
97485
  created() {
97634
97486
  super.created();
97635
97487
  this.initMarks();
@@ -97673,7 +97525,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97673
97525
  var _a;
97674
97526
  const mark = this._createMark({
97675
97527
  type: spec.type,
97676
- name: `${namePrefix}_${index}`
97528
+ name: isValid$1(spec.name) ? `${spec.name}` : `${namePrefix}_${index}`
97677
97529
  }, {
97678
97530
  skipBeforeLayouted: true,
97679
97531
  attributeContext: this._getMarkAttributeContext(),
@@ -97683,6 +97535,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97683
97535
  if (!mark) {
97684
97536
  return;
97685
97537
  }
97538
+ if (isValid$1(spec.id)) {
97539
+ mark.setUserId(spec.id);
97540
+ }
97686
97541
  if (options.hasAnimation && spec.animation) {
97687
97542
  const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
97688
97543
  mark.setAnimationConfig(config);
@@ -97731,21 +97586,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97731
97586
  }
97732
97587
  onRender(ctx) {
97733
97588
  }
97734
- afterCompile() {
97735
- this.getMarks().forEach(mark => {
97736
- const product = mark.getProduct();
97737
- if (product) {
97738
- product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
97739
- if (this._isLayout === false) {
97740
- const component = product.getGroupGraphicItem();
97741
- if ((component === null || component === void 0 ? void 0 : component.listenerCount('*')) === 0) {
97742
- component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
97743
- }
97744
- }
97745
- });
97746
- }
97747
- });
97748
- }
97749
97589
  _getMarkAttributeContext() {
97750
97590
  return {
97751
97591
  vchart: this._option.globalInstance,
@@ -97973,18 +97813,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
97973
97813
  this._activeDatum = [];
97974
97814
  }
97975
97815
  static getSpecInfo(chartSpec) {
97976
- const labelSpec = chartSpec[this.specKey];
97977
- if (!labelSpec || !labelSpec.visible || isValid$1(labelSpec.series)) {
97978
- return null;
97979
- }
97980
- return [
97981
- {
97982
- spec: labelSpec,
97983
- specPath: [this.specKey],
97984
- specInfoPath: ['component', this.specKey, 0],
97985
- type: ComponentTypeEnum.mapLabel
97986
- }
97987
- ];
97816
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
97817
+ return s.visible && isValid$1(s.seriesId);
97818
+ });
97988
97819
  }
97989
97820
  setAttrFromSpec() {
97990
97821
  var _a, _b, _c, _d;
@@ -101157,9 +100988,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
101157
100988
  });
101158
100989
  };
101159
100990
  }
101160
- afterCompile() {
101161
- super.afterCompile();
101162
- }
101163
100991
  _beforeInit() {
101164
100992
  if (this._dataSet) {
101165
100993
  registerDataSetInstanceTransform(this._dataSet, 'stackSplit', stackSplit);