@visactor/vrender-components 0.14.6 → 0.15.0-alpha.5

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 (169) hide show
  1. package/cjs/axis/animate/group-transition.d.ts +2 -1
  2. package/cjs/axis/animate/group-transition.js +3 -3
  3. package/cjs/axis/animate/group-transition.js.map +1 -1
  4. package/cjs/axis/base.d.ts +5 -8
  5. package/cjs/axis/base.js +16 -32
  6. package/cjs/axis/base.js.map +1 -1
  7. package/cjs/axis/circle.d.ts +3 -23
  8. package/cjs/axis/circle.js +3 -84
  9. package/cjs/axis/circle.js.map +1 -1
  10. package/cjs/axis/config.d.ts +0 -17
  11. package/cjs/axis/config.js +0 -17
  12. package/cjs/axis/config.js.map +1 -1
  13. package/cjs/axis/grid/base.d.ts +24 -0
  14. package/cjs/axis/{grid.js → grid/base.js} +67 -20
  15. package/cjs/axis/grid/base.js.map +1 -0
  16. package/cjs/axis/grid/circle.d.ts +9 -0
  17. package/cjs/axis/grid/circle.js +92 -0
  18. package/cjs/axis/grid/circle.js.map +1 -0
  19. package/cjs/axis/grid/index.d.ts +3 -0
  20. package/cjs/axis/grid/index.js +22 -0
  21. package/cjs/axis/grid/index.js.map +1 -0
  22. package/cjs/axis/grid/line.d.ts +10 -0
  23. package/cjs/axis/grid/line.js +103 -0
  24. package/cjs/axis/grid/line.js.map +1 -0
  25. package/cjs/axis/grid/type.d.ts +63 -0
  26. package/cjs/axis/grid/type.js +6 -0
  27. package/cjs/axis/grid/type.js.map +1 -0
  28. package/cjs/axis/index.d.ts +0 -1
  29. package/cjs/axis/index.js +3 -3
  30. package/cjs/axis/index.js.map +1 -1
  31. package/cjs/axis/line.d.ts +3 -24
  32. package/cjs/axis/line.js +17 -167
  33. package/cjs/axis/line.js.map +1 -1
  34. package/cjs/axis/mixin/circle.d.ts +17 -0
  35. package/cjs/axis/mixin/circle.js +30 -0
  36. package/cjs/axis/mixin/circle.js.map +1 -0
  37. package/cjs/axis/mixin/line.d.ts +14 -0
  38. package/cjs/axis/mixin/line.js +32 -0
  39. package/cjs/axis/mixin/line.js.map +1 -0
  40. package/cjs/axis/overlap/auto-rotate.js +2 -2
  41. package/cjs/axis/overlap/auto-rotate.js.map +1 -1
  42. package/cjs/axis/type.d.ts +0 -56
  43. package/cjs/axis/type.js.map +1 -1
  44. package/cjs/brush/brush.d.ts +0 -1
  45. package/cjs/brush/brush.js +0 -5
  46. package/cjs/brush/brush.js.map +1 -1
  47. package/cjs/core/type.js +2 -1
  48. package/cjs/crosshair/base.js +1 -2
  49. package/cjs/index.d.ts +3 -1
  50. package/cjs/index.js +9 -8
  51. package/cjs/index.js.map +1 -1
  52. package/cjs/indicator/type.js +2 -1
  53. package/cjs/jsx/component-type.d.ts +4 -0
  54. package/cjs/jsx/component-type.js +13 -0
  55. package/cjs/jsx/component-type.js.map +1 -0
  56. package/cjs/jsx/index.d.ts +1 -0
  57. package/cjs/jsx/index.js +21 -0
  58. package/cjs/jsx/index.js.map +1 -0
  59. package/cjs/label/arc.d.ts +3 -6
  60. package/cjs/label/arc.js +1 -31
  61. package/cjs/label/arc.js.map +1 -1
  62. package/cjs/label/base.d.ts +9 -12
  63. package/cjs/label/base.js +134 -117
  64. package/cjs/label/base.js.map +1 -1
  65. package/cjs/label/dataLabel.js +4 -4
  66. package/cjs/label/dataLabel.js.map +1 -1
  67. package/cjs/label/overlap/place.d.ts +2 -2
  68. package/cjs/label/overlap/place.js +8 -15
  69. package/cjs/label/overlap/place.js.map +1 -1
  70. package/cjs/label/rect.js.map +1 -1
  71. package/cjs/label/symbol.js.map +1 -1
  72. package/cjs/label/type.d.ts +2 -5
  73. package/cjs/label/type.js.map +1 -1
  74. package/cjs/util/labelSmartInvert.d.ts +0 -1
  75. package/cjs/util/labelSmartInvert.js +2 -20
  76. package/cjs/util/labelSmartInvert.js.map +1 -1
  77. package/cjs/util/matrix.d.ts +1 -1
  78. package/cjs/util/matrix.js.map +1 -1
  79. package/dist/index.js +734 -814
  80. package/dist/index.min.js +1 -1
  81. package/es/axis/animate/group-transition.d.ts +2 -1
  82. package/es/axis/animate/group-transition.js +3 -3
  83. package/es/axis/animate/group-transition.js.map +1 -1
  84. package/es/axis/base.d.ts +5 -8
  85. package/es/axis/base.js +15 -33
  86. package/es/axis/base.js.map +1 -1
  87. package/es/axis/circle.d.ts +3 -23
  88. package/es/axis/circle.js +4 -85
  89. package/es/axis/circle.js.map +1 -1
  90. package/es/axis/config.d.ts +0 -17
  91. package/es/axis/config.js +0 -17
  92. package/es/axis/config.js.map +1 -1
  93. package/es/axis/grid/base.d.ts +24 -0
  94. package/es/axis/{grid.js → grid/base.js} +69 -21
  95. package/es/axis/grid/base.js.map +1 -0
  96. package/es/axis/grid/circle.d.ts +9 -0
  97. package/es/axis/grid/circle.js +92 -0
  98. package/es/axis/grid/circle.js.map +1 -0
  99. package/es/axis/grid/index.d.ts +3 -0
  100. package/es/axis/grid/index.js +6 -0
  101. package/es/axis/grid/index.js.map +1 -0
  102. package/es/axis/grid/line.d.ts +10 -0
  103. package/es/axis/grid/line.js +102 -0
  104. package/es/axis/grid/line.js.map +1 -0
  105. package/es/axis/grid/type.d.ts +63 -0
  106. package/es/axis/grid/type.js +2 -0
  107. package/es/axis/grid/type.js.map +1 -0
  108. package/es/axis/index.d.ts +0 -1
  109. package/es/axis/index.js +0 -2
  110. package/es/axis/index.js.map +1 -1
  111. package/es/axis/line.d.ts +3 -24
  112. package/es/axis/line.js +9 -158
  113. package/es/axis/line.js.map +1 -1
  114. package/es/axis/mixin/circle.d.ts +17 -0
  115. package/es/axis/mixin/circle.js +25 -0
  116. package/es/axis/mixin/circle.js.map +1 -0
  117. package/es/axis/mixin/line.d.ts +14 -0
  118. package/es/axis/mixin/line.js +23 -0
  119. package/es/axis/mixin/line.js.map +1 -0
  120. package/es/axis/overlap/auto-rotate.js +2 -2
  121. package/es/axis/overlap/auto-rotate.js.map +1 -1
  122. package/es/axis/type.d.ts +0 -56
  123. package/es/axis/type.js.map +1 -1
  124. package/es/brush/brush.d.ts +0 -1
  125. package/es/brush/brush.js +0 -5
  126. package/es/brush/brush.js.map +1 -1
  127. package/es/core/type.js +2 -1
  128. package/es/crosshair/base.js +1 -2
  129. package/es/index.d.ts +3 -1
  130. package/es/index.js +5 -1
  131. package/es/index.js.map +1 -1
  132. package/es/indicator/type.js +2 -1
  133. package/es/jsx/component-type.d.ts +4 -0
  134. package/es/jsx/component-type.js +5 -0
  135. package/es/jsx/component-type.js.map +1 -0
  136. package/es/jsx/index.d.ts +1 -0
  137. package/es/jsx/index.js +2 -0
  138. package/es/jsx/index.js.map +1 -0
  139. package/es/label/arc.d.ts +3 -6
  140. package/es/label/arc.js +0 -31
  141. package/es/label/arc.js.map +1 -1
  142. package/es/label/base.d.ts +9 -12
  143. package/es/label/base.js +132 -118
  144. package/es/label/base.js.map +1 -1
  145. package/es/label/dataLabel.js +3 -5
  146. package/es/label/dataLabel.js.map +1 -1
  147. package/es/label/overlap/place.d.ts +2 -2
  148. package/es/label/overlap/place.js +8 -15
  149. package/es/label/overlap/place.js.map +1 -1
  150. package/es/label/rect.js.map +1 -1
  151. package/es/label/symbol.js.map +1 -1
  152. package/es/label/type.d.ts +2 -5
  153. package/es/label/type.js.map +1 -1
  154. package/es/util/labelSmartInvert.d.ts +0 -1
  155. package/es/util/labelSmartInvert.js +0 -17
  156. package/es/util/labelSmartInvert.js.map +1 -1
  157. package/es/util/matrix.d.ts +1 -1
  158. package/es/util/matrix.js.map +1 -1
  159. package/package.json +4 -4
  160. package/cjs/axis/grid.d.ts +0 -9
  161. package/cjs/axis/grid.js.map +0 -1
  162. package/cjs/label/polygon.d.ts +0 -12
  163. package/cjs/label/polygon.js +0 -35
  164. package/cjs/label/polygon.js.map +0 -1
  165. package/es/axis/grid.d.ts +0 -9
  166. package/es/axis/grid.js.map +0 -1
  167. package/es/label/polygon.d.ts +0 -12
  168. package/es/label/polygon.js +0 -31
  169. package/es/label/polygon.js.map +0 -1
package/dist/index.js CHANGED
@@ -495,20 +495,6 @@
495
495
  const { r, g, b } = c.color;
496
496
  return '#' + vutils.ColorUtil.rgbToHex(r, g, b);
497
497
  }
498
- function smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor) {
499
- let result;
500
- switch (fillStrategy) {
501
- case 'base':
502
- result = baseColor;
503
- break;
504
- case 'invertBase':
505
- result = invertColor;
506
- break;
507
- case 'similarBase':
508
- result = similarColor;
509
- }
510
- return result;
511
- }
512
498
 
513
499
  function scale(vector, scale) {
514
500
  return [vector[0] * scale, vector[1] * scale];
@@ -1409,29 +1395,26 @@
1409
1395
  };
1410
1396
  }
1411
1397
 
