@visactor/vrender-components 1.0.18 → 1.0.19

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 (60) hide show
  1. package/cjs/axis/line.js +2 -1
  2. package/cjs/axis/line.js.map +1 -1
  3. package/cjs/axis/tick-data/continuous.js.map +1 -1
  4. package/cjs/axis/tick-data/util.js.map +1 -1
  5. package/cjs/brush/brush.js.map +1 -1
  6. package/cjs/brush/config.js +1 -2
  7. package/cjs/data-zoom/data-zoom.d.ts +12 -83
  8. package/cjs/data-zoom/data-zoom.js +104 -542
  9. package/cjs/data-zoom/data-zoom.js.map +1 -1
  10. package/cjs/data-zoom/interaction.d.ts +65 -0
  11. package/cjs/data-zoom/interaction.js +179 -0
  12. package/cjs/data-zoom/interaction.js.map +1 -0
  13. package/cjs/data-zoom/renderer.d.ts +91 -0
  14. package/cjs/data-zoom/renderer.js +461 -0
  15. package/cjs/data-zoom/renderer.js.map +1 -0
  16. package/cjs/data-zoom/type.d.ts +8 -0
  17. package/cjs/data-zoom/type.js +11 -3
  18. package/cjs/data-zoom/type.js.map +1 -1
  19. package/cjs/data-zoom/utils.d.ts +2 -0
  20. package/cjs/data-zoom/utils.js +20 -0
  21. package/cjs/data-zoom/utils.js.map +1 -0
  22. package/cjs/index.d.ts +1 -1
  23. package/cjs/index.js +1 -1
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/indicator/config.js +1 -2
  26. package/cjs/indicator/register.js +2 -1
  27. package/cjs/label/base.js +1 -1
  28. package/cjs/label/data-label-register.js +1 -1
  29. package/cjs/label/dataLabel.js +1 -1
  30. package/dist/index.es.js +1087 -742
  31. package/es/axis/line.js +2 -1
  32. package/es/axis/line.js.map +1 -1
  33. package/es/axis/tick-data/continuous.js.map +1 -1
  34. package/es/axis/tick-data/util.js.map +1 -1
  35. package/es/brush/brush.js.map +1 -1
  36. package/es/brush/config.js +1 -2
  37. package/es/data-zoom/data-zoom.d.ts +12 -83
  38. package/es/data-zoom/data-zoom.js +108 -545
  39. package/es/data-zoom/data-zoom.js.map +1 -1
  40. package/es/data-zoom/interaction.d.ts +65 -0
  41. package/es/data-zoom/interaction.js +177 -0
  42. package/es/data-zoom/interaction.js.map +1 -0
  43. package/es/data-zoom/renderer.d.ts +91 -0
  44. package/es/data-zoom/renderer.js +458 -0
  45. package/es/data-zoom/renderer.js.map +1 -0
  46. package/es/data-zoom/type.d.ts +8 -0
  47. package/es/data-zoom/type.js +13 -0
  48. package/es/data-zoom/type.js.map +1 -1
  49. package/es/data-zoom/utils.d.ts +2 -0
  50. package/es/data-zoom/utils.js +12 -0
  51. package/es/data-zoom/utils.js.map +1 -0
  52. package/es/index.d.ts +1 -1
  53. package/es/index.js +1 -1
  54. package/es/index.js.map +1 -1
  55. package/es/indicator/config.js +1 -2
  56. package/es/indicator/register.js +2 -1
  57. package/es/label/base.js +1 -1
  58. package/es/label/data-label-register.js +1 -1
  59. package/es/label/dataLabel.js +1 -1
  60. package/package.json +4 -4
package/dist/index.es.js CHANGED
@@ -499,14 +499,20 @@ class ContributionProviderCache {
499
499
  }
500
500
  }
