@visactor/vchart 1.13.9-alpha.6 → 1.13.9

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 (166) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +1047 -747
  3. package/build/index.js +1047 -746
  4. package/build/index.min.js +1 -1
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/chart/index.d.ts +1 -1
  7. package/cjs/chart/index.js.map +1 -1
  8. package/cjs/chart/pictogram/interface.d.ts +1 -1
  9. package/cjs/chart/pictogram/interface.js.map +1 -1
  10. package/cjs/chart/progress/linear/linear-progress-transformer.js +1 -1
  11. package/cjs/chart/progress/linear/linear-progress-transformer.js.map +1 -1
  12. package/cjs/compile/mark/compilable-mark.d.ts +1 -0
  13. package/cjs/compile/mark/compilable-mark.js +3 -0
  14. package/cjs/compile/mark/compilable-mark.js.map +1 -1
  15. package/cjs/component/axis/base-axis.js +7 -2
  16. package/cjs/component/axis/base-axis.js.map +1 -1
  17. package/cjs/component/axis/interface/spec.d.ts +7 -2
  18. package/cjs/component/axis/interface/spec.js.map +1 -1
  19. package/cjs/component/brush/brush.d.ts +23 -24
  20. package/cjs/component/brush/brush.js +183 -182
  21. package/cjs/component/brush/brush.js.map +1 -1
  22. package/cjs/component/brush/interface.d.ts +2 -0
  23. package/cjs/component/brush/interface.js.map +1 -1
  24. package/cjs/component/crosshair/base.js +1 -1
  25. package/cjs/component/crosshair/base.js.map +1 -1
  26. package/cjs/component/crosshair/utils/cartesian.js +9 -8
  27. package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
  28. package/cjs/component/data-zoom/data-zoom/interface.d.ts +2 -3
  29. package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
  30. package/cjs/component/marker/mark-area/base-mark-area.js +27 -17
  31. package/cjs/component/marker/mark-area/base-mark-area.js.map +1 -1
  32. package/cjs/component/marker/mark-area/interface/theme.d.ts +4 -3
  33. package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
  34. package/cjs/component/marker/mark-line/base-mark-line.js +31 -20
  35. package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
  36. package/cjs/component/marker/mark-line/cartesian-mark-line.js +32 -26
  37. package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
  38. package/cjs/component/marker/mark-line/interface/theme.d.ts +4 -3
  39. package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
  40. package/cjs/component/marker/mark-point/cartesian-mark-point.js +3 -1
  41. package/cjs/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
  42. package/cjs/component/marker/utils.d.ts +12 -0
  43. package/cjs/component/marker/utils.js +22 -7
  44. package/cjs/component/marker/utils.js.map +1 -1
  45. package/cjs/constant/event.d.ts +1 -0
  46. package/cjs/constant/event.js +6 -6
  47. package/cjs/constant/event.js.map +1 -1
  48. package/cjs/constant/layout.js +2 -1
  49. package/cjs/constant/sunburst.js +1 -2
  50. package/cjs/core/index.d.ts +1 -1
  51. package/cjs/core/index.js +1 -1
  52. package/cjs/core/index.js.map +1 -1
  53. package/cjs/core/interface.js +2 -1
  54. package/cjs/core/vchart.js +1 -2
  55. package/cjs/data/transforms/pictogram.d.ts +1 -9
  56. package/cjs/data/transforms/pictogram.js +3 -3
  57. package/cjs/data/transforms/pictogram.js.map +1 -1
  58. package/cjs/data/transforms/pie.js +1 -1
  59. package/cjs/data/transforms/pie.js.map +1 -1
  60. package/cjs/index-harmony-simple.js.map +1 -1
  61. package/cjs/index.d.ts +1 -0
  62. package/cjs/index.js +8 -7
  63. package/cjs/index.js.map +1 -1
  64. package/cjs/model/base-model.d.ts +1 -0
  65. package/cjs/model/base-model.js +6 -0
  66. package/cjs/model/base-model.js.map +1 -1
  67. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
  68. package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  69. package/cjs/series/bar/bar.js.map +1 -1
  70. package/cjs/series/gauge/gauge.js +7 -5
  71. package/cjs/series/gauge/gauge.js.map +1 -1
  72. package/cjs/series/pictogram/tooltip-helper.d.ts +2 -2
  73. package/cjs/series/pictogram/tooltip-helper.js.map +1 -1
  74. package/cjs/series/pie/pie.js +3 -3
  75. package/cjs/series/pie/pie.js.map +1 -1
  76. package/cjs/series/polar/progress-like/interface.d.ts +1 -0
  77. package/cjs/series/polar/progress-like/interface.js.map +1 -1
  78. package/cjs/series/polar/progress-like/progress-like.js +4 -3
  79. package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
  80. package/cjs/series/progress/linear/interface.d.ts +1 -0
  81. package/cjs/series/progress/linear/interface.js.map +1 -1
  82. package/cjs/series/progress/linear/linear.js +6 -4
  83. package/cjs/series/progress/linear/linear.js.map +1 -1
  84. package/cjs/typings/visual.d.ts +1 -1
  85. package/cjs/typings/visual.js.map +1 -1
  86. package/esm/chart/index.d.ts +1 -1
  87. package/esm/chart/index.js.map +1 -1
  88. package/esm/chart/pictogram/interface.d.ts +1 -1
  89. package/esm/chart/pictogram/interface.js.map +1 -1
  90. package/esm/chart/progress/linear/linear-progress-transformer.js +1 -1
  91. package/esm/chart/progress/linear/linear-progress-transformer.js.map +1 -1
  92. package/esm/compile/mark/compilable-mark.d.ts +1 -0
  93. package/esm/compile/mark/compilable-mark.js +3 -0
  94. package/esm/compile/mark/compilable-mark.js.map +1 -1
  95. package/esm/component/axis/base-axis.js +7 -2
  96. package/esm/component/axis/base-axis.js.map +1 -1
  97. package/esm/component/axis/interface/spec.d.ts +7 -2
  98. package/esm/component/axis/interface/spec.js.map +1 -1
  99. package/esm/component/brush/brush.d.ts +23 -24
  100. package/esm/component/brush/brush.js +179 -177
  101. package/esm/component/brush/brush.js.map +1 -1
  102. package/esm/component/brush/interface.d.ts +2 -0
  103. package/esm/component/brush/interface.js.map +1 -1
  104. package/esm/component/crosshair/base.js +1 -1
  105. package/esm/component/crosshair/base.js.map +1 -1
  106. package/esm/component/crosshair/utils/cartesian.js +9 -8
  107. package/esm/component/crosshair/utils/cartesian.js.map +1 -1
  108. package/esm/component/data-zoom/data-zoom/interface.d.ts +2 -3
  109. package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
  110. package/esm/component/marker/mark-area/base-mark-area.js +27 -16
  111. package/esm/component/marker/mark-area/base-mark-area.js.map +1 -1
  112. package/esm/component/marker/mark-area/interface/theme.d.ts +4 -3
  113. package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
  114. package/esm/component/marker/mark-line/base-mark-line.js +30 -19
  115. package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
  116. package/esm/component/marker/mark-line/cartesian-mark-line.js +31 -26
  117. package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
  118. package/esm/component/marker/mark-line/interface/theme.d.ts +4 -3
  119. package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
  120. package/esm/component/marker/mark-point/cartesian-mark-point.js +1 -1
  121. package/esm/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
  122. package/esm/component/marker/utils.d.ts +12 -0
  123. package/esm/component/marker/utils.js +19 -4
  124. package/esm/component/marker/utils.js.map +1 -1
  125. package/esm/constant/event.d.ts +1 -0
  126. package/esm/constant/event.js +6 -6
  127. package/esm/constant/event.js.map +1 -1
  128. package/esm/constant/layout.js +2 -1
  129. package/esm/constant/sunburst.js +1 -2
  130. package/esm/core/index.d.ts +1 -1
  131. package/esm/core/index.js +1 -1
  132. package/esm/core/index.js.map +1 -1
  133. package/esm/core/interface.js +2 -1
  134. package/esm/core/vchart.js +1 -2
  135. package/esm/data/transforms/pictogram.d.ts +1 -9
  136. package/esm/data/transforms/pictogram.js +3 -3
  137. package/esm/data/transforms/pictogram.js.map +1 -1
  138. package/esm/data/transforms/pie.js +1 -1
  139. package/esm/data/transforms/pie.js.map +1 -1
  140. package/esm/index-harmony-simple.js.map +1 -1
  141. package/esm/index.d.ts +1 -0
  142. package/esm/index.js +2 -0
  143. package/esm/index.js.map +1 -1
  144. package/esm/model/base-model.d.ts +1 -0
  145. package/esm/model/base-model.js +6 -0
  146. package/esm/model/base-model.js.map +1 -1
  147. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
  148. package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
  149. package/esm/series/bar/bar.js.map +1 -1
  150. package/esm/series/gauge/gauge.js +6 -4
  151. package/esm/series/gauge/gauge.js.map +1 -1
  152. package/esm/series/pictogram/tooltip-helper.d.ts +2 -2
  153. package/esm/series/pictogram/tooltip-helper.js.map +1 -1
  154. package/esm/series/pie/pie.js +4 -4
  155. package/esm/series/pie/pie.js.map +1 -1
  156. package/esm/series/polar/progress-like/interface.d.ts +1 -0
  157. package/esm/series/polar/progress-like/interface.js.map +1 -1
  158. package/esm/series/polar/progress-like/progress-like.js +4 -3
  159. package/esm/series/polar/progress-like/progress-like.js.map +1 -1
  160. package/esm/series/progress/linear/interface.d.ts +1 -0
  161. package/esm/series/progress/linear/interface.js.map +1 -1
  162. package/esm/series/progress/linear/linear.js +6 -4
  163. package/esm/series/progress/linear/linear.js.map +1 -1
  164. package/esm/typings/visual.d.ts +1 -1
  165. package/esm/typings/visual.js.map +1 -1
  166. package/package.json +18 -18
package/build/index.es.js CHANGED
@@ -1753,6 +1753,37 @@ const calculateAnchorOfBounds = (bounds, anchorType) => {
1753
1753
  y: anchorY
1754
1754
  };
1755
1755
  };
1756
+ const aabbSeparation = (a, b) => Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
1757
+ const obbSeparation = (a, b) => {
1758
+ const axes = [{
1759
+ x: Math.cos(a.angle),
1760
+ y: Math.sin(a.angle)
1761
+ }, {
1762
+ x: -Math.sin(a.angle),
1763
+ y: Math.cos(a.angle)
1764
+ }, {
1765
+ x: Math.cos(b.angle),
1766
+ y: Math.sin(a.angle)
1767
+ }, {
1768
+ x: -Math.sin(b.angle),
1769
+ y: Math.cos(a.angle)
1770
+ }];
1771
+ function getProjectionRange(obb, axisX, axisY) {
1772
+ const projections = obb.getRotatedCorners().map(p => p.x * axisX + p.y * axisY);
1773
+ return {
1774
+ min: Math.min(...projections),
1775
+ max: Math.max(...projections)
1776
+ };
1777
+ }
1778
+ let maxDistance = 0;
1779
+ for (const axis of axes) {
1780
+ const rangeA = getProjectionRange(a, axis.x, axis.y),
1781
+ rangeB = getProjectionRange(b, axis.x, axis.y);
1782
+ let distance;
1783
+ distance = rangeA.max < rangeB.min ? rangeB.min - rangeA.max : rangeB.max < rangeA.min ? rangeA.min - rangeB.max : 0, maxDistance = Math.max(maxDistance, distance);
1784
+ }
1785
+ return maxDistance;
1786
+ };
1756
1787
 