1412
- function canPlace($, bitmap, bound, checkBound = true, pad = 0) {
1413
- let range = bound;
1414
- if (pad > 0) {
1415
- range = {
1416
- x1: bound.x1 - pad,
1417
- x2: bound.x2 + pad,
1418
- y1: bound.y1 - pad,
1419
- y2: bound.y2 + pad
1420
- };
1421
- }
1422
- range = boundToRange($, range);
1398
+ function canPlace($, bitmap, bound, checkBound = true) {
1399
+ const range = boundToRange($, bound);
1423
1400
  const outOfBounds = checkBound && bitmap.outOfBounds(range);
1424
1401
  if (outOfBounds) {
1425
1402
  return false;
1426
1403
  }
1427
1404
  return !bitmap.getRange(range);
1428
1405
  }
1429
- function placeToCandidates($, bitmap, text, candidates = [], clampForce = true, pad = 0) {
1406
+ function canPlaceInside(textBound, shapeBound) {
1407
+ if (!textBound || !shapeBound) {
1408
+ return false;
1409
+ }
1410
+ return shapeBound.encloses(textBound);
1411
+ }
1412
+ function placeToCandidates($, bitmap, text, candidates = [], clampForce = true) {
1430
1413
  for (let i = 0; i < candidates.length; i++) {
1431
1414
  const tempText = text.clone();
1432
1415
  tempText.setAttributes(candidates[i]);
1433
1416
  tempText.update();
1434
- if (canPlace($, bitmap, boundToRange($, tempText.AABBBounds), clampForce, pad)) {
1417
+ if (canPlace($, bitmap, boundToRange($, tempText.AABBBounds), clampForce)) {
1435
1418
  bitmap.setRange(boundToRange($, tempText.AABBBounds, true));
1436
1419
  return candidates[i];
1437
1420
  }
@@ -1439,15 +1422,13 @@
1439
1422
  return false;
1440
1423
  }
1441
1424
  function place($, bitmap, s, attrs, text, bounds, labeling) {
1442
- var _a, _b;
1443
- const clampForce = (_a = attrs.overlap) === null || _a === void 0 ? void 0 : _a.clampForce;
1444
- const overlapPadding = (_b = attrs.overlap) === null || _b === void 0 ? void 0 : _b.overlapPadding;
1425
+ var _a, _b, _c;
1445
1426
  if (s.type === 'bound' || s.type === 'position') {
1446
1427
  if (vutils.isFunction(labeling)) {
1447
1428
  const userPosition = vutils.isFunction(s.position) ? s.position(text.attribute) : s.position;
1448
1429
  const positions = (userPosition || defaultLabelPosition(attrs.type));
1449
1430
  const candidates = positions.map(p => labeling(text.AABBBounds, bounds, p, attrs.offset));
1450
- return placeToCandidates($, bitmap, text, candidates, clampForce, overlapPadding);
1431
+ return placeToCandidates($, bitmap, text, candidates, (_a = attrs.overlap) === null || _a === void 0 ? void 0 : _a.clampForce);
1451
1432
  }
1452
1433
  return false;
1453
1434
  }
@@ -1456,14 +1437,14 @@
1456
1437
  const candidates = offset.map(dy => {
1457
1438
  return { x: text.attribute.x, y: text.attribute.y + dy };
1458
1439
  });
1459
- return placeToCandidates($, bitmap, text, candidates, clampForce, overlapPadding);
1440
+ return placeToCandidates($, bitmap, text, candidates, (_b = attrs.overlap) === null || _b === void 0 ? void 0 : _b.clampForce);
1460
1441
  }
1461
1442
  if (s.type === 'moveX') {
1462
1443
  const offset = s.offset ? (vutils.isFunction(s.offset) ? s.offset(text.attribute) : s.offset) : [];
1463
1444
  const candidates = offset.map(dx => {
1464
1445
  return { x: text.attribute.x + dx, y: text.attribute.y };
1465
1446
  });
1466
- return placeToCandidates($, bitmap, text, candidates, clampForce, overlapPadding);
1447
+ return placeToCandidates($, bitmap, text, candidates, (_c = attrs.overlap) === null || _c === void 0 ? void 0 : _c.clampForce);
1467
1448
  }
1468
1449
  return false;
1469
1450
  }
@@ -1551,14 +1532,8 @@
1551
1532
  };
1552
1533
 
1553
1534
  class LabelBase extends AbstractComponent {
1554
- setBitmap(bitmap) {
1555
- this._bitmap = bitmap;
1556
- }
1557
- setBitmapTool(bmpTool) {
1558
- this._bmpTool = bmpTool;
1559
- }
1560
- constructor(attributes) {
1561
- super(vutils.merge({}, LabelBase.defaultAttributes, attributes));
1535
+ constructor() {
1536
+ super(...arguments);
1562
1537
  this.name = 'label';
1563
1538
  this._onHover = (e) => {
1564
1539
  const target = e.target;
@@ -1606,11 +1581,15 @@
1606
1581
  }
1607
1582
  };
1608
1583
  }
1609
- labeling(textBounds, graphicBounds, position, offset) {
1610
- return;
1584
+ setBitmap(bitmap) {
1585
+ this._bitmap = bitmap;
1611
1586
  }
1612
- _labelLine(text) {
1613
- return;
1587
+ setBitmapTool(bmpTool) {
1588
+ this._bmpTool = bmpTool;
1589
+ }
1590
+ layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
1591
+ const arcs = [];
1592
+ return arcs;
1614
1593
  }
1615
1594
  render() {
1616
1595
  this._prepare();
@@ -1624,14 +1603,14 @@
1624
1603
  labels = customLayoutFunc(data, (d) => this._idToGraphic.get(d.id));
1625
1604
  }
1626
1605
  else {
1627
- labels = this._layout(data);
1628
- }
1629
- if (vutils.isFunction(customOverlapFunc)) {
1630
- labels = customOverlapFunc(labels, (d) => this._idToGraphic.get(d.id));
1631
- }
1632
- else {
1633
- if (overlap !== false) {
1634
- labels = this._overlapping(labels);
1606
+ labels = this.layout(data);
1607
+ if (vutils.isFunction(customOverlapFunc)) {
1608
+ labels = customOverlapFunc(labels, (d) => this._idToGraphic.get(d.id));
1609
+ }
1610
+ else {
1611
+ if (overlap !== false) {
1612
+ labels = this._overlapping(labels);
1613
+ }
1635
1614
  }
1636
1615
  }
1637
1616
  if (smartInvert !== false) {
@@ -1700,24 +1679,49 @@
1700
1679
  }
1701
1680
  }
1702
1681
  }
1703
- _layout(data = []) {
1682
+ layout(data = []) {
1704
1683
  const { textStyle = {}, position, offset } = this.attribute;
1705
1684
  const labels = [];
1685
+ const textBoundsArray = [];
1706
1686
  for (let i = 0; i < data.length; i++) {
1707
1687
  const textData = data[i];
1708
1688
  const baseMark = this._idToGraphic.get(textData.id);
1709
1689
  const labelAttribute = Object.assign(Object.assign({ fill: baseMark.attribute.fill }, textStyle), textData);
1710
1690
  const text = this._createLabelText(labelAttribute);
1711
1691
  const textBounds = this.getGraphicBounds(text);
1692
+ textBoundsArray.push(textBounds);
1712
1693
  const graphicBounds = this.getGraphicBounds(baseMark, { x: textData.x, y: textData.y });
1713
1694
  const textLocation = this.labeling(textBounds, graphicBounds, vutils.isFunction(position) ? position(textData) : position, offset);
1714
- if (textLocation) {
1715
- labelAttribute.x = textLocation.x;
1716
- labelAttribute.y = textLocation.y;
1717
- text.setAttributes(textLocation);
1695
+ if (!textLocation) {
1696
+ continue;
1718
1697
  }
1698
+ labelAttribute.x = textLocation.x;
1699
+ labelAttribute.y = textLocation.y;
1700
+ text.setAttributes(textLocation);
1719
1701
  labels.push(text);
1720
1702
  }
1703
+ if (this.attribute.type === 'arc') {
1704
+ const ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), { text: '...' });
1705
+ const ellipsisText = this._createLabelText(ellipsisLabelAttribute);
1706
+ const ellipsisTextBounds = this.getGraphicBounds(ellipsisText);
1707
+ const ellipsisWidth = ellipsisTextBounds.x2 - ellipsisTextBounds.x1;
1708
+ const arcs = this.layoutArcLabels(position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
1709
+ for (let i = 0; i < data.length; i++) {
1710
+ const textData = data[i];
1711
+ const basedArc = arcs.find(arc => arc.refDatum.id === textData.id);
1712
+ const labelAttribute = {
1713
+ visible: basedArc.labelVisible,
1714
+ x: basedArc.labelPosition.x,
1715
+ y: basedArc.labelPosition.y,
1716
+ angle: basedArc.angle,
1717
+ maxLineWidth: basedArc.labelLimit,
1718
+ points: (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointA) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointB) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointC)
1719
+ ? [basedArc.pointA, basedArc.pointB, basedArc.pointC]
1720
+ : undefined
1721
+ };
1722
+ labels[i].setAttributes(labelAttribute);
1723
+ }
1724
+ }
1721
1725
  return labels;
1722
1726
  }
1723
1727
  _overlapping(labels) {
@@ -1735,7 +1739,7 @@
1735
1739
  if (size.width === 0 || size.height === 0) {
1736
1740
  return labels;
1737
1741
  }
1738
- const { avoidBaseMark, strategy = [], hideOnHit = true, clampForce = true, avoidMarks = [], overlapPadding } = option;
1742
+ const { avoidBaseMark, strategy = [], hideOnHit = true, clampForce = true, avoidMarks = [] } = option;
1739
1743
  const bmpTool = this._bmpTool || bitmapTool(size.width, size.height);
1740
1744
  const bitmap = this._bitmap || bmpTool.bitmap();
1741
1745
  const checkBounds = strategy.some(s => s.type === 'bound');
@@ -1763,16 +1767,13 @@
1763
1767
  const text = labels[i];
1764
1768
  const baseMark = this._idToGraphic.get(text.attribute.id);
1765
1769
  text.update();
1766
- if (!vutils.isRectIntersect(baseMark.AABBBounds, { x1: 0, x2: bmpTool.width, y1: 0, y2: bmpTool.height }, true)) {
1767
- continue;
1768
- }
1769
- if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce, overlapPadding)) {
1770
+ if (canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {
1770
1771
  if (!checkBounds) {
1771
1772
  bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));
1772
1773
  result.push(text);
1773
1774
  continue;
1774
1775
  }
1775
- if (checkBounds && (baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds) && this._canPlaceInside(text.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds)) {
1776
+ if (checkBounds && (baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds) && canPlaceInside(text.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds)) {
1776
1777
  bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));
1777
1778
  result.push(text);
1778
1779
  continue;
@@ -1795,7 +1796,7 @@
1795
1796
  x2: text.AABBBounds.x2 + dx,
1796
1797
  y1: text.AABBBounds.y1 + dy,
1797
1798
  y2: text.AABBBounds.y2 + dy
1798
- }, undefined, overlapPadding)) {
1799
+ })) {
1799
1800
  text.setAttributes({ x: text.attribute.x + dx, y: text.attribute.y + dy });
1800
1801
  bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, true));
1801
1802
  result.push(text);
@@ -1826,17 +1827,9 @@
1826
1827
  });
1827
1828
  }
