@visactor/vrender-components 1.0.0 → 1.0.3
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/axis/tick-data/continuous.js +17 -15
- package/cjs/axis/tick-data/continuous.js.map +1 -1
- package/cjs/axis/tick-data/discrete/linear.js +21 -14
- package/cjs/axis/tick-data/discrete/linear.js.map +1 -1
- package/cjs/axis/tick-data/util.js +14 -8
- package/cjs/axis/tick-data/util.js.map +1 -1
- package/cjs/brush/brush.d.ts +1 -5
- package/cjs/brush/brush.js +11 -13
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/core/base.d.ts +5 -1
- package/cjs/core/base.js +11 -0
- package/cjs/core/base.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +1 -5
- package/cjs/data-zoom/data-zoom.js +7 -8
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +255 -378
- package/es/axis/tick-data/continuous.js +15 -13
- package/es/axis/tick-data/continuous.js.map +1 -1
- package/es/axis/tick-data/discrete/linear.js +22 -14
- package/es/axis/tick-data/discrete/linear.js.map +1 -1
- package/es/axis/tick-data/util.js +15 -9
- package/es/axis/tick-data/util.js.map +1 -1
- package/es/brush/brush.d.ts +1 -5
- package/es/brush/brush.js +11 -13
- package/es/brush/brush.js.map +1 -1
- package/es/core/base.d.ts +5 -1
- package/es/core/base.js +11 -0
- package/es/core/base.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +1 -5
- package/es/data-zoom/data-zoom.js +7 -8
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.es.js
CHANGED
|
@@ -499,20 +499,14 @@ class ContributionProviderCache {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
function bindContributionProvider(bind, id) {
|
|
502
|
-
bind(ContributionProvider).toDynamicValue(
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
} = _ref;
|
|
506
|
-
return new ContributionProviderCache(id, container);
|
|
507
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
502
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
503
|
+
container: container
|
|
504
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
508
505
|
}
|
|
509
506
|
function bindContributionProviderNoSingletonScope(bind, id) {
|
|
510
|
-
bind(ContributionProvider).toDynamicValue(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
} = _ref2;
|
|
514
|
-
return new ContributionProviderCache(id, container);
|
|
515
|
-
}).whenTargetNamed(id);
|
|
507
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
508
|
+
container: container
|
|
509
|
+
}) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
|
|
516
510
|
}
|
|
517
511
|
class ContributionStore {
|
|
518
512
|
static getStore(id) {
|
|
@@ -582,10 +576,7 @@ class Hook {
|
|
|
582
576
|
}
|
|
583
577
|
|
|
584
578
|
class SyncHook extends Hook {
|
|
585
|
-
call() {
|
|
586
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
587
|
-
args[_key] = arguments[_key];
|
|
588
|
-
}
|
|
579
|
+
call(...args) {
|
|
589
580
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
590
581
|
}
|
|
591
582
|
}
|
|
@@ -861,16 +852,13 @@ let DefaultGlobal = class extends EventListenerManager {
|
|
|
861
852
|
updateDom(dom, params) {
|
|
862
853
|
return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
|
|
863
854
|
}
|
|
864
|
-
getElementTop(dom) {
|
|
865
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
855
|
+
getElementTop(dom, baseWindow = !1) {
|
|
866
856
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
|
|
867
857
|
}
|
|
868
|
-
getElementLeft(dom) {
|
|
869
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
858
|
+
getElementLeft(dom, baseWindow = !1) {
|
|
870
859
|
return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
|
|
871
860
|
}
|
|
872
|
-
getElementTopLeft(dom) {
|
|
873
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
861
|
+
getElementTopLeft(dom, baseWindow = !1) {
|
|
874
862
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
|
|
875
863
|
}
|
|
876
864
|
isMacOS() {
|
|
@@ -955,7 +943,7 @@ class BoundsContext {
|
|
|
955
943
|
clear() {
|
|
956
944
|
this.bounds.clear();
|
|
957
945
|
}
|
|
958
|
-
release() {}
|
|
946
|
+
release(...params) {}
|
|
959
947
|
}
|
|
960
948
|
|
|
961
949
|
class CurvePath {
|
|
@@ -1130,8 +1118,7 @@ function drawArc(context, x, y, coords) {
|
|
|
1130
1118
|
context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
|
|
1131
1119
|
}
|
|
1132
1120
|
}
|
|
1133
|
-
const addArcToBezierPath =
|
|
1134
|
-
let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
1121
|
+
const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
|
|
1135
1122
|
const PI2 = 2 * Math.PI,
|
|
1136
1123
|
sAngle = (startAngle % PI2 + PI2) % PI2;
|
|
1137
1124
|
let deltaAngle,
|
|
@@ -1159,12 +1146,7 @@ const addArcToBezierPath = function (bezierPath, startAngle, endAngle, cx, cy, r
|
|
|
1159
1146
|
};
|
|
1160
1147
|
|
|
1161
1148
|
const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
|
|
1162
|
-
function renderCommandList(commandList, context) {
|
|
1163
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1164
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1165
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
1166
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
1167
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
1149
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
1168
1150
|
for (let i = 0; i < commandList.length; i++) {
|
|
1169
1151
|
const command = commandList[i];
|
|
1170
1152
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -1405,7 +1387,7 @@ class ReflectSegContext extends SegContext {
|
|
|
1405
1387
|
}
|
|
1406
1388
|
}
|
|
1407
1389
|
|
|
1408
|
-
function genCurveSegments(path, points) {
|
|
1390
|
+
function genCurveSegments(path, points, step = 1) {
|
|
1409
1391
|
let defined0 = !1;
|
|
1410
1392
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
1411
1393
|
}
|
|
@@ -1448,8 +1430,7 @@ class Linear {
|
|
|
1448
1430
|
return this.context.tryUpdateLength();
|
|
1449
1431
|
}
|
|
1450
1432
|
}
|
|
1451
|
-
function genLinearSegments(points) {
|
|
1452
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1433
|
+
function genLinearSegments(points, params = {}) {
|
|
1453
1434
|
const {
|
|
1454
1435
|
direction: direction,
|
|
1455
1436
|
startPoint: startPoint
|
|
@@ -1459,7 +1440,7 @@ function genLinearSegments(points) {
|
|
|
1459
1440
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
1460
1441
|
}
|
|
1461
1442
|
function genLinearTypeSegments(path, points) {
|
|
1462
|
-
return genCurveSegments(path, points);
|
|
1443
|
+
return genCurveSegments(path, points, 1);
|
|
1463
1444
|
}
|
|
1464
1445
|
|
|
1465
1446
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -1502,10 +1483,9 @@ class Basis {
|
|
|
1502
1483
|
}
|
|
1503
1484
|
}
|
|
1504
1485
|
function genBasisTypeSegments(path, points) {
|
|
1505
|
-
return genCurveSegments(path, points);
|
|
1486
|
+
return genCurveSegments(path, points, 2);
|
|
1506
1487
|
}
|
|
1507
|
-
function genBasisSegments(points) {
|
|
1508
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1488
|
+
function genBasisSegments(points, params = {}) {
|
|
1509
1489
|
const {
|
|
1510
1490
|
direction: direction,
|
|
1511
1491
|
startPoint: startPoint
|
|
@@ -1598,10 +1578,9 @@ class MonotoneY extends MonotoneX {
|
|
|
1598
1578
|
}
|
|
1599
1579
|
}
|
|
1600
1580
|
function genMonotoneXTypeSegments(path, points) {
|
|
1601
|
-
return genCurveSegments(path, points);
|
|
1581
|
+
return genCurveSegments(path, points, 2);
|
|
1602
1582
|
}
|
|
1603
|
-
function genMonotoneXSegments(points) {
|
|
1604
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1583
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
1605
1584
|
const {
|
|
1606
1585
|
direction: direction,
|
|
1607
1586
|
startPoint: startPoint
|
|
@@ -1612,10 +1591,9 @@ function genMonotoneXSegments(points) {
|
|
|
1612
1591
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
1613
1592
|
}
|
|
1614
1593
|
function genMonotoneYTypeSegments(path, points) {
|
|
1615
|
-
return genCurveSegments(path, points);
|
|
1594
|
+
return genCurveSegments(path, points, 2);
|
|
1616
1595
|
}
|
|
1617
|
-
function genMonotoneYSegments(points) {
|
|
1618
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1596
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
1619
1597
|
const {
|
|
1620
1598
|
direction: direction,
|
|
1621
1599
|
startPoint: startPoint
|
|
@@ -1627,9 +1605,7 @@ function genMonotoneYSegments(points) {
|
|
|
1627
1605
|
}
|
|
1628
1606
|
|
|
1629
1607
|
let Step$1 = class Step {
|
|
1630
|
-
constructor(context) {
|
|
1631
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1632
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1608
|
+
constructor(context, t = .5, startPoint) {
|
|
1633
1609
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
1634
1610
|
}
|
|
1635
1611
|
areaStart() {
|
|
@@ -1670,8 +1646,7 @@ class StepClosed extends Step$1 {
|
|
|
1670
1646
|
this.context.closePath();
|
|
1671
1647
|
}
|
|
1672
1648
|
}
|
|
1673
|
-
function genStepSegments(points, t) {
|
|
1674
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1649
|
+
function genStepSegments(points, t, params = {}) {
|
|
1675
1650
|
const {
|
|
1676
1651
|
direction: direction,
|
|
1677
1652
|
startPoint: startPoint
|
|
@@ -1681,10 +1656,9 @@ function genStepSegments(points, t) {
|
|
|
1681
1656
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
1682
1657
|
}
|
|
1683
1658
|
function genStepTypeSegments(path, points) {
|
|
1684
|
-
return genCurveSegments(path, points);
|
|
1659
|
+
return genCurveSegments(path, points, 1);
|
|
1685
1660
|
}
|
|
1686
|
-
function genStepClosedSegments(points, t) {
|
|
1687
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1661
|
+
function genStepClosedSegments(points, t, params = {}) {
|
|
1688
1662
|
const {
|
|
1689
1663
|
direction: direction,
|
|
1690
1664
|
startPoint: startPoint
|
|
@@ -1699,8 +1673,7 @@ class LinearClosed extends Linear {
|
|
|
1699
1673
|
this.context.closePath();
|
|
1700
1674
|
}
|
|
1701
1675
|
}
|
|
1702
|
-
function genLinearClosedSegments(points) {
|
|
1703
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1676
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
1704
1677
|
const {
|
|
1705
1678
|
direction: direction,
|
|
1706
1679
|
startPoint: startPoint
|
|
@@ -1710,7 +1683,7 @@ function genLinearClosedSegments(points) {
|
|
|
1710
1683
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
1711
1684
|
}
|
|
1712
1685
|
function genLinearClosedTypeSegments(path, points) {
|
|
1713
|
-
return genCurveSegments(path, points);
|
|
1686
|
+
return genCurveSegments(path, points, 1);
|
|
1714
1687
|
}
|
|
1715
1688
|
|
|
1716
1689
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -1731,9 +1704,7 @@ function point$1(curveClass, x, y, defined, p) {
|
|
|
1731
1704
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
1732
1705
|
}
|
|
1733
1706
|
class CatmullRom {
|
|
1734
|
-
constructor(context) {
|
|
1735
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1736
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1707
|
+
constructor(context, alpha = .5, startPoint) {
|
|
1737
1708
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
1738
1709
|
}
|
|
1739
1710
|
areaStart() {
|
|
@@ -1787,8 +1758,7 @@ class CatmullRom {
|
|
|
1787
1758
|
}
|
|
1788
1759
|
}
|
|
1789
1760
|
function commonGenCatmullRomSegments(type, cons) {
|
|
1790
|
-
return function (points, alpha) {
|
|
1791
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1761
|
+
return function (points, alpha, params = {}) {
|
|
1792
1762
|
const {
|
|
1793
1763
|
direction: direction,
|
|
1794
1764
|
startPoint: startPoint
|
|
@@ -1797,15 +1767,13 @@ function commonGenCatmullRomSegments(type, cons) {
|
|
|
1797
1767
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
1798
1768
|
const segContext = genSegContext(type, direction, points),
|
|
1799
1769
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
1800
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
1770
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
1801
1771
|
};
|
|
1802
1772
|
}
|
|
1803
1773
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
1804
1774
|
|
|
1805
1775
|
class CatmullRomClosed {
|
|
1806
|
-
constructor(context) {
|
|
1807
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
1808
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
1776
|
+
constructor(context, alpha = .5, startPoint) {
|
|
1809
1777
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
1810
1778
|
}
|
|
1811
1779
|
areaStart() {
|
|
@@ -2115,11 +2083,7 @@ class CustomPath2D extends CurvePath {
|
|
|
2115
2083
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
2116
2084
|
}
|
|
2117
2085
|
closePathTransform() {}
|
|
2118
|
-
_runCommandStrList(commandStrList) {
|
|
2119
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2120
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2121
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2122
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
2086
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
2123
2087
|
let current,
|
|
2124
2088
|
tempX,
|
|
2125
2089
|
tempY,
|
|
@@ -2193,11 +2157,7 @@ class CustomPath2D extends CurvePath {
|
|
|
2193
2157
|
previous = current;
|
|
2194
2158
|
}
|
|
2195
2159
|
}
|
|
2196
|
-
_runCommandList(commandList) {
|
|
2197
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2198
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2199
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2200
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
2160
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
2201
2161
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
2202
2162
|
const current = commandList[i].slice();
|
|
2203
2163
|
switch (current[0]) {
|
|
@@ -2848,9 +2808,7 @@ function getScaledStroke(context, width, dpr) {
|
|
|
2848
2808
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
2849
2809
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
2850
2810
|
}
|
|
2851
|
-
function createColor(context, c, params) {
|
|
2852
|
-
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2853
|
-
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2811
|
+
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
2854
2812
|
var _a, _b, _c, _d;
|
|
2855
2813
|
if (!c || !0 === c) return "black";
|
|
2856
2814
|
let result, color;
|
|
@@ -2989,8 +2947,7 @@ function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter)
|
|
|
2989
2947
|
}
|
|
2990
2948
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
2991
2949
|
}
|
|
2992
|
-
function testLetter(string, index) {
|
|
2993
|
-
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
2950
|
+
function testLetter(string, index, negativeWrongMatch = !1) {
|
|
2994
2951
|
let i = index;
|
|
2995
2952
|
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
2996
2953
|
return i;
|
|
@@ -3000,8 +2957,7 @@ function testLetter2(string, index) {
|
|
|
3000
2957
|
for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
3001
2958
|
return i + 1;
|
|
3002
2959
|
}
|
|
3003
|
-
function measureTextCanvas(text, character) {
|
|
3004
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
2960
|
+
function measureTextCanvas(text, character, mode = "actual") {
|
|
3005
2961
|
var _a;
|
|
3006
2962
|
if ("" === text) return {
|
|
3007
2963
|
ascent: 0,
|
|
@@ -3071,10 +3027,9 @@ let ATextMeasure = class {
|
|
|
3071
3027
|
}
|
|
3072
3028
|
return metrics;
|
|
3073
3029
|
}
|
|
3074
|
-
estimate(text,
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
} = _ref;
|
|
3030
|
+
estimate(text, {
|
|
3031
|
+
fontSize = DefaultTextAttribute.fontSize
|
|
3032
|
+
}) {
|
|
3078
3033
|
let eCharLen = 0,
|
|
3079
3034
|
cCharLen = 0;
|
|
3080
3035
|
for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
|
|
@@ -3385,8 +3340,7 @@ let ATextMeasure = class {
|
|
|
3385
3340
|
});
|
|
3386
3341
|
});
|
|
3387
3342
|
}
|
|
3388
|
-
clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
3389
|
-
let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
3343
|
+
clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
|
|
3390
3344
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
3391
3345
|
if (0 === text.length) return {
|
|
3392
3346
|
str: "",
|
|
@@ -3830,7 +3784,7 @@ class DefaultCanvasAllocate {
|
|
|
3830
3784
|
get length() {
|
|
3831
3785
|
return this.pools.length;
|
|
3832
3786
|
}
|
|
3833
|
-
release() {
|
|
3787
|
+
release(...params) {
|
|
3834
3788
|
this.pools = [];
|
|
3835
3789
|
}
|
|
3836
3790
|
}
|
|
@@ -4026,8 +3980,7 @@ let DefaultGraphicUtil = class {
|
|
|
4026
3980
|
bindTextMeasure(tm) {
|
|
4027
3981
|
this._textMeasure = tm;
|
|
4028
3982
|
}
|
|
4029
|
-
measureText(text, tc) {
|
|
4030
|
-
let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
|
|
3983
|
+
measureText(text, tc, method = "native") {
|
|
4031
3984
|
var _a;
|
|
4032
3985
|
this.configure(this.global, this.global.env);
|
|
4033
3986
|
const m = this.global.measureTextMethod;
|
|
@@ -4210,8 +4163,7 @@ class Theme {
|
|
|
4210
4163
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
4211
4164
|
return null;
|
|
4212
4165
|
}
|
|
4213
|
-
applyTheme(group, pt) {
|
|
4214
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
4166
|
+
applyTheme(group, pt, force = !1) {
|
|
4215
4167
|
if (this.dirty) {
|
|
4216
4168
|
const parentGroup = this.getParentWithTheme(group);
|
|
4217
4169
|
if (parentGroup) {
|
|
@@ -4310,8 +4262,7 @@ class Node extends EventEmitter {
|
|
|
4310
4262
|
constructor() {
|
|
4311
4263
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
4312
4264
|
}
|
|
4313
|
-
forEachChildren(cb) {
|
|
4314
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4265
|
+
forEachChildren(cb, reverse = !1) {
|
|
4315
4266
|
if (reverse) {
|
|
4316
4267
|
let child = this._lastChild,
|
|
4317
4268
|
i = 0;
|
|
@@ -4328,8 +4279,7 @@ class Node extends EventEmitter {
|
|
|
4328
4279
|
}
|
|
4329
4280
|
}
|
|
4330
4281
|
}
|
|
4331
|
-
forEachChildrenAsync(cb) {
|
|
4332
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4282
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
4333
4283
|
return __awaiter$3(this, void 0, void 0, function* () {
|
|
4334
4284
|
if (reverse) {
|
|
4335
4285
|
let child = this._lastChild,
|
|
@@ -4353,13 +4303,12 @@ class Node extends EventEmitter {
|
|
|
4353
4303
|
forEach(cb) {
|
|
4354
4304
|
return this.forEachChildren(cb);
|
|
4355
4305
|
}
|
|
4356
|
-
appendChild(node) {
|
|
4357
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
4306
|
+
appendChild(node, highPerformance = !0) {
|
|
4358
4307
|
if (this._uid === node._uid) return null;
|
|
4359
4308
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
4360
4309
|
return node.parent && node.parent.removeChild(node), node.parent = this, this._lastChild ? (this._lastChild._next = node, node._prev = this._lastChild, this._lastChild = node) : (this._firstChild = this._lastChild = node, node._prev = node._next = null), this._idMap || (this._idMap = new Map()), this._idMap.set(node._uid, node), this.setCount(node.count), this._structEdit = !0, node;
|
|
4361
4310
|
}
|
|
4362
|
-
appendChildArrHighPerformance(nodes) {
|
|
4311
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
4363
4312
|
return console.error("暂不支持该函数"), nodes;
|
|
4364
4313
|
}
|
|
4365
4314
|
insertBefore(newNode, referenceNode) {
|
|
@@ -4427,8 +4376,7 @@ class Node extends EventEmitter {
|
|
|
4427
4376
|
replaceChild(newChild, oldChild) {
|
|
4428
4377
|
throw new Error("暂不支持");
|
|
4429
4378
|
}
|
|
4430
|
-
find(callback) {
|
|
4431
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4379
|
+
find(callback, deep = !1) {
|
|
4432
4380
|
let target = null;
|
|
4433
4381
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
4434
4382
|
if (child.isContainer) {
|
|
@@ -4438,8 +4386,7 @@ class Node extends EventEmitter {
|
|
|
4438
4386
|
return !1;
|
|
4439
4387
|
}), target;
|
|
4440
4388
|
}
|
|
4441
|
-
findAll(callback) {
|
|
4442
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4389
|
+
findAll(callback, deep = !1) {
|
|
4443
4390
|
let nodes = [];
|
|
4444
4391
|
return this.forEachChildren((node, index) => {
|
|
4445
4392
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -4468,8 +4415,7 @@ class Node extends EventEmitter {
|
|
|
4468
4415
|
getElementsByType(type) {
|
|
4469
4416
|
return this.findAll(node => node.type === type, !0);
|
|
4470
4417
|
}
|
|
4471
|
-
getChildByName(name) {
|
|
4472
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4418
|
+
getChildByName(name, deep = !1) {
|
|
4473
4419
|
return this.find(node => node.name === name, deep);
|
|
4474
4420
|
}
|
|
4475
4421
|
getChildAt(idx) {
|
|
@@ -4588,10 +4534,7 @@ class Node extends EventEmitter {
|
|
|
4588
4534
|
removeAllListeners() {
|
|
4589
4535
|
return this.removeAllEventListeners();
|
|
4590
4536
|
}
|
|
4591
|
-
dispatchEvent(event) {
|
|
4592
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
4593
|
-
args[_key - 1] = arguments[_key];
|
|
4594
|
-
}
|
|
4537
|
+
dispatchEvent(event, ...args) {
|
|
4595
4538
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
4596
4539
|
}
|
|
4597
4540
|
emit(event, data) {
|
|
@@ -4986,8 +4929,7 @@ class SquareSymbol extends BaseSymbol {
|
|
|
4986
4929
|
}
|
|
4987
4930
|
var square$1 = new SquareSymbol();
|
|
4988
4931
|
|
|
4989
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
4990
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
4932
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
4991
4933
|
return ctx.moveTo(x + r + 2 * offset, r + y + offset), ctx.lineTo(x - r - 2 * offset, r + y + offset), ctx.lineTo(x, y - r - 2 * offset), ctx.closePath(), !0;
|
|
4992
4934
|
}
|
|
4993
4935
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -5133,8 +5075,7 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
5133
5075
|
}
|
|
5134
5076
|
var triangleLeft = new TriangleLeftSymbol();
|
|
5135
5077
|
|
|
5136
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
5137
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
5078
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
5138
5079
|
return ctx.moveTo(x - r - offset, r + y + 2 * offset), ctx.lineTo(r + x + 2 * offset, y), ctx.lineTo(x - r - offset, y - r - 2 * offset), ctx.closePath(), !0;
|
|
5139
5080
|
}
|
|
5140
5081
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -5150,8 +5091,7 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
5150
5091
|
}
|
|
5151
5092
|
var triangleRight = new TriangleRightSymbol();
|
|
5152
5093
|
|
|
5153
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
5154
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
5094
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
5155
5095
|
return ctx.moveTo(x - r - 2 * offset, y - r - offset), ctx.lineTo(x + r + 2 * offset, y - r - offset), ctx.lineTo(x, y + r + 2 * offset), ctx.closePath(), !0;
|
|
5156
5096
|
}
|
|
5157
5097
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -5368,8 +5308,7 @@ var rect = new RectSymbol();
|
|
|
5368
5308
|
|
|
5369
5309
|
const tempBounds = new AABBBounds();
|
|
5370
5310
|
class CustomSymbolClass {
|
|
5371
|
-
constructor(type, path) {
|
|
5372
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
5311
|
+
constructor(type, path, isSvg = !1) {
|
|
5373
5312
|
this.pathStr = "", this.type = type, isArray(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
5374
5313
|
}
|
|
5375
5314
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -5391,10 +5330,9 @@ class CustomSymbolClass {
|
|
|
5391
5330
|
bounds(size, bounds) {
|
|
5392
5331
|
if (size = this.parseSize(size), this.isSvg) {
|
|
5393
5332
|
if (!this.svgCache) return;
|
|
5394
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
} = _ref;
|
|
5333
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
5334
|
+
path: path
|
|
5335
|
+
}) => {
|
|
5398
5336
|
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
5399
5337
|
});
|
|
5400
5338
|
}
|
|
@@ -5450,8 +5388,7 @@ function findClosingIndex(xmlData, str, i, errMsg) {
|
|
|
5450
5388
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
5451
5389
|
return closingIndex + str.length - 1;
|
|
5452
5390
|
}
|
|
5453
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
5454
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
5391
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
5455
5392
|
let attrBoundary,
|
|
5456
5393
|
tagExp = "";
|
|
5457
5394
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -5469,8 +5406,7 @@ function tagExpWithClosingIndex(xmlData, i) {
|
|
|
5469
5406
|
tagExp += ch;
|
|
5470
5407
|
}
|
|
5471
5408
|
}
|
|
5472
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
5473
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
5409
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
5474
5410
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
5475
5411
|
if (!result) return;
|
|
5476
5412
|
let tagExp = result.data;
|
|
@@ -5632,8 +5568,7 @@ undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator)
|
|
|
5632
5568
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5633
5569
|
});
|
|
5634
5570
|
};
|
|
5635
|
-
function boundStroke(bounds, halfW, miter) {
|
|
5636
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5571
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
5637
5572
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
5638
5573
|
}
|
|
5639
5574
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -5818,7 +5753,7 @@ class DefaultMatrixAllocate {
|
|
|
5818
5753
|
get length() {
|
|
5819
5754
|
return this.pools.length;
|
|
5820
5755
|
}
|
|
5821
|
-
release() {
|
|
5756
|
+
release(...params) {
|
|
5822
5757
|
this.pools = [];
|
|
5823
5758
|
}
|
|
5824
5759
|
}
|
|
@@ -5846,7 +5781,7 @@ class DefaultMat4Allocate {
|
|
|
5846
5781
|
get length() {
|
|
5847
5782
|
return this.pools.length;
|
|
5848
5783
|
}
|
|
5849
|
-
release() {
|
|
5784
|
+
release(...params) {
|
|
5850
5785
|
this.pools = [];
|
|
5851
5786
|
}
|
|
5852
5787
|
}
|
|
@@ -5881,8 +5816,7 @@ let EmptyContext2d = class {
|
|
|
5881
5816
|
getContext() {
|
|
5882
5817
|
throw new Error("不支持getContext");
|
|
5883
5818
|
}
|
|
5884
|
-
setTransformForCurrent() {
|
|
5885
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
5819
|
+
setTransformForCurrent(force = !1) {
|
|
5886
5820
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
|
|
5887
5821
|
}
|
|
5888
5822
|
get currentMatrix() {
|
|
@@ -5903,8 +5837,7 @@ let EmptyContext2d = class {
|
|
|
5903
5837
|
highPerformanceRestore() {
|
|
5904
5838
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
5905
5839
|
}
|
|
5906
|
-
rotate(rad) {
|
|
5907
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
5840
|
+
rotate(rad, setTransform = !0) {
|
|
5908
5841
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
5909
5842
|
}
|
|
5910
5843
|
save() {
|
|
@@ -5915,55 +5848,41 @@ let EmptyContext2d = class {
|
|
|
5915
5848
|
const matrix = this.cloneMatrix(this.matrix);
|
|
5916
5849
|
this.stack.push(matrix);
|
|
5917
5850
|
}
|
|
5918
|
-
scale(sx, sy) {
|
|
5919
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5851
|
+
scale(sx, sy, setTransform = !0) {
|
|
5920
5852
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
5921
5853
|
}
|
|
5922
|
-
setScale(sx, sy) {
|
|
5923
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5854
|
+
setScale(sx, sy, setTransform = !0) {
|
|
5924
5855
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
5925
5856
|
}
|
|
5926
|
-
scalePoint(sx, sy, px, py) {
|
|
5927
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
5857
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
5928
5858
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
5929
5859
|
}
|
|
5930
|
-
setTransform(a, b, c, d, e, f) {
|
|
5931
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
5932
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
5860
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
5933
5861
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
5934
5862
|
}
|
|
5935
|
-
setTransformFromMatrix(matrix) {
|
|
5936
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
5937
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
5863
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
5938
5864
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
5939
5865
|
}
|
|
5940
|
-
resetTransform() {
|
|
5941
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
5942
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
5866
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
5943
5867
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
5944
5868
|
}
|
|
5945
|
-
transform(a, b, c, d, e, f) {
|
|
5946
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
5869
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
5947
5870
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
5948
5871
|
}
|
|
5949
5872
|
transformFromMatrix(matrix, setTransform) {
|
|
5950
5873
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
5951
5874
|
}
|
|
5952
|
-
translate(x, y) {
|
|
5953
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
5875
|
+
translate(x, y, setTransform = !0) {
|
|
5954
5876
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
5955
5877
|
}
|
|
5956
|
-
rotateDegrees(deg) {
|
|
5957
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
5878
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
5958
5879
|
const rad = deg * Math.PI / 180;
|
|
5959
5880
|
this.rotate(rad, setTransform);
|
|
5960
5881
|
}
|
|
5961
|
-
rotateAbout(rad, x, y) {
|
|
5962
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
5882
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
5963
5883
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
5964
5884
|
}
|
|
5965
|
-
rotateDegreesAbout(deg, x, y) {
|
|
5966
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
5885
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
5967
5886
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
5968
5887
|
}
|
|
5969
5888
|
beginPath() {
|
|
@@ -6057,19 +5976,16 @@ let EmptyContext2d = class {
|
|
|
6057
5976
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {}
|
|
6058
5977
|
setTextStyle(params, defaultParams) {}
|
|
6059
5978
|
draw() {}
|
|
6060
|
-
clearMatrix() {
|
|
6061
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6062
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
5979
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
6063
5980
|
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
6064
5981
|
}
|
|
6065
5982
|
setClearMatrix(a, b, c, d, e, f) {
|
|
6066
5983
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
6067
5984
|
}
|
|
6068
|
-
onlyTranslate() {
|
|
6069
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
5985
|
+
onlyTranslate(dpr = this.dpr) {
|
|
6070
5986
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
6071
5987
|
}
|
|
6072
|
-
release() {
|
|
5988
|
+
release(...params) {
|
|
6073
5989
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
6074
5990
|
}
|
|
6075
5991
|
};
|
|
@@ -6080,9 +5996,7 @@ var ColorType;
|
|
|
6080
5996
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
6081
5997
|
}(ColorType || (ColorType = {}));
|
|
6082
5998
|
class ColorStore {
|
|
6083
|
-
static Get(str) {
|
|
6084
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
6085
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
5999
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
6086
6000
|
if (size === ColorType.Color1) {
|
|
6087
6001
|
const color = ColorStore.store1[str];
|
|
6088
6002
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -6110,8 +6024,7 @@ class ColorStore {
|
|
|
6110
6024
|
}
|
|
6111
6025
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
6112
6026
|
|
|
6113
|
-
function colorArrayToString(color) {
|
|
6114
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6027
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
6115
6028
|
return Array.isArray(color) && isNumber(color[0]) ? alphaChannel ? `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])},${color[3].toFixed(2)})` : `rgb(${Math.round(color[0])},${Math.round(color[1])},${Math.round(color[2])})` : color;
|
|
6116
6029
|
}
|
|
6117
6030
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -6295,8 +6208,7 @@ class Graphic extends Node {
|
|
|
6295
6208
|
get globalTransMatrix() {
|
|
6296
6209
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
6297
6210
|
}
|
|
6298
|
-
constructor() {
|
|
6299
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6211
|
+
constructor(params = {}) {
|
|
6300
6212
|
var _a;
|
|
6301
6213
|
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
6302
6214
|
}
|
|
@@ -6316,8 +6228,7 @@ class Graphic extends Node {
|
|
|
6316
6228
|
set2dMode() {
|
|
6317
6229
|
this.in3dMode = !1;
|
|
6318
6230
|
}
|
|
6319
|
-
getOffsetXY(attr) {
|
|
6320
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6231
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
6321
6232
|
var _a, _b;
|
|
6322
6233
|
const {
|
|
6323
6234
|
dx = attr.dx,
|
|
@@ -6428,7 +6339,7 @@ class Graphic extends Node {
|
|
|
6428
6339
|
const b = this.AABBBounds;
|
|
6429
6340
|
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this._globalAABBBounds.empty() || this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
6430
6341
|
}
|
|
6431
|
-
tryUpdateGlobalTransMatrix() {
|
|
6342
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
6432
6343
|
if (this._globalTransMatrix) {
|
|
6433
6344
|
if (this.parent) {
|
|
6434
6345
|
const m = this.parent.globalTransMatrix;
|
|
@@ -6440,8 +6351,7 @@ class Graphic extends Node {
|
|
|
6440
6351
|
shouldUpdateGlobalMatrix() {
|
|
6441
6352
|
return !0;
|
|
6442
6353
|
}
|
|
6443
|
-
tryUpdateLocalTransMatrix() {
|
|
6444
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6354
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
6445
6355
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
6446
6356
|
}
|
|
6447
6357
|
shouldUpdateAABBBounds() {
|
|
@@ -6481,23 +6391,17 @@ class Graphic extends Node {
|
|
|
6481
6391
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
6482
6392
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
6483
6393
|
}
|
|
6484
|
-
setAttributesAndPreventAnimate(params) {
|
|
6485
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6486
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6394
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
6487
6395
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
6488
6396
|
Object.keys(params).forEach(key => {
|
|
6489
6397
|
animate.preventAttr(key);
|
|
6490
6398
|
});
|
|
6491
6399
|
});
|
|
6492
6400
|
}
|
|
6493
|
-
setAttributes(params) {
|
|
6494
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6495
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6401
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
6496
6402
|
(params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context);
|
|
6497
6403
|
}
|
|
6498
|
-
_setAttributes(params) {
|
|
6499
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6500
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
6404
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
6501
6405
|
const keys = Object.keys(params);
|
|
6502
6406
|
for (let i = 0; i < keys.length; i++) {
|
|
6503
6407
|
const key = keys[i];
|
|
@@ -6512,16 +6416,14 @@ class Graphic extends Node {
|
|
|
6512
6416
|
}, this.attribute, key, context);
|
|
6513
6417
|
params ? this._setAttributes(params, forceUpdateTag, context) : isNil(null === (_a = this.normalAttrs) || void 0 === _a ? void 0 : _a[key]) ? (this.attribute[key] = value, this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag(), this.onAttributeUpdate(context)) : this.normalAttrs[key] = value, "background" === key ? this.loadImage(value, !0) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
6514
6418
|
}
|
|
6515
|
-
needUpdateTags(keys) {
|
|
6516
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
6419
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
6517
6420
|
for (let i = 0; i < k.length; i++) {
|
|
6518
6421
|
const attrKey = k[i];
|
|
6519
6422
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
6520
6423
|
}
|
|
6521
6424
|
return !1;
|
|
6522
6425
|
}
|
|
6523
|
-
needUpdateTag(key) {
|
|
6524
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
6426
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
6525
6427
|
for (let i = 0; i < k.length; i++) {
|
|
6526
6428
|
if (key === k[i]) return !0;
|
|
6527
6429
|
}
|
|
@@ -6677,8 +6579,7 @@ class Graphic extends Node {
|
|
|
6677
6579
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
6678
6580
|
}), this.normalAttrs = newNormalAttrs;
|
|
6679
6581
|
}
|
|
6680
|
-
stopStateAnimates() {
|
|
6681
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
6582
|
+
stopStateAnimates(type = "end") {
|
|
6682
6583
|
this.animates && this.animates.forEach(animate => {
|
|
6683
6584
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
6684
6585
|
});
|
|
@@ -6842,8 +6743,7 @@ class Graphic extends Node {
|
|
|
6842
6743
|
var _a;
|
|
6843
6744
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
6844
6745
|
}
|
|
6845
|
-
onSetStage(cb) {
|
|
6846
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6746
|
+
onSetStage(cb, immediate = !1) {
|
|
6847
6747
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
6848
6748
|
}
|
|
6849
6749
|
attachShadow(shadowRoot) {
|
|
@@ -6864,8 +6764,7 @@ class Graphic extends Node {
|
|
|
6864
6764
|
createPathProxy(path) {
|
|
6865
6765
|
return isString(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
6866
6766
|
}
|
|
6867
|
-
loadImage(image) {
|
|
6868
|
-
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6767
|
+
loadImage(image, background = !1) {
|
|
6869
6768
|
if (!image || background && backgroundNotImage(image)) return;
|
|
6870
6769
|
const url = image;
|
|
6871
6770
|
this.resources || (this.resources = new Map());
|
|
@@ -6895,8 +6794,7 @@ class Graphic extends Node {
|
|
|
6895
6794
|
animate.stop();
|
|
6896
6795
|
});
|
|
6897
6796
|
}
|
|
6898
|
-
stopAnimates() {
|
|
6899
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
6797
|
+
stopAnimates(stopChildren = !1) {
|
|
6900
6798
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
6901
6799
|
c.stopAnimates(stopChildren);
|
|
6902
6800
|
});
|
|
@@ -7044,8 +6942,7 @@ class Group extends Graphic {
|
|
|
7044
6942
|
_updateChildToStage(child) {
|
|
7045
6943
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
7046
6944
|
}
|
|
7047
|
-
appendChild(node) {
|
|
7048
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
6945
|
+
appendChild(node, addStage = !0) {
|
|
7049
6946
|
const data = super.appendChild(node);
|
|
7050
6947
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
7051
6948
|
}
|
|
@@ -7062,8 +6959,7 @@ class Group extends Graphic {
|
|
|
7062
6959
|
const data = super.removeChild(child);
|
|
7063
6960
|
return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
|
|
7064
6961
|
}
|
|
7065
|
-
removeAllChild() {
|
|
7066
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
6962
|
+
removeAllChild(deep = !1) {
|
|
7067
6963
|
this.forEachChildren(child => {
|
|
7068
6964
|
this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
7069
6965
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -7083,8 +6979,7 @@ class Group extends Graphic {
|
|
|
7083
6979
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
7084
6980
|
});
|
|
7085
6981
|
}
|
|
7086
|
-
tryUpdateGlobalTransMatrix() {
|
|
7087
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6982
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
7088
6983
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
7089
6984
|
if (this._globalTransMatrix) {
|
|
7090
6985
|
if (this.parent) {
|
|
@@ -7158,8 +7053,7 @@ class Layer extends Group {
|
|
|
7158
7053
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
7159
7054
|
}), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
|
|
7160
7055
|
}
|
|
7161
|
-
combineSubLayer() {
|
|
7162
|
-
let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
7056
|
+
combineSubLayer(removeIncrementalKey = !0) {
|
|
7163
7057
|
const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
|
|
7164
7058
|
this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
|
|
7165
7059
|
l.group && (l.group.incremental = 0);
|
|
@@ -7268,10 +7162,9 @@ let DefaultLayerService = DefaultLayerService_1 = class {
|
|
|
7268
7162
|
let layerHandler;
|
|
7269
7163
|
return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
|
|
7270
7164
|
}
|
|
7271
|
-
createLayer(stage
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
};
|
|
7165
|
+
createLayer(stage, options = {
|
|
7166
|
+
main: !1
|
|
7167
|
+
}) {
|
|
7275
7168
|
var _a;
|
|
7276
7169
|
this.tryInit();
|
|
7277
7170
|
let layerMode = this.getRecommendedLayerType(options.layerMode);
|
|
@@ -7512,8 +7405,7 @@ const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContrib
|
|
|
7512
7405
|
function textDrawOffsetX(textAlign, width) {
|
|
7513
7406
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
7514
7407
|
}
|
|
7515
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
7516
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
7408
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
7517
7409
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
7518
7410
|
}
|
|
7519
7411
|
|
|
@@ -7727,10 +7619,9 @@ const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
|
|
|
7727
7619
|
|
|
7728
7620
|
const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
7729
7621
|
class Circle extends Graphic {
|
|
7730
|
-
constructor(
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
};
|
|
7622
|
+
constructor(params = {
|
|
7623
|
+
radius: 1
|
|
7624
|
+
}) {
|
|
7734
7625
|
super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
7735
7626
|
}
|
|
7736
7627
|
isValid() {
|
|
@@ -7812,10 +7703,7 @@ class CanvasTextLayout {
|
|
|
7812
7703
|
} else bbox.yOffset = -bbox.height;
|
|
7813
7704
|
return bbox;
|
|
7814
7705
|
}
|
|
7815
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
7816
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
7817
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
7818
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
7706
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
7819
7707
|
const {
|
|
7820
7708
|
lineWidth: lineWidth,
|
|
7821
7709
|
suffixPosition = "end",
|
|
@@ -7938,11 +7826,10 @@ class Text extends Graphic {
|
|
|
7938
7826
|
get isMultiLine() {
|
|
7939
7827
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
7940
7828
|
}
|
|
7941
|
-
constructor(
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
};
|
|
7829
|
+
constructor(params = {
|
|
7830
|
+
text: "",
|
|
7831
|
+
fontSize: 16
|
|
7832
|
+
}) {
|
|
7946
7833
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
7947
7834
|
}
|
|
7948
7835
|
isValid() {
|
|
@@ -8274,12 +8161,10 @@ class Text extends Graphic {
|
|
|
8274
8161
|
var _a;
|
|
8275
8162
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
8276
8163
|
}
|
|
8277
|
-
needUpdateTags(keys) {
|
|
8278
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
8164
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
8279
8165
|
return super.needUpdateTags(keys, k);
|
|
8280
8166
|
}
|
|
8281
|
-
needUpdateTag(key) {
|
|
8282
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
8167
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
8283
8168
|
return super.needUpdateTag(key, k);
|
|
8284
8169
|
}
|
|
8285
8170
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -8482,19 +8367,15 @@ const updateBoundsOfSymbolOuterBorder = (attribute, symbolTheme, aabbBounds) =>
|
|
|
8482
8367
|
|
|
8483
8368
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8484
8369
|
let Symbol$1 = class Symbol extends Graphic {
|
|
8485
|
-
constructor(
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
};
|
|
8370
|
+
constructor(params = {
|
|
8371
|
+
symbolType: "circle"
|
|
8372
|
+
}) {
|
|
8489
8373
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
8490
8374
|
}
|
|
8491
8375
|
getParsedPath() {
|
|
8492
8376
|
return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
|
|
8493
8377
|
}
|
|
8494
|
-
getParsedPath2D() {
|
|
8495
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8496
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8497
|
-
let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
8378
|
+
getParsedPath2D(x = 0, y = 0, size = 1) {
|
|
8498
8379
|
let path = null;
|
|
8499
8380
|
try {
|
|
8500
8381
|
path = new Path2D();
|
|
@@ -8579,8 +8460,7 @@ function createSymbol(attributes) {
|
|
|
8579
8460
|
|
|
8580
8461
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8581
8462
|
let Line$1 = class Line extends Graphic {
|
|
8582
|
-
constructor() {
|
|
8583
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8463
|
+
constructor(params = {}) {
|
|
8584
8464
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
8585
8465
|
}
|
|
8586
8466
|
isValid() {
|
|
@@ -9318,8 +9198,7 @@ class Wrapper {
|
|
|
9318
9198
|
line = new Line(this.frame.left, this[this.directionKey.width], this.y + maxAscent, maxAscent, maxDescent, this.lineBuffer, this.direction, "horizontal" === this.direction ? this.frame.isWidthMax : this.frame.isHeightMax);
|
|
9319
9199
|
this.frame.lines.push(line), this.frame.actualHeight += line.height, this.y += line.height, this.lineBuffer.length = 0, this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
|
|
9320
9200
|
}
|
|
9321
|
-
deal(paragraph) {
|
|
9322
|
-
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
9201
|
+
deal(paragraph, singleLine = !1) {
|
|
9323
9202
|
paragraph instanceof RichTextIcon ? "horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : 0 === this.lineBuffer.length ? (this.store(paragraph), this.send()) : (this.send(), this.deal(paragraph)) : "number" != typeof this.width || this.width < 0 || (paragraph.newLine && this.send(), (0 !== paragraph.text.length || this.newLine) && ("horizontal" === this.direction && 0 === this.width || "vertical" === this.direction && 0 === this.height || this.lineWidth + paragraph[this.directionKey.width] <= this[this.directionKey.width] ? this.store(paragraph) : this.lineWidth === this[this.directionKey.width] ? (this.send(), this.deal(paragraph)) : this.cut(paragraph, singleLine)));
|
|
9324
9203
|
}
|
|
9325
9204
|
cut(paragraph, singleLine) {
|
|
@@ -10630,9 +10509,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
10630
10509
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
10631
10510
|
|
|
10632
10511
|
const halfPi = pi / 2;
|
|
10633
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
10634
|
-
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
10635
|
-
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
10512
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
10636
10513
|
let cornerRadius;
|
|
10637
10514
|
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
10638
10515
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -10973,8 +10850,7 @@ class BaseRender {
|
|
|
10973
10850
|
doStroke: doStroke
|
|
10974
10851
|
};
|
|
10975
10852
|
}
|
|
10976
|
-
transform(graphic, graphicAttribute, context) {
|
|
10977
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
10853
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
10978
10854
|
const {
|
|
10979
10855
|
x = graphicAttribute.x,
|
|
10980
10856
|
y = graphicAttribute.y,
|
|
@@ -12096,7 +11972,7 @@ class DefaultBoundsAllocate {
|
|
|
12096
11972
|
get length() {
|
|
12097
11973
|
return this.pools.length;
|
|
12098
11974
|
}
|
|
12099
|
-
release() {
|
|
11975
|
+
release(...params) {
|
|
12100
11976
|
this.pools = [];
|
|
12101
11977
|
}
|
|
12102
11978
|
}
|
|
@@ -12321,8 +12197,7 @@ function drawPolygon(path, points, x, y) {
|
|
|
12321
12197
|
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
12322
12198
|
}
|
|
12323
12199
|
}
|
|
12324
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
12325
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
12200
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
12326
12201
|
var _a;
|
|
12327
12202
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
12328
12203
|
let startI = 0,
|
|
@@ -13080,7 +12955,7 @@ let DefaultPluginService = class {
|
|
|
13080
12955
|
unRegister(plugin) {
|
|
13081
12956
|
"onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
|
|
13082
12957
|
}
|
|
13083
|
-
release() {
|
|
12958
|
+
release(...params) {
|
|
13084
12959
|
this.onStartupFinishedPlugin.forEach(plugin => {
|
|
13085
12960
|
plugin.deactivate(this);
|
|
13086
12961
|
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
|
|
@@ -13227,9 +13102,7 @@ function parseChildMap(graphic, defaultZIndex, reverse) {
|
|
|
13227
13102
|
zIdxArray: zIdxArray
|
|
13228
13103
|
};
|
|
13229
13104
|
}
|
|
13230
|
-
function foreach(graphic, defaultZIndex, cb) {
|
|
13231
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13232
|
-
let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
13105
|
+
function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
13233
13106
|
let needSort = !1;
|
|
13234
13107
|
if (sort3d) needSort = !0;else {
|
|
13235
13108
|
let lastZIndex;
|
|
@@ -13260,14 +13133,12 @@ function foreach(graphic, defaultZIndex, cb) {
|
|
|
13260
13133
|
}
|
|
13261
13134
|
} else graphic.forEachChildren(cb, reverse);
|
|
13262
13135
|
}
|
|
13263
|
-
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
13264
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13136
|
+
function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
13265
13137
|
return __awaiter$2(this, void 0, void 0, function* () {
|
|
13266
13138
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
13267
13139
|
});
|
|
13268
13140
|
}
|
|
13269
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
13270
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
13141
|
+
function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
13271
13142
|
let needSort = !1;
|
|
13272
13143
|
graphic.forEachChildren((item, i) => {
|
|
13273
13144
|
const {
|
|
@@ -14109,6 +13980,13 @@ class AbstractComponent extends Group {
|
|
|
14109
13980
|
changeEvent.manager = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventSystem.manager;
|
|
14110
13981
|
this.dispatchEvent(changeEvent);
|
|
14111
13982
|
}
|
|
13983
|
+
eventPosToStagePos(e) {
|
|
13984
|
+
var _a, _b;
|
|
13985
|
+
const result = { x: 0, y: 0 };
|
|
13986
|
+
const stagePoints = (_b = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventPointTransform(e)) !== null && _b !== void 0 ? _b : { x: 0, y: 0 };
|
|
13987
|
+
this.globalTransMatrix.transformPoint(stagePoints, result);
|
|
13988
|
+
return result;
|
|
13989
|
+
}
|
|
14112
13990
|
}
|
|
14113
13991
|
|
|
14114
13992
|
const MathPickerContribution = Symbol.for("MathPickerContribution");
|
|
@@ -18767,6 +18645,10 @@ class InterpolateUpdateStore {
|
|
|
18767
18645
|
target.attribute.x = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
18768
18646
|
}, this.y = (key, from, to, ratio, step, target) => {
|
|
18769
18647
|
target.attribute.y = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
18648
|
+
}, this.dx = (key, from, to, ratio, step, target) => {
|
|
18649
|
+
target.attribute.dx = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
18650
|
+
}, this.dy = (key, from, to, ratio, step, target) => {
|
|
18651
|
+
target.attribute.dy = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
18770
18652
|
}, this.angle = (key, from, to, ratio, step, target) => {
|
|
18771
18653
|
target.attribute.angle = interpolateNumber(from, to, ratio), target.addUpdateBoundTag(), target.addUpdatePositionTag();
|
|
18772
18654
|
}, this.scaleX = (key, from, to, ratio, step, target) => {
|
|
@@ -18835,8 +18717,7 @@ class Step {
|
|
|
18835
18717
|
getLastProps() {
|
|
18836
18718
|
return this.prev ? this.prev.props || {} : this.animate.getStartProps();
|
|
18837
18719
|
}
|
|
18838
|
-
setDuration(duration) {
|
|
18839
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
18720
|
+
setDuration(duration, updateDownstream = !0) {
|
|
18840
18721
|
this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
|
|
18841
18722
|
}
|
|
18842
18723
|
getDuration() {
|
|
@@ -18857,8 +18738,7 @@ class Step {
|
|
|
18857
18738
|
} else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
|
|
18858
18739
|
}), this.interpolateUpdateFunctions = funcs;
|
|
18859
18740
|
}
|
|
18860
|
-
setStartTime(time) {
|
|
18861
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
18741
|
+
setStartTime(time, updateDownstream = !0) {
|
|
18862
18742
|
this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
|
|
18863
18743
|
}
|
|
18864
18744
|
getStartTime() {
|
|
@@ -18984,8 +18864,7 @@ class DefaultTimeline extends EventEmitter {
|
|
|
18984
18864
|
animate.release();
|
|
18985
18865
|
}), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
|
|
18986
18866
|
}
|
|
18987
|
-
removeAnimate(animate) {
|
|
18988
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
18867
|
+
removeAnimate(animate, release = !0) {
|
|
18989
18868
|
const node = this.animateMap.get(animate);
|
|
18990
18869
|
node && (release && (animate._onRemove && animate._onRemove.forEach(cb => cb()), animate.release()), node.prev ? node.prev.next = node.next : this.head = node.next, node.next ? node.next.prev = node.prev : this.tail = node.prev, this.animateMap.delete(animate), this._animateCount--, animate.getStartTime() + animate.getDuration() >= this._totalDuration && this.recalculateTotalDuration());
|
|
18991
18870
|
}
|
|
@@ -19023,10 +18902,7 @@ const defaultTimeline = new DefaultTimeline();
|
|
|
19023
18902
|
defaultTimeline.isGlobal = !0;
|
|
19024
18903
|
|
|
19025
18904
|
class Animate {
|
|
19026
|
-
constructor() {
|
|
19027
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
19028
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
19029
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
18905
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
19030
18906
|
this.id = id, this.status = AnimateStatus.INITIAL, this._timeline = timeline, timeline.addAnimate(this), this.slience = slience, this._startTime = 0, this._duration = 0, this._totalDuration = 0, this._loopCount = 0, this._currentLoop = 0, this._bounce = !1, this._firstStep = null, this._lastStep = null, this._startProps = {}, this._endProps = {}, this._preventAttrs = new Set(), this.currentTime = 0, this.interpolateUpdateFunction = null, this.priority = 0;
|
|
19031
18907
|
}
|
|
19032
18908
|
getStartProps() {
|
|
@@ -19047,9 +18923,7 @@ class Animate {
|
|
|
19047
18923
|
bind(target) {
|
|
19048
18924
|
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
19049
18925
|
}
|
|
19050
|
-
to(props) {
|
|
19051
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
19052
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
18926
|
+
to(props, duration = 300, easing = "linear") {
|
|
19053
18927
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
19054
18928
|
return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
|
|
19055
18929
|
}
|
|
@@ -19079,9 +18953,7 @@ class Animate {
|
|
|
19079
18953
|
this._endProps[key] = currentStep.props[key];
|
|
19080
18954
|
}), currentStep = currentStep.next;
|
|
19081
18955
|
}
|
|
19082
|
-
from(props) {
|
|
19083
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
19084
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
18956
|
+
from(props, duration = 300, easing = "linear") {
|
|
19085
18957
|
const step = new Step(AnimateStepType.from, props, duration, easing);
|
|
19086
18958
|
return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
|
|
19087
18959
|
}
|
|
@@ -19319,8 +19191,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
19319
19191
|
}
|
|
19320
19192
|
return !1;
|
|
19321
19193
|
}
|
|
19322
|
-
start() {
|
|
19323
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
19194
|
+
start(force = !1) {
|
|
19324
19195
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
19325
19196
|
if (!this.tickerHandler) return !1;
|
|
19326
19197
|
if (!force) {
|
|
@@ -19591,7 +19462,10 @@ class AnimateExecutor {
|
|
|
19591
19462
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
19592
19463
|
var _a, _b, _c, _d;
|
|
19593
19464
|
if (custom && customType) {
|
|
19594
|
-
const customParams = this.resolveValue(customParameters, graphic, {
|
|
19465
|
+
const customParams = this.resolveValue(customParameters, graphic, {
|
|
19466
|
+
width: graphic.stage.width,
|
|
19467
|
+
height: graphic.stage.height
|
|
19468
|
+
}),
|
|
19595
19469
|
objOptions = isFunction(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
|
|
19596
19470
|
customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
|
|
19597
19471
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -19680,14 +19554,10 @@ class AnimateExecutor {
|
|
|
19680
19554
|
var _a, _b;
|
|
19681
19555
|
return void 0 === value ? defaultValue : "function" == typeof value && graphic ? value(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : value;
|
|
19682
19556
|
}
|
|
19683
|
-
executeItem(params, graphic) {
|
|
19684
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19685
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
19557
|
+
executeItem(params, graphic, index = 0, count = 1) {
|
|
19686
19558
|
return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
|
|
19687
19559
|
}
|
|
19688
|
-
_executeItem(params, graphic) {
|
|
19689
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
19690
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
19560
|
+
_executeItem(params, graphic, index = 0, count = 1) {
|
|
19691
19561
|
if (!graphic) return null;
|
|
19692
19562
|
const isTimeline = ("timeSlices" in params);
|
|
19693
19563
|
let animate = null;
|
|
@@ -19855,8 +19725,7 @@ class GraphicStateExtension {
|
|
|
19855
19725
|
}
|
|
19856
19726
|
|
|
19857
19727
|
class AnimateExtension {
|
|
19858
|
-
getAttributes() {
|
|
19859
|
-
let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
19728
|
+
getAttributes(final = !1) {
|
|
19860
19729
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
19861
19730
|
}
|
|
19862
19731
|
animate(params) {
|
|
@@ -19901,8 +19770,7 @@ class AnimateExtension {
|
|
|
19901
19770
|
getFinalAttribute() {
|
|
19902
19771
|
return this.finalAttribute;
|
|
19903
19772
|
}
|
|
19904
|
-
getGraphicAttribute(key) {
|
|
19905
|
-
let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
19773
|
+
getGraphicAttribute(key, prev = !1) {
|
|
19906
19774
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
19907
19775
|
}
|
|
19908
19776
|
}
|
|
@@ -21068,7 +20936,7 @@ const calculateFlushPos = (basePosition, size, rangePosition, otherEnd) => {
|
|
|
21068
20936
|
: rangePosition - size;
|
|
21069
20937
|
};
|
|
21070
20938
|
const getCartesianLabelBounds = (scale, domain, op) => {
|
|
21071
|
-
var _a;
|
|
20939
|
+
var _a, _b, _c;
|
|
21072
20940
|
const { labelStyle, axisOrientType, labelFlush, labelFormatter, startAngle = 0 } = op;
|
|
21073
20941
|
let labelAngle = (_a = labelStyle.angle) !== null && _a !== void 0 ? _a : 0;
|
|
21074
20942
|
if (labelStyle.direction === 'vertical') {
|
|
@@ -21089,9 +20957,14 @@ const getCartesianLabelBounds = (scale, domain, op) => {
|
|
|
21089
20957
|
}
|
|
21090
20958
|
const textMeasure = initTextMeasure(labelStyle);
|
|
21091
20959
|
const range = scale.range();
|
|
21092
|
-
|
|
21093
|
-
|
|
20960
|
+
let labelBoundsList = [];
|
|
20961
|
+
for (let i = 0; i < domain.length; i++) {
|
|
20962
|
+
const v = domain[i];
|
|
21094
20963
|
const str = labelFormatter ? labelFormatter(v) : `${v}`;
|
|
20964
|
+
if (isPlainObject(str)) {
|
|
20965
|
+
labelBoundsList = undefined;
|
|
20966
|
+
break;
|
|
20967
|
+
}
|
|
21095
20968
|
const { width, height } = textMeasure.quickMeasure(str);
|
|
21096
20969
|
const textWidth = Math.max(width, MIN_TICK_GAP);
|
|
21097
20970
|
const textHeight = Math.max(height, MIN_TICK_GAP);
|
|
@@ -21108,7 +20981,7 @@ const getCartesianLabelBounds = (scale, domain, op) => {
|
|
|
21108
20981
|
textX = calculateFlushPos(baseTextX, textWidth, range[range.length - 1], range[0]);
|
|
21109
20982
|
}
|
|
21110
20983
|
else {
|
|
21111
|
-
align = (
|
|
20984
|
+
align = (_b = labelStyle.textAlign) !== null && _b !== void 0 ? _b : 'center';
|
|
21112
20985
|
}
|
|
21113
20986
|
if (align === 'right') {
|
|
21114
20987
|
textX -= textWidth;
|
|
@@ -21124,7 +20997,7 @@ const getCartesianLabelBounds = (scale, domain, op) => {
|
|
|
21124
20997
|
textY = calculateFlushPos(baseTextY, textHeight, range[range.length - 1], range[0]);
|
|
21125
20998
|
}
|
|
21126
20999
|
else {
|
|
21127
|
-
baseline = (
|
|
21000
|
+
baseline = (_c = labelStyle.textBaseline) !== null && _c !== void 0 ? _c : 'middle';
|
|
21128
21001
|
}
|
|
21129
21002
|
if (baseline === 'bottom') {
|
|
21130
21003
|
textY -= textHeight;
|
|
@@ -21136,8 +21009,8 @@ const getCartesianLabelBounds = (scale, domain, op) => {
|
|
|
21136
21009
|
if (labelAngle) {
|
|
21137
21010
|
bounds.rotate(labelAngle, baseTextX, baseTextY);
|
|
21138
21011
|
}
|
|
21139
|
-
|
|
21140
|
-
}
|
|
21012
|
+
labelBoundsList.push(bounds);
|
|
21013
|
+
}
|
|
21141
21014
|
return labelBoundsList;
|
|
21142
21015
|
};
|
|
21143
21016
|
const isAxisHorizontal = (axisOrientType) => {
|
|
@@ -21202,7 +21075,7 @@ function forceItemVisible(sourceItem, items, check, comparator, inverse = false)
|
|
|
21202
21075
|
}
|
|
21203
21076
|
const DEFAULT_CONTINUOUS_TICK_COUNT = 5;
|
|
21204
21077
|
const continuousTicks = (scale, op) => {
|
|
21205
|
-
var _a, _b;
|
|
21078
|
+
var _a, _b, _c, _d;
|
|
21206
21079
|
if (!isContinuous(scale.type)) {
|
|
21207
21080
|
return convertDomainToTickData(scale.domain());
|
|
21208
21081
|
}
|
|
@@ -21265,44 +21138,46 @@ const continuousTicks = (scale, op) => {
|
|
|
21265
21138
|
samplingScaleTicks.push(tick);
|
|
21266
21139
|
}
|
|
21267
21140
|
});
|
|
21268
|
-
items = getCartesianLabelBounds(scale, samplingScaleTicks, op).map((bounds, i) => ({
|
|
21141
|
+
items = (_c = getCartesianLabelBounds(scale, samplingScaleTicks, op)) === null || _c === void 0 ? void 0 : _c.map((bounds, i) => ({
|
|
21269
21142
|
AABBBounds: bounds,
|
|
21270
21143
|
value: samplingScaleTicks[i]
|
|
21271
21144
|
}));
|
|
21272
21145
|
}
|
|
21273
21146
|
else {
|
|
21274
|
-
items = getCartesianLabelBounds(scale, scaleTicks, op).map((bounds, i) => ({
|
|
21147
|
+
items = (_d = getCartesianLabelBounds(scale, scaleTicks, op)) === null || _d === void 0 ? void 0 : _d.map((bounds, i) => ({
|
|
21275
21148
|
AABBBounds: bounds,
|
|
21276
21149
|
value: scaleTicks[i]
|
|
21277
21150
|
}));
|
|
21278
21151
|
}
|
|
21279
|
-
|
|
21280
|
-
|
|
21281
|
-
|
|
21282
|
-
|
|
21283
|
-
items
|
|
21284
|
-
|
|
21285
|
-
const checkFirst = op.labelFirstVisible;
|
|
21286
|
-
let checkLast = op.labelLastVisible;
|
|
21287
|
-
if (textIntersect(firstSourceItem, lastSourceItem, labelGap)) {
|
|
21288
|
-
if (items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast) {
|
|
21289
|
-
items.splice(items.indexOf(lastSourceItem), 1);
|
|
21290
|
-
checkLast = false;
|
|
21152
|
+
if (items) {
|
|
21153
|
+
const firstSourceItem = items[0];
|
|
21154
|
+
const lastSourceItem = last(items);
|
|
21155
|
+
const samplingMethod = breakData && breakData() ? methods.greedy : methods.parity;
|
|
21156
|
+
while (items.length >= 3 && hasOverlap(items, labelGap)) {
|
|
21157
|
+
items = samplingMethod(items, labelGap);
|
|
21291
21158
|
}
|
|
21292
|
-
|
|
21293
|
-
|
|
21294
|
-
|
|
21295
|
-
|
|
21296
|
-
|
|
21297
|
-
|
|
21298
|
-
|
|
21299
|
-
ticks.pop();
|
|
21159
|
+
const checkFirst = op.labelFirstVisible;
|
|
21160
|
+
let checkLast = op.labelLastVisible;
|
|
21161
|
+
if (textIntersect(firstSourceItem, lastSourceItem, labelGap)) {
|
|
21162
|
+
if (items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast) {
|
|
21163
|
+
items.splice(items.indexOf(lastSourceItem), 1);
|
|
21164
|
+
checkLast = false;
|
|
21165
|
+
}
|
|
21300
21166
|
}
|
|
21301
|
-
|
|
21302
|
-
|
|
21167
|
+
forceItemVisible(firstSourceItem, items, checkFirst, (item) => textIntersect(item, firstSourceItem, labelGap));
|
|
21168
|
+
forceItemVisible(lastSourceItem, items, checkLast, (item) => textIntersect(item, lastSourceItem, labelGap) ||
|
|
21169
|
+
(checkFirst && item !== firstSourceItem ? textIntersect(item, firstSourceItem, labelGap) : false), true);
|
|
21170
|
+
const ticks = items.map(item => item.value);
|
|
21171
|
+
if (ticks.length < 3 && labelFlush) {
|
|
21172
|
+
if (ticks.length > 1) {
|
|
21173
|
+
ticks.pop();
|
|
21174
|
+
}
|
|
21175
|
+
if (last(ticks) !== last(scaleTicks)) {
|
|
21176
|
+
ticks.push(last(scaleTicks));
|
|
21177
|
+
}
|
|
21303
21178
|
}
|
|
21179
|
+
scaleTicks = ticks;
|
|
21304
21180
|
}
|
|
21305
|
-
scaleTicks = ticks;
|
|
21306
21181
|
}
|
|
21307
21182
|
}
|
|
21308
21183
|
return convertDomainToTickData(scaleTicks);
|
|
@@ -21325,12 +21200,13 @@ const methods = {
|
|
|
21325
21200
|
|
|
21326
21201
|
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) => {
|
|
21327
21202
|
const labelBoundsList = getCartesianLabelBounds(scale, domain, op);
|
|
21328
|
-
return labelBoundsList
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21333
|
-
|
|
21203
|
+
return (labelBoundsList &&
|
|
21204
|
+
labelBoundsList.map(bounds => {
|
|
21205
|
+
if (isHorizontal) {
|
|
21206
|
+
return [bounds.x1, bounds.x2, bounds.width()];
|
|
21207
|
+
}
|
|
21208
|
+
return [bounds.y1, bounds.y2, bounds.height()];
|
|
21209
|
+
}));
|
|
21334
21210
|
};
|
|
21335
21211
|
const boundsOverlap = (prevBounds, nextBounds, gap = 0) => {
|
|
21336
21212
|
return Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
@@ -21376,47 +21252,51 @@ const linearDiscreteTicks = (scale, op) => {
|
|
|
21376
21252
|
const rangeStart = minInArray(range);
|
|
21377
21253
|
const rangeEnd = maxInArray(range);
|
|
21378
21254
|
if (domain.length <= rangeSize / fontSize) {
|
|
21379
|
-
const incrementUnit = (rangeEnd - rangeStart) / domain.length;
|
|
21380
21255
|
const labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal);
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
21384
|
-
|
|
21385
|
-
|
|
21386
|
-
|
|
21256
|
+
if (labelBoundsList) {
|
|
21257
|
+
const minBoundsLength = Math.min(...labelBoundsList.map(bounds => bounds[2]));
|
|
21258
|
+
const incrementUnit = (rangeEnd - rangeStart) / domain.length;
|
|
21259
|
+
const stepResult = getStep$1(domain, labelBoundsList, labelGap, op.labelLastVisible, Math.floor(minBoundsLength / incrementUnit), false);
|
|
21260
|
+
scaleTicks = scale.stepTicks(stepResult.step);
|
|
21261
|
+
if (op.labelLastVisible) {
|
|
21262
|
+
if (stepResult.delCount) {
|
|
21263
|
+
scaleTicks = scaleTicks.slice(0, scaleTicks.length - stepResult.delCount);
|
|
21264
|
+
}
|
|
21265
|
+
scaleTicks.push(domain[domain.length - 1]);
|
|
21387
21266
|
}
|
|
21388
|
-
scaleTicks.push(domain[domain.length - 1]);
|
|
21389
21267
|
}
|
|
21390
21268
|
}
|
|
21391
21269
|
else {
|
|
21392
21270
|
const tempDomain = [domain[0], domain[Math.floor(domain.length / 2)], domain[domain.length - 1]];
|
|
21393
21271
|
const tempList = getOneDimensionalLabelBounds(scale, tempDomain, op, isHorizontal);
|
|
21394
|
-
|
|
21395
|
-
|
|
21396
|
-
|
|
21397
|
-
maxBounds
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
maxBounds
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
(
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21272
|
+
if (tempList) {
|
|
21273
|
+
let maxBounds = null;
|
|
21274
|
+
tempList.forEach(current => {
|
|
21275
|
+
if (!maxBounds) {
|
|
21276
|
+
maxBounds = current;
|
|
21277
|
+
return;
|
|
21278
|
+
}
|
|
21279
|
+
if (maxBounds[2] < current[2]) {
|
|
21280
|
+
maxBounds = current;
|
|
21281
|
+
}
|
|
21282
|
+
});
|
|
21283
|
+
const step = rangeEnd - rangeStart - labelGap > 0
|
|
21284
|
+
? Math.ceil((domain.length * (labelGap + maxBounds[2])) / (rangeEnd - rangeStart - labelGap))
|
|
21285
|
+
: domain.length - 1;
|
|
21286
|
+
scaleTicks = scale.stepTicks(step);
|
|
21287
|
+
if (op.labelLastVisible &&
|
|
21288
|
+
(!scaleTicks.length || scaleTicks[scaleTicks.length - 1] !== domain[domain.length - 1])) {
|
|
21289
|
+
if (scaleTicks.length &&
|
|
21290
|
+
Math.abs(scale.scale(scaleTicks[scaleTicks.length - 1]) - scale.scale(domain[domain.length - 1])) <
|
|
21291
|
+
maxBounds[2]) {
|
|
21292
|
+
scaleTicks = scaleTicks.slice(0, -1);
|
|
21293
|
+
}
|
|
21294
|
+
scaleTicks.push(domain[domain.length - 1]);
|
|
21414
21295
|
}
|
|
21415
|
-
scaleTicks.push(domain[domain.length - 1]);
|
|
21416
21296
|
}
|
|
21417
21297
|
}
|
|
21418
21298
|
}
|
|
21419
|
-
|
|
21299
|
+
if (isNil(scaleTicks)) {
|
|
21420
21300
|
scaleTicks = scale.domain();
|
|
21421
21301
|
}
|
|
21422
21302
|
return convertDomainToTickData(scaleTicks);
|
|
@@ -24984,10 +24864,6 @@ class DataZoom extends AbstractComponent {
|
|
|
24984
24864
|
this.state.end = end;
|
|
24985
24865
|
shouldRender && this.setAttributes({ start, end });
|
|
24986
24866
|
}
|
|
24987
|
-
eventPosToStagePos(e) {
|
|
24988
|
-
var _a, _b;
|
|
24989
|
-
return (_b = (_a = this.stage) === null || _a === void 0 ? void 0 : _a.eventPointTransform(e)) !== null && _b !== void 0 ? _b : { x: 0, y: 0 };
|
|
24990
|
-
}
|
|
24991
24867
|
_clearDragEvents() {
|
|
24992
24868
|
const evtTarget = vglobal.env === 'browser' ? vglobal : this.stage;
|
|
24993
24869
|
const triggers = getEndTriggersOfDrag();
|
|
@@ -25171,10 +25047,12 @@ class DataZoom extends AbstractComponent {
|
|
|
25171
25047
|
if (new Bounds().set(x1, y1, x2, y2).intersects(endTextBounds)) {
|
|
25172
25048
|
const direction = this.attribute.orient === 'bottom' || this.attribute.orient === 'right' ? -1 : 1;
|
|
25173
25049
|
if (this._isHorizontal) {
|
|
25174
|
-
|
|
25050
|
+
const boundsYDiff = Math.abs(endTextBounds.y1 - endTextBounds.y2);
|
|
25051
|
+
this._startText.setAttribute('dy', startTextDy + direction * (Number.isFinite(boundsYDiff) ? boundsYDiff : 0));
|
|
25175
25052
|
}
|
|
25176
25053
|
else {
|
|
25177
|
-
|
|
25054
|
+
const boundsXDiff = Math.abs(endTextBounds.x1 - endTextBounds.x2);
|
|
25055
|
+
this._startText.setAttribute('dx', startTextDx + direction * (Number.isFinite(boundsXDiff) ? boundsXDiff : 0));
|
|
25178
25056
|
}
|
|
25179
25057
|
}
|
|
25180
25058
|
else {
|
|
@@ -31446,6 +31324,7 @@ class Brush extends AbstractComponent {
|
|
|
31446
31324
|
constructor(attributes, options) {
|
|
31447
31325
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, Brush.defaultAttributes, attributes));
|
|
31448
31326
|
this.name = 'brush';
|
|
31327
|
+
this._activeBrushState = false;
|
|
31449
31328
|
this._activeDrawState = false;
|
|
31450
31329
|
this._cacheDrawPoints = [];
|
|
31451
31330
|
this._activeMoveState = false;
|
|
@@ -31456,13 +31335,6 @@ class Brush extends AbstractComponent {
|
|
|
31456
31335
|
this._brushMaskAABBBoundsDict = {};
|
|
31457
31336
|
this._firstUpdate = true;
|
|
31458
31337
|
this._onBrushStart = (e) => {
|
|
31459
|
-
if (this._outOfInteractiveRange(e)) {
|
|
31460
|
-
if (!this._isEmptyMask()) {
|
|
31461
|
-
this._clearMask();
|
|
31462
|
-
this._dispatchBrushEvent(IOperateType.brushClear, e);
|
|
31463
|
-
}
|
|
31464
|
-
return;
|
|
31465
|
-
}
|
|
31466
31338
|
const { updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger, endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger, brushMoved = true } = this.attribute;
|
|
31467
31339
|
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay));
|
|
31468
31340
|
array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd));
|
|
@@ -31526,9 +31398,7 @@ class Brush extends AbstractComponent {
|
|
|
31526
31398
|
brushMode === 'single' && this._clearMask();
|
|
31527
31399
|
this._addBrushMask();
|
|
31528
31400
|
this._dispatchBrushEvent(IOperateType.drawStart, e);
|
|
31529
|
-
|
|
31530
|
-
this._dispatchBrushEvent(IOperateType.brushActive, e);
|
|
31531
|
-
}
|
|
31401
|
+
this._activeBrushState = false;
|
|
31532
31402
|
}
|
|
31533
31403
|
_initMove(e) {
|
|
31534
31404
|
var _a, _b;
|
|
@@ -31550,7 +31420,7 @@ class Brush extends AbstractComponent {
|
|
|
31550
31420
|
_drawing(e) {
|
|
31551
31421
|
var _a;
|
|
31552
31422
|
const pos = this.eventPosToStagePos(e);
|
|
31553
|
-
const { brushType } = this.attribute;
|
|
31423
|
+
const { brushType, sizeThreshold = DEFAULT_SIZE_THRESHOLD } = this.attribute;
|
|
31554
31424
|
const cacheLength = this._cacheDrawPoints.length;
|
|
31555
31425
|
if (cacheLength > 0) {
|
|
31556
31426
|
const lastPos = (_a = this._cacheDrawPoints[this._cacheDrawPoints.length - 1]) !== null && _a !== void 0 ? _a : {};
|
|
@@ -31566,7 +31436,17 @@ class Brush extends AbstractComponent {
|
|
|
31566
31436
|
}
|
|
31567
31437
|
const maskPoints = this._computeMaskPoints();
|
|
31568
31438
|
this._operatingMask.setAttribute('points', maskPoints);
|
|
31569
|
-
this.
|
|
31439
|
+
const { x: x1, y: y1 } = this._startPos;
|
|
31440
|
+
const { x: x2, y: y2 } = this.eventPosToStagePos(e);
|
|
31441
|
+
if (Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold) {
|
|
31442
|
+
if (Object.keys(this._brushMaskAABBBoundsDict).length === 1 && !this._activeBrushState) {
|
|
31443
|
+
this._activeBrushState = true;
|
|
31444
|
+
this._dispatchBrushEvent(IOperateType.brushActive, e);
|
|
31445
|
+
}
|
|
31446
|
+
else {
|
|
31447
|
+
this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
31448
|
+
}
|
|
31449
|
+
}
|
|
31570
31450
|
}
|
|
31571
31451
|
_moving(e) {
|
|
31572
31452
|
const startPos = this._cacheMovePoint;
|
|
@@ -31708,7 +31588,7 @@ class Brush extends AbstractComponent {
|
|
|
31708
31588
|
_addBrushMask() {
|
|
31709
31589
|
var _a;
|
|
31710
31590
|
const { brushStyle, hasMask } = this.attribute;
|
|
31711
|
-
const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? (
|
|
31591
|
+
const brushMask = graphicCreator.polygon(Object.assign(Object.assign({ points: cloneDeep(this._cacheDrawPoints), cursor: 'move', pickable: false }, brushStyle), { opacity: hasMask ? (_a = brushStyle.opacity) !== null && _a !== void 0 ? _a : 1 : 0 }));
|
|
31712
31592
|
brushMask.name = `brush-${Date.now()}`;
|
|
31713
31593
|
this._operatingMask = brushMask;
|
|
31714
31594
|
this._container.add(brushMask);
|
|
@@ -31741,9 +31621,6 @@ class Brush extends AbstractComponent {
|
|
|
31741
31621
|
}
|
|
31742
31622
|
return false;
|
|
31743
31623
|
}
|
|
31744
|
-
eventPosToStagePos(e) {
|
|
31745
|
-
return this.stage.eventPointTransform(e);
|
|
31746
|
-
}
|
|
31747
31624
|
_dispatchBrushEvent(operateType, e) {
|
|
31748
31625
|
this._dispatchEvent(operateType, {
|
|
31749
31626
|
operateMask: this._operatingMask,
|
|
@@ -31753,7 +31630,7 @@ class Brush extends AbstractComponent {
|
|
|
31753
31630
|
}
|
|
31754
31631
|
_clearMask() {
|
|
31755
31632
|
this._brushMaskAABBBoundsDict = {};
|
|
31756
|
-
this._container.
|
|
31633
|
+
this._container.removeAllChild();
|
|
31757
31634
|
this._operatingMask = null;
|
|
31758
31635
|
}
|
|
31759
31636
|
_isEmptyMask() {
|
|
@@ -33210,6 +33087,6 @@ StoryLabelItem.defaultAttributes = {
|
|
|
33210
33087
|
theme: 'default'
|
|
33211
33088
|
};
|
|
33212
33089
|
|
|
33213
|
-
const version = "1.0.
|
|
33090
|
+
const version = "1.0.3";
|
|
33214
33091
|
|
|
33215
33092
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|