1757
1788
  function transformBoundsWithMatrix(out, bounds, matrix) {
1758
1789
  const {
@@ -1912,6 +1943,25 @@ class OBBBounds extends Bounds {
1912
1943
  clone() {
1913
1944
  return new OBBBounds(this);
1914
1945
  }
1946
+ getRotatedCorners() {
1947
+ const originPoint = {
1948
+ x: (this.x1 + this.x2) / 2,
1949
+ y: (this.y1 + this.y2) / 2
1950
+ };
1951
+ return [rotatePoint({
1952
+ x: this.x1,
1953
+ y: this.y1
1954
+ }, this.angle, originPoint), rotatePoint({
1955
+ x: this.x2,
1956
+ y: this.y1
1957
+ }, this.angle, originPoint), rotatePoint({
1958
+ x: this.x1,
1959
+ y: this.y2
1960
+ }, this.angle, originPoint), rotatePoint({
1961
+ x: this.x2,
1962
+ y: this.y2
1963
+ }, this.angle, originPoint)];
1964
+ }
1915
1965
  }
1916
1966
 
1917
1967
  class Matrix {
@@ -8912,6 +8962,11 @@ let Step$1 = class Step {
8912
8962
  return this.context.tryUpdateLength();
8913
8963
  }
8914
8964
  };
8965
+ class StepClosed extends Step$1 {
8966
+ lineEnd() {
8967
+ this.context.closePath();
8968
+ }
8969
+ }
8915
8970
  function genStepSegments(points, t) {
8916
8971
  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8917
8972
  const {
@@ -8925,6 +8980,16 @@ function genStepSegments(points, t) {
8925
8980
  function genStepTypeSegments(path, points) {
8926
8981
  return genCurveSegments(path, points);
8927
8982
  }
8983
+ function genStepClosedSegments(points, t) {
8984
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8985
+ const {
8986
+ direction: direction,
8987
+ startPoint: startPoint
8988
+ } = params;
8989
+ if (points.length < 2 - Number(!!startPoint)) return null;
8990
+ const segContext = new SegContext("step", null != direction ? direction : abs$1(points[points.length - 1].x - points[0].x) > abs$1(points[points.length - 1].y - points[0].y) ? Direction$1.ROW : Direction$1.COLUMN);
8991
+ return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
8992
+ }
8928
8993
 
8929
8994
  class LinearClosed extends Linear {
8930
8995
  lineEnd() {
@@ -9154,6 +9219,8 @@ function calcLineCache(points, curveType, params) {
9154
9219
  return genMonotoneYSegments(points, params);
9155
9220
  case "step":
9156
9221
  return genStepSegments(points, .5, params);
9222
+ case "stepClosed":
9223
+ return genStepClosedSegments(points, .5, params);
9157
9224
  case "stepBefore":
9158
9225
  return genStepSegments(points, 0, params);
9159
9226
  case "stepAfter":
@@ -9588,7 +9655,8 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
9588
9655
  filter: "",
9589
9656
  cursor: null,
9590
9657
  html: null,
9591
- react: null
9658
+ react: null,
9659
+ vue: null
9592
9660
  }, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
9593
9661
  const DefaultConnectAttribute = {
9594
9662
  connectedType: "none",
@@ -9696,6 +9764,12 @@ const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute
9696
9764
  cornerRadius: 0,
9697
9765
  closePath: !0
9698
9766
  });
9767
+ const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
9768
+ width: 100,
9769
+ height: 100,
9770
+ spikes: 5,
9771
+ thickness: .5
9772
+ });
9699
9773
  const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
9700
9774
  width: 0,
9701
9775
  height: 0,
@@ -10021,6 +10095,7 @@ function getScaledStroke(context, width, dpr) {
10021
10095
  function createColor(context, c, params) {
10022
10096
  let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
10023
10097
  let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
10098
+ var _a, _b, _c, _d;
10024
10099
  if (!c || !0 === c) return "black";
10025
10100
  let result, color;
10026
10101
  if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
@@ -10034,9 +10109,10 @@ function createColor(context, c, params) {
10034
10109
  if (params.attribute) {
10035
10110
  const {
10036
10111
  scaleX = 1,
10037
- scaleY = 1
10112
+ scaleY = 1,
10113
+ angle = 0
10038
10114
  } = params.attribute;
10039
- w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
10115
+ w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = null !== (_a = params.x1WithoutTransform) && void 0 !== _a ? _a : 0, y = null !== (_b = params.y1WithoutTransform) && void 0 !== _b ? _b : 0, w = null !== (_c = params.widthWithoutTransform) && void 0 !== _c ? _c : w, h = null !== (_d = params.heightWithoutTransform) && void 0 !== _d ? _d : h);
10040
10116
  }
10041
10117
  "linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
10042
10118
  }
@@ -10061,7 +10137,7 @@ function createConicGradient(context, color, x, y, w, h) {
10061
10137
  const canvasGradient = context.createConicGradient(x + (null !== (_a = color.x) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y) && void 0 !== _b ? _b : 0) * h, color.startAngle, color.endAngle);
10062
10138
  return color.stops.forEach(stop => {
10063
10139
  canvasGradient.addColorStop(stop.offset, stop.color);
10064
- }), canvasGradient.GetPattern(w + x, h + y, undefined);
10140
+ }), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
10065
10141
  }
10066
10142
 
10067
10143
  const DIRECTION_KEY = {
@@ -10136,6 +10212,7 @@ function applyStrokeStyle(ctx, character) {
10136
10212
  ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
10137
10213
  }
10138
10214
  function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
10215
+ if (desc.length <= 1) return 0;
10139
10216
  if (!width || width <= 0) return 0;
10140
10217
  const textMeasure = application.graphicUtil.textMeasure;
10141
10218
  let index = guessIndex,
@@ -10169,6 +10246,13 @@ function testLetter2(string, index) {
10169
10246
  }
10170
10247
  function measureTextCanvas(text, character) {
10171
10248
  let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
10249
+ var _a;
10250
+ if ("" === text) return {
10251
+ ascent: 0,
10252
+ height: 0,
10253
+ descent: 0,
10254
+ width: 0
10255
+ };
10172
10256
  const measurement = application.graphicUtil.textMeasure.measureText(text, character),
10173
10257
  result = {
10174
10258
  ascent: 0,
@@ -10178,7 +10262,9 @@ function measureTextCanvas(text, character) {
10178
10262
  },
10179
10263
  ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
10180
10264
  descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
10181
- return "number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent), result;
10265
+ "number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent);
10266
+ const space = null !== (_a = character.space) && void 0 !== _a ? _a : 0;
10267
+ return result.width += space, result;
10182
10268
  }
10183
10269
 
10184
10270
  var __decorate$1A = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -11316,6 +11402,7 @@ const defaultThemeObj = {
11316
11402
  text: DefaultTextAttribute,
11317
11403
  rect: DefaultRectAttribute,
11318
11404
  polygon: DefaultPolygonAttribute,
11405
+ star: DefaultStarAttribute,
11319
11406
  richtext: DefaultRichTextAttribute,
11320
11407
  richtextIcon: DefaultRichTextIconAttribute,
11321
11408
  image: DefaultImageAttribute,
@@ -11334,6 +11421,7 @@ function newThemeObj() {
11334
11421
  text: Object.assign({}, defaultThemeObj.text),
11335
11422
  rect: Object.assign({}, defaultThemeObj.rect),
11336
11423
  polygon: Object.assign({}, defaultThemeObj.polygon),
11424
+ star: Object.assign({}, defaultThemeObj.star),
11337
11425
  richtext: Object.assign({}, defaultThemeObj.richtext),
11338
11426
  richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
11339
11427
  image: Object.assign({}, defaultThemeObj.image),
@@ -11813,7 +11901,7 @@ class FederatedEvent {
11813
11901
  }
11814
11902
  _composedDetailPath(params) {
11815
11903
  if (params && params.graphic) {
11816
- const g = this.pickParams.graphic;
11904
+ const g = params.graphic;
11817
11905
  if (g.stage) {
11818
11906
  const path = g.stage.eventSystem.manager.propagationPath(g);
11819
11907
  this.detailPath.push(path), this._composedDetailPath(params.params);
@@ -15189,7 +15277,7 @@ class RectSymbol extends BaseSymbol {
15189
15277
  }
15190
15278
  var rect = new RectSymbol();
15191
15279
 
15192
- const tempBounds$1 = new AABBBounds();
15280
+ const tempBounds = new AABBBounds();
15193
15281
  class CustomSymbolClass {
15194
15282
  constructor(type, path) {
15195
15283
  let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
@@ -15218,7 +15306,7 @@ class CustomSymbolClass {
15218
15306
  let {
15219
15307
  path: path
15220
15308
  } = _ref;
15221
- tempBounds$1.x1 = path.bounds.x1 * size, tempBounds$1.y1 = path.bounds.y1 * size, tempBounds$1.x2 = path.bounds.x2 * size, tempBounds$1.y2 = path.bounds.y2 * size, bounds.union(tempBounds$1);
15309
+ tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
15222
15310
  });
15223
15311
  }
15224
15312
  this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
@@ -15532,6 +15620,7 @@ const PYRAMID3D_NUMBER_TYPE = genNumberType();
15532
15620
  const RECT_NUMBER_TYPE = genNumberType();
15533
15621
  const RECT3D_NUMBER_TYPE = genNumberType();
15534
15622
  const RICHTEXT_NUMBER_TYPE = genNumberType();
15623
+ genNumberType();
15535
15624
  const SYMBOL_NUMBER_TYPE = genNumberType();
15536
15625
  const TEXT_NUMBER_TYPE = genNumberType();
15537
15626
  const GraphicService = Symbol.for("GraphicService");
@@ -15550,8 +15639,8 @@ const SVG_PARSE_ATTRIBUTE_MAP = {
15550
15639
  const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
15551
15640
 
15552
15641
  const _tempBounds = new AABBBounds(),
15553
- tempMatrix = new Matrix(),
15554
- tempBounds = new AABBBounds();
15642
+ tempMatrix = new Matrix();
15643
+ new AABBBounds();
15555
15644
  const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
15556
15645
  const tempConstantXYKey = ["x", "y"],
15557
15646
  tempConstantScaleXYKey = ["scaleX", "scaleY"],
@@ -15786,6 +15875,9 @@ class Graphic extends Node {
15786
15875
  y: y
15787
15876
  });
15788
15877
  }
15878
+ setWidthHeightWithoutTransform(aabbBounds) {
15879
+ this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
15880
+ }
15789
15881
  setAttributes(params) {
15790
15882
  let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
15791
15883
  let context = arguments.length > 2 ? arguments[2] : undefined;
@@ -16067,24 +16159,12 @@ class Graphic extends Node {
16067
16159
  needUpdateLayout() {
16068
16160
  return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
16069
16161
  }
16070
- getAnchor(anchor, params) {
16162
+ getAnchor(anchor, params, resetScale) {
16071
16163
  const _anchor = [0, 0],
16072
16164
  getBounds = () => {
16073
16165
  if (params.b) return params.b;
16074
- const {
16075
- scaleX: scaleX,
16076
- scaleY: scaleY,
16077
- angle: angle
16078
- } = this.attribute;
16079
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
16080
- scaleX: 1,
16081
- scaleY: 1,
16082
- angle: 0
16083
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
16084
- scaleX: scaleX,
16085
- scaleY: scaleY,
16086
- angle: angle
16087
- }), params.b;
16166
+ const graphic = this.clone();
16167
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
16088
16168
  };
16089
16169
  if ("string" == typeof anchor[0]) {
16090
16170
  const ratio = parseFloat(anchor[0]) / 100,
@@ -16111,9 +16191,9 @@ class Graphic extends Node {
16111
16191
  } = this.attribute;
16112
16192
  let _anchor = [0, 0];
16113
16193
  const params = {};
16114
- if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
16194
+ if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
16115
16195
  const m = this._transMatrix;
16116
- m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
16196
+ m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
16117
16197
  x: _anchor[0],
16118
16198
  y: _anchor[1]
16119
16199
  });
@@ -17440,7 +17520,7 @@ class Circle extends Graphic {
17440
17520
  tb1: tb1,
17441
17521
  tb2: tb2
17442
17522
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
17443
- return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this), aabbBounds;
17523
+ return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this), aabbBounds;
17444
17524
  }
17445
17525
  updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
17446
17526
  const {
@@ -17690,7 +17770,7 @@ let Text$1 = class Text extends Graphic {
17690
17770
  const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
17691
17771
  boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
17692
17772
  }
17693
- return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
17773
+ return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
17694
17774
  }
17695
17775
  updateSingallineAABBBounds(text) {
17696
17776
  this.updateMultilineAABBBounds([text]);
@@ -18071,7 +18151,7 @@ let Symbol$1 = class Symbol extends Graphic {
18071
18151
  tb1: tb1,
18072
18152
  tb2: tb2
18073
18153
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
18074
- updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
18154
+ updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, this.x1WithoutTransform = aabbBounds.x1, this.y1WithoutTransform = aabbBounds.y1;
18075
18155
  const {
18076
18156
  lineJoin = symbolTheme.lineJoin
18077
18157
  } = attribute;
@@ -18143,7 +18223,7 @@ let Line$1 = class Line extends Graphic {
18143
18223
  return getTheme$1(this).line;
18144
18224
  }
18145
18225
  updateAABBBounds(attribute, lineTheme, aabbBounds) {
18146
- this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
18226
+ this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
18147
18227
  const {
18148
18228
  lineJoin = lineTheme.lineJoin
18149
18229
  } = attribute;
@@ -18240,7 +18320,7 @@ class Rect extends Graphic {
18240
18320
  tb1: tb1,
18241
18321
  tb2: tb2
18242
18322
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
18243
- return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
18323
+ return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
18244
18324
  }
18245
18325
  needUpdateTags(keys) {
18246
18326
  return super.needUpdateTags(keys, RECT_UPDATE_TAG_KEY);
@@ -18611,6 +18691,7 @@ function getFixedLRTB(left, right, top, bottom) {
18611
18691
  }
18612
18692
  class Paragraph {
18613
18693
  constructor(text, newLine, character, ascentDescentMode) {
18694
+ var _a, _b;
18614
18695
  this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
18615
18696
  const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
18616
18697
  this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
@@ -18623,7 +18704,7 @@ class Paragraph {
18623
18704
  let halfDetaHeight = 0,
18624
18705
  deltaAscent = 0,
18625
18706
  deltaDescent = 0;
18626
- this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
18707
+ this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, this.space = character.space, this.dx = null !== (_a = character.dx) && void 0 !== _a ? _a : 0, this.dy = null !== (_b = character.dy) && void 0 !== _b ? _b : 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
18627
18708
  }
18628
18709
  updateWidth() {
18629
18710
  const {
@@ -18642,11 +18723,11 @@ class Paragraph {
18642
18723
  if ("hide" === this.ellipsis) return;
18643
18724
  if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
18644
18725
  const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
18645
- if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
18726
+ if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
18646
18727
  const {
18647
18728
  width: width
18648
18729
  } = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
18649
- "vertical" === direction || (left -= this.ellipsisWidth - width);
18730
+ left -= this.ellipsisWidth - width;
18650
18731
  }
18651
18732
  }
18652
18733
  }
@@ -18657,20 +18738,21 @@ class Paragraph {
18657
18738
  });
18658
18739
  }
18659
18740
  draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
18741
+ var _a;
18660
18742
  let baseline = top + ascent,
18661
18743
  text = this.text,
18662
- left = this.left + deltaLeft;
18744
+ left = this.left + deltaLeft + (null !== (_a = this.space) && void 0 !== _a ? _a : 0) / 2;
18663
18745
  baseline += this.top;
18664
18746
  let direction = this.direction;
18665
18747
  if (this.verticalEllipsis) text = this.ellipsisStr, direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
18666
18748
  if ("hide" === this.ellipsis) return;
18667
18749
  if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
18668
18750
  const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
18669
- if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
18751
+ if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
18670
18752
  const {
18671
18753
  width: width
18672
18754
  } = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
18673
- "vertical" === direction || (left -= this.ellipsisWidth - width);
18755
+ left -= this.ellipsisWidth - width;
18674
18756
  }
18675
18757
  }
18676
18758
  }
@@ -18685,7 +18767,7 @@ class Paragraph {
18685
18767
  const {
18686
18768
  lineWidth = 1
18687
18769
  } = this.character;
18688
- if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill) if (this.character.lineThrough || this.character.underline) {
18770
+ if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline + this.dy), this.character.fill && ctx.fillText(text, left, baseline + this.dy), this.character.fill) if (this.character.lineThrough || this.character.underline) {
18689
18771
  if (this.character.underline) {
18690
18772
  const top = 1 + baseline,
18691
18773
  lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
@@ -18814,7 +18896,7 @@ class Image extends Graphic {
18814
18896
  tb1: tb1,
18815
18897
  tb2: tb2
18816
18898
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
18817
- return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
18899
+ return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
18818
18900
  }
18819
18901
  getDefaultAttribute(name) {
18820
18902
  return DefaultImageAttribute[name];
@@ -19157,7 +19239,7 @@ class RichText extends Graphic {
19157
19239
  maxWidth = richtextTheme.maxWidth,
19158
19240
  maxHeight = richtextTheme.maxHeight,
19159
19241
  textAlign = richtextTheme.textAlign,
19160
- verticalDirection = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : richtextTheme.verticalDirection,
19242
+ textBaseline = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : "top",
19161
19243
  editOptions: editOptions
19162
19244
  } = attribute;
19163
19245
  if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height);else {
@@ -19172,7 +19254,7 @@ class RichText extends Graphic {
19172
19254
  }
19173
19255
  editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !(null === (_c = attribute.textConfig) || void 0 === _c ? void 0 : _c.length) && (aabbBounds.y2 = aabbBounds.y1 + (null !== (_d = attribute.fontSize) && void 0 !== _d ? _d : 12), aabbBounds.x2 = aabbBounds.x1 + 2);
19174
19256
  let deltaY = 0;
19175
- switch (verticalDirection) {
19257
+ switch (textBaseline) {
19176
19258
  case "top":
19177
19259
  deltaY = 0;
19178
19260
  break;
@@ -19193,7 +19275,7 @@ class RichText extends Graphic {
19193
19275
  case "right":
19194
19276
  deltaX = -aabbBounds.width();
19195
19277
  }
19196
- return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
19278
+ return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
19197
19279
  }
19198
19280
  needUpdateTags(keys) {
19199
19281
  return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
@@ -19411,7 +19493,7 @@ class Path extends Graphic {
19411
19493
  tb1: tb1,
19412
19494
  tb2: tb2
19413
19495
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
19414
- updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
19496
+ updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
19415
19497
  const {
19416
19498
  lineJoin = pathTheme.lineJoin
19417
19499
  } = attribute;
@@ -19468,7 +19550,7 @@ class Area extends Graphic {
19468
19550
  return getTheme$1(this).area;
19469
19551
  }
19470
19552
  updateAABBBounds(attribute, areaTheme, aabbBounds) {
19471
- this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
19553
+ this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.setWidthHeightWithoutTransform(aabbBounds);
19472
19554
  const {
19473
19555
  lineJoin = areaTheme.lineJoin
19474
19556
  } = attribute;
@@ -19673,7 +19755,7 @@ class Arc extends Graphic {
19673
19755
  tb1: tb1,
19674
19756
  tb2: tb2
19675
19757
  } = application.graphicService.updateTempAABBBounds(aabbBounds);
19676
- updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
19758
+ updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.setWidthHeightWithoutTransform(aabbBounds);
19677
19759
  const {
19678
19760
  lineJoin = arcTheme.lineJoin
19679
19761
  } = attribute;
@@ -19801,7 +19883,7 @@ class Polygon extends Graphic {
19801
19883
  return getTheme$1(this).polygon;
19802
19884
  }
19803
19885
  updateAABBBounds(attribute, polygonTheme, aabbBounds) {
19804
- this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds);
19886
+ this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
19805
19887
  const {
19806
19888
  lineJoin = polygonTheme.lineJoin
19807
19889
  } = attribute;
@@ -26866,6 +26948,7 @@ let BrowserContext2d = class {
26866
26948
  return this.nativeContext.createRadialGradient(x0, y0, r0, x1, y1, r1);
26867
26949
  }
26868
26950
  createConicGradient(x, y, startAngle, endAngle) {
26951
+ if (this.nativeContext.createConicGradient && Math.abs(endAngle - startAngle - 2 * Math.PI) < .001) return this.nativeContext.createConicGradient(startAngle, x, y);
26869
26952
  let pattern,
26870
26953
  edit = !1;
26871
26954
  const ctx = this;
@@ -31425,6 +31508,10 @@ const SCROLLBAR_START_EVENT = "scrollDown";
31425
31508
  const SCROLLBAR_EVENT$1 = "scrollDrag";
31426
31509
  const SCROLLBAR_END_EVENT$1 = "scrollUp";
31427
31510
 
31511
+ function getEndTriggersOfDrag() {
31512
+ return "browser" === vglobal.env ? ["pointerup", "pointerleave", "pointercancel"] : ["pointerup", "pointerleave", "pointerupoutside"];
31513
+ }
31514
+
31428
31515
  const delayMap$3 = {
31429
31516
  debounce: debounce,
31430
31517
  throttle: throttle
@@ -31432,7 +31519,9 @@ const delayMap$3 = {
31432
31519
  loadScrollbarComponent();
31433
31520
  let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31434
31521
  constructor(attributes, options) {
31435
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._onRailPointerDown = e => {
31522
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._handleTouchMove = e => {
31523
+ isValid$1(this._prePos) && e.preventDefault();
31524
+ }, this._onRailPointerDown = e => {
31436
31525
  const {
31437
31526
  viewX: viewX,
31438
31527
  viewY: viewY
@@ -31457,6 +31546,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31457
31546
  }
31458
31547
  this.setScrollRange([currentScrollValue - (range[1] - range[0]) / 2, currentScrollValue + (range[1] - range[0]) / 2], !1), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
31459
31548
  }, this._onSliderPointerDown = e => {
31549
+ this._clearDragEvents();
31460
31550
  const {
31461
31551
  stopSliderDownPropagation = !0
31462
31552
  } = this.attribute;
@@ -31471,11 +31561,14 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31471
31561
  this._prePos = "horizontal" === direction ? x : y, this._dispatchEvent(SCROLLBAR_START_EVENT, {
31472
31562
  pos: this._prePos,
31473
31563
  event: e
31474
- }), "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31475
- capture: !0
31476
- }), vglobal.addEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31564
+ });
31565
+ const triggers = getEndTriggersOfDrag(),
31566
+ obj = "browser" === vglobal.env ? vglobal : this.stage;
31567
+ obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31477
31568
  capture: !0
31478
- }), this.stage.addEventListener("pointerup", this._onSliderPointerUp), this.stage.addEventListener("pointerupoutside", this._onSliderPointerUp));
31569
+ }), triggers.forEach(trigger => {
31570
+ obj.addEventListener(trigger, this._onSliderPointerUp);
31571
+ });
31479
31572
  }, this._computeScrollValue = e => {
31480
31573
  const {
31481
31574
  direction: direction
@@ -31501,7 +31594,6 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31501
31594
  [currentPos, currentScrollValue] = this._computeScrollValue(e);
31502
31595
  this.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this._prePos = currentPos;
31503
31596
  }, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap$3[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime), this._onSliderPointerUp = e => {
31504
- e.preventDefault();
31505
31597
  const {
31506
31598
  range: preRange,
31507
31599
  limitRange = [0, 1]
@@ -31509,14 +31601,10 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31509
31601
  preScrollRange = this.getScrollRange(),
31510
31602
  [currentPos, currentScrollValue] = this._computeScrollValue(e),
31511
31603
  range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
31512
- this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
31604
+ this._prePos = null, this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
31513
31605
  pre: preRange,
31514
31606
  value: clampRange$1(range, limitRange[0], limitRange[1])
31515
- }), "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31516
- capture: !0
31517
- }), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31518
- capture: !0
31519
- }), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
31607
+ }), this._clearDragEvents();
31520
31608
  };
31521
31609
  }
31522
31610
  setScrollRange(range) {
@@ -31555,7 +31643,9 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31555
31643
  delayType = "throttle",
31556
31644
  delayTime = 0
31557
31645
  } = this.attribute;
31558
- this._rail && this._rail.addEventListener("pointerdown", delayMap$3[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown);
31646
+ this._rail && this._rail.addEventListener("pointerdown", delayMap$3[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
31647
+ passive: !1
31648
+ });
31559
31649
  }
31560
31650
  render() {
31561
31651
  this._reset();
@@ -31665,9 +31755,23 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
31665
31755
  sliderSize = this._sliderSize;
31666
31756
  return "horizontal" === direction ? clampRange$1([x1 + min * width, x1 + max * width], x1, width - sliderSize) : clampRange$1([y1 + min * height, y1 + max * height], y1, height - sliderSize);
31667
31757
  }
31758
+ _clearDragEvents() {
31759
+ const triggers = getEndTriggersOfDrag(),
31760
+ obj = "browser" === vglobal.env ? vglobal : this.stage;
31761
+ obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
31762
+ capture: !0
31763
+ }), triggers.forEach(trigger => {
31764
+ obj.removeEventListener(trigger, this._onSliderPointerUp);
31765
+ });
31766
+ }
31668
31767
  _reset() {
31669
31768
  this._sliderRenderBounds = null, this._sliderLimitRange = null;
31670
31769
  }
31770
+ release(all) {
31771
+ super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
31772
+ passive: !1
31773
+ }), this._clearDragEvents();
31774
+ }
31671
31775
  };
31672
31776
  ScrollBar$1.defaultAttributes = {
31673
31777
  direction: "horizontal",
@@ -32386,6 +32490,7 @@ class PopTip extends AbstractComponent {
32386
32490
  contentStyle = {},
32387
32491
  panel: panel,
32388
32492
  logoSymbol: logoSymbol,
32493
+ poptipAnchor = "position",
32389
32494
  logoText: logoText,
32390
32495
  logoTextStyle = {},
32391
32496
  triangleMode = "default",
@@ -32397,7 +32502,8 @@ class PopTip extends AbstractComponent {
32397
32502
  visible: visible,
32398
32503
  state: state,
32399
32504
  dx = 0,
32400
- dy = 0
32505
+ dy = 0,
32506
+ positionBounds: positionBounds
32401
32507
  } = this.attribute;
32402
32508
  let {
32403
32509
  title = "",
@@ -32483,21 +32589,28 @@ class PopTip extends AbstractComponent {
32483
32589
  titleShape.setAttribute("maxLineWidth", maxSpace - buf), contentShape.setAttribute("maxLineWidth", maxSpace - buf), poptipHeight = parsedPadding[0] + parsedPadding[2], titleVisible && (poptipHeight += titleShape.AABBBounds.height() + space), poptipHeight += contentShape.AABBBounds.height();
32484
32590
  }
32485
32591
  }
32486
- const layout = "auto" === position;
32592
+ const layout = "auto" === position || isArray$1(position),
32593
+ positionList = isArray$1(position) ? position : this.positionList;
32487
32594
  let maxBBoxI,
32488
32595
  maxBBoxSize = -1 / 0;
32489
- for (let i = 0; i < this.positionList.length + 1; i++) {
32490
- const p = layout ? this.positionList[i === this.positionList.length ? maxBBoxI : i] : position;
32596
+ for (let i = 0; i < positionList.length + 1; i++) {
32597
+ const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
32491
32598
  let symbolType = "arrow2Left",
32492
32599
  offsetX = (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 4,
32493
32600
  offsetY = 0;
32494
- "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(position) ? (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -(isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = ["tl", "tr", "lb", "rb"].includes(position) ? -(isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2 : (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2);
32601
+ "top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(p) ? (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -(isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = ["tl", "tr", "lb", "rb"].includes(p) ? -(isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2 : (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2);
32495
32602
  const {
32496
32603
  angle: angle,
32497
32604
  offset: offset
32498
32605
  } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$1(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
32499
- if (isBoolean$1(bgVisible)) {
32500
- const bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
32606
+ let bgSymbol,
32607
+ anchorPoint = {
32608
+ x: 0,
32609
+ y: 0
32610
+ };
32611
+ if ("bounds" === poptipAnchor && positionBounds && (anchorPoint = this.calculateAnchorPoint(p, positionBounds)), isBoolean$1(bgVisible)) {
32612
+ let bgRect;
32613
+ bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
32501
32614
  visible: bgVisible && (contentVisible || titleVisible),
32502
32615
  x: offsetX,
32503
32616
  y: offsetY,
@@ -32510,9 +32623,7 @@ class PopTip extends AbstractComponent {
32510
32623
  dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
32511
32624
  size: symbolSize,
32512
32625
  zIndex: 9
32513
- }), "symbol");
32514
- let bgRect;
32515
- isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
32626
+ }), "symbol"), isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
32516
32627
  visible: bgVisible && (contentVisible || titleVisible),
32517
32628
  x: 0,
32518
32629
  y: 0,
@@ -32529,8 +32640,8 @@ class PopTip extends AbstractComponent {
32529
32640
  }), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
32530
32641
  }
32531
32642
  if (group.setAttributes({
32532
- x: -offset[0] + dx,
32533
- y: -offset[1] + dy,
32643
+ x: -offset[0] + dx + anchorPoint.x,
32644
+ y: -offset[1] + dy + anchorPoint.y,
32534
32645
  anchor: [offsetX, offsetY]
32535
32646
  }), logoSymbol) {
32536
32647
  const {
@@ -32558,20 +32669,87 @@ class PopTip extends AbstractComponent {
32558
32669
  zIndex: 10
32559
32670
  }), "text");
32560
32671
  }