1828
1829
  _renderLabels(labels) {
1829
- const disableAnimation = this._enableAnimation === false || this.attribute.animation === false;
1830
- if (disableAnimation) {
1831
- this._renderWithOutAnimation(labels);
1832
- }
1833
- else {
1834
- this._renderWithAnimation(labels);
1835
- }
1836
- }
1837
- _renderWithAnimation(labels) {
1838
1830
  var _a, _b, _c, _d, _e;
1839
1831
  const animationConfig = ((_a = this.attribute.animation) !== null && _a !== void 0 ? _a : {});
1832
+ const disableAnimation = this._enableAnimation === false || animationConfig === false;
1840
1833
  const mode = (_b = animationConfig.mode) !== null && _b !== void 0 ? _b : DefaultLabelAnimation.mode;
1841
1834
  const duration = (_c = animationConfig.duration) !== null && _c !== void 0 ? _c : DefaultLabelAnimation.duration;
1842
1835
  const easing = (_d = animationConfig.easing) !== null && _d !== void 0 ? _d : DefaultLabelAnimation.easing;
@@ -1845,18 +1838,27 @@
1845
1838
  const prevTextMap = this._graphicToText || new Map();
1846
1839
  const texts = [];
1847
1840
  labels.forEach((text, index) => {
1848
- var _a;
1849
- const labelLine = this._labelLine(text);
1841
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1842
+ const labelLine = ((_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points)
1843
+ ? vrender.createLine({
1844
+ visible: (_c = (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.visible) !== null && _c !== void 0 ? _c : true,
1845
+ stroke: (_f = (_e = (_d = text.attribute) === null || _d === void 0 ? void 0 : _d.line) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f : (_g = text.attribute) === null || _g === void 0 ? void 0 : _g.fill,
1846
+ lineWidth: (_k = (_j = (_h = text.attribute) === null || _h === void 0 ? void 0 : _h.line) === null || _j === void 0 ? void 0 : _j.lineWidth) !== null && _k !== void 0 ? _k : 1,
1847
+ points: (_l = text.attribute) === null || _l === void 0 ? void 0 : _l.points
1848
+ })
1849
+ : undefined;
1850
1850
  const relatedGraphic = this._idToGraphic.get(text.attribute.id);
1851
1851
  const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(relatedGraphic)) ? 'update' : 'enter';
1852
1852
  if (state === 'enter') {
1853
1853
  texts.push(text);
1854
1854
  currentTextMap.set(relatedGraphic, labelLine ? { text, labelLine } : { text });
1855
- if (relatedGraphic) {
1855
+ if (!disableAnimation && relatedGraphic) {
1856
1856
  const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');
1857
1857
  this.add(text);
1858
- labelLine && this.add(labelLine);
1859
- relatedGraphic.once('animate-bind', () => {
1858
+ if (labelLine) {
1859
+ this.add(labelLine);
1860
+ }
1861
+ relatedGraphic.onAnimateBind = () => {
1860
1862
  text.setAttributes(from);
1861
1863
  const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
1862
1864
  mode,
@@ -1866,69 +1868,58 @@
1866
1868
  delay
1867
1869
  });
1868
1870
  relatedGraphic.on('afterAttributeUpdate', listener);
1869
- });
1871
+ };
1872
+ }
1873
+ else {
1874
+ this.add(text);
1875
+ if (labelLine) {
1876
+ this.add(labelLine);
1877
+ }
1870
1878
  }
1871
1879
  }
1872
- else if (state === 'update') {
1880
+ if (state === 'update') {
1873
1881
  const prevLabel = prevTextMap.get(relatedGraphic);
1874
1882
  prevTextMap.delete(relatedGraphic);
1875
1883
  currentTextMap.set(relatedGraphic, prevLabel);
1876
- const prevText = prevLabel.text;
1877
- prevText.animate().to(text.attribute, duration, easing);
1878
- if (prevLabel.labelLine) {
1879
- prevLabel.labelLine.animate().to(vutils.merge({}, prevLabel.labelLine.attribute, {
1880
- points: (_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points
1881
- }), duration, easing);
1884
+ if (!disableAnimation) {
1885
+ const prevText = prevLabel.text;
1886
+ prevText.animate().to(text.attribute, duration, easing);
1887
+ if (prevLabel.labelLine) {
1888
+ prevLabel.labelLine.animate().to(vutils.merge({}, prevLabel.labelLine.attribute, {
1889
+ points: (_m = text.attribute) === null || _m === void 0 ? void 0 : _m.points
1890
+ }), duration, easing);
1891
+ }
1892
+ if (animationConfig.increaseEffect !== false &&
1893
+ prevText.attribute.text !== text.attribute.text &&
1894
+ vutils.isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))) {
1895
+ prevText
1896
+ .animate()
1897
+ .play(new vrender.IncreaseCount({ text: prevText.attribute.text }, { text: text.attribute.text }, duration, easing));
1898
+ }
1882
1899
  }
1883
- if (animationConfig.increaseEffect !== false &&
1884
- prevText.attribute.text !== text.attribute.text &&
1885
- vutils.isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))) {
1886
- prevText
1887
- .animate()
1888
- .play(new vrender.IncreaseCount({ text: prevText.attribute.text }, { text: text.attribute.text }, duration, easing));
1900
+ else {
1901
+ prevLabel.text.setAttributes(text.attribute);
1902
+ if (prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.labelLine) {
1903
+ prevLabel.labelLine.setAttributes({ points: (_o = text.attribute) === null || _o === void 0 ? void 0 : _o.points });
1904
+ }
1889
1905
  }
1890
1906
  }
1891
1907
  });
1892
1908
  prevTextMap.forEach(label => {
1893
1909
  var _a;
1894
- (_a = label.text) === null || _a === void 0 ? void 0 : _a.animate().to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, duration, easing).onEnd(() => {
1910
+ if (disableAnimation) {
1895
1911
  this.removeChild(label.text);
1896
1912
  if (label === null || label === void 0 ? void 0 : label.labelLine) {
1897
1913
  this.removeChild(label.labelLine);
1898
1914
  }
1899
- });
1900
- });
1901
- this._graphicToText = currentTextMap;
1902
- }
1903
- _renderWithOutAnimation(labels) {
1904
- const currentTextMap = new Map();
1905
- const prevTextMap = this._graphicToText || new Map();
1906
- labels.forEach(text => {
1907
- var _a;
1908
- const labelLine = this._labelLine(text);
1909
- const relatedGraphic = this._idToGraphic.get(text.attribute.id);
1910
- const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(relatedGraphic)) ? 'update' : 'enter';
1911
- if (state === 'enter') {
1912
- currentTextMap.set(relatedGraphic, labelLine ? { text, labelLine } : { text });
1913
- this.add(text);
1914
- if (labelLine) {
1915
- this.add(labelLine);
1916
- }
1917
1915
  }
1918
- else if (state === 'update') {
1919
- const prevLabel = prevTextMap.get(relatedGraphic);
1920
- prevTextMap.delete(relatedGraphic);
1921
- currentTextMap.set(relatedGraphic, prevLabel);
1922
- prevLabel.text.setAttributes(text.attribute);
1923
- if (prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.labelLine) {
1924
- prevLabel.labelLine.setAttributes({ points: (_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points });
1925
- }
1926
- }
1927
- });
1928
- prevTextMap.forEach(label => {
1929
- this.removeChild(label.text);
1930
- if (label === null || label === void 0 ? void 0 : label.labelLine) {
1931
- this.removeChild(label.labelLine);
1916
+ else {
1917
+ (_a = label.text) === null || _a === void 0 ? void 0 : _a.animate().to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, duration, easing).onEnd(() => {
1918
+ this.removeChild(label.text);
1919
+ if (label === null || label === void 0 ? void 0 : label.labelLine) {
1920
+ this.removeChild(label.labelLine);
1921
+ }
1922
+ });
1932
1923
  }
1933
1924
  });
1934
1925
  this._graphicToText = currentTextMap;
@@ -1999,20 +1990,21 @@
1999
1990
  continue;
2000
1991
  }
2001
1992
  const baseMark = this._idToGraphic.get(label.attribute.id);
2002
- const isInside = this._canPlaceInside(label.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds);
1993
+ let isInside = canPlaceInside(label.AABBBounds, baseMark === null || baseMark === void 0 ? void 0 : baseMark.AABBBounds);
1994
+ if (this.attribute.type === 'arc') {
1995
+ isInside = this.attribute.position === 'inside';
1996
+ }
2003
1997
  const backgroundColor = baseMark.attribute.fill;
2004
1998
  const foregroundColor = label.attribute.fill;
2005
1999
  const baseColor = backgroundColor;
2006
2000
  const invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors);
2007
- const similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
2001
+ const simialrColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
2008
2002
  if (isInside) {
2009
- const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
2010
- fill && label.setAttributes({ fill });
2003
+ this.setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor);
2011
2004
  if (label.attribute.lineWidth === 0) {
2012
2005
  continue;
2013
2006
  }
2014
- const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
2015
- stroke && label.setAttributes({ stroke });
2007
+ this.setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor);
2016
2008
  }
2017
2009
  else {
2018
2010
  if (label.attribute.lineWidth === 0) {
@@ -2024,18 +2016,47 @@
2024
2016
  });
2025
2017
  continue;
2026
2018
  }
2027
- const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
2028
- fill && label.setAttributes({ fill });
2029
- const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
2030
- stroke && label.setAttributes({ stroke });
2019
+ this.setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor);
2020
+ this.setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor);
2031
2021
  }
2032
2022
  }
2033
2023
  }
2034
- _canPlaceInside(textBound, shapeBound) {
2035
- if (!textBound || !shapeBound) {
2036
- return false;
2024
+ setFillStrategy(fillStrategy, label, baseColor, invertColor, simialrColor) {
2025
+ switch (fillStrategy) {
2026
+ case 'base':
2027
+ label.setAttributes({
2028
+ fill: baseColor
2029
+ });
2030
+ break;
2031
+ case 'invertBase':
2032
+ label.setAttributes({
2033
+ fill: invertColor
2034
+ });
2035
+ break;
2036
+ case 'similarBase':
2037
+ label.setAttributes({
2038
+ fill: simialrColor
2039
+ });
2040
+ }
2041
+ }
2042
+ setStrokeStrategy(strokeStrategy, label, baseColor, invertColor, simialrColor) {
2043
+ switch (strokeStrategy) {
2044
+ case 'base':
2045
+ label.setAttributes({
2046
+ stroke: baseColor
2047
+ });
2048
+ break;
2049
+ case 'invertBase':
2050
+ label.setAttributes({
2051
+ stroke: invertColor
2052
+ });
2053
+ break;
2054
+ case 'similarBase':
2055
+ label.setAttributes({
2056
+ stroke: simialrColor
2057
+ });
2058
+ break;
2037
2059
  }
2038
- return shapeBound.encloses(textBound);
2039
2060
  }
2040
2061
  setLocation(point) {
2041
2062
  this.translateTo(point.x, point.y);
@@ -2047,16 +2068,6 @@
2047
2068
  this._enableAnimation = true;
2048
2069
  }
2049
2070
  }
2050
- LabelBase.defaultAttributes = {
2051
- textStyle: {
2052
- fontSize: 12,
2053
- textAlign: 'center',
2054
- textBaseline: 'middle',
2055
- boundsPadding: [-1, 0, -1, 0]
2056
- },
2057
- offset: 0,
2058
- pickable: false
2059
- };
2060
2071
 
2061
2072
  class SymbolLabel extends LabelBase {
2062
2073
  constructor(attributes) {
@@ -2411,31 +2422,6 @@
2411
2422
  }
2412
2423
  return { x: 0, y: 0 };
2413
2424
  }
2414
- _layout(data = []) {
2415
- const labels = super._layout(data);
2416
- const textBoundsArray = labels.map(label => this.getGraphicBounds(label));
2417
- const ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), { text: '...' });
2418
- const ellipsisText = this._createLabelText(ellipsisLabelAttribute);
2419
- const ellipsisTextBounds = this.getGraphicBounds(ellipsisText);
2420
- const ellipsisWidth = ellipsisTextBounds.x2 - ellipsisTextBounds.x1;
2421
- const arcs = this.layoutArcLabels(this.attribute.position, this.attribute, Array.from(this._idToGraphic.values()), data, textBoundsArray, ellipsisWidth);
2422
- for (let i = 0; i < data.length; i++) {
2423
- const textData = data[i];
2424
- const basedArc = arcs.find(arc => arc.refDatum.id === textData.id);
2425
- const labelAttribute = {
2426
- visible: basedArc.labelVisible,
2427
- x: basedArc.labelPosition.x,
2428
- y: basedArc.labelPosition.y,
2429
- angle: basedArc.angle,
2430
- maxLineWidth: basedArc.labelLimit,
2431
- points: (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointA) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointB) && (basedArc === null || basedArc === void 0 ? void 0 : basedArc.pointC)
2432
- ? [basedArc.pointA, basedArc.pointB, basedArc.pointC]
2433
- : undefined
2434
- };
2435
- labels[i].setAttributes(labelAttribute);
2436
- }
2437
- return labels;
2438
- }
2439
2425
  layoutArcLabels(position, attribute, currentMarks, data, textBoundsArray, ellipsisWidth) {
2440
2426
  var _a;
2441
2427
  this._arcLeft.clear();
@@ -3002,18 +2988,6 @@
3002
2988
  }
3003
2989
  }
3004
2990
  }