501
501
  function bindContributionProvider(bind, id) {
502
- bind(ContributionProvider).toDynamicValue(({
503
- container: container
504
- }) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
502
+ bind(ContributionProvider).toDynamicValue(_ref => {
503
+ let {
504
+ container: container
505
+ } = _ref;
506
+ return new ContributionProviderCache(id, container);
507
+ }).inSingletonScope().whenTargetNamed(id);
505
508
  }
506
509
  function bindContributionProviderNoSingletonScope(bind, id) {
507
- bind(ContributionProvider).toDynamicValue(({
508
- container: container
509
- }) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
510
+ bind(ContributionProvider).toDynamicValue(_ref2 => {
511
+ let {
512
+ container: container
513
+ } = _ref2;
514
+ return new ContributionProviderCache(id, container);
515
+ }).whenTargetNamed(id);
510
516
  }
511
517
  class ContributionStore {
512
518
  static getStore(id) {
@@ -576,7 +582,10 @@ class Hook {
576
582
  }
577
583
 
578
584
  class SyncHook extends Hook {
579
- call(...args) {
585
+ call() {
586
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
587
+ args[_key] = arguments[_key];
588
+ }
580
589
  this.taps.map(t => t.fn).forEach(cb => cb(...args));
581
590
  }
582
591
  }
@@ -860,13 +869,16 @@ let DefaultGlobal = class extends EventListenerManager {
860
869
  updateDom(dom, params) {
861
870
  return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
862
871
  }
863
- getElementTop(dom, baseWindow = !1) {
872
+ getElementTop(dom) {
873
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
864
874
  return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
865
875
  }
866
- getElementLeft(dom, baseWindow = !1) {
876
+ getElementLeft(dom) {
877
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
867
878
  return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
868
879
  }
869
- getElementTopLeft(dom, baseWindow = !1) {
880
+ getElementTopLeft(dom) {
881
+ let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
870
882
  return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
871
883
  }
872
884
  isMacOS() {
@@ -951,7 +963,7 @@ class BoundsContext {
951
963
  clear() {
952
964
  this.bounds.clear();
953
965
  }
954
- release(...params) {}
966
+ release() {}
955
967
  }
956
968
 
957
969
  class CurvePath {
@@ -1126,7 +1138,8 @@ function drawArc(context, x, y, coords) {
1126
1138
  context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
1127
1139
  }
1128
1140
  }
1129
- const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
1141
+ const addArcToBezierPath = function (bezierPath, startAngle, endAngle, cx, cy, rx, ry) {
1142
+ let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
1130
1143
  const PI2 = 2 * Math.PI,
1131
1144
  sAngle = (startAngle % PI2 + PI2) % PI2;
1132
1145
  let deltaAngle,
@@ -1154,7 +1167,12 @@ const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, co
1154
1167
  };
1155
1168
 
1156
1169
  const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
1157
- function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
1170
+ function renderCommandList(commandList, context) {
1171
+ let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1172
+ let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1173
+ let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
1174
+ let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
1175
+ let z = arguments.length > 6 ? arguments[6] : undefined;
1158
1176
  for (let i = 0; i < commandList.length; i++) {
1159
1177
  const command = commandList[i];
1160
1178
  commandFuncs[command[0]](command, context, x, y, sx, sy, z);
@@ -1395,7 +1413,7 @@ class ReflectSegContext extends SegContext {
1395
1413
  }
1396
1414
  }
1397
1415
 
1398
- function genCurveSegments(path, points, step = 1) {
1416
+ function genCurveSegments(path, points) {
1399
1417
  let defined0 = !1;
1400
1418
  for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
1401
1419
  }
@@ -1438,7 +1456,8 @@ class Linear {
1438
1456
  return this.context.tryUpdateLength();
1439
1457
  }
1440
1458
  }
1441
- function genLinearSegments(points, params = {}) {
1459
+ function genLinearSegments(points) {
1460
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1442
1461
  const {
1443
1462
  direction: direction,
1444
1463
  startPoint: startPoint
@@ -1448,7 +1467,7 @@ function genLinearSegments(points, params = {}) {
1448
1467
  return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
1449
1468
  }
1450
1469
  function genLinearTypeSegments(path, points) {
1451
- return genCurveSegments(path, points, 1);
1470
+ return genCurveSegments(path, points);
1452
1471
  }
1453
1472
 
1454
1473
  function point$3(curveClass, x, y, defined, p) {
@@ -1491,9 +1510,10 @@ class Basis {
1491
1510
  }
1492
1511
  }
1493
1512
  function genBasisTypeSegments(path, points) {
1494
- return genCurveSegments(path, points, 2);
1513
+ return genCurveSegments(path, points);
1495
1514
  }
1496
- function genBasisSegments(points, params = {}) {
1515
+ function genBasisSegments(points) {
1516
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1497
1517
  const {
1498
1518
  direction: direction,
1499
1519
  startPoint: startPoint
@@ -1586,9 +1606,10 @@ class MonotoneY extends MonotoneX {
1586
1606
  }
1587
1607
  }
1588
1608
  function genMonotoneXTypeSegments(path, points) {
1589
- return genCurveSegments(path, points, 2);
1609
+ return genCurveSegments(path, points);
1590
1610
  }
1591
- function genMonotoneXSegments(points, params = {}) {
1611
+ function genMonotoneXSegments(points) {
1612
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1592
1613
  const {
1593
1614
  direction: direction,
1594
1615
  startPoint: startPoint
@@ -1599,9 +1620,10 @@ function genMonotoneXSegments(points, params = {}) {
1599
1620
  return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
1600
1621
  }
1601
1622
  function genMonotoneYTypeSegments(path, points) {
1602
- return genCurveSegments(path, points, 2);
1623
+ return genCurveSegments(path, points);
1603
1624
  }
1604
- function genMonotoneYSegments(points, params = {}) {
1625
+ function genMonotoneYSegments(points) {
1626
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1605
1627
  const {
1606
1628
  direction: direction,
1607
1629
  startPoint: startPoint
@@ -1613,7 +1635,9 @@ function genMonotoneYSegments(points, params = {}) {
1613
1635
  }
1614
1636
 
1615
1637
  let Step$1 = class Step {
1616
- constructor(context, t = .5, startPoint) {
1638
+ constructor(context) {
1639
+ let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1640
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1617
1641
  this.context = context, this._t = t, this.startPoint = startPoint;
1618
1642
  }
1619
1643
  areaStart() {
@@ -1654,7 +1678,8 @@ class StepClosed extends Step$1 {
1654
1678
  this.context.closePath();
1655
1679
  }
1656
1680
  }
1657
- function genStepSegments(points, t, params = {}) {
1681
+ function genStepSegments(points, t) {
1682
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1658
1683
  const {
1659
1684
  direction: direction,
1660
1685
  startPoint: startPoint
@@ -1664,9 +1689,10 @@ function genStepSegments(points, t, params = {}) {
1664
1689
  return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
1665
1690
  }
1666
1691
  function genStepTypeSegments(path, points) {
1667
- return genCurveSegments(path, points, 1);
1692
+ return genCurveSegments(path, points);
1668
1693
  }
1669
- function genStepClosedSegments(points, t, params = {}) {
1694
+ function genStepClosedSegments(points, t) {
1695
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1670
1696
  const {
1671
1697
  direction: direction,
1672
1698
  startPoint: startPoint
@@ -1681,7 +1707,8 @@ class LinearClosed extends Linear {
1681
1707
  this.context.closePath();
1682
1708
  }
1683
1709
  }
1684
- function genLinearClosedSegments(points, params = {}) {
1710
+ function genLinearClosedSegments(points) {
1711
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1685
1712
  const {
1686
1713
  direction: direction,
1687
1714
  startPoint: startPoint
@@ -1691,7 +1718,7 @@ function genLinearClosedSegments(points, params = {}) {
1691
1718
  return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
1692
1719
  }
1693
1720
  function genLinearClosedTypeSegments(path, points) {
1694
- return genCurveSegments(path, points, 1);
1721
+ return genCurveSegments(path, points);
1695
1722
  }
1696
1723
 
1697
1724
  function point$1(curveClass, x, y, defined, p) {
@@ -1712,7 +1739,9 @@ function point$1(curveClass, x, y, defined, p) {
1712
1739
  curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
1713
1740
  }
1714
1741
  class CatmullRom {
1715
- constructor(context, alpha = .5, startPoint) {
1742
+ constructor(context) {
1743
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1744
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1716
1745
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1717
1746
  }
1718
1747
  areaStart() {
@@ -1766,7 +1795,8 @@ class CatmullRom {
1766
1795
  }
1767
1796
  }
1768
1797
  function commonGenCatmullRomSegments(type, cons) {
1769
- return function (points, alpha, params = {}) {
1798
+ return function (points, alpha) {
1799
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1770
1800
  const {
1771
1801
  direction: direction,
1772
1802
  startPoint: startPoint
@@ -1775,13 +1805,15 @@ function commonGenCatmullRomSegments(type, cons) {
1775
1805
  if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
1776
1806
  const segContext = genSegContext(type, direction, points),
1777
1807
  gatmullRom = new cons(segContext, alpha, startPoint);
1778
- return genCurveSegments(gatmullRom, points, 2), segContext;
1808
+ return genCurveSegments(gatmullRom, points), segContext;
1779
1809
  };
1780
1810
  }
1781
1811
  const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
1782
1812
 
1783
1813
  class CatmullRomClosed {
1784
- constructor(context, alpha = .5, startPoint) {
1814
+ constructor(context) {
1815
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1816
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1785
1817
  this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1786
1818
  }
1787
1819
  areaStart() {
@@ -2091,7 +2123,11 @@ class CustomPath2D extends CurvePath {
2091
2123
  cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
2092
2124
  }
2093
2125
  closePathTransform() {}
2094
- _runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
2126
+ _runCommandStrList(commandStrList) {
2127
+ let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2128
+ let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2129
+ let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2130
+ let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
2095
2131
  let current,
2096
2132
  tempX,
2097
2133
  tempY,
@@ -2165,7 +2201,11 @@ class CustomPath2D extends CurvePath {
2165
2201
  previous = current;
2166
2202
  }
2167
2203
  }
2168
- _runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
2204
+ _runCommandList(commandList) {
2205
+ let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2206
+ let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2207
+ let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
2208
+ let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
2169
2209
  if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
2170
2210
  const current = commandList[i].slice();
2171
2211
  switch (current[0]) {
@@ -2837,7 +2877,9 @@ function getScaledStroke(context, width, dpr) {
2837
2877
  scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
2838
2878
  return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
2839
2879
  }
2840
- function createColor(context, c, params, offsetX = 0, offsetY = 0) {
2880
+ function createColor(context, c, params) {
2881
+ let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2882
+ let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
2841
2883
  var _a, _b, _c, _d;
2842
2884
  if (!c || !0 === c) return "black";
2843
2885
  let result, color;
@@ -2976,7 +3018,8 @@ function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter)
2976
3018
  }
2977
3019
  return needTestLetter && (index = testLetter(desc, index)), index;
2978
3020
  }
2979
- function testLetter(string, index, negativeWrongMatch = !1) {
3021
+ function testLetter(string, index) {
3022
+ let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
2980
3023
  let i = index;
2981
3024
  for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
2982
3025
  return i;
@@ -2986,7 +3029,8 @@ function testLetter2(string, index) {
2986
3029
  for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
2987
3030
  return i + 1;
2988
3031
  }
2989
- function measureTextCanvas(text, character, mode = "actual") {
3032
+ function measureTextCanvas(text, character) {
3033
+ let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
2990
3034
  var _a;
2991
3035
  if ("" === text) return {
2992
3036
  ascent: 0,
@@ -3059,9 +3103,10 @@ let ATextMeasure = class {
3059
3103
  }
3060
3104
  return metrics;
3061
3105
  }
3062
- estimate(text, {
3063
- fontSize = DefaultTextAttribute.fontSize
3064
- }) {
3106
+ estimate(text, _ref) {
3107
+ let {
3108
+ fontSize = DefaultTextAttribute.fontSize
3109
+ } = _ref;
3065
3110
  let eCharLen = 0,
3066
3111
  cCharLen = 0;
3067
3112
  for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
@@ -3372,7 +3417,8 @@ let ATextMeasure = class {
3372
3417
  });
3373
3418
  });
3374
3419
  }
3375
- clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
3420
+ clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
3421
+ let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
3376
3422
  if ("" === suffix) return this.clipText(text, options, width, wordBreak);
3377
3423
  if (0 === text.length) return {
3378
3424
  str: "",
@@ -3818,7 +3864,7 @@ class DefaultCanvasAllocate {
3818
3864
  get length() {
3819
3865
  return this.pools.length;
3820
3866
  }
3821
- release(...params) {
3867
+ release() {
3822
3868
  this.pools = [];
3823
3869
  }
3824
3870
  }
@@ -4018,7 +4064,8 @@ let DefaultGraphicUtil = class {
4018
4064
  bindTextMeasure(tm) {
4019
4065
  this._textMeasure && "DefaultTextMeasureContribution" !== tm.id || (this._textMeasure = tm), this._textMeasureMap.has(tm.id) || this._textMeasureMap.set(tm.id, tm);
4020
4066
  }
4021
- measureText(text, tc, method = "native") {
4067
+ measureText(text, tc) {
4068
+ let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
4022
4069
  var _a;
4023
4070
  this.configure(this.global, this.global.env);
4024
4071
  const m = this.global.measureTextMethod;
@@ -4201,7 +4248,8 @@ class Theme {
4201
4248
  for (; group.parent;) if ((group = group.parent).theme) return group;
4202
4249
  return null;
4203
4250
  }
4204
- applyTheme(group, pt, force = !1) {
4251
+ applyTheme(group, pt) {
4252
+ let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
4205
4253
  if (this.dirty) {
4206
4254
  const parentGroup = this.getParentWithTheme(group);
4207
4255
  if (parentGroup) {
@@ -4300,7 +4348,8 @@ class Node extends EventEmitter {
4300
4348
  constructor() {
4301
4349
  super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
4302
4350
  }
4303
- forEachChildren(cb, reverse = !1) {
4351
+ forEachChildren(cb) {
4352
+ let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4304
4353
  if (reverse) {
4305
4354
  let child = this._lastChild,
4306
4355
  i = 0;
@@ -4317,7 +4366,8 @@ class Node extends EventEmitter {
4317
4366
  }
4318
4367
  }
4319
4368
  }
4320
- forEachChildrenAsync(cb, reverse = !1) {
4369
+ forEachChildrenAsync(cb) {
4370
+ let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4321
4371
  return __awaiter$3(this, void 0, void 0, function* () {
4322
4372
  if (reverse) {
4323
4373
  let child = this._lastChild,
@@ -4341,12 +4391,13 @@ class Node extends EventEmitter {
4341
4391
  forEach(cb) {
4342
4392
  return this.forEachChildren(cb);
4343
4393
  }
4344
- appendChild(node, highPerformance = !0) {
4394
+ appendChild(node) {
4395
+ let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
4345
4396
  if (this._uid === node._uid) return null;
4346
4397
  if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
4347
4398
  return node.parent && node.parent.removeChild(node), node.parent = this, this._lastChild ? (this._lastChild._next = node, node._prev = this._lastChild, this._lastChild = node) : (this._firstChild = this._lastChild = node, node._prev = node._next = null), this._idMap || (this._idMap = new Map()), this._idMap.set(node._uid, node), this.setCount(node.count), this._structEdit = !0, node;
4348
4399
  }
4349
- appendChildArrHighPerformance(nodes, replace = !1) {
4400
+ appendChildArrHighPerformance(nodes) {
4350
4401
  return console.error("暂不支持该函数"), nodes;
4351
4402
  }
4352
4403
  insertBefore(newNode, referenceNode) {
@@ -4414,7 +4465,8 @@ class Node extends EventEmitter {
4414
4465
  replaceChild(newChild, oldChild) {
4415
4466
  throw new Error("暂不支持");
4416
4467
  }
4417
- find(callback, deep = !1) {
4468
+ find(callback) {
4469
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4418
4470
  let target = null;
4419
4471
  return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
4420
4472
  if (child.isContainer) {
@@ -4424,7 +4476,8 @@ class Node extends EventEmitter {
4424
4476
  return !1;
4425
4477
  }), target;
4426
4478
  }
4427
- findAll(callback, deep = !1) {
4479
+ findAll(callback) {
4480
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4428
4481
  let nodes = [];
4429
4482
  return this.forEachChildren((node, index) => {
4430
4483
  node !== this && callback(node, index) && nodes.push(node);
@@ -4453,7 +4506,8 @@ class Node extends EventEmitter {
4453
4506
  getElementsByType(type) {
4454
4507
  return this.findAll(node => node.type === type, !0);
4455
4508
  }
4456
- getChildByName(name, deep = !1) {
4509
+ getChildByName(name) {
4510
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
4457
4511
  return this.find(node => node.name === name, deep);
4458
4512
  }
4459
4513
  getChildAt(idx) {
@@ -4572,7 +4626,10 @@ class Node extends EventEmitter {
4572
4626
  removeAllListeners() {
4573
4627
  return this.removeAllEventListeners();
4574
4628
  }
4575
- dispatchEvent(event, ...args) {
4629
+ dispatchEvent(event) {
4630
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4631
+ args[_key - 1] = arguments[_key];
4632
+ }
4576
4633
  return super.emit(event.type, event, ...args), !event.defaultPrevented;
4577
4634
  }
4578
4635
  emit(event, data) {
@@ -4967,7 +5024,8 @@ class SquareSymbol extends BaseSymbol {
4967
5024
  }
4968
5025
  var square$1 = new SquareSymbol();
4969
5026
 
4970
- function trianglUpOffset(ctx, r, x, y, offset = 0) {
5027
+ function trianglUpOffset(ctx, r, x, y) {
5028
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
4971
5029
  return ctx.moveTo(x + r + 2 * offset, r + y + offset), ctx.lineTo(x - r - 2 * offset, r + y + offset), ctx.lineTo(x, y - r - 2 * offset), ctx.closePath(), !0;
4972
5030
  }
4973
5031
  class TriangleUpSymbol extends BaseSymbol {
@@ -5113,7 +5171,8 @@ class TriangleLeftSymbol extends BaseSymbol {
5113
5171
  }
5114
5172
  var triangleLeft = new TriangleLeftSymbol();
5115
5173
 
5116
- function trianglRightOffset(ctx, r, x, y, offset = 0) {
5174
+ function trianglRightOffset(ctx, r, x, y) {
5175
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
5117
5176
  return ctx.moveTo(x - r - offset, r + y + 2 * offset), ctx.lineTo(r + x + 2 * offset, y), ctx.lineTo(x - r - offset, y - r - 2 * offset), ctx.closePath(), !0;
5118
5177
  }
5119
5178
  class TriangleRightSymbol extends BaseSymbol {
@@ -5129,7 +5188,8 @@ class TriangleRightSymbol extends BaseSymbol {
5129
5188
  }
5130
5189
  var triangleRight = new TriangleRightSymbol();
5131
5190
 
5132
- function trianglDownOffset(ctx, r, x, y, offset = 0) {
5191
+ function trianglDownOffset(ctx, r, x, y) {
5192
+ let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
5133
5193
  return ctx.moveTo(x - r - 2 * offset, y - r - offset), ctx.lineTo(x + r + 2 * offset, y - r - offset), ctx.lineTo(x, y + r + 2 * offset), ctx.closePath(), !0;
5134
5194
  }
5135
5195
  class TriangleDownSymbol extends BaseSymbol {
@@ -5346,7 +5406,8 @@ var rect = new RectSymbol();
5346
5406
 
5347
5407
  const tempBounds = new AABBBounds();
5348
5408
  class CustomSymbolClass {
5349
- constructor(type, path, isSvg = !1) {
5409
+ constructor(type, path) {
5410
+ let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
5350
5411
  this.pathStr = "", this.type = type, isArray(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
5351
5412
  }
5352
5413
  drawOffset(ctx, size, x, y, offset, z, cb) {
@@ -5368,9 +5429,10 @@ class CustomSymbolClass {
5368
5429
  bounds(size, bounds) {
5369
5430
  if (size = this.parseSize(size), this.isSvg) {
5370
5431
  if (!this.svgCache) return;
5371
- return bounds.clear(), void this.svgCache.forEach(({
5372
- path: path
5373
- }) => {
5432
+ return bounds.clear(), void this.svgCache.forEach(_ref => {
5433
+ let {
5434
+ path: path
5435
+ } = _ref;
5374
5436
  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);
5375
5437
  });
5376
5438
  }
@@ -5426,7 +5488,8 @@ function findClosingIndex(xmlData, str, i, errMsg) {
5426
5488
  if (-1 === closingIndex) throw new Error(errMsg);
5427
5489
  return closingIndex + str.length - 1;
5428
5490
  }
5429
- function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
5491
+ function tagExpWithClosingIndex(xmlData, i) {
5492
+ let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
5430
5493
  let attrBoundary,
5431
5494
  tagExp = "";
5432
5495
  for (let index = i; index < xmlData.length; index++) {
@@ -5444,7 +5507,8 @@ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
5444
5507
  tagExp += ch;
5445
5508
  }
5446
5509
  }
5447
- function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
5510
+ function readTagExp(xmlData, i, removeNSPrefix) {
5511
+ let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
5448
5512
  const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
5449
5513
  if (!result) return;
5450
5514
  let tagExp = result.data;
@@ -5606,7 +5670,8 @@ undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator)
5606
5670
  step((generator = generator.apply(thisArg, _arguments || [])).next());
5607
5671
  });
5608
5672
  };
5609
- function boundStroke(bounds, halfW, miter, pad = 0) {
5673
+ function boundStroke(bounds, halfW, miter) {
5674
+ let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
5610
5675
  return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
5611
5676
  }
5612
5677
  function miterAdjustment(miter, strokeWidth) {
@@ -5791,7 +5856,7 @@ class DefaultMatrixAllocate {
5791
5856
  get length() {
5792
5857
  return this.pools.length;
5793
5858
  }
5794
- release(...params) {
5859
+ release() {
5795
5860
  this.pools = [];
5796
5861
  }
5797
5862
  }
@@ -5819,7 +5884,7 @@ class DefaultMat4Allocate {
5819
5884
  get length() {
5820
5885
  return this.pools.length;
5821
5886
  }
5822
- release(...params) {
5887
+ release() {
5823
5888
  this.pools = [];
5824
5889
  }
5825
5890
  }
@@ -5854,7 +5919,8 @@ let EmptyContext2d = class {
5854
5919
  getContext() {
5855
5920
  throw new Error("不支持getContext");
5856
5921
  }
5857
- setTransformForCurrent(force = !1) {
5922
+ setTransformForCurrent() {
5923
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
5858
5924
  !force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
5859
5925
  }
5860
5926
  get currentMatrix() {
@@ -5875,7 +5941,8 @@ let EmptyContext2d = class {
5875
5941
  highPerformanceRestore() {
5876
5942
  this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
5877
5943
  }
5878
- rotate(rad, setTransform = !0) {
5944
+ rotate(rad) {
5945
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5879
5946
  this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
5880
5947
  }
5881
5948
  save() {
@@ -5886,41 +5953,55 @@ let EmptyContext2d = class {
5886
5953
  const matrix = this.cloneMatrix(this.matrix);
5887
5954
  this.stack.push(matrix);
5888
5955
  }
5889
- scale(sx, sy, setTransform = !0) {
5956
+ scale(sx, sy) {
5957
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5890
5958
  this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
5891
5959
  }
5892
- setScale(sx, sy, setTransform = !0) {
5960
+ setScale(sx, sy) {
5961
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5893
5962
  this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
5894
5963
  }
5895
- scalePoint(sx, sy, px, py, setTransform = !0) {
5964
+ scalePoint(sx, sy, px, py) {
5965
+ let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
5896
5966
  this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
5897
5967
  }
5898
- setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
5968
+ setTransform(a, b, c, d, e, f) {
5969
+ let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
5970
+ let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
5899
5971
  this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
5900
5972
  }
5901
- setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
5973
+ setTransformFromMatrix(matrix) {
5974
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5975
+ let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
5902
5976
  this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
5903
5977
  }
5904
- resetTransform(setTransform = !0, dpr = this.dpr) {
5978
+ resetTransform() {
5979
+ let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
5980
+ let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
5905
5981
  this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
5906
5982
  }
5907
- transform(a, b, c, d, e, f, setTransform = !0) {
5983
+ transform(a, b, c, d, e, f) {
5984
+ let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
5908
5985
  this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
5909
5986
  }
5910
5987
  transformFromMatrix(matrix, setTransform) {
5911
5988
  this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
5912
5989
  }
5913
- translate(x, y, setTransform = !0) {
5990
+ translate(x, y) {
5991
+ let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
5914
5992
  this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
5915
5993
  }
5916
- rotateDegrees(deg, setTransform = !0) {
5994
+ rotateDegrees(deg) {
5995
+ let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
5917
5996
  const rad = deg * Math.PI / 180;
5918
5997
  this.rotate(rad, setTransform);
5919
5998
  }
5920
- rotateAbout(rad, x, y, setTransform = !0) {
5999
+ rotateAbout(rad, x, y) {
6000
+ let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
5921
6001
  this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
5922
6002
  }
5923
- rotateDegreesAbout(deg, x, y, setTransform = !0) {
6003
+ rotateDegreesAbout(deg, x, y) {
6004
+ let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
5924
6005
  this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
5925
6006
  }
5926
6007
  beginPath() {
@@ -6014,16 +6095,19 @@ let EmptyContext2d = class {
6014
6095
  setTextStyleWithoutAlignBaseline(params, defaultParams) {}
6015
6096
  setTextStyle(params, defaultParams) {}
6016
6097
  draw() {}
6017
- clearMatrix(setTransform = !0, dpr = this.dpr) {
6098
+ clearMatrix() {
6099
+ let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
6100
+ let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
6018
6101
  this.setTransformFromMatrix(initMatrix, setTransform, dpr);
6019
6102
  }
6020
6103
  setClearMatrix(a, b, c, d, e, f) {
6021
6104
  this._clearMatrix.setValue(a, b, c, d, e, f);
6022
6105
  }
6023
- onlyTranslate(dpr = this.dpr) {
6106
+ onlyTranslate() {
6107
+ let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
6024
6108
  return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
6025
6109
  }
6026
- release(...params) {
6110
+ release() {
6027
6111
  this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
6028
6112
  }
6029
6113
  };
@@ -6034,7 +6118,9 @@ var ColorType;
6034
6118
  ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
6035
6119
  }(ColorType || (ColorType = {}));
6036
6120
  class ColorStore {
6037
- static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
6121
+ static Get(str) {
6122
+ let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
6123
+ let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
6038
6124
  if (size === ColorType.Color1) {
6039
6125
  const color = ColorStore.store1[str];
6040
6126
  if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
@@ -6062,7 +6148,8 @@ class ColorStore {
6062
6148
  }
6063
6149
  ColorStore.store255 = {}, ColorStore.store1 = {};
6064
6150
 
6065
- function colorArrayToString(color, alphaChannel = !1) {
6151
+ function colorArrayToString(color) {
6152
+ let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6066
6153
  return Array.isArray(color) && isNumber(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
6067
6154
  }
6068
6155
  function interpolateColor(from, to, ratio, alphaChannel, cb) {
@@ -6246,7 +6333,8 @@ class Graphic extends Node {
6246
6333
  get globalTransMatrix() {
6247
6334
  return this.tryUpdateGlobalTransMatrix(!0);
6248
6335
  }
6249
- constructor(params = {}) {
6336
+ constructor() {
6337
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6250
6338
  var _a;
6251
6339
  super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
6252
6340
  }
@@ -6266,7 +6354,8 @@ class Graphic extends Node {
6266
6354
  set2dMode() {
6267
6355
  this.in3dMode = !1;
6268
6356
  }
6269
- getOffsetXY(attr, includeScroll = !1) {
6357
+ getOffsetXY(attr) {
6358
+ let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6270
6359
  var _a, _b;
6271
6360
  const {
6272
6361
  dx = attr.dx,
@@ -6377,7 +6466,7 @@ class Graphic extends Node {
6377
6466
  const b = this.AABBBounds;
6378
6467
  return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this._globalAABBBounds.empty() || this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
6379
6468
  }
6380
- tryUpdateGlobalTransMatrix(clearTag = !0) {
6469
+ tryUpdateGlobalTransMatrix() {
6381
6470
  if (this._globalTransMatrix) {
6382
6471
  if (this.parent) {
6383
6472
  const m = this.parent.globalTransMatrix;
@@ -6389,7 +6478,8 @@ class Graphic extends Node {
6389
6478
  shouldUpdateGlobalMatrix() {
6390
6479
  return !0;
6391
6480
  }
6392
- tryUpdateLocalTransMatrix(clearTag = !0) {
6481
+ tryUpdateLocalTransMatrix() {
6482
+ let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
6393
6483
  return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
6394
6484
  }
6395
6485
  shouldUpdateAABBBounds() {
@@ -6429,17 +6519,24 @@ class Graphic extends Node {
6429
6519
  setWidthHeightWithoutTransform(aabbBounds) {
6430
6520
  this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
6431
6521
  }
6432
- setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context, ignorePriority) {
6522
+ setAttributesAndPreventAnimate(params) {
6523
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6524
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6525
+ let ignorePriority = arguments.length > 3 ? arguments[3] : undefined;
6433
6526
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
6434
6527
  (animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
6435
6528
  animate.preventAttr(key);
6436
6529
  });
6437
6530
  });
6438
6531
  }
6439
- setAttributes(params, forceUpdateTag = !1, context) {
6532
+ setAttributes(params) {
6533
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6534
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6440
6535
  params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
6441
6536
  }
6442
- _setAttributes(params, forceUpdateTag = !1, context) {
6537
+ _setAttributes(params) {
6538
+ let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6539
+ let context = arguments.length > 2 ? arguments[2] : undefined;
6443
6540
  const keys = Object.keys(params);
6444
6541
  for (let i = 0; i < keys.length; i++) {
6445
6542
  const key = keys[i];
@@ -6454,14 +6551,16 @@ class Graphic extends Node {
6454
6551
  }, this.attribute, key, context);
6455
6552
  params ? this._setAttributes(params, forceUpdateTag, context) : isNil(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
6456
6553
  }
6457
- needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
6554
+ needUpdateTags(keys) {
6555
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
6458
6556
  for (let i = 0; i < k.length; i++) {
6459
6557
  const attrKey = k[i];
6460
6558
  if (-1 !== keys.indexOf(attrKey)) return !0;
6461
6559
  }
6462
6560
  return !1;
6463
6561
  }
6464
- needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
6562
+ needUpdateTag(key) {
6563
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
6465
6564
  for (let i = 0; i < k.length; i++) {
6466
6565
  if (key === k[i]) return !0;
6467
6566
  }
@@ -6617,7 +6716,8 @@ class Graphic extends Node {
6617
6716
  newNormalAttrs[key] = this.getNormalAttribute(key);
6618
6717
  }), this.normalAttrs = newNormalAttrs;
6619
6718
  }
6620
- stopStateAnimates(type = "end") {
6719
+ stopStateAnimates() {
6720
+ let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
6621
6721
  this.animates && this.animates.forEach(animate => {
6622
6722
  animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
6623
6723
  });
@@ -6781,7 +6881,8 @@ class Graphic extends Node {
6781
6881
  var _a;
6782
6882
  return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
6783
6883
  }
6784
- onSetStage(cb, immediate = !1) {
6884
+ onSetStage(cb) {
6885
+ let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6785
6886
  this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
6786
6887
  }
6787
6888
  attachShadow(shadowRoot) {
@@ -6802,7 +6903,8 @@ class Graphic extends Node {
6802
6903
  createPathProxy(path) {
6803
6904
  return isString(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
6804
6905
  }
6805
- loadImage(image, background = !1) {
6906
+ loadImage(image) {
6907
+ let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
6806
6908
  if (!image || background && backgroundNotImage(image)) return;
6807
6909
  const url = image;
6808
6910
  this.resources || (this.resources = new Map());
@@ -6832,7 +6934,8 @@ class Graphic extends Node {
6832
6934
  animate.stop();
6833
6935
  });
6834
6936
  }
6835
- stopAnimates(stopChildren = !1) {
6937
+ stopAnimates() {
6938
+ let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
6836
6939
  this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
6837
6940
  c.stopAnimates(stopChildren);
6838
6941
  });
@@ -6980,7 +7083,8 @@ class Group extends Graphic {
6980
7083
  _updateChildToStage(child) {
6981
7084
  return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
6982
7085
  }
6983
- appendChild(node, addStage = !0) {
7086
+ appendChild(node) {
7087
+ let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
6984
7088
  const data = super.appendChild(node);
6985
7089
  return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
6986
7090
  }
@@ -6997,7 +7101,8 @@ class Group extends Graphic {
6997
7101
  const data = super.removeChild(child);
6998
7102
  return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
6999
7103
  }
7000
- removeAllChild(deep = !1) {
7104
+ removeAllChild() {
7105
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
7001
7106
  this.forEachChildren(child => {
7002
7107
  this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
7003
7108
  }), super.removeAllChild(), this.addUpdateBoundTag();
@@ -7017,7 +7122,8 @@ class Group extends Graphic {
7017
7122
  g.isContainer && g.addUpdateGlobalPositionTag();
7018
7123
  });
7019
7124
  }
7020
- tryUpdateGlobalTransMatrix(clearTag = !0) {
7125
+ tryUpdateGlobalTransMatrix() {
7126
+ let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
7021
7127
  if (this.shouldUpdateGlobalMatrix()) {
7022
7128
  if (this._globalTransMatrix) {
7023
7129
  if (this.parent) {
@@ -7091,7 +7197,8 @@ class Layer extends Group {
7091
7197
  zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
7092
7198
  }), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
7093
7199
  }
7094
- combineSubLayer(removeIncrementalKey = !0) {
7200
+ combineSubLayer() {
7201
+ let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
7095
7202
  const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
7096
7203
  this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
7097
7204
  l.group && (l.group.incremental = 0);
@@ -7200,9 +7307,10 @@ let DefaultLayerService = DefaultLayerService_1 = class {
7200
7307
  let layerHandler;
7201
7308
  return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
7202
7309
  }
7203
- createLayer(stage, options = {
7204
- main: !1
7205
- }) {
7310
+ createLayer(stage) {
7311
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
7312
+ main: !1
7313
+ };
7206
7314
  var _a;
7207
7315
  this.tryInit();
7208
7316
  let layerMode = this.getRecommendedLayerType(options.layerMode);
@@ -7443,7 +7551,8 @@ const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContrib
7443
7551
  function textDrawOffsetX(textAlign, width) {
7444
7552
  return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
7445
7553
  }
7446
- function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
7554
+ function textLayoutOffsetY(baseline, lineHeight, fontSize) {
7555
+ let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
7447
7556
  return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
7448
7557
  }
7449
7558
 
@@ -7657,9 +7766,10 @@ const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
7657
7766
 
7658
7767
  const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
7659
7768
  class Circle extends Graphic {
7660
- constructor(params = {
7661
- radius: 1
7662
- }) {
7769
+ constructor() {
7770
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
7771
+ radius: 1
7772
+ };
7663
7773
  super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
7664
7774
  }
7665
7775
  isValid() {
@@ -7741,7 +7851,10 @@ class CanvasTextLayout {
7741
7851
  } else bbox.yOffset = -bbox.height;
7742
7852
  return bbox;
7743
7853
  }
7744
- GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
7854
+ GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
7855
+ let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
7856
+ let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
7857
+ let params = arguments.length > 6 ? arguments[6] : undefined;
7745
7858
  const {
7746
7859
  lineWidth: lineWidth,
7747
7860
  suffixPosition = "end",
@@ -7864,10 +7977,11 @@ class Text extends Graphic {
7864
7977
  get isMultiLine() {
7865
7978
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
7866
7979
  }
7867
- constructor(params = {
7868
- text: "",
7869
- fontSize: 16
7870
- }) {
7980
+ constructor() {
7981
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
7982
+ text: "",
7983
+ fontSize: 16
7984
+ };
7871
7985
  super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
7872
7986
  }
7873
7987
  isValid() {
@@ -8199,10 +8313,12 @@ class Text extends Graphic {
8199
8313
  var _a;
8200
8314
  return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
8201
8315
  }
8202
- needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
8316
+ needUpdateTags(keys) {
8317
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
8203
8318
  return super.needUpdateTags(keys, k);
8204
8319
  }
8205
- needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
8320
+ needUpdateTag(key) {
8321
+ let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
8206
8322
  return super.needUpdateTag(key, k);
8207
8323
  }
8208
8324
  _interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
@@ -8405,15 +8521,19 @@ const updateBoundsOfSymbolOuterBorder = (attribute, symbolTheme, aabbBounds) =>
8405
8521
 
8406
8522
  const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
8407
8523
  let Symbol$1 = class Symbol extends Graphic {
8408
- constructor(params = {
8409
- symbolType: "circle"
8410
- }) {
8524
+ constructor() {
8525
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
8526
+ symbolType: "circle"
8527
+ };
8411
8528
  super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
8412
8529
  }
8413
8530
  getParsedPath() {
8414
8531
  return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
8415
8532
  }
8416
- getParsedPath2D(x = 0, y = 0, size = 1) {
8533
+ getParsedPath2D() {
8534
+ let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
8535
+ let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
8536
+ let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
8417
8537
  let path = null;
8418
8538
  try {
8419
8539
  path = new Path2D();
@@ -8498,7 +8618,8 @@ function createSymbol(attributes) {
8498
8618
 
8499
8619
  const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
8500
8620
  let Line$1 = class Line extends Graphic {
8501
- constructor(params = {}) {
8621
+ constructor() {
8622
+ let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8502
8623
  super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
8503
8624
  }
8504
8625
  isValid() {
@@ -9236,7 +9357,8 @@ class Wrapper {
9236
9357
  line = new Line(this.frame.left, this[this.directionKey.width], this.y + maxAscent, maxAscent, maxDescent, this.lineBuffer, this.direction, "horizontal" === this.direction ? this.frame.isWidthMax : this.frame.isHeightMax);
9237
9358
  this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
9238
9359
  }
9239
- deal(paragraph, singleLine = !1) {
9360
+ deal(paragraph) {
9361
+ let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
9240
9362
  paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), (0 !== paragraph.text.length || this.newLine) && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
9241
9363
  }
9242
9364
  cut(paragraph, singleLine) {
@@ -10548,7 +10670,9 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
10548
10670
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
10549
10671
 
10550
10672
  const halfPi = pi / 2;
10551
- function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
10673
+ function createRectPath(path, x, y, width, height, rectCornerRadius) {
10674
+ let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
10675
+ let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
10552
10676
  let cornerRadius;
10553
10677
  if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
10554
10678
  const cornerRadiusArr = rectCornerRadius;
@@ -10889,7 +11013,8 @@ class BaseRender {
10889
11013
  doStroke: doStroke
10890
11014
  };
10891
11015
  }
10892
- transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
11016
+ transform(graphic, graphicAttribute, context) {
11017
+ let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
10893
11018
  const {
10894
11019
  x = graphicAttribute.x,
10895
11020
  y = graphicAttribute.y,
@@ -12012,7 +12137,7 @@ class DefaultBoundsAllocate {
12012
12137
  get length() {
12013
12138
  return this.pools.length;
12014
12139
  }
12015
- release(...params) {
12140
+ release() {
12016
12141
  this.pools = [];
12017
12142
  }
12018
12143
  }
@@ -12237,7 +12362,8 @@ function drawPolygon(path, points, x, y) {
12237
12362
  for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
12238
12363
  }
12239
12364
  }
12240
- function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
12365
+ function drawRoundedPolygon(path, points, x, y, cornerRadius) {
12366
+ let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
12241
12367
  var _a;
12242
12368
  if (points.length < 3) return void drawPolygon(path, points, x, y);
12243
12369
  let startI = 0,
@@ -12994,7 +13120,7 @@ let DefaultPluginService = class {
12994
13120
  unRegister(plugin) {
12995
13121
  "onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
12996
13122
  }
12997
- release(...params) {
13123
+ release() {
12998
13124
  this.onStartupFinishedPlugin.forEach(plugin => {
12999
13125
  plugin.deactivate(this);
13000
13126
  }), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
@@ -13141,7 +13267,9 @@ function parseChildMap(graphic, defaultZIndex, reverse) {
13141
13267
  zIdxArray: zIdxArray
13142
13268
  };
13143
13269
  }
13144
- function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
13270
+ function foreach(graphic, defaultZIndex, cb) {
13271
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13272
+ let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
13145
13273
  let needSort = !1;
13146
13274
  if (sort3d) needSort = !0;else {
13147
13275
  let lastZIndex;
@@ -13172,12 +13300,14 @@ function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
13172
13300
  }
13173
13301
  } else graphic.forEachChildren(cb, reverse);
13174
13302
  }
13175
- function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
13303
+ function foreachAsync(graphic, defaultZIndex, cb) {
13304
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13176
13305
  return __awaiter$2(this, void 0, void 0, function* () {
13177
13306
  yield graphic.forEachChildrenAsync(cb, reverse);
13178
13307
  });
13179
13308
  }
13180
- function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
13309
+ function findNextGraphic(graphic, id, defaultZIndex) {
13310
+ let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
13181
13311
  let needSort = !1;
13182
13312
  graphic.forEachChildren((item, i) => {
13183
13313
  const {
@@ -18755,7 +18885,8 @@ class Step {
18755
18885
  getLastProps() {
18756
18886
  return this.prev ? this.prev.props || {} : this.animate.getStartProps();
18757
18887
  }
18758
- setDuration(duration, updateDownstream = !0) {
18888
+ setDuration(duration) {
18889
+ let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18759
18890
  this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
18760
18891
  }
18761
18892
  getDuration() {
@@ -18776,7 +18907,8 @@ class Step {
18776
18907
  } else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
18777
18908
  }), this.interpolateUpdateFunctions = funcs;
18778
18909
  }
18779
- setStartTime(time, updateDownstream = !0) {
18910
+ setStartTime(time) {
18911
+ let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18780
18912
  this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
18781
18913
  }
18782
18914
  getStartTime() {
@@ -18902,7 +19034,8 @@ class DefaultTimeline extends EventEmitter {
18902
19034
  animate.release();
18903
19035
  }), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
18904
19036
  }
18905
- removeAnimate(animate, release = !0) {
19037
+ removeAnimate(animate) {
19038
+ let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
18906
19039
  const node = this.animateMap.get(animate);
18907
19040
  node && (release && (animate._onRemove && animate._onRemove.forEach(cb => cb()), animate.release()), node.prev ? node.prev.next = node.next : this.head = node.next, node.next ? node.next.prev = node.prev : this.tail = node.prev, this.animateMap.delete(animate), this._animateCount--, animate.getStartTime() + animate.getDuration() >= this._totalDuration && this.recalculateTotalDuration());
18908
19041
  }
@@ -18940,7 +19073,10 @@ const defaultTimeline = new DefaultTimeline();
18940
19073
  defaultTimeline.isGlobal = !0;
18941
19074
 
18942
19075
  class Animate {
18943
- constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
19076
+ constructor() {
19077
+ let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
19078
+ let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
19079
+ let slience = arguments.length > 2 ? arguments[2] : undefined;
18944
19080
  this.id = id, this.status = AnimateStatus.INITIAL, this._timeline = timeline, timeline.addAnimate(this), this.slience = slience, this._startTime = 0, this._duration = 0, this._totalDuration = 0, this._loopCount = 0, this._currentLoop = 0, this._bounce = !1, this._firstStep = null, this._lastStep = null, this._startProps = {}, this._endProps = {}, this._preventAttrs = new Set(), this.currentTime = 0, this.interpolateUpdateFunction = null, this.priority = 0;
18945
19081
  }
18946
19082
  getStartProps() {
@@ -18963,7 +19099,9 @@ class Animate {
18963
19099
  this.stop(), this.target.animates.delete(this.id);
18964
19100
  }), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
18965
19101
  }
18966
- to(props, duration = 300, easing = "linear") {
19102
+ to(props) {
19103
+ let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
19104
+ let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
18967
19105
  const step = new Step(AnimateStepType.to, props, duration, easing);
18968
19106
  return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
18969
19107
  }
@@ -18993,7 +19131,9 @@ class Animate {
18993
19131
  this._endProps[key] = currentStep.props[key];
18994
19132
  }), currentStep = currentStep.next;
18995
19133
  }
18996
- from(props, duration = 300, easing = "linear") {
19134
+ from(props) {
19135
+ let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
19136
+ let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
18997
19137
  const step = new Step(AnimateStepType.from, props, duration, easing);
18998
19138
  return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
18999
19139
  }
@@ -19193,10 +19333,12 @@ class DefaultTicker extends EventEmitter {
19193
19333
  getTimelines() {
19194
19334
  return this.timelines;
19195
19335
  }
19196
- initHandler(force = !1) {
19336
+ initHandler() {
19337
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19197
19338
  this.setupTickHandler(force);
19198
19339
  }
19199
- setupTickHandler(force = !1) {
19340
+ setupTickHandler() {
19341
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19200
19342
  if (!force && this.tickerHandler) return !0;
19201
19343
  const handler = new RAFTickHandler();
19202
19344
  return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
@@ -19238,7 +19380,8 @@ class DefaultTicker extends EventEmitter {
19238
19380
  }
19239
19381
  return !1;
19240
19382
  }
19241
- start(force = !1) {
19383
+ start() {
19384
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19242
19385
  if (this.status === STATUS$1.RUNNING) return !1;
19243
19386
  if (!this.tickerHandler) return !1;
19244
19387
  if (!force) {
@@ -19606,17 +19749,22 @@ class AnimateExecutor {
19606
19749
  var _a, _b;
19607
19750
  return void 0 === value ? defaultValue : "function" == typeof value && graphic ? value(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : value;
19608
19751
  }
19609
- executeItem(params, graphic, index = 0, count = 1) {
19752
+ executeItem(params, graphic) {
19753
+ let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
19754
+ let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
19610
19755
  return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
19611
19756
  }
19612
- _executeItem(params, graphic, index = 0, count = 1) {
19757
+ _executeItem(params, graphic) {
19758
+ let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
19759
+ let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
19613
19760
  if (!graphic) return null;
19614
19761
  const isTimeline = ("timeSlices" in params);
19615
19762
  let animate = null;
19616
19763
  const parsedParams = this.parseParams(params, isTimeline);
19617
19764
  return animate = isTimeline ? this.executeTimelineItem(parsedParams, graphic, index, count) : this.executeTypeConfigItem(parsedParams, graphic, index, count), animate && this._trackAnimation(animate), animate;
19618
19765
  }
19619
- stop(type, callEnd = !0) {
19766
+ stop(type) {
19767
+ let callEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
19620
19768
  for (; this._animates.length > 0;) {
19621
19769
  const animate = this._animates.pop();
19622
19770
  !1 === callEnd && (animate.status = AnimateStatus.END), null == animate || animate.stop(type);
@@ -19773,7 +19921,8 @@ class GraphicStateExtension {
19773
19921
  applyUnhighlightState(animationConfig, callback) {
19774
19922
  return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
19775
19923
  }
19776
- stopAnimationState(state, type, deep = !1) {
19924
+ stopAnimationState(state, type) {
19925
+ let deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
19777
19926
  return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
19778
19927
  child.stopAnimationState(state, type, deep);
19779
19928
  }), this;
@@ -19782,7 +19931,8 @@ class GraphicStateExtension {
19782
19931
  const stateManager = this._animationStateManager;
19783
19932
  return stateManager && stateManager.clearState(), this;
19784
19933
  }
19785
- reApplyAnimationState(state, deep = !1) {
19934
+ reApplyAnimationState(state) {
19935
+ let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
19786
19936
  const stateManager = this._animationStateManager;
19787
19937
  return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
19788
19938
  child.reApplyAnimationState(state, deep);
@@ -19794,7 +19944,8 @@ class GraphicStateExtension {
19794
19944
  }
19795
19945
 
19796
19946
  class AnimateExtension {
19797
- getAttributes(final = !1) {
19947
+ getAttributes() {
19948
+ let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19798
19949
  return final && this.finalAttribute ? this.finalAttribute : this.attribute;
19799
19950
  }
19800
19951
  animate(params) {
@@ -19836,20 +19987,24 @@ class AnimateExtension {
19836
19987
  getFinalAttribute() {
19837
19988
  return this.finalAttribute;
19838
19989
  }
19839
- getGraphicAttribute(key, prev = !1) {
19990
+ getGraphicAttribute(key) {
19991
+ let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
19840
19992
  return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
19841
19993
  }
19842
- pauseAnimation(deep = !1) {
19994
+ pauseAnimation() {
19995
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19843
19996
  this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
19844
19997
  child.pauseAnimation(deep);
19845
19998
  });
19846
19999
  }
19847
- resumeAnimation(deep = !1) {
20000
+ resumeAnimation() {
20001
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19848
20002
  this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
19849
20003
  child.resumeAnimation(deep);
19850
20004
  });
19851
20005
  }
19852
- stopAnimation(deep = !1) {
20006
+ stopAnimation() {
20007
+ let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
19853
20008
  this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
19854
20009
  child.stopAnimation(deep);
19855
20010
  });
@@ -20595,8 +20750,8 @@ class LineAxis extends AxisBase {
20595
20750
  let limitLength = limitSize;
20596
20751
  let titleHeight = 0;
20597
20752
  let titleSpacing = 0;
20598
- const axisLineWidth = line && line.visible ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
20599
- const tickLength = tick && tick.visible ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
20753
+ const axisLineWidth = line && line.visible ? ((_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1) : 0;
20754
+ const tickLength = tick && tick.visible ? ((_c = tick.length) !== null && _c !== void 0 ? _c : 4) : 0;
20600
20755
  if (title && title.visible && typeof title.text === 'string') {
20601
20756
  titleHeight = measureTextSize(title.text, title.textStyle, (_e = (_d = this.stage) === null || _d === void 0 ? void 0 : _d.getTheme()) === null || _e === void 0 ? void 0 : _e.text).height;
20602
20757
  const padding = normalizePadding(title.padding);
@@ -24618,6 +24773,24 @@ class CircleAxisGrid extends BaseGrid {
24618
24773
  }
24619
24774
  mixin(CircleAxisGrid, CircleAxisMixin);
24620
24775
 
24776
+ var DataZoomActiveTag;
24777
+ (function (DataZoomActiveTag) {
24778
+ DataZoomActiveTag["startHandler"] = "startHandler";
24779
+ DataZoomActiveTag["endHandler"] = "endHandler";
24780
+ DataZoomActiveTag["middleHandler"] = "middleHandler";
24781
+ DataZoomActiveTag["background"] = "background";
24782
+ })(DataZoomActiveTag || (DataZoomActiveTag = {}));
24783
+ var IDataZoomInteractiveEvent;
24784
+ (function (IDataZoomInteractiveEvent) {
24785
+ IDataZoomInteractiveEvent["stateUpdate"] = "stateUpdate";
24786
+ IDataZoomInteractiveEvent["maskUpdate"] = "maskUpdate";
24787
+ IDataZoomInteractiveEvent["dataZoomUpdate"] = "dataZoomUpdate";
24788
+ })(IDataZoomInteractiveEvent || (IDataZoomInteractiveEvent = {}));
24789
+ var IDataZoomEvent;
24790
+ (function (IDataZoomEvent) {
24791
+ IDataZoomEvent["dataZoomChange"] = "dataZoomChange";
24792
+ })(IDataZoomEvent || (IDataZoomEvent = {}));
24793
+
24621
24794
  const DEFAULT_HANDLER_PATH = 'M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z';
24622
24795
  const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
24623
24796
  orient: 'bottom',
@@ -24735,538 +24908,175 @@ const DEFAULT_HANDLER_ATTR_MAP = {
24735
24908
  }
24736
24909
  };
24737
24910
 
24738
- var DataZoomActiveTag;
24739
- (function (DataZoomActiveTag) {
24740
- DataZoomActiveTag["startHandler"] = "startHandler";
24741
- DataZoomActiveTag["endHandler"] = "endHandler";
24742
- DataZoomActiveTag["middleHandler"] = "middleHandler";
24743
- DataZoomActiveTag["background"] = "background";
24744
- })(DataZoomActiveTag || (DataZoomActiveTag = {}));
24745
-
24746
- function loadDataZoomComponent() {
24747
- loadTagComponent();
24748
- registerRect();
24749
- registerSymbol();
24750
- registerArea();
24751
- registerLine();
24752
- }
24753
-
24754
- const delayMap$1 = {
24755
- debounce: debounce,
24756
- throttle: throttle
24757
- };
24758
- loadDataZoomComponent();
24759
- class DataZoom extends AbstractComponent {
24760
- setPropsFromAttrs() {
24761
- const { start, end, orient, previewData, previewPointsX, previewPointsY, previewPointsX1, previewPointsY1 } = this
24762
- .attribute;
24763
- start && (this.state.start = start);
24764
- end && (this.state.end = end);
24765
- const { width, height } = this.getLayoutAttrFromConfig();
24766
- this._spanCache = this.state.end - this.state.start;
24767
- this._isHorizontal = orient === 'top' || orient === 'bottom';
24768
- this._layoutCache.max = this._isHorizontal ? width : height;
24769
- this._layoutCache.attPos = this._isHorizontal ? 'x' : 'y';
24770
- this._layoutCache.attSize = this._isHorizontal ? 'width' : 'height';
24771
- previewData && (this._previewData = previewData);
24772
- isFunction(previewPointsX) && (this._previewPointsX = previewPointsX);
24773
- isFunction(previewPointsY) && (this._previewPointsY = previewPointsY);
24774
- isFunction(previewPointsX1) && (this._previewPointsX1 = previewPointsX1);
24775
- isFunction(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
24911
+ const isTextOverflow = (componentBoundsLike, textBounds, layout, isHorizontal) => {
24912
+ if (!textBounds) {
24913
+ return false;
24776
24914
  }
24777
- constructor(attributes, options) {
24778
- super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, DataZoom.defaultAttributes, attributes));
24779
- this.name = 'dataZoom';
24780
- this._previewData = [];
24781
- this._activeState = false;
24782
- this._activeCache = {
24783
- startPos: { x: 0, y: 0 },
24784
- lastPos: { x: 0, y: 0 }
24785
- };
24786
- this._layoutCache = {
24787
- attPos: 'x',
24788
- attSize: 'width',
24789
- max: 0
24790
- };
24791
- this.state = {
24792
- start: 0,
24793
- end: 1
24794
- };
24795
- this._statePointToData = state => state;
24796
- this._handleTouchMove = (e) => {
24797
- if (this._activeState) {
24798
- e.preventDefault();
24799
- }
24800
- };
24801
- this._onHandlerPointerDown = (e, tag) => {
24802
- this._clearDragEvents();
24803
- if (tag === 'start') {
24804
- this._activeTag = DataZoomActiveTag.startHandler;
24805
- this._activeItem = this._startHandlerMask;
24806
- }
24807
- else if (tag === 'end') {
24808
- this._activeTag = DataZoomActiveTag.endHandler;
24809
- this._activeItem = this._endHandlerMask;
24810
- }
24811
- else if (tag === 'middleRect') {
24812
- this._activeTag = DataZoomActiveTag.middleHandler;
24813
- this._activeItem = this._middleHandlerRect;
24814
- }
24815
- else if (tag === 'middleSymbol') {
24816
- this._activeTag = DataZoomActiveTag.middleHandler;
24817
- this._activeItem = this._middleHandlerSymbol;
24818
- }
24819
- else if (tag === 'background') {
24820
- this._activeTag = DataZoomActiveTag.background;
24821
- this._activeItem = this._background;
24915
+ if (isHorizontal) {
24916
+ if (layout === 'start') {
24917
+ if (textBounds.x1 < componentBoundsLike.x1) {
24918
+ return true;
24822
24919
  }
24823
- this._activeState = true;
24824
- this._activeCache.startPos = this.eventPosToStagePos(e);
24825
- this._activeCache.lastPos = this.eventPosToStagePos(e);
24826
- const evtTarget = vglobal.env === 'browser' ? vglobal : this.stage;
24827
- const triggers = getEndTriggersOfDrag();
24828
- evtTarget.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24829
- this.addEventListener('pointermove', this._onHandlerPointerMove, {
24830
- capture: true
24831
- });
24832
- triggers.forEach((trigger) => {
24833
- evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
24834
- });
24835
- };
24836
- this._pointerMove = (e) => {
24837
- const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute;
24838
- const pos = this.eventPosToStagePos(e);
24839
- const { attPos, max } = this._layoutCache;
24840
- const dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
24841
- let { start, end } = this.state;
24842
- if (this._activeState) {
24843
- if (this._activeTag === DataZoomActiveTag.middleHandler) {
24844
- this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis);
24845
- }
24846
- else if (this._activeTag === DataZoomActiveTag.startHandler) {
24847
- if (start + dis > end) {
24848
- start = end;
24849
- end = start + dis;
24850
- this._activeTag = DataZoomActiveTag.endHandler;
24851
- }
24852
- else {
24853
- start = start + dis;
24854
- }
24855
- }
24856
- else if (this._activeTag === DataZoomActiveTag.endHandler) {
24857
- if (end + dis < start) {
24858
- end = start;
24859
- start = end + dis;
24860
- this._activeTag = DataZoomActiveTag.startHandler;
24861
- }
24862
- else {
24863
- end = end + dis;
24864
- }
24865
- }
24866
- this._activeCache.lastPos = pos;
24867
- brushSelect && this.renderDragMask();
24868
- }
24869
- start = Math.min(Math.max(start, 0), 1);
24870
- end = Math.min(Math.max(end, 0), 1);
24871
- if (startAttr !== start || endAttr !== end) {
24872
- this.setStateAttr(start, end, true);
24873
- if (realTime) {
24874
- this._dispatchEvent('change', {
24875
- start,
24876
- end,
24877
- tag: this._activeTag
24878
- });
24879
- }
24920
+ }
24921
+ else {
24922
+ if (textBounds.x2 > componentBoundsLike.x2) {
24923
+ return true;
24880
24924
  }
24881
- };
24882
- this._onHandlerPointerMove = this.attribute.delayTime === 0
24883
- ? this._pointerMove
24884
- : delayMap$1[this.attribute.delayType](this._pointerMove, this.attribute.delayTime);
24885
- this._onHandlerPointerUp = (e) => {
24886
- const { start, end, brushSelect, realTime = true } = this.attribute;
24887
- if (this._activeState) {
24888
- if (this._activeTag === DataZoomActiveTag.background) {
24889
- const pos = this.eventPosToStagePos(e);
24890
- this.backgroundDragZoom(this._activeCache.startPos, pos);
24891
- }
24925
+ }
24926
+ }
24927
+ else {
24928
+ if (layout === 'start') {
24929
+ if (textBounds.y1 < componentBoundsLike.y1) {
24930
+ return true;
24892
24931
  }
24893
- this._activeState = false;
24894
- brushSelect && this.renderDragMask();
24895
- this._dispatchEvent('change', {
24896
- start: this.state.start,
24897
- end: this.state.end,
24898
- tag: this._activeTag
24899
- });
24900
- this._clearDragEvents();
24901
- };
24902
- const { position, showDetail } = attributes;
24903
- this._activeCache.startPos = position;
24904
- this._activeCache.lastPos = position;
24905
- if (showDetail === 'auto') {
24906
- this._showText = false;
24907
24932
  }
24908
24933
  else {
24909
- this._showText = showDetail;
24934
+ if (textBounds.y2 > componentBoundsLike.y2) {
24935
+ return true;
24936
+ }
24910
24937
  }
24911
- this.setPropsFromAttrs();
24912
24938
  }
24913
- setAttributes(params, forceUpdateTag) {
24914
- super.setAttributes(params, forceUpdateTag);
24915
- this.setPropsFromAttrs();
24939
+ return false;
24940
+ };
24941
+
24942
+ class DataZoomRenderer {
24943
+ get startHandlerMask() {
24944
+ return this._startHandlerMask;
24916
24945
  }
24917
- bindEvents() {
24918
- if (this.attribute.disableTriggerEvent) {
24919
- this.setAttribute('childrenPickable', false);
24920
- return;
24921
- }
24922
- const { showDetail, brushSelect } = this.attribute;
24923
- if (this._startHandlerMask) {
24924
- this._startHandlerMask.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'start'));
24925
- }
24926
- if (this._endHandlerMask) {
24927
- this._endHandlerMask.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'end'));
24928
- }
24929
- if (this._middleHandlerSymbol) {
24930
- this._middleHandlerSymbol.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'middleSymbol'));
24931
- }
24932
- if (this._middleHandlerRect) {
24933
- this._middleHandlerRect.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'middleRect'));
24934
- }
24935
- const selectedTag = brushSelect ? 'background' : 'middleRect';
24936
- if (this._selectedBackground) {
24937
- this._selectedBackground.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
24938
- }
24939
- if (brushSelect && this._background) {
24940
- this._background.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'background'));
24941
- }
24942
- if (brushSelect && this._previewGroup) {
24943
- this._previewGroup.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'background'));
24944
- }
24945
- if (this._selectedPreviewGroup) {
24946
- this._selectedPreviewGroup.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
24947
- }
24948
- if (showDetail === 'auto') {
24949
- this.addEventListener('pointerenter', this._onHandlerPointerEnter);
24950
- this.addEventListener('pointerleave', this._onHandlerPointerLeave);
24951
- }
24952
- (vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
24953
- passive: false
24954
- });
24946
+ get middleHandlerSymbol() {
24947
+ return this._middleHandlerSymbol;
24955
24948
  }
24956
- dragMaskSize() {
24957
- const { position } = this.attribute;
24958
- const { attPos, max } = this._layoutCache;
24959
- if (this._activeCache.lastPos[attPos] - position[attPos] > max) {
24960
- return max + position[attPos] - this._activeCache.startPos[attPos];
24961
- }
24962
- else if (this._activeCache.lastPos[attPos] - position[attPos] < 0) {
24963
- return position[attPos] - this._activeCache.startPos[attPos];
24964
- }
24965
- return this._activeCache.lastPos[attPos] - this._activeCache.startPos[attPos];
24949
+ get middleHandlerRect() {
24950
+ return this._middleHandlerRect;
24966
24951
  }
24967
- setStateAttr(start, end, shouldRender) {
24968
- const { zoomLock = false, minSpan = 0, maxSpan = 1 } = this.attribute;
24969
- const span = end - start;
24970
- if (span !== this._spanCache && (zoomLock || span < minSpan || span > maxSpan)) {
24971
- return;
24972
- }
24973
- this._spanCache = span;
24974
- this.state.start = start;
24975
- this.state.end = end;
24976
- shouldRender && this.setAttributes({ start, end });
24952
+ get endHandlerMask() {
24953
+ return this._endHandlerMask;
24977
24954
  }
24978
- _clearDragEvents() {
24979
- const evtTarget = vglobal.env === 'browser' ? vglobal : this.stage;
24980
- const triggers = getEndTriggersOfDrag();
24981
- evtTarget.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
24982
- triggers.forEach((trigger) => {
24983
- evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
24984
- });
24985
- this.removeEventListener('pointermove', this._onHandlerPointerMove, {
24986
- capture: true
24987
- });
24955
+ get selectedBackground() {
24956
+ return this._selectedBackground;
24988
24957
  }
24989
- _onHandlerPointerEnter(e) {
24990
- this._showText = true;
24991
- this.renderText();
24958
+ get dragMask() {
24959
+ return this._dragMask;
24992
24960
  }
24993
- _onHandlerPointerLeave(e) {
24994
- this._showText = false;
24995
- this.renderText();
24961
+ get startText() {
24962
+ return this._startText;
24996
24963
  }
24997
- backgroundDragZoom(startPos, endPos) {
24998
- const { attPos, max } = this._layoutCache;
24999
- const { position } = this.attribute;
25000
- const startPosInComponent = startPos[attPos] - position[attPos];
25001
- const endPosInComponent = endPos[attPos] - position[attPos];
25002
- const start = Math.min(Math.max(Math.min(startPosInComponent, endPosInComponent) / max, 0), 1);
25003
- const end = Math.min(Math.max(Math.max(startPosInComponent, endPosInComponent) / max, 0), 1);
25004
- if (Math.abs(start - end) < 0.01) {
25005
- this.moveZoomWithMiddle(start);
25006
- }
25007
- else {
25008
- this.setStateAttr(start, end, false);
25009
- }
24964
+ get endText() {
24965
+ return this._endText;
25010
24966
  }
25011
- moveZoomWithMiddle(middle) {
25012
- const currentMiddle = (this.state.start + this.state.end) / 2;
25013
- let offset = middle - currentMiddle;
25014
- if (offset === 0) {
25015
- return;
25016
- }
25017
- else if (offset > 0) {
25018
- if (this.state.end + offset > 1) {
25019
- offset = 1 - this.state.end;
25020
- }
25021
- }
25022
- else if (offset < 0) {
25023
- if (this.state.start + offset < 0) {
25024
- offset = -this.state.start;
25025
- }
25026
- }
25027
- this.setStateAttr(this.state.start + offset, this.state.end + offset, false);
24967
+ get startValue() {
24968
+ return this._startValue;
25028
24969
  }
25029
- renderDragMask() {
25030
- const { dragMaskStyle } = this.attribute;
25031
- const { position, width, height } = this.getLayoutAttrFromConfig();
25032
- if (this._isHorizontal) {
25033
- this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.x : this._activeCache.startPos.x, position.x, position.x + width), y: position.y, width: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
25034
- 0, height }, dragMaskStyle), 'rect');
25035
- }
25036
- else {
25037
- this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.y : this._activeCache.startPos.y, position.y, position.y + height), width, height: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
25038
- 0 }, dragMaskStyle), 'rect');
25039
- }
24970
+ get endValue() {
24971
+ return this._endValue;
25040
24972
  }
25041
- isTextOverflow(componentBoundsLike, textBounds, layout) {
25042
- if (!textBounds) {
25043
- return false;
25044
- }
25045
- if (this._isHorizontal) {
25046
- if (layout === 'start') {
25047
- if (textBounds.x1 < componentBoundsLike.x1) {
25048
- return true;
25049
- }
25050
- }
25051
- else {
25052
- if (textBounds.x2 > componentBoundsLike.x2) {
25053
- return true;
25054
- }
25055
- }
25056
- }
25057
- else {
25058
- if (layout === 'start') {
25059
- if (textBounds.y1 < componentBoundsLike.y1) {
25060
- return true;
25061
- }
25062
- }
25063
- else {
25064
- if (textBounds.y2 > componentBoundsLike.y2) {
25065
- return true;
25066
- }
25067
- }
25068
- }
25069
- return false;
24973
+ set showText(showText) {
24974
+ this._showText = showText;
25070
24975
  }
25071
- setTextAttr(startTextBounds, endTextBounds) {
25072
- var _a, _b, _c, _d, _e, _f, _g, _h;
25073
- const { startTextStyle, endTextStyle } = this.attribute;
25074
- const { formatMethod: startTextFormat } = startTextStyle, restStartTextStyle = __rest(startTextStyle, ["formatMethod"]);
25075
- const { formatMethod: endTextFormat } = endTextStyle, restEndTextStyle = __rest(endTextStyle, ["formatMethod"]);
25076
- const { start, end } = this.state;
25077
- this._startValue = this._statePointToData(start);
25078
- this._endValue = this._statePointToData(end);
25079
- const { position, width, height } = this.getLayoutAttrFromConfig();
25080
- const startTextValue = startTextFormat ? startTextFormat(this._startValue) : this._startValue;
25081
- const endTextValue = endTextFormat ? endTextFormat(this._endValue) : this._endValue;
25082
- const componentBoundsLike = {
25083
- x1: position.x,
25084
- y1: position.y,
25085
- x2: position.x + width,
25086
- y2: position.y + height
25087
- };
25088
- let startTextPosition;
25089
- let endTextPosition;
25090
- let startTextAlignStyle;
25091
- let endTextAlignStyle;
25092
- if (this._isHorizontal) {
25093
- startTextPosition = {
25094
- x: position.x + start * width,
25095
- y: position.y + height / 2
25096
- };
25097
- endTextPosition = {
25098
- x: position.x + end * width,
25099
- y: position.y + height / 2
25100
- };
25101
- startTextAlignStyle = {
25102
- textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'left' : 'right',
25103
- textBaseline: (_b = (_a = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _a === void 0 ? void 0 : _a.textBaseline) !== null && _b !== void 0 ? _b : 'middle'
25104
- };
25105
- endTextAlignStyle = {
25106
- textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'right' : 'left',
25107
- textBaseline: (_d = (_c = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _c === void 0 ? void 0 : _c.textBaseline) !== null && _d !== void 0 ? _d : 'middle'
25108
- };
25109
- }
25110
- else {
25111
- startTextPosition = {
25112
- x: position.x + width / 2,
25113
- y: position.y + start * height
25114
- };
25115
- endTextPosition = {
25116
- x: position.x + width / 2,
25117
- y: position.y + end * height
25118
- };
25119
- startTextAlignStyle = {
25120
- textAlign: (_f = (_e = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _e === void 0 ? void 0 : _e.textAlign) !== null && _f !== void 0 ? _f : 'center',
25121
- textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'top' : 'bottom'
25122
- };
25123
- endTextAlignStyle = {
25124
- textAlign: (_h = (_g = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _g === void 0 ? void 0 : _g.textAlign) !== null && _h !== void 0 ? _h : 'center',
25125
- textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'bottom' : 'top'
25126
- };
25127
- }
25128
- this._startText = this.maybeAddLabel(this._container, merge({}, restStartTextStyle, {
25129
- text: startTextValue,
25130
- x: startTextPosition.x,
25131
- y: startTextPosition.y,
25132
- visible: this._showText,
25133
- pickable: false,
25134
- childrenPickable: false,
25135
- textStyle: startTextAlignStyle
25136
- }), `data-zoom-start-text-${position}`);
25137
- this._endText = this.maybeAddLabel(this._container, merge({}, restEndTextStyle, {
25138
- text: endTextValue,
25139
- x: endTextPosition.x,
25140
- y: endTextPosition.y,
25141
- visible: this._showText,
25142
- pickable: false,
25143
- childrenPickable: false,
25144
- textStyle: endTextAlignStyle
25145
- }), `data-zoom-end-text-${position}`);
24976
+ get background() {
24977
+ return this._background;
25146
24978
  }
25147
- renderText() {
25148
- let startTextBounds = null;
25149
- let endTextBounds = null;
25150
- this.setTextAttr(startTextBounds, endTextBounds);
25151
- startTextBounds = this._startText.AABBBounds;
25152
- endTextBounds = this._endText.AABBBounds;
25153
- this.setTextAttr(startTextBounds, endTextBounds);
25154
- startTextBounds = this._startText.AABBBounds;
25155
- endTextBounds = this._endText.AABBBounds;
25156
- const { x1, x2, y1, y2 } = startTextBounds;
25157
- const { dx: startTextDx = 0, dy: startTextDy = 0 } = this.attribute.startTextStyle;
25158
- if (new Bounds().set(x1, y1, x2, y2).intersects(endTextBounds)) {
25159
- const direction = this.attribute.orient === 'bottom' || this.attribute.orient === 'right' ? -1 : 1;
25160
- if (this._isHorizontal) {
25161
- const boundsYDiff = Math.abs(endTextBounds.y1 - endTextBounds.y2);
25162
- this._startText.setAttribute('dy', startTextDy + direction * (Number.isFinite(boundsYDiff) ? boundsYDiff : 0));
25163
- }
25164
- else {
25165
- const boundsXDiff = Math.abs(endTextBounds.x1 - endTextBounds.x2);
25166
- this._startText.setAttribute('dx', startTextDx + direction * (Number.isFinite(boundsXDiff) ? boundsXDiff : 0));
25167
- }
25168
- }
25169
- else {
25170
- if (this._isHorizontal) {
25171
- this._startText.setAttribute('dy', startTextDy);
25172
- }
25173
- else {
25174
- this._startText.setAttribute('dx', startTextDx);
25175
- }
25176
- }
24979
+ set previewData(previewData) {
24980
+ this._previewData = previewData;
24981
+ }
24982
+ get previewGroup() {
24983
+ return this._previewGroup;
25177
24984
  }
25178
- getLayoutAttrFromConfig() {
24985
+ get selectedPreviewGroup() {
24986
+ return this._selectedPreviewGroup;
24987
+ }
24988
+ set previewPointsX(previewPointsX) {
24989
+ this._previewPointsX = previewPointsX;
24990
+ }
24991
+ set previewPointsY(previewPointsY) {
24992
+ this._previewPointsY = previewPointsY;
24993
+ }
24994
+ set previewPointsX1(previewPointsX1) {
24995
+ this._previewPointsX1 = previewPointsX1;
24996
+ }
24997
+ set previewPointsY1(previewPointsY1) {
24998
+ this._previewPointsY1 = previewPointsY1;
24999
+ }
25000
+ set statePointToData(statePointToData) {
25001
+ this._statePointToData = statePointToData;
25002
+ }
25003
+ _initAttrs(props) {
25004
+ this.attribute = props.attribute;
25005
+ this._isHorizontal = this.attribute.orient === 'top' || this.attribute.orient === 'bottom';
25006
+ const { previewData, previewPointsX, previewPointsY, previewPointsX1, previewPointsY1 } = this
25007
+ .attribute;
25008
+ previewData && (this._previewData = previewData);
25009
+ isFunction(previewPointsX) && (this._previewPointsX = previewPointsX);
25010
+ isFunction(previewPointsY) && (this._previewPointsY = previewPointsY);
25011
+ isFunction(previewPointsX1) && (this._previewPointsX1 = previewPointsX1);
25012
+ isFunction(previewPointsY1) && (this._previewPointsY1 = previewPointsY1);
25013
+ this._getState = props.getState;
25014
+ this._getLayoutAttrFromConfig = props.getLayoutAttrFromConfig;
25015
+ this._getContainer = props.getContainer;
25016
+ }
25017
+ constructor(props) {
25018
+ this._previewData = [];
25019
+ this._statePointToData = state => state;
25020
+ const { showDetail } = props.attribute;
25021
+ this._showText = showDetail === 'auto' ? false : showDetail;
25022
+ this._initAttrs(props);
25023
+ }
25024
+ setAttributes(props) {
25025
+ this._initAttrs(props);
25026
+ }
25027
+ renderDataZoom(onlyStateChange = false) {
25179
25028
  var _a, _b, _c, _d, _e, _f;
25180
- if (this._layoutAttrFromConfig) {
25181
- return this._layoutAttrFromConfig;
25182
- }
25183
- const { position: positionConfig, size, orient, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, backgroundStyle = {} } = this.attribute;
25184
- const { width: widthConfig, height: heightConfig } = size;
25185
- const middleHandlerSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
25186
- let width;
25187
- let height;
25188
- let position;
25189
- if (middleHandlerStyle.visible) {
25190
- if (this._isHorizontal) {
25191
- width = widthConfig;
25192
- height = heightConfig - middleHandlerSize;
25193
- position = {
25194
- x: positionConfig.x,
25195
- y: positionConfig.y + middleHandlerSize
25196
- };
25197
- }
25198
- else {
25199
- width = widthConfig - middleHandlerSize;
25200
- height = heightConfig;
25201
- position = {
25202
- x: positionConfig.x + (orient === 'left' ? middleHandlerSize : 0),
25203
- y: positionConfig.y
25204
- };
25205
- }
25206
- }
25207
- else {
25208
- width = widthConfig;
25209
- height = heightConfig;
25210
- position = positionConfig;
25211
- }
25212
- const startHandlerSize = (_c = startHandlerStyle.size) !== null && _c !== void 0 ? _c : (this._isHorizontal ? height : width);
25213
- const endHandlerSize = (_d = endHandlerStyle.size) !== null && _d !== void 0 ? _d : (this._isHorizontal ? height : width);
25214
- if (startHandlerStyle.visible) {
25215
- if (this._isHorizontal) {
25216
- width -= (startHandlerSize + endHandlerSize) / 2;
25217
- position = {
25218
- x: position.x + startHandlerSize / 2,
25219
- y: position.y
25220
- };
25221
- }
25222
- else {
25223
- height -= (startHandlerSize + endHandlerSize) / 2;
25224
- position = {
25225
- x: position.x,
25226
- y: position.y + startHandlerSize / 2
25227
- };
25228
- }
25029
+ const { backgroundChartStyle = {}, selectedBackgroundChartStyle = {}, brushSelect } = this.attribute;
25030
+ this._renderBackground();
25031
+ ((_a = backgroundChartStyle.line) === null || _a === void 0 ? void 0 : _a.visible) && !onlyStateChange && this._setPreviewAttributes('line', this._getContainer());
25032
+ ((_b = backgroundChartStyle.area) === null || _b === void 0 ? void 0 : _b.visible) && !onlyStateChange && this._setPreviewAttributes('area', this._getContainer());
25033
+ brushSelect && this.renderDragMask();
25034
+ this._renderSelectedBackground();
25035
+ ((_c = selectedBackgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this._setSelectedPreviewClipAttributes('line', this._getContainer());
25036
+ ((_d = selectedBackgroundChartStyle.line) === null || _d === void 0 ? void 0 : _d.visible) && !onlyStateChange && this._setSelectedPreviewAttributes('line');
25037
+ ((_e = selectedBackgroundChartStyle.line) === null || _e === void 0 ? void 0 : _e.visible) && this._setSelectedPreviewClipAttributes('area', this._getContainer());
25038
+ ((_f = selectedBackgroundChartStyle.area) === null || _f === void 0 ? void 0 : _f.visible) && !onlyStateChange && this._setSelectedPreviewAttributes('area');
25039
+ this._renderHandler();
25040
+ if (this._showText) {
25041
+ this.renderText();
25229
25042
  }
25230
- height += (_e = backgroundStyle.lineWidth / 2) !== null && _e !== void 0 ? _e : 1;
25231
- width += (_f = backgroundStyle.lineWidth / 2) !== null && _f !== void 0 ? _f : 1;
25232
- this._layoutAttrFromConfig = {
25233
- position,
25234
- width,
25235
- height
25236
- };
25237
- return this._layoutAttrFromConfig;
25238
25043
  }
25239
- render() {
25240
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
25241
- this._layoutAttrFromConfig = null;
25242
- const { orient, backgroundStyle, backgroundChartStyle = {}, selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, brushSelect, zoomLock } = this.attribute;
25243
- const { start, end } = this.state;
25244
- const { position, width, height } = this.getLayoutAttrFromConfig();
25245
- const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
25246
- const endHandlerMinSize = (_b = endHandlerStyle.triggerMinSize) !== null && _b !== void 0 ? _b : 40;
25247
- const group = this.createOrUpdateChild('dataZoom-container', {}, 'group');
25248
- this._container = group;
25249
- this._background = group.createOrUpdateChild('background', Object.assign(Object.assign({ x: position.x, y: position.y, width,
25250
- height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), { pickable: zoomLock ? false : (_c = backgroundStyle.pickable) !== null && _c !== void 0 ? _c : true }), 'rect');
25251
- ((_d = backgroundChartStyle.line) === null || _d === void 0 ? void 0 : _d.visible) && this.setPreviewAttributes('line', group);
25252
- ((_e = backgroundChartStyle.area) === null || _e === void 0 ? void 0 : _e.visible) && this.setPreviewAttributes('area', group);
25253
- brushSelect && this.renderDragMask();
25044
+ renderDragMask() {
25045
+ const { dragMaskStyle } = this.attribute;
25046
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25047
+ const { start, end } = this._getState();
25254
25048
  if (this._isHorizontal) {
25255
- this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : (_f = selectedBackgroundChartStyle.pickable) !== null && _f !== void 0 ? _f : true }), 'rect');
25049
+ this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height }, dragMaskStyle), 'rect');
25256
25050
  }
25257
25051
  else {
25258
- this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : (_g = selectedBackgroundStyle.pickable) !== null && _g !== void 0 ? _g : true }), 'rect');
25052
+ this._dragMask = this._getContainer().createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height }, dragMaskStyle), 'rect');
25259
25053
  }
25260
- ((_h = selectedBackgroundChartStyle.line) === null || _h === void 0 ? void 0 : _h.visible) && this.setSelectedPreviewAttributes('line', group);
25261
- ((_j = selectedBackgroundChartStyle.area) === null || _j === void 0 ? void 0 : _j.visible) && this.setSelectedPreviewAttributes('area', group);
25054
+ return { start, end };
25055
+ }
25056
+ _renderBackground() {
25057
+ var _a;
25058
+ const { backgroundStyle, brushSelect, zoomLock } = this.attribute;
25059
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25060
+ const group = this._getContainer();
25061
+ this._background = group.createOrUpdateChild('background', Object.assign(Object.assign({ x: position.x, y: position.y, width,
25062
+ height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), { pickable: zoomLock ? false : ((_a = backgroundStyle.pickable) !== null && _a !== void 0 ? _a : true) }), 'rect');
25063
+ }
25064
+ _renderHandler() {
25065
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
25066
+ const { orient, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, zoomLock } = this.attribute;
25067
+ const { start, end } = this._getState();
25068
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25069
+ const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
25070
+ const endHandlerMinSize = (_b = endHandlerStyle.triggerMinSize) !== null && _b !== void 0 ? _b : 40;
25071
+ const group = this._getContainer();
25262
25072
  if (this._isHorizontal) {
25263
25073
  if (middleHandlerStyle.visible) {
25264
- const middleHandlerBackgroundSize = ((_k = middleHandlerStyle.background) === null || _k === void 0 ? void 0 : _k.size) || 10;
25265
- this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_l = middleHandlerStyle.background) === null || _l === void 0 ? void 0 : _l.style), { pickable: zoomLock ? false : (_p = (_o = (_m = middleHandlerStyle.background) === null || _m === void 0 ? void 0 : _m.style) === null || _o === void 0 ? void 0 : _o.pickable) !== null && _p !== void 0 ? _p : true }), 'rect');
25266
- this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_r = (_q = middleHandlerStyle.icon) === null || _q === void 0 ? void 0 : _q.symbolType) !== null && _r !== void 0 ? _r : 'square' }, middleHandlerStyle.icon), { pickable: zoomLock ? false : (_s = middleHandlerStyle.icon.pickable) !== null && _s !== void 0 ? _s : true }), 'symbol');
25074
+ const middleHandlerBackgroundSize = ((_c = middleHandlerStyle.background) === null || _c === void 0 ? void 0 : _c.size) || 10;
25075
+ this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_d = middleHandlerStyle.background) === null || _d === void 0 ? void 0 : _d.style), { pickable: zoomLock ? false : ((_g = (_f = (_e = middleHandlerStyle.background) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.pickable) !== null && _g !== void 0 ? _g : true) }), 'rect');
25076
+ this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_j = (_h = middleHandlerStyle.icon) === null || _h === void 0 ? void 0 : _h.symbolType) !== null && _j !== void 0 ? _j : 'square' }, middleHandlerStyle.icon), { pickable: zoomLock ? false : ((_k = middleHandlerStyle.icon.pickable) !== null && _k !== void 0 ? _k : true) }), 'symbol');
25267
25077
  }
25268
- this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_t = startHandlerStyle.symbolType) !== null && _t !== void 0 ? _t : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), { pickable: zoomLock ? false : (_u = startHandlerStyle.pickable) !== null && _u !== void 0 ? _u : true }), 'symbol');
25269
- this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_v = endHandlerStyle.symbolType) !== null && _v !== void 0 ? _v : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), { pickable: zoomLock ? false : (_w = endHandlerStyle.pickable) !== null && _w !== void 0 ? _w : true }), 'symbol');
25078
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_l = startHandlerStyle.symbolType) !== null && _l !== void 0 ? _l : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), { pickable: zoomLock ? false : ((_m = startHandlerStyle.pickable) !== null && _m !== void 0 ? _m : true) }), 'symbol');
25079
+ this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_o = endHandlerStyle.symbolType) !== null && _o !== void 0 ? _o : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), { pickable: zoomLock ? false : ((_p = endHandlerStyle.pickable) !== null && _p !== void 0 ? _p : true) }), 'symbol');
25270
25080
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
25271
25081
  const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
25272
25082
  const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
@@ -25276,14 +25086,14 @@ class DataZoom extends AbstractComponent {
25276
25086
  }
25277
25087
  else {
25278
25088
  if (middleHandlerStyle.visible) {
25279
- const middleHandlerBackgroundSize = ((_x = middleHandlerStyle.background) === null || _x === void 0 ? void 0 : _x.size) || 10;
25280
- this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_y = middleHandlerStyle.background) === null || _y === void 0 ? void 0 : _y.style), { pickable: zoomLock ? false : (_1 = (_0 = (_z = middleHandlerStyle.background) === null || _z === void 0 ? void 0 : _z.style) === null || _0 === void 0 ? void 0 : _0.pickable) !== null && _1 !== void 0 ? _1 : true }), 'rect');
25089
+ const middleHandlerBackgroundSize = ((_q = middleHandlerStyle.background) === null || _q === void 0 ? void 0 : _q.size) || 10;
25090
+ this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign(Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_r = middleHandlerStyle.background) === null || _r === void 0 ? void 0 : _r.style), { pickable: zoomLock ? false : ((_u = (_t = (_s = middleHandlerStyle.background) === null || _s === void 0 ? void 0 : _s.style) === null || _t === void 0 ? void 0 : _t.pickable) !== null && _u !== void 0 ? _u : true) }), 'rect');
25281
25091
  this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign(Object.assign({ x: orient === 'left'
25282
25092
  ? position.x - middleHandlerBackgroundSize / 2
25283
- : position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_3 = (_2 = middleHandlerStyle.icon) === null || _2 === void 0 ? void 0 : _2.symbolType) !== null && _3 !== void 0 ? _3 : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), { pickable: zoomLock ? false : (_5 = (_4 = middleHandlerStyle.icon) === null || _4 === void 0 ? void 0 : _4.pickable) !== null && _5 !== void 0 ? _5 : true }), 'symbol');
25093
+ : position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_w = (_v = middleHandlerStyle.icon) === null || _v === void 0 ? void 0 : _v.symbolType) !== null && _w !== void 0 ? _w : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), { pickable: zoomLock ? false : ((_y = (_x = middleHandlerStyle.icon) === null || _x === void 0 ? void 0 : _x.pickable) !== null && _y !== void 0 ? _y : true) }), 'symbol');
25284
25094
  }
25285
- this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_6 = startHandlerStyle.symbolType) !== null && _6 !== void 0 ? _6 : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), { pickable: zoomLock ? false : (_7 = startHandlerStyle.pickable) !== null && _7 !== void 0 ? _7 : true }), 'symbol');
25286
- this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_8 = endHandlerStyle.symbolType) !== null && _8 !== void 0 ? _8 : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), { pickable: zoomLock ? false : (_9 = endHandlerStyle.pickable) !== null && _9 !== void 0 ? _9 : true }), 'symbol');
25095
+ this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_z = startHandlerStyle.symbolType) !== null && _z !== void 0 ? _z : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), { pickable: zoomLock ? false : ((_0 = startHandlerStyle.pickable) !== null && _0 !== void 0 ? _0 : true) }), 'symbol');
25096
+ this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_1 = endHandlerStyle.symbolType) !== null && _1 !== void 0 ? _1 : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), { pickable: zoomLock ? false : ((_2 = endHandlerStyle.pickable) !== null && _2 !== void 0 ? _2 : true) }), 'symbol');
25287
25097
  const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
25288
25098
  const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
25289
25099
  const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
@@ -25291,13 +25101,75 @@ class DataZoom extends AbstractComponent {
25291
25101
  this._startHandlerMask = group.createOrUpdateChild('startHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + startHandlerWidth / 2, y: position.y + start * height - startHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
25292
25102
  this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign(Object.assign({ x: position.x + width / 2 + endHandlerWidth / 2, y: position.y + end * height - endHandlerHeight / 2, width: endHandlerHeight, height: endHandlerWidth, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.vertical), { pickable: !zoomLock }), 'rect');
25293
25103
  }
25294
- if (this._showText) {
25295
- this.renderText();
25104
+ }
25105
+ _renderSelectedBackground() {
25106
+ var _a, _b;
25107
+ const { selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, brushSelect, zoomLock } = this.attribute;
25108
+ const { start, end } = this._getState();
25109
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25110
+ const group = this._getContainer();
25111
+ if (this._isHorizontal) {
25112
+ this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : ((_a = selectedBackgroundChartStyle.pickable) !== null && _a !== void 0 ? _a : true) }), 'rect');
25113
+ }
25114
+ else {
25115
+ this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign(Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), { pickable: zoomLock ? false : ((_b = selectedBackgroundStyle.pickable) !== null && _b !== void 0 ? _b : true) }), 'rect');
25116
+ }
25117
+ }
25118
+ _setPreviewAttributes(type, group) {
25119
+ if (!this._previewGroup) {
25120
+ this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false }, 'group');
25121
+ }
25122
+ if (type === 'line') {
25123
+ this._previewLine = this._previewGroup.createOrUpdateChild('previewLine', {}, 'line');
25124
+ }
25125
+ else {
25126
+ this._previewArea = this._previewGroup.createOrUpdateChild('previewArea', { curveType: 'basis' }, 'area');
25127
+ }
25128
+ const { backgroundChartStyle = {} } = this.attribute;
25129
+ type === 'line' &&
25130
+ this._previewLine.setAttributes(Object.assign({ points: this._getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.line));
25131
+ type === 'area' &&
25132
+ this._previewArea.setAttributes(Object.assign({ points: this._getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.area));
25133
+ }
25134
+ _setSelectedPreviewClipAttributes(type, group) {
25135
+ if (!this._selectedPreviewGroupClip) {
25136
+ this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false }, 'group');
25137
+ this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild('selectedPreviewGroup', {}, 'group');
25138
+ }
25139
+ const { start, end } = this._getState();
25140
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25141
+ this._selectedPreviewGroupClip.setAttributes({
25142
+ x: this._isHorizontal ? position.x + start * width : position.x,
25143
+ y: this._isHorizontal ? position.y : position.y + start * height,
25144
+ width: this._isHorizontal ? (end - start) * width : width,
25145
+ height: this._isHorizontal ? height : (end - start) * height,
25146
+ clip: true,
25147
+ pickable: false
25148
+ });
25149
+ this._selectedPreviewGroup.setAttributes({
25150
+ x: -(this._isHorizontal ? position.x + start * width : position.x),
25151
+ y: -(this._isHorizontal ? position.y : position.y + start * height),
25152
+ width: this._isHorizontal ? (end - start) * width : width,
25153
+ height: this._isHorizontal ? height : (end - start) * height,
25154
+ pickable: false
25155
+ });
25156
+ }
25157
+ _setSelectedPreviewAttributes(type) {
25158
+ const { selectedBackgroundChartStyle = {} } = this.attribute;
25159
+ if (type === 'line') {
25160
+ this._selectedPreviewLine = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewLine', {}, 'line');
25161
+ }
25162
+ else {
25163
+ this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewArea', { curveType: 'basis' }, 'area');
25296
25164
  }
25165
+ type === 'line' &&
25166
+ this._selectedPreviewLine.setAttributes(Object.assign({ points: this._getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.line));
25167
+ type === 'area' &&
25168
+ this._selectedPreviewArea.setAttributes(Object.assign({ points: this._getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.area));
25297
25169
  }
25298
- computeBasePoints() {
25170
+ _computeBasePoints() {
25299
25171
  const { orient } = this.attribute;
25300
- const { position, width, height } = this.getLayoutAttrFromConfig();
25172
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25301
25173
  let basePointStart;
25302
25174
  let basePointEnd;
25303
25175
  if (this._isHorizontal) {
@@ -25347,7 +25219,7 @@ class DataZoom extends AbstractComponent {
25347
25219
  basePointEnd
25348
25220
  };
25349
25221
  }
25350
- simplifyPoints(points) {
25222
+ _simplifyPoints(points) {
25351
25223
  var _a;
25352
25224
  const niceCount = 10000;
25353
25225
  if (points.length > niceCount) {
@@ -25356,7 +25228,7 @@ class DataZoom extends AbstractComponent {
25356
25228
  }
25357
25229
  return points;
25358
25230
  }
25359
- getPreviewLinePoints() {
25231
+ _getPreviewLinePoints() {
25360
25232
  let previewPoints = this._previewData.map(d => {
25361
25233
  return {
25362
25234
  x: this._previewPointsX && this._previewPointsX(d),
@@ -25366,11 +25238,11 @@ class DataZoom extends AbstractComponent {
25366
25238
  if (previewPoints.length === 0) {
25367
25239
  return previewPoints;
25368
25240
  }
25369
- previewPoints = this.simplifyPoints(previewPoints);
25370
- const { basePointStart, basePointEnd } = this.computeBasePoints();
25241
+ previewPoints = this._simplifyPoints(previewPoints);
25242
+ const { basePointStart, basePointEnd } = this._computeBasePoints();
25371
25243
  return basePointStart.concat(previewPoints).concat(basePointEnd);
25372
25244
  }
25373
- getPreviewAreaPoints() {
25245
+ _getPreviewAreaPoints() {
25374
25246
  let previewPoints = this._previewData.map(d => {
25375
25247
  return {
25376
25248
  x: this._previewPointsX && this._previewPointsX(d),
@@ -25382,103 +25254,583 @@ class DataZoom extends AbstractComponent {
25382
25254
  if (previewPoints.length === 0) {
25383
25255
  return previewPoints;
25384
25256
  }
25385
- previewPoints = this.simplifyPoints(previewPoints);
25386
- const { basePointStart, basePointEnd } = this.computeBasePoints();
25257
+ previewPoints = this._simplifyPoints(previewPoints);
25258
+ const { basePointStart, basePointEnd } = this._computeBasePoints();
25387
25259
  return basePointStart.concat(previewPoints).concat(basePointEnd);
25388
25260
  }
25389
- setPreviewAttributes(type, group) {
25390
- if (!this._previewGroup) {
25391
- this._previewGroup = group.createOrUpdateChild('previewGroup', { pickable: false }, 'group');
25392
- }
25393
- if (type === 'line') {
25394
- this._previewLine = this._previewGroup.createOrUpdateChild('previewLine', {}, 'line');
25395
- }
25396
- else {
25397
- this._previewArea = this._previewGroup.createOrUpdateChild('previewArea', { curveType: 'basis' }, 'area');
25261
+ renderText() {
25262
+ let startTextBounds = null;
25263
+ let endTextBounds = null;
25264
+ this._setTextAttr(startTextBounds, endTextBounds);
25265
+ if (this._showText) {
25266
+ startTextBounds = this._startText.AABBBounds;
25267
+ endTextBounds = this._endText.AABBBounds;
25268
+ this._setTextAttr(startTextBounds, endTextBounds);
25269
+ startTextBounds = this._startText.AABBBounds;
25270
+ endTextBounds = this._endText.AABBBounds;
25271
+ const { x1, x2, y1, y2 } = startTextBounds;
25272
+ const { dx: startTextDx = 0, dy: startTextDy = 0 } = this.attribute.startTextStyle;
25273
+ if (new Bounds().set(x1, y1, x2, y2).intersects(endTextBounds)) {
25274
+ const direction = this.attribute.orient === 'bottom' || this.attribute.orient === 'right' ? -1 : 1;
25275
+ if (this._isHorizontal) {
25276
+ this._startText.setAttribute('dy', startTextDy + direction * Math.abs(endTextBounds.y1 - endTextBounds.y2));
25277
+ }
25278
+ else {
25279
+ this._startText.setAttribute('dx', startTextDx + direction * Math.abs(endTextBounds.x1 - endTextBounds.x2));
25280
+ }
25281
+ }
25282
+ else {
25283
+ if (this._isHorizontal) {
25284
+ this._startText.setAttribute('dy', startTextDy);
25285
+ }
25286
+ else {
25287
+ this._startText.setAttribute('dx', startTextDx);
25288
+ }
25289
+ }
25398
25290
  }
25399
- const { backgroundChartStyle = {} } = this.attribute;
25400
- type === 'line' &&
25401
- this._previewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.line));
25402
- type === 'area' &&
25403
- this._previewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.area));
25404
25291
  }
25405
- setSelectedPreviewAttributes(type, group) {
25406
- if (!this._selectedPreviewGroupClip) {
25407
- this._selectedPreviewGroupClip = group.createOrUpdateChild('selectedPreviewGroupClip', { pickable: false }, 'group');
25408
- this._selectedPreviewGroup = this._selectedPreviewGroupClip.createOrUpdateChild('selectedPreviewGroup', {}, 'group');
25409
- }
25410
- if (type === 'line') {
25411
- this._selectedPreviewLine = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewLine', {}, 'line');
25292
+ _setTextAttr(startTextBounds, endTextBounds) {
25293
+ var _a, _b, _c, _d, _e, _f, _g, _h;
25294
+ const { startTextStyle, endTextStyle } = this.attribute;
25295
+ const { formatMethod: startTextFormat } = startTextStyle, restStartTextStyle = __rest(startTextStyle, ["formatMethod"]);
25296
+ const { formatMethod: endTextFormat } = endTextStyle, restEndTextStyle = __rest(endTextStyle, ["formatMethod"]);
25297
+ const { start, end } = this._getState();
25298
+ this._startValue = this._statePointToData(start);
25299
+ this._endValue = this._statePointToData(end);
25300
+ const { position, width, height } = this._getLayoutAttrFromConfig();
25301
+ const startTextValue = startTextFormat ? startTextFormat(this._startValue) : this._startValue;
25302
+ const endTextValue = endTextFormat ? endTextFormat(this._endValue) : this._endValue;
25303
+ const componentBoundsLike = {
25304
+ x1: position.x,
25305
+ y1: position.y,
25306
+ x2: position.x + width,
25307
+ y2: position.y + height
25308
+ };
25309
+ let startTextPosition;
25310
+ let endTextPosition;
25311
+ let startTextAlignStyle;
25312
+ let endTextAlignStyle;
25313
+ if (this._isHorizontal) {
25314
+ startTextPosition = {
25315
+ x: position.x + start * width,
25316
+ y: position.y + height / 2
25317
+ };
25318
+ endTextPosition = {
25319
+ x: position.x + end * width,
25320
+ y: position.y + height / 2
25321
+ };
25322
+ startTextAlignStyle = {
25323
+ textAlign: isTextOverflow(componentBoundsLike, startTextBounds, 'start', this._isHorizontal) ? 'left' : 'right',
25324
+ textBaseline: (_b = (_a = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _a === void 0 ? void 0 : _a.textBaseline) !== null && _b !== void 0 ? _b : 'middle'
25325
+ };
25326
+ endTextAlignStyle = {
25327
+ textAlign: isTextOverflow(componentBoundsLike, endTextBounds, 'end', this._isHorizontal) ? 'right' : 'left',
25328
+ textBaseline: (_d = (_c = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _c === void 0 ? void 0 : _c.textBaseline) !== null && _d !== void 0 ? _d : 'middle'
25329
+ };
25412
25330
  }
25413
25331
  else {
25414
- this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewArea', { curveType: 'basis' }, 'area');
25332
+ startTextPosition = {
25333
+ x: position.x + width / 2,
25334
+ y: position.y + start * height
25335
+ };
25336
+ endTextPosition = {
25337
+ x: position.x + width / 2,
25338
+ y: position.y + end * height
25339
+ };
25340
+ startTextAlignStyle = {
25341
+ textAlign: (_f = (_e = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _e === void 0 ? void 0 : _e.textAlign) !== null && _f !== void 0 ? _f : 'center',
25342
+ textBaseline: isTextOverflow(componentBoundsLike, startTextBounds, 'start', this._isHorizontal)
25343
+ ? 'top'
25344
+ : 'bottom'
25345
+ };
25346
+ endTextAlignStyle = {
25347
+ textAlign: (_h = (_g = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _g === void 0 ? void 0 : _g.textAlign) !== null && _h !== void 0 ? _h : 'center',
25348
+ textBaseline: isTextOverflow(componentBoundsLike, endTextBounds, 'end', this._isHorizontal) ? 'bottom' : 'top'
25349
+ };
25415
25350
  }
25416
- const { selectedBackgroundChartStyle = {} } = this.attribute;
25417
- const { start, end } = this.state;
25418
- const { position, width, height } = this.getLayoutAttrFromConfig();
25419
- this._selectedPreviewGroupClip.setAttributes({
25420
- x: this._isHorizontal ? position.x + start * width : position.x,
25421
- y: this._isHorizontal ? position.y : position.y + start * height,
25422
- width: this._isHorizontal ? (end - start) * width : width,
25423
- height: this._isHorizontal ? height : (end - start) * height,
25424
- clip: true,
25425
- pickable: false
25426
- });
25427
- this._selectedPreviewGroup.setAttributes({
25428
- x: -(this._isHorizontal ? position.x + start * width : position.x),
25429
- y: -(this._isHorizontal ? position.y : position.y + start * height),
25430
- width: this._isHorizontal ? (end - start) * width : width,
25431
- height: this._isHorizontal ? height : (end - start) * height,
25432
- pickable: false
25433
- });
25434
- type === 'line' &&
25435
- this._selectedPreviewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.line));
25436
- type === 'area' &&
25437
- this._selectedPreviewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.area));
25351
+ this._startText = this._maybeAddLabel(this._getContainer(), merge({}, restStartTextStyle, {
25352
+ text: startTextValue,
25353
+ x: startTextPosition.x,
25354
+ y: startTextPosition.y,
25355
+ visible: this._showText,
25356
+ pickable: false,
25357
+ childrenPickable: false,
25358
+ textStyle: startTextAlignStyle
25359
+ }), `data-zoom-start-text`);
25360
+ this._endText = this._maybeAddLabel(this._getContainer(), merge({}, restEndTextStyle, {
25361
+ text: endTextValue,
25362
+ x: endTextPosition.x,
25363
+ y: endTextPosition.y,
25364
+ visible: this._showText,
25365
+ pickable: false,
25366
+ childrenPickable: false,
25367
+ textStyle: endTextAlignStyle
25368
+ }), `data-zoom-end-text`);
25438
25369
  }
25439
- maybeAddLabel(container, attributes, name) {
25440
- let labelShape = this.find(node => node.name === name, true);
25370
+ _maybeAddLabel(container, attributes, name) {
25371
+ let labelShape = container.find(node => node.name === name, true);
25441
25372
  if (labelShape) {
25442
25373
  labelShape.setAttributes(attributes);
25443
25374
  }
25444
25375
  else {
25445
25376
  labelShape = new Tag(attributes);
25446
25377
  labelShape.name = name;
25378
+ container.add(labelShape);
25447
25379
  }
25448
- container.add(labelShape);
25449
25380
  return labelShape;
25450
25381
  }
25451
- setStartAndEnd(start, end) {
25452
- const { start: startAttr, end: endAttr } = this.attribute;
25453
- if (isValid(start) && isValid(end) && (start !== this.state.start || end !== this.state.end)) {
25454
- this.state.start = start;
25455
- this.state.end = end;
25456
- if (startAttr !== this.state.start || endAttr !== this.state.end) {
25457
- this.setStateAttr(start, end, true);
25458
- this._dispatchEvent('change', {
25459
- start,
25460
- end,
25382
+ }
25383
+
25384
+ const delayMap$1 = {
25385
+ debounce: debounce,
25386
+ throttle: throttle
25387
+ };
25388
+ class DataZoomInteraction extends EventEmitter {
25389
+ constructor(props) {
25390
+ super();
25391
+ this._activeState = false;
25392
+ this._activeCache = {
25393
+ startPos: { x: 0, y: 0 },
25394
+ lastPos: { x: 0, y: 0 }
25395
+ };
25396
+ this._layoutCache = {
25397
+ attPos: 'x',
25398
+ attSize: 'width',
25399
+ size: 0
25400
+ };
25401
+ this._handleTouchMove = (e) => {
25402
+ if (this._activeState) {
25403
+ e.preventDefault();
25404
+ }
25405
+ };
25406
+ this._onHandlerPointerDown = (e, tag) => {
25407
+ this.clearDragEvents();
25408
+ if (tag === 'start') {
25409
+ this._activeTag = DataZoomActiveTag.startHandler;
25410
+ this._activeItem = this._startHandlerMask;
25411
+ }
25412
+ else if (tag === 'end') {
25413
+ this._activeTag = DataZoomActiveTag.endHandler;
25414
+ this._activeItem = this._endHandlerMask;
25415
+ }
25416
+ else if (tag === 'middleRect') {
25417
+ this._activeTag = DataZoomActiveTag.middleHandler;
25418
+ this._activeItem = this._middleHandlerRect;
25419
+ }
25420
+ else if (tag === 'middleSymbol') {
25421
+ this._activeTag = DataZoomActiveTag.middleHandler;
25422
+ this._activeItem = this._middleHandlerSymbol;
25423
+ }
25424
+ else if (tag === 'background') {
25425
+ this._activeTag = DataZoomActiveTag.background;
25426
+ this._activeItem = this._background;
25427
+ }
25428
+ this._activeState = true;
25429
+ this._activeCache.startPos = this._eventPosToStagePos(e);
25430
+ this._activeCache.lastPos = this._eventPosToStagePos(e);
25431
+ const evtTarget = vglobal.env === 'browser' ? vglobal : this.stage;
25432
+ const triggers = getEndTriggersOfDrag();
25433
+ evtTarget.addEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
25434
+ this.on('pointermove', this._onHandlerPointerMove, {
25435
+ capture: true
25436
+ });
25437
+ triggers.forEach((trigger) => {
25438
+ evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
25439
+ });
25440
+ };
25441
+ this._pointerMove = (e) => {
25442
+ const { brushSelect } = this.attribute;
25443
+ const { position } = this._getLayoutAttrFromConfig();
25444
+ const pos = this._eventPosToStagePos(e);
25445
+ const { attPos, size, attSize } = this._layoutCache;
25446
+ const dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / size;
25447
+ const statePos = (pos[attPos] - position[attPos]) / this._getLayoutAttrFromConfig()[attSize];
25448
+ let { start, end } = this._getState();
25449
+ let shouldRender = true;
25450
+ if (this._activeState) {
25451
+ if (this._activeTag === DataZoomActiveTag.middleHandler) {
25452
+ ({ start, end } = this._moveZoomWithMiddle(dis));
25453
+ }
25454
+ else if (this._activeTag === DataZoomActiveTag.startHandler) {
25455
+ ({ start, end } = this._moveZoomWithHandler(statePos, 'start'));
25456
+ }
25457
+ else if (this._activeTag === DataZoomActiveTag.endHandler) {
25458
+ ({ start, end } = this._moveZoomWithHandler(statePos, 'end'));
25459
+ }
25460
+ else if (this._activeTag === DataZoomActiveTag.background && brushSelect) {
25461
+ ({ start, end } = this._moveZoomWithBackground(statePos));
25462
+ shouldRender = false;
25463
+ this._dispatchEvent(IDataZoomInteractiveEvent.maskUpdate);
25464
+ }
25465
+ this._activeCache.lastPos = pos;
25466
+ }
25467
+ if (this._getState().start !== start || this._getState().end !== end) {
25468
+ this._setStateAttr(start, end);
25469
+ this._dispatchEvent(IDataZoomInteractiveEvent.stateUpdate, {
25470
+ start: this._getState().start,
25471
+ end: this._getState().end,
25472
+ shouldRender,
25461
25473
  tag: this._activeTag
25462
25474
  });
25475
+ if (this.attribute.realTime) {
25476
+ this._dispatchEvent(IDataZoomInteractiveEvent.dataZoomUpdate, {
25477
+ start: this._getState().start,
25478
+ end: this._getState().end,
25479
+ shouldRender: true,
25480
+ tag: this._activeTag
25481
+ });
25482
+ }
25483
+ }
25484
+ };
25485
+ this._onHandlerPointerUp = (e) => {
25486
+ if (this._activeState) {
25487
+ if (this._activeTag === DataZoomActiveTag.background) {
25488
+ this._setStateAttr(this._getState().start, this._getState().end);
25489
+ this._dispatchEvent(IDataZoomInteractiveEvent.stateUpdate, {
25490
+ start: this._getState().start,
25491
+ end: this._getState().end,
25492
+ shouldRender: true,
25493
+ tag: this._activeTag
25494
+ });
25495
+ }
25463
25496
  }
25497
+ this._activeState = false;
25498
+ this._dispatchEvent(IDataZoomInteractiveEvent.dataZoomUpdate, {
25499
+ start: this._getState().start,
25500
+ end: this._getState().end,
25501
+ shouldRender: true,
25502
+ tag: this._activeTag
25503
+ });
25504
+ this.clearDragEvents();
25505
+ };
25506
+ this._initAttrs(props);
25507
+ }
25508
+ setAttributes(props) {
25509
+ var _a, _b, _c, _d, _e, _f;
25510
+ this._initAttrs(props);
25511
+ this._onHandlerPointerMove =
25512
+ ((_b = (_a = this.attribute) === null || _a === void 0 ? void 0 : _a.delayTime) !== null && _b !== void 0 ? _b : 0) === 0
25513
+ ? this._pointerMove
25514
+ : delayMap$1[(_d = (_c = this.attribute) === null || _c === void 0 ? void 0 : _c.delayType) !== null && _d !== void 0 ? _d : 'debounce'](this._pointerMove, (_f = (_e = this.attribute) === null || _e === void 0 ? void 0 : _e.delayTime) !== null && _f !== void 0 ? _f : 0);
25515
+ }
25516
+ _initAttrs(props) {
25517
+ this.stage = props.stage;
25518
+ this.attribute = props.attribute;
25519
+ this._startHandlerMask = props.startHandlerMask;
25520
+ this._endHandlerMask = props.endHandlerMask;
25521
+ this._middleHandlerSymbol = props.middleHandlerSymbol;
25522
+ this._middleHandlerRect = props.middleHandlerRect;
25523
+ this._selectedBackground = props.selectedBackground;
25524
+ this._background = props.background;
25525
+ this._previewGroup = props.previewGroup;
25526
+ this._selectedPreviewGroup = props.selectedPreviewGroup;
25527
+ this._getLayoutAttrFromConfig = props.getLayoutAttrFromConfig;
25528
+ this._getState = props.getState;
25529
+ this._setState = props.setState;
25530
+ const { width, height } = this._getLayoutAttrFromConfig();
25531
+ this._spanCache = this._getState().end - this._getState().start;
25532
+ const isHorizontal = this.attribute.orient === 'top' || this.attribute.orient === 'bottom';
25533
+ this._layoutCache.size = isHorizontal ? width : height;
25534
+ this._layoutCache.attPos = isHorizontal ? 'x' : 'y';
25535
+ this._layoutCache.attSize = isHorizontal ? 'width' : 'height';
25536
+ this._getGlobalTransMatrix = props.getGlobalTransMatrix;
25537
+ }
25538
+ clearDragEvents() {
25539
+ const evtTarget = vglobal.env === 'browser' ? vglobal : this.stage;
25540
+ const triggers = getEndTriggersOfDrag();
25541
+ evtTarget.removeEventListener('pointermove', this._onHandlerPointerMove, { capture: true });
25542
+ triggers.forEach((trigger) => {
25543
+ evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
25544
+ });
25545
+ this.off('pointermove', this._onHandlerPointerMove, {
25546
+ capture: true
25547
+ });
25548
+ }
25549
+ clearVGlobalEvents() {
25550
+ (vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
25551
+ passive: false
25552
+ });
25553
+ }
25554
+ bindEvents() {
25555
+ var _a, _b, _c, _d, _e, _f, _g, _h;
25556
+ const { brushSelect } = this.attribute;
25557
+ (_a = this._startHandlerMask) === null || _a === void 0 ? void 0 : _a.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'start'));
25558
+ (_b = this._endHandlerMask) === null || _b === void 0 ? void 0 : _b.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'end'));
25559
+ (_c = this._middleHandlerSymbol) === null || _c === void 0 ? void 0 : _c.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'middleSymbol'));
25560
+ (_d = this._middleHandlerRect) === null || _d === void 0 ? void 0 : _d.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'middleRect'));
25561
+ const selectedTag = brushSelect ? 'background' : 'middleRect';
25562
+ (_e = this._selectedBackground) === null || _e === void 0 ? void 0 : _e.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
25563
+ brushSelect &&
25564
+ ((_f = this._background) === null || _f === void 0 ? void 0 : _f.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'background')));
25565
+ brushSelect &&
25566
+ ((_g = this._previewGroup) === null || _g === void 0 ? void 0 : _g.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, 'background')));
25567
+ (_h = this._selectedPreviewGroup) === null || _h === void 0 ? void 0 : _h.addEventListener('pointerdown', (e) => this._onHandlerPointerDown(e, selectedTag));
25568
+ (vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
25569
+ passive: false
25570
+ });
25571
+ }
25572
+ _setStateAttr(start, end) {
25573
+ const { zoomLock = false, minSpan = 0, maxSpan = 1 } = this.attribute;
25574
+ const span = end - start;
25575
+ if (span !== this._spanCache && (zoomLock || span < minSpan || span > maxSpan)) {
25576
+ return;
25577
+ }
25578
+ this._spanCache = span;
25579
+ this._setState({ start, end });
25580
+ }
25581
+ _moveZoomWithMiddle(dis) {
25582
+ const { start: staetState, end: endState } = this._getState();
25583
+ if (dis > 0 && endState + dis > 1) {
25584
+ dis = 1 - endState;
25585
+ }
25586
+ else if (dis < 0 && staetState + dis < 0) {
25587
+ dis = -staetState;
25588
+ }
25589
+ return {
25590
+ start: clamp(staetState + dis, 0, 1),
25591
+ end: clamp(endState + dis, 0, 1)
25592
+ };
25593
+ }
25594
+ _moveZoomWithHandler(statePos, handler) {
25595
+ const { start, end } = this._getState();
25596
+ let newStart = start;
25597
+ let newEnd = end;
25598
+ if (handler === 'start') {
25599
+ if (statePos > end) {
25600
+ newStart = end;
25601
+ newEnd = statePos;
25602
+ this._activeTag = DataZoomActiveTag.endHandler;
25603
+ }
25604
+ else {
25605
+ newStart = statePos;
25606
+ }
25607
+ }
25608
+ else if (handler === 'end') {
25609
+ if (statePos < start) {
25610
+ newEnd = start;
25611
+ newStart = statePos;
25612
+ this._activeTag = DataZoomActiveTag.startHandler;
25613
+ }
25614
+ else {
25615
+ newEnd = statePos;
25616
+ }
25617
+ }
25618
+ return {
25619
+ start: clamp(newStart, 0, 1),
25620
+ end: clamp(newEnd, 0, 1)
25621
+ };
25622
+ }
25623
+ _moveZoomWithBackground(statePos) {
25624
+ const { position } = this._getLayoutAttrFromConfig();
25625
+ const { attSize } = this._layoutCache;
25626
+ const startPos = (this._activeCache.startPos[this._layoutCache.attPos] - position[this._layoutCache.attPos]) /
25627
+ this._getLayoutAttrFromConfig()[attSize];
25628
+ const endPos = statePos;
25629
+ let start = clamp(startPos, 0, 1);
25630
+ let end = clamp(endPos, 0, 1);
25631
+ if (start > end) {
25632
+ [start, end] = [end, start];
25633
+ }
25634
+ return { start, end };
25635
+ }
25636
+ _eventPosToStagePos(e) {
25637
+ var _a, _b;
25638
+ const result = { x: 0, y: 0 };
25639
+ const stagePoints = (_b = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventPointTransform(e)) !== null && _b !== void 0 ? _b : { x: 0, y: 0 };
25640
+ this._getGlobalTransMatrix().transformPoint(stagePoints, result);
25641
+ return result;
25642
+ }
25643
+ _dispatchEvent(eventName, details) {
25644
+ this.emit(eventName, details);
25645
+ }
25646
+ }
25647
+
25648
+ function loadDataZoomComponent() {
25649
+ loadTagComponent();
25650
+ registerRect();
25651
+ registerSymbol();
25652
+ registerArea();
25653
+ registerLine();
25654
+ }
25655
+
25656
+ loadDataZoomComponent();
25657
+ class DataZoom extends AbstractComponent {
25658
+ constructor(attributes, options) {
25659
+ super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, DataZoom.defaultAttributes, attributes));
25660
+ this.name = 'dataZoom';
25661
+ this._state = { start: 0, end: 1 };
25662
+ this.getLayoutAttrFromConfig = () => {
25663
+ var _a, _b, _c, _d, _e, _f;
25664
+ if (this._layoutCacheFromConfig) {
25665
+ return this._layoutCacheFromConfig;
25666
+ }
25667
+ const { position: positionConfig, size, orient, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, backgroundStyle = {} } = this.attribute;
25668
+ const { width: widthConfig, height: heightConfig } = size;
25669
+ const middleHandlerSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
25670
+ let width;
25671
+ let height;
25672
+ let position;
25673
+ if (middleHandlerStyle.visible) {
25674
+ if (this._isHorizontal) {
25675
+ width = widthConfig;
25676
+ height = heightConfig - middleHandlerSize;
25677
+ position = {
25678
+ x: positionConfig.x,
25679
+ y: positionConfig.y + middleHandlerSize
25680
+ };
25681
+ }
25682
+ else {
25683
+ width = widthConfig - middleHandlerSize;
25684
+ height = heightConfig;
25685
+ position = {
25686
+ x: positionConfig.x + (orient === 'left' ? middleHandlerSize : 0),
25687
+ y: positionConfig.y
25688
+ };
25689
+ }
25690
+ }
25691
+ else {
25692
+ width = widthConfig;
25693
+ height = heightConfig;
25694
+ position = positionConfig;
25695
+ }
25696
+ const startHandlerSize = (_c = startHandlerStyle.size) !== null && _c !== void 0 ? _c : (this._isHorizontal ? height : width);
25697
+ const endHandlerSize = (_d = endHandlerStyle.size) !== null && _d !== void 0 ? _d : (this._isHorizontal ? height : width);
25698
+ if (startHandlerStyle.visible) {
25699
+ if (this._isHorizontal) {
25700
+ width -= (startHandlerSize + endHandlerSize) / 2;
25701
+ position = {
25702
+ x: position.x + startHandlerSize / 2,
25703
+ y: position.y
25704
+ };
25705
+ }
25706
+ else {
25707
+ height -= (startHandlerSize + endHandlerSize) / 2;
25708
+ position = {
25709
+ x: position.x,
25710
+ y: position.y + startHandlerSize / 2
25711
+ };
25712
+ }
25713
+ }
25714
+ height += ((_e = backgroundStyle.lineWidth) !== null && _e !== void 0 ? _e : 2) / 2;
25715
+ width += ((_f = backgroundStyle.lineWidth) !== null && _f !== void 0 ? _f : 2) / 2;
25716
+ this._layoutCacheFromConfig = {
25717
+ position,
25718
+ width,
25719
+ height
25720
+ };
25721
+ return this._layoutCacheFromConfig;
25722
+ };
25723
+ const { start, end, orient } = this.attribute;
25724
+ this._isHorizontal = orient === 'top' || orient === 'bottom';
25725
+ start && (this._state.start = start);
25726
+ end && (this._state.end = end);
25727
+ this._renderer = new DataZoomRenderer(this._getRendererAttrs());
25728
+ this._interaction = new DataZoomInteraction(this._getInteractionAttrs());
25729
+ }
25730
+ _getRendererAttrs() {
25731
+ return {
25732
+ attribute: this.attribute,
25733
+ getLayoutAttrFromConfig: this.getLayoutAttrFromConfig,
25734
+ setState: (state) => {
25735
+ this._state = state;
25736
+ },
25737
+ getState: () => this._state,
25738
+ getContainer: () => this._container
25739
+ };
25740
+ }
25741
+ _getInteractionAttrs() {
25742
+ return {
25743
+ stage: this.stage,
25744
+ attribute: this.attribute,
25745
+ startHandlerMask: this._renderer.startHandlerMask,
25746
+ endHandlerMask: this._renderer.endHandlerMask,
25747
+ middleHandlerSymbol: this._renderer.middleHandlerSymbol,
25748
+ middleHandlerRect: this._renderer.middleHandlerRect,
25749
+ selectedBackground: this._renderer.selectedBackground,
25750
+ background: this._renderer.background,
25751
+ previewGroup: this._renderer.previewGroup,
25752
+ selectedPreviewGroup: this._renderer.selectedPreviewGroup,
25753
+ getLayoutAttrFromConfig: this.getLayoutAttrFromConfig,
25754
+ setState: (state) => {
25755
+ this._state = state;
25756
+ },
25757
+ getState: () => this._state,
25758
+ getGlobalTransMatrix: () => this.globalTransMatrix
25759
+ };
25760
+ }
25761
+ bindEvents() {
25762
+ if (this.attribute.disableTriggerEvent) {
25763
+ this.setAttribute('childrenPickable', false);
25764
+ return;
25765
+ }
25766
+ this._interaction.bindEvents();
25767
+ this._interaction.on(IDataZoomInteractiveEvent.stateUpdate, ({ shouldRender }) => {
25768
+ if (shouldRender) {
25769
+ this._renderer.renderDataZoom(true);
25770
+ }
25771
+ });
25772
+ this._interaction.on(IDataZoomInteractiveEvent.dataZoomUpdate, ({ start, end, tag }) => {
25773
+ this._dispatchEvent(IDataZoomEvent.dataZoomChange, { start, end, tag });
25774
+ });
25775
+ this._interaction.on(IDataZoomInteractiveEvent.maskUpdate, () => {
25776
+ this._renderer.renderDragMask();
25777
+ });
25778
+ if (this.attribute.showDetail === 'auto') {
25779
+ this._container.addEventListener('pointerenter', () => {
25780
+ this._renderer.showText = true;
25781
+ this._renderer.renderText();
25782
+ });
25783
+ this._container.addEventListener('pointerleave', () => {
25784
+ this._renderer.showText = false;
25785
+ this._renderer.renderText();
25786
+ });
25787
+ }
25788
+ }
25789
+ setAttributes(params, forceUpdateTag) {
25790
+ const { start, end } = this.attribute;
25791
+ start && (this._state.start = start);
25792
+ end && (this._state.end = end);
25793
+ this._renderer.setAttributes(this._getRendererAttrs());
25794
+ this._interaction.setAttributes(this._getInteractionAttrs());
25795
+ super.setAttributes(params, forceUpdateTag);
25796
+ }
25797
+ render() {
25798
+ this._layoutCacheFromConfig = null;
25799
+ this._container = this.createOrUpdateChild('datazoom-container', {}, 'group');
25800
+ this._renderer.renderDataZoom();
25801
+ this._interaction.setAttributes(this._getInteractionAttrs());
25802
+ }
25803
+ release(all) {
25804
+ super.release(all);
25805
+ this._interaction.clearDragEvents();
25806
+ }
25807
+ setStartAndEnd(start, end) {
25808
+ const { start: startState, end: endState } = this._state;
25809
+ if (isValid(start) && isValid(end) && (start !== startState || end !== endState)) {
25810
+ this._state = { start, end };
25811
+ this._renderer.renderDataZoom(true);
25812
+ this._dispatchEvent(IDataZoomEvent.dataZoomChange, {
25813
+ start,
25814
+ end
25815
+ });
25464
25816
  }
25465
25817
  }
25466
25818
  setPreviewData(data) {
25467
- this._previewData = data;
25819
+ this._renderer.previewData = data;
25468
25820
  }
25469
25821
  setText(text, tag) {
25470
25822
  if (tag === 'start') {
25471
- this._startText.setAttribute('text', text);
25823
+ this._renderer.startText.setAttribute('text', text);
25472
25824
  }
25473
25825
  else {
25474
- this._endText.setAttribute('text', text);
25826
+ this._renderer.endText.setAttribute('text', text);
25475
25827
  }
25476
25828
  }
25477
25829
  getStartValue() {
25478
- return this._startValue;
25830
+ return this._renderer.startValue;
25479
25831
  }
25480
25832
  getEndTextValue() {
25481
- return this._endValue;
25833
+ return this._renderer.endValue;
25482
25834
  }
25483
25835
  getMiddleHandlerSize() {
25484
25836
  var _a, _b, _c, _d;
@@ -25488,26 +25840,19 @@ class DataZoom extends AbstractComponent {
25488
25840
  return Math.max(middleHandlerRectSize, ...array(middleHandlerSymbolSize));
25489
25841
  }
25490
25842
  setPreviewPointsX(callback) {
25491
- isFunction(callback) && (this._previewPointsX = callback);
25843
+ isFunction(callback) && (this._renderer.previewPointsX = callback);
25492
25844
  }
25493
25845
  setPreviewPointsY(callback) {
25494
- isFunction(callback) && (this._previewPointsY = callback);
25846
+ isFunction(callback) && (this._renderer.previewPointsY = callback);
25495
25847
  }
25496
25848
  setPreviewPointsX1(callback) {
25497
- isFunction(callback) && (this._previewPointsX1 = callback);
25849
+ isFunction(callback) && (this._renderer.previewPointsX1 = callback);
25498
25850
  }
25499
25851
  setPreviewPointsY1(callback) {
25500
- isFunction(callback) && (this._previewPointsY1 = callback);
25852
+ isFunction(callback) && (this._renderer.previewPointsY1 = callback);
25501
25853
  }
25502
25854
  setStatePointToData(callback) {
25503
- isFunction(callback) && (this._statePointToData = callback);
25504
- }
25505
- release(all) {
25506
- super.release(all);
25507
- (vglobal.env === 'browser' ? vglobal : this.stage).addEventListener('touchmove', this._handleTouchMove, {
25508
- passive: false
25509
- });
25510
- this._clearDragEvents();
25855
+ isFunction(callback) && (this._renderer.statePointToData = callback);
25511
25856
  }
25512
25857
  }
25513
25858
  DataZoom.defaultAttributes = DEFAULT_DATA_ZOOM_ATTRIBUTES;
@@ -31699,7 +32044,7 @@ class Brush extends AbstractComponent {
31699
32044
  _addBrushMask() {
31700
32045
  var _a;
31701
32046
  const { brushStyle, hasMask } = this.attribute;
31702
- const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? (_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1 : 0 }));
32047
+ const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? ((_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1) : 0 }));
31703
32048
  brushMask.name = `brush-${Date.now()}`;
31704
32049
  this._operatingMask = brushMask;
31705
32050
  this._container.add(brushMask);
@@ -34193,6 +34538,6 @@ TableSeriesNumber.defaultAttributes = {
34193
34538
  select: true
34194
34539
  };
34195
34540
 
34196
- const version = "1.0.18";
34541
+ const version = "1.0.19";
34197
34542
 
34198
- export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
34543
+ export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IDataZoomEvent, IDataZoomInteractiveEvent, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, TableSeriesNumber, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };