@visactor/vrender-components 0.19.19 → 0.19.20

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.
package/cjs/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.19.19";
1
+ export declare const version = "0.19.20";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
17
17
 
18
18
  Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
- }), exports.version = void 0, exports.version = "0.19.19", __exportStar(require("./core/base"), exports),
20
+ }), exports.version = void 0, exports.version = "0.19.20", __exportStar(require("./core/base"), exports),
21
21
  __exportStar(require("./core/type"), exports), __exportStar(require("./scrollbar"), exports),
22
22
  __exportStar(require("./tag"), exports), __exportStar(require("./poptip"), exports),
23
23
  __exportStar(require("./crosshair"), exports), __exportStar(require("./label"), exports),
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.19\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,SAAS,CAAC;AAEjC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.20\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, Matrix, pi2, Logger, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, isArray, cos, sin, pi, pointAt, isNumber, getDecimalPlaces, isNil, Color, has, normalTransform, isValidUrl, isBase64, epsilon, acos, sqrt, clampAngleByRadian, asin, transformBoundsWithMatrix, arrayEqual, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, isEmpty, isValid, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian as polarToCartesian$1, array, isValidNumber, calculateAnchorOfBounds, isGreater, isLess, isNumberClose, normalizeAngle as normalizeAngle$1, flattenArray, cloneDeep, get, isRotateAABBIntersect, last, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, polygonContainPoint } from '@visactor/vutils';
1
+ import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, isArray, cos, sin, pi, pointAt, isNumber, getDecimalPlaces, isNil, Color, has, normalTransform, isValidUrl, isBase64, acos, sqrt, clampAngleByRadian, asin, transformBoundsWithMatrix, arrayEqual, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, isEmpty, isValid, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian as polarToCartesian$1, array, isValidNumber, calculateAnchorOfBounds, isGreater, isLess, isNumberClose, normalizeAngle as normalizeAngle$1, flattenArray, cloneDeep, get, isRotateAABBIntersect, last, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, polygonContainPoint } from '@visactor/vutils';
2
2
  import { isContinuous, isDiscrete, LinearScale } from '@visactor/vscale';
3
3
 