3005
- _labelLine(text) {
3006
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
3007
- const labelLine = ((_a = text.attribute) === null || _a === void 0 ? void 0 : _a.points)
3008
- ? vrender.createLine({
3009
- visible: (_c = (_b = text.attribute) === null || _b === void 0 ? void 0 : _b.visible) !== null && _c !== void 0 ? _c : true,
3010
- stroke: (_f = (_e = (_d = text.attribute) === null || _d === void 0 ? void 0 : _d.line) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f : (_g = text.attribute) === null || _g === void 0 ? void 0 : _g.fill,
3011
- lineWidth: (_k = (_j = (_h = text.attribute) === null || _h === void 0 ? void 0 : _h.line) === null || _j === void 0 ? void 0 : _j.lineWidth) !== null && _k !== void 0 ? _k : 1,
3012
- points: (_l = text.attribute) === null || _l === void 0 ? void 0 : _l.points
3013
- })
3014
- : undefined;
3015
- return labelLine;
3016
- }
3017
2991
  computeRadius(r, width, height, centerOffset, k) {
3018
2992
  var _a;
3019
2993
  return ((_a = this.computeLayoutRadius(width ? width : 0, height ? height : 0) * r * (vutils.isNil(k) ? 1 : k) + centerOffset) !== null && _a !== void 0 ? _a : 0);
@@ -3021,9 +2995,6 @@
3021
2995
  computeLayoutRadius(width, height) {
3022
2996
  return Math.min(width / 2, height / 2);
3023
2997
  }
3024
- _canPlaceInside(textBound, shapeBound) {
3025
- return this.attribute.position === 'inside';
3026
- }
3027
2998
  computeLayoutOuterRadius(r, width, height) {
3028
2999
  return r / (Math.min(width, height) / 2);
3029
3000
  }
@@ -3088,8 +3059,7 @@
3088
3059
  const prevComponentMap = this._componentMap;
3089
3060
  for (let i = 0; i < dataLabels.length; i++) {
3090
3061
  const dataLabel = dataLabels[i];
3091
- const labelComponent = labelComponentMap[dataLabel.type] || LabelBase;
3092
- if (labelComponent) {
3062
+ if (labelComponentMap[dataLabel.type]) {
3093
3063
  const { baseMarkGroupName } = dataLabel;
3094
3064
  let component = this._componentMap.get(baseMarkGroupName);
3095
3065
  if (component) {
@@ -3099,7 +3069,7 @@
3099
3069
  currentComponentMap.set(baseMarkGroupName, component);
3100
3070
  }
3101
3071
  else {
3102
- component = new labelComponent(dataLabel);
3072
+ component = new labelComponentMap[dataLabel.type](dataLabel);
3103
3073
  component.setBitmap(bitmap);
3104
3074
  component.setBitmapTool(tool);
3105
3075
  this.add(component);
@@ -3132,156 +3102,6 @@
3132
3102
  pickable: false
3133
3103
  };
3134
3104
 
3135
- function getLinePath(points, closed) {
3136
- let path = '';
3137
- if (points.length === 0) {
3138
- return path;
3139
- }
3140
- points.forEach((point, index) => {
3141
- if (index === 0) {
3142
- path = `M${point.x},${point.y}`;
3143
- }
3144
- else {
3145
- path += `L${point.x},${point.y}`;
3146
- }
3147
- });
3148
- if (closed) {
3149
- path += 'Z';
3150
- }
3151
- return path;
3152
- }
3153
- function getArcPath(center, points, reverse, closed) {
3154
- let path = '';
3155
- if (!center || points.length === 0) {
3156
- return path;
3157
- }
3158
- const firstPoint = points[0];
3159
- const radius = vutils.PointService.distancePP(center, firstPoint);
3160
- const sweepFlag = reverse ? 0 : 1;
3161
- if (closed) {
3162
- path += `M${center.x},${center.y - radius}A${radius},${radius},0,0,${sweepFlag},${center.x},${center.y + radius}A${radius},${radius},0,0,${sweepFlag},${center.x},${center.y - radius}Z`;
3163
- }
3164
- else {
3165
- points.forEach((point, index) => {
3166
- if (index === 0) {
3167
- path = `M${point.x},${point.y}`;
3168
- }
3169
- else {
3170
- path += `A${radius},${radius},0,0,${sweepFlag},${point.x},${point.y}`;
3171
- }
3172
- });
3173
- }
3174
- return path;
3175
- }
3176
- function getRegionPath(from, to, attribute) {
3177
- const { type, closed } = attribute;
3178
- const reversePoints = to.slice(0).reverse();
3179
- let regionPath = '';
3180
- let nextPath = '';
3181
- if (type === 'line' && attribute.smoothLink && attribute.center) {
3182
- const fromStart = from[0];
3183
- const toEnd = reversePoints[0];
3184
- const center = attribute.center;
3185
- regionPath = getLinePath(from, !!closed);
3186
- nextPath = getLinePath(reversePoints, !!closed);
3187
- const toEndRadius = vutils.PointService.distancePP(toEnd, center);
3188
- const fromStartRadius = vutils.PointService.distancePP(fromStart, center);
3189
- regionPath += `A${toEndRadius},${toEndRadius},0,0,1,${toEnd.x},${toEnd.y}L${toEnd.x},${toEnd.y}`;
3190
- nextPath += `A${fromStartRadius},${fromStartRadius},0,0,0,${fromStart.x},${fromStart.y}`;
3191
- }
3192
- else if (type === 'circle') {
3193
- const { center } = attribute;
3194
- regionPath = getArcPath(center, from, false, !!closed);
3195
- nextPath = getArcPath(center, reversePoints, true, !!closed);
3196
- }
3197
- else if (type === 'line' || type === 'polygon') {
3198
- regionPath = getLinePath(from, !!closed);
3199
- nextPath = getLinePath(reversePoints, !!closed);
3200
- }
3201
- if (closed) {
3202
- regionPath += nextPath;
3203
- }
3204
- else {
3205
- nextPath = 'L' + nextPath.substring(1);
3206
- regionPath += nextPath;
3207
- regionPath += 'Z';
3208
- }
3209
- return regionPath;
3210
- }
3211
- class Grid extends AbstractComponent {
3212
- constructor(attributes) {
3213
- super(vutils.merge({}, Grid.defaultAttributes, attributes));
3214
- this.name = 'grid';
3215
- }
3216
- render() {
3217
- this.removeAllChild();
3218
- const { type, items, style, closed, alternateColor, depth = 0 } = this.attribute;
3219
- if (vutils.isEmpty(items)) {
3220
- return;
3221
- }
3222
- items.forEach((item, index) => {
3223
- const { id, points } = item;
3224
- let path = '';
3225
- if (type === 'line' || type === 'polygon') {
3226
- path = getLinePath(points, !!closed);
3227
- }
3228
- else if (type === 'circle') {
3229
- const { center } = this.attribute;
3230
- path = getArcPath(center, points, false, !!closed);
3231
- }
3232
- const shape = vrender.createPath(Object.assign({ path, z: depth }, (vutils.isFunction(style) ? vutils.merge({}, Grid.defaultAttributes.style, style(item, index)) : style)));
3233
- shape.name = `${this.name}-line`;
3234
- shape.id = this._getNodeId(`path-${id}`);
3235
- this.add(shape);
3236
- });
3237
- if (depth && type === 'line') {
3238
- items.forEach((item, index) => {
3239
- const { id, points } = item;
3240
- const nextPoints = [];
3241
- nextPoints.push(points[0]);
3242
- const dir = { x: points[1].x - points[0].x, y: points[1].y - points[0].y };
3243
- const dirLen = Math.sqrt(dir.x * dir.x + dir.y * dir.y);
3244
- const ratio = depth / dirLen;
3245
- nextPoints.push({ x: points[0].x + dir.x * ratio, y: points[0].y + dir.y * ratio });
3246
- const path = getLinePath(nextPoints, !!closed);
3247
- const deltaX = vutils.abs(nextPoints[0].x - nextPoints[1].x);
3248
- const deltaY = vutils.abs(nextPoints[0].y - nextPoints[1].y);
3249
- const shape = vrender.createPath(Object.assign({ path, z: 0, alpha: deltaX > deltaY ? ((points[1].x - points[0].x > 0 ? -1 : 1) * vutils.pi) / 2 : 0, beta: deltaX < deltaY ? -vutils.pi / 2 : 0, anchor3d: deltaX > deltaY ? [nextPoints[0].x, 0] : [0, nextPoints[0].y] }, (vutils.isFunction(style) ? vutils.merge({}, Grid.defaultAttributes.style, style(item, index)) : style)));
3250
- shape.name = `${this.name}-line`;
3251
- shape.id = this._getNodeId(`path-${id}`);
3252
- this.add(shape);
3253
- });
3254
- }
3255
- if (items.length > 1 && alternateColor) {
3256
- const colors = vutils.isArray(alternateColor)
3257
- ? alternateColor
3258
- : [alternateColor, 'transparent'];
3259
- const getColor = (index) => colors[index % colors.length];
3260
- for (let index = 0; index < items.length - 1; index++) {
3261
- const [prev, curr] = [items[index].points, items[index + 1].points];
3262
- const path = getRegionPath(prev, curr, this.attribute);
3263
- const shape = vrender.createPath({
3264
- path,
3265
- fill: getColor(index)
3266
- });
3267
- shape.name = `${this.name}-region`;
3268
- shape.id = this._getNodeId(`region-${index}`);
3269
- this.add(shape);
3270
- }
3271
- }
3272
- }
3273
- _getNodeId(id) {
3274
- return `${this.id}-${id}`;
3275
- }
3276
- }
3277
- Grid.defaultAttributes = {
3278
- style: {
3279
- lineWidth: 1,
3280
- stroke: '#416180'
3281
- },
3282
- zIndex: 0
3283
- };
3284
-
3285
3105
  class Segment extends AbstractComponent {
3286
3106
  constructor(attributes) {
3287
3107
  super(vutils.merge({}, Segment.defaultAttributes, attributes));
@@ -3499,23 +3319,6 @@
3499
3319
  stroke: '#000',
3500
3320
  strokeOpacity: 1
3501
3321
  }
3502
- },
3503
- grid: {
3504
- style: {
3505
- lineWidth: 1,
3506
- stroke: '#999',
3507
- strokeOpacity: 1,
3508
- lineDash: [4, 4]
3509
- }
3510
- },
3511
- subGrid: {
3512
- visible: false,
3513
- style: {
3514
- lineWidth: 1,
3515
- stroke: '#999',
3516
- strokeOpacity: 1,
3517
- lineDash: [4, 4]
3518
- }
3519
3322
  }
3520
3323
  };
3521
3324
 
@@ -3612,7 +3415,7 @@
3612
3415
  }
3613
3416
  }
3614
3417
  _renderInner(container) {
3615
- const { title, label, tick, line, grid, items } = this.attribute;
3418
+ const { title, label, tick, line, items } = this.attribute;
3616
3419
  const axisContainer = vrender.createGroup({ x: 0, y: 0, zIndex: 1 });
3617
3420
  axisContainer.name = exports.AXIS_ELEMENT_NAME.axisContainer;
3618
3421
  axisContainer.id = this._getNodeId('container');
@@ -3641,9 +3444,6 @@
3641
3444
  this.afterLabelsOverlap(labels, axisItems, layerLabelGroup, layer, items.length);
3642
3445
  });
3643
3446
  }
3644
- if (grid === null || grid === void 0 ? void 0 : grid.visible) {
3645
- this.renderGrid(container);
3646
- }
3647
3447
  }
3648
3448
  if (title === null || title === void 0 ? void 0 : title.visible) {
3649
3449
  this.renderTitle(axisContainer);
@@ -3760,13 +3560,6 @@
3760
3560
  axisTitle.id = this._getNodeId('title');
3761
3561
  container.add(axisTitle);
3762
3562
  }
3763
- renderGrid(container) {
3764
- const { visible } = this.attribute.subGrid || {};
3765
- if (visible) {
3766
- this._renderGridByType('subGrid', container);
3767
- }
3768
- this._renderGridByType('grid', container);
3769
- }
3770
3563
  getVerticalCoord(point, offset, inside) {
3771
3564
  const vector = this.getVerticalVector(offset, inside, point);
3772
3565
  return {
@@ -3937,13 +3730,6 @@
3937
3730
  });
3938
3731
  return data;
3939
3732
  }
3940
- _renderGridByType(type, container) {
3941
- const gridAttrs = this.getGridAttribute(type);
3942
- const gridGroup = new Grid(Object.assign(Object.assign({ pickable: false }, gridAttrs), { zIndex: 0 }));
3943
- gridGroup.name = type === 'subGrid' ? `${exports.AXIS_ELEMENT_NAME.grid}-sub` : `${exports.AXIS_ELEMENT_NAME.grid}`;
3944
- gridGroup.id = this._getNodeId(type);
3945
- container.add(gridGroup);
3946
- }
3947
3733
  }