32561
- if (!layout || !range) break;
32672
+ if (!range) break;
32562
32673
  {
32563
32674
  _tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
32564
32675
  const b = _tBounds,
32565
32676
  stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
32566
- if (rectInsideAnotherRect(b, stageBounds, !1)) break;
32567
- {
32568
- const bbox = getRectIntersect(b, stageBounds, !1),
32569
- size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
32570
- size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
32677
+ if (layout) {
32678
+ if (rectInsideAnotherRect(b, stageBounds, !1)) break;
32679
+ {
32680
+ const bbox = getRectIntersect(b, stageBounds, !1),
32681
+ size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
32682
+ size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
32683
+ }
32571
32684
  }
32685
+ if (["top", "bottom", "left", "right"].includes(p)) {
32686
+ const isVerticalPosition = "top" === p || "bottom" === p,
32687
+ isHorizontalPosition = "left" === p || "right" === p;
32688
+ let mainDirectionOverlap = !1;
32689
+ if (isVerticalPosition ? mainDirectionOverlap = "top" === p && b.y1 < 0 || "bottom" === p && b.y2 > stageBounds.y2 : isHorizontalPosition && (mainDirectionOverlap = "left" === p && b.x1 < 0 || "right" === p && b.x2 > stageBounds.x2), !mainDirectionOverlap) {
32690
+ let secondaryOffset = 0;
32691
+ const szNumber = (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2;
32692
+ isVerticalPosition ? (b.x1 < 0 ? secondaryOffset = -b.x1 : b.x2 > stageBounds.x2 && (secondaryOffset = stageBounds.x2 - b.x2), group.setAttribute("x", group.attribute.x + secondaryOffset), bgSymbol.setAttribute("dx", min$1(max$1(bgSymbol.attribute.dx - secondaryOffset, szNumber), b.width() - szNumber))) : isHorizontalPosition && (b.y1 < 0 ? secondaryOffset = -b.y1 : b.y2 > stageBounds.y2 && (secondaryOffset = stageBounds.y2 - b.y2), group.setAttribute("y", group.attribute.y + secondaryOffset), bgSymbol.setAttribute("dy", min$1(max$1(bgSymbol.attribute.dy - secondaryOffset, szNumber), b.height() - szNumber)));
32693
+ break;
32694
+ }
32695
+ }
32696
+ if (!layout) break;
32572
32697
  }
32573
32698
  }
32574
32699
  }
32700
+ calculateAnchorPoint(position, positionBounds) {
32701
+ if (!positionBounds) return {
32702
+ x: 0,
32703
+ y: 0
32704
+ };
32705
+ const {
32706
+ x: x,
32707
+ y: y
32708
+ } = this.attribute,
32709
+ {
32710
+ x1: x1,
32711
+ y1: y1,
32712
+ x2: x2,
32713
+ y2: y2
32714
+ } = positionBounds,
32715
+ width = x2 - x1,
32716
+ height = y2 - y1;
32717
+ switch (position) {
32718
+ case "top":
32719
+ case "tl":
32720
+ case "tr":
32721
+ return {
32722
+ x: x1 + width / 2 - x,
32723
+ y: y1 - y
32724
+ };
32725
+ case "bottom":
32726
+ case "bl":
32727
+ case "br":
32728
+ return {
32729
+ x: x1 + width / 2 - x,
32730
+ y: y2 - y
32731
+ };
32732
+ case "left":
32733
+ case "lt":
32734
+ case "lb":
32735
+ return {
32736
+ x: x1 - x,
32737
+ y: y1 + height / 2 - y
32738
+ };
32739
+ case "right":
32740
+ case "rt":
32741
+ case "rb":
32742
+ return {
32743
+ x: x2 - x,
32744
+ y: y1 + height / 2 - y
32745
+ };
32746
+ default:
32747
+ return {
32748
+ x: 0,
32749
+ y: 0
32750
+ };
32751
+ }
32752
+ }
32575
32753
  getAngleAndOffset(position, width, height, size, symbolType) {
32576
32754
  const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
32577
32755
  switch (position) {
@@ -32733,10 +32911,12 @@ let PopTipRenderContribution = class {
32733
32911
  this.poptipComponent.setAttributes(Object.assign(Object.assign({
32734
32912
  visibleAll: !0,
32735
32913
  pickable: !1,
32736
- childrenPickable: !1
32914
+ childrenPickable: !1,
32915
+ poptipAnchor: "bounds"
32737
32916
  }, poptip), {
32738
32917
  x: matrix.e,
32739
- y: matrix.f
32918
+ y: matrix.f,
32919
+ positionBounds: graphic.globalAABBBounds
32740
32920
  })), drawContext.stage.tryInitInteractiveLayer();
32741
32921
  const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
32742
32922
  interactiveLayer && interactiveLayer.add(this.poptipComponent);
@@ -33490,10 +33670,11 @@ function getPolygonPath(points, closed) {
33490
33670
  }
33491
33671
  function textIntersect(textA, textB, sep) {
33492
33672
  var _a;
33493
- let a, b;
33494
- const angle = null === (_a = textA.attribute) || void 0 === _a ? void 0 : _a.angle,
33495
- isAABBIntersects = (textA, textB, sep) => (a = textA.AABBBounds, b = textB.AABBBounds, sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2));
33496
- return isAngleHorizontal(angle, Number.EPSILON) ? isAABBIntersects(textA, textB, sep) : (a = textA.OBBBounds, b = textB.OBBBounds, !a || !b || a.empty() || b.empty() ? isAABBIntersects(textA, textB, sep) : a.intersects(b));
33673
+ const angle = null === (_a = textA.attribute) || void 0 === _a ? void 0 : _a.angle;
33674
+ if (isAngleHorizontal(angle, Number.EPSILON)) return sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds);
33675
+ const a = textA.OBBBounds,
33676
+ b = textB.OBBBounds;
33677
+ return !a || !b || a.empty() || b.empty() ? sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds) : a.intersects(b) || sep > obbSeparation(a, b);
33497
33678
  }
33498
33679
  function hasOverlap$1(items, pad) {
33499
33680
  for (let b, i = 1, n = items.length, a = items[0]; i < n; a = b, ++i) if (b = items[i], textIntersect(a, b, pad)) return !0;
@@ -35722,7 +35903,9 @@ class LinearScale extends ContinuousScale {
35722
35903
  super(...arguments), this.type = ScaleEnum.Linear;
35723
35904
  }
35724
35905
  clone() {
35725
- return new LinearScale().domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate);
35906
+ var _a;
35907
+ const scale = new LinearScale();
35908
+ return scale.domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate), this._niceType && (scale._niceType = this._niceType, scale._domainValidator = this._domainValidator, scale._niceDomain = null === (_a = this._niceDomain) || void 0 === _a ? void 0 : _a.slice()), scale;
35726
35909
  }
35727
35910
  tickFormat() {
35728
35911
  return () => {};
@@ -39013,14 +39196,20 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39013
39196
  }, this.state = {
39014
39197
  start: 0,
39015
39198
  end: 1
39016
- }, this._statePointToData = state => state, this._onHandlerPointerDown = (e, tag) => {
39017
- e.stopPropagation(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e), "browser" === vglobal.env && (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
39199
+ }, this._statePointToData = state => state, this._handleTouchMove = e => {
39200
+ this._activeState && e.preventDefault();
39201
+ }, this._onHandlerPointerDown = (e, tag) => {
39202
+ this._clearDragEvents(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e);
39203
+ const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
39204
+ triggers = getEndTriggersOfDrag();
39205
+ evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
39018
39206
  capture: !0
39019
- }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)), this.addEventListener("pointermove", this._onHandlerPointerMove, {
39207
+ }), this.addEventListener("pointermove", this._onHandlerPointerMove, {
39020
39208
  capture: !0
39209
+ }), triggers.forEach(trigger => {
39210
+ evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
39021
39211
  });
39022
39212
  }, this._pointerMove = e => {
39023
- e.stopPropagation();
39024
39213
  const {
39025
39214
  start: startAttr,
39026
39215
  end: endAttr,
@@ -39043,7 +39232,6 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39043
39232
  tag: this._activeTag
39044
39233
  }));
39045
39234
  }, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
39046
- e.preventDefault();
39047
39235
  const {
39048
39236
  start: start,
39049
39237
  end: end,
@@ -39058,11 +39246,7 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39058
39246
  start: this.state.start,
39059
39247
  end: this.state.end,
39060
39248
  tag: this._activeTag
39061
- }), "browser" === vglobal.env && (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
39062
- capture: !0
39063
- }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
39064
- capture: !0
39065
- }), this.removeEventListener("pointerup", this._onHandlerPointerUp);
39249
+ }), this._clearDragEvents();
39066
39250
  };
39067
39251
  const {
39068
39252
  position: position,
@@ -39081,7 +39265,9 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39081
39265
  } = this.attribute;
39082
39266
  this._startHandlerMask && this._startHandlerMask.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "start")), this._endHandlerMask && this._endHandlerMask.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "end")), this._middleHandlerSymbol && this._middleHandlerSymbol.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleSymbol")), this._middleHandlerRect && this._middleHandlerRect.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleRect"));
39083
39267
  const selectedTag = brushSelect ? "background" : "middleRect";
39084
- this._selectedBackground && this._selectedBackground.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && this._background && this._background.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), brushSelect && this._previewGroup && this._previewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), this._selectedPreviewGroup && this._selectedPreviewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), this.addEventListener("pointerup", this._onHandlerPointerUp), this.addEventListener("pointerupoutside", this._onHandlerPointerUp), "auto" === showDetail && (this.addEventListener("pointerenter", this._onHandlerPointerEnter), this.addEventListener("pointerleave", this._onHandlerPointerLeave));
39268
+ this._selectedBackground && this._selectedBackground.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && this._background && this._background.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), brushSelect && this._previewGroup && this._previewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), this._selectedPreviewGroup && this._selectedPreviewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), "auto" === showDetail && (this.addEventListener("pointerenter", this._onHandlerPointerEnter), this.addEventListener("pointerleave", this._onHandlerPointerLeave)), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
39269
+ passive: !1
39270
+ });
39085
39271
  }
39086
39272
  dragMaskSize() {
39087
39273
  const {
@@ -39112,11 +39298,22 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39112
39298
  y: 0
39113
39299
  };
39114
39300
  }
39301
+ _clearDragEvents() {
39302
+ const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
39303
+ triggers = getEndTriggersOfDrag();
39304
+ evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
39305
+ capture: !0
39306
+ }), triggers.forEach(trigger => {
39307
+ evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
39308
+ }), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
39309
+ capture: !0
39310
+ });
39311
+ }
39115
39312
  _onHandlerPointerEnter(e) {
39116
- e.stopPropagation(), this._showText = !0, this.renderText();
39313
+ this._showText = !0, this.renderText();
39117
39314
  }
39118
39315
  _onHandlerPointerLeave(e) {
39119
- e.stopPropagation(), this._showText = !1, this.renderText();
39316
+ this._showText = !1, this.renderText();
39120
39317
  }
39121
39318
  backgroundDragZoom(startPos, endPos) {
39122
39319
  const {
@@ -39655,6 +39852,11 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
39655
39852
  setStatePointToData(callback) {
39656
39853
  isFunction$1(callback) && (this._statePointToData = callback);
39657
39854
  }
39855
+ release(all) {
39856
+ super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
39857
+ passive: !1
39858
+ }), this._clearDragEvents();
39859
+ }
39658
39860
  };
39659
39861
  DataZoom$1.defaultAttributes = DEFAULT_DATA_ZOOM_ATTRIBUTES;
39660
39862
 
@@ -39824,17 +40026,26 @@ function commonLineClipIn(line, label, duration, delay, easing) {
39824
40026
  l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
39825
40027
  clipRange: 1
39826
40028
  }, stepDuration, easing);
39827
- }), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing), graphicFadeIn(label.getTextShape(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing), graphicFadeIn(label.getBgRect(), delay + startSymbolDuration + lineDuration + endSymbolDuration, labelDuration, easing);
40029
+ }), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing), array(label).forEach(labelNode => {
40030
+ const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
40031
+ graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
40032
+ });
39828
40033
  }
39829
40034
 
39830
40035
  function commonLineFadeIn(line, label, duration, delay, easing) {
39831
- segmentFadeIn(line, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
40036
+ segmentFadeIn(line, delay, duration, easing), array(label).forEach(labelNode => {
40037
+ tagFadeIn(labelNode, delay, duration, easing);
40038
+ });
39832
40039
  }
39833
40040
  function areaFadeIn(area, label, duration, delay, easing) {
39834
- graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
40041
+ graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
40042
+ tagFadeIn(labelNode, delay, duration, easing);
40043
+ });
39835
40044
  }
39836
40045
  function arcAreaFadeIn(area, label, duration, delay, easing) {
39837
- graphicFadeIn(area, delay, duration, easing), tagFadeIn(label, delay, duration, easing);
40046
+ graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
40047
+ tagFadeIn(labelNode, delay, duration, easing);
40048
+ });
39838
40049
  }
39839
40050
  function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
39840
40051
  var _a;
@@ -39842,13 +40053,19 @@ function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
39842
40053
  }
39843
40054
 
39844
40055
  function commonLineFadeOut(line, label, duration, delay, easing) {
39845
- segmentFadeOut(line, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
40056
+ segmentFadeOut(line, delay, duration, easing), array(label).forEach(labelNode => {
40057
+ tagFadeOut(labelNode, delay, duration, easing);
40058
+ });
39846
40059
  }
39847
40060
  function areaFadeOut(area, label, duration, delay, easing) {
39848
- graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
40061
+ graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
40062
+ tagFadeOut(labelNode, delay, duration, easing);
40063
+ });
39849
40064
  }
39850
40065
  function arcAreaFadeOut(area, label, duration, delay, easing) {
39851
- graphicFadeOut(area, delay, duration, easing), tagFadeOut(label, delay, duration, easing);
40066
+ graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
40067
+ tagFadeOut(labelNode, delay, duration, easing);
40068
+ });
39852
40069
  }
39853
40070
  function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
39854
40071
  var _a;
@@ -40020,6 +40237,57 @@ const DefaultExitMarkerAnimation = {
40020
40237
  delay: 0
40021
40238
  };
40022
40239
 
