@visactor/vchart-extension 1.13.5-alpha.16 → 1.13.5-alpha.18
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/build/index.js +98 -192
- package/build/index.min.js +2 -2
- package/cjs/charts/ranking-list/ranking-list-transformer.js +2 -1
- package/cjs/charts/ranking-list/ranking-list.js +1 -2
- package/cjs/components/series-label/index.js +1 -2
- package/cjs/components/series-label/type.js +2 -1
- package/esm/charts/ranking-list/ranking-list-transformer.js +2 -1
- package/esm/charts/ranking-list/ranking-list.js +1 -2
- package/esm/components/series-label/index.js +1 -2
- package/esm/components/series-label/type.js +2 -1
- package/package.json +28 -6
package/build/index.js
CHANGED
|
@@ -1061,33 +1061,27 @@
|
|
|
1061
1061
|
|
|
1062
1062
|
let idIndex = 0;
|
|
1063
1063
|
const maxId = 1e8;
|
|
1064
|
-
function getUUID() {
|
|
1065
|
-
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "dataset";
|
|
1064
|
+
function getUUID(prefix = "dataset") {
|
|
1066
1065
|
return idIndex > maxId && (idIndex = 0), prefix + "_" + idIndex++;
|
|
1067
1066
|
}
|
|
1068
1067
|
|
|
1069
1068
|
const DataViewDiffRank = "_data-view-diff-rank";
|
|
1070
1069
|
class DataView {
|
|
1071
1070
|
constructor(dataSet, options) {
|
|
1072
|
-
var _this = this;
|
|
1073
1071
|
let name;
|
|
1074
|
-
this.dataSet = dataSet, this.options = options, this.isDataView = !0, this.target = new vutils.EventEmitter(), this.parseOption = null, this.transformsArr = [], this.isRunning = !1, this.rawData = {}, this.history = !1, this.parserData = {}, this.latestData = {}, this._fields = null, this.reRunAllTransform =
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
}), _this.isLastTransform(t) && _this.diffLastData();
|
|
1084
|
-
}), _this.isRunning = !1, !1 !== opt.emitMessage && _this.target.emit("change", []), _this;
|
|
1085
|
-
}, this.markRunning = () => {
|
|
1072
|
+
this.dataSet = dataSet, this.options = options, this.isDataView = !0, this.target = new vutils.EventEmitter(), this.parseOption = null, this.transformsArr = [], this.isRunning = !1, this.rawData = {}, this.history = !1, this.parserData = {}, this.latestData = {}, this._fields = null, this.reRunAllTransform = (opt = {
|
|
1073
|
+
pushHistory: !0,
|
|
1074
|
+
emitMessage: !0
|
|
1075
|
+
}) => (this.isRunning = !0, this.resetTransformData(), this.transformsArr.forEach(t => {
|
|
1076
|
+
this.executeTransform(t, {
|
|
1077
|
+
pushHistory: opt.pushHistory,
|
|
1078
|
+
emitMessage: !1
|
|
1079
|
+
}), this.isLastTransform(t) && this.diffLastData();
|
|
1080
|
+
}), this.isRunning = !1, !1 !== opt.emitMessage && this.target.emit("change", []), this), this.markRunning = () => {
|
|
1086
1081
|
this.isRunning = !0, this.target.emit("markRunning", []);
|
|
1087
1082
|
}, name = (null == options ? void 0 : options.name) ? options.name : getUUID("dataview"), this.name = name, (null == options ? void 0 : options.history) && (this.history = options.history, this.historyData = []), this.dataSet.setDataView(name, this), this.setFields(null == options ? void 0 : options.fields);
|
|
1088
1083
|
}
|
|
1089
|
-
parse(data, options) {
|
|
1090
|
-
let emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1084
|
+
parse(data, options, emit = !1) {
|
|
1091
1085
|
var _a;
|
|
1092
1086
|
this.isRunning = !0, emit && this.target.emit("beforeParse", []), options && (this.parseOption = options);
|
|
1093
1087
|
const cloneData = this.cloneParseData(data, options);
|
|
@@ -1097,8 +1091,7 @@
|
|
|
1097
1091
|
} else this.parserData = cloneData, this.rawData = cloneData, this.history && this.historyData.push(cloneData), this.latestData = cloneData;
|
|
1098
1092
|
return this.isRunning = !1, emit && this.target.emit("afterParse", []), this;
|
|
1099
1093
|
}
|
|
1100
|
-
transform(options) {
|
|
1101
|
-
let execute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
1094
|
+
transform(options, execute = !0) {
|
|
1102
1095
|
if (this.isRunning = !0, options && options.type) {
|
|
1103
1096
|
let pushOption = !0;
|
|
1104
1097
|
if ("fields" === options.type) {
|
|
@@ -1122,11 +1115,10 @@
|
|
|
1122
1115
|
return (null !== (_a = a.level) && void 0 !== _a ? _a : 0) - (null !== (_b = b.level) && void 0 !== _b ? _b : 0);
|
|
1123
1116
|
});
|
|
1124
1117
|
}
|
|
1125
|
-
executeTransform(options
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
};
|
|
1118
|
+
executeTransform(options, opt = {
|
|
1119
|
+
pushHistory: !0,
|
|
1120
|
+
emitMessage: !0
|
|
1121
|
+
}) {
|
|
1130
1122
|
const {
|
|
1131
1123
|
pushHistory: pushHistory,
|
|
1132
1124
|
emitMessage: emitMessage
|
|
@@ -1187,8 +1179,7 @@
|
|
|
1187
1179
|
var _a;
|
|
1188
1180
|
return this._fields ? this._fields : "dataview" === (null === (_a = this.parseOption) || void 0 === _a ? void 0 : _a.type) && 1 === this.rawData.length && this.rawData[0].getFields ? this.rawData[0].getFields() : null;
|
|
1189
1181
|
}
|
|
1190
|
-
setFields(f) {
|
|
1191
|
-
let foreMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1182
|
+
setFields(f, foreMerge = !1) {
|
|
1192
1183
|
this._fields = f && foreMerge ? vutils.merge({}, this._fields, f) : f;
|
|
1193
1184
|
const fieldsOption = this.transformsArr.find(_op => "fields" === _op.type);
|
|
1194
1185
|
!vutils.isNil(this._fields) && vutils.isNil(fieldsOption) ? (this.dataSet.registerTransform("fields", fields), this.transform({
|
|
@@ -2136,12 +2127,9 @@
|
|
|
2136
2127
|
}
|
|
2137
2128
|
}
|
|
2138
2129
|
function bindContributionProvider(bind, id) {
|
|
2139
|
-
bind(ContributionProvider).toDynamicValue(
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
} = _ref;
|
|
2143
|
-
return new ContributionProviderCache(id, container);
|
|
2144
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
2130
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
2131
|
+
container: container
|
|
2132
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
2145
2133
|
}
|
|
2146
2134
|
|
|
2147
2135
|
class Hook {
|
|
@@ -2197,10 +2185,7 @@
|
|
|
2197
2185
|
}
|
|
2198
2186
|
|
|
2199
2187
|
class SyncHook extends Hook {
|
|
2200
|
-
call() {
|
|
2201
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2202
|
-
args[_key] = arguments[_key];
|
|
2203
|
-
}
|
|
2188
|
+
call(...args) {
|
|
2204
2189
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
2205
2190
|
}
|
|
2206
2191
|
}
|
|
@@ -2259,7 +2244,7 @@
|
|
|
2259
2244
|
clear() {
|
|
2260
2245
|
this.bounds.clear();
|
|
2261
2246
|
}
|
|
2262
|
-
release() {}
|
|
2247
|
+
release(...params) {}
|
|
2263
2248
|
}
|
|
2264
2249
|
|
|
2265
2250
|
class CurvePath {
|
|
@@ -2467,12 +2452,7 @@
|
|
|
2467
2452
|
};
|
|
2468
2453
|
|
|
2469
2454
|
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)];
|
|
2470
|
-
function renderCommandList(commandList, context) {
|
|
2471
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2472
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2473
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
2474
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
2475
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
2455
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
2476
2456
|
for (let i = 0; i < commandList.length; i++) {
|
|
2477
2457
|
const command = commandList[i];
|
|
2478
2458
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -2658,7 +2638,7 @@
|
|
|
2658
2638
|
}
|
|
2659
2639
|
}
|
|
2660
2640
|
|
|
2661
|
-
function genCurveSegments(path, points) {
|
|
2641
|
+
function genCurveSegments(path, points, step = 1) {
|
|
2662
2642
|
let defined0 = !1;
|
|
2663
2643
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
2664
2644
|
}
|
|
@@ -2701,8 +2681,7 @@
|
|
|
2701
2681
|
return this.context.tryUpdateLength();
|
|
2702
2682
|
}
|
|
2703
2683
|
}
|
|
2704
|
-
function genLinearSegments(points) {
|
|
2705
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2684
|
+
function genLinearSegments(points, params = {}) {
|
|
2706
2685
|
const {
|
|
2707
2686
|
direction: direction,
|
|
2708
2687
|
startPoint: startPoint
|
|
@@ -2712,7 +2691,7 @@
|
|
|
2712
2691
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
2713
2692
|
}
|
|
2714
2693
|
function genLinearTypeSegments(path, points) {
|
|
2715
|
-
return genCurveSegments(path, points);
|
|
2694
|
+
return genCurveSegments(path, points, 1);
|
|
2716
2695
|
}
|
|
2717
2696
|
|
|
2718
2697
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -2755,10 +2734,9 @@
|
|
|
2755
2734
|
}
|
|
2756
2735
|
}
|
|
2757
2736
|
function genBasisTypeSegments(path, points) {
|
|
2758
|
-
return genCurveSegments(path, points);
|
|
2737
|
+
return genCurveSegments(path, points, 2);
|
|
2759
2738
|
}
|
|
2760
|
-
function genBasisSegments(points) {
|
|
2761
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2739
|
+
function genBasisSegments(points, params = {}) {
|
|
2762
2740
|
const {
|
|
2763
2741
|
direction: direction,
|
|
2764
2742
|
startPoint: startPoint
|
|
@@ -2851,10 +2829,9 @@
|
|
|
2851
2829
|
}
|
|
2852
2830
|
}
|
|
2853
2831
|
function genMonotoneXTypeSegments(path, points) {
|
|
2854
|
-
return genCurveSegments(path, points);
|
|
2832
|
+
return genCurveSegments(path, points, 2);
|
|
2855
2833
|
}
|
|
2856
|
-
function genMonotoneXSegments(points) {
|
|
2857
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2834
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
2858
2835
|
const {
|
|
2859
2836
|
direction: direction,
|
|
2860
2837
|
startPoint: startPoint
|
|
@@ -2865,10 +2842,9 @@
|
|
|
2865
2842
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
2866
2843
|
}
|
|
2867
2844
|
function genMonotoneYTypeSegments(path, points) {
|
|
2868
|
-
return genCurveSegments(path, points);
|
|
2845
|
+
return genCurveSegments(path, points, 2);
|
|
2869
2846
|
}
|
|
2870
|
-
function genMonotoneYSegments(points) {
|
|
2871
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2847
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
2872
2848
|
const {
|
|
2873
2849
|
direction: direction,
|
|
2874
2850
|
startPoint: startPoint
|
|
@@ -2880,9 +2856,7 @@
|
|
|
2880
2856
|
}
|
|
2881
2857
|
|
|
2882
2858
|
let Step$1 = class Step {
|
|
2883
|
-
constructor(context) {
|
|
2884
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
2885
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
2859
|
+
constructor(context, t = .5, startPoint) {
|
|
2886
2860
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
2887
2861
|
}
|
|
2888
2862
|
areaStart() {
|
|
@@ -2918,8 +2892,7 @@
|
|
|
2918
2892
|
return this.context.tryUpdateLength();
|
|
2919
2893
|
}
|
|
2920
2894
|
};
|
|
2921
|
-
function genStepSegments(points, t) {
|
|
2922
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2895
|
+
function genStepSegments(points, t, params = {}) {
|
|
2923
2896
|
const {
|
|
2924
2897
|
direction: direction,
|
|
2925
2898
|
startPoint: startPoint
|
|
@@ -2929,7 +2902,7 @@
|
|
|
2929
2902
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
2930
2903
|
}
|
|
2931
2904
|
function genStepTypeSegments(path, points) {
|
|
2932
|
-
return genCurveSegments(path, points);
|
|
2905
|
+
return genCurveSegments(path, points, 1);
|
|
2933
2906
|
}
|
|
2934
2907
|
|
|
2935
2908
|
class LinearClosed extends Linear {
|
|
@@ -2937,8 +2910,7 @@
|
|
|
2937
2910
|
this.context.closePath();
|
|
2938
2911
|
}
|
|
2939
2912
|
}
|
|
2940
|
-
function genLinearClosedSegments(points) {
|
|
2941
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2913
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
2942
2914
|
const {
|
|
2943
2915
|
direction: direction,
|
|
2944
2916
|
startPoint: startPoint
|
|
@@ -2948,7 +2920,7 @@
|
|
|
2948
2920
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
2949
2921
|
}
|
|
2950
2922
|
function genLinearClosedTypeSegments(path, points) {
|
|
2951
|
-
return genCurveSegments(path, points);
|
|
2923
|
+
return genCurveSegments(path, points, 1);
|
|
2952
2924
|
}
|
|
2953
2925
|
|
|
2954
2926
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -2969,9 +2941,7 @@
|
|
|
2969
2941
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
2970
2942
|
}
|
|
2971
2943
|
class CatmullRom {
|
|
2972
|
-
constructor(context) {
|
|
2973
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
2974
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
2944
|
+
constructor(context, alpha = .5, startPoint) {
|
|
2975
2945
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
2976
2946
|
}
|
|
2977
2947
|
areaStart() {
|
|
@@ -3025,8 +2995,7 @@
|
|
|
3025
2995
|
}
|
|
3026
2996
|
}
|
|
3027
2997
|
function commonGenCatmullRomSegments(type, cons) {
|
|
3028
|
-
return function (points, alpha) {
|
|
3029
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2998
|
+
return function (points, alpha, params = {}) {
|
|
3030
2999
|
const {
|
|
3031
3000
|
direction: direction,
|
|
3032
3001
|
startPoint: startPoint
|
|
@@ -3035,15 +3004,13 @@
|
|
|
3035
3004
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
3036
3005
|
const segContext = genSegContext(type, direction, points),
|
|
3037
3006
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
3038
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
3007
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
3039
3008
|
};
|
|
3040
3009
|
}
|
|
3041
3010
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
3042
3011
|
|
|
3043
3012
|
class CatmullRomClosed {
|
|
3044
|
-
constructor(context) {
|
|
3045
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
3046
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
3013
|
+
constructor(context, alpha = .5, startPoint) {
|
|
3047
3014
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
3048
3015
|
}
|
|
3049
3016
|
areaStart() {
|
|
@@ -3247,11 +3214,7 @@
|
|
|
3247
3214
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
3248
3215
|
}
|
|
3249
3216
|
closePathTransform() {}
|
|
3250
|
-
_runCommandStrList(commandStrList) {
|
|
3251
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3252
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
3253
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
3254
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
3217
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
3255
3218
|
let current,
|
|
3256
3219
|
tempX,
|
|
3257
3220
|
tempY,
|
|
@@ -3325,11 +3288,7 @@
|
|
|
3325
3288
|
previous = current;
|
|
3326
3289
|
}
|
|
3327
3290
|
}
|
|
3328
|
-
_runCommandList(commandList) {
|
|
3329
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3330
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
3331
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
3332
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
3291
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
3333
3292
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
3334
3293
|
const current = commandList[i].slice();
|
|
3335
3294
|
switch (current[0]) {
|
|
@@ -3757,7 +3716,7 @@
|
|
|
3757
3716
|
get length() {
|
|
3758
3717
|
return this.pools.length;
|
|
3759
3718
|
}
|
|
3760
|
-
release() {
|
|
3719
|
+
release(...params) {
|
|
3761
3720
|
this.pools = [];
|
|
3762
3721
|
}
|
|
3763
3722
|
}
|
|
@@ -3824,8 +3783,7 @@
|
|
|
3824
3783
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
3825
3784
|
return null;
|
|
3826
3785
|
}
|
|
3827
|
-
applyTheme(group, pt) {
|
|
3828
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
3786
|
+
applyTheme(group, pt, force = !1) {
|
|
3829
3787
|
if (this.dirty) {
|
|
3830
3788
|
const parentGroup = this.getParentWithTheme(group);
|
|
3831
3789
|
if (parentGroup) {
|
|
@@ -3924,8 +3882,7 @@
|
|
|
3924
3882
|
constructor() {
|
|
3925
3883
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
3926
3884
|
}
|
|
3927
|
-
forEachChildren(cb) {
|
|
3928
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
3885
|
+
forEachChildren(cb, reverse = !1) {
|
|
3929
3886
|
if (reverse) {
|
|
3930
3887
|
let child = this._lastChild,
|
|
3931
3888
|
i = 0;
|
|
@@ -3942,8 +3899,7 @@
|
|
|
3942
3899
|
}
|
|
3943
3900
|
}
|
|
3944
3901
|
}
|
|
3945
|
-
forEachChildrenAsync(cb) {
|
|
3946
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
3902
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
3947
3903
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3948
3904
|
if (reverse) {
|
|
3949
3905
|
let child = this._lastChild,
|
|
@@ -3967,13 +3923,12 @@
|
|
|
3967
3923
|
forEach(cb) {
|
|
3968
3924
|
return this.forEachChildren(cb);
|
|
3969
3925
|
}
|
|
3970
|
-
appendChild(node) {
|
|
3971
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
3926
|
+
appendChild(node, highPerformance = !0) {
|
|
3972
3927
|
if (this._uid === node._uid) return null;
|
|
3973
3928
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
3974
3929
|
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;
|
|
3975
3930
|
}
|
|
3976
|
-
appendChildArrHighPerformance(nodes) {
|
|
3931
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
3977
3932
|
return console.error("暂不支持该函数"), nodes;
|
|
3978
3933
|
}
|
|
3979
3934
|
insertBefore(newNode, referenceNode) {
|
|
@@ -4041,8 +3996,7 @@
|
|
|
4041
3996
|
replaceChild(newChild, oldChild) {
|
|
4042
3997
|
throw new Error("暂不支持");
|
|
4043
3998
|
}
|
|
4044
|
-
find(callback) {
|
|
4045
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
3999
|
+
find(callback, deep = !1) {
|
|
4046
4000
|
let target = null;
|
|
4047
4001
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
4048
4002
|
if (child.isContainer) {
|
|
@@ -4052,8 +4006,7 @@
|
|
|
4052
4006
|
return !1;
|
|
4053
4007
|
}), target;
|
|
4054
4008
|
}
|
|
4055
|
-
findAll(callback) {
|
|
4056
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4009
|
+
findAll(callback, deep = !1) {
|
|
4057
4010
|
let nodes = [];
|
|
4058
4011
|
return this.forEachChildren((node, index) => {
|
|
4059
4012
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -4082,8 +4035,7 @@
|
|
|
4082
4035
|
getElementsByType(type) {
|
|
4083
4036
|
return this.findAll(node => node.type === type, !0);
|
|
4084
4037
|
}
|
|
4085
|
-
getChildByName(name) {
|
|
4086
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4038
|
+
getChildByName(name, deep = !1) {
|
|
4087
4039
|
return this.find(node => node.name === name, deep);
|
|
4088
4040
|
}
|
|
4089
4041
|
getChildAt(idx) {
|
|
@@ -4202,10 +4154,7 @@
|
|
|
4202
4154
|
removeAllListeners() {
|
|
4203
4155
|
return this.removeAllEventListeners();
|
|
4204
4156
|
}
|
|
4205
|
-
dispatchEvent(event) {
|
|
4206
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
4207
|
-
args[_key - 1] = arguments[_key];
|
|
4208
|
-
}
|
|
4157
|
+
dispatchEvent(event, ...args) {
|
|
4209
4158
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
4210
4159
|
}
|
|
4211
4160
|
emit(event, data) {
|
|
@@ -4445,8 +4394,7 @@
|
|
|
4445
4394
|
for (; animate;) animate.release(), animate = animate.nextAnimate;
|
|
4446
4395
|
this.animateHead = null, this.animateTail = null, this.animateCount = 0;
|
|
4447
4396
|
}
|
|
4448
|
-
removeAnimate(animate) {
|
|
4449
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
4397
|
+
removeAnimate(animate, release = !0) {
|
|
4450
4398
|
animate._onRemove && animate._onRemove.forEach(cb => cb()), animate === this.animateHead ? (this.animateHead = animate.nextAnimate, animate === this.animateTail ? this.animateTail = null : this.animateHead.prevAnimate = null) : animate === this.animateTail ? (this.animateTail = animate.prevAnimate, this.animateTail.nextAnimate = null) : (animate.prevAnimate.nextAnimate = animate.nextAnimate, animate.nextAnimate.prevAnimate = animate.prevAnimate), release && animate.release();
|
|
4451
4399
|
}
|
|
4452
4400
|
}
|
|
@@ -4495,10 +4443,7 @@
|
|
|
4495
4443
|
}
|
|
4496
4444
|
}
|
|
4497
4445
|
class Animate {
|
|
4498
|
-
constructor() {
|
|
4499
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
4500
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
4501
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
4446
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
4502
4447
|
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
4503
4448
|
}
|
|
4504
4449
|
setTimeline(timeline) {
|
|
@@ -4533,8 +4478,7 @@
|
|
|
4533
4478
|
}
|
|
4534
4479
|
return 1 === this.subAnimates.length && this.tailAnimate.totalDuration === customAnimate.duration && this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode), this;
|
|
4535
4480
|
}
|
|
4536
|
-
trySetAttribute(attr) {
|
|
4537
|
-
let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Animate.mode;
|
|
4481
|
+
trySetAttribute(attr, mode = Animate.mode) {
|
|
4538
4482
|
attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY && this.target.setAttributes && this.target.setAttributes(attr, !1, {
|
|
4539
4483
|
type: AttributeUpdateType.ANIMATE_PLAY
|
|
4540
4484
|
});
|
|
@@ -4880,9 +4824,7 @@
|
|
|
4880
4824
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
4881
4825
|
}(ColorType || (ColorType = {}));
|
|
4882
4826
|
class ColorStore {
|
|
4883
|
-
static Get(str) {
|
|
4884
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
4885
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
4827
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
4886
4828
|
if (size === ColorType.Color1) {
|
|
4887
4829
|
const color = ColorStore.store1[str];
|
|
4888
4830
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -4910,8 +4852,7 @@
|
|
|
4910
4852
|
}
|
|
4911
4853
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
4912
4854
|
|
|
4913
|
-
function colorArrayToString(color) {
|
|
4914
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
4855
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
4915
4856
|
return Array.isArray(color) && vutils.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;
|
|
4916
4857
|
}
|
|
4917
4858
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -5156,8 +5097,7 @@
|
|
|
5156
5097
|
get globalTransMatrix() {
|
|
5157
5098
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
5158
5099
|
}
|
|
5159
|
-
constructor() {
|
|
5160
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5100
|
+
constructor(params = {}) {
|
|
5161
5101
|
var _a;
|
|
5162
5102
|
super(), this._AABBBounds = new vutils.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);
|
|
5163
5103
|
}
|
|
@@ -5170,8 +5110,7 @@
|
|
|
5170
5110
|
set2dMode() {
|
|
5171
5111
|
this.in3dMode = !1;
|
|
5172
5112
|
}
|
|
5173
|
-
getOffsetXY(attr) {
|
|
5174
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
5113
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
5175
5114
|
var _a, _b;
|
|
5176
5115
|
const {
|
|
5177
5116
|
dx = attr.dx,
|
|
@@ -5229,7 +5168,7 @@
|
|
|
5229
5168
|
const b = this.AABBBounds;
|
|
5230
5169
|
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;
|
|
5231
5170
|
}
|
|
5232
|
-
tryUpdateGlobalTransMatrix() {
|
|
5171
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
5233
5172
|
if (this._globalTransMatrix) {
|
|
5234
5173
|
if (this.parent) {
|
|
5235
5174
|
const m = this.parent.globalTransMatrix;
|
|
@@ -5241,8 +5180,7 @@
|
|
|
5241
5180
|
shouldUpdateGlobalMatrix() {
|
|
5242
5181
|
return !0;
|
|
5243
5182
|
}
|
|
5244
|
-
tryUpdateLocalTransMatrix() {
|
|
5245
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
5183
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
5246
5184
|
return this._transMatrix || (this._transMatrix = new vutils.Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
5247
5185
|
}
|
|
5248
5186
|
shouldUpdateAABBBounds() {
|
|
@@ -5279,14 +5217,10 @@
|
|
|
5279
5217
|
y: y
|
|
5280
5218
|
});
|
|
5281
5219
|
}
|
|
5282
|
-
setAttributes(params) {
|
|
5283
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
5284
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
5220
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
5285
5221
|
(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);
|
|
5286
5222
|
}
|
|
5287
|
-
_setAttributes(params) {
|
|
5288
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
5289
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
5223
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
5290
5224
|
const keys = Object.keys(params);
|
|
5291
5225
|
for (let i = 0; i < keys.length; i++) {
|
|
5292
5226
|
const key = keys[i];
|
|
@@ -5301,16 +5235,14 @@
|
|
|
5301
5235
|
}, this.attribute, key, context);
|
|
5302
5236
|
params ? this._setAttributes(params, forceUpdateTag, context) : vutils.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);
|
|
5303
5237
|
}
|
|
5304
|
-
needUpdateTags(keys) {
|
|
5305
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
5238
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
5306
5239
|
for (let i = 0; i < k.length; i++) {
|
|
5307
5240
|
const attrKey = k[i];
|
|
5308
5241
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
5309
5242
|
}
|
|
5310
5243
|
return !1;
|
|
5311
5244
|
}
|
|
5312
|
-
needUpdateTag(key) {
|
|
5313
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
5245
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
5314
5246
|
for (let i = 0; i < k.length; i++) {
|
|
5315
5247
|
if (key === k[i]) return !0;
|
|
5316
5248
|
}
|
|
@@ -5473,8 +5405,7 @@
|
|
|
5473
5405
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
5474
5406
|
}), this.normalAttrs = newNormalAttrs;
|
|
5475
5407
|
}
|
|
5476
|
-
stopStateAnimates() {
|
|
5477
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
5408
|
+
stopStateAnimates(type = "end") {
|
|
5478
5409
|
this.animates && this.animates.forEach(animate => {
|
|
5479
5410
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
5480
5411
|
});
|
|
@@ -5713,8 +5644,7 @@
|
|
|
5713
5644
|
var _a;
|
|
5714
5645
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
5715
5646
|
}
|
|
5716
|
-
onSetStage(cb) {
|
|
5717
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
5647
|
+
onSetStage(cb, immediate = !1) {
|
|
5718
5648
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
5719
5649
|
}
|
|
5720
5650
|
attachShadow(shadowRoot) {
|
|
@@ -5735,8 +5665,7 @@
|
|
|
5735
5665
|
createPathProxy(path) {
|
|
5736
5666
|
return vutils.isString(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
5737
5667
|
}
|
|
5738
|
-
loadImage(image) {
|
|
5739
|
-
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
5668
|
+
loadImage(image, background = !1) {
|
|
5740
5669
|
if (!image || background && backgroundNotImage(image)) return;
|
|
5741
5670
|
const url = image;
|
|
5742
5671
|
this.resources || (this.resources = new Map());
|
|
@@ -5766,8 +5695,7 @@
|
|
|
5766
5695
|
animate.stop();
|
|
5767
5696
|
});
|
|
5768
5697
|
}
|
|
5769
|
-
stopAnimates() {
|
|
5770
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
5698
|
+
stopAnimates(stopChildren = !1) {
|
|
5771
5699
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
5772
5700
|
c.stopAnimates(stopChildren);
|
|
5773
5701
|
});
|
|
@@ -5824,8 +5752,7 @@
|
|
|
5824
5752
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
5825
5753
|
return closingIndex + str.length - 1;
|
|
5826
5754
|
}
|
|
5827
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
5828
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
5755
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
5829
5756
|
let attrBoundary,
|
|
5830
5757
|
tagExp = "";
|
|
5831
5758
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -5843,8 +5770,7 @@
|
|
|
5843
5770
|
tagExp += ch;
|
|
5844
5771
|
}
|
|
5845
5772
|
}
|
|
5846
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
5847
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
5773
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
5848
5774
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
5849
5775
|
if (!result) return;
|
|
5850
5776
|
let tagExp = result.data;
|
|
@@ -6006,8 +5932,7 @@
|
|
|
6006
5932
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6007
5933
|
});
|
|
6008
5934
|
};
|
|
6009
|
-
function boundStroke(bounds, halfW, miter) {
|
|
6010
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5935
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
6011
5936
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
6012
5937
|
}
|
|
6013
5938
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -6198,8 +6123,7 @@
|
|
|
6198
6123
|
_updateChildToStage(child) {
|
|
6199
6124
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
6200
6125
|
}
|
|
6201
|
-
appendChild(node) {
|
|
6202
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
6126
|
+
appendChild(node, addStage = !0) {
|
|
6203
6127
|
const data = super.appendChild(node);
|
|
6204
6128
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
6205
6129
|
}
|
|
@@ -6216,8 +6140,7 @@
|
|
|
6216
6140
|
const data = super.removeChild(child);
|
|
6217
6141
|
return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
|
|
6218
6142
|
}
|
|
6219
|
-
removeAllChild() {
|
|
6220
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
6143
|
+
removeAllChild(deep = !1) {
|
|
6221
6144
|
this.forEachChildren(child => {
|
|
6222
6145
|
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
6223
6146
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -6237,8 +6160,7 @@
|
|
|
6237
6160
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
6238
6161
|
});
|
|
6239
6162
|
}
|
|
6240
|
-
tryUpdateGlobalTransMatrix() {
|
|
6241
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
6163
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
6242
6164
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
6243
6165
|
if (this._globalTransMatrix) {
|
|
6244
6166
|
if (this.parent) {
|
|
@@ -6318,8 +6240,7 @@
|
|
|
6318
6240
|
function textDrawOffsetX(textAlign, width) {
|
|
6319
6241
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
6320
6242
|
}
|
|
6321
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
6322
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
6243
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
6323
6244
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
6324
6245
|
}
|
|
6325
6246
|
|
|
@@ -6429,7 +6350,7 @@
|
|
|
6429
6350
|
get length() {
|
|
6430
6351
|
return this.pools.length;
|
|
6431
6352
|
}
|
|
6432
|
-
release() {
|
|
6353
|
+
release(...params) {
|
|
6433
6354
|
this.pools = [];
|
|
6434
6355
|
}
|
|
6435
6356
|
}
|
|
@@ -6675,8 +6596,7 @@
|
|
|
6675
6596
|
doStroke: doStroke
|
|
6676
6597
|
};
|
|
6677
6598
|
}
|
|
6678
|
-
transform(graphic, graphicAttribute, context) {
|
|
6679
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
6599
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
6680
6600
|
const {
|
|
6681
6601
|
x = graphicAttribute.x,
|
|
6682
6602
|
y = graphicAttribute.y,
|
|
@@ -7354,8 +7274,7 @@
|
|
|
7354
7274
|
path.moveTo(points[0].x + x, points[0].y + y);
|
|
7355
7275
|
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
7356
7276
|
}
|
|
7357
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
7358
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
7277
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
7359
7278
|
var _a;
|
|
7360
7279
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
7361
7280
|
let startI = 0,
|
|
@@ -7493,10 +7412,7 @@
|
|
|
7493
7412
|
} else bbox.yOffset = -bbox.height;
|
|
7494
7413
|
return bbox;
|
|
7495
7414
|
}
|
|
7496
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
7497
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
7498
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
7499
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
7415
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
7500
7416
|
const {
|
|
7501
7417
|
lineWidth: lineWidth,
|
|
7502
7418
|
suffixPosition = "end",
|
|
@@ -7619,11 +7535,10 @@
|
|
|
7619
7535
|
get isMultiLine() {
|
|
7620
7536
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
7621
7537
|
}
|
|
7622
|
-
constructor(
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
};
|
|
7538
|
+
constructor(params = {
|
|
7539
|
+
text: "",
|
|
7540
|
+
fontSize: 16
|
|
7541
|
+
}) {
|
|
7627
7542
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
7628
7543
|
}
|
|
7629
7544
|
isValid() {
|
|
@@ -7955,12 +7870,10 @@
|
|
|
7955
7870
|
var _a;
|
|
7956
7871
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
7957
7872
|
}
|
|
7958
|
-
needUpdateTags(keys) {
|
|
7959
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
7873
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
7960
7874
|
return super.needUpdateTags(keys, k);
|
|
7961
7875
|
}
|
|
7962
|
-
needUpdateTag(key) {
|
|
7963
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
7876
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
7964
7877
|
return super.needUpdateTag(key, k);
|
|
7965
7878
|
}
|
|
7966
7879
|
clone() {
|
|
@@ -8084,8 +7997,7 @@
|
|
|
8084
7997
|
}
|
|
8085
7998
|
var square$1 = new SquareSymbol();
|
|
8086
7999
|
|
|
8087
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
8088
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8000
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
8089
8001
|
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;
|
|
8090
8002
|
}
|
|
8091
8003
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -8231,8 +8143,7 @@
|
|
|
8231
8143
|
}
|
|
8232
8144
|
var triangleLeft = new TriangleLeftSymbol();
|
|
8233
8145
|
|
|
8234
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
8235
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8146
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
8236
8147
|
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;
|
|
8237
8148
|
}
|
|
8238
8149
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -8248,8 +8159,7 @@
|
|
|
8248
8159
|
}
|
|
8249
8160
|
var triangleRight = new TriangleRightSymbol();
|
|
8250
8161
|
|
|
8251
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
8252
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8162
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
8253
8163
|
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;
|
|
8254
8164
|
}
|
|
8255
8165
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -8434,8 +8344,7 @@
|
|
|
8434
8344
|
|
|
8435
8345
|
const tempBounds = new vutils.AABBBounds();
|
|
8436
8346
|
class CustomSymbolClass {
|
|
8437
|
-
constructor(type, path) {
|
|
8438
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
8347
|
+
constructor(type, path, isSvg = !1) {
|
|
8439
8348
|
this.pathStr = "", this.type = type, vutils.isArray(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
8440
8349
|
}
|
|
8441
8350
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -8452,10 +8361,9 @@
|
|
|
8452
8361
|
bounds(size, bounds) {
|
|
8453
8362
|
if (size = this.parseSize(size), this.isSvg) {
|
|
8454
8363
|
if (!this.svgCache) return;
|
|
8455
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
} = _ref;
|
|
8364
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
8365
|
+
path: path
|
|
8366
|
+
}) => {
|
|
8459
8367
|
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);
|
|
8460
8368
|
});
|
|
8461
8369
|
}
|
|
@@ -8495,10 +8403,9 @@
|
|
|
8495
8403
|
const _tempBounds = new vutils.AABBBounds(),
|
|
8496
8404
|
SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8497
8405
|
let Symbol$1 = class Symbol extends Graphic {
|
|
8498
|
-
constructor(
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
};
|
|
8406
|
+
constructor(params = {
|
|
8407
|
+
symbolType: "circle"
|
|
8408
|
+
}) {
|
|
8502
8409
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
8503
8410
|
}
|
|
8504
8411
|
getParsedPath() {
|
|
@@ -8611,8 +8518,7 @@
|
|
|
8611
8518
|
|
|
8612
8519
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
8613
8520
|
class Line extends Graphic {
|
|
8614
|
-
constructor() {
|
|
8615
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8521
|
+
constructor(params = {}) {
|
|
8616
8522
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
8617
8523
|
}
|
|
8618
8524
|
isValid() {
|