3948
3734
 
3949
3735
  const methods = {
@@ -4099,14 +3885,12 @@
4099
3885
  }
4100
3886
  function rotateYAxis(orient, items) {
4101
3887
  items.forEach((item, i) => {
4102
- item.attribute.angle &&
4103
- item.setAttributes(Object.assign(Object.assign({}, getYAxisLabelAlign(orient, item.attribute.angle)), { angle: clampAngle(item.attribute.angle) }));
3888
+ item.setAttributes(Object.assign(Object.assign({}, getYAxisLabelAlign(orient, item.attribute.angle)), { angle: clampAngle(item.attribute.angle) }));
4104
3889
  });
4105
3890
  }
4106
3891
  function rotateXAxis(orient, items) {
4107
3892
  items.forEach(item => {
4108
- item.attribute.angle &&
4109
- item.setAttributes(Object.assign(Object.assign({}, getXAxisLabelAlign(orient, item.attribute.angle)), { angle: clampAngle(item.attribute.angle) }));
3893
+ item.setAttributes(Object.assign(Object.assign({}, getXAxisLabelAlign(orient, item.attribute.angle)), { angle: clampAngle(item.attribute.angle) }));
4110
3894
  });
4111
3895
  }
4112
3896
  function getXAxisLabelAlign(orient, angle = 0) {
@@ -4242,15 +4026,31 @@
4242
4026
  }
4243
4027
  }
4244
4028
 
4245
- function getCirclePoints(center, count, radius, startAngle, endAngle) {
4246
- const points = [];
4247
- const range = endAngle - startAngle;
4248
- for (let i = 0; i < count; i++) {
4249
- const angle = startAngle + (i * range) / count;
4250
- points.push(vutils.polarToCartesian(center, radius, angle));
4029
+ class LineAxisMixin {
4030
+ isInValidValue(value) {
4031
+ return value < 0 || value > 1;
4032
+ }
4033
+ getTickCoord(tickValue) {
4034
+ const { start } = this.attribute;
4035
+ const axisVector = this.getRelativeVector();
4036
+ return {
4037
+ x: start.x + axisVector[0] * tickValue,
4038
+ y: start.y + axisVector[1] * tickValue
4039
+ };
4040
+ }
4041
+ getRelativeVector(point) {
4042
+ const { start, end } = this.attribute;
4043
+ return [end.x - start.x, end.y - start.y];
4044
+ }
4045
+ getVerticalVector(offset, inside = false, point) {
4046
+ const { verticalFactor = 1 } = this.attribute;
4047
+ const axisVector = this.getRelativeVector();
4048
+ const normalizedAxisVector = normalize(axisVector);
4049
+ const verticalVector = [normalizedAxisVector[1], normalizedAxisVector[0] * -1];
4050
+ return scale(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
4251
4051
  }
4252
- return points;
4253
4052
  }
4053
+
4254
4054
  class LineAxis extends AxisBase {
4255
4055
  constructor(attributes, mode) {
4256
4056
  super(vutils.merge({}, LineAxis.defaultAttributes, attributes), mode);
@@ -4288,28 +4088,6 @@
4288
4088
  axisLineGroup.id = this._getNodeId('line');
4289
4089
  container.add(axisLineGroup);
4290
4090
  }
4291
- isInValidValue(value) {
4292
- return value < 0 || value > 1;
4293
- }
4294
- getTickCoord(tickValue) {
4295
- const { start } = this.attribute;
4296
- const axisVector = this.getRelativeVector();
4297
- return {
4298
- x: start.x + axisVector[0] * tickValue,
4299
- y: start.y + axisVector[1] * tickValue
4300
- };
4301
- }
4302
- getRelativeVector() {
4303
- const { start, end } = this.attribute;
4304
- return [end.x - start.x, end.y - start.y];
4305
- }
4306
- getVerticalVector(offset, inside = false) {
4307
- const { verticalFactor = 1 } = this.attribute;
4308
- const axisVector = this.getRelativeVector();
4309
- const normalizedAxisVector = normalize(axisVector);
4310
- const verticalVector = [normalizedAxisVector[1], normalizedAxisVector[0] * -1];
4311
- return scale(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
4312
- }
4313
4091
  getTitleAttribute() {
4314
4092
  var _a, _b, _c, _d, _e, _f, _g, _h;
4315
4093
  const _j = this.attribute.title, { position = 'middle', space = 4, textStyle = {}, autoRotate = true, shape, background, state } = _j, restAttrs = __rest(_j, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state"]);
@@ -4394,7 +4172,7 @@
4394
4172
  }
4395
4173
  const offset = tickLength + labelLength + space;
4396
4174
  const titlePoint = this.getVerticalCoord(point, offset, false);
4397
- const vector = this.getVerticalVector(offset, false);
4175
+ const vector = this.getVerticalVector(offset, false, { x: 0, y: 0 });
4398
4176
  let { angle } = restAttrs;
4399
4177
  let textAlign;
4400
4178
  if (position === 'start') {
@@ -4442,100 +4220,6 @@
4442
4220
  }
4443
4221
  return attrs;
4444
4222
  }
4445
- _getGridPoint(gridType, point) {
4446
- let gridPoints;
4447
- if (gridType === 'line') {
4448
- const { length } = this.attribute.grid;
4449
- const endPoint = this.getVerticalCoord(point, length, true);
4450
- gridPoints = [point, endPoint];
4451
- }
4452
- else if (gridType === 'circle' || gridType === 'polygon') {
4453
- const { center, sides, startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE } = this.attribute.grid;
4454
- const distance = vutils.PointService.distancePP(center, point);
4455
- gridPoints = getCirclePoints(center, sides, distance, startAngle, endAngle);
4456
- }
4457
- return gridPoints;
4458
- }
4459
- getGridAttribute(type) {
4460
- const { type: gridType, alignWithLabel = true } = this.attribute.grid;
4461
- let tickSegment = 1;
4462
- const count = this.data.length;
4463
- if (count >= 2) {
4464
- tickSegment = this.data[1].value - this.data[0].value;
4465
- }
4466
- let gridAttribute;
4467
- let items = [];
4468
- if (type === 'grid') {
4469
- gridAttribute = this.attribute.grid;
4470
- const gridItems = [];
4471
- this.data.forEach(item => {
4472
- let { point } = item;
4473
- if (!alignWithLabel) {
4474
- const value = item.value - tickSegment / 2;
4475
- if (this.isInValidValue(value)) {
4476
- return;
4477
- }
4478
- point = this.getTickCoord(value);
4479
- }
4480
- gridItems.push({
4481
- id: item.label,
4482
- datum: item,
4483
- points: this._getGridPoint(gridType, point)
4484
- });
4485
- });
4486
- items = gridItems;
4487
- }
4488
- else {
4489
- gridAttribute = vutils.merge({}, this.attribute.grid, this.attribute.subGrid);
4490
- const subGridItems = [];
4491
- const { count: subCount = 4 } = this.attribute.subTick || {};
4492
- const tickLineCount = this.data.length;
4493
- if (tickLineCount >= 2) {
4494
- const points = [];
4495
- this.data.forEach((item) => {
4496
- let tickValue = item.value;
4497
- if (!alignWithLabel) {
4498
- const value = item.value - tickSegment / 2;
4499
- if (this.isInValidValue(value)) {
4500
- return;
4501
- }
4502
- tickValue = value;
4503
- }
4504
- points.push({
4505
- value: tickValue
4506
- });
4507
- });
4508
- for (let i = 0; i < points.length - 1; i++) {
4509
- const pre = points[i];
4510
- const next = points[i + 1];
4511
- subGridItems.push({
4512
- id: `sub-${i}-0`,
4513
- points: this._getGridPoint(gridType, this.getTickCoord(pre.value)),
4514
- datum: {}
4515
- });
4516
- for (let j = 0; j < subCount; j++) {
4517
- const percent = (j + 1) / (subCount + 1);
4518
- const value = (1 - percent) * pre.value + percent * next.value;
4519
- const point = this.getTickCoord(value);
4520
- subGridItems.push({
4521
- id: `sub-${i}-${j + 1}`,
4522
- points: this._getGridPoint(gridType, point),
4523
- datum: {}
4524
- });
4525
- }
4526
- if (i === points.length - 2) {
4527
- subGridItems.push({
4528
- id: `sub-${i}-${subCount + 1}`,
4529
- points: this._getGridPoint(gridType, this.getTickCoord(next.value)),
4530
- datum: {}
4531
- });
4532
- }
4533
- }
4534
- items = subGridItems;
4535
- }
4536
- }
4537
- return Object.assign(Object.assign({}, gridAttribute), { items });
4538
- }
4539
4223
  getTextBaseline(vector, inside) {
4540
4224
  let base = 'middle';
4541
4225
  const { verticalFactor = 1 } = this.attribute;
@@ -4572,92 +4256,6 @@
4572
4256
  };
4573
4257
  }
4574
4258
  beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
4575
- const { flush = false } = this.attribute.label || {};
4576
- if (flush) {
4577
- const { orient, start, end } = this.attribute;
4578
- const isX = orient === 'bottom' || orient === 'top';
4579
- const first = labelShapes[0];
4580
- const last = vutils.last(labelShapes);
4581
- const isInverse = isX ? first.attribute.x > last.attribute.x : first.attribute.y < last.attribute.y;
4582
- if (isX) {
4583
- const width = Math.abs(start.x - end.x);
4584
- if (isInverse) {
4585
- const start = width;
4586
- const end = 0;
4587
- const startBound = first.AABBBounds.x2;
4588
- const endBound = last.AABBBounds.x1;
4589
- if (startBound > start) {
4590
- first.setAttributes({
4591
- x: start,
4592
- textAlign: 'right'
4593
- });
4594
- }
4595
- if (endBound < end) {
4596
- last.setAttributes({
4597
- x: end,
4598
- textAlign: 'left'
4599
- });
4600
- }
4601
- }
4602
- else {
4603
- const start = 0;
4604
- const end = width;
4605
- const startBound = first.AABBBounds.x1;
4606
- const endBound = last.AABBBounds.x2;
4607
- if (startBound < start) {
4608
- first.setAttributes({
4609
- x: start,
4610
- textAlign: 'left'
4611
- });
4612
- }
4613
- if (endBound > end) {
4614
- last.setAttributes({
4615
- x: end,
4616
- textAlign: 'right'
4617
- });
4618
- }
4619
- }
4620
- }
4621
- else {
4622
- const height = Math.abs(start.y - end.y);
4623
- if (isInverse) {
4624
- const startBound = first.AABBBounds.y1;
4625
- const endBound = last.AABBBounds.y2;
4626
- const start = 0;
4627
- const end = height;
4628
- if (startBound < start) {
4629
- first.setAttributes({
4630
- y: start,
4631
- textBaseline: 'top'
4632
- });
4633
- }
4634
- if (endBound > end) {
4635
- last.setAttributes({
4636
- y: end,
4637
- textBaseline: 'bottom'
4638
- });
4639
- }
4640
- }
4641
- else {
4642
- const start = height;
4643
- const end = 0;
4644
- const startBound = first.AABBBounds.y2;
4645
- const endBound = last.AABBBounds.y1;
4646
- if (startBound > start) {
4647
- first.setAttributes({
4648
- y: start,
4649
- textBaseline: 'bottom'
4650
- });
4651
- }
4652
- if (endBound < end) {
4653
- last.setAttributes({
4654
- y: end,
4655
- textBaseline: 'top'
4656
- });
4657
- }
4658
- }
4659
- }
4660
- }
4661
4259
  return;
4662
4260
  }
4663
4261
  handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
@@ -4769,29 +4367,9 @@
4769
4367
  }
4770
4368
  }
4771
4369
  LineAxis.defaultAttributes = DEFAULT_AXIS_THEME;
4370
+ vutils.mixin(LineAxis, LineAxisMixin);
4772
4371
 
4773
- class CircleAxis extends AxisBase {
4774
- constructor(attributes) {
4775
- super(vutils.merge({}, CircleAxis.defaultAttributes, attributes));
4776
- }
4777
- renderLine(container) {
4778
- const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line, inside = false } = this.attribute;
4779
- let arcRadius = radius;
4780
- let arcInnerRadius = innerRadius;
4781
- if (inside && innerRadius > 0) {
4782
- arcRadius = innerRadius;
4783
- arcInnerRadius = 0;
4784
- }
4785
- const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
4786
- endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line === null || line === void 0 ? void 0 : line.style);
4787
- const axisLine = vrender.createCircle(arcAttrs);
4788
- axisLine.name = exports.AXIS_ELEMENT_NAME.line;
4789
- axisLine.id = this._getNodeId('line');
4790
- if (!vutils.isEmpty(line === null || line === void 0 ? void 0 : line.state)) {
4791
- axisLine.states = vutils.merge({}, DEFAULT_STATES$1, line.state);
4792
- }
4793
- container.add(axisLine);
4794
- }
4372
+ class CircleAxisMixin {
4795
4373
  isInValidValue(value) {
4796
4374
  const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE } = this.attribute;
4797
4375
  if (Math.abs(endAngle - startAngle) % (Math.PI * 2) === 0) {
@@ -4814,6 +4392,30 @@
4814
4392
  const { center } = this.attribute;
4815
4393
  return [point.y - center.y, -1 * (point.x - center.x)];
4816
4394
  }
4395
+ }
4396
+
4397
+ class CircleAxis extends AxisBase {
4398
+ constructor(attributes) {
4399
+ super(vutils.merge({}, CircleAxis.defaultAttributes, attributes));
4400
+ }
4401
+ renderLine(container) {
4402
+ const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line, inside = false } = this.attribute;
4403
+ let arcRadius = radius;
4404
+ let arcInnerRadius = innerRadius;
4405
+ if (inside && innerRadius > 0) {
4406
+ arcRadius = innerRadius;
4407
+ arcInnerRadius = 0;
4408
+ }
4409
+ const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
4410
+ endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line === null || line === void 0 ? void 0 : line.style);
4411
+ const axisLine = vrender.createCircle(arcAttrs);
4412
+ axisLine.name = exports.AXIS_ELEMENT_NAME.line;
4413
+ axisLine.id = this._getNodeId('line');
4414
+ if (!vutils.isEmpty(line === null || line === void 0 ? void 0 : line.state)) {
4415
+ axisLine.states = vutils.merge({}, DEFAULT_STATES$1, line.state);
4416
+ }
4417
+ container.add(axisLine);
4418
+ }
4817
4419
  getTitleAttribute() {
4818
4420
  var _a, _b, _c, _d, _e, _f, _g, _h;
4819
4421
  const { center, radius, innerRadius = 0 } = this.attribute;
@@ -4894,12 +4496,513 @@
4894
4496
  }