40240
+ class MarkLabelMixin {
40241
+ getLabel() {
40242
+ return this._label;
40243
+ }
40244
+ _addMarkLabels(container, labelName, defaultLabelAttrs) {
40245
+ const {
40246
+ label: label,
40247
+ state: state
40248
+ } = this.attribute,
40249
+ labelStates = array(null == state ? void 0 : state.label),
40250
+ labelBackgroundStates = array(null == state ? void 0 : state.labelBackground),
40251
+ labelShapes = array(label).map((labelAttrs, index) => {
40252
+ var _a, _b;
40253
+ const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labelAttrs),
40254
+ markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), {
40255
+ state: {
40256
+ panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
40257
+ text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
40258
+ }
40259
+ }));
40260
+ return markLabel.name = labelName, container.add(markLabel), this.setLabelPos(markLabel, finalLabelAttrs), markLabel;
40261
+ });
40262
+ this._label = 1 === array(labelShapes).length ? labelShapes[0] : labelShapes;
40263
+ }
40264
+ _updateMarkLabels(defaultLabelAttrs) {
40265
+ const {
40266
+ label: label,
40267
+ state: state
40268
+ } = this.attribute,
40269
+ labelShapes = array(this._label),
40270
+ labelStates = array(null == state ? void 0 : state.label),
40271
+ labelBackgroundStates = array(null == state ? void 0 : state.labelBackground);
40272
+ if (labelShapes.length) {
40273
+ const labels = array(label);
40274
+ labelShapes.forEach((labelItem, index) => {
40275
+ var _a, _b;
40276
+ const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labels[index]);
40277
+ labelItem.setAttributes(Object.assign(Object.assign({
40278
+ dx: 0,
40279
+ dy: 0
40280
+ }, finalLabelAttrs), {
40281
+ state: {
40282
+ panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
40283
+ text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
40284
+ }
40285
+ })), this.setLabelPos(labelItem, finalLabelAttrs);
40286
+ });
40287
+ }
40288
+ }
40289
+ }
40290
+
40023
40291
  class MarkCommonLine extends Marker {
40024
40292
  constructor() {
40025
40293
  super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = DefaultUpdateMarkLineAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
@@ -40027,24 +40295,20 @@ class MarkCommonLine extends Marker {
40027
40295
  getLine() {
40028
40296
  return this._line;
40029
40297
  }
40030
- getLabel() {
40031
- return this._label;
40032
- }
40033
- setLabelPos() {
40298
+ setLabelPos(labelNode, labelAttrs) {
40034
40299
  const {
40035
- label = {},
40036
40300
  limitRect: limitRect
40037
40301
  } = this.attribute,
40038
40302
  {
40039
40303
  position: position,
40040
40304
  confine: confine,
40041
40305
  autoRotate: autoRotate
40042
- } = label,
40043
- labelPoint = this.getPointAttrByPosition(position),
40306
+ } = labelAttrs,
40307
+ labelPoint = this.getPointAttrByPosition(position, labelAttrs),
40044
40308
  labelAngle = position.toString().toLocaleLowerCase().includes("start") ? this._line.getStartAngle() || 0 : this._line.getEndAngle() || 0;
40045
- if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
40046
- angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0,
40047
- textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), label.textStyle)
40309
+ if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
40310
+ angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0,
40311
+ textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle)
40048
40312
  })), limitRect && confine) {
40049
40313
  const {
40050
40314
  x: x,
@@ -40052,7 +40316,7 @@ class MarkCommonLine extends Marker {
40052
40316
  width: width,
40053
40317
  height: height
40054
40318
  } = limitRect;
40055
- limitShapeInBounds(this._label, {
40319
+ limitShapeInBounds(labelNode, {
40056
40320
  x1: x,
40057
40321
  y1: y,
40058
40322
  x2: x + width,
@@ -40061,36 +40325,14 @@ class MarkCommonLine extends Marker {
40061
40325
  }
40062
40326
  }
40063
40327
  initMarker(container) {
40064
- const {
40065
- label: label,
40066
- state: state
40067
- } = this.attribute,
40068
- line = this.createSegment();
40069
- line.name = "mark-common-line-line", this._line = line, container.add(line);
40070
- const markLabel = new Tag(Object.assign(Object.assign({}, label), {
40071
- state: {
40072
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
40073
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
40074
- }
40075
- }));
40076
- markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
40328
+ const line = this.createSegment();
40329
+ line.name = "mark-common-line-line", this._line = line, container.add(line), this.addMarkLineLabels(container);
40077
40330
  }
40078
40331
  updateMarker() {
40079
- const {
40080
- label: label,
40081
- state: state
40082
- } = this.attribute;
40083
- this.setLineAttributes(), this._label && (this._label.setAttributes(Object.assign(Object.assign({
40084
- dx: 0,
40085
- dy: 0
40086
- }, label), {
40087
- state: {
40088
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
40089
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
40090
- }
40091
- })), this.setLabelPos());
40332
+ this.setLineAttributes(), this.updateMarkLineLabels();
40092
40333
  }
40093
40334
  }
40335
+ mixin(MarkCommonLine, MarkLabelMixin);
40094
40336
 
40095
40337
  const FUZZY_EQUAL_DELTA = .001;
40096
40338
  const DEFAULT_MARK_LINE_THEME = {
@@ -40279,6 +40521,7 @@ const DEFAULT_MARK_ARC_LINE_THEME = {
40279
40521
  lineWidth: 0
40280
40522
  },
40281
40523
  label: {
40524
+ autoRotate: !0,
40282
40525
  position: IMarkCommonArcLabelPosition.arcOuterMiddle,
40283
40526
  refX: 0,
40284
40527
  refY: 0,
@@ -40333,6 +40576,7 @@ const DEFAULT_MARK_AREA_THEME = {
40333
40576
  const DEFAULT_MARK_ARC_AREA_THEME = {
40334
40577
  interactive: !0,
40335
40578
  label: {
40579
+ autoRotate: !0,
40336
40580
  position: IMarkCommonArcLabelPosition.arcOuterMiddle,
40337
40581
  textStyle: {
40338
40582
  fill: "#fff",
@@ -40588,15 +40832,12 @@ class MarkLine extends MarkCommonLine {
40588
40832
  constructor(attributes, options) {
40589
40833
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
40590
40834
  }
40591
- getPointAttrByPosition(position) {
40835
+ getPointAttrByPosition(position, labelAttrs) {
40592
40836
  var _a;
40593
40837
  const {
40594
- label = {}
40595
- } = this.attribute,
40596
- {
40597
40838
  refX = 0,
40598
40839
  refY = 0
40599
- } = label,
40840
+ } = labelAttrs,
40600
40841
  points = this._line.getMainSegmentPoints(),
40601
40842
  lineEndAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0,
40602
40843
  labelAngle = (lineEndAngle),
@@ -40622,9 +40863,9 @@ class MarkLine extends MarkCommonLine {
40622
40863
  angle: labelAngle
40623
40864
  };
40624
40865
  }
40625
- getRotateByAngle(angle) {
40866
+ getRotateByAngle(angle, labelAttrs) {
40626
40867
  var _a;
40627
- return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a = this.attribute.label.refAngle) && void 0 !== _a ? _a : 0);
40868
+ return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
40628
40869
  }
40629
40870
  getTextStyle(position, labelAngle, autoRotate) {
40630
40871
  return fuzzyEqualNumber(Math.abs(labelAngle), Math.PI / 2, FUZZY_EQUAL_DELTA) || fuzzyEqualNumber(Math.abs(labelAngle), 3 * Math.PI / 2, FUZZY_EQUAL_DELTA) ? getTextAlignAttrOfVerticalDir(autoRotate, labelAngle, position) : isPostiveXAxis(labelAngle) ? DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.postiveXAxis[position] : DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.negativeXAxis[position];
@@ -40690,6 +40931,12 @@ class MarkLine extends MarkCommonLine {
40690
40931
  });else if (!isValidNumber$1(point.x) || !isValidNumber$1(point.y)) return void (validFlag = !1);
40691
40932
  }), validFlag;
40692
40933
  }
40934
+ addMarkLineLabels(container) {
40935
+ this._addMarkLabels(container, "mark-common-line-label", MarkLine.defaultAttributes.label);
40936
+ }
40937
+ updateMarkLineLabels() {
40938
+ this._updateMarkLabels(MarkLine.defaultAttributes.label);
40939
+ }
40693
40940
  }
40694
40941
  MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
40695
40942
 
@@ -40704,9 +40951,6 @@ class MarkArea extends Marker {
40704
40951
  getArea() {
40705
40952
  return this._area;
40706
40953
  }
40707
- getLabel() {
40708
- return this._label;
40709
- }
40710
40954
  constructor(attributes, options) {
40711
40955
  super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
40712
40956
  }
@@ -40723,24 +40967,21 @@ class MarkArea extends Marker {
40723
40967
  };
40724
40968
  return (position.includes("left") || position.includes("Left")) && (result.x = x1), (position.includes("right") || position.includes("Right")) && (result.x = x2), (position.includes("top") || position.includes("Top")) && (result.y = y1), (position.includes("bottom") || position.includes("Bottom")) && (result.y = y2), result;
40725
40969
  }
40726
- setLabelPos() {
40970
+ setLabelPos(labelNode, labelAttrs) {
40727
40971
  var _a;
40728
- if (this._label && this._area) {
40729
- const {
40730
- label = {}
40731
- } = this.attribute,
40732
- labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle",
40972
+ if (this._area) {
40973
+ const labelPosition = null !== (_a = labelAttrs.position) && void 0 !== _a ? _a : "middle",
40733
40974
  labelPoint = this.getPointAttrByPosition(labelPosition);
40734
- if (this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), {
40735
- textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle)
40736
- })), this.attribute.limitRect && label.confine) {
40975
+ if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), {
40976
+ textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
40977
+ })), this.attribute.limitRect && labelAttrs.confine) {
40737
40978
  const {
40738
40979
  x: x,
40739
40980
  y: y,
40740
40981
  width: width,
40741
40982
  height: height
40742
40983
  } = this.attribute.limitRect;
40743
- limitShapeInBounds(this._label, {
40984
+ limitShapeInBounds(labelNode, {
40744
40985
  x1: x,
40745
40986
  y1: y,
40746
40987
  x2: x + width,
@@ -40752,40 +40993,23 @@ class MarkArea extends Marker {
40752
40993
  initMarker(container) {
40753
40994
  const {
40754
40995
  points: points,
40755
- label: label,
40756
40996
  areaStyle: areaStyle,
40757
40997
  state: state
40758
40998
  } = this.attribute,
40759
40999
  area = graphicCreator.polygon(Object.assign({
40760
41000
  points: points
40761
41001
  }, areaStyle));
40762
- area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
40763
- const markLabel = new Tag(Object.assign(Object.assign({}, label), {
40764
- state: {
40765
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
40766
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
40767
- }
40768
- }));
40769
- markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
41002
+ area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArea.defaultAttributes.label);
40770
41003
  }
40771
41004
  updateMarker() {
40772
41005
  const {
40773
41006
  points: points,
40774
- label: label,
40775
41007
  areaStyle: areaStyle,
40776
41008
  state: state
40777
41009
  } = this.attribute;
40778
41010
  this._area && (this._area.setAttributes(Object.assign({
40779
41011
  points: points
40780
- }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && this._label.setAttributes(Object.assign(Object.assign({
40781
- dx: 0,
40782
- dy: 0
40783
- }, label), {
40784
- state: {
40785
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
40786
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
40787
- }
40788
- })), this.setLabelPos();
41012
+ }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArea.defaultAttributes.label);
40789
41013
  }
40790
41014
  isValidPoints() {
40791
41015
  const {
@@ -40798,7 +41022,7 @@ class MarkArea extends Marker {
40798
41022
  }), validFlag;
40799
41023
  }
40800
41024
  }
40801
- MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
41025
+ MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME, mixin(MarkArea, MarkLabelMixin);
40802
41026
 
40803
41027
  loadMarkArcLineComponent();
40804
41028
  function registerMarkArcLineAnimate() {
@@ -40809,24 +41033,19 @@ class MarkArcLine extends MarkCommonLine {
40809
41033
  MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
40810
41034
  }
40811
41035
  constructor(attributes, options) {
40812
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes, {
40813
- label: {
40814
- autoRotate: !0
40815
- }
40816
- })), this.name = "markArcLine";
41036
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes)), this.name = "markArcLine";
40817
41037
  }
40818
- getPointAttrByPosition(direction) {
41038
+ getPointAttrByPosition(direction, labelAttrs) {
40819
41039
  const {
40820
41040
  center: center,
40821
41041
  radius: radius,
40822
41042
  startAngle: startAngle,
40823
- endAngle: endAngle,
40824
- label: label
41043
+ endAngle: endAngle
40825
41044
  } = this.attribute,
40826
41045
  {
40827
41046
  refX = 0,
40828
41047
  refY = 0
40829
- } = label;
41048
+ } = labelAttrs;
40830
41049
  let angle;
40831
41050
  switch (direction) {
40832
41051
  case IMarkCommonArcLabelPosition.arcInnerStart:
@@ -40856,9 +41075,9 @@ class MarkArcLine extends MarkCommonLine {
40856
41075
  getTextStyle(position) {
40857
41076
  return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
40858
41077
  }
40859
- getRotateByAngle(angle) {
41078
+ getRotateByAngle(angle, labelAttrs) {
40860
41079
  var _a;
40861
- return angle - Math.PI / 2 + (null !== (_a = this.attribute.label.refAngle) && void 0 !== _a ? _a : 0);
41080
+ return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
40862
41081
  }
40863
41082
  createSegment() {
40864
41083
  const {
@@ -40915,6 +41134,12 @@ class MarkArcLine extends MarkCommonLine {
40915
41134
  isValidPoints() {
40916
41135
  return !0;
40917
41136
  }
41137
+ addMarkLineLabels(container) {
41138
+ this._addMarkLabels(container, "mark-common-line-label", MarkArcLine.defaultAttributes.label);
41139
+ }
41140
+ updateMarkLineLabels() {
41141
+ this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
41142
+ }
40918
41143
  }
40919
41144
  MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
40920
41145
 
@@ -40929,29 +41154,21 @@ class MarkArcArea extends Marker {
40929
41154
  getArea() {
40930
41155
  return this._area;
40931
41156
  }
40932
- getLabel() {
40933
- return this._label;
40934
- }
40935
41157
  constructor(attributes, options) {
40936
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes, {
40937
- label: {
40938
- autoRotate: !0
40939
- }
40940
- })), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
41158
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes)), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
40941
41159
  }
40942
- getPointAttrByPosition(position) {
41160
+ getPointAttrByPosition(position, labelAttrs) {
40943
41161
  const {
40944
41162
  center: center,
40945
41163
  innerRadius: innerRadius,
40946
41164
  outerRadius: outerRadius,
40947
41165
  startAngle: startAngle,
40948
- endAngle: endAngle,
40949
- label: label
41166
+ endAngle: endAngle
40950
41167
  } = this.attribute,
40951
41168
  {
40952
41169
  refX = 0,
40953
41170
  refY = 0
40954
- } = label;
41171
+ } = labelAttrs;
40955
41172
  let radius, angle;
40956
41173
  switch (position) {
40957
41174
  case IMarkCommonArcLabelPosition.center:
@@ -40986,28 +41203,25 @@ class MarkArcArea extends Marker {
40986
41203
  angle: angle
40987
41204
  };
40988
41205
  }
40989
- setLabelPos() {
41206
+ setLabelPos(labelNode, labelAttrs) {
40990
41207
  var _a;
40991
- if (this._label && this._area) {
41208
+ if (this._area) {
40992
41209
  const {
40993
- label = {}
40994
- } = this.attribute,
40995
- {
40996
41210
  position: labelPosition = "arcInnerMiddle",
40997
41211
  autoRotate: autoRotate
40998
- } = label,
40999
- labelAttr = this.getPointAttrByPosition(labelPosition);
41000
- if (this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
41001
- angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0,
41002
- textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), label.textStyle)
41003
- })), this.attribute.limitRect && label.confine) {
41212
+ } = labelAttrs,
41213
+ labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
41214
+ if (labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
41215
+ angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0) : 0,
41216
+ textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
41217
+ })), this.attribute.limitRect && labelAttrs.confine) {
41004
41218
  const {
41005
41219
  x: x,
41006
41220
  y: y,
41007
41221
  width: width,
41008
41222
  height: height
41009
41223
  } = this.attribute.limitRect;
41010
- limitShapeInBounds(this._label, {
41224
+ limitShapeInBounds(labelNode, {
41011
41225
  x1: x,
41012
41226
  y1: y,
41013
41227
  x2: x + width,
@@ -41024,7 +41238,6 @@ class MarkArcArea extends Marker {
41024
41238
  startAngle: startAngle,
41025
41239
  endAngle: endAngle,
41026
41240
  areaStyle: areaStyle,
41027
- label: label,
41028
41241
  state: state
41029
41242
  } = this.attribute,
41030
41243
  area = graphicCreator.arc(Object.assign({
@@ -41035,14 +41248,7 @@ class MarkArcArea extends Marker {
41035
41248
  startAngle: startAngle,
41036
41249
  endAngle: endAngle
41037
41250
  }, areaStyle));
41038
- area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area);
41039
- const markLabel = new Tag(Object.assign(Object.assign({}, label), {
41040
- state: {
41041
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
41042
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
41043
- }
41044
- }));
41045
- markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
41251
+ area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArcArea.defaultAttributes.label);
41046
41252
  }
41047
41253
  updateMarker() {
41048
41254
  const {
@@ -41062,21 +41268,13 @@ class MarkArcArea extends Marker {
41062
41268
  outerRadius: outerRadius,
41063
41269
  startAngle: startAngle,
41064
41270
  endAngle: endAngle
41065
- }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._label && (this._label.setAttributes(Object.assign(Object.assign({
41066
- dx: 0,
41067
- dy: 0
41068
- }, label), {
41069
- state: {
41070
- panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
41071
- text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
41072
- }
41073
- })), this.setLabelPos());
41271
+ }, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
41074
41272
  }
41075
41273
  isValidPoints() {
41076
41274
  return !0;
41077
41275
  }
41078
41276
  }
41079
- MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
41277
+ MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
41080
41278
 
41081
41279
  loadMarkPointComponent();
41082
41280
  function registerMarkPointAnimate() {
@@ -42596,19 +42794,22 @@ class Slider extends AbstractComponent {
42596
42794
  } = this.attribute;
42597
42795
  tooltip && tooltip.alwaysShow || (this._tooltipState = null, this._tooltipShape && this._tooltipShape.setAttribute("visible", !1), this._tooltipText && this._tooltipText.setAttribute("visible", !1), this._dispatchTooltipEvent("sliderTooltipHide"));
42598
42796
  }, this._onHandlerPointerdown = e => {
42599
- e.stopPropagation(), this._isChanging = !0;
42797
+ this._clearAllDragEvents(), this._isChanging = !0;
42600
42798
  const {
42601
42799
  x: x,
42602
42800
  y: y
42603
42801
  } = this.stage.eventPointTransform(e);
42604
- this._currentHandler = e.target, this._prePos = this._isHorizontal ? x : y, "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onHandlerPointerMove, {
42802
+ this._currentHandler = e.target, this._prePos = this._isHorizontal ? x : y;
42803
+ const triggers = getEndTriggersOfDrag(),
42804
+ obj = "browser" === vglobal.env ? vglobal : this.stage;
42805
+ obj.addEventListener("pointermove", this._onHandlerPointerMove, {
42605
42806
  capture: !0
42606
- }), vglobal.addEventListener("pointerup", this._onHandlerPointerUp)) : (this.stage.addEventListener("pointermove", this._onHandlerPointerMove, {
42607
- capture: !0
42608
- }), this.stage.addEventListener("pointerup", this._onHandlerPointerUp), this.stage.addEventListener("pointerupoutside", this._onHandlerPointerUp));
42807
+ }), triggers.forEach(trigger => {
42808
+ obj.addEventListener(trigger, this._onHandlerPointerUp);
42809
+ });
42609
42810
  }, this._onHandlerPointerMove = e => {
42610
42811
  var _a, _b;
42611
- e.stopPropagation(), this._isChanging = !0;
42812
+ this._isChanging = !0;
42612
42813
  const {
42613
42814
  railWidth: railWidth,
42614
42815
  railHeight: railHeight,
@@ -42629,24 +42830,25 @@ class Slider extends AbstractComponent {
42629
42830
  currentValue = this.calculateValueByPos(newPos);
42630
42831
  "text" === this._currentHandler.type ? this._updateHandlerText(this._currentHandler, newPos, currentValue) : this._updateHandler(this._currentHandler, newPos, currentValue), this._updateTrack(), this._prePos = currentPos, this._dispatchChangeEvent();
42631
42832
  }, this._onHandlerPointerUp = e => {
42632
- e.preventDefault(), this._isChanging = !1, this._currentHandler = null, "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onHandlerPointerMove, {
42633
- capture: !0
42634
- }), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)) : (this.stage.removeEventListener("pointermove", this._onHandlerPointerMove, {
42635
- capture: !0
42636
- }), this.stage.removeEventListener("pointerup", this._onHandlerPointerUp), this.stage.removeEventListener("pointerupoutside", this._onHandlerPointerUp));
42833
+ this._isChanging = !1, this._currentHandler = null, this._clearAllDragEvents();
42834
+ }, this._handleTouchMove = e => {
42835
+ this._isChanging && e.preventDefault();
42637
42836
  }, this._onTrackPointerdown = e => {
42638
- e.stopPropagation(), this._isChanging = !0;
42837
+ this._clearAllDragEvents(), this._isChanging = !0;
42639
42838
  const {
42640
42839
  x: x,
42641
42840
  y: y
42642
42841
  } = this.stage.eventPointTransform(e);
42643
- this._prePos = this._isHorizontal ? x : y, "browser" === vglobal.env ? (vglobal.addEventListener("pointermove", this._onTrackPointerMove, {
42842
+ this._prePos = this._isHorizontal ? x : y;
42843
+ const triggers = getEndTriggersOfDrag(),
42844
+ obj = "browser" === vglobal.env ? vglobal : this.stage;
42845
+ obj.addEventListener("pointermove", this._onTrackPointerMove, {
42644
42846
  capture: !0
42645
- }), vglobal.addEventListener("pointerup", this._onTrackPointerUp)) : (this.stage.addEventListener("pointermove", this._onTrackPointerMove, {
42646
- capture: !0
42647
- }), this.stage.addEventListener("pointerup", this._onTrackPointerUp), this.stage.addEventListener("pointerupoutside", this._onTrackPointerUp));
42847
+ }), triggers.forEach(trigger => {
42848
+ obj.addEventListener(trigger, this._onTrackPointerUp);
42849
+ });
42648
42850
  }, this._onTrackPointerMove = e => {
42649
- e.stopPropagation(), this._isChanging = !0;
42851
+ this._isChanging = !0;
42650
42852
  const {
42651
42853
  railWidth: railWidth,
42652
42854
  railHeight: railHeight,
@@ -42687,13 +42889,9 @@ class Slider extends AbstractComponent {
42687
42889
  }
42688
42890
  this._prePos = currentPos, this._dispatchChangeEvent();
42689
42891
  }, this._onTrackPointerUp = e => {
42690
- e.preventDefault(), this._isChanging = !1, "browser" === vglobal.env ? (vglobal.removeEventListener("pointermove", this._onTrackPointerMove, {
42691
- capture: !0
42692
- }), vglobal.removeEventListener("pointerup", this._onTrackPointerUp)) : (this.stage.removeEventListener("pointermove", this._onTrackPointerMove, {
42693
- capture: !0
42694
- }), this.stage.removeEventListener("pointerup", this._onTrackPointerUp), this.stage.removeEventListener("pointerupoutside", this._onTrackPointerUp));
42892
+ this._isChanging = !1, this._clearAllDragEvents();
42695
42893
  }, this._onRailPointerDown = e => {
42696
- e.stopPropagation(), this._isChanging = !0;
42894
+ this._clearAllDragEvents(), this._isChanging = !0;
42697
42895
  const {
42698
42896
  railWidth: railWidth,
42699
42897
  railHeight: railHeight,
@@ -43014,11 +43212,26 @@ class Slider extends AbstractComponent {
43014
43212
  slidable: slidable,
43015
43213
  range: range
43016
43214
  } = this.attribute;
43017
- slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$2(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown));
43215
+ slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$2(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
43216
+ passive: !1
43217
+ }));
43018
43218
  }
43019
43219
  _bindTooltipEvents() {
43020
43220
  this.attribute.disableTriggerEvent || (this._mainContainer.addEventListener("pointerenter", this._onTooltipShow), this._mainContainer.addEventListener("pointermove", this._onTooltipUpdate), this._mainContainer.addEventListener("pointerleave", this._onTooltipHide));
43021
43221
  }
43222
+ _clearAllDragEvents() {
43223
+ const triggers = getEndTriggersOfDrag(),
43224
+ obj = "browser" === vglobal.env ? vglobal : this.stage;
43225
+ obj.removeEventListener("pointermove", this._onHandlerPointerMove, {
43226
+ capture: !0
43227
+ }), triggers.forEach(trigger => {
43228
+ obj.removeEventListener(trigger, this._onHandlerPointerUp);
43229
+ }), obj.removeEventListener("pointermove", this._onTrackPointerMove, {
43230
+ capture: !0
43231
+ }), triggers.forEach(trigger => {
43232
+ obj.removeEventListener(trigger, this._onTrackPointerUp);
43233
+ });
43234
+ }
43022
43235
  _updateTrack() {
43023
43236
  const {
43024
43237
  inverse: inverse,
@@ -43117,6 +43330,11 @@ class Slider extends AbstractComponent {
43117
43330
  endHandler: endHandler
43118
43331
  };
43119
43332
  }
43333
+ release(all) {
43334
+ super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
43335
+ passive: !1
43336
+ }), this._clearAllDragEvents();
43337
+ }
43120
43338
  }
