@visactor/vchart 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/es5/index.js +4 -2
- package/build/index.es.js +581 -1168
- package/build/index.js +581 -1168
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -2
- package/cjs/chart/base/base-chart.js +0 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +1 -2
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/util.js +2 -1
- package/cjs/compile/compiler.js +2 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +0 -1
- package/cjs/component/axis/base-axis.js +0 -3
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +0 -5
- package/cjs/component/axis/cartesian/axis.js +1 -5
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/polar/axis.d.ts +0 -2
- package/cjs/component/axis/polar/axis.js +0 -2
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +1 -3
- package/cjs/component/base/base-component.js +1 -7
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +1 -3
- package/cjs/component/brush/brush.js +0 -2
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/base.d.ts +0 -4
- package/cjs/component/crosshair/base.js +0 -2
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +0 -6
- package/cjs/component/custom-mark/custom-mark.js +0 -5
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +0 -4
- package/cjs/component/data-zoom/data-filter-base-component.js +7 -10
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/util.d.ts +1 -0
- package/cjs/component/data-zoom/util.js +8 -5
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.d.ts +2 -6
- package/cjs/component/geo/geo-coordinate.js +0 -5
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/indicator/indicator.d.ts +0 -3
- package/cjs/component/indicator/indicator.js +0 -2
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/interface/common.d.ts +0 -1
- package/cjs/component/interface/common.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +2 -6
- package/cjs/component/label/base-label.js +11 -4
- package/cjs/component/label/base-label.js.map +1 -1
- package/cjs/component/label/label.d.ts +0 -1
- package/cjs/component/label/label.js +1 -8
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/total-label.d.ts +0 -1
- package/cjs/component/label/total-label.js +1 -8
- package/cjs/component/label/total-label.js.map +1 -1
- package/cjs/component/legend/base-legend.d.ts +0 -3
- package/cjs/component/legend/base-legend.js +0 -2
- package/cjs/component/legend/base-legend.js.map +1 -1
- package/cjs/component/marker/base-marker.d.ts +1 -4
- package/cjs/component/marker/base-marker.js +0 -2
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/component/player/player.d.ts +0 -4
- package/cjs/component/player/player.js +1 -6
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/title/title.d.ts +0 -5
- package/cjs/component/title/title.js +0 -4
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +0 -6
- package/cjs/component/tooltip/tooltip.js +0 -5
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/util.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/mark/base/base-mark.d.ts +1 -0
- package/cjs/mark/base/base-mark.js +6 -5
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/component.js +1 -1
- package/cjs/mark/component.js.map +1 -1
- package/cjs/mark/group.d.ts +1 -1
- package/cjs/mark/group.js +3 -3
- package/cjs/mark/group.js.map +1 -1
- package/cjs/mark/interface/common.d.ts +1 -0
- package/cjs/mark/interface/common.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -2
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +0 -1
- package/cjs/model/interface.js.map +1 -1
- package/cjs/region/region.d.ts +0 -1
- package/cjs/region/region.js +0 -1
- package/cjs/region/region.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +1 -2
- package/cjs/series/base/base-series.js +0 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/funnel/funnel.js +16 -2
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/liquid/liquid.js +1 -1
- package/cjs/series/liquid/liquid.js.map +1 -1
- package/cjs/series/rose/animation.js +14 -7
- package/cjs/series/rose/animation.js.map +1 -1
- package/cjs/series/word-cloud/base.js +3 -1
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -2
- package/esm/chart/base/base-chart.js +0 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +1 -2
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/util.js +2 -1
- package/esm/compile/compiler.js +2 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +0 -1
- package/esm/component/axis/base-axis.js +0 -3
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +0 -5
- package/esm/component/axis/cartesian/axis.js +1 -5
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/polar/axis.d.ts +0 -2
- package/esm/component/axis/polar/axis.js +0 -2
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/base/base-component.d.ts +1 -3
- package/esm/component/base/base-component.js +1 -7
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/brush/brush.d.ts +1 -3
- package/esm/component/brush/brush.js +0 -2
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/base.d.ts +0 -4
- package/esm/component/crosshair/base.js +0 -2
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +0 -6
- package/esm/component/custom-mark/custom-mark.js +0 -5
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +0 -4
- package/esm/component/data-zoom/data-filter-base-component.js +6 -8
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/util.d.ts +1 -0
- package/esm/component/data-zoom/util.js +8 -5
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/geo/geo-coordinate.d.ts +2 -6
- package/esm/component/geo/geo-coordinate.js +0 -5
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/indicator/indicator.d.ts +0 -3
- package/esm/component/indicator/indicator.js +0 -2
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/interface/common.d.ts +0 -1
- package/esm/component/interface/common.js.map +1 -1
- package/esm/component/label/base-label.d.ts +2 -6
- package/esm/component/label/base-label.js +11 -4
- package/esm/component/label/base-label.js.map +1 -1
- package/esm/component/label/label.d.ts +0 -1
- package/esm/component/label/label.js +1 -8
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/total-label.d.ts +0 -1
- package/esm/component/label/total-label.js +1 -8
- package/esm/component/label/total-label.js.map +1 -1
- package/esm/component/legend/base-legend.d.ts +0 -3
- package/esm/component/legend/base-legend.js +0 -2
- package/esm/component/legend/base-legend.js.map +1 -1
- package/esm/component/marker/base-marker.d.ts +1 -4
- package/esm/component/marker/base-marker.js +0 -2
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/component/player/player.d.ts +0 -4
- package/esm/component/player/player.js +1 -6
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/title/title.d.ts +0 -5
- package/esm/component/title/title.js +0 -4
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +0 -6
- package/esm/component/tooltip/tooltip.js +0 -5
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/util.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/mark/base/base-mark.d.ts +1 -0
- package/esm/mark/base/base-mark.js +6 -5
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/component.js +1 -1
- package/esm/mark/component.js.map +1 -1
- package/esm/mark/group.d.ts +1 -1
- package/esm/mark/group.js +3 -3
- package/esm/mark/group.js.map +1 -1
- package/esm/mark/interface/common.d.ts +1 -0
- package/esm/mark/interface/common.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -2
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +0 -1
- package/esm/model/interface.js.map +1 -1
- package/esm/region/region.d.ts +0 -1
- package/esm/region/region.js +0 -1
- package/esm/region/region.js.map +1 -1
- package/esm/series/base/base-series.d.ts +1 -2
- package/esm/series/base/base-series.js +0 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/funnel/funnel.js +16 -2
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/liquid/liquid.js +1 -1
- package/esm/series/liquid/liquid.js.map +1 -1
- package/esm/series/rose/animation.js +10 -7
- package/esm/series/rose/animation.js.map +1 -1
- package/esm/series/word-cloud/base.js +4 -0
- package/esm/series/word-cloud/base.js.map +1 -1
- package/package.json +10 -10
package/build/index.es.js
CHANGED
|
@@ -429,10 +429,7 @@ var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
|
429
429
|
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
430
430
|
var isType$1 = isType;
|
|
431
431
|
|
|
432
|
-
const isBoolean =
|
|
433
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
434
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
435
|
-
};
|
|
432
|
+
const isBoolean = (value, fuzzy = !1) => fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
436
433
|
var isBoolean$1 = isBoolean;
|
|
437
434
|
|
|
438
435
|
const isFunction = value => "function" == typeof value;
|
|
@@ -465,8 +462,7 @@ var isPlainObject$1 = isPlainObject;
|
|
|
465
462
|
const isUndefined = value => void 0 === value;
|
|
466
463
|
var isUndefined$1 = isUndefined;
|
|
467
464
|
|
|
468
|
-
const isString =
|
|
469
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
465
|
+
const isString = (value, fuzzy = !1) => {
|
|
470
466
|
const type = typeof value;
|
|
471
467
|
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
472
468
|
};
|
|
@@ -483,8 +479,7 @@ var isArrayLike$1 = isArrayLike;
|
|
|
483
479
|
const isDate = value => isType$1(value, "Date");
|
|
484
480
|
var isDate$1 = isDate;
|
|
485
481
|
|
|
486
|
-
const isNumber =
|
|
487
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
482
|
+
const isNumber = (value, fuzzy = !1) => {
|
|
488
483
|
const type = typeof value;
|
|
489
484
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
490
485
|
};
|
|
@@ -550,9 +545,7 @@ function cloneDeep(value, ignoreWhen, excludeKeys) {
|
|
|
550
545
|
return result;
|
|
551
546
|
}
|
|
552
547
|
|
|
553
|
-
function baseMerge(target, source) {
|
|
554
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
555
|
-
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
548
|
+
function baseMerge(target, source, shallowArray = !1, skipTargetArray = !1) {
|
|
556
549
|
if (source) {
|
|
557
550
|
if (target === source) return;
|
|
558
551
|
if (isValid$1(source) && "object" == typeof source) {
|
|
@@ -570,9 +563,7 @@ function baseMerge(target, source) {
|
|
|
570
563
|
}
|
|
571
564
|
}
|
|
572
565
|
}
|
|
573
|
-
function baseMergeDeep(target, source, key) {
|
|
574
|
-
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
575
|
-
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
566
|
+
function baseMergeDeep(target, source, key, shallowArray = !1, skipTargetArray = !1) {
|
|
576
567
|
const objValue = target[key],
|
|
577
568
|
srcValue = source[key];
|
|
578
569
|
let newValue = source[key],
|
|
@@ -593,11 +584,11 @@ function assignMergeValue(target, key, value) {
|
|
|
593
584
|
function eq(value, other) {
|
|
594
585
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
595
586
|
}
|
|
596
|
-
function merge$1(target) {
|
|
587
|
+
function merge$1(target, ...sources) {
|
|
597
588
|
let sourceIndex = -1;
|
|
598
|
-
const length =
|
|
589
|
+
const length = sources.length;
|
|
599
590
|
for (; ++sourceIndex < length;) {
|
|
600
|
-
baseMerge(target,
|
|
591
|
+
baseMerge(target, sources[sourceIndex], !0);
|
|
601
592
|
}
|
|
602
593
|
return target;
|
|
603
594
|
}
|
|
@@ -661,8 +652,7 @@ function defaults(target, source, overlay) {
|
|
|
661
652
|
}
|
|
662
653
|
return target;
|
|
663
654
|
}
|
|
664
|
-
function mixin(target, source) {
|
|
665
|
-
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
655
|
+
function mixin(target, source, override = !0) {
|
|
666
656
|
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source, Object.getOwnPropertyNames) {
|
|
667
657
|
const keyList = Object.getOwnPropertyNames(source);
|
|
668
658
|
for (let i = 0; i < keyList.length; i++) {
|
|
@@ -709,8 +699,7 @@ function arrayEqual(a, b) {
|
|
|
709
699
|
function uniqArray(arr) {
|
|
710
700
|
return arr && isArray$1(arr) ? Array.from(new Set(array(arr))) : arr;
|
|
711
701
|
}
|
|
712
|
-
function shuffleArray(arr) {
|
|
713
|
-
let random = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.random;
|
|
702
|
+
function shuffleArray(arr, random = Math.random) {
|
|
714
703
|
let j,
|
|
715
704
|
x,
|
|
716
705
|
i = arr.length;
|
|
@@ -741,8 +730,7 @@ function toNumber(a) {
|
|
|
741
730
|
return Number(a);
|
|
742
731
|
}
|
|
743
732
|
|
|
744
|
-
function quantileSorted(values, percent) {
|
|
745
|
-
let valueof = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : toNumber;
|
|
733
|
+
function quantileSorted(values, percent, valueof = toNumber) {
|
|
746
734
|
const n = values.length;
|
|
747
735
|
if (!n) return;
|
|
748
736
|
if (percent <= 0 || n < 2) return valueof(values[0], 0, values);
|
|
@@ -775,9 +763,7 @@ class Logger {
|
|
|
775
763
|
static clearInstance() {
|
|
776
764
|
Logger._instance = null;
|
|
777
765
|
}
|
|
778
|
-
constructor() {
|
|
779
|
-
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
780
|
-
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
766
|
+
constructor(level = LoggerLevel.None, method) {
|
|
781
767
|
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
782
768
|
}
|
|
783
769
|
addErrorHandler(handler) {
|
|
@@ -787,10 +773,7 @@ class Logger {
|
|
|
787
773
|
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
788
774
|
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
789
775
|
}
|
|
790
|
-
callErrorHandler() {
|
|
791
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
792
|
-
args[_key] = arguments[_key];
|
|
793
|
-
}
|
|
776
|
+
callErrorHandler(...args) {
|
|
794
777
|
this._onErrorHandler.forEach(h => h(...args));
|
|
795
778
|
}
|
|
796
779
|
canLogInfo() {
|
|
@@ -808,37 +791,23 @@ class Logger {
|
|
|
808
791
|
level(levelValue) {
|
|
809
792
|
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
810
793
|
}
|
|
811
|
-
error() {
|
|
794
|
+
error(...args) {
|
|
812
795
|
var _a;
|
|
813
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
814
|
-
args[_key2] = arguments[_key2];
|
|
815
|
-
}
|
|
816
796
|
return this._level >= LoggerLevel.Error && (this._onErrorHandler.length ? this.callErrorHandler(...args) : log$2(null !== (_a = this._method) && void 0 !== _a ? _a : "error", "ERROR", args)), this;
|
|
817
797
|
}
|
|
818
|
-
warn() {
|
|
819
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
820
|
-
args[_key3] = arguments[_key3];
|
|
821
|
-
}
|
|
798
|
+
warn(...args) {
|
|
822
799
|
return this._level >= LoggerLevel.Warn && log$2(this._method || "warn", "WARN", args), this;
|
|
823
800
|
}
|
|
824
|
-
info() {
|
|
825
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
826
|
-
args[_key4] = arguments[_key4];
|
|
827
|
-
}
|
|
801
|
+
info(...args) {
|
|
828
802
|
return this._level >= LoggerLevel.Info && log$2(this._method || "log", "INFO", args), this;
|
|
829
803
|
}
|
|
830
|
-
debug() {
|
|
831
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
832
|
-
args[_key5] = arguments[_key5];
|
|
833
|
-
}
|
|
804
|
+
debug(...args) {
|
|
834
805
|
return this._level >= LoggerLevel.Debug && log$2(this._method || "log", "DEBUG", args), this;
|
|
835
806
|
}
|
|
836
807
|
}
|
|
837
808
|
Logger._instance = null;
|
|
838
809
|
|
|
839
|
-
function bisect(a, x) {
|
|
840
|
-
let lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
841
|
-
let hi = arguments.length > 3 ? arguments[3] : undefined;
|
|
810
|
+
function bisect(a, x, lo = 0, hi) {
|
|
842
811
|
for (isNil$1(hi) && (hi = a.length); lo < hi;) {
|
|
843
812
|
const mid = lo + hi >>> 1;
|
|
844
813
|
ascending$1(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
|
@@ -883,9 +852,7 @@ const median$1 = (values, isSorted) => {
|
|
|
883
852
|
|
|
884
853
|
const DEFAULT_ABSOLUTE_TOLERATE = 1e-10,
|
|
885
854
|
DEFAULT_RELATIVE_TOLERATE = 1e-10;
|
|
886
|
-
function isNumberClose(a, b) {
|
|
887
|
-
let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE;
|
|
888
|
-
let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE;
|
|
855
|
+
function isNumberClose(a, b, relTol = DEFAULT_RELATIVE_TOLERATE, absTol = DEFAULT_ABSOLUTE_TOLERATE) {
|
|
889
856
|
const abs = absTol,
|
|
890
857
|
rel = relTol * Math.max(a, b);
|
|
891
858
|
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
@@ -900,12 +867,7 @@ function isLess(a, b, relTol, absTol) {
|
|
|
900
867
|
const memoize = func => {
|
|
901
868
|
let lastArgs = null,
|
|
902
869
|
lastResult = null;
|
|
903
|
-
return
|
|
904
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
905
|
-
args[_key] = arguments[_key];
|
|
906
|
-
}
|
|
907
|
-
return lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult;
|
|
908
|
-
};
|
|
870
|
+
return (...args) => (lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult);
|
|
909
871
|
};
|
|
910
872
|
|
|
911
873
|
const clamp = function (input, min, max) {
|
|
@@ -969,12 +931,9 @@ function debounce(func, wait, options) {
|
|
|
969
931
|
function trailingEdge(time) {
|
|
970
932
|
return timerId = void 0, trailing && lastArgs ? invokeFunc(time) : (lastArgs = lastThis = void 0, result);
|
|
971
933
|
}
|
|
972
|
-
function debounced() {
|
|
934
|
+
function debounced(...args) {
|
|
973
935
|
const time = Date.now(),
|
|
974
936
|
isInvoking = shouldInvoke(time);
|
|
975
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
976
|
-
args[_key] = arguments[_key];
|
|
977
|
-
}
|
|
978
937
|
if (lastArgs = args, lastThis = this, lastCallTime = time, isInvoking) {
|
|
979
938
|
if (void 0 === timerId) return function (time) {
|
|
980
939
|
return lastInvokeTime = time, timerId = startTimer(timerExpired, wait), leading ? invokeFunc(time) : result;
|
|
@@ -1034,8 +993,7 @@ function seedRandom(seed) {
|
|
|
1034
993
|
const a = 1664525,
|
|
1035
994
|
c$1 = 1013904223,
|
|
1036
995
|
m$2 = 4294967296;
|
|
1037
|
-
function randomLCG() {
|
|
1038
|
-
let initS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
996
|
+
function randomLCG(initS = 1) {
|
|
1039
997
|
let s = initS;
|
|
1040
998
|
return () => (s = (a * s + c$1) % m$2) / m$2;
|
|
1041
999
|
}
|
|
@@ -1046,14 +1004,12 @@ const fakeRandom = () => {
|
|
|
1046
1004
|
};
|
|
1047
1005
|
|
|
1048
1006
|
const getter = path => obj => get$1(obj, path);
|
|
1049
|
-
const fieldSingle =
|
|
1050
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1007
|
+
const fieldSingle = (fieldStr, opt = {}) => {
|
|
1051
1008
|
if (isFunction$1(fieldStr)) return fieldStr;
|
|
1052
1009
|
const path = [fieldStr];
|
|
1053
1010
|
return (opt && opt.get || getter)(path);
|
|
1054
1011
|
};
|
|
1055
|
-
const field$2 =
|
|
1056
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1012
|
+
const field$2 = (fieldStr, opt = {}) => {
|
|
1057
1013
|
if (isArray$1(fieldStr)) {
|
|
1058
1014
|
const funcs = fieldStr.map(entry => fieldSingle(entry, opt));
|
|
1059
1015
|
return datum => funcs.map(func => func(datum));
|
|
@@ -1102,9 +1058,7 @@ function rSquared(data, x, y, uY, predict) {
|
|
|
1102
1058
|
SSE += sse * sse, SST += sst * sst;
|
|
1103
1059
|
}), 1 - SSE / SST;
|
|
1104
1060
|
}
|
|
1105
|
-
function regressionLinear(data) {
|
|
1106
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datum => datum.x;
|
|
1107
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : datum => datum.y;
|
|
1061
|
+
function regressionLinear(data, x = datum => datum.x, y = datum => datum.y) {
|
|
1108
1062
|
let X = 0,
|
|
1109
1063
|
Y = 0,
|
|
1110
1064
|
XY = 0,
|
|
@@ -1160,8 +1114,7 @@ function dotProduct(a, b) {
|
|
|
1160
1114
|
function fuzzyEqualVec(a, b) {
|
|
1161
1115
|
return abs$1(a[0] - b[0]) + abs$1(a[1] - b[1]) < 1e-12;
|
|
1162
1116
|
}
|
|
1163
|
-
function fixPrecision$1(num) {
|
|
1164
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
1117
|
+
function fixPrecision$1(num, precision = 10) {
|
|
1165
1118
|
return Math.round(num * precision) / precision;
|
|
1166
1119
|
}
|
|
1167
1120
|
function getDecimalPlaces(n) {
|
|
@@ -1177,11 +1130,7 @@ function precisionSub(a, b) {
|
|
|
1177
1130
|
}
|
|
1178
1131
|
|
|
1179
1132
|
class Point {
|
|
1180
|
-
constructor() {
|
|
1181
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1182
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1183
|
-
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1184
|
-
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1133
|
+
constructor(x = 0, y = 0, x1, y1) {
|
|
1185
1134
|
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1186
1135
|
}
|
|
1187
1136
|
clone() {
|
|
@@ -1227,8 +1176,7 @@ function degreeToRadian(degree) {
|
|
|
1227
1176
|
function radianToDegree(radian) {
|
|
1228
1177
|
return 180 * radian / Math.PI;
|
|
1229
1178
|
}
|
|
1230
|
-
const clampRadian =
|
|
1231
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1179
|
+
const clampRadian = (angle = 0) => {
|
|
1232
1180
|
if (angle < 0) for (; angle < -tau$1;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
|
|
1233
1181
|
return angle;
|
|
1234
1182
|
};
|
|
@@ -1242,13 +1190,10 @@ function polarToCartesian(center, radius, angleInRadian) {
|
|
|
1242
1190
|
y: center.y
|
|
1243
1191
|
};
|
|
1244
1192
|
}
|
|
1245
|
-
function cartesianToPolar(point
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
};
|
|
1250
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1251
|
-
let endAngle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2 * Math.PI;
|
|
1193
|
+
function cartesianToPolar(point, center = {
|
|
1194
|
+
x: 0,
|
|
1195
|
+
y: 0
|
|
1196
|
+
}, startAngle = 0, endAngle = 2 * Math.PI) {
|
|
1252
1197
|
const {
|
|
1253
1198
|
x: x,
|
|
1254
1199
|
y: y
|
|
@@ -1424,15 +1369,13 @@ function pointInRect(point, bbox, format) {
|
|
|
1424
1369
|
function getProjectionRadius(checkAxis, axis) {
|
|
1425
1370
|
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
1426
1371
|
}
|
|
1427
|
-
function rotatePoint(
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
y: 0
|
|
1435
|
-
};
|
|
1372
|
+
function rotatePoint({
|
|
1373
|
+
x: x,
|
|
1374
|
+
y: y
|
|
1375
|
+
}, rad, origin = {
|
|
1376
|
+
x: 0,
|
|
1377
|
+
y: 0
|
|
1378
|
+
}) {
|
|
1436
1379
|
return {
|
|
1437
1380
|
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
1438
1381
|
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
@@ -1461,8 +1404,7 @@ function toRect(box, isDeg) {
|
|
|
1461
1404
|
y: box.y2
|
|
1462
1405
|
}, deg, cp)];
|
|
1463
1406
|
}
|
|
1464
|
-
function isRotateAABBIntersect(box1, box2) {
|
|
1465
|
-
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1407
|
+
function isRotateAABBIntersect(box1, box2, isDeg = !1) {
|
|
1466
1408
|
const rect1 = toRect(box1, isDeg),
|
|
1467
1409
|
rect2 = toRect(box2, isDeg),
|
|
1468
1410
|
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
@@ -1530,9 +1472,7 @@ const eastAsianCharacterInfo = character => {
|
|
|
1530
1472
|
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";
|
|
1531
1473
|
};
|
|
1532
1474
|
|
|
1533
|
-
function getContextFont(text) {
|
|
1534
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1535
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1475
|
+
function getContextFont(text, defaultAttr = {}, fontSizeScale) {
|
|
1536
1476
|
fontSizeScale || (fontSizeScale = 1);
|
|
1537
1477
|
const {
|
|
1538
1478
|
fontStyle = defaultAttr.fontStyle,
|
|
@@ -1858,49 +1798,29 @@ class Bounds {
|
|
|
1858
1798
|
equals(b) {
|
|
1859
1799
|
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1860
1800
|
}
|
|
1861
|
-
setValue() {
|
|
1862
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1863
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1864
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1865
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1801
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1866
1802
|
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1867
1803
|
}
|
|
1868
|
-
set() {
|
|
1869
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1870
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1871
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1872
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1804
|
+
set(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1873
1805
|
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;
|
|
1874
1806
|
}
|
|
1875
|
-
add() {
|
|
1876
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1877
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1807
|
+
add(x = 0, y = 0) {
|
|
1878
1808
|
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;
|
|
1879
1809
|
}
|
|
1880
|
-
expand() {
|
|
1881
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1810
|
+
expand(d = 0) {
|
|
1882
1811
|
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;
|
|
1883
1812
|
}
|
|
1884
1813
|
round() {
|
|
1885
1814
|
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;
|
|
1886
1815
|
}
|
|
1887
|
-
translate() {
|
|
1888
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1889
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1816
|
+
translate(dx = 0, dy = 0) {
|
|
1890
1817
|
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1891
1818
|
}
|
|
1892
|
-
rotate() {
|
|
1893
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1894
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1895
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1819
|
+
rotate(angle = 0, x = 0, y = 0) {
|
|
1896
1820
|
const p = this.rotatedPoints(angle, x, y);
|
|
1897
1821
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1898
1822
|
}
|
|
1899
|
-
scale() {
|
|
1900
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1901
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1902
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1903
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1823
|
+
scale(sx = 0, sy = 0, x = 0, y = 0) {
|
|
1904
1824
|
const p = this.scalePoints(sx, sy, x, y);
|
|
1905
1825
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1906
1826
|
}
|
|
@@ -1919,9 +1839,7 @@ class Bounds {
|
|
|
1919
1839
|
intersects(b) {
|
|
1920
1840
|
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1921
1841
|
}
|
|
1922
|
-
contains() {
|
|
1923
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1924
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1842
|
+
contains(x = 0, y = 0) {
|
|
1925
1843
|
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1926
1844
|
}
|
|
1927
1845
|
containsPoint(p) {
|
|
@@ -1933,12 +1851,10 @@ class Bounds {
|
|
|
1933
1851
|
height() {
|
|
1934
1852
|
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1935
1853
|
}
|
|
1936
|
-
scaleX() {
|
|
1937
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1854
|
+
scaleX(s = 0) {
|
|
1938
1855
|
return this.x1 *= s, this.x2 *= s, this;
|
|
1939
1856
|
}
|
|
1940
|
-
scaleY() {
|
|
1941
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1857
|
+
scaleY(s = 0) {
|
|
1942
1858
|
return this.y1 *= s, this.y2 *= s, this;
|
|
1943
1859
|
}
|
|
1944
1860
|
transformWithMatrix(matrix) {
|
|
@@ -1972,20 +1888,14 @@ class Bounds {
|
|
|
1972
1888
|
}
|
|
1973
1889
|
class AABBBounds extends Bounds {}
|
|
1974
1890
|
class OBBBounds extends Bounds {
|
|
1975
|
-
constructor(bounds) {
|
|
1976
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1891
|
+
constructor(bounds, angle = 0) {
|
|
1977
1892
|
var _a;
|
|
1978
1893
|
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
1979
1894
|
}
|
|
1980
1895
|
intersects(b) {
|
|
1981
1896
|
return isRotateAABBIntersect(this, b);
|
|
1982
1897
|
}
|
|
1983
|
-
setValue() {
|
|
1984
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1985
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1986
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1987
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1988
|
-
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1898
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0, angle = 0) {
|
|
1989
1899
|
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1990
1900
|
}
|
|
1991
1901
|
clone() {
|
|
@@ -2013,13 +1923,7 @@ class OBBBounds extends Bounds {
|
|
|
2013
1923
|
}
|
|
2014
1924
|
|
|
2015
1925
|
class Matrix {
|
|
2016
|
-
constructor() {
|
|
2017
|
-
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2018
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2019
|
-
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2020
|
-
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2021
|
-
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2022
|
-
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
1926
|
+
constructor(a = 1, b = 0, c = 0, d = 1, e = 0, f = 0) {
|
|
2023
1927
|
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
2024
1928
|
}
|
|
2025
1929
|
equalToMatrix(m2) {
|
|
@@ -2129,8 +2033,7 @@ class Matrix {
|
|
|
2129
2033
|
} = source;
|
|
2130
2034
|
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
2131
2035
|
}
|
|
2132
|
-
onlyTranslate() {
|
|
2133
|
-
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2036
|
+
onlyTranslate(scale = 1) {
|
|
2134
2037
|
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
2135
2038
|
}
|
|
2136
2039
|
clone() {
|
|
@@ -2437,16 +2340,13 @@ const setHex = (formatValue, forceHex) => {
|
|
|
2437
2340
|
}
|
|
2438
2341
|
};
|
|
2439
2342
|
class Color {
|
|
2440
|
-
static Brighter(source) {
|
|
2441
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2343
|
+
static Brighter(source, b = 1) {
|
|
2442
2344
|
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
2443
2345
|
}
|
|
2444
|
-
static SetOpacity(source) {
|
|
2445
|
-
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2346
|
+
static SetOpacity(source, o = 1) {
|
|
2446
2347
|
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
2447
2348
|
}
|
|
2448
|
-
static getColorBrightness(source) {
|
|
2449
|
-
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
2349
|
+
static getColorBrightness(source, model = "hsl") {
|
|
2450
2350
|
const color = source instanceof Color ? source : new Color(source);
|
|
2451
2351
|
switch (model) {
|
|
2452
2352
|
case "hsv":
|
|
@@ -2550,8 +2450,7 @@ class Color {
|
|
|
2550
2450
|
setScalar(scalar) {
|
|
2551
2451
|
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
2552
2452
|
}
|
|
2553
|
-
setOpacity() {
|
|
2554
|
-
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2453
|
+
setOpacity(o = 1) {
|
|
2555
2454
|
return this.color.opacity = o, this;
|
|
2556
2455
|
}
|
|
2557
2456
|
getLuminance() {
|
|
@@ -2574,12 +2473,10 @@ class Color {
|
|
|
2574
2473
|
clone() {
|
|
2575
2474
|
return new Color(this.color.toString());
|
|
2576
2475
|
}
|
|
2577
|
-
copyGammaToLinear(color) {
|
|
2578
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2476
|
+
copyGammaToLinear(color, gammaFactor = 2) {
|
|
2579
2477
|
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;
|
|
2580
2478
|
}
|
|
2581
|
-
copyLinearToGamma(color) {
|
|
2582
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2479
|
+
copyLinearToGamma(color, gammaFactor = 2) {
|
|
2583
2480
|
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
2584
2481
|
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;
|
|
2585
2482
|
}
|
|
@@ -2699,9 +2596,7 @@ function normalizePadding(padding) {
|
|
|
2699
2596
|
return [0, 0, 0, 0];
|
|
2700
2597
|
}
|
|
2701
2598
|
|
|
2702
|
-
function getContainerSize(el) {
|
|
2703
|
-
let defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2704
|
-
let defaultHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2599
|
+
function getContainerSize(el, defaultWidth = 0, defaultHeight = 0) {
|
|
2705
2600
|
if (!el) return {
|
|
2706
2601
|
width: defaultWidth,
|
|
2707
2602
|
height: defaultHeight
|
|
@@ -2736,8 +2631,7 @@ function getElementAbsolutePosition(element) {
|
|
|
2736
2631
|
y: y
|
|
2737
2632
|
};
|
|
2738
2633
|
}
|
|
2739
|
-
const styleStringToObject =
|
|
2740
|
-
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2634
|
+
const styleStringToObject = (styleStr = "") => {
|
|
2741
2635
|
const res = {};
|
|
2742
2636
|
return styleStr.split(";").forEach(item => {
|
|
2743
2637
|
if (item) {
|
|
@@ -3208,8 +3102,7 @@ function formatTrim(s) {
|
|
|
3208
3102
|
}
|
|
3209
3103
|
|
|
3210
3104
|
class FormatSpecifier {
|
|
3211
|
-
constructor() {
|
|
3212
|
-
let specifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3105
|
+
constructor(specifier = {}) {
|
|
3213
3106
|
this.fill = void 0 === specifier.fill ? " " : specifier.fill + "", this.align = void 0 === specifier.align ? ">" : specifier.align + "", this.sign = void 0 === specifier.sign ? "-" : specifier.sign + "", this.symbol = void 0 === specifier.symbol ? "" : specifier.symbol + "", this.zero = !!specifier.zero, this.width = void 0 === specifier.width ? void 0 : +specifier.width, this.comma = !!specifier.comma, this.precision = void 0 === specifier.precision ? void 0 : +specifier.precision, this.trim = !!specifier.trim, this.type = void 0 === specifier.type ? "" : specifier.type + "";
|
|
3214
3107
|
}
|
|
3215
3108
|
toString() {
|
|
@@ -5969,10 +5862,7 @@ var lib = simplifyGeometry;
|
|
|
5969
5862
|
var simplifyGeojsonExports = simplifyGeojson.exports;
|
|
5970
5863
|
var geoSimplify = /*@__PURE__*/getDefaultExportFromCjs(simplifyGeojsonExports);
|
|
5971
5864
|
|
|
5972
|
-
const mergeDeepImmer = function (target) {
|
|
5973
|
-
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
|
|
5974
|
-
sources[_key2 - 1] = arguments[_key2];
|
|
5975
|
-
}
|
|
5865
|
+
const mergeDeepImmer = function (target, ...sources) {
|
|
5976
5866
|
return mergeOption(cloneDeep(target), ...sources);
|
|
5977
5867
|
};
|
|
5978
5868
|
function _mergeOptionDeep(target, source, key) {
|
|
@@ -5985,12 +5875,12 @@ function _mergeOptionDeep(target, source, key) {
|
|
|
5985
5875
|
function _mergeOptionBase(target, source) {
|
|
5986
5876
|
if (isObject$2(source) && target !== source) for (const key in source) _mergeOptionDeep(target, source, key);
|
|
5987
5877
|
}
|
|
5988
|
-
function mergeOption(target) {
|
|
5878
|
+
function mergeOption(target, ...sources) {
|
|
5989
5879
|
target || (target = {});
|
|
5990
5880
|
let sourceIndex = -1;
|
|
5991
|
-
const length =
|
|
5881
|
+
const length = sources.length;
|
|
5992
5882
|
for (; ++sourceIndex < length;) {
|
|
5993
|
-
_mergeOptionBase(target,
|
|
5883
|
+
_mergeOptionBase(target, sources[sourceIndex]);
|
|
5994
5884
|
}
|
|
5995
5885
|
return target;
|
|
5996
5886
|
}
|
|
@@ -6234,9 +6124,7 @@ var tsvParse = tsv.parse;
|
|
|
6234
6124
|
const DEFAULT_DSV_PARSER_OPTIONS = {
|
|
6235
6125
|
delimiter: ","
|
|
6236
6126
|
};
|
|
6237
|
-
const dsvParser =
|
|
6238
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6239
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6127
|
+
const dsvParser = (data, options = {}, dataView) => {
|
|
6240
6128
|
dataView.type = DATAVIEW_TYPE.DSV;
|
|
6241
6129
|
const mergeOptions = mergeDeepImmer(DEFAULT_DSV_PARSER_OPTIONS, options),
|
|
6242
6130
|
{
|
|
@@ -6245,14 +6133,8 @@ const dsvParser = function (data) {
|
|
|
6245
6133
|
if (!isString$1(delimiter)) throw new TypeError("Invalid delimiter: must be a string!");
|
|
6246
6134
|
return dsvFormat(delimiter).parse(data);
|
|
6247
6135
|
};
|
|
6248
|
-
const csvParser =
|
|
6249
|
-
|
|
6250
|
-
return dataView.type = DATAVIEW_TYPE.DSV, csvParse(data);
|
|
6251
|
-
};
|
|
6252
|
-
const tsvParser = function (data) {
|
|
6253
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6254
|
-
return dataView.type = DATAVIEW_TYPE.DSV, tsvParse(data);
|
|
6255
|
-
};
|
|
6136
|
+
const csvParser = (data, options = {}, dataView) => (dataView.type = DATAVIEW_TYPE.DSV, csvParse(data));
|
|
6137
|
+
const tsvParser = (data, options = {}, dataView) => (dataView.type = DATAVIEW_TYPE.DSV, tsvParse(data));
|
|
6256
6138
|
|
|
6257
6139
|
/**
|
|
6258
6140
|
* Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.
|
|
@@ -6855,9 +6737,7 @@ const flattenFeature = data => {
|
|
|
6855
6737
|
}) : featuresArr.push(MultiToSingle(item));
|
|
6856
6738
|
}), featuresArr;
|
|
6857
6739
|
};
|
|
6858
|
-
const geoJSONParser =
|
|
6859
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6860
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6740
|
+
const geoJSONParser = (data, options = {}, dataView) => {
|
|
6861
6741
|
dataView.type = DATAVIEW_TYPE.GEO;
|
|
6862
6742
|
const mergeOptions = mergeDeepImmer(DEFAULT_GEOJSON_OPTIONS, options),
|
|
6863
6743
|
{
|
|
@@ -6906,8 +6786,7 @@ const dataViewParser = (data, options, dataView) => {
|
|
|
6906
6786
|
|
|
6907
6787
|
let idIndex = 0;
|
|
6908
6788
|
const maxId = 1e8;
|
|
6909
|
-
function getUUID() {
|
|
6910
|
-
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "dataset";
|
|
6789
|
+
function getUUID(prefix = "dataset") {
|
|
6911
6790
|
return idIndex > maxId && (idIndex = 0), prefix + "_" + idIndex++;
|
|
6912
6791
|
}
|
|
6913
6792
|
|
|
@@ -6995,25 +6874,22 @@ class DataSet {
|
|
|
6995
6874
|
|
|
6996
6875
|
class DataView {
|
|
6997
6876
|
constructor(dataSet, options) {
|
|
6998
|
-
var _this = this;
|
|
6999
6877
|
let name;
|
|
7000
|
-
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 =
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
_this.executeTransform(t, {
|
|
6878
|
+
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 = {}) => {
|
|
6879
|
+
const prevLatestData = this.latestData;
|
|
6880
|
+
return this.isRunning = !0, this.resetTransformData(), this.transformsArr.forEach(t => {
|
|
6881
|
+
this.executeTransform(t, {
|
|
7005
6882
|
pushHistory: opt.pushHistory,
|
|
7006
6883
|
emitMessage: !1
|
|
7007
6884
|
});
|
|
7008
|
-
}),
|
|
7009
|
-
latestData:
|
|
7010
|
-
}),
|
|
6885
|
+
}), this.isRunning = !1, !1 === opt.emitMessage || opt.skipEqual && isEqual(prevLatestData, this.latestData) || this.target.emit("change", {
|
|
6886
|
+
latestData: this.latestData
|
|
6887
|
+
}), this;
|
|
7011
6888
|
}, this.markRunning = () => {
|
|
7012
6889
|
this.isRunning = !0, this.target.emit("markRunning", []);
|
|
7013
6890
|
}, 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);
|
|
7014
6891
|
}
|
|
7015
|
-
parse(data, options) {
|
|
7016
|
-
let emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
6892
|
+
parse(data, options, emit = !1) {
|
|
7017
6893
|
var _a;
|
|
7018
6894
|
this.isRunning = !0, emit && this.target.emit("beforeParse", []), options && (this.parseOption = options);
|
|
7019
6895
|
const cloneData = this.cloneParseData(data, options);
|
|
@@ -7023,8 +6899,7 @@ class DataView {
|
|
|
7023
6899
|
} else this.parserData = cloneData, this.rawData = cloneData, this.history && this.historyData.push(cloneData), this.latestData = cloneData;
|
|
7024
6900
|
return this.isRunning = !1, emit && this.target.emit("afterParse", []), this;
|
|
7025
6901
|
}
|
|
7026
|
-
transform(options) {
|
|
7027
|
-
let execute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
6902
|
+
transform(options, execute = !0) {
|
|
7028
6903
|
if (this.isRunning = !0, options && options.type) {
|
|
7029
6904
|
let pushOption = !0;
|
|
7030
6905
|
if ("fields" === options.type) {
|
|
@@ -7042,8 +6917,7 @@ class DataView {
|
|
|
7042
6917
|
return (null !== (_a = a.level) && void 0 !== _a ? _a : 0) - (null !== (_b = b.level) && void 0 !== _b ? _b : 0);
|
|
7043
6918
|
});
|
|
7044
6919
|
}
|
|
7045
|
-
executeTransform(options) {
|
|
7046
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6920
|
+
executeTransform(options, opt = {}) {
|
|
7047
6921
|
const {
|
|
7048
6922
|
pushHistory: pushHistory,
|
|
7049
6923
|
emitMessage: emitMessage,
|
|
@@ -7074,8 +6948,7 @@ class DataView {
|
|
|
7074
6948
|
var _a;
|
|
7075
6949
|
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;
|
|
7076
6950
|
}
|
|
7077
|
-
setFields(f) {
|
|
7078
|
-
let foreMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6951
|
+
setFields(f, foreMerge = !1) {
|
|
7079
6952
|
this._fields = f && foreMerge ? merge$1({}, this._fields, f) : f;
|
|
7080
6953
|
const fieldsOption = this.transformsArr.find(_op => "fields" === _op.type);
|
|
7081
6954
|
!isNil$1(this._fields) && isNil$1(fieldsOption) ? (this.dataSet.registerTransform("fields", fields), this.transform({
|
|
@@ -7628,20 +7501,14 @@ class ContributionProviderCache {
|
|
|
7628
7501
|
}
|
|
7629
7502
|
}
|
|
7630
7503
|
function bindContributionProvider(bind, id) {
|
|
7631
|
-
bind(ContributionProvider).toDynamicValue(
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
} = _ref;
|
|
7635
|
-
return new ContributionProviderCache(id, container);
|
|
7636
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
7504
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
7505
|
+
container: container
|
|
7506
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
7637
7507
|
}
|
|
7638
7508
|
function bindContributionProviderNoSingletonScope(bind, id) {
|
|
7639
|
-
bind(ContributionProvider).toDynamicValue(
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
} = _ref2;
|
|
7643
|
-
return new ContributionProviderCache(id, container);
|
|
7644
|
-
}).whenTargetNamed(id);
|
|
7509
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
7510
|
+
container: container
|
|
7511
|
+
}) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
|
|
7645
7512
|
}
|
|
7646
7513
|
class ContributionStore {
|
|
7647
7514
|
static getStore(id) {
|
|
@@ -7711,10 +7578,7 @@ class Hook {
|
|
|
7711
7578
|
}
|
|
7712
7579
|
|
|
7713
7580
|
class SyncHook extends Hook {
|
|
7714
|
-
call() {
|
|
7715
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7716
|
-
args[_key] = arguments[_key];
|
|
7717
|
-
}
|
|
7581
|
+
call(...args) {
|
|
7718
7582
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
7719
7583
|
}
|
|
7720
7584
|
}
|
|
@@ -7726,22 +7590,22 @@ const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,s
|
|
|
7726
7590
|
class Application {}
|
|
7727
7591
|
const application = new Application();
|
|
7728
7592
|
|
|
7593
|
+
let idx = 0;
|
|
7729
7594
|
class PerformanceRAF {
|
|
7730
7595
|
constructor() {
|
|
7731
|
-
this.nextAnimationFrameCbs =
|
|
7596
|
+
this.nextAnimationFrameCbs = new Map(), this._rafHandle = null, this.runAnimationFrame = time => {
|
|
7732
7597
|
this._rafHandle = null;
|
|
7733
7598
|
const cbs = this.nextAnimationFrameCbs;
|
|
7734
|
-
this.nextAnimationFrameCbs =
|
|
7735
|
-
for (let i = 0; i < cbs.length; i++) cbs[i] && cbs[i](time);
|
|
7599
|
+
this.nextAnimationFrameCbs = new Map(), cbs.forEach(cb => cb(time));
|
|
7736
7600
|
}, this.tryRunAnimationFrameNextFrame = () => {
|
|
7737
|
-
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.
|
|
7601
|
+
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.size && (this._rafHandle = application.global.getRequestAnimationFrame()(this.runAnimationFrame));
|
|
7738
7602
|
};
|
|
7739
7603
|
}
|
|
7740
7604
|
addAnimationFrameCb(callback) {
|
|
7741
|
-
return this.nextAnimationFrameCbs.
|
|
7605
|
+
return this.nextAnimationFrameCbs.set(++idx, callback), this.tryRunAnimationFrameNextFrame(), idx;
|
|
7742
7606
|
}
|
|
7743
7607
|
removeAnimationFrameCb(index) {
|
|
7744
|
-
return
|
|
7608
|
+
return !!this.nextAnimationFrameCbs.has(index) && (this.nextAnimationFrameCbs.delete(index), !0);
|
|
7745
7609
|
}
|
|
7746
7610
|
}
|
|
7747
7611
|
|
|
@@ -7990,16 +7854,13 @@ let DefaultGlobal = class extends EventListenerManager {
|
|
|
7990
7854
|
updateDom(dom, params) {
|
|
7991
7855
|
return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
|
|
7992
7856
|
}
|
|
7993
|
-
getElementTop(dom) {
|
|
7994
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7857
|
+
getElementTop(dom, baseWindow = !1) {
|
|
7995
7858
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
|
|
7996
7859
|
}
|
|
7997
|
-
getElementLeft(dom) {
|
|
7998
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7860
|
+
getElementLeft(dom, baseWindow = !1) {
|
|
7999
7861
|
return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
|
|
8000
7862
|
}
|
|
8001
|
-
getElementTopLeft(dom) {
|
|
8002
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7863
|
+
getElementTopLeft(dom, baseWindow = !1) {
|
|
8003
7864
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
|
|
8004
7865
|
}
|
|
8005
7866
|
isMacOS() {
|
|
@@ -8079,7 +7940,7 @@ class BoundsContext {
|
|
|
8079
7940
|
clear() {
|
|
8080
7941
|
this.bounds.clear();
|
|
8081
7942
|
}
|
|
8082
|
-
release() {}
|
|
7943
|
+
release(...params) {}
|
|
8083
7944
|
}
|
|
8084
7945
|
|
|
8085
7946
|
class CurvePath {
|
|
@@ -8254,8 +8115,7 @@ function drawArc(context, x, y, coords) {
|
|
|
8254
8115
|
context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
|
|
8255
8116
|
}
|
|
8256
8117
|
}
|
|
8257
|
-
const addArcToBezierPath$1 =
|
|
8258
|
-
let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
8118
|
+
const addArcToBezierPath$1 = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
|
|
8259
8119
|
const PI2 = 2 * Math.PI,
|
|
8260
8120
|
sAngle = (startAngle % PI2 + PI2) % PI2;
|
|
8261
8121
|
let deltaAngle,
|
|
@@ -8283,12 +8143,7 @@ const addArcToBezierPath$1 = function (bezierPath, startAngle, endAngle, cx, cy,
|
|
|
8283
8143
|
};
|
|
8284
8144
|
|
|
8285
8145
|
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)];
|
|
8286
|
-
function renderCommandList(commandList, context) {
|
|
8287
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
8288
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
8289
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
8290
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
8291
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
8146
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
8292
8147
|
for (let i = 0; i < commandList.length; i++) {
|
|
8293
8148
|
const command = commandList[i];
|
|
8294
8149
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -8529,7 +8384,7 @@ class ReflectSegContext extends SegContext {
|
|
|
8529
8384
|
}
|
|
8530
8385
|
}
|
|
8531
8386
|
|
|
8532
|
-
function genCurveSegments(path, points) {
|
|
8387
|
+
function genCurveSegments(path, points, step = 1) {
|
|
8533
8388
|
let defined0 = !1;
|
|
8534
8389
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
8535
8390
|
}
|
|
@@ -8572,8 +8427,7 @@ class Linear {
|
|
|
8572
8427
|
return this.context.tryUpdateLength();
|
|
8573
8428
|
}
|
|
8574
8429
|
}
|
|
8575
|
-
function genLinearSegments(points) {
|
|
8576
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8430
|
+
function genLinearSegments(points, params = {}) {
|
|
8577
8431
|
const {
|
|
8578
8432
|
direction: direction,
|
|
8579
8433
|
startPoint: startPoint
|
|
@@ -8583,7 +8437,7 @@ function genLinearSegments(points) {
|
|
|
8583
8437
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
8584
8438
|
}
|
|
8585
8439
|
function genLinearTypeSegments(path, points) {
|
|
8586
|
-
return genCurveSegments(path, points);
|
|
8440
|
+
return genCurveSegments(path, points, 1);
|
|
8587
8441
|
}
|
|
8588
8442
|
|
|
8589
8443
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -8626,10 +8480,9 @@ class Basis {
|
|
|
8626
8480
|
}
|
|
8627
8481
|
}
|
|
8628
8482
|
function genBasisTypeSegments(path, points) {
|
|
8629
|
-
return genCurveSegments(path, points);
|
|
8483
|
+
return genCurveSegments(path, points, 2);
|
|
8630
8484
|
}
|
|
8631
|
-
function genBasisSegments(points) {
|
|
8632
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8485
|
+
function genBasisSegments(points, params = {}) {
|
|
8633
8486
|
const {
|
|
8634
8487
|
direction: direction,
|
|
8635
8488
|
startPoint: startPoint
|
|
@@ -8722,10 +8575,9 @@ class MonotoneY extends MonotoneX {
|
|
|
8722
8575
|
}
|
|
8723
8576
|
}
|
|
8724
8577
|
function genMonotoneXTypeSegments(path, points) {
|
|
8725
|
-
return genCurveSegments(path, points);
|
|
8578
|
+
return genCurveSegments(path, points, 2);
|
|
8726
8579
|
}
|
|
8727
|
-
function genMonotoneXSegments(points) {
|
|
8728
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8580
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
8729
8581
|
const {
|
|
8730
8582
|
direction: direction,
|
|
8731
8583
|
startPoint: startPoint
|
|
@@ -8736,10 +8588,9 @@ function genMonotoneXSegments(points) {
|
|
|
8736
8588
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
8737
8589
|
}
|
|
8738
8590
|
function genMonotoneYTypeSegments(path, points) {
|
|
8739
|
-
return genCurveSegments(path, points);
|
|
8591
|
+
return genCurveSegments(path, points, 2);
|
|
8740
8592
|
}
|
|
8741
|
-
function genMonotoneYSegments(points) {
|
|
8742
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8593
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
8743
8594
|
const {
|
|
8744
8595
|
direction: direction,
|
|
8745
8596
|
startPoint: startPoint
|
|
@@ -8751,9 +8602,7 @@ function genMonotoneYSegments(points) {
|
|
|
8751
8602
|
}
|
|
8752
8603
|
|
|
8753
8604
|
let Step$1 = class Step {
|
|
8754
|
-
constructor(context) {
|
|
8755
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8756
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8605
|
+
constructor(context, t = .5, startPoint) {
|
|
8757
8606
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
8758
8607
|
}
|
|
8759
8608
|
areaStart() {
|
|
@@ -8794,8 +8643,7 @@ class StepClosed extends Step$1 {
|
|
|
8794
8643
|
this.context.closePath();
|
|
8795
8644
|
}
|
|
8796
8645
|
}
|
|
8797
|
-
function genStepSegments(points, t) {
|
|
8798
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8646
|
+
function genStepSegments(points, t, params = {}) {
|
|
8799
8647
|
const {
|
|
8800
8648
|
direction: direction,
|
|
8801
8649
|
startPoint: startPoint
|
|
@@ -8805,10 +8653,9 @@ function genStepSegments(points, t) {
|
|
|
8805
8653
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
8806
8654
|
}
|
|
8807
8655
|
function genStepTypeSegments(path, points) {
|
|
8808
|
-
return genCurveSegments(path, points);
|
|
8656
|
+
return genCurveSegments(path, points, 1);
|
|
8809
8657
|
}
|
|
8810
|
-
function genStepClosedSegments(points, t) {
|
|
8811
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8658
|
+
function genStepClosedSegments(points, t, params = {}) {
|
|
8812
8659
|
const {
|
|
8813
8660
|
direction: direction,
|
|
8814
8661
|
startPoint: startPoint
|
|
@@ -8823,8 +8670,7 @@ class LinearClosed extends Linear {
|
|
|
8823
8670
|
this.context.closePath();
|
|
8824
8671
|
}
|
|
8825
8672
|
}
|
|
8826
|
-
function genLinearClosedSegments(points) {
|
|
8827
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8673
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
8828
8674
|
const {
|
|
8829
8675
|
direction: direction,
|
|
8830
8676
|
startPoint: startPoint
|
|
@@ -8834,7 +8680,7 @@ function genLinearClosedSegments(points) {
|
|
|
8834
8680
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
8835
8681
|
}
|
|
8836
8682
|
function genLinearClosedTypeSegments(path, points) {
|
|
8837
|
-
return genCurveSegments(path, points);
|
|
8683
|
+
return genCurveSegments(path, points, 1);
|
|
8838
8684
|
}
|
|
8839
8685
|
|
|
8840
8686
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -8855,9 +8701,7 @@ function point$1(curveClass, x, y, defined, p) {
|
|
|
8855
8701
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
8856
8702
|
}
|
|
8857
8703
|
class CatmullRom {
|
|
8858
|
-
constructor(context) {
|
|
8859
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8860
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8704
|
+
constructor(context, alpha = .5, startPoint) {
|
|
8861
8705
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
8862
8706
|
}
|
|
8863
8707
|
areaStart() {
|
|
@@ -8911,8 +8755,7 @@ class CatmullRom {
|
|
|
8911
8755
|
}
|
|
8912
8756
|
}
|
|
8913
8757
|
function commonGenCatmullRomSegments(type, cons) {
|
|
8914
|
-
return function (points, alpha) {
|
|
8915
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8758
|
+
return function (points, alpha, params = {}) {
|
|
8916
8759
|
const {
|
|
8917
8760
|
direction: direction,
|
|
8918
8761
|
startPoint: startPoint
|
|
@@ -8921,15 +8764,13 @@ function commonGenCatmullRomSegments(type, cons) {
|
|
|
8921
8764
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
8922
8765
|
const segContext = genSegContext(type, direction, points),
|
|
8923
8766
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
8924
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
8767
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
8925
8768
|
};
|
|
8926
8769
|
}
|
|
8927
8770
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
8928
8771
|
|
|
8929
8772
|
class CatmullRomClosed {
|
|
8930
|
-
constructor(context) {
|
|
8931
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8932
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8773
|
+
constructor(context, alpha = .5, startPoint) {
|
|
8933
8774
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
8934
8775
|
}
|
|
8935
8776
|
areaStart() {
|
|
@@ -9239,11 +9080,7 @@ class CustomPath2D extends CurvePath {
|
|
|
9239
9080
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
9240
9081
|
}
|
|
9241
9082
|
closePathTransform() {}
|
|
9242
|
-
_runCommandStrList(commandStrList) {
|
|
9243
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9244
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
9245
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
9246
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
9083
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
9247
9084
|
let current,
|
|
9248
9085
|
tempX,
|
|
9249
9086
|
tempY,
|
|
@@ -9317,11 +9154,7 @@ class CustomPath2D extends CurvePath {
|
|
|
9317
9154
|
previous = current;
|
|
9318
9155
|
}
|
|
9319
9156
|
}
|
|
9320
|
-
_runCommandList(commandList) {
|
|
9321
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9322
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
9323
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
9324
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
9157
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
9325
9158
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
9326
9159
|
const current = commandList[i].slice();
|
|
9327
9160
|
switch (current[0]) {
|
|
@@ -9972,9 +9805,7 @@ function getScaledStroke(context, width, dpr) {
|
|
|
9972
9805
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
9973
9806
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
9974
9807
|
}
|
|
9975
|
-
function createColor(context, c, params) {
|
|
9976
|
-
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
9977
|
-
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
9808
|
+
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
9978
9809
|
var _a, _b, _c, _d;
|
|
9979
9810
|
if (!c || !0 === c) return "black";
|
|
9980
9811
|
let result, color;
|
|
@@ -10113,8 +9944,7 @@ function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter)
|
|
|
10113
9944
|
}
|
|
10114
9945
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
10115
9946
|
}
|
|
10116
|
-
function testLetter(string, index) {
|
|
10117
|
-
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
9947
|
+
function testLetter(string, index, negativeWrongMatch = !1) {
|
|
10118
9948
|
let i = index;
|
|
10119
9949
|
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
10120
9950
|
return i;
|
|
@@ -10124,8 +9954,7 @@ function testLetter2(string, index) {
|
|
|
10124
9954
|
for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
10125
9955
|
return i + 1;
|
|
10126
9956
|
}
|
|
10127
|
-
function measureTextCanvas(text, character) {
|
|
10128
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
9957
|
+
function measureTextCanvas(text, character, mode = "actual") {
|
|
10129
9958
|
var _a;
|
|
10130
9959
|
if ("" === text) return {
|
|
10131
9960
|
ascent: 0,
|
|
@@ -10195,10 +10024,9 @@ let ATextMeasure = class {
|
|
|
10195
10024
|
}
|
|
10196
10025
|
return metrics;
|
|
10197
10026
|
}
|
|
10198
|
-
estimate(text,
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
} = _ref;
|
|
10027
|
+
estimate(text, {
|
|
10028
|
+
fontSize = DefaultTextAttribute.fontSize
|
|
10029
|
+
}) {
|
|
10202
10030
|
let eCharLen = 0,
|
|
10203
10031
|
cCharLen = 0;
|
|
10204
10032
|
for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
|
|
@@ -10509,8 +10337,7 @@ let ATextMeasure = class {
|
|
|
10509
10337
|
});
|
|
10510
10338
|
});
|
|
10511
10339
|
}
|
|
10512
|
-
clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
10513
|
-
let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
10340
|
+
clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
|
|
10514
10341
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
10515
10342
|
if (0 === text.length) return {
|
|
10516
10343
|
str: "",
|
|
@@ -10955,7 +10782,7 @@ class DefaultCanvasAllocate {
|
|
|
10955
10782
|
get length() {
|
|
10956
10783
|
return this.pools.length;
|
|
10957
10784
|
}
|
|
10958
|
-
release() {
|
|
10785
|
+
release(...params) {
|
|
10959
10786
|
this.pools = [];
|
|
10960
10787
|
}
|
|
10961
10788
|
}
|
|
@@ -11151,8 +10978,7 @@ let DefaultGraphicUtil = class {
|
|
|
11151
10978
|
bindTextMeasure(tm) {
|
|
11152
10979
|
this._textMeasure = tm;
|
|
11153
10980
|
}
|
|
11154
|
-
measureText(text, tc) {
|
|
11155
|
-
let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
|
|
10981
|
+
measureText(text, tc, method = "native") {
|
|
11156
10982
|
var _a;
|
|
11157
10983
|
this.configure(this.global, this.global.env);
|
|
11158
10984
|
const m = this.global.measureTextMethod;
|
|
@@ -11335,8 +11161,7 @@ class Theme {
|
|
|
11335
11161
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
11336
11162
|
return null;
|
|
11337
11163
|
}
|
|
11338
|
-
applyTheme(group, pt) {
|
|
11339
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
11164
|
+
applyTheme(group, pt, force = !1) {
|
|
11340
11165
|
if (this.dirty) {
|
|
11341
11166
|
const parentGroup = this.getParentWithTheme(group);
|
|
11342
11167
|
if (parentGroup) {
|
|
@@ -11435,8 +11260,7 @@ class Node extends EventEmitter {
|
|
|
11435
11260
|
constructor() {
|
|
11436
11261
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
11437
11262
|
}
|
|
11438
|
-
forEachChildren(cb) {
|
|
11439
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11263
|
+
forEachChildren(cb, reverse = !1) {
|
|
11440
11264
|
if (reverse) {
|
|
11441
11265
|
let child = this._lastChild,
|
|
11442
11266
|
i = 0;
|
|
@@ -11453,8 +11277,7 @@ class Node extends EventEmitter {
|
|
|
11453
11277
|
}
|
|
11454
11278
|
}
|
|
11455
11279
|
}
|
|
11456
|
-
forEachChildrenAsync(cb) {
|
|
11457
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11280
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
11458
11281
|
return __awaiter$8(this, void 0, void 0, function* () {
|
|
11459
11282
|
if (reverse) {
|
|
11460
11283
|
let child = this._lastChild,
|
|
@@ -11478,13 +11301,12 @@ class Node extends EventEmitter {
|
|
|
11478
11301
|
forEach(cb) {
|
|
11479
11302
|
return this.forEachChildren(cb);
|
|
11480
11303
|
}
|
|
11481
|
-
appendChild(node) {
|
|
11482
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
11304
|
+
appendChild(node, highPerformance = !0) {
|
|
11483
11305
|
if (this._uid === node._uid) return null;
|
|
11484
11306
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
11485
11307
|
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;
|
|
11486
11308
|
}
|
|
11487
|
-
appendChildArrHighPerformance(nodes) {
|
|
11309
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
11488
11310
|
return console.error("暂不支持该函数"), nodes;
|
|
11489
11311
|
}
|
|
11490
11312
|
insertBefore(newNode, referenceNode) {
|
|
@@ -11552,8 +11374,7 @@ class Node extends EventEmitter {
|
|
|
11552
11374
|
replaceChild(newChild, oldChild) {
|
|
11553
11375
|
throw new Error("暂不支持");
|
|
11554
11376
|
}
|
|
11555
|
-
find(callback) {
|
|
11556
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11377
|
+
find(callback, deep = !1) {
|
|
11557
11378
|
let target = null;
|
|
11558
11379
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
11559
11380
|
if (child.isContainer) {
|
|
@@ -11563,8 +11384,7 @@ class Node extends EventEmitter {
|
|
|
11563
11384
|
return !1;
|
|
11564
11385
|
}), target;
|
|
11565
11386
|
}
|
|
11566
|
-
findAll(callback) {
|
|
11567
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11387
|
+
findAll(callback, deep = !1) {
|
|
11568
11388
|
let nodes = [];
|
|
11569
11389
|
return this.forEachChildren((node, index) => {
|
|
11570
11390
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -11593,8 +11413,7 @@ class Node extends EventEmitter {
|
|
|
11593
11413
|
getElementsByType(type) {
|
|
11594
11414
|
return this.findAll(node => node.type === type, !0);
|
|
11595
11415
|
}
|
|
11596
|
-
getChildByName(name) {
|
|
11597
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11416
|
+
getChildByName(name, deep = !1) {
|
|
11598
11417
|
return this.find(node => node.name === name, deep);
|
|
11599
11418
|
}
|
|
11600
11419
|
getChildAt(idx) {
|
|
@@ -11713,10 +11532,7 @@ class Node extends EventEmitter {
|
|
|
11713
11532
|
removeAllListeners() {
|
|
11714
11533
|
return this.removeAllEventListeners();
|
|
11715
11534
|
}
|
|
11716
|
-
dispatchEvent(event) {
|
|
11717
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
11718
|
-
args[_key - 1] = arguments[_key];
|
|
11719
|
-
}
|
|
11535
|
+
dispatchEvent(event, ...args) {
|
|
11720
11536
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
11721
11537
|
}
|
|
11722
11538
|
emit(event, data) {
|
|
@@ -12546,8 +12362,7 @@ function getAttributeFromDefaultAttrList(attr, key) {
|
|
|
12546
12362
|
return attr[key];
|
|
12547
12363
|
}
|
|
12548
12364
|
class RafBasedSTO {
|
|
12549
|
-
constructor() {
|
|
12550
|
-
let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RafBasedSTO.TimeOut;
|
|
12365
|
+
constructor(timeout = RafBasedSTO.TimeOut) {
|
|
12551
12366
|
this.durations = [], this.timeout = timeout, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
12552
12367
|
}
|
|
12553
12368
|
call(cb) {
|
|
@@ -12662,8 +12477,7 @@ class SquareSymbol extends BaseSymbol {
|
|
|
12662
12477
|
}
|
|
12663
12478
|
var square$3 = new SquareSymbol();
|
|
12664
12479
|
|
|
12665
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
12666
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12480
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
12667
12481
|
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;
|
|
12668
12482
|
}
|
|
12669
12483
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -12809,8 +12623,7 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
12809
12623
|
}
|
|
12810
12624
|
var triangleLeft = new TriangleLeftSymbol();
|
|
12811
12625
|
|
|
12812
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
12813
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12626
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
12814
12627
|
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;
|
|
12815
12628
|
}
|
|
12816
12629
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -12826,8 +12639,7 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
12826
12639
|
}
|
|
12827
12640
|
var triangleRight = new TriangleRightSymbol();
|
|
12828
12641
|
|
|
12829
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
12830
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12642
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
12831
12643
|
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;
|
|
12832
12644
|
}
|
|
12833
12645
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -13044,8 +12856,7 @@ var rect = new RectSymbol();
|
|
|
13044
12856
|
|
|
13045
12857
|
const tempBounds = new AABBBounds();
|
|
13046
12858
|
class CustomSymbolClass {
|
|
13047
|
-
constructor(type, path) {
|
|
13048
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
12859
|
+
constructor(type, path, isSvg = !1) {
|
|
13049
12860
|
this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
13050
12861
|
}
|
|
13051
12862
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -13067,10 +12878,9 @@ class CustomSymbolClass {
|
|
|
13067
12878
|
bounds(size, bounds) {
|
|
13068
12879
|
if (size = this.parseSize(size), this.isSvg) {
|
|
13069
12880
|
if (!this.svgCache) return;
|
|
13070
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
} = _ref;
|
|
12881
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
12882
|
+
path: path
|
|
12883
|
+
}) => {
|
|
13074
12884
|
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);
|
|
13075
12885
|
});
|
|
13076
12886
|
}
|
|
@@ -13126,8 +12936,7 @@ function findClosingIndex(xmlData, str, i, errMsg) {
|
|
|
13126
12936
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
13127
12937
|
return closingIndex + str.length - 1;
|
|
13128
12938
|
}
|
|
13129
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
13130
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
12939
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
13131
12940
|
let attrBoundary,
|
|
13132
12941
|
tagExp = "";
|
|
13133
12942
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -13145,8 +12954,7 @@ function tagExpWithClosingIndex(xmlData, i) {
|
|
|
13145
12954
|
tagExp += ch;
|
|
13146
12955
|
}
|
|
13147
12956
|
}
|
|
13148
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
13149
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
12957
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
13150
12958
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
13151
12959
|
if (!result) return;
|
|
13152
12960
|
let tagExp = result.data;
|
|
@@ -13327,8 +13135,7 @@ function waitForAllSubLayers(stage) {
|
|
|
13327
13135
|
}), yield Promise.all(promiseList);
|
|
13328
13136
|
});
|
|
13329
13137
|
}
|
|
13330
|
-
function boundStroke(bounds, halfW, miter) {
|
|
13331
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
13138
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
13332
13139
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
13333
13140
|
}
|
|
13334
13141
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -13520,7 +13327,7 @@ class DefaultMatrixAllocate {
|
|
|
13520
13327
|
get length() {
|
|
13521
13328
|
return this.pools.length;
|
|
13522
13329
|
}
|
|
13523
|
-
release() {
|
|
13330
|
+
release(...params) {
|
|
13524
13331
|
this.pools = [];
|
|
13525
13332
|
}
|
|
13526
13333
|
}
|
|
@@ -13548,7 +13355,7 @@ class DefaultMat4Allocate {
|
|
|
13548
13355
|
get length() {
|
|
13549
13356
|
return this.pools.length;
|
|
13550
13357
|
}
|
|
13551
|
-
release() {
|
|
13358
|
+
release(...params) {
|
|
13552
13359
|
this.pools = [];
|
|
13553
13360
|
}
|
|
13554
13361
|
}
|
|
@@ -13583,8 +13390,7 @@ let EmptyContext2d = class {
|
|
|
13583
13390
|
getContext() {
|
|
13584
13391
|
throw new Error("不支持getContext");
|
|
13585
13392
|
}
|
|
13586
|
-
setTransformForCurrent() {
|
|
13587
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
13393
|
+
setTransformForCurrent(force = !1) {
|
|
13588
13394
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
|
|
13589
13395
|
}
|
|
13590
13396
|
get currentMatrix() {
|
|
@@ -13605,8 +13411,7 @@ let EmptyContext2d = class {
|
|
|
13605
13411
|
highPerformanceRestore() {
|
|
13606
13412
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
13607
13413
|
}
|
|
13608
|
-
rotate(rad) {
|
|
13609
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13414
|
+
rotate(rad, setTransform = !0) {
|
|
13610
13415
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
13611
13416
|
}
|
|
13612
13417
|
save() {
|
|
@@ -13617,55 +13422,41 @@ let EmptyContext2d = class {
|
|
|
13617
13422
|
const matrix = this.cloneMatrix(this.matrix);
|
|
13618
13423
|
this.stack.push(matrix);
|
|
13619
13424
|
}
|
|
13620
|
-
scale(sx, sy) {
|
|
13621
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13425
|
+
scale(sx, sy, setTransform = !0) {
|
|
13622
13426
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
13623
13427
|
}
|
|
13624
|
-
setScale(sx, sy) {
|
|
13625
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13428
|
+
setScale(sx, sy, setTransform = !0) {
|
|
13626
13429
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
13627
13430
|
}
|
|
13628
|
-
scalePoint(sx, sy, px, py) {
|
|
13629
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
13431
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
13630
13432
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
13631
13433
|
}
|
|
13632
|
-
setTransform(a, b, c, d, e, f) {
|
|
13633
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
13634
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
13434
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
13635
13435
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
13636
13436
|
}
|
|
13637
|
-
setTransformFromMatrix(matrix) {
|
|
13638
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13639
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
13437
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
13640
13438
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
13641
13439
|
}
|
|
13642
|
-
resetTransform() {
|
|
13643
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
13644
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
13440
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
13645
13441
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
13646
13442
|
}
|
|
13647
|
-
transform(a, b, c, d, e, f) {
|
|
13648
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
13443
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
13649
13444
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
13650
13445
|
}
|
|
13651
13446
|
transformFromMatrix(matrix, setTransform) {
|
|
13652
13447
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
13653
13448
|
}
|
|
13654
|
-
translate(x, y) {
|
|
13655
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13449
|
+
translate(x, y, setTransform = !0) {
|
|
13656
13450
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
13657
13451
|
}
|
|
13658
|
-
rotateDegrees(deg) {
|
|
13659
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13452
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
13660
13453
|
const rad = deg * Math.PI / 180;
|
|
13661
13454
|
this.rotate(rad, setTransform);
|
|
13662
13455
|
}
|
|
13663
|
-
rotateAbout(rad, x, y) {
|
|
13664
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
13456
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
13665
13457
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
13666
13458
|
}
|
|
13667
|
-
rotateDegreesAbout(deg, x, y) {
|
|
13668
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
13459
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
13669
13460
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
13670
13461
|
}
|
|
13671
13462
|
beginPath() {
|
|
@@ -13759,19 +13550,16 @@ let EmptyContext2d = class {
|
|
|
13759
13550
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {}
|
|
13760
13551
|
setTextStyle(params, defaultParams) {}
|
|
13761
13552
|
draw() {}
|
|
13762
|
-
clearMatrix() {
|
|
13763
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
13764
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
13553
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
13765
13554
|
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
13766
13555
|
}
|
|
13767
13556
|
setClearMatrix(a, b, c, d, e, f) {
|
|
13768
13557
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
13769
13558
|
}
|
|
13770
|
-
onlyTranslate() {
|
|
13771
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
13559
|
+
onlyTranslate(dpr = this.dpr) {
|
|
13772
13560
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
13773
13561
|
}
|
|
13774
|
-
release() {
|
|
13562
|
+
release(...params) {
|
|
13775
13563
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
13776
13564
|
}
|
|
13777
13565
|
};
|
|
@@ -13871,7 +13659,7 @@ class BaseCanvas {
|
|
|
13871
13659
|
transferToImageBitmap() {
|
|
13872
13660
|
throw new Error("暂未实现");
|
|
13873
13661
|
}
|
|
13874
|
-
release() {
|
|
13662
|
+
release(...params) {
|
|
13875
13663
|
this.controled && this._nativeCanvas.parentElement && this._nativeCanvas.parentElement.removeChild(this._nativeCanvas);
|
|
13876
13664
|
}
|
|
13877
13665
|
}
|
|
@@ -13882,9 +13670,7 @@ var ColorType;
|
|
|
13882
13670
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
13883
13671
|
}(ColorType || (ColorType = {}));
|
|
13884
13672
|
class ColorStore {
|
|
13885
|
-
static Get(str) {
|
|
13886
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
13887
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
13673
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
13888
13674
|
if (size === ColorType.Color1) {
|
|
13889
13675
|
const color = ColorStore.store1[str];
|
|
13890
13676
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -13912,8 +13698,7 @@ class ColorStore {
|
|
|
13912
13698
|
}
|
|
13913
13699
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
13914
13700
|
|
|
13915
|
-
function colorArrayToString(color) {
|
|
13916
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
13701
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
13917
13702
|
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;
|
|
13918
13703
|
}
|
|
13919
13704
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -14036,9 +13821,7 @@ class ColorInterpolate extends LRU {
|
|
|
14036
13821
|
static getInstance() {
|
|
14037
13822
|
return ColorInterpolate._instance || (ColorInterpolate._instance = new ColorInterpolate()), ColorInterpolate._instance;
|
|
14038
13823
|
}
|
|
14039
|
-
constructor() {
|
|
14040
|
-
let stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
14041
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
13824
|
+
constructor(stops = [], precision = 100) {
|
|
14042
13825
|
super(), this.cacheParams = {
|
|
14043
13826
|
CLEAN_THRESHOLD: 100,
|
|
14044
13827
|
L_TIME: 1e3
|
|
@@ -14056,9 +13839,7 @@ class ColorInterpolate extends LRU {
|
|
|
14056
13839
|
const rgba = this.rgbaSet.slice(4 * offset, 4 * offset + 4);
|
|
14057
13840
|
return `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3] / 255})`;
|
|
14058
13841
|
}
|
|
14059
|
-
GetOrCreate(x, y, w, h) {
|
|
14060
|
-
let stops = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
14061
|
-
let precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 100;
|
|
13842
|
+
GetOrCreate(x, y, w, h, stops = [], precision = 100) {
|
|
14062
13843
|
let str = `${x}${y}${w}${h}`;
|
|
14063
13844
|
stops.forEach(item => str += item.join()), str += precision;
|
|
14064
13845
|
let colorInter = this.dataMap.get(str);
|
|
@@ -14203,8 +13984,7 @@ class Graphic extends Node {
|
|
|
14203
13984
|
get globalTransMatrix() {
|
|
14204
13985
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
14205
13986
|
}
|
|
14206
|
-
constructor() {
|
|
14207
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13987
|
+
constructor(params = {}) {
|
|
14208
13988
|
var _a;
|
|
14209
13989
|
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);
|
|
14210
13990
|
}
|
|
@@ -14224,8 +14004,7 @@ class Graphic extends Node {
|
|
|
14224
14004
|
set2dMode() {
|
|
14225
14005
|
this.in3dMode = !1;
|
|
14226
14006
|
}
|
|
14227
|
-
getOffsetXY(attr) {
|
|
14228
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14007
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
14229
14008
|
var _a, _b;
|
|
14230
14009
|
const {
|
|
14231
14010
|
dx = attr.dx,
|
|
@@ -14336,7 +14115,7 @@ class Graphic extends Node {
|
|
|
14336
14115
|
const b = this.AABBBounds;
|
|
14337
14116
|
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;
|
|
14338
14117
|
}
|
|
14339
|
-
tryUpdateGlobalTransMatrix() {
|
|
14118
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
14340
14119
|
if (this._globalTransMatrix) {
|
|
14341
14120
|
if (this.parent) {
|
|
14342
14121
|
const m = this.parent.globalTransMatrix;
|
|
@@ -14348,8 +14127,7 @@ class Graphic extends Node {
|
|
|
14348
14127
|
shouldUpdateGlobalMatrix() {
|
|
14349
14128
|
return !0;
|
|
14350
14129
|
}
|
|
14351
|
-
tryUpdateLocalTransMatrix() {
|
|
14352
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14130
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
14353
14131
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
14354
14132
|
}
|
|
14355
14133
|
shouldUpdateAABBBounds() {
|
|
@@ -14389,23 +14167,17 @@ class Graphic extends Node {
|
|
|
14389
14167
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
14390
14168
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
14391
14169
|
}
|
|
14392
|
-
setAttributesAndPreventAnimate(params) {
|
|
14393
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14394
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14170
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
14395
14171
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
14396
14172
|
Object.keys(params).forEach(key => {
|
|
14397
14173
|
animate.preventAttr(key);
|
|
14398
14174
|
});
|
|
14399
14175
|
});
|
|
14400
14176
|
}
|
|
14401
|
-
setAttributes(params) {
|
|
14402
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14403
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14177
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
14404
14178
|
(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);
|
|
14405
14179
|
}
|
|
14406
|
-
_setAttributes(params) {
|
|
14407
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14408
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14180
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
14409
14181
|
const keys = Object.keys(params);
|
|
14410
14182
|
for (let i = 0; i < keys.length; i++) {
|
|
14411
14183
|
const key = keys[i];
|
|
@@ -14420,16 +14192,14 @@ class Graphic extends Node {
|
|
|
14420
14192
|
}, this.attribute, key, context);
|
|
14421
14193
|
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);
|
|
14422
14194
|
}
|
|
14423
|
-
needUpdateTags(keys) {
|
|
14424
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
14195
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
14425
14196
|
for (let i = 0; i < k.length; i++) {
|
|
14426
14197
|
const attrKey = k[i];
|
|
14427
14198
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
14428
14199
|
}
|
|
14429
14200
|
return !1;
|
|
14430
14201
|
}
|
|
14431
|
-
needUpdateTag(key) {
|
|
14432
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
14202
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
14433
14203
|
for (let i = 0; i < k.length; i++) {
|
|
14434
14204
|
if (key === k[i]) return !0;
|
|
14435
14205
|
}
|
|
@@ -14585,8 +14355,7 @@ class Graphic extends Node {
|
|
|
14585
14355
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
14586
14356
|
}), this.normalAttrs = newNormalAttrs;
|
|
14587
14357
|
}
|
|
14588
|
-
stopStateAnimates() {
|
|
14589
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
14358
|
+
stopStateAnimates(type = "end") {
|
|
14590
14359
|
this.animates && this.animates.forEach(animate => {
|
|
14591
14360
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
14592
14361
|
});
|
|
@@ -14750,8 +14519,7 @@ class Graphic extends Node {
|
|
|
14750
14519
|
var _a;
|
|
14751
14520
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
14752
14521
|
}
|
|
14753
|
-
onSetStage(cb) {
|
|
14754
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14522
|
+
onSetStage(cb, immediate = !1) {
|
|
14755
14523
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
14756
14524
|
}
|
|
14757
14525
|
attachShadow(shadowRoot) {
|
|
@@ -14772,8 +14540,7 @@ class Graphic extends Node {
|
|
|
14772
14540
|
createPathProxy(path) {
|
|
14773
14541
|
return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
14774
14542
|
}
|
|
14775
|
-
loadImage(image) {
|
|
14776
|
-
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14543
|
+
loadImage(image, background = !1) {
|
|
14777
14544
|
if (!image || background && backgroundNotImage(image)) return;
|
|
14778
14545
|
const url = image;
|
|
14779
14546
|
this.resources || (this.resources = new Map());
|
|
@@ -14803,8 +14570,7 @@ class Graphic extends Node {
|
|
|
14803
14570
|
animate.stop();
|
|
14804
14571
|
});
|
|
14805
14572
|
}
|
|
14806
|
-
stopAnimates() {
|
|
14807
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14573
|
+
stopAnimates(stopChildren = !1) {
|
|
14808
14574
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
14809
14575
|
c.stopAnimates(stopChildren);
|
|
14810
14576
|
});
|
|
@@ -14952,8 +14718,7 @@ let Group$1 = class Group extends Graphic {
|
|
|
14952
14718
|
_updateChildToStage(child) {
|
|
14953
14719
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
14954
14720
|
}
|
|
14955
|
-
appendChild(node) {
|
|
14956
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
14721
|
+
appendChild(node, addStage = !0) {
|
|
14957
14722
|
const data = super.appendChild(node);
|
|
14958
14723
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
14959
14724
|
}
|
|
@@ -14970,8 +14735,7 @@ let Group$1 = class Group extends Graphic {
|
|
|
14970
14735
|
const data = super.removeChild(child);
|
|
14971
14736
|
return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
|
|
14972
14737
|
}
|
|
14973
|
-
removeAllChild() {
|
|
14974
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14738
|
+
removeAllChild(deep = !1) {
|
|
14975
14739
|
this.forEachChildren(child => {
|
|
14976
14740
|
this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
14977
14741
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -14991,8 +14755,7 @@ let Group$1 = class Group extends Graphic {
|
|
|
14991
14755
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
14992
14756
|
});
|
|
14993
14757
|
}
|
|
14994
|
-
tryUpdateGlobalTransMatrix() {
|
|
14995
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14758
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
14996
14759
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
14997
14760
|
if (this._globalTransMatrix) {
|
|
14998
14761
|
if (this.parent) {
|
|
@@ -15066,8 +14829,7 @@ class Layer extends Group$1 {
|
|
|
15066
14829
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
15067
14830
|
}), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
|
|
15068
14831
|
}
|
|
15069
|
-
combineSubLayer() {
|
|
15070
|
-
let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14832
|
+
combineSubLayer(removeIncrementalKey = !0) {
|
|
15071
14833
|
const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
|
|
15072
14834
|
this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
|
|
15073
14835
|
l.group && (l.group.incremental = 0);
|
|
@@ -15176,10 +14938,9 @@ let DefaultLayerService = DefaultLayerService_1 = class {
|
|
|
15176
14938
|
let layerHandler;
|
|
15177
14939
|
return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
|
|
15178
14940
|
}
|
|
15179
|
-
createLayer(stage
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
};
|
|
14941
|
+
createLayer(stage, options = {
|
|
14942
|
+
main: !1
|
|
14943
|
+
}) {
|
|
15183
14944
|
var _a;
|
|
15184
14945
|
this.tryInit();
|
|
15185
14946
|
let layerMode = this.getRecommendedLayerType(options.layerMode);
|
|
@@ -15420,8 +15181,7 @@ const InteractiveSubRenderContribution = Symbol.for("InteractiveSubRenderContrib
|
|
|
15420
15181
|
function textDrawOffsetX(textAlign, width) {
|
|
15421
15182
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
15422
15183
|
}
|
|
15423
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
15424
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
15184
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
15425
15185
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
15426
15186
|
}
|
|
15427
15187
|
function textAttributesToStyle(attrs) {
|
|
@@ -15645,10 +15405,9 @@ const updateBoundsOfCommonOuterBorder = (attribute, theme, aabbBounds) => {
|
|
|
15645
15405
|
|
|
15646
15406
|
const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
15647
15407
|
class Circle extends Graphic {
|
|
15648
|
-
constructor(
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
};
|
|
15408
|
+
constructor(params = {
|
|
15409
|
+
radius: 1
|
|
15410
|
+
}) {
|
|
15652
15411
|
super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
15653
15412
|
}
|
|
15654
15413
|
isValid() {
|
|
@@ -15730,10 +15489,7 @@ class CanvasTextLayout {
|
|
|
15730
15489
|
} else bbox.yOffset = -bbox.height;
|
|
15731
15490
|
return bbox;
|
|
15732
15491
|
}
|
|
15733
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
15734
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
15735
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
15736
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
15492
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
15737
15493
|
const {
|
|
15738
15494
|
lineWidth: lineWidth,
|
|
15739
15495
|
suffixPosition = "end",
|
|
@@ -15856,11 +15612,10 @@ class Text extends Graphic {
|
|
|
15856
15612
|
get isMultiLine() {
|
|
15857
15613
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
15858
15614
|
}
|
|
15859
|
-
constructor(
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
};
|
|
15615
|
+
constructor(params = {
|
|
15616
|
+
text: "",
|
|
15617
|
+
fontSize: 16
|
|
15618
|
+
}) {
|
|
15864
15619
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
15865
15620
|
}
|
|
15866
15621
|
isValid() {
|
|
@@ -16192,12 +15947,10 @@ class Text extends Graphic {
|
|
|
16192
15947
|
var _a;
|
|
16193
15948
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
16194
15949
|
}
|
|
16195
|
-
needUpdateTags(keys) {
|
|
16196
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
15950
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
16197
15951
|
return super.needUpdateTags(keys, k);
|
|
16198
15952
|
}
|
|
16199
|
-
needUpdateTag(key) {
|
|
16200
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
15953
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
16201
15954
|
return super.needUpdateTag(key, k);
|
|
16202
15955
|
}
|
|
16203
15956
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -16256,19 +16009,15 @@ const updateBoundsOfSymbolOuterBorder = (attribute, symbolTheme, aabbBounds) =>
|
|
|
16256
16009
|
|
|
16257
16010
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16258
16011
|
let Symbol$1 = class Symbol extends Graphic {
|
|
16259
|
-
constructor(
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
};
|
|
16012
|
+
constructor(params = {
|
|
16013
|
+
symbolType: "circle"
|
|
16014
|
+
}) {
|
|
16263
16015
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
16264
16016
|
}
|
|
16265
16017
|
getParsedPath() {
|
|
16266
16018
|
return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
|
|
16267
16019
|
}
|
|
16268
|
-
getParsedPath2D() {
|
|
16269
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
16270
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16271
|
-
let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
16020
|
+
getParsedPath2D(x = 0, y = 0, size = 1) {
|
|
16272
16021
|
let path = null;
|
|
16273
16022
|
try {
|
|
16274
16023
|
path = new Path2D();
|
|
@@ -16353,8 +16102,7 @@ function createSymbol(attributes) {
|
|
|
16353
16102
|
|
|
16354
16103
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16355
16104
|
let Line$1 = class Line extends Graphic {
|
|
16356
|
-
constructor() {
|
|
16357
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16105
|
+
constructor(params = {}) {
|
|
16358
16106
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
16359
16107
|
}
|
|
16360
16108
|
isValid() {
|
|
@@ -16556,9 +16304,7 @@ class Glyph extends Graphic {
|
|
|
16556
16304
|
g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
|
|
16557
16305
|
});
|
|
16558
16306
|
}
|
|
16559
|
-
setAttributes(params) {
|
|
16560
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16561
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
16307
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
16562
16308
|
super.setAttributes(params, forceUpdateTag, context), this.subGraphic.forEach(g => {
|
|
16563
16309
|
g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
|
|
16564
16310
|
});
|
|
@@ -17214,8 +16960,7 @@ class Wrapper {
|
|
|
17214
16960
|
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);
|
|
17215
16961
|
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;
|
|
17216
16962
|
}
|
|
17217
|
-
deal(paragraph) {
|
|
17218
|
-
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16963
|
+
deal(paragraph, singleLine = !1) {
|
|
17219
16964
|
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)));
|
|
17220
16965
|
}
|
|
17221
16966
|
cut(paragraph, singleLine) {
|
|
@@ -18036,8 +17781,7 @@ class ShadowRoot extends Group$1 {
|
|
|
18036
17781
|
addUpdateShapeAndBoundsTag() {
|
|
18037
17782
|
super.addUpdateShapeAndBoundsTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag();
|
|
18038
17783
|
}
|
|
18039
|
-
tryUpdateGlobalTransMatrix() {
|
|
18040
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
17784
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
18041
17785
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
18042
17786
|
const m = this.transMatrix;
|
|
18043
17787
|
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();
|
|
@@ -18567,9 +18311,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
|
|
|
18567
18311
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
18568
18312
|
|
|
18569
18313
|
const halfPi = pi$1 / 2;
|
|
18570
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
18571
|
-
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
18572
|
-
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
18314
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
18573
18315
|
let cornerRadius;
|
|
18574
18316
|
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$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
18575
18317
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -18910,8 +18652,7 @@ class BaseRender {
|
|
|
18910
18652
|
doStroke: doStroke
|
|
18911
18653
|
};
|
|
18912
18654
|
}
|
|
18913
|
-
transform(graphic, graphicAttribute, context) {
|
|
18914
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
18655
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
18915
18656
|
const {
|
|
18916
18657
|
x = graphicAttribute.x,
|
|
18917
18658
|
y = graphicAttribute.y,
|
|
@@ -20032,7 +19773,7 @@ class DefaultBoundsAllocate {
|
|
|
20032
19773
|
get length() {
|
|
20033
19774
|
return this.pools.length;
|
|
20034
19775
|
}
|
|
20035
|
-
release() {
|
|
19776
|
+
release(...params) {
|
|
20036
19777
|
this.pools = [];
|
|
20037
19778
|
}
|
|
20038
19779
|
}
|
|
@@ -20252,11 +19993,12 @@ let DefaultCanvasTextRender = class extends BaseRender {
|
|
|
20252
19993
|
DefaultCanvasTextRender = __decorate$1e([injectable(), __param$C(0, inject(ContributionProvider)), __param$C(0, named(TextRenderContribution)), __metadata$Y("design:paramtypes", [Object])], DefaultCanvasTextRender);
|
|
20253
19994
|
|
|
20254
19995
|
function drawPolygon(path, points, x, y) {
|
|
20255
|
-
|
|
20256
|
-
|
|
19996
|
+
if (points && points.length) {
|
|
19997
|
+
path.moveTo(points[0].x + x, points[0].y + y);
|
|
19998
|
+
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
19999
|
+
}
|
|
20257
20000
|
}
|
|
20258
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
20259
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
20001
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
20260
20002
|
var _a;
|
|
20261
20003
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
20262
20004
|
let startI = 0,
|
|
@@ -21015,7 +20757,7 @@ let DefaultPluginService = class {
|
|
|
21015
20757
|
unRegister(plugin) {
|
|
21016
20758
|
"onStartupFinished" === plugin.activeEvent ? this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1) : "onRegister" === plugin.activeEvent && this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(plugin), 1), plugin.deactivate(this);
|
|
21017
20759
|
}
|
|
21018
|
-
release() {
|
|
20760
|
+
release(...params) {
|
|
21019
20761
|
this.onStartupFinishedPlugin.forEach(plugin => {
|
|
21020
20762
|
plugin.deactivate(this);
|
|
21021
20763
|
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
|
|
@@ -21162,9 +20904,7 @@ function parseChildMap(graphic, defaultZIndex, reverse) {
|
|
|
21162
20904
|
zIdxArray: zIdxArray
|
|
21163
20905
|
};
|
|
21164
20906
|
}
|
|
21165
|
-
function foreach(graphic, defaultZIndex, cb) {
|
|
21166
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21167
|
-
let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
20907
|
+
function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
21168
20908
|
let needSort = !1;
|
|
21169
20909
|
if (sort3d) needSort = !0;else {
|
|
21170
20910
|
let lastZIndex;
|
|
@@ -21195,14 +20935,12 @@ function foreach(graphic, defaultZIndex, cb) {
|
|
|
21195
20935
|
}
|
|
21196
20936
|
} else graphic.forEachChildren(cb, reverse);
|
|
21197
20937
|
}
|
|
21198
|
-
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
21199
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
20938
|
+
function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
21200
20939
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
21201
20940
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
21202
20941
|
});
|
|
21203
20942
|
}
|
|
21204
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
21205
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
20943
|
+
function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
21206
20944
|
let needSort = !1;
|
|
21207
20945
|
graphic.forEachChildren((item, i) => {
|
|
21208
20946
|
const {
|
|
@@ -21952,8 +21690,7 @@ class Stage extends Group$1 {
|
|
|
21952
21690
|
set ticker(ticker) {
|
|
21953
21691
|
ticker.bindStage(this), this._ticker && this._ticker.removeListener("tick", this.afterTickCb), ticker.addTimeline(this.timeline), this._ticker = ticker, this._ticker.on("tick", this.afterTickCb);
|
|
21954
21692
|
}
|
|
21955
|
-
constructor() {
|
|
21956
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21693
|
+
constructor(params = {}) {
|
|
21957
21694
|
var _a, _b;
|
|
21958
21695
|
super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
|
|
21959
21696
|
if (!(this._skipRender < 0)) if (visible) {
|
|
@@ -21996,8 +21733,7 @@ class Stage extends Group$1 {
|
|
|
21996
21733
|
startAnimate() {
|
|
21997
21734
|
this._ticker && this.timeline && (this._ticker.start(), this.timeline.resume());
|
|
21998
21735
|
}
|
|
21999
|
-
pauseRender() {
|
|
22000
|
-
let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
21736
|
+
pauseRender(sr = -1) {
|
|
22001
21737
|
this._skipRender = sr;
|
|
22002
21738
|
}
|
|
22003
21739
|
resumeRender() {
|
|
@@ -22019,8 +21755,7 @@ class Stage extends Group$1 {
|
|
|
22019
21755
|
optmize(params) {
|
|
22020
21756
|
this.optmizeRender(params.skipRenderWithOutRange), this.params.optimize = params;
|
|
22021
21757
|
}
|
|
22022
|
-
optmizeRender() {
|
|
22023
|
-
let skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
21758
|
+
optmizeRender(skipRenderWithOutRange = !1) {
|
|
22024
21759
|
skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(this._onVisibleChange));
|
|
22025
21760
|
}
|
|
22026
21761
|
getTimeline() {
|
|
@@ -22274,18 +22009,15 @@ class Stage extends Group$1 {
|
|
|
22274
22009
|
renderStyle: this.renderStyle
|
|
22275
22010
|
}, params)));
|
|
22276
22011
|
}
|
|
22277
|
-
resizeWindow(w, h) {
|
|
22278
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22012
|
+
resizeWindow(w, h, rerender = !0) {
|
|
22279
22013
|
this.window.resize(w, h), rerender && this.render();
|
|
22280
22014
|
}
|
|
22281
|
-
resize(w, h) {
|
|
22282
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22015
|
+
resize(w, h, rerender = !0) {
|
|
22283
22016
|
"released" !== this.releaseStatus && (this.window.hasSubView() || this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.window.resize(w, h), this.forEachChildren(c => {
|
|
22284
22017
|
c.resize(w, h);
|
|
22285
22018
|
}), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render());
|
|
22286
22019
|
}
|
|
22287
|
-
resizeView(w, h) {
|
|
22288
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22020
|
+
resizeView(w, h, rerender = !0) {
|
|
22289
22021
|
"released" !== this.releaseStatus && (this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.forEachChildren(c => {
|
|
22290
22022
|
c.resizeView(w, h);
|
|
22291
22023
|
}), this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), {
|
|
@@ -22299,8 +22031,7 @@ class Stage extends Group$1 {
|
|
|
22299
22031
|
c.resizeView(this.viewBox.width(), this.viewBox.height());
|
|
22300
22032
|
}), isRerender && this.render();
|
|
22301
22033
|
}
|
|
22302
|
-
setDpr(dpr) {
|
|
22303
|
-
let rerender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
22034
|
+
setDpr(dpr, rerender = !0) {
|
|
22304
22035
|
this.forEachChildren(c => {
|
|
22305
22036
|
c.setDpr(dpr);
|
|
22306
22037
|
}), rerender && this.render();
|
|
@@ -22348,8 +22079,7 @@ class Stage extends Group$1 {
|
|
|
22348
22079
|
});
|
|
22349
22080
|
});
|
|
22350
22081
|
}
|
|
22351
|
-
renderToNewWindow() {
|
|
22352
|
-
let viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
22082
|
+
renderToNewWindow(fullImage = !0, viewBox) {
|
|
22353
22083
|
if ("released" === this.releaseStatus) return;
|
|
22354
22084
|
const window = container.get(VWindow),
|
|
22355
22085
|
x1 = viewBox ? -viewBox.x1 : 0,
|
|
@@ -22373,9 +22103,7 @@ class Stage extends Group$1 {
|
|
|
22373
22103
|
title: ""
|
|
22374
22104
|
}), this.renderTo(window), window;
|
|
22375
22105
|
}
|
|
22376
|
-
toCanvas() {
|
|
22377
|
-
let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
22378
|
-
let viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
22106
|
+
toCanvas(fullImage = !0, viewBox) {
|
|
22379
22107
|
if ("released" === this.releaseStatus) return;
|
|
22380
22108
|
const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
|
|
22381
22109
|
return c.nativeCanvas ? c.nativeCanvas : null;
|
|
@@ -22437,7 +22165,7 @@ var __decorate$11 = undefined && undefined.__decorate || function (decorators, t
|
|
|
22437
22165
|
});
|
|
22438
22166
|
};
|
|
22439
22167
|
let BaseEnvContribution = class {
|
|
22440
|
-
configure(service) {
|
|
22168
|
+
configure(service, ...p) {
|
|
22441
22169
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
22442
22170
|
}
|
|
22443
22171
|
getNativeAABBBounds(dom) {
|
|
@@ -22540,7 +22268,7 @@ let BaseWindowHandlerContribution = class {
|
|
|
22540
22268
|
configure(window, global) {
|
|
22541
22269
|
global.env === this.type && window.setWindowHandler(this);
|
|
22542
22270
|
}
|
|
22543
|
-
release() {
|
|
22271
|
+
release(...params) {
|
|
22544
22272
|
this.releaseWindow();
|
|
22545
22273
|
}
|
|
22546
22274
|
isVisible(bbox) {
|
|
@@ -23914,8 +23642,7 @@ const calcDirection = (start, end) => {
|
|
|
23914
23642
|
};
|
|
23915
23643
|
};
|
|
23916
23644
|
class Gesture extends EventEmitter {
|
|
23917
|
-
constructor(element) {
|
|
23918
|
-
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23645
|
+
constructor(element, config = {}) {
|
|
23919
23646
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
23920
23647
|
super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
|
|
23921
23648
|
this.startTime = clock.now();
|
|
@@ -24252,8 +23979,7 @@ let BrowserContext2d = class {
|
|
|
24252
23979
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
24253
23980
|
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = dpr, this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this._clearMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.baseGlobalAlpha = 1;
|
|
24254
23981
|
}
|
|
24255
|
-
reset() {
|
|
24256
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
23982
|
+
reset(setTransform = !0) {
|
|
24257
23983
|
this.stack.length && Logger.getInstance().warn("可能存在bug,matrix没有清空"), this.matrix.setValue(1, 0, 0, 1, 0, 0), this.applyedMatrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack.length = 0, setTransform && this.nativeContext.setTransform(1, 0, 0, 1, 0, 0);
|
|
24258
23984
|
}
|
|
24259
23985
|
getCanvas() {
|
|
@@ -24262,8 +23988,7 @@ let BrowserContext2d = class {
|
|
|
24262
23988
|
getContext() {
|
|
24263
23989
|
return this.nativeContext;
|
|
24264
23990
|
}
|
|
24265
|
-
setTransformForCurrent() {
|
|
24266
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
23991
|
+
setTransformForCurrent(force = !1) {
|
|
24267
23992
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix.setValue(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f), this.nativeContext.setTransform(this.matrix.a, this.matrix.b, this.matrix.c, this.matrix.d, this.matrix.e, this.matrix.f));
|
|
24268
23993
|
}
|
|
24269
23994
|
get currentMatrix() {
|
|
@@ -24281,8 +24006,7 @@ let BrowserContext2d = class {
|
|
|
24281
24006
|
highPerformanceRestore() {
|
|
24282
24007
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
24283
24008
|
}
|
|
24284
|
-
rotate(rad) {
|
|
24285
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24009
|
+
rotate(rad, setTransform = !0) {
|
|
24286
24010
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
24287
24011
|
}
|
|
24288
24012
|
save() {
|
|
@@ -24293,55 +24017,41 @@ let BrowserContext2d = class {
|
|
|
24293
24017
|
const matrix = this.cloneMatrix(this.matrix);
|
|
24294
24018
|
this.stack.push(matrix);
|
|
24295
24019
|
}
|
|
24296
|
-
scale(sx, sy) {
|
|
24297
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24020
|
+
scale(sx, sy, setTransform = !0) {
|
|
24298
24021
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
24299
24022
|
}
|
|
24300
|
-
setScale(sx, sy) {
|
|
24301
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24023
|
+
setScale(sx, sy, setTransform = !0) {
|
|
24302
24024
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
24303
24025
|
}
|
|
24304
|
-
scalePoint(sx, sy, px, py) {
|
|
24305
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
24026
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
24306
24027
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
24307
24028
|
}
|
|
24308
|
-
setTransform(a, b, c, d, e, f) {
|
|
24309
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
24310
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
24029
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
24311
24030
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
24312
24031
|
}
|
|
24313
|
-
setTransformFromMatrix(matrix) {
|
|
24314
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24315
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
24032
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
24316
24033
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
24317
24034
|
}
|
|
24318
|
-
resetTransform() {
|
|
24319
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24320
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
24035
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
24321
24036
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
24322
24037
|
}
|
|
24323
|
-
transform(a, b, c, d, e, f) {
|
|
24324
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
24038
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
24325
24039
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
24326
24040
|
}
|
|
24327
24041
|
transformFromMatrix(matrix, setTransform) {
|
|
24328
24042
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
24329
24043
|
}
|
|
24330
|
-
translate(x, y) {
|
|
24331
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24044
|
+
translate(x, y, setTransform = !0) {
|
|
24332
24045
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
24333
24046
|
}
|
|
24334
|
-
rotateDegrees(deg) {
|
|
24335
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24047
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
24336
24048
|
const rad = deg * Math.PI / 180;
|
|
24337
24049
|
this.rotate(rad, setTransform);
|
|
24338
24050
|
}
|
|
24339
|
-
rotateAbout(rad, x, y) {
|
|
24340
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
24051
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
24341
24052
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
24342
24053
|
}
|
|
24343
|
-
rotateDegreesAbout(deg, x, y) {
|
|
24344
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
24054
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
24345
24055
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
24346
24056
|
}
|
|
24347
24057
|
beginPath() {
|
|
@@ -24478,8 +24188,7 @@ let BrowserContext2d = class {
|
|
|
24478
24188
|
isPointInStroke(x, y) {
|
|
24479
24189
|
return this.nativeContext.isPointInStroke(x, y);
|
|
24480
24190
|
}
|
|
24481
|
-
measureText(text) {
|
|
24482
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
24191
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
24483
24192
|
var _a, _b;
|
|
24484
24193
|
if (!method || "native" === method) return this.nativeContext.measureText(text);
|
|
24485
24194
|
this.mathTextMeasure || (this.mathTextMeasure = application.graphicUtil.createTextMeasureInstance({}, {}, () => this.canvas.nativeCanvas));
|
|
@@ -24622,19 +24331,16 @@ let BrowserContext2d = class {
|
|
|
24622
24331
|
this.fontFamily = fontFamily, this.fontSize = fontSize, _context.textAlign = null !== (_a = params.textAlign) && void 0 !== _a ? _a : defaultParams.textAlign, _context.textBaseline = null !== (_b = params.textBaseline) && void 0 !== _b ? _b : defaultParams.textBaseline;
|
|
24623
24332
|
}
|
|
24624
24333
|
draw() {}
|
|
24625
|
-
clearMatrix() {
|
|
24626
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24627
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
24334
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
24628
24335
|
this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
|
|
24629
24336
|
}
|
|
24630
24337
|
setClearMatrix(a, b, c, d, e, f) {
|
|
24631
24338
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
24632
24339
|
}
|
|
24633
|
-
onlyTranslate() {
|
|
24634
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
24340
|
+
onlyTranslate(dpr = this.dpr) {
|
|
24635
24341
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
24636
24342
|
}
|
|
24637
|
-
release() {
|
|
24343
|
+
release(...params) {
|
|
24638
24344
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
24639
24345
|
}
|
|
24640
24346
|
};
|
|
@@ -25041,8 +24747,7 @@ class DynamicB {
|
|
|
25041
24747
|
this.dom = dom;
|
|
25042
24748
|
}
|
|
25043
24749
|
}
|
|
25044
|
-
function createImageElement$1(src) {
|
|
25045
|
-
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
24750
|
+
function createImageElement$1(src, isSvg = !1) {
|
|
25046
24751
|
const img = document.createElement("img");
|
|
25047
24752
|
if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
25048
24753
|
const data = new Blob([src], {
|
|
@@ -25189,7 +24894,7 @@ let BrowserEnvContribution = class extends BaseEnvContribution {
|
|
|
25189
24894
|
getDocument() {
|
|
25190
24895
|
return document;
|
|
25191
24896
|
}
|
|
25192
|
-
release() {}
|
|
24897
|
+
release(...params) {}
|
|
25193
24898
|
getElementTop(element, baseWindow) {
|
|
25194
24899
|
let actualTop = element.offsetTop,
|
|
25195
24900
|
current = element.offsetParent;
|
|
@@ -25243,8 +24948,7 @@ const browserEnvModule = new ContainerModule(bind => {
|
|
|
25243
24948
|
browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
|
|
25244
24949
|
});
|
|
25245
24950
|
browserEnvModule.isBrowserBound = !1;
|
|
25246
|
-
function loadBrowserEnv(container) {
|
|
25247
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24951
|
+
function loadBrowserEnv(container, loadPicker = !0) {
|
|
25248
24952
|
loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
|
|
25249
24953
|
}
|
|
25250
24954
|
loadBrowserEnv.__loaded = !1;
|
|
@@ -25313,7 +25017,7 @@ let FeishuCanvas = class extends BaseCanvas {
|
|
|
25313
25017
|
init() {
|
|
25314
25018
|
this._context = new FeishuContext2d(this, this._dpr);
|
|
25315
25019
|
}
|
|
25316
|
-
release() {}
|
|
25020
|
+
release(...params) {}
|
|
25317
25021
|
};
|
|
25318
25022
|
FeishuCanvas.env = "feishu", FeishuCanvas = __decorate$R([injectable(), __metadata$G("design:paramtypes", [Object])], FeishuCanvas);
|
|
25319
25023
|
|
|
@@ -26076,7 +25780,7 @@ let FeishuEnvContribution = class extends BaseEnvContribution {
|
|
|
26076
25780
|
getDocument() {
|
|
26077
25781
|
return null;
|
|
26078
25782
|
}
|
|
26079
|
-
release() {}
|
|
25783
|
+
release(...params) {}
|
|
26080
25784
|
mapToCanvasPoint(event) {
|
|
26081
25785
|
var _a;
|
|
26082
25786
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -26088,8 +25792,7 @@ const feishuEnvModule = new ContainerModule(bind => {
|
|
|
26088
25792
|
feishuEnvModule.isFeishuBound || (feishuEnvModule.isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
|
|
26089
25793
|
});
|
|
26090
25794
|
feishuEnvModule.isFeishuBound = !1;
|
|
26091
|
-
function loadFeishuEnv(container) {
|
|
26092
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
25795
|
+
function loadFeishuEnv(container, loadPicker = !0) {
|
|
26093
25796
|
loadFeishuEnv.__loaded || (loadFeishuEnv.__loaded = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
|
|
26094
25797
|
}
|
|
26095
25798
|
loadFeishuEnv.__loaded = !1;
|
|
@@ -26138,8 +25841,7 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
26138
25841
|
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || !lineDash || (_context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
26139
25842
|
}
|
|
26140
25843
|
}
|
|
26141
|
-
measureText(text) {
|
|
26142
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
25844
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
26143
25845
|
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
26144
25846
|
return {
|
|
26145
25847
|
width: super.measureText(text, method).width,
|
|
@@ -26184,7 +25886,7 @@ let LynxCanvas = class extends BaseCanvas {
|
|
|
26184
25886
|
this._pixelWidth = width * this._dpr, this._pixelHeight = height * this._dpr, this._displayWidth = width, this._displayHeight = height, this._nativeCanvas.width = this._pixelWidth, this._nativeCanvas.height = this._pixelHeight, this._nativeCanvas.nativeCanvas && (this._nativeCanvas.nativeCanvas.width = this._pixelWidth, this._nativeCanvas.nativeCanvas.height = this._pixelHeight);
|
|
26185
25887
|
this._context.dpr = this._dpr;
|
|
26186
25888
|
}
|
|
26187
|
-
release() {}
|
|
25889
|
+
release(...params) {}
|
|
26188
25890
|
};
|
|
26189
25891
|
LynxCanvas.env = "lynx", LynxCanvas = __decorate$B([injectable(), __metadata$t("design:paramtypes", [Object])], LynxCanvas);
|
|
26190
25892
|
|
|
@@ -26374,8 +26076,7 @@ function makeUpCanvas$3(domref, canvasIdLists, canvasMap, freeCanvasIdx, freeCan
|
|
|
26374
26076
|
canvasMap.set(id, canvas), freeCanvasList.push(canvas);
|
|
26375
26077
|
}
|
|
26376
26078
|
}
|
|
26377
|
-
function createImageElement(src) {
|
|
26378
|
-
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
26079
|
+
function createImageElement(src, isSvg = !1) {
|
|
26379
26080
|
if (isSvg) return Promise.reject();
|
|
26380
26081
|
const img = lynx.createImage(src);
|
|
26381
26082
|
return new Promise((resolve, reject) => {
|
|
@@ -26458,7 +26159,7 @@ let LynxEnvContribution = class extends BaseEnvContribution {
|
|
|
26458
26159
|
getDocument() {
|
|
26459
26160
|
return null;
|
|
26460
26161
|
}
|
|
26461
|
-
release() {}
|
|
26162
|
+
release(...params) {}
|
|
26462
26163
|
};
|
|
26463
26164
|
LynxEnvContribution = __decorate$z([injectable(), __metadata$r("design:paramtypes", [])], LynxEnvContribution);
|
|
26464
26165
|
|
|
@@ -26466,8 +26167,7 @@ const lynxEnvModule = new ContainerModule(bind => {
|
|
|
26466
26167
|
lynxEnvModule.isLynxBound || (lynxEnvModule.isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
|
|
26467
26168
|
});
|
|
26468
26169
|
lynxEnvModule.isLynxBound = !1;
|
|
26469
|
-
function loadLynxEnv(container) {
|
|
26470
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
26170
|
+
function loadLynxEnv(container, loadPicker = !0) {
|
|
26471
26171
|
loadLynxEnv.__loaded || (loadLynxEnv.__loaded = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
|
|
26472
26172
|
}
|
|
26473
26173
|
loadLynxEnv.__loaded = !1;
|
|
@@ -26489,7 +26189,7 @@ let NodeContext2d = class extends BrowserContext2d {
|
|
|
26489
26189
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
26490
26190
|
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = null != dpr ? dpr : 1;
|
|
26491
26191
|
}
|
|
26492
|
-
release() {}
|
|
26192
|
+
release(...params) {}
|
|
26493
26193
|
};
|
|
26494
26194
|
NodeContext2d.env = "node", NodeContext2d = __decorate$y([injectable(), __metadata$q("design:paramtypes", [Object, Number])], NodeContext2d);
|
|
26495
26195
|
|
|
@@ -26510,7 +26210,7 @@ let NodeCanvas = class extends BaseCanvas {
|
|
|
26510
26210
|
init() {
|
|
26511
26211
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
26512
26212
|
}
|
|
26513
|
-
release() {
|
|
26213
|
+
release(...params) {
|
|
26514
26214
|
this._nativeCanvas.release && isFunction$1(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
26515
26215
|
}
|
|
26516
26216
|
};
|
|
@@ -26605,8 +26305,7 @@ let NodeWindowHandlerContribution = class extends BaseWindowHandlerContribution
|
|
|
26605
26305
|
getDpr() {
|
|
26606
26306
|
return this.canvas.dpr;
|
|
26607
26307
|
}
|
|
26608
|
-
getImageBuffer() {
|
|
26609
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "image/png";
|
|
26308
|
+
getImageBuffer(type = "image/png") {
|
|
26610
26309
|
return this.canvas.nativeCanvas.toBuffer(type);
|
|
26611
26310
|
}
|
|
26612
26311
|
addEventListener(type, listener, options) {}
|
|
@@ -26709,7 +26408,7 @@ let NodeEnvContribution = class extends BaseEnvContribution {
|
|
|
26709
26408
|
return null;
|
|
26710
26409
|
}
|
|
26711
26410
|
dispatchEvent(event) {}
|
|
26712
|
-
release() {}
|
|
26411
|
+
release(...params) {}
|
|
26713
26412
|
createOffscreenCanvas(params) {}
|
|
26714
26413
|
};
|
|
26715
26414
|
NodeEnvContribution = __decorate$v([injectable()], NodeEnvContribution);
|
|
@@ -26718,7 +26417,7 @@ const nodeEnvModule = new ContainerModule(bind => {
|
|
|
26718
26417
|
nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
|
|
26719
26418
|
});
|
|
26720
26419
|
nodeEnvModule.isNodeBound = !1;
|
|
26721
|
-
function loadNodeEnv(container) {
|
|
26420
|
+
function loadNodeEnv(container, loadPicker = !0) {
|
|
26722
26421
|
loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
|
|
26723
26422
|
}
|
|
26724
26423
|
loadNodeEnv.__loaded = !1;
|
|
@@ -26831,7 +26530,7 @@ let TaroCanvas = class extends BaseCanvas {
|
|
|
26831
26530
|
init() {
|
|
26832
26531
|
this._context = new TaroContext2d(this, this._dpr);
|
|
26833
26532
|
}
|
|
26834
|
-
release() {}
|
|
26533
|
+
release(...params) {}
|
|
26835
26534
|
};
|
|
26836
26535
|
TaroCanvas.env = "taro", TaroCanvas = __decorate$t([injectable(), __metadata$n("design:paramtypes", [Object])], TaroCanvas);
|
|
26837
26536
|
|
|
@@ -27100,7 +26799,7 @@ let TaroEnvContribution = class extends BaseEnvContribution {
|
|
|
27100
26799
|
getDocument() {
|
|
27101
26800
|
return null;
|
|
27102
26801
|
}
|
|
27103
|
-
release() {}
|
|
26802
|
+
release(...params) {}
|
|
27104
26803
|
};
|
|
27105
26804
|
TaroEnvContribution = __decorate$r([injectable(), __metadata$l("design:paramtypes", [])], TaroEnvContribution);
|
|
27106
26805
|
|
|
@@ -27108,8 +26807,7 @@ const taroEnvModule = new ContainerModule(bind => {
|
|
|
27108
26807
|
taroEnvModule.isTaroBound || (taroEnvModule.isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
|
|
27109
26808
|
});
|
|
27110
26809
|
taroEnvModule.isTaroBound = !1;
|
|
27111
|
-
function loadTaroEnv(container) {
|
|
27112
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
26810
|
+
function loadTaroEnv(container, loadPicker = !0) {
|
|
27113
26811
|
loadTaroEnv.__loaded || (loadTaroEnv.__loaded = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
|
|
27114
26812
|
}
|
|
27115
26813
|
loadTaroEnv.__loaded = !1;
|
|
@@ -27146,7 +26844,7 @@ let WxCanvas = class extends BaseCanvas {
|
|
|
27146
26844
|
init() {
|
|
27147
26845
|
this._context = new WxContext2d(this, this._dpr);
|
|
27148
26846
|
}
|
|
27149
|
-
release() {}
|
|
26847
|
+
release(...params) {}
|
|
27150
26848
|
};
|
|
27151
26849
|
WxCanvas.env = "wx", WxCanvas = __decorate$p([injectable(), __metadata$k("design:paramtypes", [Object])], WxCanvas);
|
|
27152
26850
|
|
|
@@ -27419,7 +27117,7 @@ let WxEnvContribution = class extends BaseEnvContribution {
|
|
|
27419
27117
|
getDocument() {
|
|
27420
27118
|
return null;
|
|
27421
27119
|
}
|
|
27422
|
-
release() {}
|
|
27120
|
+
release(...params) {}
|
|
27423
27121
|
mapToCanvasPoint(event) {
|
|
27424
27122
|
var _a;
|
|
27425
27123
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -27431,8 +27129,7 @@ const wxEnvModule = new ContainerModule(bind => {
|
|
|
27431
27129
|
wxEnvModule._isWxBound || (wxEnvModule._isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
|
|
27432
27130
|
});
|
|
27433
27131
|
wxEnvModule._isWxBound = !1;
|
|
27434
|
-
function loadWxEnv(container) {
|
|
27435
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27132
|
+
function loadWxEnv(container, loadPicker = !0) {
|
|
27436
27133
|
loadWxEnv.__loaded || (loadWxEnv.__loaded = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
|
|
27437
27134
|
}
|
|
27438
27135
|
loadWxEnv.__loaded = !1;
|
|
@@ -27441,7 +27138,7 @@ function loadAllEnv(container) {
|
|
|
27441
27138
|
loadAllModule(container);
|
|
27442
27139
|
}
|
|
27443
27140
|
function loadAllModule(container) {
|
|
27444
|
-
loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", (lastEnv, env) => {
|
|
27141
|
+
loadAllModule.__loaded || (loadAllModule.__loaded = !0, loadBrowserEnv(container, !1), loadFeishuEnv(container, !1), loadLynxEnv(container, !1), loadNodeEnv(container, !1), loadTaroEnv(container, !1), loadWxEnv(container, !1), loadCanvasPicker(container), vglobal.hooks.onSetEnv.tap("loadMathPicker", (lastEnv, env) => {
|
|
27445
27142
|
"browser" !== env && loadMathPicker(container);
|
|
27446
27143
|
}));
|
|
27447
27144
|
}
|
|
@@ -27477,7 +27174,7 @@ let TTCanvas = class extends BaseCanvas {
|
|
|
27477
27174
|
init() {
|
|
27478
27175
|
this._context = new TTContext2d(this, this._dpr);
|
|
27479
27176
|
}
|
|
27480
|
-
release() {}
|
|
27177
|
+
release(...params) {}
|
|
27481
27178
|
};
|
|
27482
27179
|
TTCanvas.env = "tt", TTCanvas = __decorate$l([injectable(), __metadata$h("design:paramtypes", [Object])], TTCanvas);
|
|
27483
27180
|
|
|
@@ -27745,7 +27442,7 @@ let TTEnvContribution = class extends BaseEnvContribution {
|
|
|
27745
27442
|
getDocument() {
|
|
27746
27443
|
return null;
|
|
27747
27444
|
}
|
|
27748
|
-
release() {}
|
|
27445
|
+
release(...params) {}
|
|
27749
27446
|
mapToCanvasPoint(event) {
|
|
27750
27447
|
var _a;
|
|
27751
27448
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -27757,8 +27454,7 @@ const ttEnvModule = new ContainerModule(bind => {
|
|
|
27757
27454
|
ttEnvModule.isTTBound || (ttEnvModule.isTTBound = !0, bind(TTEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TTEnvContribution));
|
|
27758
27455
|
});
|
|
27759
27456
|
ttEnvModule.isTTBound = !1;
|
|
27760
|
-
function loadTTEnv(container) {
|
|
27761
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27457
|
+
function loadTTEnv(container, loadPicker = !0) {
|
|
27762
27458
|
loadTTEnv.__loaded || (loadTTEnv.__loaded = !0, container.load(ttEnvModule), container.load(ttCanvasModule), container.load(ttWindowModule), loadPicker && loadMathPicker(container));
|
|
27763
27459
|
}
|
|
27764
27460
|
loadTTEnv.__loaded = !1;
|
|
@@ -27807,8 +27503,7 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
27807
27503
|
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || (lineDash && _context.setLineDash(lineDash), _context.lineDashOffset = lineDashOffset), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27808
27504
|
}
|
|
27809
27505
|
}
|
|
27810
|
-
measureText(text) {
|
|
27811
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
27506
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
27812
27507
|
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
27813
27508
|
return super.measureText(text, method);
|
|
27814
27509
|
}
|
|
@@ -27868,7 +27563,7 @@ let HarmonyCanvas = class extends BaseCanvas {
|
|
|
27868
27563
|
this._context = new HarmonyContext2d(this, this._dpr);
|
|
27869
27564
|
}
|
|
27870
27565
|
resize(width, height) {}
|
|
27871
|
-
release() {}
|
|
27566
|
+
release(...params) {}
|
|
27872
27567
|
};
|
|
27873
27568
|
HarmonyCanvas.env = "harmony", HarmonyCanvas = __decorate$h([injectable(), __metadata$e("design:paramtypes", [Object])], HarmonyCanvas);
|
|
27874
27569
|
|
|
@@ -28112,7 +27807,7 @@ let HarmonyEnvContribution = class extends BaseEnvContribution {
|
|
|
28112
27807
|
getDocument() {
|
|
28113
27808
|
return null;
|
|
28114
27809
|
}
|
|
28115
|
-
release() {}
|
|
27810
|
+
release(...params) {}
|
|
28116
27811
|
};
|
|
28117
27812
|
HarmonyEnvContribution = __decorate$f([injectable(), __metadata$c("design:paramtypes", [])], HarmonyEnvContribution);
|
|
28118
27813
|
|
|
@@ -28120,8 +27815,7 @@ const harmonyEnvModule = new ContainerModule(bind => {
|
|
|
28120
27815
|
harmonyEnvModule.isHarmonyBound || (harmonyEnvModule.isHarmonyBound = !0, bind(HarmonyEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(HarmonyEnvContribution));
|
|
28121
27816
|
});
|
|
28122
27817
|
harmonyEnvModule.isHarmonyBound = !1;
|
|
28123
|
-
function loadHarmonyEnv(container) {
|
|
28124
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27818
|
+
function loadHarmonyEnv(container, loadPicker = !0) {
|
|
28125
27819
|
loadHarmonyEnv.__loaded || (loadHarmonyEnv.__loaded = !0, container.load(harmonyEnvModule), container.load(harmonyCanvasModule), container.load(harmonyWindowModule), loadPicker && loadMathPicker(container));
|
|
28126
27820
|
}
|
|
28127
27821
|
loadHarmonyEnv.__loaded = !1;
|
|
@@ -28679,65 +28373,48 @@ function _registerText() {
|
|
|
28679
28373
|
_registerText.__loaded = !1;
|
|
28680
28374
|
const registerText = _registerText;
|
|
28681
28375
|
|
|
28682
|
-
function pseudoRandom(n) {
|
|
28683
|
-
let seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28376
|
+
function pseudoRandom(n, seed = 0) {
|
|
28684
28377
|
let hash = 3735928559 ^ seed;
|
|
28685
28378
|
return hash = (2654435769 ^ hash) + (hash << 6) + (hash >> 2), hash = 3432918353 * (hash ^ n), hash = hash << 15 | hash >>> 17, hash ^= hash << 25, hash += hash << 9, hash ^= hash >> 4, hash ^= hash << 18, hash |= 1, (hash >>> 0) % 2147483647 / 2147483647;
|
|
28686
28379
|
}
|
|
28687
|
-
function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28688
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28689
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28380
|
+
function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28690
28381
|
const targetRandomValue = 2 * pseudoRandom(row * columnCount + column) * Math.PI,
|
|
28691
28382
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
|
|
28692
28383
|
return Math.min(1, Math.max(0, _r));
|
|
28693
28384
|
}
|
|
28694
|
-
function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28695
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28696
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28385
|
+
function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28697
28386
|
const delay = column / columnCount,
|
|
28698
28387
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28699
28388
|
return Math.min(1, Math.max(0, _r));
|
|
28700
28389
|
}
|
|
28701
|
-
function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28702
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28703
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28390
|
+
function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28704
28391
|
const delay = (columnCount - 1 - column) / columnCount,
|
|
28705
28392
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28706
28393
|
return Math.min(1, Math.max(0, _r));
|
|
28707
28394
|
}
|
|
28708
|
-
function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28709
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28710
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28395
|
+
function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28711
28396
|
const delay = row / rowCount,
|
|
28712
28397
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28713
28398
|
return Math.min(1, Math.max(0, _r));
|
|
28714
28399
|
}
|
|
28715
|
-
function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28716
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28717
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28400
|
+
function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28718
28401
|
const delay = (rowCount - 1 - row) / rowCount,
|
|
28719
28402
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28720
28403
|
return Math.min(1, Math.max(0, _r));
|
|
28721
28404
|
}
|
|
28722
|
-
function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28723
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28724
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28405
|
+
function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28725
28406
|
const centerRow = rowCount / 2,
|
|
28726
28407
|
centerCol = columnCount / 2,
|
|
28727
28408
|
distance = Math.sqrt(Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)),
|
|
28728
28409
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28729
28410
|
return Math.min(1, Math.max(0, _r));
|
|
28730
28411
|
}
|
|
28731
|
-
function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28732
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28733
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28412
|
+
function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28734
28413
|
const delay = (row / rowCount + column / columnCount) / 2,
|
|
28735
28414
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28736
28415
|
return Math.min(1, Math.max(0, _r));
|
|
28737
28416
|
}
|
|
28738
|
-
function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28739
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28740
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28417
|
+
function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28741
28418
|
const centerRow = rowCount / 2,
|
|
28742
28419
|
centerCol = columnCount / 2,
|
|
28743
28420
|
angle = Math.atan2(row - centerRow, column - centerCol),
|
|
@@ -28745,33 +28422,25 @@ function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
|
28745
28422
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28746
28423
|
return Math.min(1, Math.max(0, _r));
|
|
28747
28424
|
}
|
|
28748
|
-
function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28749
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28750
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28425
|
+
function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28751
28426
|
const centerRow = rowCount / 2,
|
|
28752
28427
|
centerCol = columnCount / 2,
|
|
28753
28428
|
normalizedDistance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2)) / Math.sqrt(Math.pow(rowCount / 2, 2) + Math.pow(columnCount / 2, 2)),
|
|
28754
28429
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI * 3 - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28755
28430
|
return Math.min(1, Math.max(0, _r));
|
|
28756
28431
|
}
|
|
28757
|
-
function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28758
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28759
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28432
|
+
function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28760
28433
|
const delay = (row + column) % (rowCount + columnCount) / (rowCount + columnCount),
|
|
28761
28434
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
|
|
28762
28435
|
return Math.min(1, Math.max(0, _r));
|
|
28763
28436
|
}
|
|
28764
|
-
function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28765
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28766
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28437
|
+
function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28767
28438
|
const rowPhase = row / rowCount,
|
|
28768
28439
|
colPhase = column / columnCount,
|
|
28769
28440
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * rowPhase * Math.PI) * Math.sin(2 * ratio * Math.PI - 2 * colPhase * Math.PI) + 1) / 2;
|
|
28770
28441
|
return Math.min(1, Math.max(0, _r));
|
|
28771
28442
|
}
|
|
28772
|
-
function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28773
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28774
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28443
|
+
function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28775
28444
|
const centerRow = rowCount / 2,
|
|
28776
28445
|
centerCol = columnCount / 2,
|
|
28777
28446
|
distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2)),
|
|
@@ -28780,41 +28449,31 @@ function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
|
28780
28449
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
|
|
28781
28450
|
return Math.min(1, Math.max(0, _r));
|
|
28782
28451
|
}
|
|
28783
|
-
function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28784
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28785
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28452
|
+
function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28786
28453
|
const centerCol = columnCount / 2,
|
|
28787
28454
|
distance = Math.abs(column - centerCol) / centerCol,
|
|
28788
28455
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28789
28456
|
return Math.min(1, Math.max(0, _r));
|
|
28790
28457
|
}
|
|
28791
|
-
function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28792
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28793
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28458
|
+
function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28794
28459
|
const centerCol = columnCount / 2,
|
|
28795
28460
|
distance = 1 - Math.abs(column - centerCol) / centerCol,
|
|
28796
28461
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28797
28462
|
return Math.min(1, Math.max(0, _r));
|
|
28798
28463
|
}
|
|
28799
|
-
function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28800
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28801
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28464
|
+
function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28802
28465
|
const centerRow = rowCount / 2,
|
|
28803
28466
|
distance = Math.abs(row - centerRow) / centerRow,
|
|
28804
28467
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28805
28468
|
return Math.min(1, Math.max(0, _r));
|
|
28806
28469
|
}
|
|
28807
|
-
function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28808
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28809
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28470
|
+
function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28810
28471
|
const centerRow = rowCount / 2,
|
|
28811
28472
|
distance = 1 - Math.abs(row - centerRow) / centerRow,
|
|
28812
28473
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28813
28474
|
return Math.min(1, Math.max(0, _r));
|
|
28814
28475
|
}
|
|
28815
|
-
function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28816
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28817
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28476
|
+
function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28818
28477
|
const centerRow = rowCount / 2,
|
|
28819
28478
|
centerCol = columnCount / 2,
|
|
28820
28479
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28822,9 +28481,7 @@ function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic)
|
|
|
28822
28481
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28823
28482
|
return Math.min(1, Math.max(0, _r));
|
|
28824
28483
|
}
|
|
28825
|
-
function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28826
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28827
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28484
|
+
function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28828
28485
|
const centerRow = rowCount / 2,
|
|
28829
28486
|
centerCol = columnCount / 2,
|
|
28830
28487
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28832,9 +28489,7 @@ function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic)
|
|
|
28832
28489
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28833
28490
|
return Math.min(1, Math.max(0, _r));
|
|
28834
28491
|
}
|
|
28835
|
-
function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28836
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28837
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28492
|
+
function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28838
28493
|
const centerRow = rowCount / 2,
|
|
28839
28494
|
centerCol = columnCount / 2,
|
|
28840
28495
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28844,9 +28499,7 @@ function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
|
28844
28499
|
_r = minRatio + amplitude * ((Math.sin(wavePhase - 4 * normalizedDistance * Math.PI) + 1) / 2) * (.7 * decay + .3);
|
|
28845
28500
|
return Math.min(1, Math.max(0, _r));
|
|
28846
28501
|
}
|
|
28847
|
-
function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28848
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28849
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28502
|
+
function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28850
28503
|
const index = row * columnCount + column,
|
|
28851
28504
|
phase = 2 * pseudoRandom(index, 0) * Math.PI,
|
|
28852
28505
|
speed = .5 * pseudoRandom(index, 1) + .5,
|
|
@@ -28989,8 +28642,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
28989
28642
|
}), this._clearDragEvents();
|
|
28990
28643
|
};
|
|
28991
28644
|
}
|
|
28992
|
-
setScrollRange(range) {
|
|
28993
|
-
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
28645
|
+
setScrollRange(range, render = !0) {
|
|
28994
28646
|
const {
|
|
28995
28647
|
direction = "horizontal",
|
|
28996
28648
|
limitRange = [0, 1],
|
|
@@ -29493,8 +29145,7 @@ const initTextMeasure$1 = (textSpec, option, useNaiveCanvas, defaultFontParams)
|
|
|
29493
29145
|
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
29494
29146
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
29495
29147
|
}, null != option ? option : {}), textSpec);
|
|
29496
|
-
function measureTextSize(text, textSpec) {
|
|
29497
|
-
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
29148
|
+
function measureTextSize(text, textSpec, defaultTextTheme = {}) {
|
|
29498
29149
|
if (!text) return {
|
|
29499
29150
|
width: 0,
|
|
29500
29151
|
height: 0
|
|
@@ -29515,12 +29166,10 @@ function measureTextSize(text, textSpec) {
|
|
|
29515
29166
|
height: bounds.height()
|
|
29516
29167
|
};
|
|
29517
29168
|
}
|
|
29518
|
-
function isRichText(attributes) {
|
|
29519
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29169
|
+
function isRichText(attributes, typeKey = "type") {
|
|
29520
29170
|
return "rich" === getTextType(attributes, typeKey);
|
|
29521
29171
|
}
|
|
29522
|
-
function getTextType(attributes) {
|
|
29523
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29172
|
+
function getTextType(attributes, typeKey = "type") {
|
|
29524
29173
|
var _a, _b;
|
|
29525
29174
|
return isObject$2(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";
|
|
29526
29175
|
}
|
|
@@ -29548,8 +29197,7 @@ function reactAttributeTransform(attributes) {
|
|
|
29548
29197
|
} = text;
|
|
29549
29198
|
return attributes.react = react, attributes.text = _originText, attributes.renderable = !1, attributes;
|
|
29550
29199
|
}
|
|
29551
|
-
function createTextGraphicByType(textAttributes) {
|
|
29552
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29200
|
+
function createTextGraphicByType(textAttributes, typeKey = "type") {
|
|
29553
29201
|
const textType = getTextType(textAttributes, typeKey);
|
|
29554
29202
|
return "rich" === textType ? graphicCreator.richtext(richTextAttributeTransform(textAttributes)) : ("html" === textType ? textAttributes = htmlAttributeTransform(textAttributes) : "react" === textType && (textAttributes = reactAttributeTransform(textAttributes)), graphicCreator.text(textAttributes));
|
|
29555
29203
|
}
|
|
@@ -30926,14 +30574,12 @@ function itemIntersect(item1, item2) {
|
|
|
30926
30574
|
return (null === (_a = item1.OBBBounds) || void 0 === _a ? void 0 : _a.empty()) || (null === (_b = item2.OBBBounds) || void 0 === _b ? void 0 : _b.empty()) ? isRectIntersect(item1.AABBBounds, item2.AABBBounds, !1) && (!item1.rotatedBounds || !item2.rotatedBounds || isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, !0)) : item1.OBBBounds.intersects(item2.OBBBounds);
|
|
30927
30575
|
}
|
|
30928
30576
|
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
30929
|
-
function isAngleVertical(angle) {
|
|
30930
|
-
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
30577
|
+
function isAngleVertical(angle, delta = DELTA_ANGLE) {
|
|
30931
30578
|
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
30932
30579
|
cos = hasAngle ? Math.cos(angle) : 1;
|
|
30933
30580
|
return hasAngle && Math.abs(cos) <= delta;
|
|
30934
30581
|
}
|
|
30935
|
-
function isAngleHorizontal(angle) {
|
|
30936
|
-
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
30582
|
+
function isAngleHorizontal(angle, delta = DELTA_ANGLE) {
|
|
30937
30583
|
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
30938
30584
|
sin = hasAngle ? Math.sin(angle) : 0;
|
|
30939
30585
|
return !hasAngle || Math.abs(sin) <= delta;
|
|
@@ -30945,8 +30591,7 @@ function getCircleLabelPosition(tickPosition, tickVector) {
|
|
|
30945
30591
|
y: tickPosition.y + tickVector[1]
|
|
30946
30592
|
};
|
|
30947
30593
|
}
|
|
30948
|
-
function getAxisBreakSymbolAttrs() {
|
|
30949
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30594
|
+
function getAxisBreakSymbolAttrs(props = {}) {
|
|
30950
30595
|
var _a, _b;
|
|
30951
30596
|
const {
|
|
30952
30597
|
style = {},
|
|
@@ -30971,9 +30616,7 @@ function getVerticalCoord(point, vector) {
|
|
|
30971
30616
|
y: point.y + vector[1]
|
|
30972
30617
|
};
|
|
30973
30618
|
}
|
|
30974
|
-
function getCircleVerticalVector(offset, point, center) {
|
|
30975
|
-
let inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
30976
|
-
let axisInside = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
30619
|
+
function getCircleVerticalVector(offset, point, center, inside = !1, axisInside = !1) {
|
|
30977
30620
|
const vector = [point.x - center.x, point.y - center.y];
|
|
30978
30621
|
return scale(vector, (inside ? -1 : 1) * (axisInside ? -1 : 1) * offset / length(vector));
|
|
30979
30622
|
}
|
|
@@ -31383,7 +31026,7 @@ class AxisBase extends AnimateComponent {
|
|
|
31383
31026
|
var _a;
|
|
31384
31027
|
if ("group" !== el.type && el.id) {
|
|
31385
31028
|
const oldEl = prevInnerView[el.id];
|
|
31386
|
-
if (el.
|
|
31029
|
+
if (el.setFinalAttributes(el.attribute), oldEl) {
|
|
31387
31030
|
oldEl.release();
|
|
31388
31031
|
const oldAttrs = oldEl.attribute,
|
|
31389
31032
|
finalAttrs = el.getFinalAttribute(),
|
|
@@ -31451,8 +31094,7 @@ function hasBounds(item) {
|
|
|
31451
31094
|
function reset$1(items) {
|
|
31452
31095
|
return items.forEach(item => item.setAttribute("opacity", 1)), items;
|
|
31453
31096
|
}
|
|
31454
|
-
function forceItemVisible$1(sourceItem, items, check, comparator) {
|
|
31455
|
-
let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
31097
|
+
function forceItemVisible$1(sourceItem, items, check, comparator, inverse = !1) {
|
|
31456
31098
|
if (check && !sourceItem.attribute.opacity) {
|
|
31457
31099
|
const remainLength = items.length;
|
|
31458
31100
|
if (remainLength > 1) {
|
|
@@ -31480,10 +31122,7 @@ function autoHide(labels, config) {
|
|
|
31480
31122
|
do {
|
|
31481
31123
|
items = reduce(items, sep);
|
|
31482
31124
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
31483
|
-
const shouldCheck =
|
|
31484
|
-
let checkLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
31485
|
-
return checkLength && length < 3 || visibility;
|
|
31486
|
-
},
|
|
31125
|
+
const shouldCheck = (length, visibility, checkLength = !0) => checkLength && length < 3 || visibility,
|
|
31487
31126
|
checkFirst = shouldCheck(items.length, config.firstVisible, !1);
|
|
31488
31127
|
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
31489
31128
|
const firstSourceItem = source[0],
|
|
@@ -31518,8 +31157,7 @@ function hasIntersect(items) {
|
|
|
31518
31157
|
function tryRotate(orient, items) {
|
|
31519
31158
|
"bottom" !== orient && "top" !== orient || rotateXAxis(orient, items), "left" !== orient && "right" !== orient || rotateYAxis(orient, items), genRotateBounds(items);
|
|
31520
31159
|
}
|
|
31521
|
-
function clampAngle() {
|
|
31522
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
31160
|
+
function clampAngle(angle = 0) {
|
|
31523
31161
|
if (angle < 0) for (; angle < 0;) angle += 2 * Math.PI;
|
|
31524
31162
|
if (angle > 0) for (; angle >= 2 * Math.PI;) angle -= 2 * Math.PI;
|
|
31525
31163
|
return angle;
|
|
@@ -31538,8 +31176,7 @@ function rotateXAxis(orient, items) {
|
|
|
31538
31176
|
}));
|
|
31539
31177
|
});
|
|
31540
31178
|
}
|
|
31541
|
-
function getXAxisLabelAlign(orient) {
|
|
31542
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
31179
|
+
function getXAxisLabelAlign(orient, angle = 0) {
|
|
31543
31180
|
let align = ["center", "left", "left", "left", "center", "right", "right", "right", "left"],
|
|
31544
31181
|
baseline = ["top", "top", "middle", "bottom", "bottom", "bottom", "middle", "top", "top"];
|
|
31545
31182
|
"top" === orient && (align = ["center", "right", "right", "right", "center", "left", "left", "left", "right"], baseline = ["bottom", "bottom", "middle", "top", "top", "top", "middle", "bottom", "bottom"]);
|
|
@@ -31550,8 +31187,7 @@ function getXAxisLabelAlign(orient) {
|
|
|
31550
31187
|
textBaseline: baseline[index]
|
|
31551
31188
|
};
|
|
31552
31189
|
}
|
|
31553
|
-
function getYAxisLabelAlign(orient) {
|
|
31554
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
31190
|
+
function getYAxisLabelAlign(orient, angle = 0) {
|
|
31555
31191
|
let align = ["right", "right", "center", "left", "left", "left", "center", "right", "right"],
|
|
31556
31192
|
baseline = ["middle", "middle", "top", "top", "middle", "middle", "bottom", "bottom", "middle"];
|
|
31557
31193
|
"right" === orient && (align = ["left", "left", "center", "right", "right", "right", "center", "left", "left"], baseline = ["middle", "middle", "bottom", "bottom", "middle", "middle", "top", "middle", "middle"]);
|
|
@@ -31729,8 +31365,7 @@ class LineAxisMixin {
|
|
|
31729
31365
|
} = this.attribute;
|
|
31730
31366
|
return [end.x - start.x, end.y - start.y];
|
|
31731
31367
|
}
|
|
31732
|
-
getVerticalVector(offset) {
|
|
31733
|
-
let inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
31368
|
+
getVerticalVector(offset, inside = !1, point) {
|
|
31734
31369
|
const {
|
|
31735
31370
|
verticalFactor = 1
|
|
31736
31371
|
} = this.attribute,
|
|
@@ -31949,9 +31584,10 @@ function commonInterpolateUpdate(key, from, to, ratio, step, target) {
|
|
|
31949
31584
|
function noop() {}
|
|
31950
31585
|
class Step {
|
|
31951
31586
|
constructor(type, props, duration, easing) {
|
|
31587
|
+
var _a;
|
|
31952
31588
|
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
31953
31589
|
this.target.setAttributes(this.target.attribute);
|
|
31954
|
-
}, 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;
|
|
31590
|
+
}, 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;
|
|
31955
31591
|
}
|
|
31956
31592
|
bind(target, animate) {
|
|
31957
31593
|
this.target = target, this.animate = animate, this.onBind(), this.syncAttributeUpdate();
|
|
@@ -31968,8 +31604,7 @@ class Step {
|
|
|
31968
31604
|
getLastProps() {
|
|
31969
31605
|
return this.prev ? this.prev.props || {} : this.animate.getStartProps();
|
|
31970
31606
|
}
|
|
31971
|
-
setDuration(duration) {
|
|
31972
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31607
|
+
setDuration(duration, updateDownstream = !0) {
|
|
31973
31608
|
this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
|
|
31974
31609
|
}
|
|
31975
31610
|
getDuration() {
|
|
@@ -31990,8 +31625,7 @@ class Step {
|
|
|
31990
31625
|
} else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
|
|
31991
31626
|
}), this.interpolateUpdateFunctions = funcs;
|
|
31992
31627
|
}
|
|
31993
|
-
setStartTime(time) {
|
|
31994
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31628
|
+
setStartTime(time, updateDownstream = !0) {
|
|
31995
31629
|
this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
|
|
31996
31630
|
}
|
|
31997
31631
|
getStartTime() {
|
|
@@ -32117,8 +31751,7 @@ class DefaultTimeline extends EventEmitter {
|
|
|
32117
31751
|
animate.release();
|
|
32118
31752
|
}), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
|
|
32119
31753
|
}
|
|
32120
|
-
removeAnimate(animate) {
|
|
32121
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31754
|
+
removeAnimate(animate, release = !0) {
|
|
32122
31755
|
const node = this.animateMap.get(animate);
|
|
32123
31756
|
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());
|
|
32124
31757
|
}
|
|
@@ -32156,10 +31789,7 @@ const defaultTimeline = new DefaultTimeline();
|
|
|
32156
31789
|
defaultTimeline.isGlobal = !0;
|
|
32157
31790
|
|
|
32158
31791
|
class Animate {
|
|
32159
|
-
constructor() {
|
|
32160
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
32161
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
32162
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
31792
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
32163
31793
|
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;
|
|
32164
31794
|
}
|
|
32165
31795
|
getStartProps() {
|
|
@@ -32180,9 +31810,7 @@ class Animate {
|
|
|
32180
31810
|
bind(target) {
|
|
32181
31811
|
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
32182
31812
|
}
|
|
32183
|
-
to(props) {
|
|
32184
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
32185
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
31813
|
+
to(props, duration = 300, easing = "linear") {
|
|
32186
31814
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
32187
31815
|
return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
|
|
32188
31816
|
}
|
|
@@ -32212,9 +31840,7 @@ class Animate {
|
|
|
32212
31840
|
this._endProps[key] = currentStep.props[key];
|
|
32213
31841
|
}), currentStep = currentStep.next;
|
|
32214
31842
|
}
|
|
32215
|
-
from(props) {
|
|
32216
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
32217
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
31843
|
+
from(props, duration = 300, easing = "linear") {
|
|
32218
31844
|
const step = new Step(AnimateStepType.from, props, duration, easing);
|
|
32219
31845
|
return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
|
|
32220
31846
|
}
|
|
@@ -32452,8 +32078,7 @@ class DefaultTicker extends EventEmitter {
|
|
|
32452
32078
|
}
|
|
32453
32079
|
return !1;
|
|
32454
32080
|
}
|
|
32455
|
-
start() {
|
|
32456
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32081
|
+
start(force = !1) {
|
|
32457
32082
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
32458
32083
|
if (!this.tickerHandler) return !1;
|
|
32459
32084
|
if (!force) {
|
|
@@ -32514,8 +32139,7 @@ class ManualTicker extends DefaultTicker {
|
|
|
32514
32139
|
tickAt(time) {
|
|
32515
32140
|
this.tickTo(time);
|
|
32516
32141
|
}
|
|
32517
|
-
start() {
|
|
32518
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32142
|
+
start(force = !1) {
|
|
32519
32143
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
32520
32144
|
if (!this.tickerHandler) return !1;
|
|
32521
32145
|
if (!force) {
|
|
@@ -32861,14 +32485,10 @@ class AnimateExecutor {
|
|
|
32861
32485
|
var _a, _b;
|
|
32862
32486
|
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;
|
|
32863
32487
|
}
|
|
32864
|
-
executeItem(params, graphic) {
|
|
32865
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
32866
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
32488
|
+
executeItem(params, graphic, index = 0, count = 1) {
|
|
32867
32489
|
return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
|
|
32868
32490
|
}
|
|
32869
|
-
_executeItem(params, graphic) {
|
|
32870
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
32871
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
32491
|
+
_executeItem(params, graphic, index = 0, count = 1) {
|
|
32872
32492
|
if (!graphic) return null;
|
|
32873
32493
|
const isTimeline = ("timeSlices" in params);
|
|
32874
32494
|
let animate = null;
|
|
@@ -33036,8 +32656,7 @@ class GraphicStateExtension {
|
|
|
33036
32656
|
}
|
|
33037
32657
|
|
|
33038
32658
|
class AnimateExtension {
|
|
33039
|
-
getAttributes() {
|
|
33040
|
-
let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32659
|
+
getAttributes(final = !1) {
|
|
33041
32660
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
33042
32661
|
}
|
|
33043
32662
|
animate(params) {
|
|
@@ -33062,10 +32681,10 @@ class AnimateExtension {
|
|
|
33062
32681
|
createTicker(stage) {
|
|
33063
32682
|
return new DefaultTicker(stage);
|
|
33064
32683
|
}
|
|
33065
|
-
|
|
32684
|
+
setFinalAttributes(finalAttribute) {
|
|
33066
32685
|
this.finalAttribute || (this.finalAttribute = {}), Object.assign(this.finalAttribute, finalAttribute);
|
|
33067
32686
|
}
|
|
33068
|
-
|
|
32687
|
+
initFinalAttributes(finalAttribute) {
|
|
33069
32688
|
this.finalAttribute = finalAttribute;
|
|
33070
32689
|
}
|
|
33071
32690
|
initAnimateExecutor() {
|
|
@@ -33082,8 +32701,7 @@ class AnimateExtension {
|
|
|
33082
32701
|
getFinalAttribute() {
|
|
33083
32702
|
return this.finalAttribute;
|
|
33084
32703
|
}
|
|
33085
|
-
getGraphicAttribute(key) {
|
|
33086
|
-
let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
32704
|
+
getGraphicAttribute(key, prev = !1) {
|
|
33087
32705
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
33088
32706
|
}
|
|
33089
32707
|
}
|
|
@@ -33716,8 +33334,7 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
33716
33334
|
var _a, _b;
|
|
33717
33335
|
super(from, to, duration, easing, params), this.newPointAnimateType = null !== (_a = null == params ? void 0 : params.newPointAnimateType) && void 0 !== _a ? _a : "grow", this.clipRangeByDimension = null !== (_b = null == params ? void 0 : params.clipRangeByDimension) && void 0 !== _b ? _b : "x";
|
|
33718
33336
|
}
|
|
33719
|
-
getPoints(attribute) {
|
|
33720
|
-
let cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
33337
|
+
getPoints(attribute, cache = !1) {
|
|
33721
33338
|
if (attribute.points) return attribute.points;
|
|
33722
33339
|
if (attribute.segments) {
|
|
33723
33340
|
const points = [];
|
|
@@ -36105,9 +35722,9 @@ class Update extends ACustomAnimate {
|
|
|
36105
35722
|
const {
|
|
36106
35723
|
options: options
|
|
36107
35724
|
} = this.params;
|
|
36108
|
-
(null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) &&
|
|
35725
|
+
diffAttrs = Object.assign({}, diffAttrs), (null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) && options.excludeChannels.forEach(channel => {
|
|
36109
35726
|
delete diffAttrs[channel];
|
|
36110
|
-
})
|
|
35727
|
+
}), this.props = diffAttrs;
|
|
36111
35728
|
}
|
|
36112
35729
|
update(end, ratio, out) {
|
|
36113
35730
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -37066,9 +36683,7 @@ class CircleAxisMixin {
|
|
|
37066
36683
|
} = this.attribute;
|
|
37067
36684
|
return polarToCartesian(center, inside && innerRadius > 0 ? innerRadius : radius, startAngle + (endAngle - startAngle) * tickValue);
|
|
37068
36685
|
}
|
|
37069
|
-
getVerticalVector(offset) {
|
|
37070
|
-
let inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
37071
|
-
let point = arguments.length > 2 ? arguments[2] : undefined;
|
|
36686
|
+
getVerticalVector(offset, inside = !1, point) {
|
|
37072
36687
|
return getCircleVerticalVector(offset, point, this.attribute.center, inside, this.attribute.inside);
|
|
37073
36688
|
}
|
|
37074
36689
|
getRelativeVector(point) {
|
|
@@ -37346,8 +36961,7 @@ const convertDomainToTickData = domain => domain.map((t, index) => ({
|
|
|
37346
36961
|
index: index,
|
|
37347
36962
|
value: t
|
|
37348
36963
|
}));
|
|
37349
|
-
const labelOverlap =
|
|
37350
|
-
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
36964
|
+
const labelOverlap = (prevLabel, nextLabel, gap = 0) => {
|
|
37351
36965
|
const prevBounds = new AABBBounds(prevLabel).expand(gap / 2),
|
|
37352
36966
|
nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
|
|
37353
36967
|
return prevBounds.intersects(nextBounds);
|
|
@@ -37495,8 +37109,7 @@ const nice = (domain, options) => {
|
|
|
37495
37109
|
x1 = newDomain[endIndex];
|
|
37496
37110
|
return x1 < x0 && ([startIndex, endIndex] = [endIndex, startIndex], [x0, x1] = [x1, x0]), newDomain[startIndex] = options.floor(x0), newDomain[endIndex] = options.ceil(x1), newDomain;
|
|
37497
37111
|
};
|
|
37498
|
-
const niceNumber =
|
|
37499
|
-
let round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
37112
|
+
const niceNumber = (value, round = !1) => {
|
|
37500
37113
|
const exponent = Math.floor(Math.log10(value)),
|
|
37501
37114
|
fraction = value / Math.pow(10, exponent);
|
|
37502
37115
|
let niceFraction;
|
|
@@ -37736,22 +37349,19 @@ class BandScale extends OrdinalScale {
|
|
|
37736
37349
|
rangeRound(_, slience) {
|
|
37737
37350
|
return this._range = [toNumber(_[0]), toNumber(_[1])], this._round = !0, this.rescale(slience);
|
|
37738
37351
|
}
|
|
37739
|
-
ticks() {
|
|
37740
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37352
|
+
ticks(count = 10) {
|
|
37741
37353
|
const d = this.calculateVisibleDomain(this._range);
|
|
37742
37354
|
if (-1 === count) return d;
|
|
37743
37355
|
return ticks$1(0, d.length - 1, count, !1).map(i => d[i]);
|
|
37744
37356
|
}
|
|
37745
|
-
tickData() {
|
|
37746
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37357
|
+
tickData(count = 10) {
|
|
37747
37358
|
return this.ticks(count).map((tick, index) => ({
|
|
37748
37359
|
index: index,
|
|
37749
37360
|
tick: tick,
|
|
37750
37361
|
value: (this.scale(tick) - this._range[0] + this._bandwidth / 2) / (this._range[1] - this._range[0])
|
|
37751
37362
|
}));
|
|
37752
37363
|
}
|
|
37753
|
-
forceTicks() {
|
|
37754
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37364
|
+
forceTicks(count = 10) {
|
|
37755
37365
|
const d = this.calculateVisibleDomain(this._range);
|
|
37756
37366
|
return ticks$1(0, d.length - 1, count, !0).filter(i => i < d.length).map(i => d[i]);
|
|
37757
37367
|
}
|
|
@@ -37847,9 +37457,7 @@ function interpolate(a, b) {
|
|
|
37847
37457
|
}
|
|
37848
37458
|
|
|
37849
37459
|
class ContinuousScale extends BaseScale {
|
|
37850
|
-
constructor() {
|
|
37851
|
-
let transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : identity;
|
|
37852
|
-
let untransformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
37460
|
+
constructor(transformer = identity, untransformer = identity) {
|
|
37853
37461
|
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;
|
|
37854
37462
|
}
|
|
37855
37463
|
calculateVisibleDomain(range) {
|
|
@@ -37911,11 +37519,10 @@ class ContinuousScale extends BaseScale {
|
|
|
37911
37519
|
interpolate(_, slience) {
|
|
37912
37520
|
return arguments.length ? (this._interpolate = _, this.rescale(slience)) : this._interpolate;
|
|
37913
37521
|
}
|
|
37914
|
-
ticks() {
|
|
37522
|
+
ticks(count = 10) {
|
|
37915
37523
|
return [];
|
|
37916
37524
|
}
|
|
37917
|
-
tickData() {
|
|
37918
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37525
|
+
tickData(count = 10) {
|
|
37919
37526
|
const ticks = this.ticks(count);
|
|
37920
37527
|
return (null != ticks ? ticks : []).map((tick, index) => ({
|
|
37921
37528
|
index: index,
|
|
@@ -38069,8 +37676,7 @@ function stepTicks(start, stop, step) {
|
|
|
38069
37676
|
for (; ++i < count;) ticks[i] = start + i * step;
|
|
38070
37677
|
return reverse && ticks.reverse(), ticks;
|
|
38071
37678
|
}
|
|
38072
|
-
function niceLinear(d) {
|
|
38073
|
-
let count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
37679
|
+
function niceLinear(d, count = 10) {
|
|
38074
37680
|
let prestep,
|
|
38075
37681
|
step,
|
|
38076
37682
|
i0 = 0,
|
|
@@ -38157,15 +37763,11 @@ class LinearScale extends ContinuousScale {
|
|
|
38157
37763
|
tickFormat() {
|
|
38158
37764
|
return () => {};
|
|
38159
37765
|
}
|
|
38160
|
-
d3Ticks() {
|
|
38161
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38162
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37766
|
+
d3Ticks(count = 10, options) {
|
|
38163
37767
|
const d = this.calculateVisibleDomain(this._range);
|
|
38164
37768
|
return d3Ticks(d[0], d[d.length - 1], count, options);
|
|
38165
37769
|
}
|
|
38166
|
-
ticks() {
|
|
38167
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38168
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37770
|
+
ticks(count = 10, options) {
|
|
38169
37771
|
var _a;
|
|
38170
37772
|
if (isFunction$1(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
|
|
38171
37773
|
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);
|
|
@@ -38185,8 +37787,7 @@ class LinearScale extends ContinuousScale {
|
|
|
38185
37787
|
}
|
|
38186
37788
|
return ticksResult;
|
|
38187
37789
|
}
|
|
38188
|
-
forceTicks() {
|
|
38189
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37790
|
+
forceTicks(count = 10) {
|
|
38190
37791
|
const d = this.calculateVisibleDomain(this._range);
|
|
38191
37792
|
return forceTicks(d[0], d[d.length - 1], count);
|
|
38192
37793
|
}
|
|
@@ -38194,9 +37795,7 @@ class LinearScale extends ContinuousScale {
|
|
|
38194
37795
|
const d = this.calculateVisibleDomain(this._range);
|
|
38195
37796
|
return stepTicks(d[0], d[d.length - 1], step);
|
|
38196
37797
|
}
|
|
38197
|
-
nice() {
|
|
38198
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38199
|
-
let option = arguments.length > 1 ? arguments[1] : undefined;
|
|
37798
|
+
nice(count = 10, option) {
|
|
38200
37799
|
var _a, _b;
|
|
38201
37800
|
const originalDomain = this._domain;
|
|
38202
37801
|
let niceMinMax = [];
|
|
@@ -38210,15 +37809,13 @@ class LinearScale extends ContinuousScale {
|
|
|
38210
37809
|
}
|
|
38211
37810
|
return this;
|
|
38212
37811
|
}
|
|
38213
|
-
niceMin() {
|
|
38214
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37812
|
+
niceMin(count = 10) {
|
|
38215
37813
|
this._niceType = "min";
|
|
38216
37814
|
const maxD = this._domain[this._domain.length - 1],
|
|
38217
37815
|
niceDomain = niceLinear(this.domain(), count);
|
|
38218
37816
|
return niceDomain && (niceDomain[niceDomain.length - 1] = maxD, this._niceDomain = niceDomain, this.rescale()), this;
|
|
38219
37817
|
}
|
|
38220
|
-
niceMax() {
|
|
38221
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37818
|
+
niceMax(count = 10) {
|
|
38222
37819
|
this._niceType = "max";
|
|
38223
37820
|
const minD = this._domain[0],
|
|
38224
37821
|
niceDomain = niceLinear(this._domain.slice(), count);
|
|
@@ -38227,8 +37824,7 @@ class LinearScale extends ContinuousScale {
|
|
|
38227
37824
|
}
|
|
38228
37825
|
|
|
38229
37826
|
class LogNiceMixin {
|
|
38230
|
-
nice() {
|
|
38231
|
-
let option = arguments.length > 1 ? arguments[1] : undefined;
|
|
37827
|
+
nice(count = 10, option) {
|
|
38232
37828
|
var _b, _c, _d, _e;
|
|
38233
37829
|
const originalDomain = this._domain;
|
|
38234
37830
|
let niceMinMax = [],
|
|
@@ -38263,12 +37859,10 @@ class LogNiceMixin {
|
|
|
38263
37859
|
function reflect(f) {
|
|
38264
37860
|
return x => -f(-x);
|
|
38265
37861
|
}
|
|
38266
|
-
function limitPositiveZero() {
|
|
38267
|
-
let min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.EPSILON;
|
|
37862
|
+
function limitPositiveZero(min = Number.EPSILON) {
|
|
38268
37863
|
return x => Math.max(x, min);
|
|
38269
37864
|
}
|
|
38270
|
-
function limitNegativeZero() {
|
|
38271
|
-
let min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.EPSILON;
|
|
37865
|
+
function limitNegativeZero(min = Number.EPSILON) {
|
|
38272
37866
|
return x => Math.min(x, -min);
|
|
38273
37867
|
}
|
|
38274
37868
|
class LogScale extends ContinuousScale {
|
|
@@ -38299,21 +37893,17 @@ class LogScale extends ContinuousScale {
|
|
|
38299
37893
|
tickFormat() {
|
|
38300
37894
|
return identity;
|
|
38301
37895
|
}
|
|
38302
|
-
d3Ticks() {
|
|
38303
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38304
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37896
|
+
d3Ticks(count = 10, options) {
|
|
38305
37897
|
const d = this.domain(),
|
|
38306
37898
|
u = this._limit(d[0]),
|
|
38307
37899
|
v = this._limit(d[d.length - 1]);
|
|
38308
37900
|
return d3TicksForLog(u, v, count, this._base, this.transformer, this.untransformer, options);
|
|
38309
37901
|
}
|
|
38310
|
-
ticks() {
|
|
38311
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37902
|
+
ticks(count = 10) {
|
|
38312
37903
|
const d = this.calculateVisibleDomain(this._range);
|
|
38313
37904
|
return ticksBaseTransform(this._limit(d[0]), this._limit(d[d.length - 1]), count, this._base, this.transformer, this.untransformer);
|
|
38314
37905
|
}
|
|
38315
|
-
forceTicks() {
|
|
38316
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37906
|
+
forceTicks(count = 10) {
|
|
38317
37907
|
const d = this.calculateVisibleDomain(this._range);
|
|
38318
37908
|
return forceTicksBaseTransform(d[0], d[d.length - 1], count, this.transformer, this.untransformer);
|
|
38319
37909
|
}
|
|
@@ -38355,21 +37945,17 @@ class SymlogScale extends LinearScale {
|
|
|
38355
37945
|
constant(_, slience) {
|
|
38356
37946
|
return arguments.length ? (this._const = _, this.transformer = symlog(_), this.untransformer = symexp(_), this.rescale(slience)) : this._const;
|
|
38357
37947
|
}
|
|
38358
|
-
d3Ticks() {
|
|
38359
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38360
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37948
|
+
d3Ticks(count = 10, options) {
|
|
38361
37949
|
const d = this.domain(),
|
|
38362
37950
|
u = d[0],
|
|
38363
37951
|
v = d[d.length - 1];
|
|
38364
37952
|
return d3TicksForLog(u, v, count, this._const, this.transformer, this.untransformer, options);
|
|
38365
37953
|
}
|
|
38366
|
-
ticks() {
|
|
38367
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37954
|
+
ticks(count = 10) {
|
|
38368
37955
|
const d = this.calculateVisibleDomain(this._range);
|
|
38369
37956
|
return ticksBaseTransform(d[0], d[d.length - 1], count, this._const, this.transformer, this.untransformer);
|
|
38370
37957
|
}
|
|
38371
|
-
forceTicks() {
|
|
38372
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37958
|
+
forceTicks(count = 10) {
|
|
38373
37959
|
const d = this.calculateVisibleDomain(this._range);
|
|
38374
37960
|
return forceTicksBaseTransform(d[0], d[d.length - 1], count, this.transformer, this.untransformer);
|
|
38375
37961
|
}
|
|
@@ -38425,8 +38011,7 @@ function getScaleTicks(op, scale, count, getTicks) {
|
|
|
38425
38011
|
} else scaleTicks = getTicks(count);
|
|
38426
38012
|
return scaleTicks;
|
|
38427
38013
|
}
|
|
38428
|
-
function forceItemVisible(sourceItem, items, check, comparator) {
|
|
38429
|
-
let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
38014
|
+
function forceItemVisible(sourceItem, items, check, comparator, inverse = !1) {
|
|
38430
38015
|
if (check && !items.includes(sourceItem)) {
|
|
38431
38016
|
let remainLength = items.length;
|
|
38432
38017
|
if (remainLength > 1) {
|
|
@@ -38523,10 +38108,7 @@ const methods$1 = {
|
|
|
38523
38108
|
};
|
|
38524
38109
|
|
|
38525
38110
|
const getOneDimensionalLabelBounds = (scale, domain, op, isHorizontal) => getCartesianLabelBounds(scale, domain, op).map(bounds => isHorizontal ? [bounds.x1, bounds.x2, bounds.width()] : [bounds.y1, bounds.y2, bounds.height()]),
|
|
38526
|
-
boundsOverlap =
|
|
38527
|
-
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
38528
|
-
return Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38529
|
-
};
|
|
38111
|
+
boundsOverlap = (prevBounds, nextBounds, gap = 0) => Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38530
38112
|
const boundsDistance = (prevBounds, nextBounds) => prevBounds[1] < nextBounds[0] ? nextBounds[0] - prevBounds[1] : nextBounds[1] < prevBounds[0] ? prevBounds[0] - nextBounds[1] : 0;
|
|
38531
38113
|
const linearDiscreteTicks = (scale, op) => {
|
|
38532
38114
|
var _a;
|
|
@@ -38752,13 +38334,12 @@ function bitmap(w, h) {
|
|
|
38752
38334
|
const index = y * w + x;
|
|
38753
38335
|
_clear(index >>> 5, ~(1 << (31 & index)));
|
|
38754
38336
|
},
|
|
38755
|
-
getRange:
|
|
38756
|
-
|
|
38757
|
-
|
|
38758
|
-
|
|
38759
|
-
|
|
38760
|
-
|
|
38761
|
-
} = _ref;
|
|
38337
|
+
getRange: ({
|
|
38338
|
+
x1: x1,
|
|
38339
|
+
y1: y1,
|
|
38340
|
+
x2: x2,
|
|
38341
|
+
y2: y2
|
|
38342
|
+
}) => {
|
|
38762
38343
|
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return !0;
|
|
38763
38344
|
let start,
|
|
38764
38345
|
end,
|
|
@@ -38774,36 +38355,31 @@ function bitmap(w, h) {
|
|
|
38774
38355
|
}
|
|
38775
38356
|
return !1;
|
|
38776
38357
|
},
|
|
38777
|
-
setRange:
|
|
38778
|
-
|
|
38779
|
-
|
|
38780
|
-
|
|
38781
|
-
|
|
38782
|
-
|
|
38783
|
-
} = _ref2;
|
|
38358
|
+
setRange: ({
|
|
38359
|
+
x1: x1,
|
|
38360
|
+
y1: y1,
|
|
38361
|
+
x2: x2,
|
|
38362
|
+
y2: y2
|
|
38363
|
+
}) => {
|
|
38784
38364
|
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return;
|
|
38785
38365
|
let start, end, indexStart, indexEnd, i;
|
|
38786
38366
|
for (; y1 <= y2; ++y1) if (start = y1 * w + x1, end = y1 * w + x2, indexStart = start >>> 5, indexEnd = end >>> 5, indexStart === indexEnd) _set(indexStart, RIGHT0[31 & start] & RIGHT1[1 + (31 & end)]);else for (_set(indexStart, RIGHT0[31 & start]), _set(indexEnd, RIGHT1[1 + (31 & end)]), i = indexStart + 1; i < indexEnd; ++i) _set(i, 4294967295);
|
|
38787
38367
|
},
|
|
38788
|
-
clearRange:
|
|
38789
|
-
|
|
38790
|
-
|
|
38791
|
-
|
|
38792
|
-
|
|
38793
|
-
|
|
38794
|
-
} = _ref3;
|
|
38368
|
+
clearRange: ({
|
|
38369
|
+
x1: x1,
|
|
38370
|
+
y1: y1,
|
|
38371
|
+
x2: x2,
|
|
38372
|
+
y2: y2
|
|
38373
|
+
}) => {
|
|
38795
38374
|
let start, end, indexStart, indexEnd, i;
|
|
38796
38375
|
for (; y1 <= y2; ++y1) if (start = y1 * w + x1, end = y1 * w + x2, indexStart = start >>> 5, indexEnd = end >>> 5, indexStart === indexEnd) _clear(indexStart, RIGHT1[31 & start] | RIGHT0[1 + (31 & end)]);else for (_clear(indexStart, RIGHT1[31 & start]), _clear(indexEnd, RIGHT0[1 + (31 & end)]), i = indexStart + 1; i < indexEnd; ++i) _clear(i, 0);
|
|
38797
38376
|
},
|
|
38798
|
-
outOfBounds:
|
|
38799
|
-
|
|
38800
|
-
|
|
38801
|
-
|
|
38802
|
-
|
|
38803
|
-
|
|
38804
|
-
} = _ref4;
|
|
38805
|
-
return x1 < 0 || y1 < 0 || y2 >= h || x2 >= w;
|
|
38806
|
-
},
|
|
38377
|
+
outOfBounds: ({
|
|
38378
|
+
x1: x1,
|
|
38379
|
+
y1: y1,
|
|
38380
|
+
x2: x2,
|
|
38381
|
+
y2: y2
|
|
38382
|
+
}) => x1 < 0 || y1 < 0 || y2 >= h || x2 >= w,
|
|
38807
38383
|
toImageData: ctx => {
|
|
38808
38384
|
const imageData = ctx.createImageData(w, h),
|
|
38809
38385
|
data = imageData.data;
|
|
@@ -38818,13 +38394,12 @@ function bitmap(w, h) {
|
|
|
38818
38394
|
};
|
|
38819
38395
|
}
|
|
38820
38396
|
|
|
38821
|
-
function bitmapTool(width, height
|
|
38822
|
-
|
|
38823
|
-
|
|
38824
|
-
|
|
38825
|
-
|
|
38826
|
-
|
|
38827
|
-
};
|
|
38397
|
+
function bitmapTool(width, height, padding = {
|
|
38398
|
+
top: 0,
|
|
38399
|
+
left: 0,
|
|
38400
|
+
right: 0,
|
|
38401
|
+
bottom: 0
|
|
38402
|
+
}) {
|
|
38828
38403
|
const {
|
|
38829
38404
|
top = 0,
|
|
38830
38405
|
left = 0,
|
|
@@ -38861,8 +38436,7 @@ function clampRangeByBitmap($, range) {
|
|
|
38861
38436
|
y2: $.y(_y2)
|
|
38862
38437
|
};
|
|
38863
38438
|
}
|
|
38864
|
-
function boundToRange($, bound) {
|
|
38865
|
-
let clamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
38439
|
+
function boundToRange($, bound, clamp = !1) {
|
|
38866
38440
|
return clamp ? clampRangeByBitmap($, bound) : {
|
|
38867
38441
|
x1: $.x(bound.x1),
|
|
38868
38442
|
x2: $.x(bound.x2),
|
|
@@ -38871,9 +38445,7 @@ function boundToRange($, bound) {
|
|
|
38871
38445
|
};
|
|
38872
38446
|
}
|
|
38873
38447
|
|
|
38874
|
-
function canPlace($, bitmap, bound) {
|
|
38875
|
-
let checkBound = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
38876
|
-
let pad = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
38448
|
+
function canPlace($, bitmap, bound, checkBound = !0, pad = 0) {
|
|
38877
38449
|
let range = bound;
|
|
38878
38450
|
pad > 0 && (range = {
|
|
38879
38451
|
x1: bound.x1 - pad,
|
|
@@ -38884,11 +38456,7 @@ function canPlace($, bitmap, bound) {
|
|
|
38884
38456
|
const outOfBounds = bitmap.outOfBounds(range);
|
|
38885
38457
|
return (!checkBound || !outOfBounds) && (outOfBounds && (range = clampRangeByBitmap($, range)), !bitmap.getRange(range));
|
|
38886
38458
|
}
|
|
38887
|
-
function placeToCandidates($, bitmap, text) {
|
|
38888
|
-
let candidates = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
38889
|
-
let clampForce = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
38890
|
-
let pad = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
38891
|
-
let changePosition = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
38459
|
+
function placeToCandidates($, bitmap, text, candidates = [], clampForce = !0, pad = 0, changePosition = !1) {
|
|
38892
38460
|
const validCandidates = candidates.filter(candidate => isValid$1(candidate));
|
|
38893
38461
|
for (let i = 0; i < validCandidates.length; i++) {
|
|
38894
38462
|
let measureText;
|
|
@@ -38929,8 +38497,7 @@ const DefaultRectPositions = ["top", "inside-top", "inside"];
|
|
|
38929
38497
|
function defaultLabelPosition(type) {
|
|
38930
38498
|
return "rect" === type ? DefaultRectPositions : DefaultPositions;
|
|
38931
38499
|
}
|
|
38932
|
-
function clampText(text, width, height) {
|
|
38933
|
-
let padding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
38500
|
+
function clampText(text, width, height, padding = {}) {
|
|
38934
38501
|
const {
|
|
38935
38502
|
x1: x1,
|
|
38936
38503
|
x2: x2,
|
|
@@ -39039,9 +38606,7 @@ function checkBoundsOverlap(boundsA, boundsB) {
|
|
|
39039
38606
|
} = boundsB;
|
|
39040
38607
|
return !(ax1 <= bx1 && ax2 <= bx1 || ax1 >= bx2 && ax2 >= bx2 || ay1 <= by1 && ay2 <= by1 || ay1 >= by2 && ay2 >= by2);
|
|
39041
38608
|
}
|
|
39042
|
-
const labelingPoint =
|
|
39043
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
39044
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
38609
|
+
const labelingPoint = (textBounds, graphicBounds, position = "top", offset = 0) => {
|
|
39045
38610
|
if (!textBounds) return;
|
|
39046
38611
|
const {
|
|
39047
38612
|
x1: x1,
|
|
@@ -39107,9 +38672,7 @@ const getPointsOfLineArea = graphic => {
|
|
|
39107
38672
|
}
|
|
39108
38673
|
return points;
|
|
39109
38674
|
};
|
|
39110
|
-
function labelingLineOrArea(textBounds, graphicBounds) {
|
|
39111
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
39112
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
38675
|
+
function labelingLineOrArea(textBounds, graphicBounds, position = "end", offset = 0) {
|
|
39113
38676
|
if (!textBounds || !graphicBounds) return {
|
|
39114
38677
|
x: 1 / 0,
|
|
39115
38678
|
y: 1 / 0
|
|
@@ -39238,7 +38801,7 @@ class LabelEnter extends AComponentAnimate {
|
|
|
39238
38801
|
tryPreventConflict() {}
|
|
39239
38802
|
}
|
|
39240
38803
|
function registerLabelAnimate() {
|
|
39241
|
-
AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate), AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
|
|
38804
|
+
AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate), AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
|
|
39242
38805
|
}
|
|
39243
38806
|
|
|
39244
38807
|
function loadLabelComponent() {
|
|
@@ -39246,11 +38809,7 @@ function loadLabelComponent() {
|
|
|
39246
38809
|
}
|
|
39247
38810
|
|
|
39248
38811
|
const isIntersect = (top, bottom) => Math.ceil(top) > Math.floor(bottom),
|
|
39249
|
-
isXIntersect = (
|
|
39250
|
-
let [a, b] = _ref;
|
|
39251
|
-
let [c, d] = _ref2;
|
|
39252
|
-
return d > a && b > c;
|
|
39253
|
-
};
|
|
38812
|
+
isXIntersect = ([a, b], [c, d]) => d > a && b > c;
|
|
39254
38813
|
function getIntersectionLength(range1, range2) {
|
|
39255
38814
|
const [start1, end1] = range1,
|
|
39256
38815
|
[start2, end2] = range2,
|
|
@@ -39562,8 +39121,7 @@ class LabelBase extends AnimateComponent {
|
|
|
39562
39121
|
getRelatedGraphic(item) {
|
|
39563
39122
|
return this._idToGraphic.get(item.id);
|
|
39564
39123
|
}
|
|
39565
|
-
_initText() {
|
|
39566
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
39124
|
+
_initText(data = []) {
|
|
39567
39125
|
const {
|
|
39568
39126
|
textStyle = {}
|
|
39569
39127
|
} = this.attribute,
|
|
@@ -39666,8 +39224,7 @@ class LabelBase extends AnimateComponent {
|
|
|
39666
39224
|
}
|
|
39667
39225
|
return result;
|
|
39668
39226
|
}
|
|
39669
|
-
_processClampForce(text, bmpTool, bitmap) {
|
|
39670
|
-
let overlapPadding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39227
|
+
_processClampForce(text, bmpTool, bitmap, overlapPadding = 0) {
|
|
39671
39228
|
const {
|
|
39672
39229
|
dy = 0,
|
|
39673
39230
|
dx = 0
|
|
@@ -39778,9 +39335,7 @@ class LabelBase extends AnimateComponent {
|
|
|
39778
39335
|
} = this.attribute;
|
|
39779
39336
|
if (baseMarkGroupName) return this.getRootNode().find(node => node.name === baseMarkGroupName, !0);
|
|
39780
39337
|
}
|
|
39781
|
-
getGraphicBounds(graphic) {
|
|
39782
|
-
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39783
|
-
let position = arguments.length > 2 ? arguments[2] : undefined;
|
|
39338
|
+
getGraphicBounds(graphic, point = {}, position) {
|
|
39784
39339
|
var _a;
|
|
39785
39340
|
if (graphic) {
|
|
39786
39341
|
if (!1 !== graphic.attribute.visible) {
|
|
@@ -39844,25 +39399,16 @@ class LabelBase extends AnimateComponent {
|
|
|
39844
39399
|
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic,
|
|
39845
39400
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
39846
39401
|
let labelLine;
|
|
39847
|
-
|
|
39848
|
-
|
|
39849
|
-
labelLine: labelLine
|
|
39850
|
-
} : {
|
|
39851
|
-
text: text
|
|
39852
|
-
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
39402
|
+
showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic));
|
|
39403
|
+
const currentLabel = labelLine ? {
|
|
39853
39404
|
text: text,
|
|
39854
39405
|
labelLine: labelLine
|
|
39855
39406
|
} : {
|
|
39856
39407
|
text: text
|
|
39857
|
-
}
|
|
39858
|
-
|
|
39859
|
-
labelLine: labelLine
|
|
39860
|
-
}, texts, labelLines, index);else if ("update" === state) {
|
|
39408
|
+
};
|
|
39409
|
+
if (syncState && this.updateStatesOfLabels([currentLabel], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) texts.push(text), currentTextMap.set(textKey, currentLabel), this._addLabel(currentLabel, texts, labelLines, index);else if ("update" === state) {
|
|
39861
39410
|
const prevLabel = prevTextMap.get(textKey);
|
|
39862
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), this._updateLabel(prevLabel,
|
|
39863
|
-
text: text,
|
|
39864
|
-
labelLine: labelLine
|
|
39865
|
-
});
|
|
39411
|
+
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), this._updateLabel(prevLabel, currentLabel);
|
|
39866
39412
|
}
|
|
39867
39413
|
}), this._removeLabel(prevTextMap), this._graphicToText = currentTextMap;
|
|
39868
39414
|
}
|
|
@@ -39888,7 +39434,6 @@ class LabelBase extends AnimateComponent {
|
|
|
39888
39434
|
}]));
|
|
39889
39435
|
}
|
|
39890
39436
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
39891
|
-
if (!1 === this._enableAnimation || !this._animationConfig.update) return;
|
|
39892
39437
|
const {
|
|
39893
39438
|
text: prevText,
|
|
39894
39439
|
labelLine: prevLabelLine
|
|
@@ -39896,24 +39441,19 @@ class LabelBase extends AnimateComponent {
|
|
|
39896
39441
|
{
|
|
39897
39442
|
text: curText,
|
|
39898
39443
|
labelLine: curLabelLine
|
|
39899
|
-
} = currentLabel
|
|
39900
|
-
{
|
|
39901
|
-
duration: duration,
|
|
39902
|
-
easing: easing
|
|
39903
|
-
} = this._animationConfig.update;
|
|
39444
|
+
} = currentLabel;
|
|
39904
39445
|
prevText.applyAnimationState(["update"], [{
|
|
39905
39446
|
name: "update",
|
|
39906
|
-
animation: {
|
|
39907
|
-
type: "labelUpdate"
|
|
39908
|
-
|
|
39909
|
-
easing: easing,
|
|
39447
|
+
animation: Object.assign(Object.assign({
|
|
39448
|
+
type: "labelUpdate"
|
|
39449
|
+
}, this._animationConfig.update), {
|
|
39910
39450
|
customParameters: {
|
|
39911
39451
|
prevText: prevText,
|
|
39912
39452
|
curText: curText,
|
|
39913
39453
|
prevLabelLine: prevLabelLine,
|
|
39914
39454
|
curLabelLine: curLabelLine
|
|
39915
39455
|
}
|
|
39916
|
-
}
|
|
39456
|
+
})
|
|
39917
39457
|
}]);
|
|
39918
39458
|
}
|
|
39919
39459
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -39936,7 +39476,7 @@ class LabelBase extends AnimateComponent {
|
|
|
39936
39476
|
text: curText,
|
|
39937
39477
|
labelLine: curLabelLine
|
|
39938
39478
|
} = currentLabel;
|
|
39939
|
-
!1
|
|
39479
|
+
!1 === this._enableAnimation || !1 === this._animationConfig.update ? (prevLabel.text.setAttributes(curText.attribute), prevLabelLine && curLabelLine && prevLabel.labelLine.setAttributes(curLabelLine.attribute)) : this._runUpdateAnimation(prevLabel, currentLabel);
|
|
39940
39480
|
}
|
|
39941
39481
|
_removeLabel(textMap) {
|
|
39942
39482
|
const removeLabelAndLine = label => {
|
|
@@ -40072,9 +39612,7 @@ class SymbolLabel extends LabelBase {
|
|
|
40072
39612
|
data: data
|
|
40073
39613
|
}, merge$1({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
|
|
40074
39614
|
}
|
|
40075
|
-
labeling(textBounds, graphicBounds) {
|
|
40076
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
40077
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39615
|
+
labeling(textBounds, graphicBounds, position = "top", offset = 0) {
|
|
40078
39616
|
return labelingPoint(textBounds, graphicBounds, position, offset);
|
|
40079
39617
|
}
|
|
40080
39618
|
}
|
|
@@ -40108,9 +39646,7 @@ class RectLabel extends LabelBase {
|
|
|
40108
39646
|
data: data
|
|
40109
39647
|
}, merge$1({}, RectLabel.defaultAttributes, restAttributes)));
|
|
40110
39648
|
}
|
|
40111
|
-
labeling(textBounds, graphicBounds) {
|
|
40112
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
40113
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39649
|
+
labeling(textBounds, graphicBounds, position = "top", offset = 0) {
|
|
40114
39650
|
if (!textBounds || !graphicBounds) return;
|
|
40115
39651
|
const {
|
|
40116
39652
|
x1: x1,
|
|
@@ -40172,9 +39708,7 @@ let LineLabel$1 = class LineLabel extends LabelBase {
|
|
|
40172
39708
|
data: data
|
|
40173
39709
|
}, merge$1({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
|
|
40174
39710
|
}
|
|
40175
|
-
getGraphicBounds(graphic) {
|
|
40176
|
-
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
40177
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
39711
|
+
getGraphicBounds(graphic, point = {}, position = "end") {
|
|
40178
39712
|
if (!graphic || "line" !== graphic.type && "area" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
40179
39713
|
let points = graphic.attribute.points;
|
|
40180
39714
|
const segments = graphic.attribute.segments;
|
|
@@ -40190,9 +39724,7 @@ let LineLabel$1 = class LineLabel extends LabelBase {
|
|
|
40190
39724
|
y2: points[index].y
|
|
40191
39725
|
} : void 0;
|
|
40192
39726
|
}
|
|
40193
|
-
labeling(textBounds, graphicBounds) {
|
|
40194
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
40195
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39727
|
+
labeling(textBounds, graphicBounds, position = "end", offset = 0) {
|
|
40196
39728
|
return labelingLineOrArea(textBounds, graphicBounds, position, offset);
|
|
40197
39729
|
}
|
|
40198
39730
|
};
|
|
@@ -40247,7 +39779,7 @@ class ArcLabel extends LabelBase {
|
|
|
40247
39779
|
_overlapping(labels) {
|
|
40248
39780
|
return ["inside", "inside-center"].includes(this.attribute.position) ? super._overlapping(labels) : labels;
|
|
40249
39781
|
}
|
|
40250
|
-
labeling(textBounds, graphicBounds) {
|
|
39782
|
+
labeling(textBounds, graphicBounds, position = "outside", offset = 0) {
|
|
40251
39783
|
if (textBounds && graphicBounds) return {
|
|
40252
39784
|
x: 0,
|
|
40253
39785
|
y: 0
|
|
@@ -44835,8 +44367,7 @@ let DiscreteLegend$1 = class DiscreteLegend extends LegendBase {
|
|
|
44835
44367
|
item.hasState(LegendStateValue.selected) && selectedData.push(item.data);
|
|
44836
44368
|
}), selectedData;
|
|
44837
44369
|
}
|
|
44838
|
-
_appendDataToShape(shape, name, data, delegateShape) {
|
|
44839
|
-
let states = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
44370
|
+
_appendDataToShape(shape, name, data, delegateShape, states = {}) {
|
|
44840
44371
|
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
|
|
44841
44372
|
}
|
|
44842
44373
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
@@ -45796,8 +45327,7 @@ ColorContinuousLegend.defaultAttributes = {
|
|
|
45796
45327
|
}
|
|
45797
45328
|
};
|
|
45798
45329
|
|
|
45799
|
-
function getSizeHandlerPath() {
|
|
45800
|
-
let align = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "bottom";
|
|
45330
|
+
function getSizeHandlerPath(align = "bottom") {
|
|
45801
45331
|
let centerX = 0;
|
|
45802
45332
|
return "top" === align ? `\n M${centerX},-6L${centerX - 3.5},-2.5\n v5\n h7\n v-5\n Z\n` : "left" === align ? (centerX = 1, `\n M${centerX - 6},0L${centerX - 6 + 2.5},-3.5\n h5\n v7\n h-5\n Z\n`) : "right" === align ? (centerX = -1, `\n M${centerX + 6},0L${centerX + 6 - 2.5},-3.5\n h-5\n v7\n h5\n Z\n `) : `\n M${centerX},6L${centerX - 3.5},2.5\n v-5\n h7\n v5\n Z\n`;
|
|
45803
45333
|
}
|
|
@@ -46364,72 +45894,54 @@ var PlayerEventEnum;
|
|
|
46364
45894
|
PlayerEventEnum.change = "change", PlayerEventEnum.play = "play", PlayerEventEnum.pause = "pause", PlayerEventEnum.backward = "backward", PlayerEventEnum.forward = "forward", PlayerEventEnum.end = "end", PlayerEventEnum.OnChange = "change", PlayerEventEnum.OnPlay = "play", PlayerEventEnum.OnPause = "pause", PlayerEventEnum.OnBackward = "backward", PlayerEventEnum.OnForward = "forward", PlayerEventEnum.OnEnd = "end";
|
|
46365
45895
|
}(PlayerEventEnum || (PlayerEventEnum = {}));
|
|
46366
45896
|
|
|
46367
|
-
const isReachEndByDefault =
|
|
46368
|
-
|
|
46369
|
-
|
|
46370
|
-
|
|
46371
|
-
|
|
46372
|
-
|
|
46373
|
-
|
|
46374
|
-
|
|
46375
|
-
|
|
46376
|
-
|
|
46377
|
-
|
|
46378
|
-
|
|
46379
|
-
|
|
46380
|
-
|
|
46381
|
-
|
|
46382
|
-
}
|
|
46383
|
-
|
|
46384
|
-
|
|
46385
|
-
|
|
46386
|
-
|
|
46387
|
-
|
|
46388
|
-
|
|
46389
|
-
|
|
46390
|
-
|
|
46391
|
-
|
|
46392
|
-
|
|
46393
|
-
|
|
46394
|
-
|
|
46395
|
-
|
|
46396
|
-
|
|
46397
|
-
|
|
46398
|
-
|
|
46399
|
-
|
|
46400
|
-
|
|
46401
|
-
|
|
46402
|
-
|
|
46403
|
-
|
|
46404
|
-
|
|
46405
|
-
|
|
46406
|
-
|
|
46407
|
-
|
|
46408
|
-
|
|
46409
|
-
|
|
46410
|
-
|
|
46411
|
-
|
|
46412
|
-
|
|
46413
|
-
|
|
46414
|
-
|
|
46415
|
-
};
|
|
46416
|
-
const isReachStart = _ref8 => {
|
|
46417
|
-
let {
|
|
46418
|
-
direction: direction,
|
|
46419
|
-
maxIndex: maxIndex,
|
|
46420
|
-
minIndex: minIndex,
|
|
46421
|
-
dataIndex: dataIndex
|
|
46422
|
-
} = _ref8;
|
|
46423
|
-
return isReachStartByDefault({
|
|
46424
|
-
direction: direction,
|
|
46425
|
-
minIndex: minIndex,
|
|
46426
|
-
dataIndex: dataIndex
|
|
46427
|
-
}) || isReachStartByReverse({
|
|
46428
|
-
direction: direction,
|
|
46429
|
-
maxIndex: maxIndex,
|
|
46430
|
-
dataIndex: dataIndex
|
|
46431
|
-
});
|
|
46432
|
-
};
|
|
45897
|
+
const isReachEndByDefault = ({
|
|
45898
|
+
direction: direction,
|
|
45899
|
+
maxIndex: maxIndex,
|
|
45900
|
+
dataIndex: dataIndex
|
|
45901
|
+
}) => direction === DirectionEnum.Default && dataIndex === maxIndex;
|
|
45902
|
+
const isReachEndByReverse = ({
|
|
45903
|
+
direction: direction,
|
|
45904
|
+
minIndex: minIndex,
|
|
45905
|
+
dataIndex: dataIndex
|
|
45906
|
+
}) => direction === DirectionEnum.Reverse && dataIndex === minIndex;
|
|
45907
|
+
const isReachEnd = ({
|
|
45908
|
+
direction: direction,
|
|
45909
|
+
maxIndex: maxIndex,
|
|
45910
|
+
minIndex: minIndex,
|
|
45911
|
+
dataIndex: dataIndex
|
|
45912
|
+
}) => isReachEndByDefault({
|
|
45913
|
+
direction: direction,
|
|
45914
|
+
maxIndex: maxIndex,
|
|
45915
|
+
dataIndex: dataIndex
|
|
45916
|
+
}) || isReachEndByReverse({
|
|
45917
|
+
direction: direction,
|
|
45918
|
+
minIndex: minIndex,
|
|
45919
|
+
dataIndex: dataIndex
|
|
45920
|
+
});
|
|
45921
|
+
const isReachStartByDefault = ({
|
|
45922
|
+
direction: direction,
|
|
45923
|
+
minIndex: minIndex,
|
|
45924
|
+
dataIndex: dataIndex
|
|
45925
|
+
}) => direction === DirectionEnum.Default && dataIndex === minIndex;
|
|
45926
|
+
const isReachStartByReverse = ({
|
|
45927
|
+
direction: direction,
|
|
45928
|
+
maxIndex: maxIndex,
|
|
45929
|
+
dataIndex: dataIndex
|
|
45930
|
+
}) => direction === DirectionEnum.Reverse && dataIndex === maxIndex;
|
|
45931
|
+
const isReachStart = ({
|
|
45932
|
+
direction: direction,
|
|
45933
|
+
maxIndex: maxIndex,
|
|
45934
|
+
minIndex: minIndex,
|
|
45935
|
+
dataIndex: dataIndex
|
|
45936
|
+
}) => isReachStartByDefault({
|
|
45937
|
+
direction: direction,
|
|
45938
|
+
minIndex: minIndex,
|
|
45939
|
+
dataIndex: dataIndex
|
|
45940
|
+
}) || isReachStartByReverse({
|
|
45941
|
+
direction: direction,
|
|
45942
|
+
maxIndex: maxIndex,
|
|
45943
|
+
dataIndex: dataIndex
|
|
45944
|
+
});
|
|
46433
45945
|
const isHorizontal$1 = orient => "top" === orient || "bottom" === orient;
|
|
46434
45946
|
const forwardStep = (direction, currentIndex, min, max) => "default" === direction ? Math.min(currentIndex + 1, max) : Math.max(currentIndex - 1, min);
|
|
46435
45947
|
|
|
@@ -47080,10 +46592,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
47080
46592
|
};
|
|
47081
46593
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
47082
46594
|
|
|
47083
|
-
const mergeRowAttrs =
|
|
47084
|
-
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
47085
|
-
sources[_key - 1] = arguments[_key];
|
|
47086
|
-
}
|
|
46595
|
+
const mergeRowAttrs = (target, ...sources) => {
|
|
47087
46596
|
const shapeList = [target.shape, ...sources.map(s => null == s ? void 0 : s.shape)],
|
|
47088
46597
|
keyList = [target.key, ...sources.map(s => null == s ? void 0 : s.key)],
|
|
47089
46598
|
valueList = [target.value, ...sources.map(s => null == s ? void 0 : s.value)];
|
|
@@ -47401,8 +46910,7 @@ let Tooltip$1 = class Tooltip extends AbstractComponent {
|
|
|
47401
46910
|
const shapeWidths = [],
|
|
47402
46911
|
keyWidths = [],
|
|
47403
46912
|
valueWidths = [];
|
|
47404
|
-
filteredContent.forEach((
|
|
47405
|
-
let [item, itemAttr] = _ref;
|
|
46913
|
+
filteredContent.forEach(([item, itemAttr], i) => {
|
|
47406
46914
|
var _a;
|
|
47407
46915
|
const {
|
|
47408
46916
|
key: key,
|
|
@@ -48509,16 +48017,15 @@ const getProperty = (target, path, defaultValue) => {
|
|
|
48509
48017
|
};
|
|
48510
48018
|
|
|
48511
48019
|
const ignoreWhen = value => isDataView(value) || isHTMLElement(value);
|
|
48512
|
-
function cloneDeepSpec(spec) {
|
|
48513
|
-
let excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ["data"];
|
|
48020
|
+
function cloneDeepSpec(spec, excludeKeys = ["data"]) {
|
|
48514
48021
|
return cloneDeep(spec, ignoreWhen, excludeKeys);
|
|
48515
48022
|
}
|
|
48516
48023
|
|
|
48517
|
-
function mergeSpec(target) {
|
|
48024
|
+
function mergeSpec(target, ...sources) {
|
|
48518
48025
|
let sourceIndex = -1;
|
|
48519
|
-
const length =
|
|
48026
|
+
const length = sources.length;
|
|
48520
48027
|
for (; ++sourceIndex < length;) {
|
|
48521
|
-
const source =
|
|
48028
|
+
const source = sources[sourceIndex];
|
|
48522
48029
|
baseMerge(target, source, !0, !0);
|
|
48523
48030
|
}
|
|
48524
48031
|
return target;
|
|
@@ -50785,10 +50292,13 @@ class Compiler {
|
|
|
50785
50292
|
if (this._stage) {
|
|
50786
50293
|
this._rootMarks.forEach(g => {
|
|
50787
50294
|
traverseGroupMark(g, m => {
|
|
50788
|
-
if (
|
|
50789
|
-
|
|
50295
|
+
if (m.needClear) {
|
|
50296
|
+
if (!this._progressiveMarks) {
|
|
50297
|
+
m.runAnimation();
|
|
50298
|
+
}
|
|
50299
|
+
m.clearExitGraphics();
|
|
50300
|
+
m.needClear = false;
|
|
50790
50301
|
}
|
|
50791
|
-
m.clearExitGraphics();
|
|
50792
50302
|
}, null, true);
|
|
50793
50303
|
});
|
|
50794
50304
|
this._stage.disableDirtyBounds();
|
|
@@ -52289,8 +51799,6 @@ class Region extends LayoutModel {
|
|
|
52289
51799
|
getSeriesInDataName(dataName) {
|
|
52290
51800
|
return this.getSeries({ dataName });
|
|
52291
51801
|
}
|
|
52292
|
-
onRender(ctx) {
|
|
52293
|
-
}
|
|
52294
51802
|
initSeriesDataflow() {
|
|
52295
51803
|
const viewDataFilters = this._series.map(s => { var _a; return (_a = s.getViewDataFilter()) !== null && _a !== void 0 ? _a : s.getViewData(); }).filter(v => !!v);
|
|
52296
51804
|
this._option.dataSet.multipleDataViewAddListener(viewDataFilters, 'change', this.seriesDataFilterOver);
|
|
@@ -54245,6 +53753,7 @@ class BaseMark extends GrammarItem {
|
|
|
54245
53753
|
});
|
|
54246
53754
|
this._dataByKey = mark._dataByKey;
|
|
54247
53755
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53756
|
+
this.needClear = mark.needClear;
|
|
54248
53757
|
}
|
|
54249
53758
|
_parseProgressiveContext(data) {
|
|
54250
53759
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -54474,6 +53983,7 @@ class BaseMark extends GrammarItem {
|
|
|
54474
53983
|
});
|
|
54475
53984
|
this._dataByKey = newGroupedData;
|
|
54476
53985
|
this._graphics = newGraphics;
|
|
53986
|
+
this.needClear = true;
|
|
54477
53987
|
}
|
|
54478
53988
|
_runEncoderOfGraphic(styles, g, attrs = {}) {
|
|
54479
53989
|
return runEncoder(styles, g.context.data[0], attrs);
|
|
@@ -54532,9 +54042,9 @@ class BaseMark extends GrammarItem {
|
|
|
54532
54042
|
const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
54533
54043
|
if (!g.setAttributes) {
|
|
54534
54044
|
const mockGraphic = g;
|
|
54535
|
-
g = this._createGraphic(
|
|
54045
|
+
g = this._createGraphic(finalAttrs);
|
|
54536
54046
|
if (hasAnimation) {
|
|
54537
|
-
g.
|
|
54047
|
+
g.setFinalAttributes(finalAttrs);
|
|
54538
54048
|
}
|
|
54539
54049
|
g.context = mockGraphic.context;
|
|
54540
54050
|
g.context.diffAttrs = finalAttrs;
|
|
@@ -54572,7 +54082,7 @@ class BaseMark extends GrammarItem {
|
|
|
54572
54082
|
hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs);
|
|
54573
54083
|
}
|
|
54574
54084
|
if (hasAnimation) {
|
|
54575
|
-
g.
|
|
54085
|
+
g.setFinalAttributes(finalAttrs);
|
|
54576
54086
|
}
|
|
54577
54087
|
}
|
|
54578
54088
|
this._setStateOfGraphic(g);
|
|
@@ -54913,7 +54423,7 @@ class BaseMark extends GrammarItem {
|
|
|
54913
54423
|
return Object.keys(this._animationConfig).length > 0;
|
|
54914
54424
|
}
|
|
54915
54425
|
runAnimation() {
|
|
54916
|
-
this._runStateAnimation(this.
|
|
54426
|
+
this._runStateAnimation(this.getGraphics());
|
|
54917
54427
|
}
|
|
54918
54428
|
}
|
|
54919
54429
|
|
|
@@ -54978,7 +54488,7 @@ class GroupMark extends BaseMark {
|
|
|
54978
54488
|
getGraphics() {
|
|
54979
54489
|
return [this._product];
|
|
54980
54490
|
}
|
|
54981
|
-
|
|
54491
|
+
renderInner() {
|
|
54982
54492
|
var _a;
|
|
54983
54493
|
if (!this._product) {
|
|
54984
54494
|
return;
|
|
@@ -54986,11 +54496,12 @@ class GroupMark extends BaseMark {
|
|
|
54986
54496
|
const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
|
|
54987
54497
|
this._product.context = Object.assign(Object.assign({}, this._product.context), this._getCommonContext());
|
|
54988
54498
|
this._product.setAttributes(this._getAttrsFromConfig(style));
|
|
54499
|
+
this.needClear = true;
|
|
54989
54500
|
}
|
|
54990
54501
|
render() {
|
|
54991
54502
|
if (this._isCommited) {
|
|
54992
54503
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
54993
|
-
this.
|
|
54504
|
+
this.renderInner();
|
|
54994
54505
|
this.uncommit();
|
|
54995
54506
|
}
|
|
54996
54507
|
this.getMarks().forEach(mark => {
|
|
@@ -57213,7 +56724,7 @@ const lookup = (data, opt) => {
|
|
|
57213
56724
|
});
|
|
57214
56725
|
};
|
|
57215
56726
|
|
|
57216
|
-
const version = "2.0.0-alpha.
|
|
56727
|
+
const version = "2.0.0-alpha.4";
|
|
57217
56728
|
|
|
57218
56729
|
const addVChartProperty = (data, op) => {
|
|
57219
56730
|
const context = op.beforeCall();
|
|
@@ -58905,9 +58416,6 @@ class BaseSeries extends BaseModel {
|
|
|
58905
58416
|
onEvaluateEnd(ctx) {
|
|
58906
58417
|
this._data.updateData();
|
|
58907
58418
|
}
|
|
58908
|
-
onRender(ctx) {
|
|
58909
|
-
return;
|
|
58910
|
-
}
|
|
58911
58419
|
release() {
|
|
58912
58420
|
var _a, _b;
|
|
58913
58421
|
super.release();
|
|
@@ -61308,14 +60816,8 @@ class BaseComponent extends LayoutModel {
|
|
|
61308
60816
|
this._regions = (_a = this._regions) !== null && _a !== void 0 ? _a : this._option.getRegionsInIndex();
|
|
61309
60817
|
this._layout && (this._layout.layoutBindRegionID = this._regions.map(x => x === null || x === void 0 ? void 0 : x.id));
|
|
61310
60818
|
}
|
|
61311
|
-
changeRegions(regions) {
|
|
61312
|
-
throw new Error('Method not implemented.');
|
|
61313
|
-
}
|
|
61314
60819
|
_getNeedClearVRenderComponents() {
|
|
61315
|
-
|
|
61316
|
-
}
|
|
61317
|
-
onRender(ctx) {
|
|
61318
|
-
throw new Error('Method not implemented.');
|
|
60820
|
+
return [];
|
|
61319
60821
|
}
|
|
61320
60822
|
getVRenderComponents() {
|
|
61321
60823
|
return this._getNeedClearVRenderComponents();
|
|
@@ -61483,6 +60985,7 @@ class ComponentMark extends BaseMark {
|
|
|
61483
60985
|
mark: this,
|
|
61484
60986
|
model: this.model
|
|
61485
60987
|
});
|
|
60988
|
+
this.needClear = true;
|
|
61486
60989
|
}
|
|
61487
60990
|
release() {
|
|
61488
60991
|
super.release();
|
|
@@ -61535,9 +61038,6 @@ class AxisComponent extends BaseComponent {
|
|
|
61535
61038
|
this._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
61536
61039
|
this._coordinateType = 'none';
|
|
61537
61040
|
}
|
|
61538
|
-
_getNeedClearVRenderComponents() {
|
|
61539
|
-
return [];
|
|
61540
|
-
}
|
|
61541
61041
|
getVRenderComponents() {
|
|
61542
61042
|
var _a, _b;
|
|
61543
61043
|
return [(_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct(), (_b = this._gridMark) === null || _b === void 0 ? void 0 : _b.getProduct()].filter(isValid$1);
|
|
@@ -62447,14 +61947,6 @@ class CartesianAxis extends AxisComponent {
|
|
|
62447
61947
|
this.pluginService && plugin.onDidCompile && plugin.onDidCompile(this.pluginService, this);
|
|
62448
61948
|
});
|
|
62449
61949
|
}
|
|
62450
|
-
onRender(ctx) {
|
|
62451
|
-
}
|
|
62452
|
-
changeRegions(regions) {
|
|
62453
|
-
}
|
|
62454
|
-
update(ctx) {
|
|
62455
|
-
}
|
|
62456
|
-
resize(ctx) {
|
|
62457
|
-
}
|
|
62458
61950
|
collectScale() {
|
|
62459
61951
|
const scales = [];
|
|
62460
61952
|
eachSeries(this._regions, s => {
|
|
@@ -62639,6 +62131,9 @@ class CartesianAxis extends AxisComponent {
|
|
|
62639
62131
|
attrs.label = {
|
|
62640
62132
|
overflowLimitLength: this._getLabelOverflowLimit(isX)
|
|
62641
62133
|
};
|
|
62134
|
+
if (this._afterUpdateAttribute) {
|
|
62135
|
+
return this._afterUpdateAttribute(attrs, ignoreGrid);
|
|
62136
|
+
}
|
|
62642
62137
|
return attrs;
|
|
62643
62138
|
}
|
|
62644
62139
|
getLabelItems(length) {
|
|
@@ -65446,8 +64941,6 @@ class BaseChart extends CompilableBase {
|
|
|
65446
64941
|
}
|
|
65447
64942
|
this.getAllModels().forEach(model => model.onDataUpdate());
|
|
65448
64943
|
}
|
|
65449
|
-
onRender(option) {
|
|
65450
|
-
}
|
|
65451
64944
|
setCanvasRect(width, height) {
|
|
65452
64945
|
this._canvasRect = { width, height };
|
|
65453
64946
|
}
|
|
@@ -69885,13 +69378,6 @@ class GeoCoordinate extends BaseComponent {
|
|
|
69885
69378
|
this._actualScale = this._initialScale;
|
|
69886
69379
|
super.onLayoutEnd();
|
|
69887
69380
|
}
|
|
69888
|
-
onRender(ctx) {
|
|
69889
|
-
}
|
|
69890
|
-
changeRegions(regions) {
|
|
69891
|
-
}
|
|
69892
|
-
_getNeedClearVRenderComponents() {
|
|
69893
|
-
return [];
|
|
69894
|
-
}
|
|
69895
69381
|
collectFeatures() {
|
|
69896
69382
|
const features = [];
|
|
69897
69383
|
this._regions.forEach(r => {
|
|
@@ -73853,12 +73339,12 @@ const registerPieSeries = () => {
|
|
|
73853
73339
|
Factory.registerSeries(PieSeries.type, PieSeries);
|
|
73854
73340
|
};
|
|
73855
73341
|
|
|
73856
|
-
|
|
73342
|
+
function growInType(growField) {
|
|
73857
73343
|
return growField === 'angle' ? 'growAngleIn' : 'growRadiusIn';
|
|
73858
|
-
}
|
|
73859
|
-
|
|
73344
|
+
}
|
|
73345
|
+
function growOutType(growField) {
|
|
73860
73346
|
return growField === 'angle' ? 'growAngleOut' : 'growRadiusOut';
|
|
73861
|
-
}
|
|
73347
|
+
}
|
|
73862
73348
|
const Appear_Grow$4 = (params) => {
|
|
73863
73349
|
return {
|
|
73864
73350
|
type: growInType(params.growField),
|
|
@@ -74101,10 +73587,6 @@ class PolarAxis extends AxisComponent {
|
|
|
74101
73587
|
this._endAngle = degreeToRadian(this._spec.endAngle);
|
|
74102
73588
|
this._inverse = this._spec.inverse;
|
|
74103
73589
|
}
|
|
74104
|
-
onRender(ctx) {
|
|
74105
|
-
}
|
|
74106
|
-
changeRegions() {
|
|
74107
|
-
}
|
|
74108
73590
|
_tickTransformOption() {
|
|
74109
73591
|
var _a;
|
|
74110
73592
|
return Object.assign(Object.assign({}, super._tickTransformOption()), { noDecimal: (_a = this._tick) === null || _a === void 0 ? void 0 : _a.noDecimals, startAngle: this.startAngle, labelOffset: getAxisLabelOffset(this._spec), getRadius: () => this.getOuterRadius(), inside: this._spec.inside });
|
|
@@ -76630,6 +76112,9 @@ class BaseWordCloudSeries extends BaseSeries {
|
|
|
76630
76112
|
});
|
|
76631
76113
|
if ((_a = this._spec.wordMask) === null || _a === void 0 ? void 0 : _a.visible) {
|
|
76632
76114
|
this._maskMark = this._createMark(BaseWordCloudSeries.mark.wordMask, { dataView: false });
|
|
76115
|
+
this._maskMark.setMarkConfig({
|
|
76116
|
+
zIndex: LayoutZIndex.Mark - 1
|
|
76117
|
+
});
|
|
76633
76118
|
}
|
|
76634
76119
|
}
|
|
76635
76120
|
initMarkStyle() {
|
|
@@ -76884,12 +76369,7 @@ const registerWordCloudAnimation = () => {
|
|
|
76884
76369
|
}));
|
|
76885
76370
|
};
|
|
76886
76371
|
|
|
76887
|
-
const calculateNodeValue$1 =
|
|
76888
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
76889
|
-
let flattenIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
|
|
76890
|
-
let parent = arguments.length > 4 ? arguments[4] : undefined;
|
|
76891
|
-
let getNodeKey = arguments.length > 5 ? arguments[5] : undefined;
|
|
76892
|
-
let valueField = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "value";
|
|
76372
|
+
const calculateNodeValue$1 = (subTree, output, depth = 0, flattenIndex = -1, parent, getNodeKey, valueField = "value") => {
|
|
76893
76373
|
let sum = 0,
|
|
76894
76374
|
prevFlattenIndex = null != flattenIndex ? flattenIndex : -1,
|
|
76895
76375
|
maxDepth = depth;
|
|
@@ -76932,9 +76412,7 @@ const eachAfter = (subTree, callback, parent, ctx) => {
|
|
|
76932
76412
|
(null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) && (ctxRes = eachAfter(node.children, callback, node, ctxRes)), ctxRes = callback(node, index, parent, ctxRes);
|
|
76933
76413
|
}), ctxRes;
|
|
76934
76414
|
};
|
|
76935
|
-
const flattenNodes =
|
|
76936
|
-
let output = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
76937
|
-
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
76415
|
+
const flattenNodes = (nodes, output = [], options) => {
|
|
76938
76416
|
const hasMaxDepth = (null == options ? void 0 : options.maxDepth) >= 0;
|
|
76939
76417
|
return nodes.forEach(node => {
|
|
76940
76418
|
(!hasMaxDepth || node.depth <= options.maxDepth) && (output.push((null == options ? void 0 : options.callback) ? options.callback(node) : node), node.children && (hasMaxDepth && node.depth === options.maxDepth ? (node.children = null, node.isLeaf = !0) : flattenNodes(node.children, output, options)));
|
|
@@ -77810,13 +77288,12 @@ SankeyLayout.defaultOptions = {
|
|
|
77810
77288
|
dropIsolatedNode: !0
|
|
77811
77289
|
};
|
|
77812
77290
|
|
|
77813
|
-
function dice (parent, x0, y0, x1, y1
|
|
77814
|
-
|
|
77815
|
-
|
|
77816
|
-
|
|
77817
|
-
|
|
77818
|
-
|
|
77819
|
-
};
|
|
77291
|
+
function dice (parent, x0, y0, x1, y1, keyMap = {
|
|
77292
|
+
x0: "x0",
|
|
77293
|
+
x1: "x1",
|
|
77294
|
+
y0: "y0",
|
|
77295
|
+
y1: "y1"
|
|
77296
|
+
}) {
|
|
77820
77297
|
const nodes = parent.children;
|
|
77821
77298
|
let node,
|
|
77822
77299
|
i = -1;
|
|
@@ -78691,21 +78168,18 @@ const getArcsFromCircles = circles => {
|
|
|
78691
78168
|
circleList = Object.values(circles);
|
|
78692
78169
|
if (!circleList.length) return [];
|
|
78693
78170
|
intersectionArea(circleList, areaStats);
|
|
78694
|
-
const arcs = areaStats.arcs.map(
|
|
78695
|
-
|
|
78696
|
-
|
|
78697
|
-
|
|
78698
|
-
|
|
78699
|
-
|
|
78700
|
-
|
|
78701
|
-
|
|
78702
|
-
|
|
78703
|
-
|
|
78704
|
-
|
|
78705
|
-
|
|
78706
|
-
largeArcFlag: width > circle.radius
|
|
78707
|
-
};
|
|
78708
|
-
}),
|
|
78171
|
+
const arcs = areaStats.arcs.map(({
|
|
78172
|
+
p1: p1,
|
|
78173
|
+
p2: p2,
|
|
78174
|
+
circle: circle,
|
|
78175
|
+
width: width
|
|
78176
|
+
}) => ({
|
|
78177
|
+
p1: p1,
|
|
78178
|
+
p2: p2,
|
|
78179
|
+
radius: circle.radius,
|
|
78180
|
+
setId: circle.setId,
|
|
78181
|
+
largeArcFlag: width > circle.radius
|
|
78182
|
+
})),
|
|
78709
78183
|
result = [];
|
|
78710
78184
|
let i = 0,
|
|
78711
78185
|
arc = arcs[0];
|
|
@@ -79417,9 +78891,7 @@ const generateIsEmptyPixel = (backgroundColor, options, createCanvas) => {
|
|
|
79417
78891
|
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]);
|
|
79418
78892
|
};
|
|
79419
78893
|
};
|
|
79420
|
-
const generateMaskCanvas =
|
|
79421
|
-
let invert = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
79422
|
-
let createCanvas = arguments.length > 5 ? arguments[5] : undefined;
|
|
78894
|
+
const generateMaskCanvas = (shape, width, height, cacheCanvas, invert = !1, createCanvas) => {
|
|
79423
78895
|
let {
|
|
79424
78896
|
backgroundColor = "#fff"
|
|
79425
78897
|
} = shape,
|
|
@@ -79462,15 +78934,11 @@ const drawTextMask = (shape, fillColor, width, height, ctx) => {
|
|
|
79462
78934
|
ctx.fillText(text, width / 2, height / 2), ctx.scale(scale, scale);
|
|
79463
78935
|
} 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));
|
|
79464
78936
|
};
|
|
79465
|
-
const generatePoints =
|
|
79466
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79467
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
78937
|
+
const generatePoints = (center, radius, startAngle = 0, count) => {
|
|
79468
78938
|
const angle = 2 * Math.PI / count;
|
|
79469
78939
|
return new Array(count).fill(0).map((entry, index) => polarToCartesian(center, radius, startAngle + index * angle));
|
|
79470
78940
|
};
|
|
79471
|
-
const generateCardioidPoints =
|
|
79472
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79473
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
78941
|
+
const generateCardioidPoints = (center, radius, startAngle = 0, count) => {
|
|
79474
78942
|
const angle = 2 * Math.PI / count,
|
|
79475
78943
|
func = getShapeFunction("cardioid");
|
|
79476
78944
|
return new Array(count).fill(0).map((entry, index) => {
|
|
@@ -79661,8 +79129,7 @@ function gaussianBlur(labels, width, height, blur) {
|
|
|
79661
79129
|
}
|
|
79662
79130
|
return result;
|
|
79663
79131
|
}
|
|
79664
|
-
function drawContour(labels, boundaryPixels, width, height) {
|
|
79665
|
-
let thickness = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
79132
|
+
function drawContour(labels, boundaryPixels, width, height, thickness = 1) {
|
|
79666
79133
|
const result = new Array(labels.length).fill(0);
|
|
79667
79134
|
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++) {
|
|
79668
79135
|
if (Math.sqrt(di * di + dj * dj) < thickness) {
|
|
@@ -79748,9 +79215,7 @@ let GridLayout$1 = class GridLayout extends BaseLayout {
|
|
|
79748
79215
|
}
|
|
79749
79216
|
return this.pointsAtRadius[radius] = points, points;
|
|
79750
79217
|
}
|
|
79751
|
-
getTextInfo(item) {
|
|
79752
|
-
let shrinkRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
79753
|
-
let index = arguments.length > 2 ? arguments[2] : undefined;
|
|
79218
|
+
getTextInfo(item, shrinkRatio = 1, index) {
|
|
79754
79219
|
var _a;
|
|
79755
79220
|
const sizeShrinkRatio = this.options.clip ? 1 : shrinkRatio,
|
|
79756
79221
|
fontSize = Math.max(Math.floor((this.isTryRepeatFill ? this.options.fillTextFontSize : this.getTextFontSize(item)) * sizeShrinkRatio), this.options.minFontSize);
|
|
@@ -79831,8 +79296,7 @@ let GridLayout$1 = class GridLayout extends BaseLayout {
|
|
|
79831
79296
|
}
|
|
79832
79297
|
return !0;
|
|
79833
79298
|
}
|
|
79834
|
-
layoutWord(index) {
|
|
79835
|
-
let shrinkRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
79299
|
+
layoutWord(index, shrinkRatio = 1) {
|
|
79836
79300
|
const item = this.data[index],
|
|
79837
79301
|
info = this.getTextInfo(item, shrinkRatio, index);
|
|
79838
79302
|
if (!info) return !1;
|
|
@@ -81398,9 +80862,19 @@ class FunnelSeries extends BaseSeries {
|
|
|
81398
80862
|
this._rootMark.setAnimationConfig(animationConfig((_d = Factory.getAnimationInKey('cartesianGroupClip')) === null || _d === void 0 ? void 0 : _d({
|
|
81399
80863
|
direction: () => (this._isHorizontal() ? 'x' : 'y'),
|
|
81400
80864
|
width: () => {
|
|
80865
|
+
const rootMark = this.getRootMark().getProduct();
|
|
80866
|
+
if (rootMark) {
|
|
80867
|
+
const { x1, x2 } = rootMark.AABBBounds;
|
|
80868
|
+
return Math.max(x1, x2);
|
|
80869
|
+
}
|
|
81401
80870
|
return this.getLayoutRect().width;
|
|
81402
80871
|
},
|
|
81403
80872
|
height: () => {
|
|
80873
|
+
const rootMark = this.getRootMark().getProduct();
|
|
80874
|
+
if (rootMark) {
|
|
80875
|
+
const { y1, y2 } = rootMark.AABBBounds;
|
|
80876
|
+
return Math.max(y1, y2);
|
|
80877
|
+
}
|
|
81404
80878
|
return this.getLayoutRect().height;
|
|
81405
80879
|
},
|
|
81406
80880
|
orient: () => (this._isReverse() ? 'negative' : 'positive')
|
|
@@ -86140,8 +85614,7 @@ class LiquidSeries extends BaseSeries {
|
|
|
86140
85614
|
.getComponentsByKey('indicator')
|
|
86141
85615
|
.forEach((indicatorComponent) => {
|
|
86142
85616
|
var _a, _b, _c;
|
|
86143
|
-
const
|
|
86144
|
-
const waveItem = (_a = grammarMark.getGraphics()[0].getSubGraphic()) === null || _a === void 0 ? void 0 : _a[0];
|
|
85617
|
+
const waveItem = (_a = this._liquidMark.getGraphics()[0].getSubGraphic()) === null || _a === void 0 ? void 0 : _a[0];
|
|
86145
85618
|
let { y1: waveY1, y2: waveY2 } = waveItem.globalAABBBounds;
|
|
86146
85619
|
waveY1 += this._region.getLayoutStartPoint().y;
|
|
86147
85620
|
waveY2 += this._region.getLayoutStartPoint().y;
|
|
@@ -88763,8 +88236,6 @@ class BaseLegend extends BaseComponent {
|
|
|
88763
88236
|
super.created();
|
|
88764
88237
|
this.initData();
|
|
88765
88238
|
}
|
|
88766
|
-
onRender(ctx) {
|
|
88767
|
-
}
|
|
88768
88239
|
_compareSpec(spec, prevSpec) {
|
|
88769
88240
|
const result = super._compareSpec(spec, prevSpec);
|
|
88770
88241
|
result.reRender = true;
|
|
@@ -88777,8 +88248,6 @@ class BaseLegend extends BaseComponent {
|
|
|
88777
88248
|
}
|
|
88778
88249
|
return result;
|
|
88779
88250
|
}
|
|
88780
|
-
changeRegions(regions) {
|
|
88781
|
-
}
|
|
88782
88251
|
_bindLegendDataChange() {
|
|
88783
88252
|
this._preSelectedData = this._selectedData.slice();
|
|
88784
88253
|
this._initSelectedData();
|
|
@@ -90222,19 +89691,12 @@ class Tooltip extends BaseComponent {
|
|
|
90222
89691
|
isTooltipShown() {
|
|
90223
89692
|
return this._isTooltipShown;
|
|
90224
89693
|
}
|
|
90225
|
-
changeRegions(regions) {
|
|
90226
|
-
}
|
|
90227
|
-
_getNeedClearVRenderComponents() {
|
|
90228
|
-
return [];
|
|
90229
|
-
}
|
|
90230
89694
|
_registerEvent() {
|
|
90231
89695
|
}
|
|
90232
89696
|
_releaseEvent() {
|
|
90233
89697
|
}
|
|
90234
89698
|
onLayoutEnd() {
|
|
90235
89699
|
}
|
|
90236
|
-
onRender(ctx) {
|
|
90237
|
-
}
|
|
90238
89700
|
created() {
|
|
90239
89701
|
super.created();
|
|
90240
89702
|
this._regions = this._option.getAllRegions();
|
|
@@ -90858,16 +90320,12 @@ class BaseCrossHair extends BaseComponent {
|
|
|
90858
90320
|
});
|
|
90859
90321
|
return map;
|
|
90860
90322
|
}
|
|
90861
|
-
changeRegions(regions) {
|
|
90862
|
-
}
|
|
90863
90323
|
onLayoutEnd() {
|
|
90864
90324
|
const region = this._regions[0];
|
|
90865
90325
|
this.setLayoutRect(region.getLayoutRect());
|
|
90866
90326
|
this.setLayoutStartPosition(region.getLayoutStartPoint());
|
|
90867
90327
|
super.onLayoutEnd();
|
|
90868
90328
|
}
|
|
90869
|
-
onRender(ctx) {
|
|
90870
|
-
}
|
|
90871
90329
|
_releaseEvent() {
|
|
90872
90330
|
this.clearOutEvent();
|
|
90873
90331
|
const triggerConfig = this._getTriggerEvent();
|
|
@@ -91653,11 +91111,12 @@ const dataFilterWithNewDomain = (data, op) => {
|
|
|
91653
91111
|
return data.filter(filter);
|
|
91654
91112
|
};
|
|
91655
91113
|
const dataFilterComputeDomain = (data, op) => {
|
|
91656
|
-
const { stateFields, valueFields, dataCollection } = op.input;
|
|
91114
|
+
const { stateFields, valueFields, dataCollection, isCategoryState } = op.input;
|
|
91657
91115
|
const { stateField, valueField } = op.output;
|
|
91658
91116
|
const resultObj = {};
|
|
91659
91117
|
const resultData = [];
|
|
91660
91118
|
const stateValues = [];
|
|
91119
|
+
let hasLockDomain = false;
|
|
91661
91120
|
dataCollection.forEach((dv, i) => {
|
|
91662
91121
|
var _a;
|
|
91663
91122
|
if (isNil$1(stateFields[i])) {
|
|
@@ -91665,6 +91124,7 @@ const dataFilterComputeDomain = (data, op) => {
|
|
|
91665
91124
|
}
|
|
91666
91125
|
const stateFieldInfo = (_a = dv.getFields()) === null || _a === void 0 ? void 0 : _a[stateFields[i]];
|
|
91667
91126
|
if (stateFieldInfo && stateFieldInfo.lockStatisticsByDomain) {
|
|
91127
|
+
hasLockDomain = true;
|
|
91668
91128
|
stateFieldInfo.domain.forEach((d) => {
|
|
91669
91129
|
if (isNil$1(resultObj[d])) {
|
|
91670
91130
|
stateValues.push(d);
|
|
@@ -91686,7 +91146,12 @@ const dataFilterComputeDomain = (data, op) => {
|
|
|
91686
91146
|
});
|
|
91687
91147
|
});
|
|
91688
91148
|
});
|
|
91689
|
-
|
|
91149
|
+
const sortedStateValues = hasLockDomain
|
|
91150
|
+
? stateValues
|
|
91151
|
+
: isCategoryState === false
|
|
91152
|
+
? stateValues.sort((a, b) => a - b)
|
|
91153
|
+
: Object.keys(resultObj);
|
|
91154
|
+
sortedStateValues.forEach(state => {
|
|
91690
91155
|
const res = { [stateField]: state };
|
|
91691
91156
|
if (valueField) {
|
|
91692
91157
|
res[valueField] = resultObj[state];
|
|
@@ -92039,6 +91504,7 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92039
91504
|
const dataCollection = [];
|
|
92040
91505
|
const stateFields = [];
|
|
92041
91506
|
const valueFields = [];
|
|
91507
|
+
let isCategoryState;
|
|
92042
91508
|
if (this._relatedAxisComponent) {
|
|
92043
91509
|
const originalStateFields = {};
|
|
92044
91510
|
eachSeries(this._regions, s => {
|
|
@@ -92064,8 +91530,6 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92064
91530
|
? xAxisHelper
|
|
92065
91531
|
: yAxisHelper;
|
|
92066
91532
|
const valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
|
|
92067
|
-
const isValidateValueAxis = isContinuous(valueAxisHelper.getScale(0).type);
|
|
92068
|
-
const isValidateStateAxis = isContinuous(stateAxisHelper.getScale(0).type);
|
|
92069
91533
|
dataCollection.push(s.getRawData());
|
|
92070
91534
|
const seriesSpec = s.getSpec();
|
|
92071
91535
|
const xField = s.coordinate === 'cartesian'
|
|
@@ -92076,7 +91540,8 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92076
91540
|
: array((_b = seriesSpec.radiusField) !== null && _b !== void 0 ? _b : seriesSpec.valueField);
|
|
92077
91541
|
originalStateFields[s.id] =
|
|
92078
91542
|
s.type === 'link' ? ['from_xField'] : stateAxisHelper === xAxisHelper ? xField : yField;
|
|
92079
|
-
if (
|
|
91543
|
+
if (isContinuous(stateAxisHelper.getScale(0).type)) {
|
|
91544
|
+
isCategoryState = false;
|
|
92080
91545
|
stateFields.push(originalStateFields[s.id]);
|
|
92081
91546
|
}
|
|
92082
91547
|
else {
|
|
@@ -92084,7 +91549,7 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92084
91549
|
}
|
|
92085
91550
|
if (this._valueField) {
|
|
92086
91551
|
const valueField = s.type === 'link' ? ['from_yField'] : valueAxisHelper === xAxisHelper ? xField : yField;
|
|
92087
|
-
if (
|
|
91552
|
+
if (isContinuous(valueAxisHelper.getScale(0).type)) {
|
|
92088
91553
|
valueFields.push(...valueField);
|
|
92089
91554
|
}
|
|
92090
91555
|
}
|
|
@@ -92116,7 +91581,8 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92116
91581
|
input: {
|
|
92117
91582
|
dataCollection: dataCollection,
|
|
92118
91583
|
stateFields,
|
|
92119
|
-
valueFields
|
|
91584
|
+
valueFields,
|
|
91585
|
+
isCategoryState
|
|
92120
91586
|
},
|
|
92121
91587
|
output: {
|
|
92122
91588
|
stateField: this._stateField,
|
|
@@ -92296,8 +91762,6 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92296
91762
|
});
|
|
92297
91763
|
}
|
|
92298
91764
|
}
|
|
92299
|
-
onRender(ctx) {
|
|
92300
|
-
}
|
|
92301
91765
|
_compareSpec(spec, prevSpec) {
|
|
92302
91766
|
const result = super._compareSpec(spec, prevSpec);
|
|
92303
91767
|
if (!result.reMake && !isEqual(prevSpec, spec)) {
|
|
@@ -92314,12 +91778,6 @@ class DataFilterBaseComponent extends BaseComponent {
|
|
|
92314
91778
|
});
|
|
92315
91779
|
});
|
|
92316
91780
|
}
|
|
92317
|
-
changeRegions() {
|
|
92318
|
-
}
|
|
92319
|
-
update(ctx) {
|
|
92320
|
-
}
|
|
92321
|
-
resize(ctx) {
|
|
92322
|
-
}
|
|
92323
91781
|
_parseDomainFromState(startValue, endValue) {
|
|
92324
91782
|
if (isContinuous(this._stateScale.type)) {
|
|
92325
91783
|
return [Math.min(endValue, startValue), Math.max(endValue, startValue)];
|
|
@@ -93190,10 +92648,6 @@ class Indicator extends BaseComponent {
|
|
|
93190
92648
|
this._content = array(this._spec.content);
|
|
93191
92649
|
this._regions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
93192
92650
|
}
|
|
93193
|
-
onRender(ctx) {
|
|
93194
|
-
}
|
|
93195
|
-
changeRegions(regions) {
|
|
93196
|
-
}
|
|
93197
92651
|
initEvent() {
|
|
93198
92652
|
if (this._option.disableTriggerEvent) {
|
|
93199
92653
|
return;
|
|
@@ -94202,10 +93656,6 @@ class BaseMarker extends BaseComponent {
|
|
|
94202
93656
|
this._relativeSeries.event.on('scroll', this._markerLayout.bind(this));
|
|
94203
93657
|
}
|
|
94204
93658
|
}
|
|
94205
|
-
onRender(ctx) {
|
|
94206
|
-
}
|
|
94207
|
-
changeRegions(regions) {
|
|
94208
|
-
}
|
|
94209
93659
|
clear() {
|
|
94210
93660
|
super.clear();
|
|
94211
93661
|
this._firstSeries = null;
|
|
@@ -94880,8 +94330,6 @@ class Title extends BaseComponent {
|
|
|
94880
94330
|
return s.visible !== false;
|
|
94881
94331
|
});
|
|
94882
94332
|
}
|
|
94883
|
-
onRender(ctx) {
|
|
94884
|
-
}
|
|
94885
94333
|
_compareSpec(spec, prevSpec) {
|
|
94886
94334
|
const result = super._compareSpec(spec, prevSpec);
|
|
94887
94335
|
if ((prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.orient) !== (spec === null || spec === void 0 ? void 0 : spec.orient) || (prevSpec === null || prevSpec === void 0 ? void 0 : prevSpec.visible) !== spec.visible) {
|
|
@@ -94891,12 +94339,6 @@ class Title extends BaseComponent {
|
|
|
94891
94339
|
result.reRender = true;
|
|
94892
94340
|
return result;
|
|
94893
94341
|
}
|
|
94894
|
-
changeRegions(regions) {
|
|
94895
|
-
}
|
|
94896
|
-
update(ctx) {
|
|
94897
|
-
}
|
|
94898
|
-
resize(ctx) {
|
|
94899
|
-
}
|
|
94900
94342
|
afterSetLayoutStartPoint(pos) {
|
|
94901
94343
|
if (isValidNumber$1(pos.x)) {
|
|
94902
94344
|
this._titleComponent && this._titleComponent.setAttribute('x', pos.x);
|
|
@@ -95594,10 +95036,6 @@ class Player extends BaseComponent {
|
|
|
95594
95036
|
this._createOrUpdatePlayerComponent();
|
|
95595
95037
|
return bounds;
|
|
95596
95038
|
}
|
|
95597
|
-
changeRegions(regions) {
|
|
95598
|
-
}
|
|
95599
|
-
onRender(ctx) {
|
|
95600
|
-
}
|
|
95601
95039
|
_getNeedClearVRenderComponents() {
|
|
95602
95040
|
return [this._playerComponent];
|
|
95603
95041
|
}
|
|
@@ -95666,10 +95104,7 @@ class Player extends BaseComponent {
|
|
|
95666
95104
|
}
|
|
95667
95105
|
changePlayerIndex(index) {
|
|
95668
95106
|
const spec = this._specs[index];
|
|
95669
|
-
|
|
95670
|
-
var _a, _b;
|
|
95671
|
-
(_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance) === null || _b === void 0 ? void 0 : _b.updateData(data.id, data.values);
|
|
95672
|
-
});
|
|
95107
|
+
this._option.globalInstance.updateFullData(spec.data);
|
|
95673
95108
|
this.event.emit(ChartEvent.playerChange, {
|
|
95674
95109
|
model: this,
|
|
95675
95110
|
value: {
|
|
@@ -95790,12 +95225,23 @@ class BaseLabelComponent extends BaseComponent {
|
|
|
95790
95225
|
};
|
|
95791
95226
|
});
|
|
95792
95227
|
}
|
|
95793
|
-
|
|
95794
|
-
|
|
95795
|
-
|
|
95228
|
+
getVRenderComponents() {
|
|
95229
|
+
const labels = [];
|
|
95230
|
+
this.getMarks().forEach(m => {
|
|
95231
|
+
const graphicItem = m.getComponent();
|
|
95232
|
+
if (graphicItem) {
|
|
95233
|
+
labels.push(graphicItem);
|
|
95234
|
+
}
|
|
95235
|
+
});
|
|
95236
|
+
return labels;
|
|
95796
95237
|
}
|
|
95797
|
-
|
|
95798
|
-
|
|
95238
|
+
clear() {
|
|
95239
|
+
super.clear();
|
|
95240
|
+
this.getMarks().forEach(m => {
|
|
95241
|
+
if (m) {
|
|
95242
|
+
m.clearComponent();
|
|
95243
|
+
}
|
|
95244
|
+
});
|
|
95799
95245
|
}
|
|
95800
95246
|
}
|
|
95801
95247
|
BaseLabelComponent.type = ComponentTypeEnum.label;
|
|
@@ -96080,7 +95526,6 @@ class Label extends BaseLabelComponent {
|
|
|
96080
95526
|
}
|
|
96081
95527
|
_updateLabelComponentAttribute(labelComponent, baseMark, labelInfos) {
|
|
96082
95528
|
const totalLabels = this._option.getComponentsByType('totalLabel');
|
|
96083
|
-
labelComponent.clearComponent();
|
|
96084
95529
|
labelComponent.setMarkConfig({
|
|
96085
95530
|
interactive: false
|
|
96086
95531
|
});
|
|
@@ -96141,16 +95586,6 @@ class Label extends BaseLabelComponent {
|
|
|
96141
95586
|
m.compile({ group });
|
|
96142
95587
|
});
|
|
96143
95588
|
}
|
|
96144
|
-
getVRenderComponents() {
|
|
96145
|
-
const labels = [];
|
|
96146
|
-
this._labelComponentMap.forEach((infoFunc, component) => {
|
|
96147
|
-
const graphicItem = component.getComponent();
|
|
96148
|
-
if (graphicItem) {
|
|
96149
|
-
labels.push(graphicItem);
|
|
96150
|
-
}
|
|
96151
|
-
});
|
|
96152
|
-
return labels;
|
|
96153
|
-
}
|
|
96154
95589
|
getLabelInfoByTextGraphic(text) {
|
|
96155
95590
|
let labelInfo;
|
|
96156
95591
|
const vrenderLabel = text === null || text === void 0 ? void 0 : text.parent;
|
|
@@ -96274,7 +95709,6 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
96274
95709
|
super.updateLayoutAttribute();
|
|
96275
95710
|
const series = this._getSeries();
|
|
96276
95711
|
this._marks.forEach((componentMark, index) => {
|
|
96277
|
-
componentMark.clearComponent();
|
|
96278
95712
|
componentMark.setMarkConfig({
|
|
96279
95713
|
interactive: false
|
|
96280
95714
|
});
|
|
@@ -96321,16 +95755,6 @@ class TotalLabel extends BaseLabelComponent {
|
|
|
96321
95755
|
m.compile({ group, context: { model: this } });
|
|
96322
95756
|
});
|
|
96323
95757
|
}
|
|
96324
|
-
getVRenderComponents() {
|
|
96325
|
-
const labels = [];
|
|
96326
|
-
this.getMarks().forEach(m => {
|
|
96327
|
-
const graphicItem = m.getComponent();
|
|
96328
|
-
if (graphicItem) {
|
|
96329
|
-
labels.push(graphicItem);
|
|
96330
|
-
}
|
|
96331
|
-
});
|
|
96332
|
-
return labels;
|
|
96333
|
-
}
|
|
96334
95758
|
_getSeries() {
|
|
96335
95759
|
return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0];
|
|
96336
95760
|
}
|
|
@@ -96403,7 +95827,7 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
96403
95827
|
dx: 0,
|
|
96404
95828
|
dy: 0
|
|
96405
95829
|
};
|
|
96406
|
-
itemContentStyle = transformLabelAttributes(merge$1((_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style
|
|
95830
|
+
itemContentStyle = transformLabelAttributes(merge$1(defaultStyle, (_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style), this._markerData, this._markAttributeContext);
|
|
96407
95831
|
}
|
|
96408
95832
|
else if (type === 'richText') {
|
|
96409
95833
|
itemContentState = (_c = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _c !== void 0 ? _c : state;
|
|
@@ -96815,10 +96239,6 @@ class Brush extends BaseComponent {
|
|
|
96815
96239
|
}
|
|
96816
96240
|
initEvent() {
|
|
96817
96241
|
}
|
|
96818
|
-
onRender(ctx) {
|
|
96819
|
-
}
|
|
96820
|
-
changeRegions(regions) {
|
|
96821
|
-
}
|
|
96822
96242
|
_compareSpec(spec, prevSpec) {
|
|
96823
96243
|
if (this._brushComponents) {
|
|
96824
96244
|
this._relativeRegions.forEach((region, index) => {
|
|
@@ -97364,13 +96784,6 @@ class CustomMark extends BaseComponent {
|
|
|
97364
96784
|
result.reRender = true;
|
|
97365
96785
|
return result;
|
|
97366
96786
|
}
|
|
97367
|
-
changeRegions(regions) {
|
|
97368
|
-
}
|
|
97369
|
-
_getNeedClearVRenderComponents() {
|
|
97370
|
-
return [];
|
|
97371
|
-
}
|
|
97372
|
-
onRender(ctx) {
|
|
97373
|
-
}
|
|
97374
96787
|
_getMarkAttributeContext() {
|
|
97375
96788
|
return {
|
|
97376
96789
|
vchart: this._option.globalInstance,
|