4895
4497
  }
4896
4498
  }
4897
- return subTickLineItems;
4499
+ return subTickLineItems;
4500
+ }
4501
+ getTextBaseline(vector) {
4502
+ let base = 'middle';
4503
+ if (vutils.isNumberClose(vector[1], 0)) {
4504
+ base = 'middle';
4505
+ }
4506
+ else if (vector[1] > 0 && vector[1] > Math.abs(vector[0])) {
4507
+ base = 'top';
4508
+ }
4509
+ else if (vector[1] < 0 && Math.abs(vector[1]) > Math.abs(vector[0])) {
4510
+ base = 'bottom';
4511
+ }
4512
+ return base;
4513
+ }
4514
+ beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
4515
+ return;
4516
+ }
4517
+ handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
4518
+ return;
4519
+ }
4520
+ afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
4521
+ return;
4522
+ }
4523
+ getLabelAlign(vector, inside, angle) {
4524
+ return {
4525
+ textAlign: this.getTextAlign(vector),
4526
+ textBaseline: this.getTextBaseline(vector)
4527
+ };
4528
+ }
4529
+ }
4530
+ CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME;
4531
+ vutils.mixin(CircleAxis, CircleAxisMixin);
4532
+
4533
+ function getElMap(g) {
4534
+ const elMap = {};
4535
+ traverseGroup(g, (el) => {
4536
+ if (el.type !== 'group' && el.id) {
4537
+ elMap[el.id] = el;
4538
+ }
4539
+ });
4540
+ return elMap;
4541
+ }
4542
+ class GroupTransition extends vrender.ACustomAnimate {
4543
+ constructor() {
4544
+ super(...arguments);
4545
+ this.mode = vrender.AnimateMode.NORMAL;
4546
+ }
4547
+ onBind() {
4548
+ const currentInnerView = this.target.getInnerView();
4549
+ const prevInnerView = this.target.getPrevInnerView();
4550
+ if (!prevInnerView) {
4551
+ return;
4552
+ }
4553
+ this._oldElementMap = getElMap(prevInnerView);
4554
+ this._newElementAttrMap = {};
4555
+ traverseGroup(currentInnerView, (el) => {
4556
+ var _a, _b, _c, _d, _e, _f;
4557
+ if (el.type !== 'group' && el.id) {
4558
+ const oldEl = this._oldElementMap[el.id];
4559
+ if (oldEl) {
4560
+ if (!vutils.isEqual(el.attribute, oldEl.attribute)) {
4561
+ const newProps = vutils.cloneDeep(el.attribute);
4562
+ this._newElementAttrMap[el.id] = {
4563
+ state: 'update',
4564
+ node: el,
4565
+ attrs: Object.assign(Object.assign({}, newProps), { opacity: (_a = newProps.opacity) !== null && _a !== void 0 ? _a : 1, fillOpacity: (_b = newProps.fillOpacity) !== null && _b !== void 0 ? _b : 1, strokeOpacity: (_c = newProps.strokeOpacity) !== null && _c !== void 0 ? _c : 1 })
4566
+ };
4567
+ el.setAttributes(oldEl.attribute);
4568
+ }
4569
+ }
4570
+ else {
4571
+ const finalOpacityAttrs = {
4572
+ opacity: (_d = el.attribute.opacity) !== null && _d !== void 0 ? _d : 1,
4573
+ fillOpacity: (_e = el.attribute.fillOpacity) !== null && _e !== void 0 ? _e : 1,
4574
+ strokeOpacity: (_f = el.attribute.strokeOpacity) !== null && _f !== void 0 ? _f : 1
4575
+ };
4576
+ this._newElementAttrMap[el.id] = {
4577
+ state: 'enter',
4578
+ node: el,
4579
+ attrs: finalOpacityAttrs
4580
+ };
4581
+ el.setAttributes({
4582
+ opacity: 0,
4583
+ fillOpacity: 0,
4584
+ strokeOpacity: 0
4585
+ });
4586
+ }
4587
+ }
4588
+ });
4589
+ }
4590
+ onStart() {
4591
+ let duration = this.duration;
4592
+ let easing = this.easing;
4593
+ Object.keys(this._newElementAttrMap).forEach(id => {
4594
+ var _a, _b, _c, _d, _e, _f, _g;
4595
+ const { node, attrs, state } = this._newElementAttrMap[id];
4596
+ if (state === 'enter') {
4597
+ duration = vutils.isValidNumber((_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.enter) === null || _b === void 0 ? void 0 : _b.duration) ? (_c = this.params) === null || _c === void 0 ? void 0 : _c.enter.duration : duration;
4598
+ easing = ((_e = (_d = this.params) === null || _d === void 0 ? void 0 : _d.enter) === null || _e === void 0 ? void 0 : _e.easing) ? (_g = (_f = this.params) === null || _f === void 0 ? void 0 : _f.enter) === null || _g === void 0 ? void 0 : _g.easing : easing;
4599
+ }
4600
+ if (node.type === 'path') {
4601
+ node
4602
+ .animate({
4603
+ interpolate(key, ratio, from, to, nextAttributes) {
4604
+ if (key === 'path') {
4605
+ nextAttributes.path = vutils.interpolateString(from, to)(ratio);
4606
+ return true;
4607
+ }
4608
+ return false;
4609
+ }
4610
+ })
4611
+ .to(attrs, duration, easing);
4612
+ }
4613
+ else {
4614
+ node
4615
+ .animate()
4616
+ .to(attrs, duration, easing);
4617
+ }
4618
+ });
4619
+ }
4620
+ onUpdate(end, ratio, out) {
4621
+ }
4622
+ }
4623
+
4624
+ class GroupFadeIn extends vrender.ACustomAnimate {
4625
+ constructor(from, to, duration, easing) {
4626
+ super(null, null, duration, easing);
4627
+ }
4628
+ getEndProps() {
4629
+ return {};
4630
+ }
4631
+ onBind() {
4632
+ this.target.setTheme({
4633
+ common: {
4634
+ opacity: 0
4635
+ }
4636
+ });
4637
+ return;
4638
+ }
4639
+ onEnd() {
4640
+ this.target.setTheme({
4641
+ common: {
4642
+ opacity: 1
4643
+ }
4644
+ });
4645
+ return;
4646
+ }
4647
+ onUpdate(end, ratio, out) {
4648
+ this.target.setTheme({
4649
+ common: {
4650
+ opacity: ratio
4651
+ }
4652
+ });
4653
+ }
4654
+ }
4655
+ class GroupFadeOut extends vrender.ACustomAnimate {
4656
+ constructor(from, to, duration, easing) {
4657
+ super(null, null, duration, easing);
4658
+ }
4659
+ getEndProps() {
4660
+ return {};
4661
+ }
4662
+ onBind() {
4663
+ this.target.setTheme({
4664
+ common: {
4665
+ opacity: 1
4666
+ }
4667
+ });
4668
+ return;
4669
+ }
4670
+ onEnd() {
4671
+ this.target.setTheme({
4672
+ common: {
4673
+ opacity: 0
4674
+ }
4675
+ });
4676
+ return;
4677
+ }
4678
+ onUpdate(end, ratio, out) {
4679
+ this.target.setTheme({
4680
+ common: {
4681
+ opacity: 1 - ratio
4682
+ }
4683
+ });
4684
+ }
4685
+ }
4686
+
4687
+ function getLinePath(points, closed) {
4688
+ let path = '';
4689
+ if (points.length === 0) {
4690
+ return path;
4691
+ }
4692
+ points.forEach((point, index) => {
4693
+ if (index === 0) {
4694
+ path = `M${point.x},${point.y}`;
4695
+ }
4696
+ else {
4697
+ path += `L${point.x},${point.y}`;
4698
+ }
4699
+ });
4700
+ if (closed) {
4701
+ path += 'Z';
4702
+ }
4703
+ return path;
4704
+ }
4705
+ function getArcPath(center, points, reverse, closed) {
4706
+ let path = '';
4707
+ if (!center || points.length === 0) {
4708
+ return path;
4709
+ }
4710
+ const firstPoint = points[0];
4711
+ const radius = vutils.PointService.distancePP(center, firstPoint);
4712
+ const sweepFlag = reverse ? 0 : 1;
4713
+ if (closed) {
4714
+ path += `M${center.x},${center.y - radius}A${radius},${radius},0,0,${sweepFlag},${center.x},${center.y + radius}A${radius},${radius},0,0,${sweepFlag},${center.x},${center.y - radius}Z`;
4715
+ }
4716
+ else {
4717
+ points.forEach((point, index) => {
4718
+ if (index === 0) {
4719
+ path = `M${point.x},${point.y}`;
4720
+ }
4721
+ else {
4722
+ path += `A${radius},${radius},0,0,${sweepFlag},${point.x},${point.y}`;
4723
+ }
4724
+ });
4725
+ }
4726
+ return path;
4727
+ }
4728
+ function getRegionPath(from, to, attribute) {
4729
+ const { type, closed } = attribute;
4730
+ const reversePoints = to.slice(0).reverse();
4731
+ let regionPath = '';
4732
+ let nextPath = '';
4733
+ if (type === 'line' && attribute.smoothLink && attribute.center) {
4734
+ const fromStart = from[0];
4735
+ const toEnd = reversePoints[0];
4736
+ const center = attribute.center;
4737
+ regionPath = getLinePath(from, !!closed);
4738
+ nextPath = getLinePath(reversePoints, !!closed);
4739
+ const toEndRadius = vutils.PointService.distancePP(toEnd, center);
4740
+ const fromStartRadius = vutils.PointService.distancePP(fromStart, center);
4741
+ regionPath += `A${toEndRadius},${toEndRadius},0,0,1,${toEnd.x},${toEnd.y}L${toEnd.x},${toEnd.y}`;
4742
+ nextPath += `A${fromStartRadius},${fromStartRadius},0,0,0,${fromStart.x},${fromStart.y}`;
4743
+ }
4744
+ else if (type === 'circle') {
4745
+ const { center } = attribute;
4746
+ regionPath = getArcPath(center, from, false, !!closed);
4747
+ nextPath = getArcPath(center, reversePoints, true, !!closed);
4748
+ }
4749
+ else if (type === 'line' || type === 'polygon') {
4750
+ regionPath = getLinePath(from, !!closed);
4751
+ nextPath = getLinePath(reversePoints, !!closed);
4752
+ }
4753
+ if (closed) {
4754
+ regionPath += nextPath;
4755
+ }
4756
+ else {
4757
+ nextPath = 'L' + nextPath.substring(1);
4758
+ regionPath += nextPath;
4759
+ regionPath += 'Z';
4760
+ }
4761
+ return regionPath;
4762
+ }
4763
+ class BaseGrid extends AbstractComponent {
4764
+ constructor() {
4765
+ super(...arguments);
4766
+ this.name = 'axis-grid';
4767
+ this.data = [];
4768
+ }
4769
+ getInnerView() {
4770
+ return this._innerView;
4771
+ }
4772
+ getPrevInnerView() {
4773
+ return this._prevInnerView;
4774
+ }
4775
+ render() {
4776
+ this.removeAllChild();
4777
+ this._prevInnerView = this._innerView;
4778
+ this._innerView = vrender.createGroup({ x: 0, y: 0, pickable: false });
4779
+ this.add(this._innerView);
4780
+ const { items, visible } = this.attribute;
4781
+ if (items && items.length && visible !== false) {
4782
+ this.data = this._transformItems(items);
4783
+ this._renderGrid(this._innerView);
4784
+ }
4785
+ }
4786
+ getVerticalCoord(point, offset, inside) {
4787
+ const vector = this.getVerticalVector(offset, inside, point);
4788
+ return {
4789
+ x: point.x + vector[0],
4790
+ y: point.y + vector[1]
4791
+ };
4792
+ }
4793
+ _transformItems(items) {
4794
+ const data = [];
4795
+ items.forEach((item) => {
4796
+ var _a;
4797
+ data.push(Object.assign(Object.assign({}, item), { point: this.getTickCoord(item.value), id: (_a = item.id) !== null && _a !== void 0 ? _a : item.label }));
4798
+ });
4799
+ return data;
4800
+ }
4801
+ _renderGrid(container) {
4802
+ const { visible } = this.attribute.subGrid || {};
4803
+ if (visible) {
4804
+ this._renderGridByType(true, container);
4805
+ }
4806
+ this._renderGridByType(false, container);
4807
+ }
4808
+ _renderGridByType(isSubGrid, container) {
4809
+ const gridAttrs = vutils.merge({}, this.attribute, this.getGridAttribute(isSubGrid));
4810
+ const { type, items, style, closed, alternateColor, depth = 0 } = gridAttrs;
4811
+ const name = isSubGrid ? `${exports.AXIS_ELEMENT_NAME.grid}-sub` : `${exports.AXIS_ELEMENT_NAME.grid}`;
4812
+ items.forEach((item, index) => {
4813
+ const { id, points } = item;
4814
+ let path = '';
4815
+ if (type === 'line' || type === 'polygon') {
4816
+ path = getLinePath(points, !!closed);
4817
+ }
4818
+ else if (type === 'circle') {
4819
+ const { center } = this.attribute;
4820
+ path = getArcPath(center, points, false, !!closed);
4821
+ }
4822
+ const shape = vrender.createPath(Object.assign({ path, z: depth }, (vutils.isFunction(style) ? vutils.merge({}, BaseGrid.defaultAttributes.style, style(item, index)) : style)));
4823
+ shape.name = `${name}-line`;
4824
+ shape.id = this._getNodeId(`${name}-path-${id}`);
4825
+ container.add(shape);
4826
+ });
4827
+ if (depth && type === 'line') {
4828
+ items.forEach((item, index) => {
4829
+ const { id, points } = item;
4830
+ const nextPoints = [];
4831
+ nextPoints.push(points[0]);
4832
+ const dir = { x: points[1].x - points[0].x, y: points[1].y - points[0].y };
4833
+ const dirLen = Math.sqrt(dir.x * dir.x + dir.y * dir.y);
4834
+ const ratio = depth / dirLen;
4835
+ nextPoints.push({ x: points[0].x + dir.x * ratio, y: points[0].y + dir.y * ratio });
4836
+ const path = getLinePath(nextPoints, !!closed);
4837
+ const deltaX = vutils.abs(nextPoints[0].x - nextPoints[1].x);
4838
+ const deltaY = vutils.abs(nextPoints[0].y - nextPoints[1].y);
4839
+ const shape = vrender.createPath(Object.assign({ path, z: 0, alpha: deltaX > deltaY ? ((points[1].x - points[0].x > 0 ? -1 : 1) * vutils.pi) / 2 : 0, beta: deltaX < deltaY ? -vutils.pi / 2 : 0, anchor3d: deltaX > deltaY ? [nextPoints[0].x, 0] : [0, nextPoints[0].y] }, (vutils.isFunction(style) ? vutils.merge({}, BaseGrid.defaultAttributes.style, style(item, index)) : style)));
4840
+ shape.name = `${name}-line`;
4841
+ shape.id = this._getNodeId(`${name}-path-${id}`);
4842
+ container.add(shape);
4843
+ });
4844
+ }
4845
+ if (items.length > 1 && alternateColor) {
4846
+ const colors = vutils.isArray(alternateColor)
4847
+ ? alternateColor
4848
+ : [alternateColor, 'transparent'];
4849
+ const getColor = (index) => colors[index % colors.length];
4850
+ for (let index = 0; index < items.length - 1; index++) {
4851
+ const [prev, curr] = [items[index].points, items[index + 1].points];
4852
+ const path = getRegionPath(prev, curr, gridAttrs);
4853
+ const shape = vrender.createPath({
4854
+ path,
4855
+ fill: getColor(index)
4856
+ });
4857
+ shape.name = `${name}-region`;
4858
+ shape.id = this._getNodeId(`${name}-region-${index}`);
4859
+ container.add(shape);
4860
+ }
4861
+ }
4862
+ }
4863
+ _getNodeId(id) {
4864
+ return `${this.id}-${id}`;
4865
+ }
4866
+ }
4867
+ BaseGrid.defaultAttributes = {
4868
+ style: {
4869
+ lineWidth: 1,
4870
+ stroke: '#999',
4871
+ strokeOpacity: 1,
4872
+ lineDash: [4, 4]
4873
+ },
4874
+ subGrid: {
4875
+ visible: false,
4876
+ style: {
4877
+ lineWidth: 1,
4878
+ stroke: '#999',
4879
+ strokeOpacity: 1,
4880
+ lineDash: [4, 4]
4881
+ }
4882
+ }
4883
+ };
4884
+
4885
+ function getCirclePoints(center, count, radius, startAngle, endAngle) {
4886
+ const points = [];
4887
+ const range = endAngle - startAngle;
4888
+ for (let i = 0; i < count; i++) {
4889
+ const angle = startAngle + (i * range) / count;
4890
+ points.push(vutils.polarToCartesian(center, radius, angle));
4891
+ }
4892
+ return points;
4893
+ }
4894
+ class LineAxisGrid extends BaseGrid {
4895
+ constructor(attributes, mode) {
4896
+ super(vutils.merge({}, BaseGrid.defaultAttributes, attributes), mode);
4897
+ if (mode === '3d') {
4898
+ this.setMode(mode);
4899
+ }
4900
+ }
4901
+ _getGridPoint(gridType, point) {
4902
+ let gridPoints;
4903
+ if (gridType === 'line') {
4904
+ const { length } = this.attribute;
4905
+ const endPoint = this.getVerticalCoord(point, length, true);
4906
+ gridPoints = [point, endPoint];
4907
+ }
4908
+ else if (gridType === 'circle' || gridType === 'polygon') {
4909
+ const { center, sides = 6, startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE } = this.attribute;
4910
+ const distance = vutils.PointService.distancePP(center, point);
4911
+ gridPoints = getCirclePoints(center, sides, distance, startAngle, endAngle);
4912
+ }
4913
+ return gridPoints;
4914
+ }
4915
+ getGridAttribute(isSubGrid) {
4916
+ const { type: gridType, alignWithLabel = true } = this.attribute;
4917
+ let tickSegment = 1;
4918
+ const count = this.data.length;
4919
+ if (count >= 2) {
4920
+ tickSegment = this.data[1].value - this.data[0].value;
4921
+ }
4922
+ let gridAttribute;
4923
+ let items = [];
4924
+ if (!isSubGrid) {
4925
+ gridAttribute = this.attribute;
4926
+ const gridItems = [];
4927
+ this.data.forEach(item => {
4928
+ let { point } = item;
4929
+ if (!alignWithLabel) {
4930
+ const value = item.value - tickSegment / 2;
4931
+ if (this.isInValidValue(value)) {
4932
+ return;
4933
+ }
4934
+ point = this.getTickCoord(value);
4935
+ }
4936
+ gridItems.push({
4937
+ id: item.label,
4938
+ datum: item,
4939
+ points: this._getGridPoint(gridType, point)
4940
+ });
4941
+ });
4942
+ items = gridItems;
4943
+ }
4944
+ else {
4945
+ gridAttribute = vutils.merge({}, this.attribute, this.attribute.subGrid);
4946
+ const subGridItems = [];
4947
+ const { count: subCount = 4 } = this.attribute.subGrid || {};
4948
+ const tickLineCount = this.data.length;
4949
+ if (tickLineCount >= 2) {
4950
+ const points = [];
4951
+ this.data.forEach((item) => {
4952
+ let tickValue = item.value;
4953
+ if (!alignWithLabel) {
4954
+ const value = item.value - tickSegment / 2;
4955
+ if (this.isInValidValue(value)) {
4956
+ return;
4957
+ }
4958
+ tickValue = value;
4959
+ }
4960
+ points.push({
4961
+ value: tickValue
4962
+ });
4963
+ });
4964
+ for (let i = 0; i < points.length - 1; i++) {
4965
+ const pre = points[i];
4966
+ const next = points[i + 1];
4967
+ subGridItems.push({
4968
+ id: `sub-${i}-0`,
4969
+ points: this._getGridPoint(gridType, this.getTickCoord(pre.value)),
4970
+ datum: {}
4971
+ });
4972
+ for (let j = 0; j < subCount; j++) {
4973
+ const percent = (j + 1) / (subCount + 1);
4974
+ const value = (1 - percent) * pre.value + percent * next.value;
4975
+ const point = this.getTickCoord(value);
4976
+ subGridItems.push({
4977
+ id: `sub-${i}-${j + 1}`,
4978
+ points: this._getGridPoint(gridType, point),
4979
+ datum: {}
4980
+ });
4981
+ }
4982
+ if (i === points.length - 2) {
4983
+ subGridItems.push({
4984
+ id: `sub-${i}-${subCount + 1}`,
4985
+ points: this._getGridPoint(gridType, this.getTickCoord(next.value)),
4986
+ datum: {}
4987
+ });
4988
+ }
4989
+ }
4990
+ items = subGridItems;
4991
+ }
4992
+ }
4993
+ return Object.assign(Object.assign({}, gridAttribute), { items });
4994
+ }
4995
+ }
4996
+ vutils.mixin(LineAxisGrid, LineAxisMixin);
4997
+
4998
+ class CircleAxisGrid extends BaseGrid {
4999
+ constructor(attributes) {
5000
+ super(vutils.merge({}, BaseGrid.defaultAttributes, attributes));
4898
5001
  }
4899
- getGridAttribute(type) {
5002
+ getGridAttribute(isSubGrid) {
4900
5003
  let gridAttribute;
4901
5004
  let items = [];
4902
- const { radius, innerRadius = 0, startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, center, grid } = this.attribute;
5005
+ const _a = this.attribute, { radius, innerRadius = 0, startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, center, subGrid } = _a, grid = __rest(_a, ["radius", "innerRadius", "startAngle", "endAngle", "center", "subGrid"]);
4903
5006
  const { alignWithLabel = true } = grid || {};
4904
5007
  const length = radius - innerRadius;
4905
5008
  let tickSegment = 1;
@@ -4907,8 +5010,8 @@
4907
5010
  if (count >= 2) {
4908
5011
  tickSegment = this.data[1].value - this.data[0].value;
4909
5012
  }
4910
- if (type === 'grid') {
4911
- gridAttribute = this.attribute.grid;
5013
+ if (!isSubGrid) {
5014
+ gridAttribute = grid;
4912
5015
  const gridItems = [];
4913
5016
  let data;
4914
5017
  if (Math.abs(endAngle - startAngle) % (Math.PI * 2) === 0) {
@@ -4936,9 +5039,9 @@
4936
5039
  items = gridItems;
4937
5040
  }
4938
5041
  else {
4939
- gridAttribute = vutils.merge({}, this.attribute.grid, this.attribute.subGrid);
5042
+ gridAttribute = vutils.merge({}, grid, subGrid);
4940
5043
  const subGridItems = [];
4941
- const { count: subCount = 4 } = this.attribute.subTick || {};
5044
+ const { count: subCount = 4 } = subGrid || {};
4942
5045
  const tickLineCount = this.data.length;
4943
5046
  if (tickLineCount >= 2) {
4944
5047
  const points = [];
@@ -4982,192 +5085,10 @@
4982
5085
  }
4983
5086
  }
4984
5087
  return Object.assign(Object.assign({}, gridAttribute), { items,
4985
- center });
4986
- }
4987
- getTextBaseline(vector) {
4988
- let base = 'middle';
4989
- if (vutils.isNumberClose(vector[1], 0)) {
4990
- base = 'middle';
4991
- }
4992
- else if (vector[1] > 0 && vector[1] > Math.abs(vector[0])) {
4993
- base = 'top';
4994
- }
4995
- else if (vector[1] < 0 && Math.abs(vector[1]) > Math.abs(vector[0])) {
4996
- base = 'bottom';
4997
- }
4998
- return base;
4999
- }
5000
- beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
5001
- return;
5002
- }
5003
- handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
5004
- return;
5005
- }
5006
- afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
5007
- return;
5008
- }
5009
- getLabelAlign(vector, inside, angle) {
5010
- return {
5011
- textAlign: this.getTextAlign(vector),
5012
- textBaseline: this.getTextBaseline(vector)
5013
- };
5014
- }
5015
- }
5016
- CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME;
5017
-
5018
- function getElMap(g) {
5019
- const elMap = {};
5020
- traverseGroup(g, (el) => {
5021
- if (el.type !== 'group' && el.id) {
5022
- elMap[el.id] = el;
5023
- }
5024
- });
5025
- return elMap;
5026
- }
5027
- class GroupTransition extends vrender.ACustomAnimate {
5028
- constructor() {
5029
- super(...arguments);
5030
- this.mode = vrender.AnimateMode.NORMAL;
5031
- }
5032
- onBind() {
5033
- const currentInnerView = this.target.getInnerView();
5034
- const prevInnerView = this.target.getPrevInnerView();
5035
- if (!prevInnerView) {
5036
- return;
5037
- }
5038
- this._oldElementMap = getElMap(prevInnerView);
5039
- this._newElementAttrMap = {};
5040
- traverseGroup(currentInnerView, (el) => {
5041
- var _a, _b, _c, _d, _e, _f;
5042
- if (el.type !== 'group' && el.id) {
5043
- const oldEl = this._oldElementMap[el.id];
5044
- if (oldEl) {
5045
- if (!vutils.isEqual(el.attribute, oldEl.attribute)) {
5046
- const newProps = vutils.cloneDeep(el.attribute);
5047
- this._newElementAttrMap[el.id] = {
5048
- state: 'update',
5049
- node: el,
5050
- attrs: Object.assign(Object.assign({}, newProps), { opacity: (_a = newProps.opacity) !== null && _a !== void 0 ? _a : 1, fillOpacity: (_b = newProps.fillOpacity) !== null && _b !== void 0 ? _b : 1, strokeOpacity: (_c = newProps.strokeOpacity) !== null && _c !== void 0 ? _c : 1 })
5051
- };
5052
- el.setAttributes(oldEl.attribute);
5053
- }
5054
- }
5055
- else {
5056
- const finalOpacityAttrs = {
5057
- opacity: (_d = el.attribute.opacity) !== null && _d !== void 0 ? _d : 1,
5058
- fillOpacity: (_e = el.attribute.fillOpacity) !== null && _e !== void 0 ? _e : 1,
5059
- strokeOpacity: (_f = el.attribute.strokeOpacity) !== null && _f !== void 0 ? _f : 1
5060
- };
5061
- this._newElementAttrMap[el.id] = {
5062
- state: 'enter',
5063
- node: el,
5064
- attrs: finalOpacityAttrs
5065
- };
5066
- el.setAttributes({
5067
- opacity: 0,
5068
- fillOpacity: 0,
5069
- strokeOpacity: 0
5070
- });
5071
- }
5072
- }
5073
- });
5074
- }
5075
- onStart() {
5076
- let duration = this.duration;
5077
- let easing = this.easing;
5078
- Object.keys(this._newElementAttrMap).forEach(id => {
5079
- var _a, _b, _c;
5080
- const { node, attrs, state } = this._newElementAttrMap[id];
5081
- if (state === 'enter') {
5082
- duration = vutils.isValidNumber((_a = this.params.enter) === null || _a === void 0 ? void 0 : _a.duration) ? this.params.enter.duration : duration;
5083
- easing = ((_b = this.params.enter) === null || _b === void 0 ? void 0 : _b.easing) ? (_c = this.params.enter) === null || _c === void 0 ? void 0 : _c.easing : easing;
5084
- }
5085
- if (node.type === 'path') {
5086
- node
5087
- .animate({
5088
- interpolate(key, ratio, from, to, nextAttributes) {
5089
- if (key === 'path') {
5090
- nextAttributes.path = vutils.interpolateString(from, to)(ratio);
5091
- return true;
5092
- }
5093
- return false;
5094
- }
5095
- })
5096
- .to(attrs, duration, easing);
5097
- }
5098
- else {
5099
- node
5100
- .animate()
5101
- .to(attrs, duration, easing);
5102
- }
5103
- });
5104
- }
5105
- onUpdate(end, ratio, out) {
5106
- }
5107
- }
5108
-
5109
- class GroupFadeIn extends vrender.ACustomAnimate {
5110
- constructor(from, to, duration, easing) {
5111
- super(null, null, duration, easing);
5112
- }
5113
- getEndProps() {
5114
- return {};
5115
- }
5116
- onBind() {
5117
- this.target.setTheme({
5118
- common: {
5119
- opacity: 0
5120
- }
5121
- });
5122
- return;
5123
- }
5124
- onEnd() {
5125
- this.target.setTheme({
5126
- common: {
5127
- opacity: 1
5128
- }
5129
- });
5130
- return;
5131
- }
5132
- onUpdate(end, ratio, out) {
5133
- this.target.setTheme({
5134
- common: {
5135
- opacity: ratio
5136
- }
5137
- });
5138
- }
5139
- }
5140
- class GroupFadeOut extends vrender.ACustomAnimate {
5141
- constructor(from, to, duration, easing) {
5142
- super(null, null, duration, easing);
5143
- }
5144
- getEndProps() {
5145
- return {};
5146
- }
5147
- onBind() {
5148
- this.target.setTheme({
5149
- common: {
5150
- opacity: 1
5151
- }
5152
- });
5153
- return;
5154
- }
5155
- onEnd() {
5156
- this.target.setTheme({
5157
- common: {
5158
- opacity: 0
5159
- }
5160
- });
5161
- return;
5162
- }
5163
- onUpdate(end, ratio, out) {
5164
- this.target.setTheme({
5165
- common: {
5166
- opacity: 1 - ratio
5167
- }
5168
- });
5088
+ center, type: 'line' });
5169
5089
  }