43121
43339
  Slider.defaultAttributes = {
43122
43340
  slidable: !0,
@@ -44392,13 +44610,13 @@ class ContinuousPlayer extends BasePlayer {
44392
44610
 
44393
44611
  var IOperateType;
44394
44612
  !function (IOperateType) {
44395
- IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushClear = "brushClear";
44613
+ IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushActive = "brushActive", IOperateType.brushClear = "brushClear";
44396
44614
  }(IOperateType || (IOperateType = {}));
44397
44615
 
44398
44616
  const DEFAULT_BRUSH_ATTRIBUTES = {
44399
44617
  trigger: "pointerdown",
44400
44618
  updateTrigger: "pointermove",
44401
- endTrigger: "pointerup",
44619
+ endTrigger: ["pointerup", "pointerleave"],
44402
44620
  resetTrigger: "pointerupoutside",
44403
44621
  hasMask: !0,
44404
44622
  brushMode: "single",
@@ -44414,10 +44632,10 @@ const DEFAULT_BRUSH_ATTRIBUTES = {
44414
44632
  delayType: "throttle",
44415
44633
  delayTime: 10,
44416
44634
  interactiveRange: {
44417
- y1: -1 / 0,
44418
- y2: 1 / 0,
44419
- x1: -1 / 0,
44420
- x2: 1 / 0
44635
+ minY: -1 / 0,
44636
+ maxY: 1 / 0,
44637
+ minX: -1 / 0,
44638
+ maxX: 1 / 0
44421
44639
  }
44422
44640
  };
44423
44641
  const DEFAULT_SIZE_THRESHOLD = 5;
@@ -44433,83 +44651,36 @@ const delayMap$1 = {
44433
44651
  loadBrushComponent();
44434
44652
  let Brush$1 = class Brush extends AbstractComponent {
44435
44653
  constructor(attributes, options) {
44436
- super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._onBrushStart = e => {
44437
- var _a;
44438
- if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
44439
- e.stopPropagation();
44440
- const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
44441
- this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
44442
- }, this._onBrushing = e => {
44443
- this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
44444
- }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
44445
- var _a;
44446
- if (!this._activeDrawState && !this._activeMoveState) return;
44447
- e.preventDefault();
44654
+ super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
44655
+ if (this._outOfInteractiveRange(e)) return void (this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)));
44448
44656
  const {
44449
- removeOnClick = !0
44657
+ updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
44658
+ endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
44659
+ brushMoved = !0
44450
44660
  } = this.attribute;
44451
- this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick ? ((null === (_a = this._operatingMask) || void 0 === _a ? void 0 : _a._AABBBounds.empty()) && this._dispatchEvent(IOperateType.brushClear, {
44452
- operateMask: this._operatingMask,
44453
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44454
- event: e
44455
- }), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}) : (this._activeDrawState && this._dispatchEvent(IOperateType.drawEnd, {
44456
- operateMask: this._operatingMask,
44457
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44458
- event: e
44459
- }), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
44460
- operateMask: this._operatingMask,
44461
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44462
- event: e
44463
- })), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
44661
+ array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), e.stopPropagation(), this._firstUpdate = !0, this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._startPos = this.eventPosToStagePos(e), this._cacheDrawPoints = [this._startPos];
44662
+ }, this._onBrushing = e => {
44663
+ this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e)));
44664
+ }, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
44665
+ this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
44464
44666
  }, this._onBrushClear = e => {
44465
- e.preventDefault();
44466
- const {
44467
- removeOnClick = !0
44468
- } = this.attribute;
44469
- this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
44470
- operateMask: this._operatingMask,
44471
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44472
- event: e
44473
- }), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
44667
+ e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
44474
44668
  };
44475
44669
  }
44476
44670
  _bindBrushEvents() {
44477
- if (this.attribute.disableTriggerEvent) return;
44671
+ if (this.releaseBrushEvents(), this.attribute.disableTriggerEvent) return;
44478
44672
  const {
44479
44673
  trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
44480
- updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
44481
- endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
44482
44674
  resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
44483
44675
  } = this.attribute;
44484
- array(trigger).forEach(t => vglobal.addEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
44485
- }
44486
- _isPosInBrushMask(e) {
44487
- const pos = this.eventPosToStagePos(e),
44488
- brushMasks = this._container.getChildren();
44489
- for (let i = 0; i < brushMasks.length; i++) {
44490
- const {
44491
- points = [],
44492
- dx = 0,
44493
- dy = 0
44494
- } = brushMasks[i].attribute,
44495
- pointsConsiderOffset = points.map(point => ({
44496
- x: point.x + dx,
44497
- y: point.y + dy
44498
- }));
44499
- if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
44500
- }
44501
- return !1;
44676
+ array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
44502
44677
  }
44503
44678
  _initDraw(e) {
44504
44679
  const {
44505
44680
  brushMode: brushMode
44506
44681
  } = this.attribute,
44507
44682
  pos = this.eventPosToStagePos(e);
44508
- this._cacheDrawPoints = [pos], this._isDrawedBeforeEnd = !1, "single" === brushMode && (this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild()), this._addBrushMask(), this._dispatchEvent(IOperateType.drawStart, {
44509
- operateMask: this._operatingMask,
44510
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44511
- event: e
44512
- });
44683
+ this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e), 1 === Object.keys(this._brushMaskAABBBoundsDict).length && this._dispatchBrushEvent(IOperateType.brushActive, e);
44513
44684
  }
44514
44685
  _initMove(e) {
44515
44686
  var _a, _b;
@@ -44533,17 +44704,12 @@ let Brush$1 = class Brush extends AbstractComponent {
44533
44704
  maxMoveStepX = maxX - x2,
44534
44705
  minMoveStepY = minY - y1,
44535
44706
  maxMoveStepY = maxY - y2;
44536
- this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchEvent(IOperateType.moveStart, {
44537
- operateMask: this._operatingMask,
44538
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44539
- event: e
44540
- });
44707
+ this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
44541
44708
  }
44542
44709
  _drawing(e) {
44543
- var _a, _b;
44710
+ var _a;
44544
44711
  const pos = this.eventPosToStagePos(e),
44545
44712
  {
44546
- sizeThreshold = DEFAULT_SIZE_THRESHOLD,
44547
44713
  brushType: brushType
44548
44714
  } = this.attribute,
44549
44715
  cacheLength = this._cacheDrawPoints.length;
@@ -44553,18 +44719,7 @@ let Brush$1 = class Brush extends AbstractComponent {
44553
44719
  }
44554
44720
  "polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
44555
44721
  const maskPoints = this._computeMaskPoints();
44556
- this._operatingMask.setAttribute("points", maskPoints);
44557
- const {
44558
- x1 = 0,
44559
- x2 = 0,
44560
- y1 = 0,
44561
- y2 = 0
44562
- } = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
44563
- this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchEvent(IOperateType.drawing, {
44564
- operateMask: this._operatingMask,
44565
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44566
- event: e
44567
- }));
44722
+ this._operatingMask.setAttribute("points", maskPoints), this._dispatchBrushEvent(IOperateType.drawing, e);
44568
44723
  }
44569
44724
  _moving(e) {
44570
44725
  const startPos = this._cacheMovePoint,
@@ -44577,11 +44732,46 @@ let Brush$1 = class Brush extends AbstractComponent {
44577
44732
  this._operatingMask.setAttributes({
44578
44733
  dx: moveX,
44579
44734
  dy: moveY
44580
- }), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchEvent(IOperateType.moving, {
44581
- operateMask: this._operatingMask,
44582
- operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44583
- event: e
44584
- });
44735
+ }), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
44736
+ }
44737
+ _drawEnd(e) {
44738
+ const {
44739
+ removeOnClick = !0,
44740
+ sizeThreshold = DEFAULT_SIZE_THRESHOLD
44741
+ } = this.attribute;
44742
+ if (this._outOfInteractiveRange(e)) this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e));else {
44743
+ const {
44744
+ x: x1,
44745
+ y: y1
44746
+ } = this._startPos,
44747
+ {
44748
+ x: x2,
44749
+ y: y2
44750
+ } = this.eventPosToStagePos(e);
44751
+ Math.abs(x2 - x1) <= 1 && Math.abs(y2 - y1) <= 1 && removeOnClick ? this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)) : Math.abs(x2 - x1) < sizeThreshold && Math.abs(y1 - y2) < sizeThreshold ? (delete this._brushMaskAABBBoundsDict[this._operatingMask.name], this._container.setAttributes({}), this._container.removeChild(this._operatingMask), this._isEmptyMask() && this._dispatchBrushEvent(IOperateType.brushClear, e)) : (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.drawEnd, e));
44752
+ }
44753
+ }
44754
+ _moveEnd(e) {
44755
+ this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
44756
+ }
44757
+ render() {
44758
+ this._bindBrushEvents();
44759
+ const group = this.createOrUpdateChild("brush-container", {}, "group");
44760
+ this._container = group;
44761
+ }
44762
+ releaseBrushEvents() {
44763
+ const {
44764
+ trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
44765
+ resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
44766
+ } = this.attribute;
44767
+ array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear)), this._releaseBrushUpdateEvents();
44768
+ }
44769
+ _releaseBrushUpdateEvents() {
44770
+ const {
44771
+ updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
44772
+ endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger
44773
+ } = this.attribute;
44774
+ array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd));
44585
44775
  }
44586
44776
  _computeMaskPoints() {
44587
44777
  const {
@@ -44639,6 +44829,23 @@ let Brush$1 = class Brush extends AbstractComponent {
44639
44829
  }));
44640
44830
  brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
44641
44831
  }
