@visactor/vchart-extension 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +269 -565
- package/build/index.min.js +2 -2
- package/cjs/charts/axis-3d/axis-3d-mixin.d.ts +13 -0
- package/cjs/charts/axis-3d/axis-3d-mixin.js +19 -0
- package/cjs/charts/axis-3d/axis-3d-mixin.js.map +1 -0
- package/cjs/charts/axis-3d/band-axis.d.ts +0 -45
- package/cjs/charts/axis-3d/band-axis.js +7 -18
- package/cjs/charts/axis-3d/band-axis.js.map +1 -1
- package/cjs/charts/axis-3d/linear-axis.d.ts +0 -41
- package/cjs/charts/axis-3d/linear-axis.js +9 -26
- package/cjs/charts/axis-3d/linear-axis.js.map +1 -1
- package/cjs/charts/axis-3d/log-axis.d.ts +0 -45
- package/cjs/charts/axis-3d/log-axis.js +9 -19
- package/cjs/charts/axis-3d/log-axis.js.map +1 -1
- package/cjs/charts/axis-3d/symlog-axis.d.ts +0 -45
- package/cjs/charts/axis-3d/symlog-axis.js +7 -18
- package/cjs/charts/axis-3d/symlog-axis.js.map +1 -1
- package/cjs/charts/axis-3d/time-axis.d.ts +0 -44
- package/cjs/charts/axis-3d/time-axis.js +7 -18
- package/cjs/charts/axis-3d/time-axis.js.map +1 -1
- package/cjs/charts/conversion-funnel/constants.js +1 -2
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -0
- package/cjs/charts/image-cloud/image-cloud-transformer.js +1 -2
- package/cjs/charts/image-cloud/image-cloud.js +2 -1
- package/cjs/charts/pictogram/pictogram-transformer.js +1 -1
- package/cjs/charts/word-cloud-3d/animation.js +1 -1
- package/cjs/charts/word-cloud-3d/animation.js.map +1 -1
- package/esm/charts/axis-3d/axis-3d-mixin.d.ts +13 -0
- package/esm/charts/axis-3d/axis-3d-mixin.js +13 -0
- package/esm/charts/axis-3d/axis-3d-mixin.js.map +1 -0
- package/esm/charts/axis-3d/band-axis.d.ts +0 -45
- package/esm/charts/axis-3d/band-axis.js +8 -17
- package/esm/charts/axis-3d/band-axis.js.map +1 -1
- package/esm/charts/axis-3d/linear-axis.d.ts +0 -41
- package/esm/charts/axis-3d/linear-axis.js +9 -24
- package/esm/charts/axis-3d/linear-axis.js.map +1 -1
- package/esm/charts/axis-3d/log-axis.d.ts +0 -45
- package/esm/charts/axis-3d/log-axis.js +10 -18
- package/esm/charts/axis-3d/log-axis.js.map +1 -1
- package/esm/charts/axis-3d/symlog-axis.d.ts +0 -45
- package/esm/charts/axis-3d/symlog-axis.js +8 -17
- package/esm/charts/axis-3d/symlog-axis.js.map +1 -1
- package/esm/charts/axis-3d/time-axis.d.ts +0 -44
- package/esm/charts/axis-3d/time-axis.js +8 -17
- package/esm/charts/axis-3d/time-axis.js.map +1 -1
- package/esm/charts/conversion-funnel/constants.js +1 -2
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +2 -1
- package/esm/charts/image-cloud/image-cloud-transformer.js +1 -2
- package/esm/charts/image-cloud/image-cloud.js +2 -1
- package/esm/charts/pictogram/pictogram-transformer.js +1 -1
- package/esm/charts/word-cloud-3d/animation.js +1 -1
- package/esm/charts/word-cloud-3d/animation.js.map +1 -1
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -328,10 +328,7 @@
|
|
|
328
328
|
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
329
329
|
var isType$1 = isType;
|
|
330
330
|
|
|
331
|
-
const isBoolean =
|
|
332
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
333
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
334
|
-
};
|
|
331
|
+
const isBoolean = (value, fuzzy = !1) => fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
335
332
|
var isBoolean$1 = isBoolean;
|
|
336
333
|
|
|
337
334
|
const isFunction = value => "function" == typeof value;
|
|
@@ -361,8 +358,7 @@
|
|
|
361
358
|
};
|
|
362
359
|
var isPlainObject$1 = isPlainObject;
|
|
363
360
|
|
|
364
|
-
const isString =
|
|
365
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
361
|
+
const isString = (value, fuzzy = !1) => {
|
|
366
362
|
const type = typeof value;
|
|
367
363
|
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
368
364
|
};
|
|
@@ -379,8 +375,7 @@
|
|
|
379
375
|
const isDate = value => isType$1(value, "Date");
|
|
380
376
|
var isDate$1 = isDate;
|
|
381
377
|
|
|
382
|
-
const isNumber =
|
|
383
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
378
|
+
const isNumber = (value, fuzzy = !1) => {
|
|
384
379
|
const type = typeof value;
|
|
385
380
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
386
381
|
};
|
|
@@ -439,9 +434,7 @@
|
|
|
439
434
|
return result;
|
|
440
435
|
}
|
|
441
436
|
|
|
442
|
-
function baseMerge(target, source) {
|
|
443
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
444
|
-
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
437
|
+
function baseMerge(target, source, shallowArray = !1, skipTargetArray = !1) {
|
|
445
438
|
if (source) {
|
|
446
439
|
if (target === source) return;
|
|
447
440
|
if (isValid$1(source) && "object" == typeof source) {
|
|
@@ -459,9 +452,7 @@
|
|
|
459
452
|
}
|
|
460
453
|
}
|
|
461
454
|
}
|
|
462
|
-
function baseMergeDeep(target, source, key) {
|
|
463
|
-
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
464
|
-
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
455
|
+
function baseMergeDeep(target, source, key, shallowArray = !1, skipTargetArray = !1) {
|
|
465
456
|
const objValue = target[key],
|
|
466
457
|
srcValue = source[key];
|
|
467
458
|
let newValue = source[key],
|
|
@@ -482,11 +473,11 @@
|
|
|
482
473
|
function eq(value, other) {
|
|
483
474
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
484
475
|
}
|
|
485
|
-
function merge(target) {
|
|
476
|
+
function merge(target, ...sources) {
|
|
486
477
|
let sourceIndex = -1;
|
|
487
|
-
const length =
|
|
478
|
+
const length = sources.length;
|
|
488
479
|
for (; ++sourceIndex < length;) {
|
|
489
|
-
baseMerge(target,
|
|
480
|
+
baseMerge(target, sources[sourceIndex], !0);
|
|
490
481
|
}
|
|
491
482
|
return target;
|
|
492
483
|
}
|
|
@@ -550,8 +541,7 @@
|
|
|
550
541
|
}
|
|
551
542
|
return target;
|
|
552
543
|
}
|
|
553
|
-
function mixin(target, source) {
|
|
554
|
-
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
544
|
+
function mixin(target, source, override = !0) {
|
|
555
545
|
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source, Object.getOwnPropertyNames) {
|
|
556
546
|
const keyList = Object.getOwnPropertyNames(source);
|
|
557
547
|
for (let i = 0; i < keyList.length; i++) {
|
|
@@ -641,9 +631,7 @@
|
|
|
641
631
|
static clearInstance() {
|
|
642
632
|
Logger._instance = null;
|
|
643
633
|
}
|
|
644
|
-
constructor() {
|
|
645
|
-
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
646
|
-
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
634
|
+
constructor(level = LoggerLevel.None, method) {
|
|
647
635
|
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
648
636
|
}
|
|
649
637
|
addErrorHandler(handler) {
|
|
@@ -653,10 +641,7 @@
|
|
|
653
641
|
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
654
642
|
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
655
643
|
}
|
|
656
|
-
callErrorHandler() {
|
|
657
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
658
|
-
args[_key] = arguments[_key];
|
|
659
|
-
}
|
|
644
|
+
callErrorHandler(...args) {
|
|
660
645
|
this._onErrorHandler.forEach(h => h(...args));
|
|
661
646
|
}
|
|
662
647
|
canLogInfo() {
|
|
@@ -674,37 +659,23 @@
|
|
|
674
659
|
level(levelValue) {
|
|
675
660
|
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
676
661
|
}
|
|
677
|
-
error() {
|
|
662
|
+
error(...args) {
|
|
678
663
|
var _a;
|
|
679
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
680
|
-
args[_key2] = arguments[_key2];
|
|
681
|
-
}
|
|
682
664
|
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
683
665
|
}
|
|
684
|
-
warn() {
|
|
685
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
686
|
-
args[_key3] = arguments[_key3];
|
|
687
|
-
}
|
|
666
|
+
warn(...args) {
|
|
688
667
|
return this._level >= LoggerLevel.Warn && log(this._method || "warn", "WARN", args), this;
|
|
689
668
|
}
|
|
690
|
-
info() {
|
|
691
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
692
|
-
args[_key4] = arguments[_key4];
|
|
693
|
-
}
|
|
669
|
+
info(...args) {
|
|
694
670
|
return this._level >= LoggerLevel.Info && log(this._method || "log", "INFO", args), this;
|
|
695
671
|
}
|
|
696
|
-
debug() {
|
|
697
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
698
|
-
args[_key5] = arguments[_key5];
|
|
699
|
-
}
|
|
672
|
+
debug(...args) {
|
|
700
673
|
return this._level >= LoggerLevel.Debug && log(this._method || "log", "DEBUG", args), this;
|
|
701
674
|
}
|
|
702
675
|
}
|
|
703
676
|
Logger._instance = null;
|
|
704
677
|
|
|
705
|
-
function bisect(a, x) {
|
|
706
|
-
let lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
707
|
-
let hi = arguments.length > 3 ? arguments[3] : undefined;
|
|
678
|
+
function bisect(a, x, lo = 0, hi) {
|
|
708
679
|
for (isNil$1(hi) && (hi = a.length); lo < hi;) {
|
|
709
680
|
const mid = lo + hi >>> 1;
|
|
710
681
|
ascending$1(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
|
@@ -714,9 +685,7 @@
|
|
|
714
685
|
|
|
715
686
|
const DEFAULT_ABSOLUTE_TOLERATE = 1e-10,
|
|
716
687
|
DEFAULT_RELATIVE_TOLERATE = 1e-10;
|
|
717
|
-
function isNumberClose(a, b) {
|
|
718
|
-
let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE;
|
|
719
|
-
let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE;
|
|
688
|
+
function isNumberClose(a, b, relTol = DEFAULT_RELATIVE_TOLERATE, absTol = DEFAULT_ABSOLUTE_TOLERATE) {
|
|
720
689
|
const abs = absTol,
|
|
721
690
|
rel = relTol * Math.max(a, b);
|
|
722
691
|
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
@@ -725,12 +694,7 @@
|
|
|
725
694
|
const memoize = func => {
|
|
726
695
|
let lastArgs = null,
|
|
727
696
|
lastResult = null;
|
|
728
|
-
return
|
|
729
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
730
|
-
args[_key] = arguments[_key];
|
|
731
|
-
}
|
|
732
|
-
return lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult;
|
|
733
|
-
};
|
|
697
|
+
return (...args) => (lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult);
|
|
734
698
|
};
|
|
735
699
|
|
|
736
700
|
const clamp = function (input, min, max) {
|
|
@@ -765,14 +729,12 @@
|
|
|
765
729
|
};
|
|
766
730
|
|
|
767
731
|
const getter = path => obj => get$1(obj, path);
|
|
768
|
-
const fieldSingle =
|
|
769
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
732
|
+
const fieldSingle = (fieldStr, opt = {}) => {
|
|
770
733
|
if (isFunction$1(fieldStr)) return fieldStr;
|
|
771
734
|
const path = [fieldStr];
|
|
772
735
|
return (opt && opt.get || getter)(path);
|
|
773
736
|
};
|
|
774
|
-
const field =
|
|
775
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
737
|
+
const field = (fieldStr, opt = {}) => {
|
|
776
738
|
if (isArray$1(fieldStr)) {
|
|
777
739
|
const funcs = fieldStr.map(entry => fieldSingle(entry, opt));
|
|
778
740
|
return datum => funcs.map(func => func(datum));
|
|
@@ -830,11 +792,7 @@
|
|
|
830
792
|
}
|
|
831
793
|
|
|
832
794
|
class Point {
|
|
833
|
-
constructor() {
|
|
834
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
835
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
836
|
-
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
837
|
-
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
795
|
+
constructor(x = 0, y = 0, x1, y1) {
|
|
838
796
|
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
839
797
|
}
|
|
840
798
|
clone() {
|
|
@@ -880,8 +838,7 @@
|
|
|
880
838
|
function radianToDegree(radian) {
|
|
881
839
|
return 180 * radian / Math.PI;
|
|
882
840
|
}
|
|
883
|
-
const clampRadian =
|
|
884
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
841
|
+
const clampRadian = (angle = 0) => {
|
|
885
842
|
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
886
843
|
return angle;
|
|
887
844
|
};
|
|
@@ -937,15 +894,13 @@
|
|
|
937
894
|
function getProjectionRadius(checkAxis, axis) {
|
|
938
895
|
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
939
896
|
}
|
|
940
|
-
function rotatePoint(
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
y: 0
|
|
948
|
-
};
|
|
897
|
+
function rotatePoint({
|
|
898
|
+
x: x,
|
|
899
|
+
y: y
|
|
900
|
+
}, rad, origin = {
|
|
901
|
+
x: 0,
|
|
902
|
+
y: 0
|
|
903
|
+
}) {
|
|
949
904
|
return {
|
|
950
905
|
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
951
906
|
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
@@ -974,8 +929,7 @@
|
|
|
974
929
|
y: box.y2
|
|
975
930
|
}, deg, cp)];
|
|
976
931
|
}
|
|
977
|
-
function isRotateAABBIntersect(box1, box2) {
|
|
978
|
-
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
932
|
+
function isRotateAABBIntersect(box1, box2, isDeg = !1) {
|
|
979
933
|
const rect1 = toRect$1(box1, isDeg),
|
|
980
934
|
rect2 = toRect$1(box2, isDeg),
|
|
981
935
|
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
@@ -1040,9 +994,7 @@
|
|
|
1040
994
|
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
1041
995
|
};
|
|
1042
996
|
|
|
1043
|
-
function getContextFont(text) {
|
|
1044
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1045
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
997
|
+
function getContextFont(text, defaultAttr = {}, fontSizeScale) {
|
|
1046
998
|
fontSizeScale || (fontSizeScale = 1);
|
|
1047
999
|
const {
|
|
1048
1000
|
fontStyle = defaultAttr.fontStyle,
|
|
@@ -1289,49 +1241,29 @@
|
|
|
1289
1241
|
equals(b) {
|
|
1290
1242
|
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1291
1243
|
}
|
|
1292
|
-
setValue() {
|
|
1293
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1294
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1295
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1296
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1244
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1297
1245
|
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1298
1246
|
}
|
|
1299
|
-
set() {
|
|
1300
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1301
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1302
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1303
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1247
|
+
set(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1304
1248
|
return x2 < x1 ? (this.x2 = x1, this.x1 = x2) : (this.x1 = x1, this.x2 = x2), y2 < y1 ? (this.y2 = y1, this.y1 = y2) : (this.y1 = y1, this.y2 = y2), this;
|
|
1305
1249
|
}
|
|
1306
|
-
add() {
|
|
1307
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1308
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1250
|
+
add(x = 0, y = 0) {
|
|
1309
1251
|
return x < this.x1 && (this.x1 = x), y < this.y1 && (this.y1 = y), x > this.x2 && (this.x2 = x), y > this.y2 && (this.y2 = y), this;
|
|
1310
1252
|
}
|
|
1311
|
-
expand() {
|
|
1312
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1253
|
+
expand(d = 0) {
|
|
1313
1254
|
return isArray$1(d) ? (this.y1 -= d[0], this.x2 += d[1], this.y2 += d[2], this.x1 -= d[3]) : (this.x1 -= d, this.y1 -= d, this.x2 += d, this.y2 += d), this;
|
|
1314
1255
|
}
|
|
1315
1256
|
round() {
|
|
1316
1257
|
return this.x1 = Math.floor(this.x1), this.y1 = Math.floor(this.y1), this.x2 = Math.ceil(this.x2), this.y2 = Math.ceil(this.y2), this;
|
|
1317
1258
|
}
|
|
1318
|
-
translate() {
|
|
1319
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1320
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1259
|
+
translate(dx = 0, dy = 0) {
|
|
1321
1260
|
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1322
1261
|
}
|
|
1323
|
-
rotate() {
|
|
1324
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1325
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1326
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1262
|
+
rotate(angle = 0, x = 0, y = 0) {
|
|
1327
1263
|
const p = this.rotatedPoints(angle, x, y);
|
|
1328
1264
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1329
1265
|
}
|
|
1330
|
-
scale() {
|
|
1331
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1332
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1333
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1334
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1266
|
+
scale(sx = 0, sy = 0, x = 0, y = 0) {
|
|
1335
1267
|
const p = this.scalePoints(sx, sy, x, y);
|
|
1336
1268
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1337
1269
|
}
|
|
@@ -1350,9 +1282,7 @@
|
|
|
1350
1282
|
intersects(b) {
|
|
1351
1283
|
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1352
1284
|
}
|
|
1353
|
-
contains() {
|
|
1354
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1355
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1285
|
+
contains(x = 0, y = 0) {
|
|
1356
1286
|
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1357
1287
|
}
|
|
1358
1288
|
containsPoint(p) {
|
|
@@ -1364,12 +1294,10 @@
|
|
|
1364
1294
|
height() {
|
|
1365
1295
|
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1366
1296
|
}
|
|
1367
|
-
scaleX() {
|
|
1368
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1297
|
+
scaleX(s = 0) {
|
|
1369
1298
|
return this.x1 *= s, this.x2 *= s, this;
|
|
1370
1299
|
}
|
|
1371
|
-
scaleY() {
|
|
1372
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1300
|
+
scaleY(s = 0) {
|
|
1373
1301
|
return this.y1 *= s, this.y2 *= s, this;
|
|
1374
1302
|
}
|
|
1375
1303
|
transformWithMatrix(matrix) {
|
|
@@ -1403,20 +1331,14 @@
|
|
|
1403
1331
|
}
|
|
1404
1332
|
class AABBBounds extends Bounds {}
|
|
1405
1333
|
class OBBBounds extends Bounds {
|
|
1406
|
-
constructor(bounds) {
|
|
1407
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1334
|
+
constructor(bounds, angle = 0) {
|
|
1408
1335
|
var _a;
|
|
1409
1336
|
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
1410
1337
|
}
|
|
1411
1338
|
intersects(b) {
|
|
1412
1339
|
return isRotateAABBIntersect(this, b);
|
|
1413
1340
|
}
|
|
1414
|
-
setValue() {
|
|
1415
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1416
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1417
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1418
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1419
|
-
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1341
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0, angle = 0) {
|
|
1420
1342
|
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1421
1343
|
}
|
|
1422
1344
|
clone() {
|
|
@@ -1444,13 +1366,7 @@
|
|
|
1444
1366
|
}
|
|
1445
1367
|
|
|
1446
1368
|
class Matrix {
|
|
1447
|
-
constructor() {
|
|
1448
|
-
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1449
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1450
|
-
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1451
|
-
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
1452
|
-
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1453
|
-
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
1369
|
+
constructor(a = 1, b = 0, c = 0, d = 1, e = 0, f = 0) {
|
|
1454
1370
|
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
1455
1371
|
}
|
|
1456
1372
|
equalToMatrix(m2) {
|
|
@@ -1560,8 +1476,7 @@
|
|
|
1560
1476
|
} = source;
|
|
1561
1477
|
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
1562
1478
|
}
|
|
1563
|
-
onlyTranslate() {
|
|
1564
|
-
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1479
|
+
onlyTranslate(scale = 1) {
|
|
1565
1480
|
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
1566
1481
|
}
|
|
1567
1482
|
clone() {
|
|
@@ -1820,16 +1735,13 @@
|
|
|
1820
1735
|
}
|
|
1821
1736
|
};
|
|
1822
1737
|
class Color {
|
|
1823
|
-
static Brighter(source) {
|
|
1824
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1738
|
+
static Brighter(source, b = 1) {
|
|
1825
1739
|
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
1826
1740
|
}
|
|
1827
|
-
static SetOpacity(source) {
|
|
1828
|
-
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1741
|
+
static SetOpacity(source, o = 1) {
|
|
1829
1742
|
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
1830
1743
|
}
|
|
1831
|
-
static getColorBrightness(source) {
|
|
1832
|
-
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
1744
|
+
static getColorBrightness(source, model = "hsl") {
|
|
1833
1745
|
const color = source instanceof Color ? source : new Color(source);
|
|
1834
1746
|
switch (model) {
|
|
1835
1747
|
case "hsv":
|
|
@@ -1933,8 +1845,7 @@
|
|
|
1933
1845
|
setScalar(scalar) {
|
|
1934
1846
|
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
1935
1847
|
}
|
|
1936
|
-
setOpacity() {
|
|
1937
|
-
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1848
|
+
setOpacity(o = 1) {
|
|
1938
1849
|
return this.color.opacity = o, this;
|
|
1939
1850
|
}
|
|
1940
1851
|
getLuminance() {
|
|
@@ -1957,12 +1868,10 @@
|
|
|
1957
1868
|
clone() {
|
|
1958
1869
|
return new Color(this.color.toString());
|
|
1959
1870
|
}
|
|
1960
|
-
copyGammaToLinear(color) {
|
|
1961
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1871
|
+
copyGammaToLinear(color, gammaFactor = 2) {
|
|
1962
1872
|
return this.color.r = Math.pow(color.color.r, gammaFactor), this.color.g = Math.pow(color.color.g, gammaFactor), this.color.b = Math.pow(color.color.b, gammaFactor), this;
|
|
1963
1873
|
}
|
|
1964
|
-
copyLinearToGamma(color) {
|
|
1965
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
1874
|
+
copyLinearToGamma(color, gammaFactor = 2) {
|
|
1966
1875
|
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
1967
1876
|
return this.color.r = Math.pow(color.color.r, safeInverse), this.color.g = Math.pow(color.color.g, safeInverse), this.color.b = Math.pow(color.color.b, safeInverse), this;
|
|
1968
1877
|
}
|
|
@@ -2166,8 +2075,7 @@
|
|
|
2166
2075
|
}
|
|
2167
2076
|
return result;
|
|
2168
2077
|
}
|
|
2169
|
-
function destination(point, distance, bearing) {
|
|
2170
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
2078
|
+
function destination(point, distance, bearing, options = {}) {
|
|
2171
2079
|
const longitude1 = degreeToRadian(point[0]),
|
|
2172
2080
|
latitude1 = degreeToRadian(point[1]),
|
|
2173
2081
|
bearingRad = degreeToRadian(bearing),
|
|
@@ -3270,8 +3178,7 @@
|
|
|
3270
3178
|
function splitNumberSequence(rawStr) {
|
|
3271
3179
|
return rawStr.match(numberReg) || [];
|
|
3272
3180
|
}
|
|
3273
|
-
const svgParser =
|
|
3274
|
-
let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3181
|
+
const svgParser = (data, option = {}, dataView) => {
|
|
3275
3182
|
let parser = option.customDOMParser;
|
|
3276
3183
|
if (parser || (null === window || void 0 === window ? void 0 : window.DOMParser) && (parser = svg => new DOMParser().parseFromString(svg, "text/xml")), !parser) throw new Error("No Available DOMParser!");
|
|
3277
3184
|
const svg = parser(data);
|
|
@@ -3282,9 +3189,8 @@
|
|
|
3282
3189
|
}
|
|
3283
3190
|
return null;
|
|
3284
3191
|
};
|
|
3285
|
-
let idx = 0;
|
|
3286
|
-
function parseSvgNode(svg) {
|
|
3287
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3192
|
+
let idx$1 = 0;
|
|
3193
|
+
function parseSvgNode(svg, opt = {}) {
|
|
3288
3194
|
const elements = [],
|
|
3289
3195
|
root = parseNode(svg, null);
|
|
3290
3196
|
let width = parseFloat(svg.getAttribute("width") || opt.width),
|
|
@@ -3361,7 +3267,7 @@
|
|
|
3361
3267
|
attributes: parseAttributes(node),
|
|
3362
3268
|
parent: parent,
|
|
3363
3269
|
name: null !== (_b = node.getAttribute("name")) && void 0 !== _b ? _b : null === (_c = null == parent ? void 0 : parent.attributes) || void 0 === _c ? void 0 : _c.name,
|
|
3364
|
-
id: null !== (_d = node.getAttribute("id")) && void 0 !== _d ? _d : `${tagName}-${idx++}`,
|
|
3270
|
+
id: null !== (_d = node.getAttribute("id")) && void 0 !== _d ? _d : `${tagName}-${idx$1++}`,
|
|
3365
3271
|
transform: parseTransform(node)
|
|
3366
3272
|
};
|
|
3367
3273
|
return parsed._inheritStyle = parseInheritAttributes(parsed), parent && !isValid$1(parsed.name) && (parsed._nameFromParent = null !== (_e = parent.name) && void 0 !== _e ? _e : parent._nameFromParent), parsed;
|
|
@@ -3382,7 +3288,7 @@
|
|
|
3382
3288
|
attributes: parseAttributes(node),
|
|
3383
3289
|
parent: parent,
|
|
3384
3290
|
name: node.getAttribute("name"),
|
|
3385
|
-
id: null !== (_c = node.getAttribute("id")) && void 0 !== _c ? _c : `${tagName}-${idx++}`,
|
|
3291
|
+
id: null !== (_c = node.getAttribute("id")) && void 0 !== _c ? _c : `${tagName}-${idx$1++}`,
|
|
3386
3292
|
transform: parseTransform(node),
|
|
3387
3293
|
value: value
|
|
3388
3294
|
} : {
|
|
@@ -3391,7 +3297,7 @@
|
|
|
3391
3297
|
attributes: parseAttributes(node),
|
|
3392
3298
|
parent: parent,
|
|
3393
3299
|
name: null == parent ? void 0 : parent.name,
|
|
3394
|
-
id: null !== (_e = null === (_d = node.getAttribute) || void 0 === _d ? void 0 : _d.call(node, "id")) && void 0 !== _e ? _e : `${tagName}-${idx++}`,
|
|
3300
|
+
id: null !== (_e = null === (_d = node.getAttribute) || void 0 === _d ? void 0 : _d.call(node, "id")) && void 0 !== _e ? _e : `${tagName}-${idx$1++}`,
|
|
3395
3301
|
value: value
|
|
3396
3302
|
}, parsed._inheritStyle = parseInheritAttributes(parsed), isValid$1(parsed.name) || (parsed._nameFromParent = null !== (_f = parent.name) && void 0 !== _f ? _f : parent._nameFromParent), nodeAsGroup ? parent._textGroupStyle ? parsed._textGroupStyle = merge({}, parent._textGroupStyle, parseAttributes(node)) : parsed._textGroupStyle = parseAttributes(node) : parsed.attributes = parsed._inheritStyle, parsed;
|
|
3397
3303
|
}
|
|
@@ -3411,8 +3317,7 @@
|
|
|
3411
3317
|
} = matrix;
|
|
3412
3318
|
return new Matrix(a, b, c, d, e, f);
|
|
3413
3319
|
}
|
|
3414
|
-
function traverse(node, parsedParent) {
|
|
3415
|
-
let result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
3320
|
+
function traverse(node, parsedParent, result = []) {
|
|
3416
3321
|
var _a;
|
|
3417
3322
|
if (!node) return;
|
|
3418
3323
|
let parseResult;
|
|
@@ -3423,8 +3328,7 @@
|
|
|
3423
3328
|
|
|
3424
3329
|
let idIndex = 0;
|
|
3425
3330
|
const maxId = 1e8;
|
|
3426
|
-
function getUUID() {
|
|
3427
|
-
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "dataset";
|
|
3331
|
+
function getUUID(prefix = "dataset") {
|
|
3428
3332
|
return idIndex > maxId && (idIndex = 0), prefix + "_" + idIndex++;
|
|
3429
3333
|
}
|
|
3430
3334
|
|
|
@@ -3512,25 +3416,22 @@
|
|
|
3512
3416
|
|
|
3513
3417
|
class DataView {
|
|
3514
3418
|
constructor(dataSet, options) {
|
|
3515
|
-
var _this = this;
|
|
3516
3419
|
let name;
|
|
3517
|
-
this.dataSet = dataSet, this.options = options, this.isDataView = !0, this.target = new EventEmitter(), this.parseOption = null, this.transformsArr = [], this.isRunning = !1, this.rawData = {}, this.history = !1, this.parserData = {}, this.latestData = {}, this._fields = null, this.reRunAllTransform =
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
_this.executeTransform(t, {
|
|
3420
|
+
this.dataSet = dataSet, this.options = options, this.isDataView = !0, this.target = new EventEmitter(), this.parseOption = null, this.transformsArr = [], this.isRunning = !1, this.rawData = {}, this.history = !1, this.parserData = {}, this.latestData = {}, this._fields = null, this.reRunAllTransform = (opt = {}) => {
|
|
3421
|
+
const prevLatestData = this.latestData;
|
|
3422
|
+
return this.isRunning = !0, this.resetTransformData(), this.transformsArr.forEach(t => {
|
|
3423
|
+
this.executeTransform(t, {
|
|
3522
3424
|
pushHistory: opt.pushHistory,
|
|
3523
3425
|
emitMessage: !1
|
|
3524
3426
|
});
|
|
3525
|
-
}),
|
|
3526
|
-
latestData:
|
|
3527
|
-
}),
|
|
3427
|
+
}), this.isRunning = !1, !1 === opt.emitMessage || opt.skipEqual && isEqual(prevLatestData, this.latestData) || this.target.emit("change", {
|
|
3428
|
+
latestData: this.latestData
|
|
3429
|
+
}), this;
|
|
3528
3430
|
}, this.markRunning = () => {
|
|
3529
3431
|
this.isRunning = !0, this.target.emit("markRunning", []);
|
|
3530
3432
|
}, 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);
|
|
3531
3433
|
}
|
|
3532
|
-
parse(data, options) {
|
|
3533
|
-
let emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
3434
|
+
parse(data, options, emit = !1) {
|
|
3534
3435
|
var _a;
|
|
3535
3436
|
this.isRunning = !0, emit && this.target.emit("beforeParse", []), options && (this.parseOption = options);
|
|
3536
3437
|
const cloneData = this.cloneParseData(data, options);
|
|
@@ -3540,8 +3441,7 @@
|
|
|
3540
3441
|
} else this.parserData = cloneData, this.rawData = cloneData, this.history && this.historyData.push(cloneData), this.latestData = cloneData;
|
|
3541
3442
|
return this.isRunning = !1, emit && this.target.emit("afterParse", []), this;
|
|
3542
3443
|
}
|
|
3543
|
-
transform(options) {
|
|
3544
|
-
let execute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
3444
|
+
transform(options, execute = !0) {
|
|
3545
3445
|
if (this.isRunning = !0, options && options.type) {
|
|
3546
3446
|
let pushOption = !0;
|
|
3547
3447
|
if ("fields" === options.type) {
|
|
@@ -3559,8 +3459,7 @@
|
|
|
3559
3459
|
return (null !== (_a = a.level) && void 0 !== _a ? _a : 0) - (null !== (_b = b.level) && void 0 !== _b ? _b : 0);
|
|
3560
3460
|
});
|
|
3561
3461
|
}
|
|
3562
|
-
executeTransform(options) {
|
|
3563
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3462
|
+
executeTransform(options, opt = {}) {
|
|
3564
3463
|
const {
|
|
3565
3464
|
pushHistory: pushHistory,
|
|
3566
3465
|
emitMessage: emitMessage,
|
|
@@ -3591,8 +3490,7 @@
|
|
|
3591
3490
|
var _a;
|
|
3592
3491
|
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;
|
|
3593
3492
|
}
|
|
3594
|
-
setFields(f) {
|
|
3595
|
-
let foreMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
3493
|
+
setFields(f, foreMerge = !1) {
|
|
3596
3494
|
this._fields = f && foreMerge ? merge({}, this._fields, f) : f;
|
|
3597
3495
|
const fieldsOption = this.transformsArr.find(_op => "fields" === _op.type);
|
|
3598
3496
|
!isNil$1(this._fields) && isNil$1(fieldsOption) ? (this.dataSet.registerTransform("fields", fields), this.transform({
|
|
@@ -5402,12 +5300,9 @@
|
|
|
5402
5300
|
}
|
|
5403
5301
|
}
|
|
5404
5302
|
function bindContributionProvider(bind, id) {
|
|
5405
|
-
bind(ContributionProvider).toDynamicValue(
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
} = _ref;
|
|
5409
|
-
return new ContributionProviderCache(id, container);
|
|
5410
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
5303
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
5304
|
+
container: container
|
|
5305
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
5411
5306
|
}
|
|
5412
5307
|
class ContributionStore {
|
|
5413
5308
|
static getStore(id) {
|
|
@@ -5477,10 +5372,7 @@
|
|
|
5477
5372
|
}
|
|
5478
5373
|
|
|
5479
5374
|
class SyncHook extends Hook {
|
|
5480
|
-
call() {
|
|
5481
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5482
|
-
args[_key] = arguments[_key];
|
|
5483
|
-
}
|
|
5375
|
+
call(...args) {
|
|
5484
5376
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
5485
5377
|
}
|
|
5486
5378
|
}
|
|
@@ -5490,22 +5382,22 @@
|
|
|
5490
5382
|
class Application {}
|
|
5491
5383
|
const application = new Application();
|
|
5492
5384
|
|
|
5385
|
+
let idx = 0;
|
|
5493
5386
|
class PerformanceRAF {
|
|
5494
5387
|
constructor() {
|
|
5495
|
-
this.nextAnimationFrameCbs =
|
|
5388
|
+
this.nextAnimationFrameCbs = new Map(), this._rafHandle = null, this.runAnimationFrame = time => {
|
|
5496
5389
|
this._rafHandle = null;
|
|
5497
5390
|
const cbs = this.nextAnimationFrameCbs;
|
|
5498
|
-
this.nextAnimationFrameCbs =
|
|
5499
|
-
for (let i = 0; i < cbs.length; i++) cbs[i] && cbs[i](time);
|
|
5391
|
+
this.nextAnimationFrameCbs = new Map(), cbs.forEach(cb => cb(time));
|
|
5500
5392
|
}, this.tryRunAnimationFrameNextFrame = () => {
|
|
5501
|
-
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.
|
|
5393
|
+
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.size && (this._rafHandle = application.global.getRequestAnimationFrame()(this.runAnimationFrame));
|
|
5502
5394
|
};
|
|
5503
5395
|
}
|
|
5504
5396
|
addAnimationFrameCb(callback) {
|
|
5505
|
-
return this.nextAnimationFrameCbs.
|
|
5397
|
+
return this.nextAnimationFrameCbs.set(++idx, callback), this.tryRunAnimationFrameNextFrame(), idx;
|
|
5506
5398
|
}
|
|
5507
5399
|
removeAnimationFrameCb(index) {
|
|
5508
|
-
return
|
|
5400
|
+
return !!this.nextAnimationFrameCbs.has(index) && (this.nextAnimationFrameCbs.delete(index), !0);
|
|
5509
5401
|
}
|
|
5510
5402
|
}
|
|
5511
5403
|
|
|
@@ -5577,7 +5469,7 @@
|
|
|
5577
5469
|
clear() {
|
|
5578
5470
|
this.bounds.clear();
|
|
5579
5471
|
}
|
|
5580
|
-
release() {}
|
|
5472
|
+
release(...params) {}
|
|
5581
5473
|
}
|
|
5582
5474
|
|
|
5583
5475
|
class CurvePath {
|
|
@@ -5752,8 +5644,7 @@
|
|
|
5752
5644
|
context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
|
|
5753
5645
|
}
|
|
5754
5646
|
}
|
|
5755
|
-
const addArcToBezierPath =
|
|
5756
|
-
let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
5647
|
+
const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
|
|
5757
5648
|
const PI2 = 2 * Math.PI,
|
|
5758
5649
|
sAngle = (startAngle % PI2 + PI2) % PI2;
|
|
5759
5650
|
let deltaAngle,
|
|
@@ -5781,12 +5672,7 @@
|
|
|
5781
5672
|
};
|
|
5782
5673
|
|
|
5783
5674
|
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)];
|
|
5784
|
-
function renderCommandList(commandList, context) {
|
|
5785
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
5786
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
5787
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
5788
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
5789
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
5675
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
5790
5676
|
for (let i = 0; i < commandList.length; i++) {
|
|
5791
5677
|
const command = commandList[i];
|
|
5792
5678
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -6019,7 +5905,7 @@
|
|
|
6019
5905
|
}
|
|
6020
5906
|
}
|
|
6021
5907
|
|
|
6022
|
-
function genCurveSegments(path, points) {
|
|
5908
|
+
function genCurveSegments(path, points, step = 1) {
|
|
6023
5909
|
let defined0 = !1;
|
|
6024
5910
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
6025
5911
|
}
|
|
@@ -6062,8 +5948,7 @@
|
|
|
6062
5948
|
return this.context.tryUpdateLength();
|
|
6063
5949
|
}
|
|
6064
5950
|
}
|
|
6065
|
-
function genLinearSegments(points) {
|
|
6066
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5951
|
+
function genLinearSegments(points, params = {}) {
|
|
6067
5952
|
const {
|
|
6068
5953
|
direction: direction,
|
|
6069
5954
|
startPoint: startPoint
|
|
@@ -6073,7 +5958,7 @@
|
|
|
6073
5958
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
6074
5959
|
}
|
|
6075
5960
|
function genLinearTypeSegments(path, points) {
|
|
6076
|
-
return genCurveSegments(path, points);
|
|
5961
|
+
return genCurveSegments(path, points, 1);
|
|
6077
5962
|
}
|
|
6078
5963
|
|
|
6079
5964
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -6116,10 +6001,9 @@
|
|
|
6116
6001
|
}
|
|
6117
6002
|
}
|
|
6118
6003
|
function genBasisTypeSegments(path, points) {
|
|
6119
|
-
return genCurveSegments(path, points);
|
|
6004
|
+
return genCurveSegments(path, points, 2);
|
|
6120
6005
|
}
|
|
6121
|
-
function genBasisSegments(points) {
|
|
6122
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6006
|
+
function genBasisSegments(points, params = {}) {
|
|
6123
6007
|
const {
|
|
6124
6008
|
direction: direction,
|
|
6125
6009
|
startPoint: startPoint
|
|
@@ -6212,10 +6096,9 @@
|
|
|
6212
6096
|
}
|
|
6213
6097
|
}
|
|
6214
6098
|
function genMonotoneXTypeSegments(path, points) {
|
|
6215
|
-
return genCurveSegments(path, points);
|
|
6099
|
+
return genCurveSegments(path, points, 2);
|
|
6216
6100
|
}
|
|
6217
|
-
function genMonotoneXSegments(points) {
|
|
6218
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6101
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
6219
6102
|
const {
|
|
6220
6103
|
direction: direction,
|
|
6221
6104
|
startPoint: startPoint
|
|
@@ -6226,10 +6109,9 @@
|
|
|
6226
6109
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
6227
6110
|
}
|
|
6228
6111
|
function genMonotoneYTypeSegments(path, points) {
|
|
6229
|
-
return genCurveSegments(path, points);
|
|
6112
|
+
return genCurveSegments(path, points, 2);
|
|
6230
6113
|
}
|
|
6231
|
-
function genMonotoneYSegments(points) {
|
|
6232
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6114
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
6233
6115
|
const {
|
|
6234
6116
|
direction: direction,
|
|
6235
6117
|
startPoint: startPoint
|
|
@@ -6241,9 +6123,7 @@
|
|
|
6241
6123
|
}
|
|
6242
6124
|
|
|
6243
6125
|
let Step$1 = class Step {
|
|
6244
|
-
constructor(context) {
|
|
6245
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
6246
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
6126
|
+
constructor(context, t = .5, startPoint) {
|
|
6247
6127
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
6248
6128
|
}
|
|
6249
6129
|
areaStart() {
|
|
@@ -6284,8 +6164,7 @@
|
|
|
6284
6164
|
this.context.closePath();
|
|
6285
6165
|
}
|
|
6286
6166
|
}
|
|
6287
|
-
function genStepSegments(points, t) {
|
|
6288
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6167
|
+
function genStepSegments(points, t, params = {}) {
|
|
6289
6168
|
const {
|
|
6290
6169
|
direction: direction,
|
|
6291
6170
|
startPoint: startPoint
|
|
@@ -6295,10 +6174,9 @@
|
|
|
6295
6174
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
6296
6175
|
}
|
|
6297
6176
|
function genStepTypeSegments(path, points) {
|
|
6298
|
-
return genCurveSegments(path, points);
|
|
6177
|
+
return genCurveSegments(path, points, 1);
|
|
6299
6178
|
}
|
|
6300
|
-
function genStepClosedSegments(points, t) {
|
|
6301
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6179
|
+
function genStepClosedSegments(points, t, params = {}) {
|
|
6302
6180
|
const {
|
|
6303
6181
|
direction: direction,
|
|
6304
6182
|
startPoint: startPoint
|
|
@@ -6313,8 +6191,7 @@
|
|
|
6313
6191
|
this.context.closePath();
|
|
6314
6192
|
}
|
|
6315
6193
|
}
|
|
6316
|
-
function genLinearClosedSegments(points) {
|
|
6317
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6194
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
6318
6195
|
const {
|
|
6319
6196
|
direction: direction,
|
|
6320
6197
|
startPoint: startPoint
|
|
@@ -6324,7 +6201,7 @@
|
|
|
6324
6201
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
6325
6202
|
}
|
|
6326
6203
|
function genLinearClosedTypeSegments(path, points) {
|
|
6327
|
-
return genCurveSegments(path, points);
|
|
6204
|
+
return genCurveSegments(path, points, 1);
|
|
6328
6205
|
}
|
|
6329
6206
|
|
|
6330
6207
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -6345,9 +6222,7 @@
|
|
|
6345
6222
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
6346
6223
|
}
|
|
6347
6224
|
class CatmullRom {
|
|
6348
|
-
constructor(context) {
|
|
6349
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
6350
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
6225
|
+
constructor(context, alpha = .5, startPoint) {
|
|
6351
6226
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
6352
6227
|
}
|
|
6353
6228
|
areaStart() {
|
|
@@ -6401,8 +6276,7 @@
|
|
|
6401
6276
|
}
|
|
6402
6277
|
}
|
|
6403
6278
|
function commonGenCatmullRomSegments(type, cons) {
|
|
6404
|
-
return function (points, alpha) {
|
|
6405
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
6279
|
+
return function (points, alpha, params = {}) {
|
|
6406
6280
|
const {
|
|
6407
6281
|
direction: direction,
|
|
6408
6282
|
startPoint: startPoint
|
|
@@ -6411,15 +6285,13 @@
|
|
|
6411
6285
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
6412
6286
|
const segContext = genSegContext(type, direction, points),
|
|
6413
6287
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
6414
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
6288
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
6415
6289
|
};
|
|
6416
6290
|
}
|
|
6417
6291
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
6418
6292
|
|
|
6419
6293
|
class CatmullRomClosed {
|
|
6420
|
-
constructor(context) {
|
|
6421
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
6422
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
6294
|
+
constructor(context, alpha = .5, startPoint) {
|
|
6423
6295
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
6424
6296
|
}
|
|
6425
6297
|
areaStart() {
|
|
@@ -6729,11 +6601,7 @@
|
|
|
6729
6601
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
6730
6602
|
}
|
|
6731
6603
|
closePathTransform() {}
|
|
6732
|
-
_runCommandStrList(commandStrList) {
|
|
6733
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
6734
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
6735
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
6736
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
6604
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
6737
6605
|
let current,
|
|
6738
6606
|
tempX,
|
|
6739
6607
|
tempY,
|
|
@@ -6807,11 +6675,7 @@
|
|
|
6807
6675
|
previous = current;
|
|
6808
6676
|
}
|
|
6809
6677
|
}
|
|
6810
|
-
_runCommandList(commandList) {
|
|
6811
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
6812
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
6813
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
6814
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
6678
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
6815
6679
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
6816
6680
|
const current = commandList[i].slice();
|
|
6817
6681
|
switch (current[0]) {
|
|
@@ -7462,9 +7326,7 @@
|
|
|
7462
7326
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
7463
7327
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
7464
7328
|
}
|
|
7465
|
-
function createColor(context, c, params) {
|
|
7466
|
-
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
7467
|
-
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
7329
|
+
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
7468
7330
|
var _a, _b, _c, _d;
|
|
7469
7331
|
if (!c || !0 === c) return "black";
|
|
7470
7332
|
let result, color;
|
|
@@ -7603,8 +7465,7 @@
|
|
|
7603
7465
|
}
|
|
7604
7466
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
7605
7467
|
}
|
|
7606
|
-
function testLetter(string, index) {
|
|
7607
|
-
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
7468
|
+
function testLetter(string, index, negativeWrongMatch = !1) {
|
|
7608
7469
|
let i = index;
|
|
7609
7470
|
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
7610
7471
|
return i;
|
|
@@ -7614,8 +7475,7 @@
|
|
|
7614
7475
|
for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
7615
7476
|
return i + 1;
|
|
7616
7477
|
}
|
|
7617
|
-
function measureTextCanvas(text, character) {
|
|
7618
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
7478
|
+
function measureTextCanvas(text, character, mode = "actual") {
|
|
7619
7479
|
var _a;
|
|
7620
7480
|
if ("" === text) return {
|
|
7621
7481
|
ascent: 0,
|
|
@@ -8039,7 +7899,7 @@
|
|
|
8039
7899
|
get length() {
|
|
8040
7900
|
return this.pools.length;
|
|
8041
7901
|
}
|
|
8042
|
-
release() {
|
|
7902
|
+
release(...params) {
|
|
8043
7903
|
this.pools = [];
|
|
8044
7904
|
}
|
|
8045
7905
|
}
|
|
@@ -8108,8 +7968,7 @@
|
|
|
8108
7968
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
8109
7969
|
return null;
|
|
8110
7970
|
}
|
|
8111
|
-
applyTheme(group, pt) {
|
|
8112
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
7971
|
+
applyTheme(group, pt, force = !1) {
|
|
8113
7972
|
if (this.dirty) {
|
|
8114
7973
|
const parentGroup = this.getParentWithTheme(group);
|
|
8115
7974
|
if (parentGroup) {
|
|
@@ -8208,8 +8067,7 @@
|
|
|
8208
8067
|
constructor() {
|
|
8209
8068
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
8210
8069
|
}
|
|
8211
|
-
forEachChildren(cb) {
|
|
8212
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8070
|
+
forEachChildren(cb, reverse = !1) {
|
|
8213
8071
|
if (reverse) {
|
|
8214
8072
|
let child = this._lastChild,
|
|
8215
8073
|
i = 0;
|
|
@@ -8226,8 +8084,7 @@
|
|
|
8226
8084
|
}
|
|
8227
8085
|
}
|
|
8228
8086
|
}
|
|
8229
|
-
forEachChildrenAsync(cb) {
|
|
8230
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8087
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
8231
8088
|
return __awaiter(this, void 0, void 0, function* () {
|
|
8232
8089
|
if (reverse) {
|
|
8233
8090
|
let child = this._lastChild,
|
|
@@ -8251,13 +8108,12 @@
|
|
|
8251
8108
|
forEach(cb) {
|
|
8252
8109
|
return this.forEachChildren(cb);
|
|
8253
8110
|
}
|
|
8254
|
-
appendChild(node) {
|
|
8255
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
8111
|
+
appendChild(node, highPerformance = !0) {
|
|
8256
8112
|
if (this._uid === node._uid) return null;
|
|
8257
8113
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
8258
8114
|
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;
|
|
8259
8115
|
}
|
|
8260
|
-
appendChildArrHighPerformance(nodes) {
|
|
8116
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
8261
8117
|
return console.error("暂不支持该函数"), nodes;
|
|
8262
8118
|
}
|
|
8263
8119
|
insertBefore(newNode, referenceNode) {
|
|
@@ -8325,8 +8181,7 @@
|
|
|
8325
8181
|
replaceChild(newChild, oldChild) {
|
|
8326
8182
|
throw new Error("暂不支持");
|
|
8327
8183
|
}
|
|
8328
|
-
find(callback) {
|
|
8329
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8184
|
+
find(callback, deep = !1) {
|
|
8330
8185
|
let target = null;
|
|
8331
8186
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
8332
8187
|
if (child.isContainer) {
|
|
@@ -8336,8 +8191,7 @@
|
|
|
8336
8191
|
return !1;
|
|
8337
8192
|
}), target;
|
|
8338
8193
|
}
|
|
8339
|
-
findAll(callback) {
|
|
8340
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8194
|
+
findAll(callback, deep = !1) {
|
|
8341
8195
|
let nodes = [];
|
|
8342
8196
|
return this.forEachChildren((node, index) => {
|
|
8343
8197
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -8366,8 +8220,7 @@
|
|
|
8366
8220
|
getElementsByType(type) {
|
|
8367
8221
|
return this.findAll(node => node.type === type, !0);
|
|
8368
8222
|
}
|
|
8369
|
-
getChildByName(name) {
|
|
8370
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
8223
|
+
getChildByName(name, deep = !1) {
|
|
8371
8224
|
return this.find(node => node.name === name, deep);
|
|
8372
8225
|
}
|
|
8373
8226
|
getChildAt(idx) {
|
|
@@ -8486,10 +8339,7 @@
|
|
|
8486
8339
|
removeAllListeners() {
|
|
8487
8340
|
return this.removeAllEventListeners();
|
|
8488
8341
|
}
|
|
8489
|
-
dispatchEvent(event) {
|
|
8490
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
8491
|
-
args[_key - 1] = arguments[_key];
|
|
8492
|
-
}
|
|
8342
|
+
dispatchEvent(event, ...args) {
|
|
8493
8343
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
8494
8344
|
}
|
|
8495
8345
|
emit(event, data) {
|
|
@@ -8876,8 +8726,7 @@
|
|
|
8876
8726
|
}
|
|
8877
8727
|
var square$3 = new SquareSymbol();
|
|
8878
8728
|
|
|
8879
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
8880
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8729
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
8881
8730
|
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;
|
|
8882
8731
|
}
|
|
8883
8732
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -9023,8 +8872,7 @@
|
|
|
9023
8872
|
}
|
|
9024
8873
|
var triangleLeft = new TriangleLeftSymbol();
|
|
9025
8874
|
|
|
9026
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
9027
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8875
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
9028
8876
|
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;
|
|
9029
8877
|
}
|
|
9030
8878
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -9040,8 +8888,7 @@
|
|
|
9040
8888
|
}
|
|
9041
8889
|
var triangleRight = new TriangleRightSymbol();
|
|
9042
8890
|
|
|
9043
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
9044
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
8891
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
9045
8892
|
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;
|
|
9046
8893
|
}
|
|
9047
8894
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -9258,8 +9105,7 @@
|
|
|
9258
9105
|
|
|
9259
9106
|
const tempBounds = new AABBBounds();
|
|
9260
9107
|
class CustomSymbolClass {
|
|
9261
|
-
constructor(type, path) {
|
|
9262
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
9108
|
+
constructor(type, path, isSvg = !1) {
|
|
9263
9109
|
this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
9264
9110
|
}
|
|
9265
9111
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -9281,10 +9127,9 @@
|
|
|
9281
9127
|
bounds(size, bounds) {
|
|
9282
9128
|
if (size = this.parseSize(size), this.isSvg) {
|
|
9283
9129
|
if (!this.svgCache) return;
|
|
9284
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
} = _ref;
|
|
9130
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
9131
|
+
path: path
|
|
9132
|
+
}) => {
|
|
9288
9133
|
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);
|
|
9289
9134
|
});
|
|
9290
9135
|
}
|
|
@@ -9340,8 +9185,7 @@
|
|
|
9340
9185
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
9341
9186
|
return closingIndex + str.length - 1;
|
|
9342
9187
|
}
|
|
9343
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
9344
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
9188
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
9345
9189
|
let attrBoundary,
|
|
9346
9190
|
tagExp = "";
|
|
9347
9191
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -9359,8 +9203,7 @@
|
|
|
9359
9203
|
tagExp += ch;
|
|
9360
9204
|
}
|
|
9361
9205
|
}
|
|
9362
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
9363
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
9206
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
9364
9207
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
9365
9208
|
if (!result) return;
|
|
9366
9209
|
let tagExp = result.data;
|
|
@@ -9522,8 +9365,7 @@
|
|
|
9522
9365
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9523
9366
|
});
|
|
9524
9367
|
};
|
|
9525
|
-
function boundStroke(bounds, halfW, miter) {
|
|
9526
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
9368
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
9527
9369
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
9528
9370
|
}
|
|
9529
9371
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -9730,7 +9572,7 @@
|
|
|
9730
9572
|
get length() {
|
|
9731
9573
|
return this.pools.length;
|
|
9732
9574
|
}
|
|
9733
|
-
release() {
|
|
9575
|
+
release(...params) {
|
|
9734
9576
|
this.pools = [];
|
|
9735
9577
|
}
|
|
9736
9578
|
}
|
|
@@ -9758,7 +9600,7 @@
|
|
|
9758
9600
|
get length() {
|
|
9759
9601
|
return this.pools.length;
|
|
9760
9602
|
}
|
|
9761
|
-
release() {
|
|
9603
|
+
release(...params) {
|
|
9762
9604
|
this.pools = [];
|
|
9763
9605
|
}
|
|
9764
9606
|
}
|
|
@@ -9793,8 +9635,7 @@
|
|
|
9793
9635
|
getContext() {
|
|
9794
9636
|
throw new Error("不支持getContext");
|
|
9795
9637
|
}
|
|
9796
|
-
setTransformForCurrent() {
|
|
9797
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
9638
|
+
setTransformForCurrent(force = !1) {
|
|
9798
9639
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
|
|
9799
9640
|
}
|
|
9800
9641
|
get currentMatrix() {
|
|
@@ -9815,8 +9656,7 @@
|
|
|
9815
9656
|
highPerformanceRestore() {
|
|
9816
9657
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
9817
9658
|
}
|
|
9818
|
-
rotate(rad) {
|
|
9819
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
9659
|
+
rotate(rad, setTransform = !0) {
|
|
9820
9660
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
9821
9661
|
}
|
|
9822
9662
|
save() {
|
|
@@ -9827,55 +9667,41 @@
|
|
|
9827
9667
|
const matrix = this.cloneMatrix(this.matrix);
|
|
9828
9668
|
this.stack.push(matrix);
|
|
9829
9669
|
}
|
|
9830
|
-
scale(sx, sy) {
|
|
9831
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
9670
|
+
scale(sx, sy, setTransform = !0) {
|
|
9832
9671
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
9833
9672
|
}
|
|
9834
|
-
setScale(sx, sy) {
|
|
9835
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
9673
|
+
setScale(sx, sy, setTransform = !0) {
|
|
9836
9674
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
9837
9675
|
}
|
|
9838
|
-
scalePoint(sx, sy, px, py) {
|
|
9839
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
9676
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
9840
9677
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
9841
9678
|
}
|
|
9842
|
-
setTransform(a, b, c, d, e, f) {
|
|
9843
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
9844
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
9679
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
9845
9680
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
9846
9681
|
}
|
|
9847
|
-
setTransformFromMatrix(matrix) {
|
|
9848
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
9849
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
9682
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
9850
9683
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
9851
9684
|
}
|
|
9852
|
-
resetTransform() {
|
|
9853
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
9854
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
9685
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
9855
9686
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
9856
9687
|
}
|
|
9857
|
-
transform(a, b, c, d, e, f) {
|
|
9858
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
9688
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
9859
9689
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
9860
9690
|
}
|
|
9861
9691
|
transformFromMatrix(matrix, setTransform) {
|
|
9862
9692
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
9863
9693
|
}
|
|
9864
|
-
translate(x, y) {
|
|
9865
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
9694
|
+
translate(x, y, setTransform = !0) {
|
|
9866
9695
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
9867
9696
|
}
|
|
9868
|
-
rotateDegrees(deg) {
|
|
9869
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
9697
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
9870
9698
|
const rad = deg * Math.PI / 180;
|
|
9871
9699
|
this.rotate(rad, setTransform);
|
|
9872
9700
|
}
|
|
9873
|
-
rotateAbout(rad, x, y) {
|
|
9874
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
9701
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
9875
9702
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
9876
9703
|
}
|
|
9877
|
-
rotateDegreesAbout(deg, x, y) {
|
|
9878
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
9704
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
9879
9705
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
9880
9706
|
}
|
|
9881
9707
|
beginPath() {
|
|
@@ -9969,19 +9795,16 @@
|
|
|
9969
9795
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {}
|
|
9970
9796
|
setTextStyle(params, defaultParams) {}
|
|
9971
9797
|
draw() {}
|
|
9972
|
-
clearMatrix() {
|
|
9973
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
9974
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
9798
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
9975
9799
|
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
9976
9800
|
}
|
|
9977
9801
|
setClearMatrix(a, b, c, d, e, f) {
|
|
9978
9802
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
9979
9803
|
}
|
|
9980
|
-
onlyTranslate() {
|
|
9981
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
9804
|
+
onlyTranslate(dpr = this.dpr) {
|
|
9982
9805
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
9983
9806
|
}
|
|
9984
|
-
release() {
|
|
9807
|
+
release(...params) {
|
|
9985
9808
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
9986
9809
|
}
|
|
9987
9810
|
};
|
|
@@ -9992,9 +9815,7 @@
|
|
|
9992
9815
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
9993
9816
|
}(ColorType || (ColorType = {}));
|
|
9994
9817
|
class ColorStore {
|
|
9995
|
-
static Get(str) {
|
|
9996
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
9997
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
9818
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
9998
9819
|
if (size === ColorType.Color1) {
|
|
9999
9820
|
const color = ColorStore.store1[str];
|
|
10000
9821
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -10022,8 +9843,7 @@
|
|
|
10022
9843
|
}
|
|
10023
9844
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
10024
9845
|
|
|
10025
|
-
function colorArrayToString(color) {
|
|
10026
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
9846
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
10027
9847
|
return Array.isArray(color) && isNumber$1(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;
|
|
10028
9848
|
}
|
|
10029
9849
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -10207,8 +10027,7 @@
|
|
|
10207
10027
|
get globalTransMatrix() {
|
|
10208
10028
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
10209
10029
|
}
|
|
10210
|
-
constructor() {
|
|
10211
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10030
|
+
constructor(params = {}) {
|
|
10212
10031
|
var _a;
|
|
10213
10032
|
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);
|
|
10214
10033
|
}
|
|
@@ -10228,8 +10047,7 @@
|
|
|
10228
10047
|
set2dMode() {
|
|
10229
10048
|
this.in3dMode = !1;
|
|
10230
10049
|
}
|
|
10231
|
-
getOffsetXY(attr) {
|
|
10232
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10050
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
10233
10051
|
var _a, _b;
|
|
10234
10052
|
const {
|
|
10235
10053
|
dx = attr.dx,
|
|
@@ -10340,7 +10158,7 @@
|
|
|
10340
10158
|
const b = this.AABBBounds;
|
|
10341
10159
|
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;
|
|
10342
10160
|
}
|
|
10343
|
-
tryUpdateGlobalTransMatrix() {
|
|
10161
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
10344
10162
|
if (this._globalTransMatrix) {
|
|
10345
10163
|
if (this.parent) {
|
|
10346
10164
|
const m = this.parent.globalTransMatrix;
|
|
@@ -10352,8 +10170,7 @@
|
|
|
10352
10170
|
shouldUpdateGlobalMatrix() {
|
|
10353
10171
|
return !0;
|
|
10354
10172
|
}
|
|
10355
|
-
tryUpdateLocalTransMatrix() {
|
|
10356
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
10173
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
10357
10174
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
10358
10175
|
}
|
|
10359
10176
|
shouldUpdateAABBBounds() {
|
|
@@ -10393,23 +10210,17 @@
|
|
|
10393
10210
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
10394
10211
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
10395
10212
|
}
|
|
10396
|
-
setAttributesAndPreventAnimate(params) {
|
|
10397
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10398
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
10213
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
10399
10214
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
10400
10215
|
Object.keys(params).forEach(key => {
|
|
10401
10216
|
animate.preventAttr(key);
|
|
10402
10217
|
});
|
|
10403
10218
|
});
|
|
10404
10219
|
}
|
|
10405
|
-
setAttributes(params) {
|
|
10406
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10407
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
10220
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
10408
10221
|
(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);
|
|
10409
10222
|
}
|
|
10410
|
-
_setAttributes(params) {
|
|
10411
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10412
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
10223
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
10413
10224
|
const keys = Object.keys(params);
|
|
10414
10225
|
for (let i = 0; i < keys.length; i++) {
|
|
10415
10226
|
const key = keys[i];
|
|
@@ -10424,16 +10235,14 @@
|
|
|
10424
10235
|
}, this.attribute, key, context);
|
|
10425
10236
|
params ? this._setAttributes(params, forceUpdateTag, context) : isNil$1(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);
|
|
10426
10237
|
}
|
|
10427
|
-
needUpdateTags(keys) {
|
|
10428
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
10238
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
10429
10239
|
for (let i = 0; i < k.length; i++) {
|
|
10430
10240
|
const attrKey = k[i];
|
|
10431
10241
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
10432
10242
|
}
|
|
10433
10243
|
return !1;
|
|
10434
10244
|
}
|
|
10435
|
-
needUpdateTag(key) {
|
|
10436
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
10245
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
10437
10246
|
for (let i = 0; i < k.length; i++) {
|
|
10438
10247
|
if (key === k[i]) return !0;
|
|
10439
10248
|
}
|
|
@@ -10589,8 +10398,7 @@
|
|
|
10589
10398
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
10590
10399
|
}), this.normalAttrs = newNormalAttrs;
|
|
10591
10400
|
}
|
|
10592
|
-
stopStateAnimates() {
|
|
10593
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
10401
|
+
stopStateAnimates(type = "end") {
|
|
10594
10402
|
this.animates && this.animates.forEach(animate => {
|
|
10595
10403
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
10596
10404
|
});
|
|
@@ -10754,8 +10562,7 @@
|
|
|
10754
10562
|
var _a;
|
|
10755
10563
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
10756
10564
|
}
|
|
10757
|
-
onSetStage(cb) {
|
|
10758
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10565
|
+
onSetStage(cb, immediate = !1) {
|
|
10759
10566
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
10760
10567
|
}
|
|
10761
10568
|
attachShadow(shadowRoot) {
|
|
@@ -10776,8 +10583,7 @@
|
|
|
10776
10583
|
createPathProxy(path) {
|
|
10777
10584
|
return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
10778
10585
|
}
|
|
10779
|
-
loadImage(image) {
|
|
10780
|
-
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
10586
|
+
loadImage(image, background = !1) {
|
|
10781
10587
|
if (!image || background && backgroundNotImage(image)) return;
|
|
10782
10588
|
const url = image;
|
|
10783
10589
|
this.resources || (this.resources = new Map());
|
|
@@ -10807,8 +10613,7 @@
|
|
|
10807
10613
|
animate.stop();
|
|
10808
10614
|
});
|
|
10809
10615
|
}
|
|
10810
|
-
stopAnimates() {
|
|
10811
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
10616
|
+
stopAnimates(stopChildren = !1) {
|
|
10812
10617
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
10813
10618
|
c.stopAnimates(stopChildren);
|
|
10814
10619
|
});
|
|
@@ -10956,8 +10761,7 @@
|
|
|
10956
10761
|
_updateChildToStage(child) {
|
|
10957
10762
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
10958
10763
|
}
|
|
10959
|
-
appendChild(node) {
|
|
10960
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
10764
|
+
appendChild(node, addStage = !0) {
|
|
10961
10765
|
const data = super.appendChild(node);
|
|
10962
10766
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
10963
10767
|
}
|
|
@@ -10974,8 +10778,7 @@
|
|
|
10974
10778
|
const data = super.removeChild(child);
|
|
10975
10779
|
return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
|
|
10976
10780
|
}
|
|
10977
|
-
removeAllChild() {
|
|
10978
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
10781
|
+
removeAllChild(deep = !1) {
|
|
10979
10782
|
this.forEachChildren(child => {
|
|
10980
10783
|
this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
10981
10784
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -10995,8 +10798,7 @@
|
|
|
10995
10798
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
10996
10799
|
});
|
|
10997
10800
|
}
|
|
10998
|
-
tryUpdateGlobalTransMatrix() {
|
|
10999
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
10801
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
11000
10802
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
11001
10803
|
if (this._globalTransMatrix) {
|
|
11002
10804
|
if (this.parent) {
|
|
@@ -11228,8 +11030,7 @@
|
|
|
11228
11030
|
function textDrawOffsetX(textAlign, width) {
|
|
11229
11031
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
11230
11032
|
}
|
|
11231
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
11232
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
11033
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
11233
11034
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
11234
11035
|
}
|
|
11235
11036
|
|
|
@@ -11456,10 +11257,7 @@
|
|
|
11456
11257
|
} else bbox.yOffset = -bbox.height;
|
|
11457
11258
|
return bbox;
|
|
11458
11259
|
}
|
|
11459
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
11460
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
11461
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
11462
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
11260
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
11463
11261
|
const {
|
|
11464
11262
|
lineWidth: lineWidth,
|
|
11465
11263
|
suffixPosition = "end",
|
|
@@ -11582,11 +11380,10 @@
|
|
|
11582
11380
|
get isMultiLine() {
|
|
11583
11381
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
11584
11382
|
}
|
|
11585
|
-
constructor(
|
|
11586
|
-
|
|
11587
|
-
|
|
11588
|
-
|
|
11589
|
-
};
|
|
11383
|
+
constructor(params = {
|
|
11384
|
+
text: "",
|
|
11385
|
+
fontSize: 16
|
|
11386
|
+
}) {
|
|
11590
11387
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
11591
11388
|
}
|
|
11592
11389
|
isValid() {
|
|
@@ -11918,12 +11715,10 @@
|
|
|
11918
11715
|
var _a;
|
|
11919
11716
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
11920
11717
|
}
|
|
11921
|
-
needUpdateTags(keys) {
|
|
11922
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
11718
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
11923
11719
|
return super.needUpdateTags(keys, k);
|
|
11924
11720
|
}
|
|
11925
|
-
needUpdateTag(key) {
|
|
11926
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
11721
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
11927
11722
|
return super.needUpdateTag(key, k);
|
|
11928
11723
|
}
|
|
11929
11724
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -11982,19 +11777,15 @@
|
|
|
11982
11777
|
|
|
11983
11778
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
11984
11779
|
let Symbol$1 = class Symbol extends Graphic {
|
|
11985
|
-
constructor(
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
};
|
|
11780
|
+
constructor(params = {
|
|
11781
|
+
symbolType: "circle"
|
|
11782
|
+
}) {
|
|
11989
11783
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
11990
11784
|
}
|
|
11991
11785
|
getParsedPath() {
|
|
11992
11786
|
return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
|
|
11993
11787
|
}
|
|
11994
|
-
getParsedPath2D() {
|
|
11995
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
11996
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
11997
|
-
let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
11788
|
+
getParsedPath2D(x = 0, y = 0, size = 1) {
|
|
11998
11789
|
let path = null;
|
|
11999
11790
|
try {
|
|
12000
11791
|
path = new Path2D();
|
|
@@ -12079,8 +11870,7 @@
|
|
|
12079
11870
|
|
|
12080
11871
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
12081
11872
|
let Line$1 = class Line extends Graphic {
|
|
12082
|
-
constructor() {
|
|
12083
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11873
|
+
constructor(params = {}) {
|
|
12084
11874
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
12085
11875
|
}
|
|
12086
11876
|
isValid() {
|
|
@@ -12875,8 +12665,7 @@
|
|
|
12875
12665
|
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);
|
|
12876
12666
|
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;
|
|
12877
12667
|
}
|
|
12878
|
-
deal(paragraph) {
|
|
12879
|
-
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
12668
|
+
deal(paragraph, singleLine = !1) {
|
|
12880
12669
|
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)));
|
|
12881
12670
|
}
|
|
12882
12671
|
cut(paragraph, singleLine) {
|
|
@@ -13813,8 +13602,7 @@
|
|
|
13813
13602
|
addUpdateShapeAndBoundsTag() {
|
|
13814
13603
|
super.addUpdateShapeAndBoundsTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag();
|
|
13815
13604
|
}
|
|
13816
|
-
tryUpdateGlobalTransMatrix() {
|
|
13817
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
13605
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
13818
13606
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
13819
13607
|
const m = this.transMatrix;
|
|
13820
13608
|
this._globalTransMatrix ? this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f) : this._globalTransMatrix = m.clone(), this.doUpdateGlobalMatrix(), clearTag && this.clearUpdateGlobalPositionTag();
|
|
@@ -14267,9 +14055,7 @@
|
|
|
14267
14055
|
const defaultArcBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
|
|
14268
14056
|
|
|
14269
14057
|
const halfPi = pi / 2;
|
|
14270
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
14271
|
-
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
14272
|
-
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
14058
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
14273
14059
|
let cornerRadius;
|
|
14274
14060
|
if (Array.isArray(roundCorner) && (edgeCb = roundCorner, roundCorner = !0), width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
14275
14061
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -14590,8 +14376,7 @@
|
|
|
14590
14376
|
doStroke: doStroke
|
|
14591
14377
|
};
|
|
14592
14378
|
}
|
|
14593
|
-
transform(graphic, graphicAttribute, context) {
|
|
14594
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
14379
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
14595
14380
|
const {
|
|
14596
14381
|
x = graphicAttribute.x,
|
|
14597
14382
|
y = graphicAttribute.y,
|
|
@@ -15271,7 +15056,7 @@
|
|
|
15271
15056
|
get length() {
|
|
15272
15057
|
return this.pools.length;
|
|
15273
15058
|
}
|
|
15274
|
-
release() {
|
|
15059
|
+
release(...params) {
|
|
15275
15060
|
this.pools = [];
|
|
15276
15061
|
}
|
|
15277
15062
|
}
|
|
@@ -15491,11 +15276,12 @@
|
|
|
15491
15276
|
DefaultCanvasTextRender = __decorate$p([injectable(), __param$i(0, inject(ContributionProvider)), __param$i(0, named(TextRenderContribution)), __metadata$j("design:paramtypes", [Object])], DefaultCanvasTextRender);
|
|
15492
15277
|
|
|
15493
15278
|
function drawPolygon(path, points, x, y) {
|
|
15494
|
-
|
|
15495
|
-
|
|
15279
|
+
if (points && points.length) {
|
|
15280
|
+
path.moveTo(points[0].x + x, points[0].y + y);
|
|
15281
|
+
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
15282
|
+
}
|
|
15496
15283
|
}
|
|
15497
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
15498
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
15284
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
15499
15285
|
var _a;
|
|
15500
15286
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
15501
15287
|
let startI = 0,
|
|
@@ -15771,8 +15557,7 @@
|
|
|
15771
15557
|
Factory._pluginClasses = {};
|
|
15772
15558
|
|
|
15773
15559
|
class DirectionalLight {
|
|
15774
|
-
constructor(dir, color) {
|
|
15775
|
-
let ambient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .8;
|
|
15560
|
+
constructor(dir, color, ambient = .8) {
|
|
15776
15561
|
this.dir = dir, this.color = color, this.colorRgb = ColorStore.Get(color, ColorType.Color1), this.ambient = ambient;
|
|
15777
15562
|
const length = sqrt$1(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
|
|
15778
15563
|
this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
|
|
@@ -17952,9 +17737,10 @@
|
|
|
17952
17737
|
function noop() {}
|
|
17953
17738
|
class Step {
|
|
17954
17739
|
constructor(type, props, duration, easing) {
|
|
17740
|
+
var _a;
|
|
17955
17741
|
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
17956
17742
|
this.target.setAttributes(this.target.attribute);
|
|
17957
|
-
}, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : Easing[easing] : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
|
|
17743
|
+
}, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : null !== (_a = Easing[easing]) && void 0 !== _a ? _a : Easing.linear : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
|
|
17958
17744
|
}
|
|
17959
17745
|
bind(target, animate) {
|
|
17960
17746
|
this.target = target, this.animate = animate, this.onBind(), this.syncAttributeUpdate();
|
|
@@ -17971,8 +17757,7 @@
|
|
|
17971
17757
|
getLastProps() {
|
|
17972
17758
|
return this.prev ? this.prev.props || {} : this.animate.getStartProps();
|
|
17973
17759
|
}
|
|
17974
|
-
setDuration(duration) {
|
|
17975
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
17760
|
+
setDuration(duration, updateDownstream = !0) {
|
|
17976
17761
|
this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
|
|
17977
17762
|
}
|
|
17978
17763
|
getDuration() {
|
|
@@ -17993,8 +17778,7 @@
|
|
|
17993
17778
|
} else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
|
|
17994
17779
|
}), this.interpolateUpdateFunctions = funcs;
|
|
17995
17780
|
}
|
|
17996
|
-
setStartTime(time) {
|
|
17997
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
17781
|
+
setStartTime(time, updateDownstream = !0) {
|
|
17998
17782
|
this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
|
|
17999
17783
|
}
|
|
18000
17784
|
getStartTime() {
|
|
@@ -18120,8 +17904,7 @@
|
|
|
18120
17904
|
animate.release();
|
|
18121
17905
|
}), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
|
|
18122
17906
|
}
|
|
18123
|
-
removeAnimate(animate) {
|
|
18124
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
17907
|
+
removeAnimate(animate, release = !0) {
|
|
18125
17908
|
const node = this.animateMap.get(animate);
|
|
18126
17909
|
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());
|
|
18127
17910
|
}
|
|
@@ -18159,10 +17942,7 @@
|
|
|
18159
17942
|
defaultTimeline.isGlobal = !0;
|
|
18160
17943
|
|
|
18161
17944
|
class Animate {
|
|
18162
|
-
constructor() {
|
|
18163
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
18164
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
18165
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
17945
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
18166
17946
|
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;
|
|
18167
17947
|
}
|
|
18168
17948
|
getStartProps() {
|
|
@@ -18183,9 +17963,7 @@
|
|
|
18183
17963
|
bind(target) {
|
|
18184
17964
|
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
18185
17965
|
}
|
|
18186
|
-
to(props) {
|
|
18187
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
18188
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
17966
|
+
to(props, duration = 300, easing = "linear") {
|
|
18189
17967
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
18190
17968
|
return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
|
|
18191
17969
|
}
|
|
@@ -18215,9 +17993,7 @@
|
|
|
18215
17993
|
this._endProps[key] = currentStep.props[key];
|
|
18216
17994
|
}), currentStep = currentStep.next;
|
|
18217
17995
|
}
|
|
18218
|
-
from(props) {
|
|
18219
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
18220
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
17996
|
+
from(props, duration = 300, easing = "linear") {
|
|
18221
17997
|
const step = new Step(AnimateStepType.from, props, duration, easing);
|
|
18222
17998
|
return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
|
|
18223
17999
|
}
|
|
@@ -18455,8 +18231,7 @@
|
|
|
18455
18231
|
}
|
|
18456
18232
|
return !1;
|
|
18457
18233
|
}
|
|
18458
|
-
start() {
|
|
18459
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
18234
|
+
start(force = !1) {
|
|
18460
18235
|
if (this.status === STATUS.RUNNING) return !1;
|
|
18461
18236
|
if (!this.tickerHandler) return !1;
|
|
18462
18237
|
if (!force) {
|
|
@@ -18816,14 +18591,10 @@
|
|
|
18816
18591
|
var _a, _b;
|
|
18817
18592
|
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;
|
|
18818
18593
|
}
|
|
18819
|
-
executeItem(params, graphic) {
|
|
18820
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
18821
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
18594
|
+
executeItem(params, graphic, index = 0, count = 1) {
|
|
18822
18595
|
return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
|
|
18823
18596
|
}
|
|
18824
|
-
_executeItem(params, graphic) {
|
|
18825
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
18826
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
18597
|
+
_executeItem(params, graphic, index = 0, count = 1) {
|
|
18827
18598
|
if (!graphic) return null;
|
|
18828
18599
|
const isTimeline = ("timeSlices" in params);
|
|
18829
18600
|
let animate = null;
|
|
@@ -18991,8 +18762,7 @@
|
|
|
18991
18762
|
}
|
|
18992
18763
|
|
|
18993
18764
|
class AnimateExtension {
|
|
18994
|
-
getAttributes() {
|
|
18995
|
-
let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
18765
|
+
getAttributes(final = !1) {
|
|
18996
18766
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
18997
18767
|
}
|
|
18998
18768
|
animate(params) {
|
|
@@ -19017,10 +18787,10 @@
|
|
|
19017
18787
|
createTicker(stage) {
|
|
19018
18788
|
return new DefaultTicker(stage);
|
|
19019
18789
|
}
|
|
19020
|
-
|
|
18790
|
+
setFinalAttributes(finalAttribute) {
|
|
19021
18791
|
this.finalAttribute || (this.finalAttribute = {}), Object.assign(this.finalAttribute, finalAttribute);
|
|
19022
18792
|
}
|
|
19023
|
-
|
|
18793
|
+
initFinalAttributes(finalAttribute) {
|
|
19024
18794
|
this.finalAttribute = finalAttribute;
|
|
19025
18795
|
}
|
|
19026
18796
|
initAnimateExecutor() {
|
|
@@ -19037,8 +18807,7 @@
|
|
|
19037
18807
|
getFinalAttribute() {
|
|
19038
18808
|
return this.finalAttribute;
|
|
19039
18809
|
}
|
|
19040
|
-
getGraphicAttribute(key) {
|
|
19041
|
-
let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
18810
|
+
getGraphicAttribute(key, prev = !1) {
|
|
19042
18811
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
19043
18812
|
}
|
|
19044
18813
|
}
|
|
@@ -19062,25 +18831,32 @@
|
|
|
19062
18831
|
}
|
|
19063
18832
|
|
|
19064
18833
|
class RotateBySphereAnimate extends ACustomAnimate {
|
|
18834
|
+
onBind() {
|
|
18835
|
+
super.onBind(), this.propKeys = ["x", "y", "z", "alpha", "zIndex"];
|
|
18836
|
+
}
|
|
18837
|
+
onFirstRun() {
|
|
18838
|
+
super.onFirstRun();
|
|
18839
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
18840
|
+
finalAttribute && this.target.setAttributes(finalAttribute);
|
|
18841
|
+
}
|
|
19065
18842
|
onStart() {
|
|
18843
|
+
super.onStart();
|
|
19066
18844
|
const {
|
|
19067
18845
|
center: center,
|
|
19068
18846
|
r: r
|
|
19069
18847
|
} = "function" == typeof this.params ? this.params() : this.params,
|
|
19070
|
-
startX = this.target.
|
|
19071
|
-
startY = this.target.
|
|
19072
|
-
startZ = this.target.
|
|
18848
|
+
startX = this.target.finalAttribute.x,
|
|
18849
|
+
startY = this.target.finalAttribute.y,
|
|
18850
|
+
startZ = this.target.finalAttribute.z,
|
|
19073
18851
|
phi = Math.acos((startY - center.y) / r);
|
|
19074
18852
|
let theta = Math.acos((startX - center.x) / r / Math.sin(phi));
|
|
19075
18853
|
startZ - center.z < 0 && (theta = pi2 - theta), this.theta = theta, this.phi = phi;
|
|
19076
18854
|
}
|
|
19077
|
-
onBind() {
|
|
19078
|
-
super.onBind();
|
|
19079
|
-
}
|
|
19080
18855
|
onEnd() {}
|
|
19081
18856
|
onUpdate(end, ratio, out) {
|
|
19082
18857
|
if (null == this.phi || null == this.theta) return;
|
|
19083
|
-
const
|
|
18858
|
+
const target = this.target,
|
|
18859
|
+
{
|
|
19084
18860
|
center: center,
|
|
19085
18861
|
r: r,
|
|
19086
18862
|
cb: cb
|
|
@@ -19091,8 +18867,8 @@
|
|
|
19091
18867
|
x = r * Math.sin(phi) * Math.cos(theta) + center.x,
|
|
19092
18868
|
y = r * Math.cos(phi) + center.y,
|
|
19093
18869
|
z = r * Math.sin(phi) * Math.sin(theta) + center.z;
|
|
19094
|
-
for (
|
|
19095
|
-
|
|
18870
|
+
for (target.attribute.x = x, target.attribute.y = y, target.attribute.z = z, target.attribute.alpha = theta + pi / 2; target.attribute.alpha > pi2;) target.attribute.alpha -= pi2;
|
|
18871
|
+
target.attribute.alpha = pi2 - target.attribute.alpha, target.attribute.zIndex = -1e4 * target.attribute.z, cb && cb(out);
|
|
19096
18872
|
}
|
|
19097
18873
|
}
|
|
19098
18874
|
|
|
@@ -19107,7 +18883,7 @@
|
|
|
19107
18883
|
};
|
|
19108
18884
|
const registerWordCloud3dAnimation = () => {
|
|
19109
18885
|
vchart.Factory.registerAnimation('wordCloud3d', (params) => ({
|
|
19110
|
-
|
|
18886
|
+
appear: WordCloud3dAnimation(params)
|
|
19111
18887
|
}));
|
|
19112
18888
|
};
|
|
19113
18889
|
|
|
@@ -19210,6 +18986,12 @@
|
|
|
19210
18986
|
registerWordCloud3dChart();
|
|
19211
18987
|
};
|
|
19212
18988
|
|
|
18989
|
+
const axisZ = {
|
|
18990
|
+
label: {
|
|
18991
|
+
space: 0
|
|
18992
|
+
}
|
|
18993
|
+
};
|
|
18994
|
+
|
|
19213
18995
|
const getUpdateAttributeOfZAxis = (axis, ignoreGrid) => {
|
|
19214
18996
|
var _a;
|
|
19215
18997
|
const regionSize = vchart.getCombinedSizeOfRegions(axis.getRegions());
|
|
@@ -19255,104 +19037,52 @@
|
|
|
19255
19037
|
return attrs;
|
|
19256
19038
|
};
|
|
19257
19039
|
|
|
19258
|
-
|
|
19259
|
-
label: {
|
|
19260
|
-
space: 0
|
|
19261
|
-
}
|
|
19262
|
-
};
|
|
19263
|
-
|
|
19264
|
-
class CartesianBandAxis3d extends vchart.CartesianBandAxis {
|
|
19040
|
+
class Axis3dMixin {
|
|
19265
19041
|
setLayout3dBox(box3d) {
|
|
19266
19042
|
this.layout3dBox = box3d;
|
|
19267
19043
|
}
|
|
19268
|
-
|
|
19044
|
+
_afterUpdateAttribute(attrs, ignoreGrid) {
|
|
19269
19045
|
const isZ = vchart.isZAxis(this._orient);
|
|
19270
19046
|
if (!isZ) {
|
|
19271
|
-
return
|
|
19047
|
+
return attrs;
|
|
19272
19048
|
}
|
|
19273
19049
|
return getUpdateAttributeOfZAxis(this, ignoreGrid);
|
|
19274
19050
|
}
|
|
19275
19051
|
}
|
|
19276
|
-
|
|
19277
|
-
mixin(CartesianBandAxis3d, vchart.BandAxisMixin);
|
|
19052
|
+
|
|
19278
19053
|
const registerCartesianBandAxis3d = () => {
|
|
19279
|
-
vchart.
|
|
19054
|
+
vchart.registerCartesianBandAxis();
|
|
19055
|
+
const AxisCls = vchart.Factory.getComponentInKey(vchart.CartesianBandAxis.type);
|
|
19056
|
+
AxisCls.builtInTheme = Object.assign(Object.assign({}, AxisCls.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianBandAxis.builtInTheme.axisX), axisZ) });
|
|
19057
|
+
mixin(AxisCls, Axis3dMixin);
|
|
19280
19058
|
};
|
|
19281
19059
|
|
|
19282
|
-
class CartesianLinearAxis3d extends vchart.CartesianLinearAxis {
|
|
19283
|
-
setLayout3dBox(box3d) {
|
|
19284
|
-
this.layout3dBox = box3d;
|
|
19285
|
-
}
|
|
19286
|
-
_getUpdateAttribute(ignoreGrid) {
|
|
19287
|
-
const isZ = vchart.isZAxis(this._orient);
|
|
19288
|
-
if (!isZ) {
|
|
19289
|
-
const attrs = super._getUpdateAttribute(ignoreGrid);
|
|
19290
|
-
if (!ignoreGrid) {
|
|
19291
|
-
attrs.grid.depth = this.layout3dBox ? this.layout3dBox.length : 0;
|
|
19292
|
-
}
|
|
19293
|
-
return attrs;
|
|
19294
|
-
}
|
|
19295
|
-
return getUpdateAttributeOfZAxis(this, ignoreGrid);
|
|
19296
|
-
}
|
|
19297
|
-
}
|
|
19298
|
-
CartesianLinearAxis3d.builtInTheme = Object.assign(Object.assign({}, vchart.CartesianLinearAxis.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianLinearAxis.builtInTheme.axisX), axisZ) });
|
|
19299
|
-
mixin(CartesianLinearAxis3d, vchart.LinearAxisMixin);
|
|
19300
19060
|
const registerCartesianLinearAxis3d = () => {
|
|
19301
|
-
vchart.
|
|
19061
|
+
vchart.registerCartesianLinearAxis();
|
|
19062
|
+
const AxisCls = vchart.Factory.getComponentInKey(vchart.CartesianLinearAxis.type);
|
|
19063
|
+
AxisCls.builtInTheme = Object.assign(Object.assign({}, AxisCls.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianLinearAxis.builtInTheme.axisX), axisZ) });
|
|
19064
|
+
mixin(AxisCls, Axis3dMixin);
|
|
19302
19065
|
};
|
|
19303
19066
|
|
|
19304
|
-
class CartesianLogAxis3d extends vchart.CartesianLogAxis {
|
|
19305
|
-
setLayout3dBox(box3d) {
|
|
19306
|
-
this.layout3dBox = box3d;
|
|
19307
|
-
}
|
|
19308
|
-
_getUpdateAttribute(ignoreGrid) {
|
|
19309
|
-
const isZ = vchart.isZAxis(this._orient);
|
|
19310
|
-
if (!isZ) {
|
|
19311
|
-
return super._getUpdateAttribute(ignoreGrid);
|
|
19312
|
-
}
|
|
19313
|
-
return getUpdateAttributeOfZAxis(this, ignoreGrid);
|
|
19314
|
-
}
|
|
19315
|
-
}
|
|
19316
|
-
CartesianLogAxis3d.builtInTheme = Object.assign(Object.assign({}, vchart.CartesianLogAxis.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianLogAxis.builtInTheme.axisX), axisZ) });
|
|
19317
|
-
mixin(CartesianLogAxis3d, vchart.LinearAxisMixin);
|
|
19318
19067
|
const registerCartesianLogAxis3d = () => {
|
|
19319
|
-
vchart.
|
|
19068
|
+
vchart.registerCartesianLogAxis();
|
|
19069
|
+
const AxisCls = vchart.Factory.getComponentInKey(vchart.CartesianLogAxis.type);
|
|
19070
|
+
AxisCls.builtInTheme = Object.assign(Object.assign({}, AxisCls.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianLogAxis.builtInTheme.axisX), axisZ) });
|
|
19071
|
+
mixin(AxisCls, Axis3dMixin);
|
|
19320
19072
|
};
|
|
19321
19073
|
|
|
19322
|
-
class CartesianSymlogAxis3d extends vchart.CartesianSymlogAxis {
|
|
19323
|
-
setLayout3dBox(box3d) {
|
|
19324
|
-
this.layout3dBox = box3d;
|
|
19325
|
-
}
|
|
19326
|
-
_getUpdateAttribute(ignoreGrid) {
|
|
19327
|
-
const isZ = vchart.isZAxis(this._orient);
|
|
19328
|
-
if (!isZ) {
|
|
19329
|
-
return super._getUpdateAttribute(ignoreGrid);
|
|
19330
|
-
}
|
|
19331
|
-
return getUpdateAttributeOfZAxis(this, ignoreGrid);
|
|
19332
|
-
}
|
|
19333
|
-
}
|
|
19334
|
-
CartesianSymlogAxis3d.builtInTheme = Object.assign(Object.assign({}, vchart.CartesianSymlogAxis.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianSymlogAxis.builtInTheme.axisX), axisZ) });
|
|
19335
|
-
mixin(CartesianSymlogAxis3d, vchart.LinearAxisMixin);
|
|
19336
19074
|
const registerCartesianSymlogAxis3d = () => {
|
|
19337
|
-
vchart.
|
|
19075
|
+
vchart.registerCartesianLogAxis();
|
|
19076
|
+
const AxisCls = vchart.Factory.getComponentInKey(vchart.CartesianSymlogAxis.type);
|
|
19077
|
+
AxisCls.builtInTheme = Object.assign(Object.assign({}, AxisCls.builtInTheme), { axisZ: Object.assign(Object.assign({}, AxisCls.builtInTheme.axisX), axisZ) });
|
|
19078
|
+
mixin(AxisCls, Axis3dMixin);
|
|
19338
19079
|
};
|
|
19339
19080
|
|
|
19340
|
-
class CartesianTimeAxis3d extends vchart.CartesianTimeAxis {
|
|
19341
|
-
setLayout3dBox(box3d) {
|
|
19342
|
-
this.layout3dBox = box3d;
|
|
19343
|
-
}
|
|
19344
|
-
_getUpdateAttribute(ignoreGrid) {
|
|
19345
|
-
const isZ = vchart.isZAxis(this._orient);
|
|
19346
|
-
if (!isZ) {
|
|
19347
|
-
return super._getUpdateAttribute(ignoreGrid);
|
|
19348
|
-
}
|
|
19349
|
-
return getUpdateAttributeOfZAxis(this, ignoreGrid);
|
|
19350
|
-
}
|
|
19351
|
-
}
|
|
19352
|
-
CartesianTimeAxis3d.builtInTheme = Object.assign(Object.assign({}, vchart.CartesianTimeAxis.builtInTheme), { axisZ: Object.assign(Object.assign({}, vchart.CartesianTimeAxis.builtInTheme.axisX), axisZ) });
|
|
19353
|
-
mixin(CartesianTimeAxis3d, vchart.LinearAxisMixin);
|
|
19354
19081
|
const registerCartesianTimeAxis3d = () => {
|
|
19355
|
-
vchart.
|
|
19082
|
+
vchart.registerCartesianTimeAxis();
|
|
19083
|
+
const AxisCls = vchart.Factory.getComponentInKey(vchart.CartesianTimeAxis.type);
|
|
19084
|
+
AxisCls.builtInTheme = Object.assign(Object.assign({}, AxisCls.builtInTheme), { axisZ: Object.assign(Object.assign({}, AxisCls.builtInTheme.axisX), axisZ) });
|
|
19085
|
+
mixin(AxisCls, Axis3dMixin);
|
|
19356
19086
|
};
|
|
19357
19087
|
|
|
19358
19088
|
const registerAxis3dPlugin = () => {
|
|
@@ -20345,9 +20075,7 @@
|
|
|
20345
20075
|
return [0, 1, 2, 3].every(i => invert ? imageData.data[4 * (y * width + x) + i] !== bgPixel[i] : imageData.data[4 * (y * width + x) + i] === bgPixel[i]);
|
|
20346
20076
|
};
|
|
20347
20077
|
};
|
|
20348
|
-
const generateMaskCanvas =
|
|
20349
|
-
let invert = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
20350
|
-
let createCanvas = arguments.length > 5 ? arguments[5] : undefined;
|
|
20078
|
+
const generateMaskCanvas = (shape, width, height, cacheCanvas, invert = !1, createCanvas) => {
|
|
20351
20079
|
let {
|
|
20352
20080
|
backgroundColor = "#fff"
|
|
20353
20081
|
} = shape,
|
|
@@ -20390,15 +20118,11 @@
|
|
|
20390
20118
|
ctx.fillText(text, width / 2, height / 2), ctx.scale(scale, scale);
|
|
20391
20119
|
} else baseFontSize = Math.floor(baseFontSize * width / textWidth), baseFontSize = Math.min(baseFontSize, height), ctx.font = `${fontStyle} ${fontVariant} ${fontWeight} ${baseFontSize}px ${fontFamily}`, ctx.fillText(text, Math.floor(width / 2), Math.floor(height / 2));
|
|
20392
20120
|
};
|
|
20393
|
-
const generatePoints =
|
|
20394
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
20395
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
20121
|
+
const generatePoints = (center, radius, startAngle = 0, count) => {
|
|
20396
20122
|
const angle = 2 * Math.PI / count;
|
|
20397
20123
|
return new Array(count).fill(0).map((entry, index) => polarToCartesian(center, radius, startAngle + index * angle));
|
|
20398
20124
|
};
|
|
20399
|
-
const generateCardioidPoints =
|
|
20400
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
20401
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
20125
|
+
const generateCardioidPoints = (center, radius, startAngle = 0, count) => {
|
|
20402
20126
|
const angle = 2 * Math.PI / count,
|
|
20403
20127
|
func = getShapeFunction("cardioid");
|
|
20404
20128
|
return new Array(count).fill(0).map((entry, index) => {
|
|
@@ -20589,8 +20313,7 @@
|
|
|
20589
20313
|
}
|
|
20590
20314
|
return result;
|
|
20591
20315
|
}
|
|
20592
|
-
function drawContour(labels, boundaryPixels, width, height) {
|
|
20593
|
-
let thickness = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
20316
|
+
function drawContour(labels, boundaryPixels, width, height, thickness = 1) {
|
|
20594
20317
|
const result = new Array(labels.length).fill(0);
|
|
20595
20318
|
for (const [i, j] of boundaryPixels) if (result[i * width + j] = 1, thickness > 1) for (let di = 1 - thickness; di <= thickness - 1; di++) for (let dj = 1 - thickness; dj <= thickness - 1; dj++) {
|
|
20596
20319
|
if (Math.sqrt(di * di + dj * dj) < thickness) {
|
|
@@ -20780,9 +20503,7 @@
|
|
|
20780
20503
|
}
|
|
20781
20504
|
|
|
20782
20505
|
class ContinuousScale extends BaseScale {
|
|
20783
|
-
constructor() {
|
|
20784
|
-
let transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : identity;
|
|
20785
|
-
let untransformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
20506
|
+
constructor(transformer = identity, untransformer = identity) {
|
|
20786
20507
|
super(), this._unknown = void 0, this.transformer = transformer, this.untransformer = untransformer, this._forceAlign = !0, this._domain = [0, 1], this._range = [0, 1], this._clamp = identity, this._piecewise = bimap, this._interpolate = interpolate;
|
|
20787
20508
|
}
|
|
20788
20509
|
calculateVisibleDomain(range) {
|
|
@@ -20844,11 +20565,10 @@
|
|
|
20844
20565
|
interpolate(_, slience) {
|
|
20845
20566
|
return arguments.length ? (this._interpolate = _, this.rescale(slience)) : this._interpolate;
|
|
20846
20567
|
}
|
|
20847
|
-
ticks() {
|
|
20568
|
+
ticks(count = 10) {
|
|
20848
20569
|
return [];
|
|
20849
20570
|
}
|
|
20850
|
-
tickData() {
|
|
20851
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
20571
|
+
tickData(count = 10) {
|
|
20852
20572
|
const ticks = this.ticks(count);
|
|
20853
20573
|
return (null != ticks ? ticks : []).map((tick, index) => ({
|
|
20854
20574
|
index: index,
|
|
@@ -21002,8 +20722,7 @@
|
|
|
21002
20722
|
for (; ++i < count;) ticks[i] = start + i * step;
|
|
21003
20723
|
return reverse && ticks.reverse(), ticks;
|
|
21004
20724
|
}
|
|
21005
|
-
function niceLinear(d) {
|
|
21006
|
-
let count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
20725
|
+
function niceLinear(d, count = 10) {
|
|
21007
20726
|
let prestep,
|
|
21008
20727
|
step,
|
|
21009
20728
|
i0 = 0,
|
|
@@ -21047,15 +20766,11 @@
|
|
|
21047
20766
|
tickFormat() {
|
|
21048
20767
|
return () => {};
|
|
21049
20768
|
}
|
|
21050
|
-
d3Ticks() {
|
|
21051
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
21052
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
20769
|
+
d3Ticks(count = 10, options) {
|
|
21053
20770
|
const d = this.calculateVisibleDomain(this._range);
|
|
21054
20771
|
return d3Ticks(d[0], d[d.length - 1], count, options);
|
|
21055
20772
|
}
|
|
21056
|
-
ticks() {
|
|
21057
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
21058
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
20773
|
+
ticks(count = 10, options) {
|
|
21059
20774
|
var _a;
|
|
21060
20775
|
if (isFunction$1(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
|
|
21061
20776
|
if (isValid$1(this._rangeFactorStart) && isValid$1(this._rangeFactorEnd) && (this._rangeFactorStart > 0 || this._rangeFactorEnd < 1) && 2 === this._range.length || !this._niceType) return this.d3Ticks(count, options);
|
|
@@ -21075,8 +20790,7 @@
|
|
|
21075
20790
|
}
|
|
21076
20791
|
return ticksResult;
|
|
21077
20792
|
}
|
|
21078
|
-
forceTicks() {
|
|
21079
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
20793
|
+
forceTicks(count = 10) {
|
|
21080
20794
|
const d = this.calculateVisibleDomain(this._range);
|
|
21081
20795
|
return forceTicks(d[0], d[d.length - 1], count);
|
|
21082
20796
|
}
|
|
@@ -21084,9 +20798,7 @@
|
|
|
21084
20798
|
const d = this.calculateVisibleDomain(this._range);
|
|
21085
20799
|
return stepTicks(d[0], d[d.length - 1], step);
|
|
21086
20800
|
}
|
|
21087
|
-
nice() {
|
|
21088
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
21089
|
-
let option = arguments.length > 1 ? arguments[1] : undefined;
|
|
20801
|
+
nice(count = 10, option) {
|
|
21090
20802
|
var _a, _b;
|
|
21091
20803
|
const originalDomain = this._domain;
|
|
21092
20804
|
let niceMinMax = [];
|
|
@@ -21100,15 +20812,13 @@
|
|
|
21100
20812
|
}
|
|
21101
20813
|
return this;
|
|
21102
20814
|
}
|
|
21103
|
-
niceMin() {
|
|
21104
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
20815
|
+
niceMin(count = 10) {
|
|
21105
20816
|
this._niceType = "min";
|
|
21106
20817
|
const maxD = this._domain[this._domain.length - 1],
|
|
21107
20818
|
niceDomain = niceLinear(this.domain(), count);
|
|
21108
20819
|
return niceDomain && (niceDomain[niceDomain.length - 1] = maxD, this._niceDomain = niceDomain, this.rescale()), this;
|
|
21109
20820
|
}
|
|
21110
|
-
niceMax() {
|
|
21111
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
20821
|
+
niceMax(count = 10) {
|
|
21112
20822
|
this._niceType = "max";
|
|
21113
20823
|
const minD = this._domain[0],
|
|
21114
20824
|
niceDomain = niceLinear(this._domain.slice(), count);
|
|
@@ -21259,9 +20969,7 @@
|
|
|
21259
20969
|
release() {
|
|
21260
20970
|
this.segmentationInput = null, this.data = null, this.progressiveResult = null, this.options = null;
|
|
21261
20971
|
}
|
|
21262
|
-
calculateImageSize(images) {
|
|
21263
|
-
let imageConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
21264
|
-
let ratio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .45;
|
|
20972
|
+
calculateImageSize(images, imageConfig = {}, ratio = .45) {
|
|
21265
20973
|
const {
|
|
21266
20974
|
imageSizeRange: imageSizeRange,
|
|
21267
20975
|
padding = 0
|
|
@@ -21334,8 +21042,7 @@
|
|
|
21334
21042
|
} = this.options;
|
|
21335
21043
|
return this.calculateImageSize(images, imageConfig, ratio);
|
|
21336
21044
|
}
|
|
21337
|
-
tryPlaceImage(image, size, spiralType, segmentationOutput, fixedImages) {
|
|
21338
|
-
let dt = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
21045
|
+
tryPlaceImage(image, size, spiralType, segmentationOutput, fixedImages, dt = 1) {
|
|
21339
21046
|
const [width, height] = size,
|
|
21340
21047
|
centerX = width / 2,
|
|
21341
21048
|
centerY = height / 2,
|
|
@@ -22251,8 +21958,7 @@
|
|
|
22251
21958
|
};
|
|
22252
21959
|
}
|
|
22253
21960
|
|
|
22254
|
-
function measureTextSize(text, textSpec) {
|
|
22255
|
-
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
21961
|
+
function measureTextSize(text, textSpec, defaultTextTheme = {}) {
|
|
22256
21962
|
if (!text) return {
|
|
22257
21963
|
width: 0,
|
|
22258
21964
|
height: 0
|
|
@@ -22273,12 +21979,10 @@
|
|
|
22273
21979
|
height: bounds.height()
|
|
22274
21980
|
};
|
|
22275
21981
|
}
|
|
22276
|
-
function isRichText(attributes) {
|
|
22277
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
21982
|
+
function isRichText(attributes, typeKey = "type") {
|
|
22278
21983
|
return "rich" === getTextType(attributes, typeKey);
|
|
22279
21984
|
}
|
|
22280
|
-
function getTextType(attributes) {
|
|
22281
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
21985
|
+
function getTextType(attributes, typeKey = "type") {
|
|
22282
21986
|
var _a, _b;
|
|
22283
21987
|
return isObject$1(attributes.text) && "type" in attributes.text ? null !== (_a = attributes.text.type) && void 0 !== _a ? _a : "text" : typeKey in attributes && null !== (_b = attributes[typeKey]) && void 0 !== _b ? _b : "text";
|
|
22284
21988
|
}
|