5170
5090
  }
5091
+ vutils.mixin(CircleAxisGrid, CircleAxisMixin);
5171
5092
 
5172
5093
  var DataZoomActiveTag;
5173
5094
  (function (DataZoomActiveTag) {
@@ -9852,13 +9773,6 @@
9852
9773
  setUpdateDragMaskCallback(callback) {
9853
9774
  vutils.isFunction(callback) && (this._updateDragMaskCallback = callback);
9854
9775
  }
9855
- releaseBrushEvents() {
9856
- const { delayType = 'throttle', delayTime = 0 } = this.attribute;
9857
- this.stage.removeEventListener('pointerdown', this._onBrushStart);
9858
- this.stage.removeEventListener('pointermove', delayMap[delayType](this._onBrushing, delayTime));
9859
- this.stage.removeEventListener('pointerup', this._onBrushEnd);
9860
- this.stage.removeEventListener('pointerupoutside', this._onBrushEnd);
9861
- }
9862
9776
  }
9863
9777
  Brush.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
9864
9778
 
@@ -10244,7 +10158,11 @@
10244
10158
  }
10245
10159
  Tooltip.defaultAttributes = defaultAttributes;
10246
10160
 
10247
- const version = "0.14.6";
10161
+ function VTag(params) {
10162
+ return new Tag(params ? params.attribute : {});
10163
+ }
10164
+
10165
+ const version = "0.15.0-alpha.5";
10248
10166
 
10249
10167
  exports.AbstractComponent = AbstractComponent;
10250
10168
  exports.ArcInfo = ArcInfo;
@@ -10252,6 +10170,7 @@
10252
10170
  exports.BasePlayer = BasePlayer;
10253
10171
  exports.Brush = Brush;
10254
10172
  exports.CircleAxis = CircleAxis;
10173
+ exports.CircleAxisGrid = CircleAxisGrid;
10255
10174
  exports.CircleCrosshair = CircleCrosshair;
10256
10175
  exports.ColorContinuousLegend = ColorContinuousLegend;
10257
10176
  exports.ContinuousPlayer = ContinuousPlayer;
@@ -10268,13 +10187,13 @@
10268
10187
  exports.DataZoom = DataZoom;
10269
10188
  exports.DiscreteLegend = DiscreteLegend;
10270
10189
  exports.DiscretePlayer = DiscretePlayer;
10271
- exports.Grid = Grid;
10272
10190
  exports.GroupFadeIn = GroupFadeIn;
10273
10191
  exports.GroupFadeOut = GroupFadeOut;
10274
10192
  exports.GroupTransition = GroupTransition;
10275
10193
  exports.Indicator = Indicator;
10276
10194
  exports.LabelBase = LabelBase;
10277
10195
  exports.LineAxis = LineAxis;
10196
+ exports.LineAxisGrid = LineAxisGrid;
10278
10197
  exports.LineCrosshair = LineCrosshair;
10279
10198
  exports.LineLabel = LineLabel;
10280
10199
  exports.LinkPath = LinkPath;
@@ -10295,6 +10214,7 @@
10295
10214
  exports.Tag = Tag;
10296
10215
  exports.Title = Title;
10297
10216
  exports.Tooltip = Tooltip;
10217
+ exports.VTag = VTag;
10298
10218
  exports.getHorizontalPath = getHorizontalPath;
10299
10219
  exports.getSizeHandlerPath = getSizeHandlerPath;
10300
10220
  exports.getVerticalPath = getVerticalPath;