4
4
  class Generator {
@@ -1457,7 +1457,7 @@ function genLinearTypeSegments(path, points) {
1457
1457
  return genCurveSegments(path, points);
1458
1458
  }
1459
1459
 
1460
- function point$2(curveClass, x, y, defined, p) {
1460
+ function point$3(curveClass, x, y, defined, p) {
1461
1461
  curveClass.context.bezierCurveTo((2 * curveClass._x0 + curveClass._x1) / 3, (2 * curveClass._y0 + curveClass._y1) / 3, (curveClass._x0 + 2 * curveClass._x1) / 3, (curveClass._y0 + 2 * curveClass._y1) / 3, (curveClass._x0 + 4 * curveClass._x1 + x) / 6, (curveClass._y0 + 4 * curveClass._y1 + y) / 6, defined, curveClass.lastPoint1);
1462
1462
  }
1463
1463
  class Basis {
@@ -1474,7 +1474,7 @@ class Basis {
1474
1474
  this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0, this.startPoint && this.point(this.startPoint);
1475
1475
  }
1476
1476
  lineEnd() {
1477
- if (2 === this._point) point$2(this, 6 * this._x1 - (this._x0 + 4 * this._x1), 6 * this._y1 - (this._y0 + 4 * this._y1), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1477
+ if (2 === this._point) point$3(this, 6 * this._x1 - (this._x0 + 4 * this._x1), 6 * this._y1 - (this._y0 + 4 * this._y1), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1478
1478
  (this._line || 0 !== this._line && 1 === this._point) && this.context.closePath(), this._line = 1 - this._line;
1479
1479
  }
1480
1480
  point(p) {
@@ -1488,7 +1488,7 @@ class Basis {
1488
1488
  this._point = 2;
1489
1489
  break;
1490
1490
  default:
1491
- point$2(this, x, y, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1491
+ point$3(this, x, y, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1492
1492
  }
1493
1493
  this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y, this._lastDefined1 = this._lastDefined2, this._lastDefined2 = p.defined, this.lastPoint0 = this.lastPoint1, this.lastPoint1 = p;
1494
1494
  }
@@ -1526,7 +1526,7 @@ function slope2(curveClass, t) {
1526
1526
  const h = curveClass._x1 - curveClass._x0;
1527
1527
  return h ? (3 * (curveClass._y1 - curveClass._y0) / h - t) / 2 : t;
1528
1528
  }
1529
- function point$1(curveClass, t0, t1, defined, p) {
1529
+ function point$2(curveClass, t0, t1, defined, p) {
1530
1530
  const x0 = curveClass._x0,
1531
1531
  y0 = curveClass._y0,
1532
1532
  x1 = curveClass._x1,
@@ -1553,7 +1553,7 @@ class MonotoneX {
1553
1553
  this.context.lineTo(this._x1, this._y1, !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1554
1554
  break;
1555
1555
  case 3:
1556
- point$1(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1556
+ point$2(this, this._t0, slope2(this, this._t0), !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1557
1557
  }
1558
1558
  (this._line || 0 !== this._line && 1 === this._point) && this.context.closePath(), this._line = 1 - this._line;
1559
1559
  }
@@ -1569,10 +1569,10 @@ class MonotoneX {
1569
1569
  this._point = 2;
1570
1570
  break;
1571
1571
  case 2:
1572
- this._point = 3, point$1(this, slope2(this, t1 = slope3(this, x, y)), t1, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1572
+ this._point = 3, point$2(this, slope2(this, t1 = slope3(this, x, y)), t1, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1573
1573
  break;
1574
1574
  default:
1575
- point$1(this, this._t0, t1 = slope3(this, x, y), !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1575
+ point$2(this, this._t0, t1 = slope3(this, x, y), !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1576
1576
  }
1577
1577
  this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y, this._t0 = t1, this._lastDefined1 = this._lastDefined2, this._lastDefined2 = !1 !== p.defined, this.lastPoint0 = this.lastPoint1, this.lastPoint1 = p;
1578
1578
  }
@@ -1693,7 +1693,164 @@ function genLinearClosedTypeSegments(path, points) {
1693
1693
  return genCurveSegments(path, points);
1694
1694
  }
1695
1695
 
1696
+ function point$1(curveClass, x, y, defined, p) {
1697
+ let x1 = curveClass._x1,
1698
+ y1 = curveClass._y1,
1699
+ x2 = curveClass._x2,
1700
+ y2 = curveClass._y2;
1701
+ if (curveClass._l01_a > epsilon) {
1702
+ const a = 2 * curveClass._l01_2a + 3 * curveClass._l01_a * curveClass._l12_a + curveClass._l12_2a,
1703
+ n = 3 * curveClass._l01_a * (curveClass._l01_a + curveClass._l12_a);
1704
+ x1 = (x1 * a - curveClass._x0 * curveClass._l12_2a + curveClass._x2 * curveClass._l01_2a) / n, y1 = (y1 * a - curveClass._y0 * curveClass._l12_2a + curveClass._y2 * curveClass._l01_2a) / n;
1705
+ }
1706
+ if (curveClass._l23_a > epsilon) {
1707
+ const b = 2 * curveClass._l23_2a + 3 * curveClass._l23_a * curveClass._l12_a + curveClass._l12_2a,
1708
+ m = 3 * curveClass._l23_a * (curveClass._l23_a + curveClass._l12_a);
1709
+ x2 = (x2 * b + curveClass._x1 * curveClass._l23_2a - x * curveClass._l12_2a) / m, y2 = (y2 * b + curveClass._y1 * curveClass._l23_2a - y * curveClass._l12_2a) / m;
1710
+ }
1711
+ curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
1712
+ }
1713
+ class CatmullRom {
1714
+ constructor(context) {
1715
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1716
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1717
+ this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1718
+ }
1719
+ areaStart() {
1720
+ this._line = 0;
1721
+ }
1722
+ areaEnd() {
1723
+ this._line = NaN;
1724
+ }
1725
+ lineStart() {
1726
+ this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
1727
+ }
1728
+ lineEnd() {
1729
+ switch (this._point) {
1730
+ case 2:
1731
+ this.context.lineTo(this._x2, this._y2, !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1);
1732
+ break;
1733
+ case 3:
1734
+ this.point({
1735
+ x: this._x2,
1736
+ y: this._y2
1737
+ });
1738
+ }
1739
+ (this._line || 0 !== this._line && 1 === this._point) && this.context.closePath(), this._line = 1 - this._line;
1740
+ }
1741
+ point(p) {
1742
+ const {
1743
+ x: x,
1744
+ y: y
1745
+ } = p;
1746
+ if (this._point) {
1747
+ const x23 = this._x2 - x,
1748
+ y23 = this._y2 - y;
1749
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
1750
+ }
1751
+ switch (this._point) {
1752
+ case 0:
1753
+ this._point = 1, this._line ? this.context.lineTo(x, y, !1 !== this._lastDefined1 && !1 !== this._lastDefined2) : this.context.moveTo(x, y);
1754
+ break;
1755
+ case 1:
1756
+ this._point = 2;
1757
+ break;
1758
+ case 2:
1759
+ this._point = 3;
1760
+ default:
1761
+ point$1(this, x, y, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1762
+ }
1763
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y, this._lastDefined1 = this._lastDefined2, this._lastDefined2 = p.defined, this.lastPoint0 = this.lastPoint1, this.lastPoint1 = p;
1764
+ }
1765
+ tryUpdateLength() {
1766
+ return this.context.tryUpdateLength();
1767
+ }
1768
+ }
1769
+ function commonGenCatmullRomSegments(type, cons) {
1770
+ return function (points, alpha) {
1771
+ let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1772
+ const {
1773
+ direction: direction,
1774
+ startPoint: startPoint
1775
+ } = params;
1776
+ if (points.length < 2 - Number(!!startPoint)) return null;
1777
+ if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
1778
+ const segContext = genSegContext(type, direction, points),
1779
+ gatmullRom = new cons(segContext, alpha, startPoint);
1780
+ return genCurveSegments(gatmullRom, points), segContext;
1781
+ };
1782
+ }
1783
+ const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
1784
+
1785
+ class CatmullRomClosed {
1786
+ constructor(context) {
1787
+ let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
1788
+ let startPoint = arguments.length > 2 ? arguments[2] : undefined;
1789
+ this.context = context, this.startPoint = startPoint, this._alpha = alpha;
1790
+ }
1791
+ areaStart() {
1792
+ this._line = 0;
1793
+ }
1794
+ areaEnd() {
1795
+ this._line = NaN;
1796
+ }
1797
+ lineStart() {
1798
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
1799
+ }
1800
+ lineEnd() {
1801
+ switch (this._point) {
1802
+ case 1:
1803
+ this.context.moveTo(this._x3, this._y3, this.lastPoint1), this.context.closePath();
1804
+ break;
1805
+ case 2:
1806
+ this.context.lineTo(this._x3, this._y3, !1 !== this._lastDefined1 && !1 !== this._lastDefined2, this.lastPoint1), this.context.closePath();
1807
+ break;
1808
+ case 3:
1809
+ this.point({
1810
+ x: this._x3,
1811
+ y: this._y3
1812
+ }), this.point({
1813
+ x: this._x4,
1814
+ y: this._y4
1815
+ }), this.point({
1816
+ x: this._x5,
1817
+ y: this._y5
1818
+ });
1819
+ }
1820
+ }
1821
+ point(p) {
1822
+ const {
1823
+ x: x,
1824
+ y: y
1825
+ } = p;
1826
+ if (this._point) {
1827
+ const x23 = this._x2 - x,
1828
+ y23 = this._y2 - y;
1829
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
1830
+ }
1831
+ switch (this._point) {
1832
+ case 0:
1833
+ this._point = 1, this._x3 = x, this._y3 = y;
1834
+ break;
1835
+ case 1:
1836
+ this._point = 2, this.context.moveTo(this._x4 = x, this._y4 = y, p);
1837
+ break;
1838
+ case 2:
1839
+ this._point = 3, this._x5 = x, this._y5 = y;
1840
+ break;
1841
+ default:
1842
+ point$1(this, x, y, !1 !== this._lastDefined1 && !1 !== this._lastDefined2);
1843
+ }
1844
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y, this._lastDefined1 = this._lastDefined2, this._lastDefined2 = p.defined, this.lastPoint0 = this.lastPoint1, this.lastPoint1 = p;
1845
+ }
1846
+ tryUpdateLength() {
1847
+ return this.context.tryUpdateLength();
1848
+ }
1849
+ }
1850
+ const genCatmullRomClosedSegments = commonGenCatmullRomSegments("catmullRomClosed", CatmullRomClosed);
1851
+
1696
1852
  function calcLineCache$1(points, curveType, params) {
1853
+ var _a, _b;
1697
1854
  switch (curveType) {
1698
1855
  case "linear":
1699
1856
  default:
@@ -1710,6 +1867,10 @@ function calcLineCache$1(points, curveType, params) {
1710
1867
  return genStepSegments(points, 0, params);
1711
1868
  case "stepAfter":
1712
1869
  return genStepSegments(points, 1, params);
1870
+ case "catmullRom":
1871
+ return genCatmullRomSegments(points, null !== (_a = null == params ? void 0 : params.curveTension) && void 0 !== _a ? _a : .5, params);
1872
+ case "catmullRomClosed":
1873
+ return genCatmullRomClosedSegments(points, null !== (_b = null == params ? void 0 : params.curveTension) && void 0 !== _b ? _b : .5, params);
1713
1874
  case "linearClosed":
1714
1875
  return genLinearClosedSegments(points, params);
1715
1876
  }
@@ -2142,7 +2303,8 @@ const DefaultAreaAttribute = Object.assign(Object.assign(Object.assign({}, Defau
2142
2303
  segments: [],
2143
2304
  curveType: "linear",
2144
2305
  clipRange: 1,
2145
- closePath: !1
2306
+ closePath: !1,
2307
+ curveTension: 1
2146
2308
  });
2147
2309
  const DefaultCircleAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2148
2310
  radius: 1,
@@ -2177,7 +2339,8 @@ const DefaultLineAttribute = Object.assign(Object.assign(Object.assign({}, Defau
2177
2339
  curveType: "linear",
2178
2340
  clipRange: 1,
2179
2341
  clipRangeByDimension: "default",
2180
- closePath: !1
2342
+ closePath: !1,
2343
+ curveTension: 1
2181
2344
  });
2182
2345
  const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
2183
2346
  path: new CustomPath2D(),
@@ -5879,6 +6042,7 @@ function drawArcPath(arc, context, cx, cy, outerRadius, innerRadius, partStroke)
5879
6042
  }
5880
6043
  if (outerRadius <= epsilon) context.moveTo(cx, cy);else if (deltaAngle >= pi2 - epsilon) context.moveTo(cx + outerRadius * cos(startAngle), cy + outerRadius * sin(startAngle)), context.arc(cx, cy, outerRadius, startAngle, endAngle, !clockwise), innerRadius > epsilon && (context.moveTo(cx + innerRadius * cos(endAngle), cy + innerRadius * sin(endAngle)), context.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise));else {
5881
6044
  const cornerRadius = arc.getParsedCornerRadius(),
6045
+ cornerRadiusIsArray = isArray(cornerRadius),
5882
6046
  {
5883
6047
  outerDeltaAngle: outerDeltaAngle,
5884
6048
  innerDeltaAngle: innerDeltaAngle,
@@ -5887,10 +6051,10 @@ function drawArcPath(arc, context, cx, cy, outerRadius, innerRadius, partStroke)
5887
6051
  innerEndAngle: innerEndAngle,
5888
6052
  innerStartAngle: innerStartAngle
5889
6053
  } = arc.getParsePadAngle(startAngle, endAngle),
5890
- outerCornerRadiusStart = cornerRadius,
5891
- outerCornerRadiusEnd = cornerRadius,
5892
- innerCornerRadiusEnd = cornerRadius,
5893
- innerCornerRadiusStart = cornerRadius,
6054
+ outerCornerRadiusStart = cornerRadiusIsArray ? cornerRadius[0] : cornerRadius,
6055
+ outerCornerRadiusEnd = cornerRadiusIsArray ? cornerRadius[1] : cornerRadius,
6056
+ innerCornerRadiusEnd = cornerRadiusIsArray ? cornerRadius[2] : cornerRadius,
6057
+ innerCornerRadiusStart = cornerRadiusIsArray ? cornerRadius[3] : cornerRadius,
5894
6058
  maxOuterCornerRadius = Math.max(outerCornerRadiusEnd, outerCornerRadiusStart),
5895
6059
  maxInnerCornerRadius = Math.max(innerCornerRadiusEnd, innerCornerRadiusStart);
5896
6060
  let limitedOcr = maxOuterCornerRadius,
@@ -7331,7 +7495,7 @@ function createSymbol(attributes) {
7331
7495
  return new Symbol$1(attributes);
7332
7496
  }
7333
7497
 
7334
- const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", ...GRAPHIC_UPDATE_TAG_KEY];
7498
+ const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
7335
7499
  let Line$1 = class Line extends Graphic {
7336
7500
  constructor() {
7337
7501
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -8234,7 +8398,7 @@ function createPath(attributes) {
8234
8398
  return new Path(attributes);
8235
8399
  }
8236
8400
 
8237
- const AREA_UPDATE_TAG_KEY = ["segments", "points", "curveType", ...GRAPHIC_UPDATE_TAG_KEY];
8401
+ const AREA_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
8238
8402
  class Area extends Graphic {
8239
8403
  constructor(params) {
8240
8404
  super(params), this.type = "area", this.numberType = AREA_NUMBER_TYPE;
@@ -8344,8 +8508,13 @@ class Arc extends Graphic {
8344
8508
  innerRadius = arcTheme.innerRadius
8345
8509
  } = this.attribute;
8346
8510
  if (outerRadius += outerPadding, innerRadius -= innerPadding, 0 === cornerRadius || "0%" === cornerRadius) return 0;
8347
- const deltaRadius = Math.abs(outerRadius - innerRadius);
8348
- return Math.min(isNumber(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
8511
+ const deltaRadius = Math.abs(outerRadius - innerRadius),
8512
+ parseCR = cornerRadius => Math.min(isNumber(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
8513
+ if (isArray(cornerRadius)) {
8514
+ const crList = cornerRadius.map(cr => parseCR(cr) || 0);
8515
+ return 0 === crList.length ? [crList[0], crList[0], crList[0], crList[0]] : 2 === crList.length ? [crList[0], crList[1], crList[0], crList[1]] : (3 === crList.length && crList.push(0), crList);
8516
+ }
8517
+ return parseCR(cornerRadius);
8349
8518
  }
8350
8519
  getParsedAngle() {
8351
8520
  const arcTheme = getTheme(this).arc;
@@ -10425,6 +10594,7 @@ let DefaultCanvasArcRender = class extends BaseRender {
10425
10594
  outerRadius = innerRadius, innerRadius = temp;
10426
10595
  }
10427
10596
  const cornerRadius = arc.getParsedCornerRadius(),
10597
+ cornerRadiusIsArray = isArray(cornerRadius),
10428
10598
  {
10429
10599
  outerDeltaAngle: outerDeltaAngle,
10430
10600
  innerDeltaAngle: innerDeltaAngle,
@@ -10433,10 +10603,10 @@ let DefaultCanvasArcRender = class extends BaseRender {
10433
10603
  innerEndAngle: innerEndAngle,
10434
10604
  innerStartAngle: innerStartAngle
10435
10605
  } = arc.getParsePadAngle(startAngle, endAngle),
10436
- outerCornerRadiusStart = cornerRadius,
10437
- outerCornerRadiusEnd = cornerRadius,
10438
- innerCornerRadiusEnd = cornerRadius,
10439
- innerCornerRadiusStart = cornerRadius,
10606
+ outerCornerRadiusStart = cornerRadiusIsArray ? cornerRadius[0] : cornerRadius,
10607
+ outerCornerRadiusEnd = cornerRadiusIsArray ? cornerRadius[1] : cornerRadius,
10608
+ innerCornerRadiusEnd = cornerRadiusIsArray ? cornerRadius[2] : cornerRadius,
10609
+ innerCornerRadiusStart = cornerRadiusIsArray ? cornerRadius[3] : cornerRadius,
10440
10610
  maxOuterCornerRadius = Math.max(outerCornerRadiusEnd, outerCornerRadiusStart),
10441
10611
  maxInnerCornerRadius = Math.max(innerCornerRadiusEnd, innerCornerRadiusStart);
10442
10612
  let limitedOcr = maxOuterCornerRadius,
@@ -10827,7 +10997,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
10827
10997
  strokeOpacity = lineAttribute.strokeOpacity,
10828
10998
  segments: segments,
10829
10999
  points: points,
10830
- closePath: closePath
11000
+ closePath: closePath,
11001
+ curveTension = lineAttribute.curveTension
10831
11002
  } = line.attribute;
10832
11003
  if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
10833
11004
  let {
@@ -10861,7 +11032,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
10861
11032
  defined: lastSeg.curves[lastSeg.curves.length - 1].defined
10862
11033
  } : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
10863
11034
  const data = calcLineCache$1(seg.points, curveType, {
10864
- startPoint: startPoint
11035
+ startPoint: startPoint,
11036
+ curveTension: curveTension
10865
11037
  });
10866
11038
  return lastSeg = data, data;
10867
11039
  }).filter(item => !!item), "linearClosed" === curveType) {
@@ -10878,7 +11050,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
10878
11050
  }
10879
11051
  } else {
10880
11052
  if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
10881
- line.cache = calcLineCache$1(_points, curveType);
11053
+ line.cache = calcLineCache$1(_points, curveType, {
11054
+ curveTension: curveTension
11055
+ });
10882
11056
  }
10883
11057
  line.clearUpdateShapeTag();
10884
11058
  }
@@ -11049,6 +11223,7 @@ var __decorate$G = undefined && undefined.__decorate || function (decorators, ta
11049
11223
  };
11050
11224
  };
11051
11225
  function calcLineCache(points, curveType, params) {
11226
+ var _a, _b;
11052
11227
  switch (curveType) {
11053
11228
  case "linear":
11054
11229
  default:
@@ -11065,6 +11240,10 @@ function calcLineCache(points, curveType, params) {
11065
11240
  return genStepSegments(points, 0, params);
11066
11241
  case "stepAfter":
11067
11242
  return genStepSegments(points, 1, params);
11243
+ case "catmullRom":
11244
+ return genCatmullRomSegments(points, null !== (_a = null == params ? void 0 : params.curveTension) && void 0 !== _a ? _a : .5, params);
11245
+ case "catmullRomClosed":
11246
+ return genCatmullRomClosedSegments(points, null !== (_b = null == params ? void 0 : params.curveTension) && void 0 !== _b ? _b : .5, params);
11068
11247
  case "linearClosed":
11069
11248
  return genLinearClosedSegments(points, params);
11070
11249
  }
@@ -11129,7 +11308,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
11129
11308
  stroke = areaAttribute.stroke,
11130
11309
  fillOpacity = areaAttribute.fillOpacity,
11131
11310
  z = areaAttribute.z,
11132
- strokeOpacity = areaAttribute.strokeOpacity
11311
+ strokeOpacity = areaAttribute.strokeOpacity,
11312
+ curveTension = areaAttribute.curveTension
11133
11313
  } = area.attribute,
11134
11314
  data = this.valid(area, areaAttribute, fillCb, strokeCb);
11135
11315
  if (!data) return;
@@ -11160,7 +11340,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
11160
11340
  y: lastTopSeg.endY
11161
11341
  } : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
11162
11342
  const data = calcLineCache(seg.points, curveType, {
11163
- startPoint: startPoint
11343
+ startPoint: startPoint,
11344
+ curveTension: curveTension
11164
11345
  });
11165
11346
  return lastTopSeg = data, data;
11166
11347
  }).filter(item => !!item);
@@ -11181,7 +11362,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
11181
11362
  y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
11182
11363
  });
11183
11364
  }
11184
- bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType), bottomCaches.unshift(lastBottomSeg));
11365
+ bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
11366
+ curveTension: curveTension
11367
+ }), bottomCaches.unshift(lastBottomSeg));
11185
11368
  }
11186
11369
  area.cacheArea = bottomCaches.map((item, index) => ({
11187
11370
  top: topCaches[index],
@@ -11196,8 +11379,12 @@ let DefaultCanvasAreaRender = class extends BaseRender {
11196
11379
  x: null !== (_e = points[i].x1) && void 0 !== _e ? _e : points[i].x,
11197
11380
  y: null !== (_f = points[i].y1) && void 0 !== _f ? _f : points[i].y
11198
11381
  });
11199
- const topCache = calcLineCache(topPoints, curveType),
11200
- bottomCache = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType);
11382
+ const topCache = calcLineCache(topPoints, curveType, {
11383
+ curveTension: curveTension
11384
+ }),
11385
+ bottomCache = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
11386
+ curveTension: curveTension
11387
+ });
11201
11388
  area.cacheArea = {
11202
11389
  top: topCache,
11203
11390
  bottom: bottomCache
@@ -29175,6 +29362,6 @@ EmptyTip.defaultAttributes = {
29175
29362
  }
29176
29363
  };
29177
29364
 
29178
- const version = "0.19.19";
29365
+ const version = "0.19.20";
29179
29366
 
29180
29367
  export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AreaLabel, 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, GroupFadeIn, GroupFadeOut, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineDataLabel, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Title, Tooltip, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, clampRadian, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, direction, fuzzyEqualNumber, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, loadPoptip, measureTextSize, normalize, reactAttributeTransform, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
package/es/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.19.19";
1
+ export declare const version = "0.19.20";
2
2
  export * from './core/base';
3
3
  export * from './core/type';
4
4
  export * from './scrollbar';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.19.19";
1
+ export const version = "0.19.20";
2
2
 
3
3
  export * from "./core/base";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.19\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.20\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-components",
3
- "version": "0.19.19",
3
+ "version": "0.19.20",
4
4
  "description": "components library for dp visualization",
5
5
  "sideEffects": false,
6
6
  "main": "cjs/index.js",
@@ -12,8 +12,8 @@
12
12
  "dist"
13
13
  ],
14
14
  "dependencies": {
15
- "@visactor/vrender-core": "0.19.19",
16
- "@visactor/vrender-kits": "0.19.19",
15
+ "@visactor/vrender-core": "0.19.20",
16
+ "@visactor/vrender-kits": "0.19.20",
17
17
  "@visactor/vutils": "~0.18.10",
18
18
  "@visactor/vscale": "~0.18.9"
19
19
  },
@@ -30,8 +30,8 @@
30
30
  "typescript": "4.9.5",
31
31
  "cross-env": "^7.0.3",
32
32
  "@internal/bundler": "0.0.1",
33
- "@internal/ts-config": "0.0.1",
34
- "@internal/eslint-config": "0.0.1"
33
+ "@internal/eslint-config": "0.0.1",
34
+ "@internal/ts-config": "0.0.1"
35
35
  },
36
36
  "keywords": [
37
37
  "VisActor",