44832
+ _isPosInBrushMask(e) {
44833
+ const pos = this.eventPosToStagePos(e),
44834
+ brushMasks = this._container.getChildren();
44835
+ for (let i = 0; i < brushMasks.length; i++) {
44836
+ const {
44837
+ points = [],
44838
+ dx = 0,
44839
+ dy = 0
44840
+ } = brushMasks[i].attribute,
44841
+ pointsConsiderOffset = points.map(point => ({
44842
+ x: point.x + dx,
44843
+ y: point.y + dy
44844
+ }));
44845
+ if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
44846
+ }
44847
+ return !1;
44848
+ }
44642
44849
  _outOfInteractiveRange(e) {
44643
44850
  const {
44644
44851
  interactiveRange: interactiveRange
@@ -44655,21 +44862,18 @@ let Brush$1 = class Brush extends AbstractComponent {
44655
44862
  eventPosToStagePos(e) {
44656
44863
  return this.stage.eventPointTransform(e);
44657
44864
  }
44658
- render() {
44659
- this._bindBrushEvents();
44660
- const group = this.createOrUpdateChild("brush-container", {}, "group");
44661
- this._container = group;
44865
+ _dispatchBrushEvent(operateType, e) {
44866
+ this._dispatchEvent(operateType, {
44867
+ operateMask: this._operatingMask,
44868
+ operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
44869
+ event: e
44870
+ });
44662
44871
  }
44663
- releaseBrushEvents() {
44664
- const {
44665
- delayType = "throttle",
44666
- delayTime = 0,
44667
- trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
44668
- updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
44669
- endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
44670
- resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
44671
- } = this.attribute;
44672
- array(trigger).forEach(t => vglobal.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
44872
+ _clearMask() {
44873
+ this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild(), this._operatingMask = null;
44874
+ }
44875
+ _isEmptyMask() {
44876
+ return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
44673
44877
  }
44674
44878
  };
44675
44879
  Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
@@ -56904,6 +57108,7 @@ var ChartEvent;
56904
57108
  ChartEvent["brushChange"] = "brushChange";
56905
57109
  ChartEvent["brushEnd"] = "brushEnd";
56906
57110
  ChartEvent["brushClear"] = "brushClear";
57111
+ ChartEvent["brushActive"] = "brushActive";
56907
57112
  ChartEvent["legendSelectedDataChange"] = "legendSelectedDataChange";
56908
57113
  ChartEvent["legendFilter"] = "legendFilter";
56909
57114
  ChartEvent["legendItemClick"] = "legendItemClick";
@@ -59555,6 +59760,9 @@ class BaseModel extends CompilableBase {
59555
59760
  }
59556
59761
  beforeRelease() {
59557
59762
  }
59763
+ clear() {
59764
+ this.getMarks().forEach(m => { var _a; return (_a = m.clear) === null || _a === void 0 ? void 0 : _a.call(m); });
59765
+ }
59558
59766
  release() {
59559
59767
  var _a;
59560
59768
  this._releaseEvent();
@@ -61707,6 +61915,9 @@ class CompilableMark extends GrammarItem {
61707
61915
  }
61708
61916
  return undefined;
61709
61917
  }
61918
+ clear() {
61919
+ this._event.off(HOOK_EVENT.AFTER_DO_RENDER);
61920
+ }
61710
61921
  release() {
61711
61922
  super.release();
61712
61923
  this.state.release();
@@ -63656,7 +63867,7 @@ const registerVChartCore = () => {
63656
63867
  };
63657
63868
  registerVChartCore();
63658
63869
 
63659
- const version = "1.13.9-alpha.6";
63870
+ const version = "1.13.9";
63660
63871
 
63661
63872
  const addVChartProperty = (data, op) => {
63662
63873
  const context = op.beforeCall();
@@ -67803,6 +68014,9 @@ class AxisComponent extends BaseComponent {
67803
68014
  if (spec.label.state) {
67804
68015
  axisAttrs.label.state = transformAxisLabelStateStyle(spec.label.state);
67805
68016
  }
68017
+ if (isFunction$1(spec.label.dataFilter)) {
68018
+ axisAttrs.label.dataFilter = (data, layer) => spec.label.dataFilter(data, layer, { vchart: this._option.globalInstance });
68019
+ }
67806
68020
  }
67807
68021
  else {
67808
68022
  axisAttrs.label = {
@@ -67815,7 +68029,9 @@ class AxisComponent extends BaseComponent {
67815
68029
  length: spec.tick.tickSize,
67816
68030
  inside: spec.tick.inside,
67817
68031
  alignWithLabel: spec.tick.alignWithLabel,
67818
- dataFilter: spec.tick.dataFilter
68032
+ dataFilter: isFunction$1(spec.tick.dataFilter)
68033
+ ? (data) => spec.tick.dataFilter(data, { vchart: this._option.globalInstance })
68034
+ : undefined
67819
68035
  };
67820
68036
  if (spec.tick.style) {
67821
68037
  axisAttrs.tick.style = isFunction$1(spec.tick.style)
@@ -72744,9 +72960,7 @@ class BarSeries extends CartesianSeries {
72744
72960
  else if (domainMin > 0) {
72745
72961
  return scale.scale(domainMin);
72746
72962
  }
72747
- else {
72748
- return scale.scale(0);
72749
- }
72963
+ return scale.scale(0);
72750
72964
  }
72751
72965
  }
72752
72966
  };
@@ -76954,7 +77168,7 @@ const pie = (originData, op) => {
76954
77168
  return data;
76955
77169
  }
76956
77170
  if (!showAllZero && showEmptyCircle && isDataEmpty(data, angleField, supportNegative)) {
76957
- return data;
77171
+ return [];
76958
77172
  }
76959
77173
  const appendArcInfo = (data, startAngle, angle) => {
76960
77174
  data[asStartAngle] = startAngle;
@@ -77443,6 +77657,7 @@ class BasePieSeries extends PolarSeries {
77443
77657
  }, {
77444
77658
  dataView: false
77445
77659
  });
77660
+ this._emptyArcMark.setDepend(this._pieMark);
77446
77661
  }
77447
77662
  }
77448
77663
  startAngleScale(datum) {
@@ -77478,8 +77693,8 @@ class BasePieSeries extends PolarSeries {
77478
77693
  const emptyPieMark = this._emptyArcMark;
77479
77694
  if (emptyPieMark) {
77480
77695
  this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => {
77481
- const angleField = this.getAngleField()[0];
77482
- return isDataEmpty(this.getViewData().latestData, angleField, this._supportNegative);
77696
+ const data = this.getViewData().latestData;
77697
+ return !data || !data.length;
77483
77698
  } }), 'normal', AttributeLevel.Series);
77484
77699
  }
77485
77700
  }
@@ -79688,7 +79903,8 @@ class ProgressLikeSeries extends PolarSeries {
79688
79903
  return value;
79689
79904
  }
79690
79905
  }
79691
- return this.angleAxisHelper.dataToPosition([datum[this._angleField[0]]]);
79906
+ const angle = this.angleAxisHelper.dataToPosition([datum[this._angleField[0]]]);
79907
+ return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
79692
79908
  }
79693
79909
  getDimensionField() {
79694
79910
  return this._specRadiusField;
@@ -79721,12 +79937,12 @@ class ProgressLikeSeries extends PolarSeries {
79721
79937
  clip: true,
79722
79938
  clipPath: () => {
79723
79939
  const axis = this._getAngleAxis();
79940
+ const { x, y } = this.angleAxisHelper.center();
79941
+ const radius = this._computeLayoutRadius();
79724
79942
  if (this._isTickMaskVisible(axis)) {
79725
79943
  const { tickMask } = this._spec;
79726
79944
  const { angle, offsetAngle, style = {} } = tickMask;
79727
79945
  const subTickData = this._getAngleAxisSubTickData(axis);
79728
- const { x, y } = this.angleAxisHelper.center();
79729
- const radius = this._computeLayoutRadius();
79730
79946
  const markStyle = style;
79731
79947
  return subTickData.map(({ value }) => {
79732
79948
  const pos = this.angleAxisHelper.dataToPosition([value]) + degreeToRadian(offsetAngle);
@@ -80147,7 +80363,11 @@ class LinearProgressSeries extends CartesianSeries {
80147
80363
  leftPadding);
80148
80364
  },
80149
80365
  y1: (datum) => { var _a, _b; return valueInScaleRange(this.dataToPositionY(datum), (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0)); },
80150
- y: () => { var _a; return (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition }); },
80366
+ y: () => {
80367
+ var _a, _b, _c;
80368
+ const value = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
80369
+ return this._spec.clamp ? valueInScaleRange(value, (_c = (_b = this._yAxisHelper) === null || _b === void 0 ? void 0 : _b.getScale) === null || _c === void 0 ? void 0 : _c.call(_b, 0)) : value;
80370
+ },
80151
80371
  width: this._spec.bandWidth - leftPadding - rightPadding,
80152
80372
  cornerRadius: this._spec.cornerRadius,
80153
80373
  fill: this.getColorAttribute()
@@ -80166,7 +80386,11 @@ class LinearProgressSeries extends CartesianSeries {
80166
80386
  topPadding);
80167
80387
  },
80168
80388
  height: this._spec.bandWidth - topPadding - bottomPadding,
80169
- x: () => { var _a; return (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition }); },
80389
+ x: () => {
80390
+ var _a, _b, _c;
80391
+ const value = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
80392
+ return this._spec.clamp ? valueInScaleRange(value, (_c = (_b = this._xAxisHelper) === null || _b === void 0 ? void 0 : _b.getScale) === null || _c === void 0 ? void 0 : _c.call(_b, 0)) : value;
80393
+ },
80170
80394
  cornerRadius: this._spec.cornerRadius,
80171
80395
  fill: this.getColorAttribute()
80172
80396
  }, 'normal', AttributeLevel.Series);
@@ -87602,12 +87826,14 @@ class GaugeSeries extends ProgressLikeSeries {
87602
87826
  _getAngleValueStartWithoutMask(datum) {
87603
87827
  const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
87604
87828
  const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
87605
- return clamper(startAngle, (startAngle + endAngle) / 2)(startAngle + (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
87829
+ const angle = clamper(startAngle, (startAngle + endAngle) / 2)(startAngle + (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
87830
+ return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
87606
87831
  }
87607
87832
  _getAngleValueEndWithoutMask(datum) {
87608
87833
  const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
87609
87834
  const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
87610
- return clamper(endAngle, (startAngle + endAngle) / 2)(endAngle - (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
87835
+ const angle = clamper(endAngle, (startAngle + endAngle) / 2)(endAngle - (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
87836
+ return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
87611
87837
  }
87612
87838
  _getAngleValueStartWithoutPadAngle(datum) {
87613
87839
  return isValid$1(datum[SEGMENT_FIELD_START])
@@ -89918,21 +90144,21 @@ function isValidStrokeOrFill(attr) {
89918
90144
  return isValid$1(attr) && attr !== 'none' && !((_a = attr.includes) === null || _a === void 0 ? void 0 : _a.call(attr, 'url'));
89919
90145
  }
89920
90146
  const getLineWidth = (attributes) => {
89921
- const strokeWidth = parseFloat(attributes['strokeWidth']);
90147
+ const strokeWidth = parseFloat(attributes.strokeWidth);
89922
90148
  if (!isNaN(strokeWidth)) {
89923
90149
  return strokeWidth;
89924
90150
  }
89925
- const stroke = attributes['stroke'];
90151
+ const stroke = attributes.stroke;
89926
90152
  return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
89927
90153
  };
89928
90154
  const getFill = (attributes, defaultFill) => {
89929
90155
  var _a;
89930
- const fill = (_a = attributes['fill']) !== null && _a !== void 0 ? _a : defaultFill;
90156
+ const fill = (_a = attributes.fill) !== null && _a !== void 0 ? _a : defaultFill;
89931
90157
  return fill && isValidStrokeOrFill(fill) ? fill : undefined;
89932
90158
  };
89933
90159
  const getStroke = (attributes, defaultStroke) => {
89934
90160
  var _a;
89935
- const stroke = (_a = attributes['stroke']) !== null && _a !== void 0 ? _a : defaultStroke;
90161
+ const stroke = (_a = attributes.stroke) !== null && _a !== void 0 ? _a : defaultStroke;
89936
90162
  return stroke && isValidStrokeOrFill(stroke) ? stroke : false;
89937
90163
  };
89938
90164
  const commonAttributes = (attributes) => {
@@ -89941,7 +90167,7 @@ const commonAttributes = (attributes) => {
89941
90167
  const graphicAttributeTransform = {
89942
90168
  group: (attributes) => {
89943
90169
  const common = commonAttributes(attributes);
89944
- return Object.assign(Object.assign({}, common), { visibleAll: common['visible'] !== false });
90170
+ return Object.assign(Object.assign({}, common), { visibleAll: common.visible !== false });
89945
90171
  },
89946
90172
  rule: (attributes) => {
89947
90173
  return Object.assign(Object.assign({}, commonAttributes(attributes)), { x: parseFloat(attributes.x1), y: parseFloat(attributes.y1), x1: parseFloat(attributes.x2), y1: parseFloat(attributes.y2) });
@@ -89992,7 +90218,7 @@ const pictogram = (data) => {
89992
90218
  el._uniqueId = `${el.id}-${index}`;
89993
90219
  el.data = undefined;
89994
90220
  const { graphicType: type, transform } = el;
89995
- let finalAttributes = {
90221
+ const finalAttributes = {
89996
90222
  visible: el.attributes.visibility !== 'hidden' && el.attributes.visibility !== 'collapse'
89997
90223
  };
89998
90224
  if (el.graphicType === 'text') {
@@ -90027,7 +90253,7 @@ const pictogram = (data) => {
90027
90253
  return result;
90028
90254
  });
90029
90255
  if (children && children.length) {
90030
- let startX = (_b = (_a = texts[i]._textGroupStyle) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
90256
+ const startX = (_b = (_a = texts[i]._textGroupStyle) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
90031
90257
  let curX = startX;
90032
90258
  for (let j = 0; j < children.length; j++) {
90033
90259
  const currentChild = children[j];
@@ -91554,7 +91780,7 @@ class LinearProgressChartSpecTransformer extends CartesianChartSpecTransformer {
91554
91780
  }
91555
91781
  _getDefaultSeriesSpec(spec) {
91556
91782
  var _a, _b;
91557
- const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track']);
91783
+ const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track', 'clamp']);
91558
91784
  series.direction = (_a = spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
91559
91785
  series.cornerRadius = (_b = spec.cornerRadius) !== null && _b !== void 0 ? _b : 0;
91560
91786
  return series;
@@ -94416,7 +94642,7 @@ class BaseCrossHair extends BaseComponent {
94416
94642
  Object.keys(this._stateByField).forEach(field => {
94417
94643
  const fieldSpec = this._spec[field];
94418
94644
  if (fieldSpec && fieldSpec.visible && fieldSpec.defaultSelect) {
94419
- const { axisIndex, datum } = fieldSpec.defaultSelect;
94645
+ const { axisIndex = 0, datum } = fieldSpec.defaultSelect;
94420
94646
  const axis = this._option.getComponentsByKey('axes').find(c => c.getSpecIndex() === axisIndex);
94421
94647
  if (axis) {
94422
94648
  this._stateByField[field].currentValue.clear();
@@ -94972,36 +95198,37 @@ const layoutCrosshair$1 = (stateItem) => {
94972
95198
  };
94973
95199
  }
94974
95200
  else if (type === 'rect') {
94975
- const extend = getRectSize(attributes, bandSize, cacheInfo.axis);
95201
+ const [offset0, offset1] = getRectSize(attributes, bandSize, offsetSize, cacheInfo.axis);
94976
95202
  const { coordRange } = cacheInfo;
94977
95203
  positionAttribute = {
94978
95204
  visible: true,
94979
95205
  start: {
94980
- [coordKey]: Math.max(coord - extend / 2 - offsetSize / 2, coordRange[0]),
95206
+ [coordKey]: Math.max(coord + offset0, coordRange[0]),
94981
95207
  [anotherAxisKey]: sizeRange[0]
94982
95208
  },
94983
95209
  end: {
94984
- [coordKey]: Math.min(coord + bandSize + extend / 2 + offsetSize / 2, coordRange[1]),
95210
+ [coordKey]: Math.min(coord + offset1, coordRange[1]),
94985
95211
  [anotherAxisKey]: sizeRange[1]
94986
95212
  }
94987
95213
  };
94988
95214
  }
94989
95215
  return positionAttribute;
94990
95216
  };
94991
- const getRectSize = (hair, bandSize, axis) => {
95217
+ const getRectSize = (hair, bandSize, offsetSize, axis) => {
94992
95218
  var _a, _b, _c;
94993
- let extend = 0;
95219
+ const visualSize = bandSize === 0 ? offsetSize : bandSize;
95220
+ let size = visualSize;
94994
95221
  if ((_a = hair.style) === null || _a === void 0 ? void 0 : _a.sizePercent) {
94995
- extend = (hair.style.sizePercent - 1) * bandSize;
95222
+ size = visualSize * hair.style.sizePercent;
94996
95223
  }
94997
95224
  else if (typeof ((_b = hair.style) === null || _b === void 0 ? void 0 : _b.size) === 'number') {
94998
- extend = hair.style.size - bandSize;
95225
+ size = hair.style.size;
94999
95226
  }
95000
95227
  else if (typeof ((_c = hair.style) === null || _c === void 0 ? void 0 : _c.size) === 'function') {
95001
95228
  const axisRect = axis.getLayoutRect();
95002
- extend = hair.style.size(axisRect, axis) - bandSize;
95229
+ size = hair.style.size(axisRect, axis);
95003
95230
  }
95004
- return extend;
95231
+ return bandSize === 0 ? [-size / 2, size / 2] : [bandSize / 2 - size / 2, size / 2 + bandSize / 2];
95005
95232
  };
95006
95233
 
95007
95234
  class CartesianCrossHair extends BaseCrossHair {
@@ -97491,17 +97718,22 @@ function computeOffsetFromRegion(point, offset, region) {
97491
97718
  }
97492
97719
  return offset;
97493
97720
  }
97721
+ function getProcessInfo(spec) {
97722
+ return {
97723
+ isXProcess: isValid$1(spec.x),
97724
+ isYProcess: isValid$1(spec.y),
97725
+ isX1Process: isValid$1(spec.x1),
97726
+ isY1Process: isValid$1(spec.y1),
97727
+ isAngleProcess: isValid$1(spec.angle),
97728
+ isRadiusProcess: isValid$1(spec.radius),
97729
+ isAngle1Process: isValid$1(spec.angle1),
97730
+ isRadius1Process: isValid$1(spec.radius1),
97731
+ isCoordinatesProcess: isValid$1(spec.coordinates),
97732
+ isValidProcess: isValid$1(spec.process)
97733
+ };
97734
+ }
97494
97735
  function getMarkLineProcessInfo(spec) {
97495
- const isXProcess = 'x' in spec;
97496
- const isYProcess = 'y' in spec;
97497
- const isX1Process = 'x1' in spec;
97498
- const isY1Process = 'y1' in spec;
97499
- const isAngleProcess = 'angle' in spec;
97500
- const isRadiusProcess = 'radius' in spec;
97501
- const isAngle1Process = 'angle1' in spec;
97502
- const isRadius1Process = 'radius1' in spec;
97503
- const isCoordinatesProcess = 'coordinates' in spec;
97504
- const isValidProcess = 'process' in spec;
97736
+ const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess, isValidProcess } = getProcessInfo(spec);
97505
97737
  return {
97506
97738
  doXProcess: isXProcess && !isYProcess && !isY1Process,
97507
97739
  doXYY1Process: isXProcess && isYProcess && isY1Process,
@@ -97517,15 +97749,7 @@ function getMarkLineProcessInfo(spec) {
97517
97749
  };
97518
97750
  }
97519
97751
  function getMarkAreaProcessInfo(spec) {
97520
- const isXProcess = 'x' in spec;
97521
- const isX1Process = 'x1' in spec;
97522
- const isYProcess = 'y' in spec;
97523
- const isY1Process = 'y1' in spec;
97524
- const isAngleProcess = 'angle' in spec;
97525
- const isRadiusProcess = 'radius' in spec;
97526
- const isAngle1Process = 'angle1' in spec;
97527
- const isRadius1Process = 'radius1' in spec;
97528
- const isCoordinatesProcess = 'coordinates' in spec;
97752
+ const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess } = getProcessInfo(spec);
97529
97753
  return {
97530
97754
  doXProcess: isXProcess && isX1Process && !isYProcess && !isY1Process,
97531
97755
  doYProcess: isYProcess && isY1Process && !isXProcess && !isX1Process,
@@ -98043,13 +98267,14 @@ class BaseMarkLine extends BaseMarker {
98043
98267
  return 'cartesian';
98044
98268
  }
98045
98269
  _createMarkerComponent() {
98046
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
98047
- const { label = {}, startSymbol = {}, endSymbol = {} } = this._spec;
98270
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
98271
+ const { startSymbol = {}, endSymbol = {} } = this._spec;
98272
+ const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
98048
98273
  const markLineAttrs = {
98049
98274
  zIndex: this.layoutZIndex,
98050
- interactive: (_a = this._spec.interactive) !== null && _a !== void 0 ? _a : true,
98051
- hover: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
98052
- select: (_c = this._spec.interactive) !== null && _c !== void 0 ? _c : true,
98275
+ interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
98276
+ hover: (_c = this._spec.interactive) !== null && _c !== void 0 ? _c : true,
98277
+ select: (_d = this._spec.interactive) !== null && _d !== void 0 ? _d : true,
98053
98278
  points: [
98054
98279
  { x: 0, y: 0 },
98055
98280
  { x: 0, y: 0 }
@@ -98061,17 +98286,25 @@ class BaseMarkLine extends BaseMarker {
98061
98286
  radius: 0,
98062
98287
  startAngle: 0,
98063
98288
  endAngle: 0,
98064
- lineStyle: transformStyle(transformToGraphic((_d = this._spec.line) === null || _d === void 0 ? void 0 : _d.style), this._markerData, this._markAttributeContext),
98065
- clipInRange: (_e = this._spec.clip) !== null && _e !== void 0 ? _e : false,
98066
- label: transformLabelAttributes(label, this._markerData, this._markAttributeContext),
98289
+ lineStyle: transformStyle(transformToGraphic((_e = this._spec.line) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
98290
+ clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
98291
+ label: label.map(labelItem => {
98292
+ return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
98293
+ }),
98067
98294
  state: {
98068
- line: transformState((_g = (_f = this._spec.line) === null || _f === void 0 ? void 0 : _f.state) !== null && _g !== void 0 ? _g : {}, this._markerData, this._markAttributeContext),
98069
- lineStartSymbol: transformState((_j = (_h = this._spec.startSymbol) === null || _h === void 0 ? void 0 : _h.state) !== null && _j !== void 0 ? _j : {}, this._markerData, this._markAttributeContext),
98070
- lineEndSymbol: transformState((_l = (_k = this._spec.endSymbol) === null || _k === void 0 ? void 0 : _k.state) !== null && _l !== void 0 ? _l : {}, this._markerData, this._markAttributeContext),
98071
- label: transformState((_p = (_o = (_m = this._spec) === null || _m === void 0 ? void 0 : _m.label) === null || _o === void 0 ? void 0 : _o.state) !== null && _p !== void 0 ? _p : {}, this._markerData, this._markAttributeContext),
98072
- labelBackground: transformState((_t = (_s = (_r = (_q = this._spec) === null || _q === void 0 ? void 0 : _q.label) === null || _r === void 0 ? void 0 : _r.labelBackground) === null || _s === void 0 ? void 0 : _s.state) !== null && _t !== void 0 ? _t : {}, this._markerData, this._markAttributeContext)
98295
+ line: transformState((_h = (_g = this._spec.line) === null || _g === void 0 ? void 0 : _g.state) !== null && _h !== void 0 ? _h : {}, this._markerData, this._markAttributeContext),
98296
+ lineStartSymbol: transformState((_k = (_j = this._spec.startSymbol) === null || _j === void 0 ? void 0 : _j.state) !== null && _k !== void 0 ? _k : {}, this._markerData, this._markAttributeContext),
98297
+ lineEndSymbol: transformState((_m = (_l = this._spec.endSymbol) === null || _l === void 0 ? void 0 : _l.state) !== null && _m !== void 0 ? _m : {}, this._markerData, this._markAttributeContext),
98298
+ label: label.map(labelItem => {
98299
+ var _a;
98300
+ return transformState((_a = labelItem.state) !== null && _a !== void 0 ? _a : {}, this._markerData, this._markAttributeContext);
98301
+ }),
98302
+ labelBackground: label.map(labelItem => {
98303
+ var _a, _b;
98304
+ return transformState((_b = (_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : {}, this._markerData, this._markAttributeContext);
98305
+ })
98073
98306
  },
98074
- animation: (_u = this._spec.animation) !== null && _u !== void 0 ? _u : false,
98307
+ animation: (_o = this._spec.animation) !== null && _o !== void 0 ? _o : false,
98075
98308
  animationEnter: this._spec.animationEnter,
98076
98309
  animationExit: this._spec.animationExit,
98077
98310
  animationUpdate: this._spec.animationUpdate
@@ -98096,7 +98329,7 @@ class BaseMarkLine extends BaseMarker {
98096
98329
  return markLine;
98097
98330
  }
98098
98331
  _getUpdateMarkerAttrs() {
98099
- var _a, _b, _c, _d;
98332
+ var _a, _b;
98100
98333
  const spec = this._spec;
98101
98334
  const data = this._markerData;
98102
98335
  const startRelativeSeries = this._startRelativeSeries;
@@ -98106,7 +98339,7 @@ class BaseMarkLine extends BaseMarker {
98106
98339
  const seriesData = relativeSeries.getViewData().latestData;
98107
98340
  const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
98108
98341
  let limitRect;
98109
- if (spec.clip || ((_a = spec.label) === null || _a === void 0 ? void 0 : _a.confine)) {
98342
+ if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
98110
98343
  const { minX, maxX, minY, maxY } = computeClipRange([
98111
98344
  startRelativeSeries.getRegion(),
98112
98345
  endRelativeSeries.getRegion(),
@@ -98119,10 +98352,13 @@ class BaseMarkLine extends BaseMarker {
98119
98352
  height: maxY - minY
98120
98353
  };
98121
98354
  }
98122
- const markerComponentAttr = (_c = (_b = this._markerComponent) === null || _b === void 0 ? void 0 : _b.attribute) !== null && _c !== void 0 ? _c : {};
98123
- const labelAttrs = Object.assign(Object.assign({}, markerComponentAttr.label), { text: this._spec.label.formatMethod
98124
- ? this._spec.label.formatMethod(dataPoints, seriesData)
98125
- : (_d = markerComponentAttr.label) === null || _d === void 0 ? void 0 : _d.text });
98355
+ const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
98356
+ const prevLabelAttrs = array(markerComponentAttr.label);
98357
+ const specLabels = array(this._spec.label);
98358
+ const labelAttrs = prevLabelAttrs.map((prevLabel, index) => {
98359
+ const specLabel = specLabels[index] || {};
98360
+ return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod ? specLabel.formatMethod(dataPoints, seriesData) : prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
98361
+ });
98126
98362
  return Object.assign(Object.assign({}, pointsAttr), { label: labelAttrs, limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY });
98127
98363
  }
98128
98364
  _markerLayout() {
@@ -98224,7 +98460,7 @@ class CartesianMarkLine extends BaseMarkLine {
98224
98460
  return { points };
98225
98461
  }
98226
98462
  _markerLayout() {
98227
- var _a, _b, _c, _d, _e, _f, _g, _h;
98463
+ var _a, _b, _c, _d;
98228
98464
  const updateAttrs = this._getUpdateMarkerAttrs();
98229
98465
  if (this._spec.type === 'type-step') {
98230
98466
  const startRelativeSeries = this._startRelativeSeries;
@@ -98251,34 +98487,23 @@ class CartesianMarkLine extends BaseMarkLine {
98251
98487
  else {
98252
98488
  expandDistanceValue = expandDistance;
98253
98489
  }
98254
- const { points, label, limitRect } = updateAttrs;
98490
+ const { points, limitRect } = updateAttrs;
98255
98491
  const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
98256
98492
  let labelPositionAttrs;
98257
98493
  if (multiSegment && isValid$1(mainSegmentIndex)) {
98258
98494
  labelPositionAttrs = {
98259
98495
  position: 'middle',
98260
- autoRotate: false,
98261
- refX: 0,
98262
- refY: 0
98496
+ autoRotate: false
98263
98497
  };
98264
98498
  }
98265
98499
  else {
98266
- labelPositionAttrs = Object.assign(Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue)), { refX: 0, refY: 0 });
98267
- }
98268
- if (isValidNumber$1((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.refX)) {
98269
- labelPositionAttrs.refX += this._spec.label.refX;
98270
- }
98271
- if (isValidNumber$1((_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.refY)) {
98272
- labelPositionAttrs.refY += this._spec.label.refY;
98273
- }
98274
- if (isValidNumber$1((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.dx)) {
98275
- labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + this._spec.label.dx;
98276
- }
98277
- if (isValidNumber$1((_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.dy)) {
98278
- labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + this._spec.label.dy;
98500
+ labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
98279
98501
  }
98280
- const markerComponentAttr = (_f = (_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.attribute) !== null && _f !== void 0 ? _f : {};
98281
- (_g = this._markerComponent) === null || _g === void 0 ? void 0 : _g.setAttributes({
98502
+ const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
98503
+ const prevLabelAttrs = array(markerComponentAttr.label);
98504
+ const updateLabels = array(updateAttrs.label);
98505
+ const labelsInSpec = array(this._spec.label);
98506
+ (_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
98282
98507
  points: multiSegment
98283
98508
  ? [
98284
98509
  [joinPoints[0], joinPoints[1]],
@@ -98286,7 +98511,30 @@ class CartesianMarkLine extends BaseMarkLine {
98286
98511
  [joinPoints[2], joinPoints[3]]
98287
98512
  ]
98288
98513
  : joinPoints,
98289
- label: Object.assign(Object.assign(Object.assign({}, label), labelPositionAttrs), { textStyle: Object.assign(Object.assign({}, markerComponentAttr.label.textStyle), { textAlign: 'center', textBaseline: 'middle' }) }),
98514
+ label: updateLabels.map((labelItem, index) => {
98515
+ var _a, _b, _c, _d;
98516
+ let refX = 0;
98517
+ let refY = 0;
98518
+ let dx = (_a = labelPositionAttrs.dx) !== null && _a !== void 0 ? _a : 0;
98519
+ let dy = (_b = labelPositionAttrs.dy) !== null && _b !== void 0 ? _b : 0;
98520
+ const labelSpec = (_c = labelsInSpec[index]) !== null && _c !== void 0 ? _c : labelsInSpec[0];
98521
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refX)) {
98522
+ refX += labelSpec.refX;
98523
+ }
98524
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refY)) {
98525
+ refY += labelSpec.refY;
98526
+ }
98527
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dx)) {
98528
+ dx += labelSpec.dx;
98529
+ }
98530
+ if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dy)) {
98531
+ dy += labelSpec.dy;
98532
+ }
98533
+ return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { refX,
98534
+ refY,
98535
+ dx,
98536
+ dy, textStyle: Object.assign(Object.assign({}, (_d = prevLabelAttrs[index]) === null || _d === void 0 ? void 0 : _d.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
98537
+ }),
98290
98538
  limitRect,
98291
98539
  multiSegment,
98292
98540
  mainSegmentIndex,
@@ -98295,7 +98543,7 @@ class CartesianMarkLine extends BaseMarkLine {
98295
98543
  });
98296
98544
  }
98297
98545
  else {
98298
- (_h = this._markerComponent) === null || _h === void 0 ? void 0 : _h.setAttributes(updateAttrs);
98546
+ (_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
98299
98547
  }
98300
98548
  }
98301
98549
  _computeOptions() {
@@ -98359,15 +98607,15 @@ class CartesianMarkLine extends BaseMarkLine {
98359
98607
  type: 'markerAggregation',
98360
98608
  options
98361
98609
  });
98362
- if (spec.process && 'x' in spec.process) {
98610
+ if (spec.process && isValid$1(spec.process.x)) {
98363
98611
  options = [this._processSpecByDims([{ dim: 'x', specValue: spec.process.x }])];
98364
98612
  needAggr = true;
98365
98613
  }
98366
- if (spec.process && 'y' in spec.process) {
98614
+ if (spec.process && isValid$1(spec.process.y)) {
98367
98615
  options = options = [this._processSpecByDims([{ dim: 'y', specValue: spec.process.y }])];
98368
98616
  needAggr = true;
98369
98617
  }
98370
- if (spec.process && 'xy' in spec.process) {
98618
+ if (spec.process && isValid$1(spec.process.xy)) {
98371
98619
  const { xField, yField } = relativeSeries.getSpec();
98372
98620
  options = {
98373
98621
  fieldX: xField,
@@ -98649,8 +98897,8 @@ class BaseMarkArea extends BaseMarker {
98649
98897
  return 'cartesian';
98650
98898
  }
98651
98899
  _createMarkerComponent() {
98652
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
98653
- const label = (_a = this._spec.label) !== null && _a !== void 0 ? _a : {};
98900
+ var _a, _b, _c, _d, _e, _f, _g, _h;
98901
+ const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
98654
98902
  const markAreaAttrs = {
98655
98903
  zIndex: this.layoutZIndex,
98656
98904
  interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
@@ -98672,13 +98920,20 @@ class BaseMarkArea extends BaseMarker {
98672
98920
  endAngle: 0,
98673
98921
  areaStyle: transformStyle(transformToGraphic((_e = this._spec.area) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
98674
98922
  clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
98675
- label: transformLabelAttributes(label, this._markerData, this._markAttributeContext),
98923
+ label: label.map((labelItem) => {
98924
+ return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
98925
+ }),
98676
98926
  state: {
98677
98927
  area: transformState((_g = this._spec.area) === null || _g === void 0 ? void 0 : _g.state, this._markerData, this._markAttributeContext),
98678
- label: transformState((_h = this._spec.label) === null || _h === void 0 ? void 0 : _h.state, this._markerData, this._markAttributeContext),
98679
- labelBackground: transformState((_l = (_k = (_j = this._spec) === null || _j === void 0 ? void 0 : _j.label) === null || _k === void 0 ? void 0 : _k.labelBackground) === null || _l === void 0 ? void 0 : _l.state, this._markerData, this._markAttributeContext)
98928
+ label: label.map((labelItem) => {
98929
+ return transformState(labelItem.state, this._markerData, this._markAttributeContext);
98930
+ }),
98931
+ labelBackground: label.map((labelItem) => {
98932
+ var _a;
98933
+ return transformState((_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state, this._markerData, this._markAttributeContext);
98934
+ })
98680
98935
  },
98681
- animation: (_m = this._spec.animation) !== null && _m !== void 0 ? _m : false,
98936
+ animation: (_h = this._spec.animation) !== null && _h !== void 0 ? _h : false,
98682
98937
  animationEnter: this._spec.animationEnter,
98683
98938
  animationExit: this._spec.animationExit,
98684
98939
  animationUpdate: this._spec.animationUpdate
@@ -98687,7 +98942,7 @@ class BaseMarkArea extends BaseMarker {
98687
98942
  return markArea;
98688
98943
  }
98689
98944
  _markerLayout() {
98690
- var _a, _b, _c, _d;
98945
+ var _a;
98691
98946
  const spec = this._spec;
98692
98947
  const data = this._markerData;
98693
98948
  const startRelativeSeries = this._startRelativeSeries;
@@ -98701,7 +98956,7 @@ class BaseMarkArea extends BaseMarker {
98701
98956
  : data.latestData
98702
98957
  : seriesData;
98703
98958
  let limitRect;
98704
- if (spec.clip || ((_a = spec.label) === null || _a === void 0 ? void 0 : _a.confine)) {
98959
+ if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
98705
98960
  const { minX, maxX, minY, maxY } = computeClipRange([
98706
98961
  startRelativeSeries.getRegion(),
98707
98962
  endRelativeSeries.getRegion(),
@@ -98715,10 +98970,15 @@ class BaseMarkArea extends BaseMarker {
98715
98970
  };
98716
98971
  }
98717
98972
  if (this._markerComponent) {
98718
- this._markerComponent.setAttributes(Object.assign(Object.assign({}, pointsAttr), { label: Object.assign(Object.assign({}, (_b = this._markerComponent.attribute) === null || _b === void 0 ? void 0 : _b.label), { text: this._spec.label.formatMethod
98719
- ?
98720
- this._spec.label.formatMethod(dataPoints, seriesData)
98721
- : (_d = (_c = this._markerComponent.attribute) === null || _c === void 0 ? void 0 : _c.label) === null || _d === void 0 ? void 0 : _d.text }), limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY }));
98973
+ const prevLabelAttrs = array((_a = this._markerComponent.attribute) === null || _a === void 0 ? void 0 : _a.label);
98974
+ const specLabels = array(this._spec.label);
98975
+ this._markerComponent.setAttributes(Object.assign(Object.assign({}, pointsAttr), { label: prevLabelAttrs.map((prevLabel, index) => {
98976
+ const specLabel = specLabels[index] || {};
98977
+ return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod
98978
+ ?
98979
+ specLabel.formatMethod(dataPoints, seriesData)
98980
+ : prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
98981
+ }), limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY }));
98722
98982
  }
98723
98983
  }
98724
98984
  _initDataView() {
@@ -99947,9 +100207,9 @@ class CartesianMarkPoint extends BaseMarkPoint {
99947
100207
  const spec = this._spec;
99948
100208
  const data = this._markerData;
99949
100209
  const relativeSeries = this._relativeSeries;
99950
- const isXYLayout = 'x' in spec && 'y' in spec;
99951
- const isCoordinateLayout = 'coordinate' in spec;
99952
- const isPositionLayout = 'position' in spec;
100210
+ const isXYLayout = isValid$1(spec.x) && isValid$1(spec.y);
100211
+ const isCoordinateLayout = isValid$1(spec.coordinate);
100212
+ const isPositionLayout = isValid$1(spec.position);
99953
100213
  const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
99954
100214
  let point;
99955
100215
  if (isXYLayout) {
@@ -100072,7 +100332,6 @@ class Brush extends BaseComponent {
100072
100332
  this._outOfBrushElementsMap = {};
100073
100333
  this._linkedInBrushElementsMap = {};
100074
100334
  this._linkedOutOfBrushElementsMap = {};
100075
- this._needInitOutState = true;
100076
100335
  this._cacheInteractiveRangeAttrs = [];
100077
100336
  this._needDisablePickable = false;
100078
100337
  this._releatedAxes = [];
@@ -100080,6 +100339,11 @@ class Brush extends BaseComponent {
100080
100339
  this._axisDataZoomMap = {};
100081
100340
  this._zoomRecord = [];
100082
100341
  }
100342
+ static getSpecInfo(chartSpec) {
100343
+ return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
100344
+ return s.visible !== false;
100345
+ });
100346
+ }
100083
100347
  init() {
100084
100348
  const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
100085
100349
  const outOfBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.outOfBrush);
@@ -100092,9 +100356,22 @@ class Brush extends BaseComponent {
100092
100356
  });
100093
100357
  });
100094
100358
  }
100095
- static getSpecInfo(chartSpec) {
100096
- return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
100097
- return s.visible !== false;
100359
+ _initNeedOperatedItem() {
100360
+ const seriesUserId = this._spec.seriesId;
100361
+ const seriesIndex = this._spec.seriesIndex;
100362
+ this._relativeRegions.forEach(r => {
100363
+ const allMarks = [];
100364
+ r.getSeries().forEach((s) => {
100365
+ if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
100366
+ (seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
100367
+ (!seriesIndex && !seriesUserId)) {
100368
+ allMarks.push(...s.getMarksWithoutRoot());
100369
+ }
100370
+ this._itemMap[r.id] = allMarks;
100371
+ });
100372
+ });
100373
+ this._linkedSeries.forEach(s => {
100374
+ this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
100098
100375
  });
100099
100376
  }
100100
100377
  created() {
@@ -100106,41 +100383,91 @@ class Brush extends BaseComponent {
100106
100383
  this._initAxisDataZoomMap();
100107
100384
  this._initNeedOperatedItem();
100108
100385
  }
100109
- _extendDataInBrush(elementsMap) {
100110
- var _a, _b;
100111
- const data = [];
100112
- for (const brushName in elementsMap) {
100113
- for (const elementKey in elementsMap[brushName]) {
100114
- data.push(Object.assign({}, (_b = (_a = elementsMap[brushName][elementKey]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]));
100386
+ _bindRegions() {
100387
+ if (!isValid$1(this._spec.regionId) && !isValid$1(this._spec.regionIndex)) {
100388
+ this._relativeRegions = this._option.getAllRegions();
100389
+ }
100390
+ else {
100391
+ this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
100392
+ }
100393
+ }
100394
+ _bindLinkedSeries() {
100395
+ if (!isValid$1(this._spec.brushLinkSeriesId) && !isValid$1(this._spec.brushLinkSeriesIndex)) {
100396
+ return;
100397
+ }
100398
+ this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
100399
+ }
100400
+ _initRegionAxisMap() {
100401
+ if (isValid$1(this._spec.axisId)) {
100402
+ array(this._spec.axisId).forEach((axisId) => {
100403
+ this._releatedAxes.push(this._option.getComponentByUserId(axisId));
100404
+ });
100405
+ }
100406
+ else if (isValid$1(this._spec.axisIndex)) {
100407
+ array(this._spec.axisIndex).forEach((axisIndex) => {
100408
+ this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
100409
+ });
100410
+ }
100411
+ else {
100412
+ this._releatedAxes = this._option.getComponentsByKey('axes');
100413
+ }
100414
+ this._releatedAxes.forEach((axis) => {
100415
+ axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
100416
+ if (this._regionAxisMap['region_' + region.id]) {
100417
+ this._regionAxisMap['region_' + region.id].push(axis);
100418
+ }
100419
+ else {
100420
+ this._regionAxisMap['region_' + region.id] = [axis];
100421
+ }
100422
+ });
100423
+ });
100424
+ }
100425
+ _initAxisDataZoomMap() {
100426
+ this._option.getComponentsByKey('dataZoom').forEach((dz) => {
100427
+ if (dz.relatedAxisComponent) {
100428
+ this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
100115
100429
  }
100430
+ });
100431
+ }
100432
+ initEvent() {
100433
+ }
100434
+ onRender(ctx) {
100435
+ }
100436
+ changeRegions(regions) {
100437
+ }
100438
+ _compareSpec(spec, prevSpec) {
100439
+ if (this._brushComponents) {
100440
+ this._relativeRegions.forEach((region, index) => {
100441
+ this._updateBrushComponent(region, index);
100442
+ });
100116
100443
  }
100117
- return data;
100444
+ const result = super._compareSpec(spec, prevSpec);
100445
+ if (!isEqual(prevSpec, spec)) {
100446
+ result.reRender = true;
100447
+ result.reMake = true;
100448
+ }
100449
+ return result;
100118
100450
  }
100119
- _extendDatumOutOfBrush(elementsMap) {
100451
+ onLayoutEnd(ctx) {
100120
100452
  var _a;
100121
- const data = [];
100122
- for (const elementKey in elementsMap) {
100123
- data.push((_a = elementsMap[elementKey].data) === null || _a === void 0 ? void 0 : _a[0]);
100453
+ super.onLayoutEnd(ctx);
100454
+ if (this._option.disableTriggerEvent) {
100455
+ return;
100456
+ }
100457
+ const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
100458
+ if (brushVisible) {
100459
+ if (!this._brushComponents) {
100460
+ this._brushComponents = [];
100461
+ this._relativeRegions.forEach((region, index) => {
100462
+ this._createBrushComponent(region, index);
100463
+ });
100464
+ }
100465
+ else {
100466
+ this._relativeRegions.forEach((region, index) => {
100467
+ this._updateBrushComponent(region, index);
100468
+ });
100469
+ }
100124
100470
  }
100125
- return data;
100126
- }
100127
- _getBrushInteractiveAttr(region) {
100128
- const regionLayoutPosition = region.getLayoutStartPoint();
100129
- const regionLayoutRect = region.getLayoutRect();
100130
- const seriesRegionStartX = regionLayoutPosition.x;
100131
- const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
100132
- const seriesRegionStartY = regionLayoutPosition.y;
100133
- const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
100134
- return {
100135
- interactiveRange: {
100136
- minY: seriesRegionStartY,
100137
- maxY: seriesRegionEndY,
100138
- minX: seriesRegionStartX,
100139
- maxX: seriesRegionEndX
100140
- },
100141
- xRange: [seriesRegionStartX, seriesRegionEndX],
100142
- yRange: [seriesRegionStartY, seriesRegionEndY]
100143
- };
100144
100471
  }
100145
100472
  _updateBrushComponent(region, componentIndex) {
100146
100473
  const interactiveAttr = this._getBrushInteractiveAttr(region);
@@ -100148,7 +100475,6 @@ class Brush extends BaseComponent {
100148
100475
  brushComponent.setAttributes(interactiveAttr);
100149
100476
  this._initMarkBrushState(componentIndex, '');
100150
100477
  brushComponent.children[0].removeAllChild();
100151
- this._needInitOutState = true;
100152
100478
  }
100153
100479
  _createBrushComponent(region, componentIndex) {
100154
100480
  var _a, _b;
@@ -100156,9 +100482,12 @@ class Brush extends BaseComponent {
100156
100482
  const brush = new Brush$1(Object.assign(Object.assign(Object.assign({ zIndex: this.layoutZIndex, brushStyle: transformToGraphic((_a = this._spec) === null || _a === void 0 ? void 0 : _a.style) }, interactiveAttr), this._spec), { disableTriggerEvent: this._option.disableTriggerEvent }));
100157
100483
  brush.id = (_b = this._spec.id) !== null && _b !== void 0 ? _b : `brush-${this.id}`;
100158
100484
  this.getContainer().add(brush);
100159
- const { brushMode = 'single' } = this._spec;
100160
100485
  this._brushComponents.push(brush);
100161
100486
  this._cacheInteractiveRangeAttrs.push(interactiveAttr);
100487
+ brush.addEventListener(IOperateType.brushActive, (e) => {
100488
+ this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
100489
+ this._emitEvent(ChartEvent.brushActive, region);
100490
+ });
100162
100491
  brush.addEventListener(IOperateType.drawStart, (e) => {
100163
100492
  this._emitEvent(ChartEvent.brushStart, region);
100164
100493
  });
@@ -100166,41 +100495,45 @@ class Brush extends BaseComponent {
100166
100495
  this._emitEvent(ChartEvent.brushStart, region);
100167
100496
  });
100168
100497
  brush.addEventListener(IOperateType.drawing, (e) => {
100169
- if (this._needInitOutState && brushMode === 'single') {
100170
- this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
100171
- }
100172
- this._needInitOutState = false;
100173
100498
  this._needDisablePickable = true;
100174
- this._handleBrushChange(ChartEvent.brushChange, region, e);
100499
+ this._handleBrushChange(region, e);
100175
100500
  this._emitEvent(ChartEvent.brushChange, region);
100176
100501
  });
100177
100502
  brush.addEventListener(IOperateType.moving, (e) => {
100178
- this._handleBrushChange(ChartEvent.brushChange, region, e);
100503
+ this._handleBrushChange(region, e);
100179
100504
  this._emitEvent(ChartEvent.brushChange, region);
100180
100505
  });
100181
100506
  brush.addEventListener(IOperateType.brushClear, (e) => {
100182
100507
  this._initMarkBrushState(componentIndex, '');
100183
- this._needInitOutState = true;
100184
100508
  this._needDisablePickable = false;
100185
- this._handleBrushChange(ChartEvent.brushChange, region, e);
100186
- this._handleBrushChange(ChartEvent.brushClear, region, e);
100187
- this._emitEvent(ChartEvent.brushChange, region);
100188
100509
  this._emitEvent(ChartEvent.brushClear, region);
100189
100510
  });
100190
100511
  brush.addEventListener(IOperateType.drawEnd, (e) => {
100191
- this._needInitOutState = true;
100512
+ var _a;
100192
100513
  this._needDisablePickable = false;
100193
100514
  const { operateMask } = e.detail;
100194
- this._handleBrushChange(ChartEvent.brushEnd, region, e);
100195
- const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
100196
- if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
100197
- this._setAxisAndDataZoom(operateMask, region);
100515
+ if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
100516
+ if (this._spec.onBrushEnd(e) === true) {
100517
+ this.clearGraphic();
100518
+ this._initMarkBrushState(componentIndex, '');
100519
+ this._needDisablePickable = false;
100520
+ this._emitEvent(ChartEvent.brushClear, region);
100521
+ }
100522
+ else {
100523
+ this._spec.onBrushEnd(e);
100524
+ this._emitEvent(ChartEvent.brushEnd, region);
100525
+ }
100526
+ }
100527
+ else {
100528
+ const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
100529
+ if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
100530
+ this._setAxisAndDataZoom(operateMask, region);
100531
+ }
100532
+ this._emitEvent(ChartEvent.brushEnd, region);
100198
100533
  }
100199
- this._emitEvent(ChartEvent.brushEnd, region);
100200
100534
  });
100201
100535
  brush.addEventListener(IOperateType.moveEnd, (e) => {
100202
100536
  const { operateMask } = e.detail;
100203
- this._handleBrushChange(ChartEvent.brushEnd, region, e);
100204
100537
  const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
100205
100538
  if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
100206
100539
  this._setAxisAndDataZoom(operateMask, region);
@@ -100208,12 +100541,65 @@ class Brush extends BaseComponent {
100208
100541
  this._emitEvent(ChartEvent.brushEnd, region);
100209
100542
  });
100210
100543
  }
100211
- _handleBrushChange(eventType, region, e) {
100544
+ _getBrushInteractiveAttr(region) {
100545
+ const regionLayoutPosition = region.getLayoutStartPoint();
100546
+ const regionLayoutRect = region.getLayoutRect();
100547
+ const seriesRegionStartX = regionLayoutPosition.x;
100548
+ const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
100549
+ const seriesRegionStartY = regionLayoutPosition.y;
100550
+ const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
100551
+ return {
100552
+ interactiveRange: {
100553
+ minY: seriesRegionStartY,
100554
+ maxY: seriesRegionEndY,
100555
+ minX: seriesRegionStartX,
100556
+ maxX: seriesRegionEndX
100557
+ },
100558
+ xRange: [seriesRegionStartX, seriesRegionEndX],
100559
+ yRange: [seriesRegionStartY, seriesRegionEndY]
100560
+ };
100561
+ }
100562
+ _transformBrushedMarkAttr(brushedStyle) {
100563
+ const styleResult = {};
100564
+ if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
100565
+ styleResult.symbolType = brushedStyle.symbol;
100566
+ }
100567
+ if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
100568
+ styleResult.size = brushedStyle.symbolSize;
100569
+ }
100570
+ if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
100571
+ styleResult.fill = brushedStyle.color;
100572
+ }
100573
+ if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
100574
+ styleResult.fillOpacity = brushedStyle.colorAlpha;
100575
+ }
100576
+ return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
100577
+ }
100578
+ _handleBrushChange(region, e) {
100212
100579
  const { operateMask } = e.detail;
100213
100580
  this._reconfigItem(operateMask, region);
100214
100581
  this._reconfigLinkedItem(operateMask, region);
100215
100582
  }
100583
+ _extendDataInBrush(elementsMap) {
100584
+ var _a, _b;
100585
+ const data = [];
100586
+ for (const brushName in elementsMap) {
100587
+ for (const elementKey in elementsMap[brushName]) {
100588
+ data.push(Object.assign({}, (_b = (_a = elementsMap[brushName][elementKey]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]));
100589
+ }
100590
+ }
100591
+ return data;
100592
+ }
100593
+ _extendDatumOutOfBrush(elementsMap) {
100594
+ var _a;
100595
+ const data = [];
100596
+ for (const elementKey in elementsMap) {
100597
+ data.push((_a = elementsMap[elementKey].data) === null || _a === void 0 ? void 0 : _a[0]);
100598
+ }
100599
+ return data;
100600
+ }
100216
100601
  _emitEvent(eventType, region) {
100602
+ var _a;
100217
100603
  this.event.emit(eventType, {
100218
100604
  model: this,
100219
100605
  value: {
@@ -100228,27 +100614,28 @@ class Brush extends BaseComponent {
100228
100614
  linkedInBrushElementsMap: this._linkedInBrushElementsMap,
100229
100615
  linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
100230
100616
  zoomRecord: this._zoomRecord
100231
- }
100617
+ },
100618
+ vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
100232
100619
  });
100233
100620
  }
100234
- _transformBrushedMarkAttr(brushedStyle) {
100235
- const styleResult = {};
100236
- if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
100237
- styleResult.symbolType = brushedStyle.symbol;
100238
- }
100239
- if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
100240
- styleResult.size = brushedStyle.symbolSize;
100241
- }
100242
- if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
100243
- styleResult.fill = brushedStyle.color;
100244
- }
100245
- if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
100246
- styleResult.fillOpacity = brushedStyle.colorAlpha;
100247
- }
100248
- return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
100249
- }
100250
100621
  _reconfigItem(operateMask, region) {
100622
+ var _a, _b, _c;
100623
+ if (!(operateMask === null || operateMask === void 0 ? void 0 : operateMask.globalTransMatrix) || !((_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
100624
+ return;
100625
+ }
100626
+ const points = (_c = (_b = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _b === void 0 ? void 0 : _b.points) !== null && _c !== void 0 ? _c : [];
100627
+ const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
100628
+ const pointsCoord = points.map((p) => {
100629
+ return {
100630
+ x: a * p.x + c * p.y + e,
100631
+ y: b * p.x + d * p.y + f
100632
+ };
100633
+ });
100634
+ const { markTypeFilter = [] } = this._spec;
100251
100635
  this._itemMap[region.id].forEach((mark) => {
100636
+ if (markTypeFilter.includes(mark.type)) {
100637
+ return;
100638
+ }
100252
100639
  const grammarMark = mark.getProduct();
100253
100640
  if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
100254
100641
  return;
@@ -100258,7 +100645,8 @@ class Brush extends BaseComponent {
100258
100645
  var _a, _b, _c;
100259
100646
  const graphicItem = el.getGraphicItem();
100260
100647
  const elementKey = mark.id + '_' + el.key;
100261
- if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem)) {
100648
+ const isBrushContainItem = this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem);
100649
+ if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && isBrushContainItem) {
100262
100650
  el.addState(IN_BRUSH_STATE);
100263
100651
  if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
100264
100652
  this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
@@ -100266,8 +100654,7 @@ class Brush extends BaseComponent {
100266
100654
  this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name][elementKey] = el;
100267
100655
  delete this._outOfBrushElementsMap[elementKey];
100268
100656
  }
100269
- else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
100270
- !this._isBrushContainItem(operateMask, graphicItem)) {
100657
+ else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) && !isBrushContainItem) {
100271
100658
  el.removeState(IN_BRUSH_STATE);
100272
100659
  el.addState(OUT_BRUSH_STATE);
100273
100660
  this._outOfBrushElementsMap[elementKey] = el;
@@ -100278,14 +100665,36 @@ class Brush extends BaseComponent {
100278
100665
  });
100279
100666
  }
100280
100667
  _reconfigLinkedItem(operateMask, region) {
100668
+ var _a;
100669
+ if (!(operateMask === null || operateMask === void 0 ? void 0 : operateMask.globalTransMatrix) || !((_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
100670
+ return;
100671
+ }
100281
100672
  const regionLayoutPos = region.getLayoutStartPoint();
100282
100673
  const seriesId = region.getSeries().map(s => s.id);
100283
100674
  this._linkedSeries.forEach((s) => {
100675
+ var _a, _b;
100284
100676
  if (!seriesId.includes(s.id)) {
100285
100677
  const sRegionLayoutPos = s.getRegion().getLayoutStartPoint();
100286
100678
  const regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x;
100287
100679
  const regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y;
100680
+ const points = (_b = (_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points) !== null && _b !== void 0 ? _b : [];
100681
+ const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
100682
+ const dx = regionOffsetX || 0;
100683
+ const dy = regionOffsetY || 0;
100684
+ const pointsCoord = points.map((p) => {
100685
+ return {
100686
+ x: a * p.x + c * p.y + e + dx,
100687
+ y: b * p.x + d * p.y + f + dy
100688
+ };
100689
+ });
100690
+ operateMask.globalAABBBounds
100691
+ .clone()
100692
+ .set(operateMask.globalAABBBounds.x1 + dx, operateMask.globalAABBBounds.y1 + dy, operateMask.globalAABBBounds.x2 + dx, operateMask.globalAABBBounds.y2 + dy);
100693
+ const { markTypeFilter = [] } = this._spec;
100288
100694
  this._linkedItemMap[s.id].forEach((mark) => {
100695
+ if (markTypeFilter.includes(mark.type)) {
100696
+ return;
100697
+ }
100289
100698
  const grammarMark = mark.getProduct();
100290
100699
  if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
100291
100700
  return;
@@ -100296,7 +100705,7 @@ class Brush extends BaseComponent {
100296
100705
  const graphicItem = el.getGraphicItem();
100297
100706
  const elementKey = mark.id + '_' + el.key;
100298
100707
  if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
100299
- this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
100708
+ this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
100300
100709
  el.addState(IN_BRUSH_STATE);
100301
100710
  if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
100302
100711
  this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
@@ -100305,7 +100714,7 @@ class Brush extends BaseComponent {
100305
100714
  delete this._linkedOutOfBrushElementsMap[elementKey];
100306
100715
  }
100307
100716
  else if (((_c = (_b = this._linkedInBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
100308
- !this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
100717
+ !this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
100309
100718
  el.removeState(IN_BRUSH_STATE);
100310
100719
  el.addState(OUT_BRUSH_STATE);
100311
100720
  this._linkedOutOfBrushElementsMap[elementKey] = el;
@@ -100316,75 +100725,81 @@ class Brush extends BaseComponent {
100316
100725
  }
100317
100726
  });
100318
100727
  }
100319
- _isBrushContainItem(brushMask, item, linkedOffset) {
100320
- var _a, _b, _c;
100321
- if (!(brushMask === null || brushMask === void 0 ? void 0 : brushMask.globalTransMatrix) || !((_a = brushMask === null || brushMask === void 0 ? void 0 : brushMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
100322
- return false;
100323
- }
100324
- const points = (_c = (_b = brushMask === null || brushMask === void 0 ? void 0 : brushMask.attribute) === null || _b === void 0 ? void 0 : _b.points) !== null && _c !== void 0 ? _c : [];
100325
- const { a, b, c, d, e, f } = brushMask.globalTransMatrix;
100326
- const dx = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dx) || 0;
100327
- const dy = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dy) || 0;
100328
- const pointsCoord = points.map((p) => {
100329
- return {
100330
- x: a * p.x + c * p.y + e + dx,
100331
- y: b * p.x + d * p.y + f + dy
100332
- };
100333
- });
100334
- brushMask.globalAABBBounds
100335
- .clone()
100336
- .set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
100337
- const x = item.globalTransMatrix.e;
100338
- const y = item.globalTransMatrix.f;
100728
+ _isBrushContainItem(brushMaskAABBBounds, brushMaskPointsCoord, item) {
100339
100729
  let itemBounds = [];
100340
- if (item.type === 'symbol') {
100341
- const { size: itemSize = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
100342
- const size = array(itemSize)[0] / 2;
100730
+ if (['symbol', 'rect'].includes(item.type)) {
100731
+ const { x1, x2, y1, y2 } = item === null || item === void 0 ? void 0 : item.globalAABBBounds;
100343
100732
  itemBounds = [
100344
100733
  {
100345
- x: x - size,
100346
- y: y - size
100734
+ x: x1,
100735
+ y: y1
100347
100736
  },
100348
100737
  {
100349
- x: x + size,
100350
- y: y - size
100738
+ x: x2,
100739
+ y: y1
100351
100740
  },
100352
100741
  {
100353
- x: x + size,
100354
- y: y + size
100742
+ x: x2,
100743
+ y: y2
100355
100744
  },
100356
100745
  {
100357
- x: x - size,
100358
- y: y + size
100746
+ x: x1,
100747
+ y: y2
100359
100748
  }
100360
100749
  ];
100361
- return polygonIntersectPolygon(pointsCoord, itemBounds);
100750
+ return polygonIntersectPolygon(brushMaskPointsCoord, itemBounds);
100362
100751
  }
100363
- else if (item.type === 'rect') {
100364
- const { x1, x2, y1, y2 } = item === null || item === void 0 ? void 0 : item.AABBBounds;
100365
- const width = Math.abs(x1 - x2);
100366
- const height = Math.abs(y1 - y2);
100367
- itemBounds = [
100368
- {
100369
- x: x,
100370
- y: y
100371
- },
100372
- {
100373
- x: x + width,
100374
- y: y
100375
- },
100376
- {
100377
- x: x + width,
100378
- y: y + height
100379
- },
100380
- {
100381
- x: x,
100382
- y: y + height
100752
+ return brushMaskAABBBounds.intersects(item.globalAABBBounds);
100753
+ }
100754
+ _initMarkBrushState(componentIndex, stateName) {
100755
+ this._brushComponents.forEach((brush, index) => {
100756
+ if (index !== componentIndex) {
100757
+ brush.children[0].removeAllChild();
100758
+ }
100759
+ });
100760
+ this._inBrushElementsMap = {};
100761
+ this._outOfBrushElementsMap = {};
100762
+ this._linkedInBrushElementsMap = {};
100763
+ this._linkedOutOfBrushElementsMap = {};
100764
+ const { markTypeFilter = [] } = this._spec;
100765
+ Object.entries(this._itemMap).forEach(([regionId, marks]) => {
100766
+ marks.forEach((mark) => {
100767
+ if (markTypeFilter.includes(mark.type)) {
100768
+ return;
100383
100769
  }
100384
- ];
100385
- return polygonIntersectPolygon(pointsCoord, itemBounds);
100386
- }
100387
- return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
100770
+ const grammarMark = mark.getProduct();
100771
+ if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
100772
+ return;
100773
+ }
100774
+ const elements = grammarMark.elements;
100775
+ elements.forEach((el) => {
100776
+ const elementKey = mark.id + '_' + el.key;
100777
+ el.removeState(IN_BRUSH_STATE);
100778
+ el.removeState(OUT_BRUSH_STATE);
100779
+ el.addState(stateName);
100780
+ this._outOfBrushElementsMap[elementKey] = el;
100781
+ });
100782
+ });
100783
+ });
100784
+ Object.entries(this._linkedItemMap).forEach(([seriesId, marks]) => {
100785
+ marks.forEach((mark) => {
100786
+ if (markTypeFilter.includes(mark.type)) {
100787
+ return;
100788
+ }
100789
+ const grammarMark = mark.getProduct();
100790
+ if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
100791
+ return;
100792
+ }
100793
+ const elements = grammarMark.elements;
100794
+ elements.forEach((el) => {
100795
+ const elementKey = mark.id + '_' + el.key;
100796
+ el.removeState(IN_BRUSH_STATE);
100797
+ el.removeState(OUT_BRUSH_STATE);
100798
+ el.addState(stateName);
100799
+ this._linkedOutOfBrushElementsMap[elementKey] = el;
100800
+ });
100801
+ });
100802
+ });
100388
100803
  }
100389
100804
  _stateClamp(state) {
100390
100805
  return Math.min(Math.max(0, state), 1);
@@ -100450,139 +100865,9 @@ class Brush extends BaseComponent {
100450
100865
  });
100451
100866
  }
100452
100867
  }
100453
- _bindRegions() {
100454
- if (isValid$1(this._spec.regionId) && isValid$1(this._spec.regionIndex)) {
100455
- this._relativeRegions = this._option.getAllRegions();
100456
- }
100457
- this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
100458
- }
100459
- _bindLinkedSeries() {
100460
- if (isValid$1(this._spec.brushLinkSeriesId) && isValid$1(this._spec.brushLinkSeriesIndex)) {
100461
- return;
100462
- }
100463
- this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
100464
- }
100465
- _initRegionAxisMap() {
100466
- if (isValid$1(this._spec.axisId)) {
100467
- array(this._spec.axisId).forEach((axisId) => {
100468
- this._releatedAxes.push(this._option.getComponentByUserId(axisId));
100469
- });
100470
- }
100471
- else if (isValid$1(this._spec.axisIndex)) {
100472
- array(this._spec.axisIndex).forEach((axisIndex) => {
100473
- this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
100474
- });
100475
- }
100476
- else {
100477
- this._releatedAxes = this._option.getComponentsByKey('axes');
100478
- }
100479
- this._releatedAxes.forEach((axis) => {
100480
- axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
100481
- if (this._regionAxisMap['region_' + region.id]) {
100482
- this._regionAxisMap['region_' + region.id].push(axis);
100483
- }
100484
- else {
100485
- this._regionAxisMap['region_' + region.id] = [axis];
100486
- }
100487
- });
100488
- });
100489
- }
100490
- _initAxisDataZoomMap() {
100491
- this._option.getComponentsByKey('dataZoom').forEach((dz) => {
100492
- if (dz.relatedAxisComponent) {
100493
- this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
100494
- }
100495
- });
100496
- }
100497
- _initNeedOperatedItem() {
100498
- const seriesUserId = this._spec.seriesId;
100499
- const seriesIndex = this._spec.seriesIndex;
100500
- this._relativeRegions.forEach(r => {
100501
- const allMarks = [];
100502
- r.getSeries().forEach((s) => {
100503
- if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
100504
- (seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
100505
- (!seriesIndex && !seriesUserId)) {
100506
- allMarks.push(...s.getMarksWithoutRoot());
100507
- }
100508
- this._itemMap[r.id] = allMarks;
100509
- });
100510
- });
100511
- this._linkedSeries.forEach(s => {
100512
- this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
100513
- });
100514
- }
100515
- _initMarkBrushState(componentIndex, stateName) {
100516
- this._brushComponents.forEach((brush, index) => {
100517
- if (index !== componentIndex) {
100518
- brush.children[0].removeAllChild();
100519
- }
100520
- });
100521
- this._inBrushElementsMap = {};
100522
- this._outOfBrushElementsMap = {};
100523
- this._linkedInBrushElementsMap = {};
100524
- this._linkedOutOfBrushElementsMap = {};
100525
- this._option.getAllSeries().forEach((s) => {
100526
- s.getMarksWithoutRoot().forEach((mark) => {
100527
- const grammarMark = mark.getProduct();
100528
- if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
100529
- return;
100530
- }
100531
- const elements = grammarMark.elements;
100532
- elements.forEach((el) => {
100533
- const elementKey = mark.id + '_' + el.key;
100534
- el.removeState(IN_BRUSH_STATE);
100535
- el.removeState(OUT_BRUSH_STATE);
100536
- el.addState(stateName);
100537
- this._outOfBrushElementsMap[elementKey] = el;
100538
- this._linkedOutOfBrushElementsMap[elementKey] = el;
100539
- });
100540
- });
100541
- });
100542
- }
100543
- initEvent() {
100544
- }
100545
- onRender(ctx) {
100546
- }
100547
- changeRegions(regions) {
100548
- }
100549
100868
  _getNeedClearVRenderComponents() {
100550
100869
  return this._brushComponents;
100551
100870
  }
100552
- _compareSpec(spec, prevSpec) {
100553
- if (this._brushComponents) {
100554
- this._relativeRegions.forEach((region, index) => {
100555
- this._updateBrushComponent(region, index);
100556
- });
100557
- }
100558
- const result = super._compareSpec(spec, prevSpec);
100559
- if (!isEqual(prevSpec, spec)) {
100560
- result.reRender = true;
100561
- result.reMake = true;
100562
- }
100563
- return result;
100564
- }
100565
- onLayoutEnd(ctx) {
100566
- var _a;
100567
- super.onLayoutEnd(ctx);
100568
- if (this._option.disableTriggerEvent) {
100569
- return;
100570
- }
100571
- const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
100572
- if (brushVisible) {
100573
- if (!this._brushComponents) {
100574
- this._brushComponents = [];
100575
- this._relativeRegions.forEach((region, index) => {
100576
- this._createBrushComponent(region, index);
100577
- });
100578
- }
100579
- else {
100580
- this._relativeRegions.forEach((region, index) => {
100581
- this._updateBrushComponent(region, index);
100582
- });
100583
- }
100584
- }
100585
- }
100586
100871
  clearGraphic() {
100587
100872
  if (this._brushComponents) {
100588
100873
  this._brushComponents.forEach(brush => {
@@ -100593,7 +100878,9 @@ class Brush extends BaseComponent {
100593
100878
  clear() {
100594
100879
  if (this._brushComponents) {
100595
100880
  const container = this.getContainer();
100596
- this._brushComponents.forEach(brush => {
100881
+ this._brushComponents.forEach((brush, index) => {
100882
+ this._initMarkBrushState(index, '');
100883
+ this._needDisablePickable = false;
100597
100884
  brush.removeAllChild();
100598
100885
  brush.releaseBrushEvents();
100599
100886
  if (container) {
@@ -102587,16 +102874,29 @@ class DomTooltipHandler extends BaseTooltipHandler {
102587
102874
  }
102588
102875
  }
102589
102876
  _updateDomStyle(sizeKey = 'width') {
102590
- var _a, _b, _c, _d;
102877
+ var _a, _b, _c, _d, _e;
102591
102878
  const rootDom = this._rootDom;
102592
102879
  const contentDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
102880
+ const titleDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));
102593
102881
  if (contentDom) {
102594
102882
  const tooltipSpec = this._component.getSpec();
102595
102883
  const contentStyle = {};
102596
- if (isValid$1((_a = tooltipSpec === null || tooltipSpec === void 0 ? void 0 : tooltipSpec.style) === null || _a === void 0 ? void 0 : _a.maxContentHeight)) {
102597
- const titleDom = rootDom.children[0];
102884
+ const titleLabel = (_a = tooltipSpec.style) === null || _a === void 0 ? void 0 : _a.titleLabel;
102885
+ const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;
102886
+ if (autoFixTitleWidth && titleDom) {
102887
+ const maxWidth = [...contentDom.children].reduce((res, col) => {
102888
+ return sizeKey === 'height'
102889
+ ? res + col.getBoundingClientRect().width
102890
+ : Math.max(res, col.getBoundingClientRect().width);
102891
+ }, 0);
102892
+ if (maxWidth > 0) {
102893
+ titleDom.style.maxWidth = `${maxWidth}px`;
102894
+ titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;
102895
+ }
102896
+ }
102897
+ if (isValid$1((_b = tooltipSpec === null || tooltipSpec === void 0 ? void 0 : tooltipSpec.style) === null || _b === void 0 ? void 0 : _b.maxContentHeight)) {
102598
102898
  const titleHeight = titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)
102599
- ? titleDom.getBoundingClientRect().height + ((_b = tooltipSpec.style.spaceRow) !== null && _b !== void 0 ? _b : 0)
102899
+ ? titleDom.getBoundingClientRect().height + ((_c = tooltipSpec.style.spaceRow) !== null && _c !== void 0 ? _c : 0)
102600
102900
  : 0;
102601
102901
  const viewRect = this._chartOption.getChartViewRect();
102602
102902
  const maxHeight = calcLayoutNumber(tooltipSpec.style.maxContentHeight, Math.min(viewRect.height, document.body.clientHeight) -
@@ -102614,7 +102914,7 @@ class DomTooltipHandler extends BaseTooltipHandler {
102614
102914
  if (rows) {
102615
102915
  for (let i = 0; i < rows.length; i++) {
102616
102916
  const row = rows[i];
102617
- const cols = (_c = row.children) !== null && _c !== void 0 ? _c : [];
102917
+ const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
102618
102918
  for (let j = 0; j < cols.length; j++) {
102619
102919
  const width = cols[j].getBoundingClientRect()[sizeKey];
102620
102920
  if (widthByCol[j] === undefined || widthByCol[j] < width) {
@@ -102624,7 +102924,7 @@ class DomTooltipHandler extends BaseTooltipHandler {
102624
102924
  }
102625
102925
  for (let i = 0; i < rows.length; i++) {
102626
102926
  const row = rows[i];
102627
- const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
102927
+ const cols = (_e = row.children) !== null && _e !== void 0 ? _e : [];
102628
102928
  for (let j = 0; j < cols.length; j++) {
102629
102929
  cols[j].style[sizeKey] = `${widthByCol[j]}px`;
102630
102930
  }
@@ -103790,4 +104090,4 @@ const registerMediaQuery = () => {
103790
104090
  registerChartPlugin(MediaQuery);
103791
104091
  };
103792
104092
 
103793
- export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, CommonChartSpecTransformer, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, functionTransform, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getFieldAlias, getMergedTheme, getPolarDimensionInfo, getRegionStackGroup, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, mergeFields, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, sortStackValueGroup, specTransform, spiralEffect, stack, stackGroup, stackMosaic, stackMosaicTotal, stackOffsetSilhouette, stackTotal, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };
104093
+ export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianChartSpecTransformer, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, CommonChartSpecTransformer, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, functionTransform, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getFieldAlias, getMergedTheme, getPolarDimensionInfo, getRegionStackGroup, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, mergeFields, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, sortStackValueGroup, specTransform, spiralEffect, stack, stackGroup, stackMosaic, stackMosaicTotal, stackOffsetSilhouette, stackTotal, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };