@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.js
CHANGED
|
@@ -435,10 +435,7 @@
|
|
|
435
435
|
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
436
436
|
var isType$1 = isType;
|
|
437
437
|
|
|
438
|
-
const isBoolean =
|
|
439
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
440
|
-
return fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
441
|
-
};
|
|
438
|
+
const isBoolean = (value, fuzzy = !1) => fuzzy ? "boolean" == typeof value : !0 === value || !1 === value || isType$1(value, "Boolean");
|
|
442
439
|
var isBoolean$1 = isBoolean;
|
|
443
440
|
|
|
444
441
|
const isFunction = value => "function" == typeof value;
|
|
@@ -471,8 +468,7 @@
|
|
|
471
468
|
const isUndefined = value => void 0 === value;
|
|
472
469
|
var isUndefined$1 = isUndefined;
|
|
473
470
|
|
|
474
|
-
const isString =
|
|
475
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
471
|
+
const isString = (value, fuzzy = !1) => {
|
|
476
472
|
const type = typeof value;
|
|
477
473
|
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
478
474
|
};
|
|
@@ -489,8 +485,7 @@
|
|
|
489
485
|
const isDate = value => isType$1(value, "Date");
|
|
490
486
|
var isDate$1 = isDate;
|
|
491
487
|
|
|
492
|
-
const isNumber =
|
|
493
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
488
|
+
const isNumber = (value, fuzzy = !1) => {
|
|
494
489
|
const type = typeof value;
|
|
495
490
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
496
491
|
};
|
|
@@ -556,9 +551,7 @@
|
|
|
556
551
|
return result;
|
|
557
552
|
}
|
|
558
553
|
|
|
559
|
-
function baseMerge(target, source) {
|
|
560
|
-
let shallowArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
561
|
-
let skipTargetArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
554
|
+
function baseMerge(target, source, shallowArray = !1, skipTargetArray = !1) {
|
|
562
555
|
if (source) {
|
|
563
556
|
if (target === source) return;
|
|
564
557
|
if (isValid$1(source) && "object" == typeof source) {
|
|
@@ -576,9 +569,7 @@
|
|
|
576
569
|
}
|
|
577
570
|
}
|
|
578
571
|
}
|
|
579
|
-
function baseMergeDeep(target, source, key) {
|
|
580
|
-
let shallowArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
581
|
-
let skipTargetArray = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
572
|
+
function baseMergeDeep(target, source, key, shallowArray = !1, skipTargetArray = !1) {
|
|
582
573
|
const objValue = target[key],
|
|
583
574
|
srcValue = source[key];
|
|
584
575
|
let newValue = source[key],
|
|
@@ -599,11 +590,11 @@
|
|
|
599
590
|
function eq(value, other) {
|
|
600
591
|
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
601
592
|
}
|
|
602
|
-
function merge$1(target) {
|
|
593
|
+
function merge$1(target, ...sources) {
|
|
603
594
|
let sourceIndex = -1;
|
|
604
|
-
const length =
|
|
595
|
+
const length = sources.length;
|
|
605
596
|
for (; ++sourceIndex < length;) {
|
|
606
|
-
baseMerge(target,
|
|
597
|
+
baseMerge(target, sources[sourceIndex], !0);
|
|
607
598
|
}
|
|
608
599
|
return target;
|
|
609
600
|
}
|
|
@@ -667,8 +658,7 @@
|
|
|
667
658
|
}
|
|
668
659
|
return target;
|
|
669
660
|
}
|
|
670
|
-
function mixin(target, source) {
|
|
671
|
-
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
661
|
+
function mixin(target, source, override = !0) {
|
|
672
662
|
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source, Object.getOwnPropertyNames) {
|
|
673
663
|
const keyList = Object.getOwnPropertyNames(source);
|
|
674
664
|
for (let i = 0; i < keyList.length; i++) {
|
|
@@ -715,8 +705,7 @@
|
|
|
715
705
|
function uniqArray(arr) {
|
|
716
706
|
return arr && isArray$1(arr) ? Array.from(new Set(array(arr))) : arr;
|
|
717
707
|
}
|
|
718
|
-
function shuffleArray(arr) {
|
|
719
|
-
let random = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Math.random;
|
|
708
|
+
function shuffleArray(arr, random = Math.random) {
|
|
720
709
|
let j,
|
|
721
710
|
x,
|
|
722
711
|
i = arr.length;
|
|
@@ -747,8 +736,7 @@
|
|
|
747
736
|
return Number(a);
|
|
748
737
|
}
|
|
749
738
|
|
|
750
|
-
function quantileSorted(values, percent) {
|
|
751
|
-
let valueof = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : toNumber;
|
|
739
|
+
function quantileSorted(values, percent, valueof = toNumber) {
|
|
752
740
|
const n = values.length;
|
|
753
741
|
if (!n) return;
|
|
754
742
|
if (percent <= 0 || n < 2) return valueof(values[0], 0, values);
|
|
@@ -781,9 +769,7 @@
|
|
|
781
769
|
static clearInstance() {
|
|
782
770
|
Logger._instance = null;
|
|
783
771
|
}
|
|
784
|
-
constructor() {
|
|
785
|
-
let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : LoggerLevel.None;
|
|
786
|
-
let method = arguments.length > 1 ? arguments[1] : undefined;
|
|
772
|
+
constructor(level = LoggerLevel.None, method) {
|
|
787
773
|
this._onErrorHandler = [], this._level = level, this._method = method;
|
|
788
774
|
}
|
|
789
775
|
addErrorHandler(handler) {
|
|
@@ -793,10 +779,7 @@
|
|
|
793
779
|
const index = this._onErrorHandler.findIndex(h => h === handler);
|
|
794
780
|
index < 0 || this._onErrorHandler.splice(index, 1);
|
|
795
781
|
}
|
|
796
|
-
callErrorHandler() {
|
|
797
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
798
|
-
args[_key] = arguments[_key];
|
|
799
|
-
}
|
|
782
|
+
callErrorHandler(...args) {
|
|
800
783
|
this._onErrorHandler.forEach(h => h(...args));
|
|
801
784
|
}
|
|
802
785
|
canLogInfo() {
|
|
@@ -814,37 +797,23 @@
|
|
|
814
797
|
level(levelValue) {
|
|
815
798
|
return arguments.length ? (this._level = +levelValue, this) : this._level;
|
|
816
799
|
}
|
|
817
|
-
error() {
|
|
800
|
+
error(...args) {
|
|
818
801
|
var _a;
|
|
819
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
820
|
-
args[_key2] = arguments[_key2];
|
|
821
|
-
}
|
|
822
802
|
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;
|
|
823
803
|
}
|
|
824
|
-
warn() {
|
|
825
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
826
|
-
args[_key3] = arguments[_key3];
|
|
827
|
-
}
|
|
804
|
+
warn(...args) {
|
|
828
805
|
return this._level >= LoggerLevel.Warn && log$2(this._method || "warn", "WARN", args), this;
|
|
829
806
|
}
|
|
830
|
-
info() {
|
|
831
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
832
|
-
args[_key4] = arguments[_key4];
|
|
833
|
-
}
|
|
807
|
+
info(...args) {
|
|
834
808
|
return this._level >= LoggerLevel.Info && log$2(this._method || "log", "INFO", args), this;
|
|
835
809
|
}
|
|
836
|
-
debug() {
|
|
837
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
838
|
-
args[_key5] = arguments[_key5];
|
|
839
|
-
}
|
|
810
|
+
debug(...args) {
|
|
840
811
|
return this._level >= LoggerLevel.Debug && log$2(this._method || "log", "DEBUG", args), this;
|
|
841
812
|
}
|
|
842
813
|
}
|
|
843
814
|
Logger._instance = null;
|
|
844
815
|
|
|
845
|
-
function bisect(a, x) {
|
|
846
|
-
let lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
847
|
-
let hi = arguments.length > 3 ? arguments[3] : undefined;
|
|
816
|
+
function bisect(a, x, lo = 0, hi) {
|
|
848
817
|
for (isNil$1(hi) && (hi = a.length); lo < hi;) {
|
|
849
818
|
const mid = lo + hi >>> 1;
|
|
850
819
|
ascending$1(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
|
@@ -889,9 +858,7 @@
|
|
|
889
858
|
|
|
890
859
|
const DEFAULT_ABSOLUTE_TOLERATE = 1e-10,
|
|
891
860
|
DEFAULT_RELATIVE_TOLERATE = 1e-10;
|
|
892
|
-
function isNumberClose(a, b) {
|
|
893
|
-
let relTol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_RELATIVE_TOLERATE;
|
|
894
|
-
let absTol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_ABSOLUTE_TOLERATE;
|
|
861
|
+
function isNumberClose(a, b, relTol = DEFAULT_RELATIVE_TOLERATE, absTol = DEFAULT_ABSOLUTE_TOLERATE) {
|
|
895
862
|
const abs = absTol,
|
|
896
863
|
rel = relTol * Math.max(a, b);
|
|
897
864
|
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
@@ -906,12 +873,7 @@
|
|
|
906
873
|
const memoize = func => {
|
|
907
874
|
let lastArgs = null,
|
|
908
875
|
lastResult = null;
|
|
909
|
-
return
|
|
910
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
911
|
-
args[_key] = arguments[_key];
|
|
912
|
-
}
|
|
913
|
-
return lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult;
|
|
914
|
-
};
|
|
876
|
+
return (...args) => (lastArgs && args.every((val, i) => val === lastArgs[i]) || (lastArgs = args, lastResult = func(...args)), lastResult);
|
|
915
877
|
};
|
|
916
878
|
|
|
917
879
|
const clamp = function (input, min, max) {
|
|
@@ -975,12 +937,9 @@
|
|
|
975
937
|
function trailingEdge(time) {
|
|
976
938
|
return timerId = void 0, trailing && lastArgs ? invokeFunc(time) : (lastArgs = lastThis = void 0, result);
|
|
977
939
|
}
|
|
978
|
-
function debounced() {
|
|
940
|
+
function debounced(...args) {
|
|
979
941
|
const time = Date.now(),
|
|
980
942
|
isInvoking = shouldInvoke(time);
|
|
981
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
982
|
-
args[_key] = arguments[_key];
|
|
983
|
-
}
|
|
984
943
|
if (lastArgs = args, lastThis = this, lastCallTime = time, isInvoking) {
|
|
985
944
|
if (void 0 === timerId) return function (time) {
|
|
986
945
|
return lastInvokeTime = time, timerId = startTimer(timerExpired, wait), leading ? invokeFunc(time) : result;
|
|
@@ -1040,8 +999,7 @@
|
|
|
1040
999
|
const a = 1664525,
|
|
1041
1000
|
c$1 = 1013904223,
|
|
1042
1001
|
m$2 = 4294967296;
|
|
1043
|
-
function randomLCG() {
|
|
1044
|
-
let initS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1002
|
+
function randomLCG(initS = 1) {
|
|
1045
1003
|
let s = initS;
|
|
1046
1004
|
return () => (s = (a * s + c$1) % m$2) / m$2;
|
|
1047
1005
|
}
|
|
@@ -1052,14 +1010,12 @@
|
|
|
1052
1010
|
};
|
|
1053
1011
|
|
|
1054
1012
|
const getter = path => obj => get$1(obj, path);
|
|
1055
|
-
const fieldSingle =
|
|
1056
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1013
|
+
const fieldSingle = (fieldStr, opt = {}) => {
|
|
1057
1014
|
if (isFunction$1(fieldStr)) return fieldStr;
|
|
1058
1015
|
const path = [fieldStr];
|
|
1059
1016
|
return (opt && opt.get || getter)(path);
|
|
1060
1017
|
};
|
|
1061
|
-
const field$2 =
|
|
1062
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1018
|
+
const field$2 = (fieldStr, opt = {}) => {
|
|
1063
1019
|
if (isArray$1(fieldStr)) {
|
|
1064
1020
|
const funcs = fieldStr.map(entry => fieldSingle(entry, opt));
|
|
1065
1021
|
return datum => funcs.map(func => func(datum));
|
|
@@ -1108,9 +1064,7 @@
|
|
|
1108
1064
|
SSE += sse * sse, SST += sst * sst;
|
|
1109
1065
|
}), 1 - SSE / SST;
|
|
1110
1066
|
}
|
|
1111
|
-
function regressionLinear(data) {
|
|
1112
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : datum => datum.x;
|
|
1113
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : datum => datum.y;
|
|
1067
|
+
function regressionLinear(data, x = datum => datum.x, y = datum => datum.y) {
|
|
1114
1068
|
let X = 0,
|
|
1115
1069
|
Y = 0,
|
|
1116
1070
|
XY = 0,
|
|
@@ -1166,8 +1120,7 @@
|
|
|
1166
1120
|
function fuzzyEqualVec(a, b) {
|
|
1167
1121
|
return abs$1(a[0] - b[0]) + abs$1(a[1] - b[1]) < 1e-12;
|
|
1168
1122
|
}
|
|
1169
|
-
function fixPrecision$1(num) {
|
|
1170
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
1123
|
+
function fixPrecision$1(num, precision = 10) {
|
|
1171
1124
|
return Math.round(num * precision) / precision;
|
|
1172
1125
|
}
|
|
1173
1126
|
function getDecimalPlaces(n) {
|
|
@@ -1183,11 +1136,7 @@
|
|
|
1183
1136
|
}
|
|
1184
1137
|
|
|
1185
1138
|
class Point {
|
|
1186
|
-
constructor() {
|
|
1187
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1188
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1189
|
-
let x1 = arguments.length > 2 ? arguments[2] : undefined;
|
|
1190
|
-
let y1 = arguments.length > 3 ? arguments[3] : undefined;
|
|
1139
|
+
constructor(x = 0, y = 0, x1, y1) {
|
|
1191
1140
|
this.x = 0, this.y = 0, this.x = x, this.y = y, this.x1 = x1, this.y1 = y1;
|
|
1192
1141
|
}
|
|
1193
1142
|
clone() {
|
|
@@ -1233,8 +1182,7 @@
|
|
|
1233
1182
|
function radianToDegree(radian) {
|
|
1234
1183
|
return 180 * radian / Math.PI;
|
|
1235
1184
|
}
|
|
1236
|
-
const clampRadian =
|
|
1237
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1185
|
+
const clampRadian = (angle = 0) => {
|
|
1238
1186
|
if (angle < 0) for (; angle < -tau$1;) angle += tau$1;else if (angle > 0) for (; angle > tau$1;) angle -= tau$1;
|
|
1239
1187
|
return angle;
|
|
1240
1188
|
};
|
|
@@ -1248,13 +1196,10 @@
|
|
|
1248
1196
|
y: center.y
|
|
1249
1197
|
};
|
|
1250
1198
|
}
|
|
1251
|
-
function cartesianToPolar(point
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
};
|
|
1256
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1257
|
-
let endAngle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2 * Math.PI;
|
|
1199
|
+
function cartesianToPolar(point, center = {
|
|
1200
|
+
x: 0,
|
|
1201
|
+
y: 0
|
|
1202
|
+
}, startAngle = 0, endAngle = 2 * Math.PI) {
|
|
1258
1203
|
const {
|
|
1259
1204
|
x: x,
|
|
1260
1205
|
y: y
|
|
@@ -1430,15 +1375,13 @@
|
|
|
1430
1375
|
function getProjectionRadius(checkAxis, axis) {
|
|
1431
1376
|
return Math.abs(axis[0] * checkAxis[0] + axis[1] * checkAxis[1]);
|
|
1432
1377
|
}
|
|
1433
|
-
function rotatePoint(
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
y: 0
|
|
1441
|
-
};
|
|
1378
|
+
function rotatePoint({
|
|
1379
|
+
x: x,
|
|
1380
|
+
y: y
|
|
1381
|
+
}, rad, origin = {
|
|
1382
|
+
x: 0,
|
|
1383
|
+
y: 0
|
|
1384
|
+
}) {
|
|
1442
1385
|
return {
|
|
1443
1386
|
x: (x - origin.x) * Math.cos(rad) - (y - origin.y) * Math.sin(rad) + origin.x,
|
|
1444
1387
|
y: (x - origin.x) * Math.sin(rad) + (y - origin.y) * Math.cos(rad) + origin.y
|
|
@@ -1467,8 +1410,7 @@
|
|
|
1467
1410
|
y: box.y2
|
|
1468
1411
|
}, deg, cp)];
|
|
1469
1412
|
}
|
|
1470
|
-
function isRotateAABBIntersect(box1, box2) {
|
|
1471
|
-
let isDeg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
1413
|
+
function isRotateAABBIntersect(box1, box2, isDeg = !1) {
|
|
1472
1414
|
const rect1 = toRect(box1, isDeg),
|
|
1473
1415
|
rect2 = toRect(box2, isDeg),
|
|
1474
1416
|
vector = (start, end) => [end.x - start.x, end.y - start.y],
|
|
@@ -1536,9 +1478,7 @@
|
|
|
1536
1478
|
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";
|
|
1537
1479
|
};
|
|
1538
1480
|
|
|
1539
|
-
function getContextFont(text) {
|
|
1540
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1541
|
-
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1481
|
+
function getContextFont(text, defaultAttr = {}, fontSizeScale) {
|
|
1542
1482
|
fontSizeScale || (fontSizeScale = 1);
|
|
1543
1483
|
const {
|
|
1544
1484
|
fontStyle = defaultAttr.fontStyle,
|
|
@@ -1864,49 +1804,29 @@
|
|
|
1864
1804
|
equals(b) {
|
|
1865
1805
|
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
1866
1806
|
}
|
|
1867
|
-
setValue() {
|
|
1868
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1869
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1870
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1871
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1807
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1872
1808
|
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
1873
1809
|
}
|
|
1874
|
-
set() {
|
|
1875
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1876
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1877
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1878
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1810
|
+
set(x1 = 0, y1 = 0, x2 = 0, y2 = 0) {
|
|
1879
1811
|
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;
|
|
1880
1812
|
}
|
|
1881
|
-
add() {
|
|
1882
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1883
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1813
|
+
add(x = 0, y = 0) {
|
|
1884
1814
|
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;
|
|
1885
1815
|
}
|
|
1886
|
-
expand() {
|
|
1887
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1816
|
+
expand(d = 0) {
|
|
1888
1817
|
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;
|
|
1889
1818
|
}
|
|
1890
1819
|
round() {
|
|
1891
1820
|
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;
|
|
1892
1821
|
}
|
|
1893
|
-
translate() {
|
|
1894
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1895
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1822
|
+
translate(dx = 0, dy = 0) {
|
|
1896
1823
|
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
1897
1824
|
}
|
|
1898
|
-
rotate() {
|
|
1899
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1900
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1901
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1825
|
+
rotate(angle = 0, x = 0, y = 0) {
|
|
1902
1826
|
const p = this.rotatedPoints(angle, x, y);
|
|
1903
1827
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
1904
1828
|
}
|
|
1905
|
-
scale() {
|
|
1906
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1907
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1908
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1909
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1829
|
+
scale(sx = 0, sy = 0, x = 0, y = 0) {
|
|
1910
1830
|
const p = this.scalePoints(sx, sy, x, y);
|
|
1911
1831
|
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
1912
1832
|
}
|
|
@@ -1925,9 +1845,7 @@
|
|
|
1925
1845
|
intersects(b) {
|
|
1926
1846
|
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
1927
1847
|
}
|
|
1928
|
-
contains() {
|
|
1929
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1930
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1848
|
+
contains(x = 0, y = 0) {
|
|
1931
1849
|
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
1932
1850
|
}
|
|
1933
1851
|
containsPoint(p) {
|
|
@@ -1939,12 +1857,10 @@
|
|
|
1939
1857
|
height() {
|
|
1940
1858
|
return this.empty() ? 0 : this.y2 - this.y1;
|
|
1941
1859
|
}
|
|
1942
|
-
scaleX() {
|
|
1943
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1860
|
+
scaleX(s = 0) {
|
|
1944
1861
|
return this.x1 *= s, this.x2 *= s, this;
|
|
1945
1862
|
}
|
|
1946
|
-
scaleY() {
|
|
1947
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1863
|
+
scaleY(s = 0) {
|
|
1948
1864
|
return this.y1 *= s, this.y2 *= s, this;
|
|
1949
1865
|
}
|
|
1950
1866
|
transformWithMatrix(matrix) {
|
|
@@ -1978,20 +1894,14 @@
|
|
|
1978
1894
|
}
|
|
1979
1895
|
class AABBBounds extends Bounds {}
|
|
1980
1896
|
class OBBBounds extends Bounds {
|
|
1981
|
-
constructor(bounds) {
|
|
1982
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1897
|
+
constructor(bounds, angle = 0) {
|
|
1983
1898
|
var _a;
|
|
1984
1899
|
super(bounds), bounds && (this.angle = null !== (_a = bounds.angle) && void 0 !== _a ? _a : angle);
|
|
1985
1900
|
}
|
|
1986
1901
|
intersects(b) {
|
|
1987
1902
|
return isRotateAABBIntersect(this, b);
|
|
1988
1903
|
}
|
|
1989
|
-
setValue() {
|
|
1990
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1991
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1992
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1993
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1994
|
-
let angle = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
1904
|
+
setValue(x1 = 0, y1 = 0, x2 = 0, y2 = 0, angle = 0) {
|
|
1995
1905
|
return super.setValue(x1, y1, x2, y2), this.angle = angle, this;
|
|
1996
1906
|
}
|
|
1997
1907
|
clone() {
|
|
@@ -2019,13 +1929,7 @@
|
|
|
2019
1929
|
}
|
|
2020
1930
|
|
|
2021
1931
|
class Matrix {
|
|
2022
|
-
constructor() {
|
|
2023
|
-
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2024
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2025
|
-
let c = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2026
|
-
let d = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
2027
|
-
let e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2028
|
-
let f = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
1932
|
+
constructor(a = 1, b = 0, c = 0, d = 1, e = 0, f = 0) {
|
|
2029
1933
|
this.a = a, this.b = b, this.c = c, this.d = d, this.e = e, this.f = f;
|
|
2030
1934
|
}
|
|
2031
1935
|
equalToMatrix(m2) {
|
|
@@ -2135,8 +2039,7 @@
|
|
|
2135
2039
|
} = source;
|
|
2136
2040
|
target.x = x * nextA + y * nextC + nextE, target.y = x * nextB + y * nextD + nextF;
|
|
2137
2041
|
}
|
|
2138
|
-
onlyTranslate() {
|
|
2139
|
-
let scale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2042
|
+
onlyTranslate(scale = 1) {
|
|
2140
2043
|
return this.a === scale && 0 === this.b && 0 === this.c && this.d === scale;
|
|
2141
2044
|
}
|
|
2142
2045
|
clone() {
|
|
@@ -2443,16 +2346,13 @@
|
|
|
2443
2346
|
}
|
|
2444
2347
|
};
|
|
2445
2348
|
class Color {
|
|
2446
|
-
static Brighter(source) {
|
|
2447
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2349
|
+
static Brighter(source, b = 1) {
|
|
2448
2350
|
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
2449
2351
|
}
|
|
2450
|
-
static SetOpacity(source) {
|
|
2451
|
-
let o = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
2352
|
+
static SetOpacity(source, o = 1) {
|
|
2452
2353
|
return 1 === o ? source : new Color(source).setOpacity(o).toRGBA();
|
|
2453
2354
|
}
|
|
2454
|
-
static getColorBrightness(source) {
|
|
2455
|
-
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "hsl";
|
|
2355
|
+
static getColorBrightness(source, model = "hsl") {
|
|
2456
2356
|
const color = source instanceof Color ? source : new Color(source);
|
|
2457
2357
|
switch (model) {
|
|
2458
2358
|
case "hsv":
|
|
@@ -2556,8 +2456,7 @@
|
|
|
2556
2456
|
setScalar(scalar) {
|
|
2557
2457
|
return this.color.r = scalar, this.color.g = scalar, this.color.b = scalar, this;
|
|
2558
2458
|
}
|
|
2559
|
-
setOpacity() {
|
|
2560
|
-
let o = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2459
|
+
setOpacity(o = 1) {
|
|
2561
2460
|
return this.color.opacity = o, this;
|
|
2562
2461
|
}
|
|
2563
2462
|
getLuminance() {
|
|
@@ -2580,12 +2479,10 @@
|
|
|
2580
2479
|
clone() {
|
|
2581
2480
|
return new Color(this.color.toString());
|
|
2582
2481
|
}
|
|
2583
|
-
copyGammaToLinear(color) {
|
|
2584
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2482
|
+
copyGammaToLinear(color, gammaFactor = 2) {
|
|
2585
2483
|
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;
|
|
2586
2484
|
}
|
|
2587
|
-
copyLinearToGamma(color) {
|
|
2588
|
-
let gammaFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
2485
|
+
copyLinearToGamma(color, gammaFactor = 2) {
|
|
2589
2486
|
const safeInverse = gammaFactor > 0 ? 1 / gammaFactor : 1;
|
|
2590
2487
|
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;
|
|
2591
2488
|
}
|
|
@@ -2705,9 +2602,7 @@
|
|
|
2705
2602
|
return [0, 0, 0, 0];
|
|
2706
2603
|
}
|
|
2707
2604
|
|
|
2708
|
-
function getContainerSize(el) {
|
|
2709
|
-
let defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2710
|
-
let defaultHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2605
|
+
function getContainerSize(el, defaultWidth = 0, defaultHeight = 0) {
|
|
2711
2606
|
if (!el) return {
|
|
2712
2607
|
width: defaultWidth,
|
|
2713
2608
|
height: defaultHeight
|
|
@@ -2742,8 +2637,7 @@
|
|
|
2742
2637
|
y: y
|
|
2743
2638
|
};
|
|
2744
2639
|
}
|
|
2745
|
-
const styleStringToObject =
|
|
2746
|
-
let styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2640
|
+
const styleStringToObject = (styleStr = "") => {
|
|
2747
2641
|
const res = {};
|
|
2748
2642
|
return styleStr.split(";").forEach(item => {
|
|
2749
2643
|
if (item) {
|
|
@@ -3214,8 +3108,7 @@
|
|
|
3214
3108
|
}
|
|
3215
3109
|
|
|
3216
3110
|
class FormatSpecifier {
|
|
3217
|
-
constructor() {
|
|
3218
|
-
let specifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3111
|
+
constructor(specifier = {}) {
|
|
3219
3112
|
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 + "";
|
|
3220
3113
|
}
|
|
3221
3114
|
toString() {
|
|
@@ -5975,10 +5868,7 @@
|
|
|
5975
5868
|
var simplifyGeojsonExports = simplifyGeojson.exports;
|
|
5976
5869
|
var geoSimplify = /*@__PURE__*/getDefaultExportFromCjs(simplifyGeojsonExports);
|
|
5977
5870
|
|
|
5978
|
-
const mergeDeepImmer = function (target) {
|
|
5979
|
-
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
|
|
5980
|
-
sources[_key2 - 1] = arguments[_key2];
|
|
5981
|
-
}
|
|
5871
|
+
const mergeDeepImmer = function (target, ...sources) {
|
|
5982
5872
|
return mergeOption(cloneDeep(target), ...sources);
|
|
5983
5873
|
};
|
|
5984
5874
|
function _mergeOptionDeep(target, source, key) {
|
|
@@ -5991,12 +5881,12 @@
|
|
|
5991
5881
|
function _mergeOptionBase(target, source) {
|
|
5992
5882
|
if (isObject$2(source) && target !== source) for (const key in source) _mergeOptionDeep(target, source, key);
|
|
5993
5883
|
}
|
|
5994
|
-
function mergeOption(target) {
|
|
5884
|
+
function mergeOption(target, ...sources) {
|
|
5995
5885
|
target || (target = {});
|
|
5996
5886
|
let sourceIndex = -1;
|
|
5997
|
-
const length =
|
|
5887
|
+
const length = sources.length;
|
|
5998
5888
|
for (; ++sourceIndex < length;) {
|
|
5999
|
-
_mergeOptionBase(target,
|
|
5889
|
+
_mergeOptionBase(target, sources[sourceIndex]);
|
|
6000
5890
|
}
|
|
6001
5891
|
return target;
|
|
6002
5892
|
}
|
|
@@ -6240,9 +6130,7 @@
|
|
|
6240
6130
|
const DEFAULT_DSV_PARSER_OPTIONS = {
|
|
6241
6131
|
delimiter: ","
|
|
6242
6132
|
};
|
|
6243
|
-
const dsvParser =
|
|
6244
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6245
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6133
|
+
const dsvParser = (data, options = {}, dataView) => {
|
|
6246
6134
|
dataView.type = DATAVIEW_TYPE.DSV;
|
|
6247
6135
|
const mergeOptions = mergeDeepImmer(DEFAULT_DSV_PARSER_OPTIONS, options),
|
|
6248
6136
|
{
|
|
@@ -6251,14 +6139,8 @@
|
|
|
6251
6139
|
if (!isString$1(delimiter)) throw new TypeError("Invalid delimiter: must be a string!");
|
|
6252
6140
|
return dsvFormat(delimiter).parse(data);
|
|
6253
6141
|
};
|
|
6254
|
-
const csvParser =
|
|
6255
|
-
|
|
6256
|
-
return dataView.type = DATAVIEW_TYPE.DSV, csvParse(data);
|
|
6257
|
-
};
|
|
6258
|
-
const tsvParser = function (data) {
|
|
6259
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6260
|
-
return dataView.type = DATAVIEW_TYPE.DSV, tsvParse(data);
|
|
6261
|
-
};
|
|
6142
|
+
const csvParser = (data, options = {}, dataView) => (dataView.type = DATAVIEW_TYPE.DSV, csvParse(data));
|
|
6143
|
+
const tsvParser = (data, options = {}, dataView) => (dataView.type = DATAVIEW_TYPE.DSV, tsvParse(data));
|
|
6262
6144
|
|
|
6263
6145
|
/**
|
|
6264
6146
|
* Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.
|
|
@@ -6861,9 +6743,7 @@
|
|
|
6861
6743
|
}) : featuresArr.push(MultiToSingle(item));
|
|
6862
6744
|
}), featuresArr;
|
|
6863
6745
|
};
|
|
6864
|
-
const geoJSONParser =
|
|
6865
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6866
|
-
let dataView = arguments.length > 2 ? arguments[2] : undefined;
|
|
6746
|
+
const geoJSONParser = (data, options = {}, dataView) => {
|
|
6867
6747
|
dataView.type = DATAVIEW_TYPE.GEO;
|
|
6868
6748
|
const mergeOptions = mergeDeepImmer(DEFAULT_GEOJSON_OPTIONS, options),
|
|
6869
6749
|
{
|
|
@@ -6912,8 +6792,7 @@
|
|
|
6912
6792
|
|
|
6913
6793
|
let idIndex = 0;
|
|
6914
6794
|
const maxId = 1e8;
|
|
6915
|
-
function getUUID() {
|
|
6916
|
-
let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "dataset";
|
|
6795
|
+
function getUUID(prefix = "dataset") {
|
|
6917
6796
|
return idIndex > maxId && (idIndex = 0), prefix + "_" + idIndex++;
|
|
6918
6797
|
}
|
|
6919
6798
|
|
|
@@ -7001,25 +6880,22 @@
|
|
|
7001
6880
|
|
|
7002
6881
|
class DataView {
|
|
7003
6882
|
constructor(dataSet, options) {
|
|
7004
|
-
var _this = this;
|
|
7005
6883
|
let name;
|
|
7006
|
-
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 =
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
_this.executeTransform(t, {
|
|
6884
|
+
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 = {}) => {
|
|
6885
|
+
const prevLatestData = this.latestData;
|
|
6886
|
+
return this.isRunning = !0, this.resetTransformData(), this.transformsArr.forEach(t => {
|
|
6887
|
+
this.executeTransform(t, {
|
|
7011
6888
|
pushHistory: opt.pushHistory,
|
|
7012
6889
|
emitMessage: !1
|
|
7013
6890
|
});
|
|
7014
|
-
}),
|
|
7015
|
-
latestData:
|
|
7016
|
-
}),
|
|
6891
|
+
}), this.isRunning = !1, !1 === opt.emitMessage || opt.skipEqual && isEqual(prevLatestData, this.latestData) || this.target.emit("change", {
|
|
6892
|
+
latestData: this.latestData
|
|
6893
|
+
}), this;
|
|
7017
6894
|
}, this.markRunning = () => {
|
|
7018
6895
|
this.isRunning = !0, this.target.emit("markRunning", []);
|
|
7019
6896
|
}, 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);
|
|
7020
6897
|
}
|
|
7021
|
-
parse(data, options) {
|
|
7022
|
-
let emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
6898
|
+
parse(data, options, emit = !1) {
|
|
7023
6899
|
var _a;
|
|
7024
6900
|
this.isRunning = !0, emit && this.target.emit("beforeParse", []), options && (this.parseOption = options);
|
|
7025
6901
|
const cloneData = this.cloneParseData(data, options);
|
|
@@ -7029,8 +6905,7 @@
|
|
|
7029
6905
|
} else this.parserData = cloneData, this.rawData = cloneData, this.history && this.historyData.push(cloneData), this.latestData = cloneData;
|
|
7030
6906
|
return this.isRunning = !1, emit && this.target.emit("afterParse", []), this;
|
|
7031
6907
|
}
|
|
7032
|
-
transform(options) {
|
|
7033
|
-
let execute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
6908
|
+
transform(options, execute = !0) {
|
|
7034
6909
|
if (this.isRunning = !0, options && options.type) {
|
|
7035
6910
|
let pushOption = !0;
|
|
7036
6911
|
if ("fields" === options.type) {
|
|
@@ -7048,8 +6923,7 @@
|
|
|
7048
6923
|
return (null !== (_a = a.level) && void 0 !== _a ? _a : 0) - (null !== (_b = b.level) && void 0 !== _b ? _b : 0);
|
|
7049
6924
|
});
|
|
7050
6925
|
}
|
|
7051
|
-
executeTransform(options) {
|
|
7052
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6926
|
+
executeTransform(options, opt = {}) {
|
|
7053
6927
|
const {
|
|
7054
6928
|
pushHistory: pushHistory,
|
|
7055
6929
|
emitMessage: emitMessage,
|
|
@@ -7080,8 +6954,7 @@
|
|
|
7080
6954
|
var _a;
|
|
7081
6955
|
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;
|
|
7082
6956
|
}
|
|
7083
|
-
setFields(f) {
|
|
7084
|
-
let foreMerge = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6957
|
+
setFields(f, foreMerge = !1) {
|
|
7085
6958
|
this._fields = f && foreMerge ? merge$1({}, this._fields, f) : f;
|
|
7086
6959
|
const fieldsOption = this.transformsArr.find(_op => "fields" === _op.type);
|
|
7087
6960
|
!isNil$1(this._fields) && isNil$1(fieldsOption) ? (this.dataSet.registerTransform("fields", fields), this.transform({
|
|
@@ -7634,20 +7507,14 @@
|
|
|
7634
7507
|
}
|
|
7635
7508
|
}
|
|
7636
7509
|
function bindContributionProvider(bind, id) {
|
|
7637
|
-
bind(ContributionProvider).toDynamicValue(
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
} = _ref;
|
|
7641
|
-
return new ContributionProviderCache(id, container);
|
|
7642
|
-
}).inSingletonScope().whenTargetNamed(id);
|
|
7510
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
7511
|
+
container: container
|
|
7512
|
+
}) => new ContributionProviderCache(id, container)).inSingletonScope().whenTargetNamed(id);
|
|
7643
7513
|
}
|
|
7644
7514
|
function bindContributionProviderNoSingletonScope(bind, id) {
|
|
7645
|
-
bind(ContributionProvider).toDynamicValue(
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
} = _ref2;
|
|
7649
|
-
return new ContributionProviderCache(id, container);
|
|
7650
|
-
}).whenTargetNamed(id);
|
|
7515
|
+
bind(ContributionProvider).toDynamicValue(({
|
|
7516
|
+
container: container
|
|
7517
|
+
}) => new ContributionProviderCache(id, container)).whenTargetNamed(id);
|
|
7651
7518
|
}
|
|
7652
7519
|
class ContributionStore {
|
|
7653
7520
|
static getStore(id) {
|
|
@@ -7717,10 +7584,7 @@
|
|
|
7717
7584
|
}
|
|
7718
7585
|
|
|
7719
7586
|
class SyncHook extends Hook {
|
|
7720
|
-
call() {
|
|
7721
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7722
|
-
args[_key] = arguments[_key];
|
|
7723
|
-
}
|
|
7587
|
+
call(...args) {
|
|
7724
7588
|
this.taps.map(t => t.fn).forEach(cb => cb(...args));
|
|
7725
7589
|
}
|
|
7726
7590
|
}
|
|
@@ -7732,22 +7596,22 @@
|
|
|
7732
7596
|
class Application {}
|
|
7733
7597
|
const application = new Application();
|
|
7734
7598
|
|
|
7599
|
+
let idx = 0;
|
|
7735
7600
|
class PerformanceRAF {
|
|
7736
7601
|
constructor() {
|
|
7737
|
-
this.nextAnimationFrameCbs =
|
|
7602
|
+
this.nextAnimationFrameCbs = new Map(), this._rafHandle = null, this.runAnimationFrame = time => {
|
|
7738
7603
|
this._rafHandle = null;
|
|
7739
7604
|
const cbs = this.nextAnimationFrameCbs;
|
|
7740
|
-
this.nextAnimationFrameCbs =
|
|
7741
|
-
for (let i = 0; i < cbs.length; i++) cbs[i] && cbs[i](time);
|
|
7605
|
+
this.nextAnimationFrameCbs = new Map(), cbs.forEach(cb => cb(time));
|
|
7742
7606
|
}, this.tryRunAnimationFrameNextFrame = () => {
|
|
7743
|
-
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.
|
|
7607
|
+
null === this._rafHandle && 0 !== this.nextAnimationFrameCbs.size && (this._rafHandle = application.global.getRequestAnimationFrame()(this.runAnimationFrame));
|
|
7744
7608
|
};
|
|
7745
7609
|
}
|
|
7746
7610
|
addAnimationFrameCb(callback) {
|
|
7747
|
-
return this.nextAnimationFrameCbs.
|
|
7611
|
+
return this.nextAnimationFrameCbs.set(++idx, callback), this.tryRunAnimationFrameNextFrame(), idx;
|
|
7748
7612
|
}
|
|
7749
7613
|
removeAnimationFrameCb(index) {
|
|
7750
|
-
return
|
|
7614
|
+
return !!this.nextAnimationFrameCbs.has(index) && (this.nextAnimationFrameCbs.delete(index), !0);
|
|
7751
7615
|
}
|
|
7752
7616
|
}
|
|
7753
7617
|
|
|
@@ -7996,16 +7860,13 @@
|
|
|
7996
7860
|
updateDom(dom, params) {
|
|
7997
7861
|
return this._env || this.setEnv("browser"), this.envContribution.updateDom(dom, params);
|
|
7998
7862
|
}
|
|
7999
|
-
getElementTop(dom) {
|
|
8000
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7863
|
+
getElementTop(dom, baseWindow = !1) {
|
|
8001
7864
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTop(dom, baseWindow);
|
|
8002
7865
|
}
|
|
8003
|
-
getElementLeft(dom) {
|
|
8004
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7866
|
+
getElementLeft(dom, baseWindow = !1) {
|
|
8005
7867
|
return this._env || this.setEnv("browser"), this.envContribution.getElementLeft(dom, baseWindow);
|
|
8006
7868
|
}
|
|
8007
|
-
getElementTopLeft(dom) {
|
|
8008
|
-
let baseWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
7869
|
+
getElementTopLeft(dom, baseWindow = !1) {
|
|
8009
7870
|
return this._env || this.setEnv("browser"), this.envContribution.getElementTopLeft(dom, baseWindow);
|
|
8010
7871
|
}
|
|
8011
7872
|
isMacOS() {
|
|
@@ -8085,7 +7946,7 @@
|
|
|
8085
7946
|
clear() {
|
|
8086
7947
|
this.bounds.clear();
|
|
8087
7948
|
}
|
|
8088
|
-
release() {}
|
|
7949
|
+
release(...params) {}
|
|
8089
7950
|
}
|
|
8090
7951
|
|
|
8091
7952
|
class CurvePath {
|
|
@@ -8260,8 +8121,7 @@
|
|
|
8260
8121
|
context.bezierCurveTo(bez[0], bez[1], bez[2], bez[3], bez[4], bez[5]);
|
|
8261
8122
|
}
|
|
8262
8123
|
}
|
|
8263
|
-
const addArcToBezierPath$1 =
|
|
8264
|
-
let counterclockwise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : !1;
|
|
8124
|
+
const addArcToBezierPath$1 = (bezierPath, startAngle, endAngle, cx, cy, rx, ry, counterclockwise = !1) => {
|
|
8265
8125
|
const PI2 = 2 * Math.PI,
|
|
8266
8126
|
sAngle = (startAngle % PI2 + PI2) % PI2;
|
|
8267
8127
|
let deltaAngle,
|
|
@@ -8289,12 +8149,7 @@
|
|
|
8289
8149
|
};
|
|
8290
8150
|
|
|
8291
8151
|
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)];
|
|
8292
|
-
function renderCommandList(commandList, context) {
|
|
8293
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
8294
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
8295
|
-
let sx = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
8296
|
-
let sy = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
8297
|
-
let z = arguments.length > 6 ? arguments[6] : undefined;
|
|
8152
|
+
function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z) {
|
|
8298
8153
|
for (let i = 0; i < commandList.length; i++) {
|
|
8299
8154
|
const command = commandList[i];
|
|
8300
8155
|
commandFuncs[command[0]](command, context, x, y, sx, sy, z);
|
|
@@ -8535,7 +8390,7 @@
|
|
|
8535
8390
|
}
|
|
8536
8391
|
}
|
|
8537
8392
|
|
|
8538
|
-
function genCurveSegments(path, points) {
|
|
8393
|
+
function genCurveSegments(path, points, step = 1) {
|
|
8539
8394
|
let defined0 = !1;
|
|
8540
8395
|
for (let i = 0, n = points.length; i <= n; i++) i >= n === defined0 && ((defined0 = !defined0) ? path.lineStart() : path.lineEnd()), defined0 && path.point(points[i]);
|
|
8541
8396
|
}
|
|
@@ -8578,8 +8433,7 @@
|
|
|
8578
8433
|
return this.context.tryUpdateLength();
|
|
8579
8434
|
}
|
|
8580
8435
|
}
|
|
8581
|
-
function genLinearSegments(points) {
|
|
8582
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8436
|
+
function genLinearSegments(points, params = {}) {
|
|
8583
8437
|
const {
|
|
8584
8438
|
direction: direction,
|
|
8585
8439
|
startPoint: startPoint
|
|
@@ -8589,7 +8443,7 @@
|
|
|
8589
8443
|
return genLinearTypeSegments(new Linear(segContext, startPoint), points), segContext;
|
|
8590
8444
|
}
|
|
8591
8445
|
function genLinearTypeSegments(path, points) {
|
|
8592
|
-
return genCurveSegments(path, points);
|
|
8446
|
+
return genCurveSegments(path, points, 1);
|
|
8593
8447
|
}
|
|
8594
8448
|
|
|
8595
8449
|
function point$3(curveClass, x, y, defined, p) {
|
|
@@ -8632,10 +8486,9 @@
|
|
|
8632
8486
|
}
|
|
8633
8487
|
}
|
|
8634
8488
|
function genBasisTypeSegments(path, points) {
|
|
8635
|
-
return genCurveSegments(path, points);
|
|
8489
|
+
return genCurveSegments(path, points, 2);
|
|
8636
8490
|
}
|
|
8637
|
-
function genBasisSegments(points) {
|
|
8638
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8491
|
+
function genBasisSegments(points, params = {}) {
|
|
8639
8492
|
const {
|
|
8640
8493
|
direction: direction,
|
|
8641
8494
|
startPoint: startPoint
|
|
@@ -8728,10 +8581,9 @@
|
|
|
8728
8581
|
}
|
|
8729
8582
|
}
|
|
8730
8583
|
function genMonotoneXTypeSegments(path, points) {
|
|
8731
|
-
return genCurveSegments(path, points);
|
|
8584
|
+
return genCurveSegments(path, points, 2);
|
|
8732
8585
|
}
|
|
8733
|
-
function genMonotoneXSegments(points) {
|
|
8734
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8586
|
+
function genMonotoneXSegments(points, params = {}) {
|
|
8735
8587
|
const {
|
|
8736
8588
|
direction: direction,
|
|
8737
8589
|
startPoint: startPoint
|
|
@@ -8742,10 +8594,9 @@
|
|
|
8742
8594
|
return genMonotoneXTypeSegments(new MonotoneX(segContext, startPoint), points), segContext;
|
|
8743
8595
|
}
|
|
8744
8596
|
function genMonotoneYTypeSegments(path, points) {
|
|
8745
|
-
return genCurveSegments(path, points);
|
|
8597
|
+
return genCurveSegments(path, points, 2);
|
|
8746
8598
|
}
|
|
8747
|
-
function genMonotoneYSegments(points) {
|
|
8748
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8599
|
+
function genMonotoneYSegments(points, params = {}) {
|
|
8749
8600
|
const {
|
|
8750
8601
|
direction: direction,
|
|
8751
8602
|
startPoint: startPoint
|
|
@@ -8757,9 +8608,7 @@
|
|
|
8757
8608
|
}
|
|
8758
8609
|
|
|
8759
8610
|
let Step$1 = class Step {
|
|
8760
|
-
constructor(context) {
|
|
8761
|
-
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8762
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8611
|
+
constructor(context, t = .5, startPoint) {
|
|
8763
8612
|
this.context = context, this._t = t, this.startPoint = startPoint;
|
|
8764
8613
|
}
|
|
8765
8614
|
areaStart() {
|
|
@@ -8800,8 +8649,7 @@
|
|
|
8800
8649
|
this.context.closePath();
|
|
8801
8650
|
}
|
|
8802
8651
|
}
|
|
8803
|
-
function genStepSegments(points, t) {
|
|
8804
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8652
|
+
function genStepSegments(points, t, params = {}) {
|
|
8805
8653
|
const {
|
|
8806
8654
|
direction: direction,
|
|
8807
8655
|
startPoint: startPoint
|
|
@@ -8811,10 +8659,9 @@
|
|
|
8811
8659
|
return genStepTypeSegments(new Step$1(segContext, t, startPoint), points), segContext;
|
|
8812
8660
|
}
|
|
8813
8661
|
function genStepTypeSegments(path, points) {
|
|
8814
|
-
return genCurveSegments(path, points);
|
|
8662
|
+
return genCurveSegments(path, points, 1);
|
|
8815
8663
|
}
|
|
8816
|
-
function genStepClosedSegments(points, t) {
|
|
8817
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8664
|
+
function genStepClosedSegments(points, t, params = {}) {
|
|
8818
8665
|
const {
|
|
8819
8666
|
direction: direction,
|
|
8820
8667
|
startPoint: startPoint
|
|
@@ -8829,8 +8676,7 @@
|
|
|
8829
8676
|
this.context.closePath();
|
|
8830
8677
|
}
|
|
8831
8678
|
}
|
|
8832
|
-
function genLinearClosedSegments(points) {
|
|
8833
|
-
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8679
|
+
function genLinearClosedSegments(points, params = {}) {
|
|
8834
8680
|
const {
|
|
8835
8681
|
direction: direction,
|
|
8836
8682
|
startPoint: startPoint
|
|
@@ -8840,7 +8686,7 @@
|
|
|
8840
8686
|
return genLinearClosedTypeSegments(new LinearClosed(segContext, startPoint), points), segContext;
|
|
8841
8687
|
}
|
|
8842
8688
|
function genLinearClosedTypeSegments(path, points) {
|
|
8843
|
-
return genCurveSegments(path, points);
|
|
8689
|
+
return genCurveSegments(path, points, 1);
|
|
8844
8690
|
}
|
|
8845
8691
|
|
|
8846
8692
|
function point$1(curveClass, x, y, defined, p) {
|
|
@@ -8861,9 +8707,7 @@
|
|
|
8861
8707
|
curveClass.context.bezierCurveTo(x1, y1, x2, y2, curveClass._x2, curveClass._y2, defined, curveClass.lastPoint1);
|
|
8862
8708
|
}
|
|
8863
8709
|
class CatmullRom {
|
|
8864
|
-
constructor(context) {
|
|
8865
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8866
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8710
|
+
constructor(context, alpha = .5, startPoint) {
|
|
8867
8711
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
8868
8712
|
}
|
|
8869
8713
|
areaStart() {
|
|
@@ -8917,8 +8761,7 @@
|
|
|
8917
8761
|
}
|
|
8918
8762
|
}
|
|
8919
8763
|
function commonGenCatmullRomSegments(type, cons) {
|
|
8920
|
-
return function (points, alpha) {
|
|
8921
|
-
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8764
|
+
return function (points, alpha, params = {}) {
|
|
8922
8765
|
const {
|
|
8923
8766
|
direction: direction,
|
|
8924
8767
|
startPoint: startPoint
|
|
@@ -8927,15 +8770,13 @@
|
|
|
8927
8770
|
if (points.length < 3 - Number(!!startPoint)) return genLinearSegments(points, params);
|
|
8928
8771
|
const segContext = genSegContext(type, direction, points),
|
|
8929
8772
|
gatmullRom = new cons(segContext, alpha, startPoint);
|
|
8930
|
-
return genCurveSegments(gatmullRom, points), segContext;
|
|
8773
|
+
return genCurveSegments(gatmullRom, points, 2), segContext;
|
|
8931
8774
|
};
|
|
8932
8775
|
}
|
|
8933
8776
|
const genCatmullRomSegments = commonGenCatmullRomSegments("catmullRom", CatmullRom);
|
|
8934
8777
|
|
|
8935
8778
|
class CatmullRomClosed {
|
|
8936
|
-
constructor(context) {
|
|
8937
|
-
let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .5;
|
|
8938
|
-
let startPoint = arguments.length > 2 ? arguments[2] : undefined;
|
|
8779
|
+
constructor(context, alpha = .5, startPoint) {
|
|
8939
8780
|
this.context = context, this.startPoint = startPoint, this._alpha = alpha;
|
|
8940
8781
|
}
|
|
8941
8782
|
areaStart() {
|
|
@@ -9245,11 +9086,7 @@
|
|
|
9245
9086
|
cmd[1] = cmd[1] * sx + x, cmd[2] = cmd[2] * sy + y, cmd[3] = cmd[3] * (sx + sy) / 2;
|
|
9246
9087
|
}
|
|
9247
9088
|
closePathTransform() {}
|
|
9248
|
-
_runCommandStrList(commandStrList) {
|
|
9249
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9250
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
9251
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
9252
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
9089
|
+
_runCommandStrList(commandStrList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
9253
9090
|
let current,
|
|
9254
9091
|
tempX,
|
|
9255
9092
|
tempY,
|
|
@@ -9323,11 +9160,7 @@
|
|
|
9323
9160
|
previous = current;
|
|
9324
9161
|
}
|
|
9325
9162
|
}
|
|
9326
|
-
_runCommandList(commandList) {
|
|
9327
|
-
let l = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
9328
|
-
let t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
9329
|
-
let sX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
9330
|
-
let sY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
9163
|
+
_runCommandList(commandList, l = 0, t = 0, sX = 1, sY = 1) {
|
|
9331
9164
|
if (0 !== l || 0 !== t || 1 !== sX || 1 !== sY) for (let i = 0, len = commandList.length; i < len; ++i) {
|
|
9332
9165
|
const current = commandList[i].slice();
|
|
9333
9166
|
switch (current[0]) {
|
|
@@ -9978,9 +9811,7 @@
|
|
|
9978
9811
|
scaleY = Math.sign(d) * Math.sqrt(c * c + d * d);
|
|
9979
9812
|
return scaleX + scaleY === 0 ? 0 : (strokeWidth = strokeWidth / Math.abs(scaleX + scaleY) * 2 * dpr, strokeWidth);
|
|
9980
9813
|
}
|
|
9981
|
-
function createColor(context, c, params) {
|
|
9982
|
-
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
9983
|
-
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
9814
|
+
function createColor(context, c, params, offsetX = 0, offsetY = 0) {
|
|
9984
9815
|
var _a, _b, _c, _d;
|
|
9985
9816
|
if (!c || !0 === c) return "black";
|
|
9986
9817
|
let result, color;
|
|
@@ -10119,8 +9950,7 @@
|
|
|
10119
9950
|
}
|
|
10120
9951
|
return needTestLetter && (index = testLetter(desc, index)), index;
|
|
10121
9952
|
}
|
|
10122
|
-
function testLetter(string, index) {
|
|
10123
|
-
let negativeWrongMatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
9953
|
+
function testLetter(string, index, negativeWrongMatch = !1) {
|
|
10124
9954
|
let i = index;
|
|
10125
9955
|
for (; regLetter.test(string[i - 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i--, i <= 0) return negativeWrongMatch ? testLetter2(string, index) : index;
|
|
10126
9956
|
return i;
|
|
@@ -10130,8 +9960,7 @@
|
|
|
10130
9960
|
for (; regLetter.test(string[i + 1]) && regLetter.test(string[i]) || regPunctuation.test(string[i]);) if (i++, i >= string.length) return i;
|
|
10131
9961
|
return i + 1;
|
|
10132
9962
|
}
|
|
10133
|
-
function measureTextCanvas(text, character) {
|
|
10134
|
-
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
9963
|
+
function measureTextCanvas(text, character, mode = "actual") {
|
|
10135
9964
|
var _a;
|
|
10136
9965
|
if ("" === text) return {
|
|
10137
9966
|
ascent: 0,
|
|
@@ -10201,10 +10030,9 @@
|
|
|
10201
10030
|
}
|
|
10202
10031
|
return metrics;
|
|
10203
10032
|
}
|
|
10204
|
-
estimate(text,
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
} = _ref;
|
|
10033
|
+
estimate(text, {
|
|
10034
|
+
fontSize = DefaultTextAttribute.fontSize
|
|
10035
|
+
}) {
|
|
10208
10036
|
let eCharLen = 0,
|
|
10209
10037
|
cCharLen = 0;
|
|
10210
10038
|
for (let i = 0; i < text.length; i++) text.charCodeAt(i) < 128 ? eCharLen++ : cCharLen++;
|
|
@@ -10515,8 +10343,7 @@
|
|
|
10515
10343
|
});
|
|
10516
10344
|
});
|
|
10517
10345
|
}
|
|
10518
|
-
clipTextWithSuffix(text, options, width, suffix, wordBreak, position) {
|
|
10519
|
-
let forceSuffix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
10346
|
+
clipTextWithSuffix(text, options, width, suffix, wordBreak, position, forceSuffix = !1) {
|
|
10520
10347
|
if ("" === suffix) return this.clipText(text, options, width, wordBreak);
|
|
10521
10348
|
if (0 === text.length) return {
|
|
10522
10349
|
str: "",
|
|
@@ -10961,7 +10788,7 @@
|
|
|
10961
10788
|
get length() {
|
|
10962
10789
|
return this.pools.length;
|
|
10963
10790
|
}
|
|
10964
|
-
release() {
|
|
10791
|
+
release(...params) {
|
|
10965
10792
|
this.pools = [];
|
|
10966
10793
|
}
|
|
10967
10794
|
}
|
|
@@ -11157,8 +10984,7 @@
|
|
|
11157
10984
|
bindTextMeasure(tm) {
|
|
11158
10985
|
this._textMeasure = tm;
|
|
11159
10986
|
}
|
|
11160
|
-
measureText(text, tc) {
|
|
11161
|
-
let method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "native";
|
|
10987
|
+
measureText(text, tc, method = "native") {
|
|
11162
10988
|
var _a;
|
|
11163
10989
|
this.configure(this.global, this.global.env);
|
|
11164
10990
|
const m = this.global.measureTextMethod;
|
|
@@ -11341,8 +11167,7 @@
|
|
|
11341
11167
|
for (; group.parent;) if ((group = group.parent).theme) return group;
|
|
11342
11168
|
return null;
|
|
11343
11169
|
}
|
|
11344
|
-
applyTheme(group, pt) {
|
|
11345
|
-
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
11170
|
+
applyTheme(group, pt, force = !1) {
|
|
11346
11171
|
if (this.dirty) {
|
|
11347
11172
|
const parentGroup = this.getParentWithTheme(group);
|
|
11348
11173
|
if (parentGroup) {
|
|
@@ -11441,8 +11266,7 @@
|
|
|
11441
11266
|
constructor() {
|
|
11442
11267
|
super(), this._uid = Generator.GenAutoIncrementId(), this._firstChild = null, this._lastChild = null, this.parent = null, this._count = 1;
|
|
11443
11268
|
}
|
|
11444
|
-
forEachChildren(cb) {
|
|
11445
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11269
|
+
forEachChildren(cb, reverse = !1) {
|
|
11446
11270
|
if (reverse) {
|
|
11447
11271
|
let child = this._lastChild,
|
|
11448
11272
|
i = 0;
|
|
@@ -11459,8 +11283,7 @@
|
|
|
11459
11283
|
}
|
|
11460
11284
|
}
|
|
11461
11285
|
}
|
|
11462
|
-
forEachChildrenAsync(cb) {
|
|
11463
|
-
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11286
|
+
forEachChildrenAsync(cb, reverse = !1) {
|
|
11464
11287
|
return __awaiter$8(this, void 0, void 0, function* () {
|
|
11465
11288
|
if (reverse) {
|
|
11466
11289
|
let child = this._lastChild,
|
|
@@ -11484,13 +11307,12 @@
|
|
|
11484
11307
|
forEach(cb) {
|
|
11485
11308
|
return this.forEachChildren(cb);
|
|
11486
11309
|
}
|
|
11487
|
-
appendChild(node) {
|
|
11488
|
-
let highPerformance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
11310
|
+
appendChild(node, highPerformance = !0) {
|
|
11489
11311
|
if (this._uid === node._uid) return null;
|
|
11490
11312
|
if (!highPerformance && node.isAncestorsOf(this)) throw new Error("【Node::appendChild】不能将父辈元素append为子元素");
|
|
11491
11313
|
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;
|
|
11492
11314
|
}
|
|
11493
|
-
appendChildArrHighPerformance(nodes) {
|
|
11315
|
+
appendChildArrHighPerformance(nodes, replace = !1) {
|
|
11494
11316
|
return console.error("暂不支持该函数"), nodes;
|
|
11495
11317
|
}
|
|
11496
11318
|
insertBefore(newNode, referenceNode) {
|
|
@@ -11558,8 +11380,7 @@
|
|
|
11558
11380
|
replaceChild(newChild, oldChild) {
|
|
11559
11381
|
throw new Error("暂不支持");
|
|
11560
11382
|
}
|
|
11561
|
-
find(callback) {
|
|
11562
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11383
|
+
find(callback, deep = !1) {
|
|
11563
11384
|
let target = null;
|
|
11564
11385
|
return this.forEachChildren((node, index) => !(node === this || !callback(node, index)) && (target = node, !0)), deep && this.forEachChildren(child => {
|
|
11565
11386
|
if (child.isContainer) {
|
|
@@ -11569,8 +11390,7 @@
|
|
|
11569
11390
|
return !1;
|
|
11570
11391
|
}), target;
|
|
11571
11392
|
}
|
|
11572
|
-
findAll(callback) {
|
|
11573
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11393
|
+
findAll(callback, deep = !1) {
|
|
11574
11394
|
let nodes = [];
|
|
11575
11395
|
return this.forEachChildren((node, index) => {
|
|
11576
11396
|
node !== this && callback(node, index) && nodes.push(node);
|
|
@@ -11599,8 +11419,7 @@
|
|
|
11599
11419
|
getElementsByType(type) {
|
|
11600
11420
|
return this.findAll(node => node.type === type, !0);
|
|
11601
11421
|
}
|
|
11602
|
-
getChildByName(name) {
|
|
11603
|
-
let deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
11422
|
+
getChildByName(name, deep = !1) {
|
|
11604
11423
|
return this.find(node => node.name === name, deep);
|
|
11605
11424
|
}
|
|
11606
11425
|
getChildAt(idx) {
|
|
@@ -11719,10 +11538,7 @@
|
|
|
11719
11538
|
removeAllListeners() {
|
|
11720
11539
|
return this.removeAllEventListeners();
|
|
11721
11540
|
}
|
|
11722
|
-
dispatchEvent(event) {
|
|
11723
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
11724
|
-
args[_key - 1] = arguments[_key];
|
|
11725
|
-
}
|
|
11541
|
+
dispatchEvent(event, ...args) {
|
|
11726
11542
|
return super.emit(event.type, event, ...args), !event.defaultPrevented;
|
|
11727
11543
|
}
|
|
11728
11544
|
emit(event, data) {
|
|
@@ -12552,8 +12368,7 @@
|
|
|
12552
12368
|
return attr[key];
|
|
12553
12369
|
}
|
|
12554
12370
|
class RafBasedSTO {
|
|
12555
|
-
constructor() {
|
|
12556
|
-
let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RafBasedSTO.TimeOut;
|
|
12371
|
+
constructor(timeout = RafBasedSTO.TimeOut) {
|
|
12557
12372
|
this.durations = [], this.timeout = timeout, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
12558
12373
|
}
|
|
12559
12374
|
call(cb) {
|
|
@@ -12668,8 +12483,7 @@
|
|
|
12668
12483
|
}
|
|
12669
12484
|
var square$3 = new SquareSymbol();
|
|
12670
12485
|
|
|
12671
|
-
function trianglUpOffset(ctx, r, x, y) {
|
|
12672
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12486
|
+
function trianglUpOffset(ctx, r, x, y, offset = 0) {
|
|
12673
12487
|
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;
|
|
12674
12488
|
}
|
|
12675
12489
|
class TriangleUpSymbol extends BaseSymbol {
|
|
@@ -12815,8 +12629,7 @@
|
|
|
12815
12629
|
}
|
|
12816
12630
|
var triangleLeft = new TriangleLeftSymbol();
|
|
12817
12631
|
|
|
12818
|
-
function trianglRightOffset(ctx, r, x, y) {
|
|
12819
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12632
|
+
function trianglRightOffset(ctx, r, x, y, offset = 0) {
|
|
12820
12633
|
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;
|
|
12821
12634
|
}
|
|
12822
12635
|
class TriangleRightSymbol extends BaseSymbol {
|
|
@@ -12832,8 +12645,7 @@
|
|
|
12832
12645
|
}
|
|
12833
12646
|
var triangleRight = new TriangleRightSymbol();
|
|
12834
12647
|
|
|
12835
|
-
function trianglDownOffset(ctx, r, x, y) {
|
|
12836
|
-
let offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
12648
|
+
function trianglDownOffset(ctx, r, x, y, offset = 0) {
|
|
12837
12649
|
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;
|
|
12838
12650
|
}
|
|
12839
12651
|
class TriangleDownSymbol extends BaseSymbol {
|
|
@@ -13050,8 +12862,7 @@
|
|
|
13050
12862
|
|
|
13051
12863
|
const tempBounds = new AABBBounds();
|
|
13052
12864
|
class CustomSymbolClass {
|
|
13053
|
-
constructor(type, path) {
|
|
13054
|
-
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
12865
|
+
constructor(type, path, isSvg = !1) {
|
|
13055
12866
|
this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
13056
12867
|
}
|
|
13057
12868
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
@@ -13073,10 +12884,9 @@
|
|
|
13073
12884
|
bounds(size, bounds) {
|
|
13074
12885
|
if (size = this.parseSize(size), this.isSvg) {
|
|
13075
12886
|
if (!this.svgCache) return;
|
|
13076
|
-
return bounds.clear(), void this.svgCache.forEach(
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
} = _ref;
|
|
12887
|
+
return bounds.clear(), void this.svgCache.forEach(({
|
|
12888
|
+
path: path
|
|
12889
|
+
}) => {
|
|
13080
12890
|
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);
|
|
13081
12891
|
});
|
|
13082
12892
|
}
|
|
@@ -13132,8 +12942,7 @@
|
|
|
13132
12942
|
if (-1 === closingIndex) throw new Error(errMsg);
|
|
13133
12943
|
return closingIndex + str.length - 1;
|
|
13134
12944
|
}
|
|
13135
|
-
function tagExpWithClosingIndex(xmlData, i) {
|
|
13136
|
-
let closingChar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ">";
|
|
12945
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
13137
12946
|
let attrBoundary,
|
|
13138
12947
|
tagExp = "";
|
|
13139
12948
|
for (let index = i; index < xmlData.length; index++) {
|
|
@@ -13151,8 +12960,7 @@
|
|
|
13151
12960
|
tagExp += ch;
|
|
13152
12961
|
}
|
|
13153
12962
|
}
|
|
13154
|
-
function readTagExp(xmlData, i, removeNSPrefix) {
|
|
13155
|
-
let closingChar = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ">";
|
|
12963
|
+
function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
|
|
13156
12964
|
const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
|
|
13157
12965
|
if (!result) return;
|
|
13158
12966
|
let tagExp = result.data;
|
|
@@ -13333,8 +13141,7 @@
|
|
|
13333
13141
|
}), yield Promise.all(promiseList);
|
|
13334
13142
|
});
|
|
13335
13143
|
}
|
|
13336
|
-
function boundStroke(bounds, halfW, miter) {
|
|
13337
|
-
let pad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
13144
|
+
function boundStroke(bounds, halfW, miter, pad = 0) {
|
|
13338
13145
|
return bounds.expand(halfW + (pad / 2 + (miter ? miterAdjustment(miter, halfW) : 0))), bounds;
|
|
13339
13146
|
}
|
|
13340
13147
|
function miterAdjustment(miter, strokeWidth) {
|
|
@@ -13526,7 +13333,7 @@
|
|
|
13526
13333
|
get length() {
|
|
13527
13334
|
return this.pools.length;
|
|
13528
13335
|
}
|
|
13529
|
-
release() {
|
|
13336
|
+
release(...params) {
|
|
13530
13337
|
this.pools = [];
|
|
13531
13338
|
}
|
|
13532
13339
|
}
|
|
@@ -13554,7 +13361,7 @@
|
|
|
13554
13361
|
get length() {
|
|
13555
13362
|
return this.pools.length;
|
|
13556
13363
|
}
|
|
13557
|
-
release() {
|
|
13364
|
+
release(...params) {
|
|
13558
13365
|
this.pools = [];
|
|
13559
13366
|
}
|
|
13560
13367
|
}
|
|
@@ -13589,8 +13396,7 @@
|
|
|
13589
13396
|
getContext() {
|
|
13590
13397
|
throw new Error("不支持getContext");
|
|
13591
13398
|
}
|
|
13592
|
-
setTransformForCurrent() {
|
|
13593
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
13399
|
+
setTransformForCurrent(force = !1) {
|
|
13594
13400
|
!force && this.applyedMatrix.equalToMatrix(this.matrix) || (this.applyedMatrix = this.cloneMatrix(this.matrix));
|
|
13595
13401
|
}
|
|
13596
13402
|
get currentMatrix() {
|
|
@@ -13611,8 +13417,7 @@
|
|
|
13611
13417
|
highPerformanceRestore() {
|
|
13612
13418
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
13613
13419
|
}
|
|
13614
|
-
rotate(rad) {
|
|
13615
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13420
|
+
rotate(rad, setTransform = !0) {
|
|
13616
13421
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
13617
13422
|
}
|
|
13618
13423
|
save() {
|
|
@@ -13623,55 +13428,41 @@
|
|
|
13623
13428
|
const matrix = this.cloneMatrix(this.matrix);
|
|
13624
13429
|
this.stack.push(matrix);
|
|
13625
13430
|
}
|
|
13626
|
-
scale(sx, sy) {
|
|
13627
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13431
|
+
scale(sx, sy, setTransform = !0) {
|
|
13628
13432
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
13629
13433
|
}
|
|
13630
|
-
setScale(sx, sy) {
|
|
13631
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13434
|
+
setScale(sx, sy, setTransform = !0) {
|
|
13632
13435
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
13633
13436
|
}
|
|
13634
|
-
scalePoint(sx, sy, px, py) {
|
|
13635
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
13437
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
13636
13438
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
13637
13439
|
}
|
|
13638
|
-
setTransform(a, b, c, d, e, f) {
|
|
13639
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
13640
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
13440
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
13641
13441
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
13642
13442
|
}
|
|
13643
|
-
setTransformFromMatrix(matrix) {
|
|
13644
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13645
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
13443
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
13646
13444
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
13647
13445
|
}
|
|
13648
|
-
resetTransform() {
|
|
13649
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
13650
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
13446
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
13651
13447
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
13652
13448
|
}
|
|
13653
|
-
transform(a, b, c, d, e, f) {
|
|
13654
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
13449
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
13655
13450
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
13656
13451
|
}
|
|
13657
13452
|
transformFromMatrix(matrix, setTransform) {
|
|
13658
13453
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
13659
13454
|
}
|
|
13660
|
-
translate(x, y) {
|
|
13661
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
13455
|
+
translate(x, y, setTransform = !0) {
|
|
13662
13456
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
13663
13457
|
}
|
|
13664
|
-
rotateDegrees(deg) {
|
|
13665
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
13458
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
13666
13459
|
const rad = deg * Math.PI / 180;
|
|
13667
13460
|
this.rotate(rad, setTransform);
|
|
13668
13461
|
}
|
|
13669
|
-
rotateAbout(rad, x, y) {
|
|
13670
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
13462
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
13671
13463
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
13672
13464
|
}
|
|
13673
|
-
rotateDegreesAbout(deg, x, y) {
|
|
13674
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
13465
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
13675
13466
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
13676
13467
|
}
|
|
13677
13468
|
beginPath() {
|
|
@@ -13765,19 +13556,16 @@
|
|
|
13765
13556
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {}
|
|
13766
13557
|
setTextStyle(params, defaultParams) {}
|
|
13767
13558
|
draw() {}
|
|
13768
|
-
clearMatrix() {
|
|
13769
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
13770
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
13559
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
13771
13560
|
this.setTransformFromMatrix(initMatrix, setTransform, dpr);
|
|
13772
13561
|
}
|
|
13773
13562
|
setClearMatrix(a, b, c, d, e, f) {
|
|
13774
13563
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
13775
13564
|
}
|
|
13776
|
-
onlyTranslate() {
|
|
13777
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
13565
|
+
onlyTranslate(dpr = this.dpr) {
|
|
13778
13566
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
13779
13567
|
}
|
|
13780
|
-
release() {
|
|
13568
|
+
release(...params) {
|
|
13781
13569
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
13782
13570
|
}
|
|
13783
13571
|
};
|
|
@@ -13877,7 +13665,7 @@
|
|
|
13877
13665
|
transferToImageBitmap() {
|
|
13878
13666
|
throw new Error("暂未实现");
|
|
13879
13667
|
}
|
|
13880
|
-
release() {
|
|
13668
|
+
release(...params) {
|
|
13881
13669
|
this.controled && this._nativeCanvas.parentElement && this._nativeCanvas.parentElement.removeChild(this._nativeCanvas);
|
|
13882
13670
|
}
|
|
13883
13671
|
}
|
|
@@ -13888,9 +13676,7 @@
|
|
|
13888
13676
|
ColorType[ColorType.Color255 = 0] = "Color255", ColorType[ColorType.Color1 = 1] = "Color1";
|
|
13889
13677
|
}(ColorType || (ColorType = {}));
|
|
13890
13678
|
class ColorStore {
|
|
13891
|
-
static Get(str) {
|
|
13892
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ColorType.Color1;
|
|
13893
|
-
let arr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0, 0, 1];
|
|
13679
|
+
static Get(str, size = ColorType.Color1, arr = [0, 0, 0, 1]) {
|
|
13894
13680
|
if (size === ColorType.Color1) {
|
|
13895
13681
|
const color = ColorStore.store1[str];
|
|
13896
13682
|
if (color) return arr[0] = color[0], arr[1] = color[1], arr[2] = color[2], arr[3] = color[3], arr;
|
|
@@ -13918,8 +13704,7 @@
|
|
|
13918
13704
|
}
|
|
13919
13705
|
ColorStore.store255 = {}, ColorStore.store1 = {};
|
|
13920
13706
|
|
|
13921
|
-
function colorArrayToString(color) {
|
|
13922
|
-
let alphaChannel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
13707
|
+
function colorArrayToString(color, alphaChannel = !1) {
|
|
13923
13708
|
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;
|
|
13924
13709
|
}
|
|
13925
13710
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
@@ -14042,9 +13827,7 @@
|
|
|
14042
13827
|
static getInstance() {
|
|
14043
13828
|
return ColorInterpolate._instance || (ColorInterpolate._instance = new ColorInterpolate()), ColorInterpolate._instance;
|
|
14044
13829
|
}
|
|
14045
|
-
constructor() {
|
|
14046
|
-
let stops = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
14047
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
13830
|
+
constructor(stops = [], precision = 100) {
|
|
14048
13831
|
super(), this.cacheParams = {
|
|
14049
13832
|
CLEAN_THRESHOLD: 100,
|
|
14050
13833
|
L_TIME: 1e3
|
|
@@ -14062,9 +13845,7 @@
|
|
|
14062
13845
|
const rgba = this.rgbaSet.slice(4 * offset, 4 * offset + 4);
|
|
14063
13846
|
return `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3] / 255})`;
|
|
14064
13847
|
}
|
|
14065
|
-
GetOrCreate(x, y, w, h) {
|
|
14066
|
-
let stops = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
14067
|
-
let precision = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 100;
|
|
13848
|
+
GetOrCreate(x, y, w, h, stops = [], precision = 100) {
|
|
14068
13849
|
let str = `${x}${y}${w}${h}`;
|
|
14069
13850
|
stops.forEach(item => str += item.join()), str += precision;
|
|
14070
13851
|
let colorInter = this.dataMap.get(str);
|
|
@@ -14209,8 +13990,7 @@
|
|
|
14209
13990
|
get globalTransMatrix() {
|
|
14210
13991
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
14211
13992
|
}
|
|
14212
|
-
constructor() {
|
|
14213
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13993
|
+
constructor(params = {}) {
|
|
14214
13994
|
var _a;
|
|
14215
13995
|
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);
|
|
14216
13996
|
}
|
|
@@ -14230,8 +14010,7 @@
|
|
|
14230
14010
|
set2dMode() {
|
|
14231
14011
|
this.in3dMode = !1;
|
|
14232
14012
|
}
|
|
14233
|
-
getOffsetXY(attr) {
|
|
14234
|
-
let includeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14013
|
+
getOffsetXY(attr, includeScroll = !1) {
|
|
14235
14014
|
var _a, _b;
|
|
14236
14015
|
const {
|
|
14237
14016
|
dx = attr.dx,
|
|
@@ -14342,7 +14121,7 @@
|
|
|
14342
14121
|
const b = this.AABBBounds;
|
|
14343
14122
|
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;
|
|
14344
14123
|
}
|
|
14345
|
-
tryUpdateGlobalTransMatrix() {
|
|
14124
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
14346
14125
|
if (this._globalTransMatrix) {
|
|
14347
14126
|
if (this.parent) {
|
|
14348
14127
|
const m = this.parent.globalTransMatrix;
|
|
@@ -14354,8 +14133,7 @@
|
|
|
14354
14133
|
shouldUpdateGlobalMatrix() {
|
|
14355
14134
|
return !0;
|
|
14356
14135
|
}
|
|
14357
|
-
tryUpdateLocalTransMatrix() {
|
|
14358
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14136
|
+
tryUpdateLocalTransMatrix(clearTag = !0) {
|
|
14359
14137
|
return this._transMatrix || (this._transMatrix = new Matrix()), this.shouldUpdateLocalMatrix() && (this.doUpdateLocalMatrix(), clearTag && this.clearUpdateLocalPositionTag()), this._transMatrix;
|
|
14360
14138
|
}
|
|
14361
14139
|
shouldUpdateAABBBounds() {
|
|
@@ -14395,23 +14173,17 @@
|
|
|
14395
14173
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
14396
14174
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
14397
14175
|
}
|
|
14398
|
-
setAttributesAndPreventAnimate(params) {
|
|
14399
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14400
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14176
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
14401
14177
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
14402
14178
|
Object.keys(params).forEach(key => {
|
|
14403
14179
|
animate.preventAttr(key);
|
|
14404
14180
|
});
|
|
14405
14181
|
});
|
|
14406
14182
|
}
|
|
14407
|
-
setAttributes(params) {
|
|
14408
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14409
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14183
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
14410
14184
|
(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);
|
|
14411
14185
|
}
|
|
14412
|
-
_setAttributes(params) {
|
|
14413
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14414
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
14186
|
+
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
14415
14187
|
const keys = Object.keys(params);
|
|
14416
14188
|
for (let i = 0; i < keys.length; i++) {
|
|
14417
14189
|
const key = keys[i];
|
|
@@ -14426,16 +14198,14 @@
|
|
|
14426
14198
|
}, this.attribute, key, context);
|
|
14427
14199
|
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);
|
|
14428
14200
|
}
|
|
14429
|
-
needUpdateTags(keys) {
|
|
14430
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
14201
|
+
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
14431
14202
|
for (let i = 0; i < k.length; i++) {
|
|
14432
14203
|
const attrKey = k[i];
|
|
14433
14204
|
if (-1 !== keys.indexOf(attrKey)) return !0;
|
|
14434
14205
|
}
|
|
14435
14206
|
return !1;
|
|
14436
14207
|
}
|
|
14437
|
-
needUpdateTag(key) {
|
|
14438
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GRAPHIC_UPDATE_TAG_KEY;
|
|
14208
|
+
needUpdateTag(key, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
14439
14209
|
for (let i = 0; i < k.length; i++) {
|
|
14440
14210
|
if (key === k[i]) return !0;
|
|
14441
14211
|
}
|
|
@@ -14591,8 +14361,7 @@
|
|
|
14591
14361
|
newNormalAttrs[key] = this.getNormalAttribute(key);
|
|
14592
14362
|
}), this.normalAttrs = newNormalAttrs;
|
|
14593
14363
|
}
|
|
14594
|
-
stopStateAnimates() {
|
|
14595
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "end";
|
|
14364
|
+
stopStateAnimates(type = "end") {
|
|
14596
14365
|
this.animates && this.animates.forEach(animate => {
|
|
14597
14366
|
animate.stateNames && (animate.stop(type), this.animates.delete(animate.id));
|
|
14598
14367
|
});
|
|
@@ -14756,8 +14525,7 @@
|
|
|
14756
14525
|
var _a;
|
|
14757
14526
|
return null !== (_a = this.attribute[name]) && void 0 !== _a ? _a : this.getDefaultAttribute(name);
|
|
14758
14527
|
}
|
|
14759
|
-
onSetStage(cb) {
|
|
14760
|
-
let immediate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14528
|
+
onSetStage(cb, immediate = !1) {
|
|
14761
14529
|
this._onSetStage = cb, immediate && this.stage && cb(this, this.stage);
|
|
14762
14530
|
}
|
|
14763
14531
|
attachShadow(shadowRoot) {
|
|
@@ -14778,8 +14546,7 @@
|
|
|
14778
14546
|
createPathProxy(path) {
|
|
14779
14547
|
return isString$1(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
14780
14548
|
}
|
|
14781
|
-
loadImage(image) {
|
|
14782
|
-
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
14549
|
+
loadImage(image, background = !1) {
|
|
14783
14550
|
if (!image || background && backgroundNotImage(image)) return;
|
|
14784
14551
|
const url = image;
|
|
14785
14552
|
this.resources || (this.resources = new Map());
|
|
@@ -14809,8 +14576,7 @@
|
|
|
14809
14576
|
animate.stop();
|
|
14810
14577
|
});
|
|
14811
14578
|
}
|
|
14812
|
-
stopAnimates() {
|
|
14813
|
-
let stopChildren = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14579
|
+
stopAnimates(stopChildren = !1) {
|
|
14814
14580
|
this._stopAnimates(this.animates), this.shadowRoot && this.shadowRoot.stopAnimates(!0), this.isContainer && stopChildren && this.forEachChildren(c => {
|
|
14815
14581
|
c.stopAnimates(stopChildren);
|
|
14816
14582
|
});
|
|
@@ -14958,8 +14724,7 @@
|
|
|
14958
14724
|
_updateChildToStage(child) {
|
|
14959
14725
|
return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
|
|
14960
14726
|
}
|
|
14961
|
-
appendChild(node) {
|
|
14962
|
-
let addStage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
14727
|
+
appendChild(node, addStage = !0) {
|
|
14963
14728
|
const data = super.appendChild(node);
|
|
14964
14729
|
return addStage && this.stage && data && data.setStage(this.stage, this.layer), this.addUpdateBoundTag(), data;
|
|
14965
14730
|
}
|
|
@@ -14976,8 +14741,7 @@
|
|
|
14976
14741
|
const data = super.removeChild(child);
|
|
14977
14742
|
return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
|
|
14978
14743
|
}
|
|
14979
|
-
removeAllChild() {
|
|
14980
|
-
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14744
|
+
removeAllChild(deep = !1) {
|
|
14981
14745
|
this.forEachChildren(child => {
|
|
14982
14746
|
this.getGraphicService().onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
14983
14747
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
@@ -14997,8 +14761,7 @@
|
|
|
14997
14761
|
g.isContainer && g.addUpdateGlobalPositionTag();
|
|
14998
14762
|
});
|
|
14999
14763
|
}
|
|
15000
|
-
tryUpdateGlobalTransMatrix() {
|
|
15001
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14764
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
15002
14765
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
15003
14766
|
if (this._globalTransMatrix) {
|
|
15004
14767
|
if (this.parent) {
|
|
@@ -15072,8 +14835,7 @@
|
|
|
15072
14835
|
zIndex: null !== (_a = params.zIndex) && void 0 !== _a ? _a : 0
|
|
15073
14836
|
}), this.layer = this, this.subLayers = new Map(), this.theme = new Theme(), this.background = "rgba(0, 0, 0, 0)", this.afterDrawCbs = [];
|
|
15074
14837
|
}
|
|
15075
|
-
combineSubLayer() {
|
|
15076
|
-
let removeIncrementalKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
14838
|
+
combineSubLayer(removeIncrementalKey = !0) {
|
|
15077
14839
|
const subLayers = Array.from(this.subLayers.values()).sort((a, b) => a.zIndex - b.zIndex);
|
|
15078
14840
|
this.layerHandler.merge(subLayers.map(l => (l.layer.subLayers.size && l.layer.combineSubLayer(removeIncrementalKey), l.layer.getNativeHandler()))), removeIncrementalKey && subLayers.forEach(l => {
|
|
15079
14841
|
l.group && (l.group.incremental = 0);
|
|
@@ -15182,10 +14944,9 @@
|
|
|
15182
14944
|
let layerHandler;
|
|
15183
14945
|
return layerHandler = "static" === layerMode ? container.get(StaticLayerHandlerContribution) : "dynamic" === layerMode ? container.get(DynamicLayerHandlerContribution) : container.get(VirtualLayerHandlerContribution), layerHandler;
|
|
15184
14946
|
}
|
|
15185
|
-
createLayer(stage
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
};
|
|
14947
|
+
createLayer(stage, options = {
|
|
14948
|
+
main: !1
|
|
14949
|
+
}) {
|
|
15189
14950
|
var _a;
|
|
15190
14951
|
this.tryInit();
|
|
15191
14952
|
let layerMode = this.getRecommendedLayerType(options.layerMode);
|
|
@@ -15426,8 +15187,7 @@
|
|
|
15426
15187
|
function textDrawOffsetX(textAlign, width) {
|
|
15427
15188
|
return "end" === textAlign || "right" === textAlign ? -width : "center" === textAlign ? -width / 2 : 0;
|
|
15428
15189
|
}
|
|
15429
|
-
function textLayoutOffsetY(baseline, lineHeight, fontSize) {
|
|
15430
|
-
let buf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
15190
|
+
function textLayoutOffsetY(baseline, lineHeight, fontSize, buf = 0) {
|
|
15431
15191
|
return "middle" === baseline ? -lineHeight / 2 : "top" === baseline ? 0 : "bottom" === baseline ? buf - lineHeight : baseline && "alphabetic" !== baseline ? 0 : (fontSize || (fontSize = lineHeight), -(lineHeight - fontSize) / 2 - .79 * fontSize);
|
|
15432
15192
|
}
|
|
15433
15193
|
function textAttributesToStyle(attrs) {
|
|
@@ -15651,10 +15411,9 @@
|
|
|
15651
15411
|
|
|
15652
15412
|
const CIRCLE_UPDATE_TAG_KEY = ["radius", "startAngle", "endAngle", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
15653
15413
|
class Circle extends Graphic {
|
|
15654
|
-
constructor(
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
};
|
|
15414
|
+
constructor(params = {
|
|
15415
|
+
radius: 1
|
|
15416
|
+
}) {
|
|
15658
15417
|
super(params), this.type = "circle", this.numberType = CIRCLE_NUMBER_TYPE;
|
|
15659
15418
|
}
|
|
15660
15419
|
isValid() {
|
|
@@ -15736,10 +15495,7 @@
|
|
|
15736
15495
|
} else bbox.yOffset = -bbox.height;
|
|
15737
15496
|
return bbox;
|
|
15738
15497
|
}
|
|
15739
|
-
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight) {
|
|
15740
|
-
let suffix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "";
|
|
15741
|
-
let wordBreak = arguments.length > 5 ? arguments[5] : undefined;
|
|
15742
|
-
let params = arguments.length > 6 ? arguments[6] : undefined;
|
|
15498
|
+
GetLayoutByLines(lines, textAlign, textBaseline, lineHeight, suffix = "", wordBreak, params) {
|
|
15743
15499
|
const {
|
|
15744
15500
|
lineWidth: lineWidth,
|
|
15745
15501
|
suffixPosition = "end",
|
|
@@ -15862,11 +15618,10 @@
|
|
|
15862
15618
|
get isMultiLine() {
|
|
15863
15619
|
return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
|
|
15864
15620
|
}
|
|
15865
|
-
constructor(
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
|
|
15869
|
-
};
|
|
15621
|
+
constructor(params = {
|
|
15622
|
+
text: "",
|
|
15623
|
+
fontSize: 16
|
|
15624
|
+
}) {
|
|
15870
15625
|
super(params), this.type = "text", this.numberType = TEXT_NUMBER_TYPE, this.cache = {};
|
|
15871
15626
|
}
|
|
15872
15627
|
isValid() {
|
|
@@ -16198,12 +15953,10 @@
|
|
|
16198
15953
|
var _a;
|
|
16199
15954
|
return null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
16200
15955
|
}
|
|
16201
|
-
needUpdateTags(keys) {
|
|
16202
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
15956
|
+
needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
|
|
16203
15957
|
return super.needUpdateTags(keys, k);
|
|
16204
15958
|
}
|
|
16205
|
-
needUpdateTag(key) {
|
|
16206
|
-
let k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_UPDATE_TAG_KEY;
|
|
15959
|
+
needUpdateTag(key, k = TEXT_UPDATE_TAG_KEY) {
|
|
16207
15960
|
return super.needUpdateTag(key, k);
|
|
16208
15961
|
}
|
|
16209
15962
|
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {
|
|
@@ -16262,19 +16015,15 @@
|
|
|
16262
16015
|
|
|
16263
16016
|
const SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16264
16017
|
let Symbol$1 = class Symbol extends Graphic {
|
|
16265
|
-
constructor(
|
|
16266
|
-
|
|
16267
|
-
|
|
16268
|
-
};
|
|
16018
|
+
constructor(params = {
|
|
16019
|
+
symbolType: "circle"
|
|
16020
|
+
}) {
|
|
16269
16021
|
super(params), this.type = "symbol", this.numberType = SYMBOL_NUMBER_TYPE;
|
|
16270
16022
|
}
|
|
16271
16023
|
getParsedPath() {
|
|
16272
16024
|
return this.shouldUpdateShape() && (this._parsedPath = this.doUpdateParsedPath(), this.clearUpdateShapeTag()), this._parsedPath;
|
|
16273
16025
|
}
|
|
16274
|
-
getParsedPath2D() {
|
|
16275
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
16276
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16277
|
-
let size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
16026
|
+
getParsedPath2D(x = 0, y = 0, size = 1) {
|
|
16278
16027
|
let path = null;
|
|
16279
16028
|
try {
|
|
16280
16029
|
path = new Path2D();
|
|
@@ -16359,8 +16108,7 @@
|
|
|
16359
16108
|
|
|
16360
16109
|
const LINE_UPDATE_TAG_KEY = ["segments", "points", "curveType", "curveTension", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
16361
16110
|
let Line$1 = class Line extends Graphic {
|
|
16362
|
-
constructor() {
|
|
16363
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16111
|
+
constructor(params = {}) {
|
|
16364
16112
|
super(params), this.type = "line", this.numberType = LINE_NUMBER_TYPE;
|
|
16365
16113
|
}
|
|
16366
16114
|
isValid() {
|
|
@@ -16562,9 +16310,7 @@
|
|
|
16562
16310
|
g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
|
|
16563
16311
|
});
|
|
16564
16312
|
}
|
|
16565
|
-
setAttributes(params) {
|
|
16566
|
-
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16567
|
-
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
16313
|
+
setAttributes(params, forceUpdateTag = !1, context) {
|
|
16568
16314
|
super.setAttributes(params, forceUpdateTag, context), this.subGraphic.forEach(g => {
|
|
16569
16315
|
g.addUpdateShapeAndBoundsTag(), g.addUpdatePositionTag();
|
|
16570
16316
|
});
|
|
@@ -17220,8 +16966,7 @@
|
|
|
17220
16966
|
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);
|
|
17221
16967
|
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;
|
|
17222
16968
|
}
|
|
17223
|
-
deal(paragraph) {
|
|
17224
|
-
let singleLine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
16969
|
+
deal(paragraph, singleLine = !1) {
|
|
17225
16970
|
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)));
|
|
17226
16971
|
}
|
|
17227
16972
|
cut(paragraph, singleLine) {
|
|
@@ -18042,8 +17787,7 @@
|
|
|
18042
17787
|
addUpdateShapeAndBoundsTag() {
|
|
18043
17788
|
super.addUpdateShapeAndBoundsTag(), this.shadowHost && this.shadowHost.addUpdateBoundTag();
|
|
18044
17789
|
}
|
|
18045
|
-
tryUpdateGlobalTransMatrix() {
|
|
18046
|
-
let clearTag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
17790
|
+
tryUpdateGlobalTransMatrix(clearTag = !0) {
|
|
18047
17791
|
if (this.shouldUpdateGlobalMatrix()) {
|
|
18048
17792
|
const m = this.transMatrix;
|
|
18049
17793
|
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();
|
|
@@ -18573,9 +18317,7 @@
|
|
|
18573
18317
|
const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
|
|
18574
18318
|
|
|
18575
18319
|
const halfPi = pi$1 / 2;
|
|
18576
|
-
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
18577
|
-
let roundCorner = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
18578
|
-
let edgeCb = arguments.length > 7 ? arguments[7] : undefined;
|
|
18320
|
+
function createRectPath(path, x, y, width, height, rectCornerRadius, roundCorner = !0, edgeCb) {
|
|
18579
18321
|
let cornerRadius;
|
|
18580
18322
|
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)) {
|
|
18581
18323
|
const cornerRadiusArr = rectCornerRadius;
|
|
@@ -18916,8 +18658,7 @@
|
|
|
18916
18658
|
doStroke: doStroke
|
|
18917
18659
|
};
|
|
18918
18660
|
}
|
|
18919
|
-
transform(graphic, graphicAttribute, context) {
|
|
18920
|
-
let use3dMatrixIn3dMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
18661
|
+
transform(graphic, graphicAttribute, context, use3dMatrixIn3dMode = !1) {
|
|
18921
18662
|
const {
|
|
18922
18663
|
x = graphicAttribute.x,
|
|
18923
18664
|
y = graphicAttribute.y,
|
|
@@ -20038,7 +19779,7 @@
|
|
|
20038
19779
|
get length() {
|
|
20039
19780
|
return this.pools.length;
|
|
20040
19781
|
}
|
|
20041
|
-
release() {
|
|
19782
|
+
release(...params) {
|
|
20042
19783
|
this.pools = [];
|
|
20043
19784
|
}
|
|
20044
19785
|
}
|
|
@@ -20258,11 +19999,12 @@
|
|
|
20258
19999
|
DefaultCanvasTextRender = __decorate$1e([injectable(), __param$C(0, inject(ContributionProvider)), __param$C(0, named(TextRenderContribution)), __metadata$Y("design:paramtypes", [Object])], DefaultCanvasTextRender);
|
|
20259
20000
|
|
|
20260
20001
|
function drawPolygon(path, points, x, y) {
|
|
20261
|
-
|
|
20262
|
-
|
|
20002
|
+
if (points && points.length) {
|
|
20003
|
+
path.moveTo(points[0].x + x, points[0].y + y);
|
|
20004
|
+
for (let i = 1; i < points.length; i++) path.lineTo(points[i].x + x, points[i].y + y);
|
|
20005
|
+
}
|
|
20263
20006
|
}
|
|
20264
|
-
function drawRoundedPolygon(path, points, x, y, cornerRadius) {
|
|
20265
|
-
let closePath = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !0;
|
|
20007
|
+
function drawRoundedPolygon(path, points, x, y, cornerRadius, closePath = !0) {
|
|
20266
20008
|
var _a;
|
|
20267
20009
|
if (points.length < 3) return void drawPolygon(path, points, x, y);
|
|
20268
20010
|
let startI = 0,
|
|
@@ -21021,7 +20763,7 @@
|
|
|
21021
20763
|
unRegister(plugin) {
|
|
21022
20764
|
"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);
|
|
21023
20765
|
}
|
|
21024
|
-
release() {
|
|
20766
|
+
release(...params) {
|
|
21025
20767
|
this.onStartupFinishedPlugin.forEach(plugin => {
|
|
21026
20768
|
plugin.deactivate(this);
|
|
21027
20769
|
}), this.onStartupFinishedPlugin = [], this.onRegisterPlugin.forEach(plugin => {
|
|
@@ -21168,9 +20910,7 @@
|
|
|
21168
20910
|
zIdxArray: zIdxArray
|
|
21169
20911
|
};
|
|
21170
20912
|
}
|
|
21171
|
-
function foreach(graphic, defaultZIndex, cb) {
|
|
21172
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
21173
|
-
let sort3d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
20913
|
+
function foreach(graphic, defaultZIndex, cb, reverse = !1, sort3d = !1) {
|
|
21174
20914
|
let needSort = !1;
|
|
21175
20915
|
if (sort3d) needSort = !0;else {
|
|
21176
20916
|
let lastZIndex;
|
|
@@ -21201,14 +20941,12 @@
|
|
|
21201
20941
|
}
|
|
21202
20942
|
} else graphic.forEachChildren(cb, reverse);
|
|
21203
20943
|
}
|
|
21204
|
-
function foreachAsync(graphic, defaultZIndex, cb) {
|
|
21205
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
20944
|
+
function foreachAsync(graphic, defaultZIndex, cb, reverse = !1) {
|
|
21206
20945
|
return __awaiter$6(this, void 0, void 0, function* () {
|
|
21207
20946
|
yield graphic.forEachChildrenAsync(cb, reverse);
|
|
21208
20947
|
});
|
|
21209
20948
|
}
|
|
21210
|
-
function findNextGraphic(graphic, id, defaultZIndex) {
|
|
21211
|
-
let reverse = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
20949
|
+
function findNextGraphic(graphic, id, defaultZIndex, reverse = !1) {
|
|
21212
20950
|
let needSort = !1;
|
|
21213
20951
|
graphic.forEachChildren((item, i) => {
|
|
21214
20952
|
const {
|
|
@@ -21958,8 +21696,7 @@
|
|
|
21958
21696
|
set ticker(ticker) {
|
|
21959
21697
|
ticker.bindStage(this), this._ticker && this._ticker.removeListener("tick", this.afterTickCb), ticker.addTimeline(this.timeline), this._ticker = ticker, this._ticker.on("tick", this.afterTickCb);
|
|
21960
21698
|
}
|
|
21961
|
-
constructor() {
|
|
21962
|
-
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21699
|
+
constructor(params = {}) {
|
|
21963
21700
|
var _a, _b;
|
|
21964
21701
|
super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
|
|
21965
21702
|
if (!(this._skipRender < 0)) if (visible) {
|
|
@@ -22002,8 +21739,7 @@
|
|
|
22002
21739
|
startAnimate() {
|
|
22003
21740
|
this._ticker && this.timeline && (this._ticker.start(), this.timeline.resume());
|
|
22004
21741
|
}
|
|
22005
|
-
pauseRender() {
|
|
22006
|
-
let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
21742
|
+
pauseRender(sr = -1) {
|
|
22007
21743
|
this._skipRender = sr;
|
|
22008
21744
|
}
|
|
22009
21745
|
resumeRender() {
|
|
@@ -22025,8 +21761,7 @@
|
|
|
22025
21761
|
optmize(params) {
|
|
22026
21762
|
this.optmizeRender(params.skipRenderWithOutRange), this.params.optimize = params;
|
|
22027
21763
|
}
|
|
22028
|
-
optmizeRender() {
|
|
22029
|
-
let skipRenderWithOutRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
21764
|
+
optmizeRender(skipRenderWithOutRange = !1) {
|
|
22030
21765
|
skipRenderWithOutRange && (this._skipRender = this._skipRender < 0 ? this._skipRender : this.window.isVisible() ? 0 : 1, this.window.onVisibleChange(this._onVisibleChange));
|
|
22031
21766
|
}
|
|
22032
21767
|
getTimeline() {
|
|
@@ -22280,18 +22015,15 @@
|
|
|
22280
22015
|
renderStyle: this.renderStyle
|
|
22281
22016
|
}, params)));
|
|
22282
22017
|
}
|
|
22283
|
-
resizeWindow(w, h) {
|
|
22284
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22018
|
+
resizeWindow(w, h, rerender = !0) {
|
|
22285
22019
|
this.window.resize(w, h), rerender && this.render();
|
|
22286
22020
|
}
|
|
22287
|
-
resize(w, h) {
|
|
22288
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22021
|
+
resize(w, h, rerender = !0) {
|
|
22289
22022
|
"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 => {
|
|
22290
22023
|
c.resize(w, h);
|
|
22291
22024
|
}), this.camera && this.option3d && this.set3dOptions(this.option3d), rerender && this.render());
|
|
22292
22025
|
}
|
|
22293
|
-
resizeView(w, h) {
|
|
22294
|
-
let rerender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
22026
|
+
resizeView(w, h, rerender = !0) {
|
|
22295
22027
|
"released" !== this.releaseStatus && (this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h), this.forEachChildren(c => {
|
|
22296
22028
|
c.resizeView(w, h);
|
|
22297
22029
|
}), this.camera && (this.camera.params = Object.assign(Object.assign({}, this.camera.params), {
|
|
@@ -22305,8 +22037,7 @@
|
|
|
22305
22037
|
c.resizeView(this.viewBox.width(), this.viewBox.height());
|
|
22306
22038
|
}), isRerender && this.render();
|
|
22307
22039
|
}
|
|
22308
|
-
setDpr(dpr) {
|
|
22309
|
-
let rerender = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
22040
|
+
setDpr(dpr, rerender = !0) {
|
|
22310
22041
|
this.forEachChildren(c => {
|
|
22311
22042
|
c.setDpr(dpr);
|
|
22312
22043
|
}), rerender && this.render();
|
|
@@ -22354,8 +22085,7 @@
|
|
|
22354
22085
|
});
|
|
22355
22086
|
});
|
|
22356
22087
|
}
|
|
22357
|
-
renderToNewWindow() {
|
|
22358
|
-
let viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
22088
|
+
renderToNewWindow(fullImage = !0, viewBox) {
|
|
22359
22089
|
if ("released" === this.releaseStatus) return;
|
|
22360
22090
|
const window = container.get(VWindow),
|
|
22361
22091
|
x1 = viewBox ? -viewBox.x1 : 0,
|
|
@@ -22379,9 +22109,7 @@
|
|
|
22379
22109
|
title: ""
|
|
22380
22110
|
}), this.renderTo(window), window;
|
|
22381
22111
|
}
|
|
22382
|
-
toCanvas() {
|
|
22383
|
-
let fullImage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
22384
|
-
let viewBox = arguments.length > 1 ? arguments[1] : undefined;
|
|
22112
|
+
toCanvas(fullImage = !0, viewBox) {
|
|
22385
22113
|
if ("released" === this.releaseStatus) return;
|
|
22386
22114
|
const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
|
|
22387
22115
|
return c.nativeCanvas ? c.nativeCanvas : null;
|
|
@@ -22443,7 +22171,7 @@
|
|
|
22443
22171
|
});
|
|
22444
22172
|
};
|
|
22445
22173
|
let BaseEnvContribution = class {
|
|
22446
|
-
configure(service) {
|
|
22174
|
+
configure(service, ...p) {
|
|
22447
22175
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
22448
22176
|
}
|
|
22449
22177
|
getNativeAABBBounds(dom) {
|
|
@@ -22546,7 +22274,7 @@
|
|
|
22546
22274
|
configure(window, global) {
|
|
22547
22275
|
global.env === this.type && window.setWindowHandler(this);
|
|
22548
22276
|
}
|
|
22549
|
-
release() {
|
|
22277
|
+
release(...params) {
|
|
22550
22278
|
this.releaseWindow();
|
|
22551
22279
|
}
|
|
22552
22280
|
isVisible(bbox) {
|
|
@@ -23920,8 +23648,7 @@
|
|
|
23920
23648
|
};
|
|
23921
23649
|
};
|
|
23922
23650
|
class Gesture extends EventEmitter {
|
|
23923
|
-
constructor(element) {
|
|
23924
|
-
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23651
|
+
constructor(element, config = {}) {
|
|
23925
23652
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
23926
23653
|
super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.lastTapTarget = null, this.onStart = ev => {
|
|
23927
23654
|
this.startTime = clock.now();
|
|
@@ -24258,8 +23985,7 @@
|
|
|
24258
23985
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
24259
23986
|
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;
|
|
24260
23987
|
}
|
|
24261
|
-
reset() {
|
|
24262
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
23988
|
+
reset(setTransform = !0) {
|
|
24263
23989
|
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);
|
|
24264
23990
|
}
|
|
24265
23991
|
getCanvas() {
|
|
@@ -24268,8 +23994,7 @@
|
|
|
24268
23994
|
getContext() {
|
|
24269
23995
|
return this.nativeContext;
|
|
24270
23996
|
}
|
|
24271
|
-
setTransformForCurrent() {
|
|
24272
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
23997
|
+
setTransformForCurrent(force = !1) {
|
|
24273
23998
|
!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));
|
|
24274
23999
|
}
|
|
24275
24000
|
get currentMatrix() {
|
|
@@ -24287,8 +24012,7 @@
|
|
|
24287
24012
|
highPerformanceRestore() {
|
|
24288
24013
|
this.stack.length > 0 && (matrixAllocate.free(this.matrix), this.matrix = this.stack.pop());
|
|
24289
24014
|
}
|
|
24290
|
-
rotate(rad) {
|
|
24291
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24015
|
+
rotate(rad, setTransform = !0) {
|
|
24292
24016
|
this.matrix.rotate(rad), setTransform && this.setTransformForCurrent();
|
|
24293
24017
|
}
|
|
24294
24018
|
save() {
|
|
@@ -24299,55 +24023,41 @@
|
|
|
24299
24023
|
const matrix = this.cloneMatrix(this.matrix);
|
|
24300
24024
|
this.stack.push(matrix);
|
|
24301
24025
|
}
|
|
24302
|
-
scale(sx, sy) {
|
|
24303
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24026
|
+
scale(sx, sy, setTransform = !0) {
|
|
24304
24027
|
this.matrix.scale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
24305
24028
|
}
|
|
24306
|
-
setScale(sx, sy) {
|
|
24307
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24029
|
+
setScale(sx, sy, setTransform = !0) {
|
|
24308
24030
|
this.matrix.setScale(sx, sy), setTransform && this.setTransformForCurrent();
|
|
24309
24031
|
}
|
|
24310
|
-
scalePoint(sx, sy, px, py) {
|
|
24311
|
-
let setTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
24032
|
+
scalePoint(sx, sy, px, py, setTransform = !0) {
|
|
24312
24033
|
this.translate(px, py, !1), this.scale(sx, sy, !1), this.translate(-px, -py, !1), setTransform && this.setTransformForCurrent();
|
|
24313
24034
|
}
|
|
24314
|
-
setTransform(a, b, c, d, e, f) {
|
|
24315
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
24316
|
-
let dpr = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : this.dpr;
|
|
24035
|
+
setTransform(a, b, c, d, e, f, setTransform = !0, dpr = this.dpr) {
|
|
24317
24036
|
this.matrix.setValue(dpr * a, dpr * b, dpr * c, dpr * d, dpr * e, dpr * f), setTransform && this.setTransformForCurrent();
|
|
24318
24037
|
}
|
|
24319
|
-
setTransformFromMatrix(matrix) {
|
|
24320
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24321
|
-
let dpr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.dpr;
|
|
24038
|
+
setTransformFromMatrix(matrix, setTransform = !0, dpr = this.dpr) {
|
|
24322
24039
|
this.matrix.setValue(matrix.a * dpr, matrix.b * dpr, matrix.c * dpr, matrix.d * dpr, matrix.e * dpr, matrix.f * dpr), setTransform && this.setTransformForCurrent();
|
|
24323
24040
|
}
|
|
24324
|
-
resetTransform() {
|
|
24325
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24326
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
24041
|
+
resetTransform(setTransform = !0, dpr = this.dpr) {
|
|
24327
24042
|
this.setTransform(dpr, 0, 0, dpr, 0, 0), setTransform && this.setTransformForCurrent();
|
|
24328
24043
|
}
|
|
24329
|
-
transform(a, b, c, d, e, f) {
|
|
24330
|
-
let setTransform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !0;
|
|
24044
|
+
transform(a, b, c, d, e, f, setTransform = !0) {
|
|
24331
24045
|
this.matrix.multiply(a, b, c, d, e, f), setTransform && this.setTransformForCurrent();
|
|
24332
24046
|
}
|
|
24333
24047
|
transformFromMatrix(matrix, setTransform) {
|
|
24334
24048
|
this.matrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), setTransform && this.setTransformForCurrent();
|
|
24335
24049
|
}
|
|
24336
|
-
translate(x, y) {
|
|
24337
|
-
let setTransform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
24050
|
+
translate(x, y, setTransform = !0) {
|
|
24338
24051
|
this.matrix.translate(x, y), setTransform && this.setTransformForCurrent();
|
|
24339
24052
|
}
|
|
24340
|
-
rotateDegrees(deg) {
|
|
24341
|
-
let setTransform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24053
|
+
rotateDegrees(deg, setTransform = !0) {
|
|
24342
24054
|
const rad = deg * Math.PI / 180;
|
|
24343
24055
|
this.rotate(rad, setTransform);
|
|
24344
24056
|
}
|
|
24345
|
-
rotateAbout(rad, x, y) {
|
|
24346
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
24057
|
+
rotateAbout(rad, x, y, setTransform = !0) {
|
|
24347
24058
|
this.translate(x, y, !1), this.rotate(rad, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
24348
24059
|
}
|
|
24349
|
-
rotateDegreesAbout(deg, x, y) {
|
|
24350
|
-
let setTransform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
24060
|
+
rotateDegreesAbout(deg, x, y, setTransform = !0) {
|
|
24351
24061
|
this.translate(x, y, !1), this.rotateDegrees(deg, !1), this.translate(-x, -y, !1), setTransform && this.setTransformForCurrent();
|
|
24352
24062
|
}
|
|
24353
24063
|
beginPath() {
|
|
@@ -24484,8 +24194,7 @@
|
|
|
24484
24194
|
isPointInStroke(x, y) {
|
|
24485
24195
|
return this.nativeContext.isPointInStroke(x, y);
|
|
24486
24196
|
}
|
|
24487
|
-
measureText(text) {
|
|
24488
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
24197
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
24489
24198
|
var _a, _b;
|
|
24490
24199
|
if (!method || "native" === method) return this.nativeContext.measureText(text);
|
|
24491
24200
|
this.mathTextMeasure || (this.mathTextMeasure = application.graphicUtil.createTextMeasureInstance({}, {}, () => this.canvas.nativeCanvas));
|
|
@@ -24628,19 +24337,16 @@
|
|
|
24628
24337
|
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;
|
|
24629
24338
|
}
|
|
24630
24339
|
draw() {}
|
|
24631
|
-
clearMatrix() {
|
|
24632
|
-
let setTransform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
24633
|
-
let dpr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.dpr;
|
|
24340
|
+
clearMatrix(setTransform = !0, dpr = this.dpr) {
|
|
24634
24341
|
this.setTransformFromMatrix(this._clearMatrix, setTransform, dpr);
|
|
24635
24342
|
}
|
|
24636
24343
|
setClearMatrix(a, b, c, d, e, f) {
|
|
24637
24344
|
this._clearMatrix.setValue(a, b, c, d, e, f);
|
|
24638
24345
|
}
|
|
24639
|
-
onlyTranslate() {
|
|
24640
|
-
let dpr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.dpr;
|
|
24346
|
+
onlyTranslate(dpr = this.dpr) {
|
|
24641
24347
|
return this.matrix.a === dpr && 0 === this.matrix.b && 0 === this.matrix.c && this.matrix.d === dpr;
|
|
24642
24348
|
}
|
|
24643
|
-
release() {
|
|
24349
|
+
release(...params) {
|
|
24644
24350
|
this.stack.forEach(m => matrixAllocate.free(m)), this.stack.length = 0;
|
|
24645
24351
|
}
|
|
24646
24352
|
};
|
|
@@ -25047,8 +24753,7 @@
|
|
|
25047
24753
|
this.dom = dom;
|
|
25048
24754
|
}
|
|
25049
24755
|
}
|
|
25050
|
-
function createImageElement$1(src) {
|
|
25051
|
-
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
24756
|
+
function createImageElement$1(src, isSvg = !1) {
|
|
25052
24757
|
const img = document.createElement("img");
|
|
25053
24758
|
if (application.global.isImageAnonymous && (img.crossOrigin = "anonymous"), isSvg) {
|
|
25054
24759
|
const data = new Blob([src], {
|
|
@@ -25195,7 +24900,7 @@
|
|
|
25195
24900
|
getDocument() {
|
|
25196
24901
|
return document;
|
|
25197
24902
|
}
|
|
25198
|
-
release() {}
|
|
24903
|
+
release(...params) {}
|
|
25199
24904
|
getElementTop(element, baseWindow) {
|
|
25200
24905
|
let actualTop = element.offsetTop,
|
|
25201
24906
|
current = element.offsetParent;
|
|
@@ -25249,8 +24954,7 @@
|
|
|
25249
24954
|
browserEnvModule.isBrowserBound || (browserEnvModule.isBrowserBound = !0, bind(BrowserEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(BrowserEnvContribution));
|
|
25250
24955
|
});
|
|
25251
24956
|
browserEnvModule.isBrowserBound = !1;
|
|
25252
|
-
function loadBrowserEnv(container) {
|
|
25253
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
24957
|
+
function loadBrowserEnv(container, loadPicker = !0) {
|
|
25254
24958
|
loadBrowserEnv.__loaded || (loadBrowserEnv.__loaded = !0, container.load(browserEnvModule), container.load(browserCanvasModule), container.load(browserWindowModule), loadPicker && loadCanvasPicker(container));
|
|
25255
24959
|
}
|
|
25256
24960
|
loadBrowserEnv.__loaded = !1;
|
|
@@ -25319,7 +25023,7 @@
|
|
|
25319
25023
|
init() {
|
|
25320
25024
|
this._context = new FeishuContext2d(this, this._dpr);
|
|
25321
25025
|
}
|
|
25322
|
-
release() {}
|
|
25026
|
+
release(...params) {}
|
|
25323
25027
|
};
|
|
25324
25028
|
FeishuCanvas.env = "feishu", FeishuCanvas = __decorate$R([injectable(), __metadata$G("design:paramtypes", [Object])], FeishuCanvas);
|
|
25325
25029
|
|
|
@@ -26082,7 +25786,7 @@
|
|
|
26082
25786
|
getDocument() {
|
|
26083
25787
|
return null;
|
|
26084
25788
|
}
|
|
26085
|
-
release() {}
|
|
25789
|
+
release(...params) {}
|
|
26086
25790
|
mapToCanvasPoint(event) {
|
|
26087
25791
|
var _a;
|
|
26088
25792
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -26094,8 +25798,7 @@
|
|
|
26094
25798
|
feishuEnvModule.isFeishuBound || (feishuEnvModule.isFeishuBound = !0, bind(FeishuEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(FeishuEnvContribution));
|
|
26095
25799
|
});
|
|
26096
25800
|
feishuEnvModule.isFeishuBound = !1;
|
|
26097
|
-
function loadFeishuEnv(container) {
|
|
26098
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
25801
|
+
function loadFeishuEnv(container, loadPicker = !0) {
|
|
26099
25802
|
loadFeishuEnv.__loaded || (loadFeishuEnv.__loaded = !0, container.load(feishuEnvModule), container.load(feishuCanvasModule), container.load(feishuWindowModule), loadPicker && loadMathPicker(container));
|
|
26100
25803
|
}
|
|
26101
25804
|
loadFeishuEnv.__loaded = !1;
|
|
@@ -26144,8 +25847,7 @@
|
|
|
26144
25847
|
_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;
|
|
26145
25848
|
}
|
|
26146
25849
|
}
|
|
26147
|
-
measureText(text) {
|
|
26148
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
25850
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
26149
25851
|
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
26150
25852
|
return {
|
|
26151
25853
|
width: super.measureText(text, method).width,
|
|
@@ -26190,7 +25892,7 @@
|
|
|
26190
25892
|
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);
|
|
26191
25893
|
this._context.dpr = this._dpr;
|
|
26192
25894
|
}
|
|
26193
|
-
release() {}
|
|
25895
|
+
release(...params) {}
|
|
26194
25896
|
};
|
|
26195
25897
|
LynxCanvas.env = "lynx", LynxCanvas = __decorate$B([injectable(), __metadata$t("design:paramtypes", [Object])], LynxCanvas);
|
|
26196
25898
|
|
|
@@ -26380,8 +26082,7 @@
|
|
|
26380
26082
|
canvasMap.set(id, canvas), freeCanvasList.push(canvas);
|
|
26381
26083
|
}
|
|
26382
26084
|
}
|
|
26383
|
-
function createImageElement(src) {
|
|
26384
|
-
let isSvg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
26085
|
+
function createImageElement(src, isSvg = !1) {
|
|
26385
26086
|
if (isSvg) return Promise.reject();
|
|
26386
26087
|
const img = lynx.createImage(src);
|
|
26387
26088
|
return new Promise((resolve, reject) => {
|
|
@@ -26464,7 +26165,7 @@
|
|
|
26464
26165
|
getDocument() {
|
|
26465
26166
|
return null;
|
|
26466
26167
|
}
|
|
26467
|
-
release() {}
|
|
26168
|
+
release(...params) {}
|
|
26468
26169
|
};
|
|
26469
26170
|
LynxEnvContribution = __decorate$z([injectable(), __metadata$r("design:paramtypes", [])], LynxEnvContribution);
|
|
26470
26171
|
|
|
@@ -26472,8 +26173,7 @@
|
|
|
26472
26173
|
lynxEnvModule.isLynxBound || (lynxEnvModule.isLynxBound = !0, bind(LynxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(LynxEnvContribution));
|
|
26473
26174
|
});
|
|
26474
26175
|
lynxEnvModule.isLynxBound = !1;
|
|
26475
|
-
function loadLynxEnv(container) {
|
|
26476
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
26176
|
+
function loadLynxEnv(container, loadPicker = !0) {
|
|
26477
26177
|
loadLynxEnv.__loaded || (loadLynxEnv.__loaded = !0, container.load(lynxEnvModule), container.load(lynxCanvasModule), container.load(lynxWindowModule), loadPicker && loadMathPicker(container));
|
|
26478
26178
|
}
|
|
26479
26179
|
loadLynxEnv.__loaded = !1;
|
|
@@ -26495,7 +26195,7 @@
|
|
|
26495
26195
|
if (!context) throw new Error("发生错误,获取2d上下文失败");
|
|
26496
26196
|
this.nativeContext = context, this.canvas = canvas, this.matrix = new Matrix(1, 0, 0, 1, 0, 0), this.stack = [], this.dpr = null != dpr ? dpr : 1;
|
|
26497
26197
|
}
|
|
26498
|
-
release() {}
|
|
26198
|
+
release(...params) {}
|
|
26499
26199
|
};
|
|
26500
26200
|
NodeContext2d.env = "node", NodeContext2d = __decorate$y([injectable(), __metadata$q("design:paramtypes", [Object, Number])], NodeContext2d);
|
|
26501
26201
|
|
|
@@ -26516,7 +26216,7 @@
|
|
|
26516
26216
|
init() {
|
|
26517
26217
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
26518
26218
|
}
|
|
26519
|
-
release() {
|
|
26219
|
+
release(...params) {
|
|
26520
26220
|
this._nativeCanvas.release && isFunction$1(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
26521
26221
|
}
|
|
26522
26222
|
};
|
|
@@ -26611,8 +26311,7 @@
|
|
|
26611
26311
|
getDpr() {
|
|
26612
26312
|
return this.canvas.dpr;
|
|
26613
26313
|
}
|
|
26614
|
-
getImageBuffer() {
|
|
26615
|
-
let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "image/png";
|
|
26314
|
+
getImageBuffer(type = "image/png") {
|
|
26616
26315
|
return this.canvas.nativeCanvas.toBuffer(type);
|
|
26617
26316
|
}
|
|
26618
26317
|
addEventListener(type, listener, options) {}
|
|
@@ -26715,7 +26414,7 @@
|
|
|
26715
26414
|
return null;
|
|
26716
26415
|
}
|
|
26717
26416
|
dispatchEvent(event) {}
|
|
26718
|
-
release() {}
|
|
26417
|
+
release(...params) {}
|
|
26719
26418
|
createOffscreenCanvas(params) {}
|
|
26720
26419
|
};
|
|
26721
26420
|
NodeEnvContribution = __decorate$v([injectable()], NodeEnvContribution);
|
|
@@ -26724,7 +26423,7 @@
|
|
|
26724
26423
|
nodeEnvModule.isNodeBound || (nodeEnvModule.isNodeBound = !0, bind(NodeEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(NodeEnvContribution));
|
|
26725
26424
|
});
|
|
26726
26425
|
nodeEnvModule.isNodeBound = !1;
|
|
26727
|
-
function loadNodeEnv(container) {
|
|
26426
|
+
function loadNodeEnv(container, loadPicker = !0) {
|
|
26728
26427
|
loadNodeEnv.__loaded || (loadNodeEnv.__loaded = !0, container.load(nodeEnvModule), container.load(nodeCanvasModule), container.load(nodeWindowModule));
|
|
26729
26428
|
}
|
|
26730
26429
|
loadNodeEnv.__loaded = !1;
|
|
@@ -26837,7 +26536,7 @@
|
|
|
26837
26536
|
init() {
|
|
26838
26537
|
this._context = new TaroContext2d(this, this._dpr);
|
|
26839
26538
|
}
|
|
26840
|
-
release() {}
|
|
26539
|
+
release(...params) {}
|
|
26841
26540
|
};
|
|
26842
26541
|
TaroCanvas.env = "taro", TaroCanvas = __decorate$t([injectable(), __metadata$n("design:paramtypes", [Object])], TaroCanvas);
|
|
26843
26542
|
|
|
@@ -27106,7 +26805,7 @@
|
|
|
27106
26805
|
getDocument() {
|
|
27107
26806
|
return null;
|
|
27108
26807
|
}
|
|
27109
|
-
release() {}
|
|
26808
|
+
release(...params) {}
|
|
27110
26809
|
};
|
|
27111
26810
|
TaroEnvContribution = __decorate$r([injectable(), __metadata$l("design:paramtypes", [])], TaroEnvContribution);
|
|
27112
26811
|
|
|
@@ -27114,8 +26813,7 @@
|
|
|
27114
26813
|
taroEnvModule.isTaroBound || (taroEnvModule.isTaroBound = !0, bind(TaroEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TaroEnvContribution));
|
|
27115
26814
|
});
|
|
27116
26815
|
taroEnvModule.isTaroBound = !1;
|
|
27117
|
-
function loadTaroEnv(container) {
|
|
27118
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
26816
|
+
function loadTaroEnv(container, loadPicker = !0) {
|
|
27119
26817
|
loadTaroEnv.__loaded || (loadTaroEnv.__loaded = !0, container.load(taroEnvModule), container.load(taroCanvasModule), container.load(taroWindowModule), loadPicker && loadMathPicker(container));
|
|
27120
26818
|
}
|
|
27121
26819
|
loadTaroEnv.__loaded = !1;
|
|
@@ -27152,7 +26850,7 @@
|
|
|
27152
26850
|
init() {
|
|
27153
26851
|
this._context = new WxContext2d(this, this._dpr);
|
|
27154
26852
|
}
|
|
27155
|
-
release() {}
|
|
26853
|
+
release(...params) {}
|
|
27156
26854
|
};
|
|
27157
26855
|
WxCanvas.env = "wx", WxCanvas = __decorate$p([injectable(), __metadata$k("design:paramtypes", [Object])], WxCanvas);
|
|
27158
26856
|
|
|
@@ -27425,7 +27123,7 @@
|
|
|
27425
27123
|
getDocument() {
|
|
27426
27124
|
return null;
|
|
27427
27125
|
}
|
|
27428
|
-
release() {}
|
|
27126
|
+
release(...params) {}
|
|
27429
27127
|
mapToCanvasPoint(event) {
|
|
27430
27128
|
var _a;
|
|
27431
27129
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -27437,8 +27135,7 @@
|
|
|
27437
27135
|
wxEnvModule._isWxBound || (wxEnvModule._isWxBound = !0, bind(WxEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(WxEnvContribution));
|
|
27438
27136
|
});
|
|
27439
27137
|
wxEnvModule._isWxBound = !1;
|
|
27440
|
-
function loadWxEnv(container) {
|
|
27441
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27138
|
+
function loadWxEnv(container, loadPicker = !0) {
|
|
27442
27139
|
loadWxEnv.__loaded || (loadWxEnv.__loaded = !0, container.load(wxEnvModule), container.load(wxCanvasModule), container.load(wxWindowModule), loadPicker && loadMathPicker(container));
|
|
27443
27140
|
}
|
|
27444
27141
|
loadWxEnv.__loaded = !1;
|
|
@@ -27447,7 +27144,7 @@
|
|
|
27447
27144
|
loadAllModule(container);
|
|
27448
27145
|
}
|
|
27449
27146
|
function loadAllModule(container) {
|
|
27450
|
-
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) => {
|
|
27147
|
+
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) => {
|
|
27451
27148
|
"browser" !== env && loadMathPicker(container);
|
|
27452
27149
|
}));
|
|
27453
27150
|
}
|
|
@@ -27483,7 +27180,7 @@
|
|
|
27483
27180
|
init() {
|
|
27484
27181
|
this._context = new TTContext2d(this, this._dpr);
|
|
27485
27182
|
}
|
|
27486
|
-
release() {}
|
|
27183
|
+
release(...params) {}
|
|
27487
27184
|
};
|
|
27488
27185
|
TTCanvas.env = "tt", TTCanvas = __decorate$l([injectable(), __metadata$h("design:paramtypes", [Object])], TTCanvas);
|
|
27489
27186
|
|
|
@@ -27751,7 +27448,7 @@
|
|
|
27751
27448
|
getDocument() {
|
|
27752
27449
|
return null;
|
|
27753
27450
|
}
|
|
27754
|
-
release() {}
|
|
27451
|
+
release(...params) {}
|
|
27755
27452
|
mapToCanvasPoint(event) {
|
|
27756
27453
|
var _a;
|
|
27757
27454
|
return null === (_a = null == event ? void 0 : event.type) || void 0 === _a || _a.startsWith("mouse"), event;
|
|
@@ -27763,8 +27460,7 @@
|
|
|
27763
27460
|
ttEnvModule.isTTBound || (ttEnvModule.isTTBound = !0, bind(TTEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(TTEnvContribution));
|
|
27764
27461
|
});
|
|
27765
27462
|
ttEnvModule.isTTBound = !1;
|
|
27766
|
-
function loadTTEnv(container) {
|
|
27767
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27463
|
+
function loadTTEnv(container, loadPicker = !0) {
|
|
27768
27464
|
loadTTEnv.__loaded || (loadTTEnv.__loaded = !0, container.load(ttEnvModule), container.load(ttCanvasModule), container.load(ttWindowModule), loadPicker && loadMathPicker(container));
|
|
27769
27465
|
}
|
|
27770
27466
|
loadTTEnv.__loaded = !1;
|
|
@@ -27813,8 +27509,7 @@
|
|
|
27813
27509
|
_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;
|
|
27814
27510
|
}
|
|
27815
27511
|
}
|
|
27816
|
-
measureText(text) {
|
|
27817
|
-
let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : application.global.measureTextMethod;
|
|
27512
|
+
measureText(text, method = application.global.measureTextMethod) {
|
|
27818
27513
|
this.setTransform(1, 0, 0, 1, 0, 0, !0, application.global.devicePixelRatio);
|
|
27819
27514
|
return super.measureText(text, method);
|
|
27820
27515
|
}
|
|
@@ -27874,7 +27569,7 @@
|
|
|
27874
27569
|
this._context = new HarmonyContext2d(this, this._dpr);
|
|
27875
27570
|
}
|
|
27876
27571
|
resize(width, height) {}
|
|
27877
|
-
release() {}
|
|
27572
|
+
release(...params) {}
|
|
27878
27573
|
};
|
|
27879
27574
|
HarmonyCanvas.env = "harmony", HarmonyCanvas = __decorate$h([injectable(), __metadata$e("design:paramtypes", [Object])], HarmonyCanvas);
|
|
27880
27575
|
|
|
@@ -28118,7 +27813,7 @@
|
|
|
28118
27813
|
getDocument() {
|
|
28119
27814
|
return null;
|
|
28120
27815
|
}
|
|
28121
|
-
release() {}
|
|
27816
|
+
release(...params) {}
|
|
28122
27817
|
};
|
|
28123
27818
|
HarmonyEnvContribution = __decorate$f([injectable(), __metadata$c("design:paramtypes", [])], HarmonyEnvContribution);
|
|
28124
27819
|
|
|
@@ -28126,8 +27821,7 @@
|
|
|
28126
27821
|
harmonyEnvModule.isHarmonyBound || (harmonyEnvModule.isHarmonyBound = !0, bind(HarmonyEnvContribution).toSelf().inSingletonScope(), bind(EnvContribution).toService(HarmonyEnvContribution));
|
|
28127
27822
|
});
|
|
28128
27823
|
harmonyEnvModule.isHarmonyBound = !1;
|
|
28129
|
-
function loadHarmonyEnv(container) {
|
|
28130
|
-
let loadPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
27824
|
+
function loadHarmonyEnv(container, loadPicker = !0) {
|
|
28131
27825
|
loadHarmonyEnv.__loaded || (loadHarmonyEnv.__loaded = !0, container.load(harmonyEnvModule), container.load(harmonyCanvasModule), container.load(harmonyWindowModule), loadPicker && loadMathPicker(container));
|
|
28132
27826
|
}
|
|
28133
27827
|
loadHarmonyEnv.__loaded = !1;
|
|
@@ -28685,65 +28379,48 @@
|
|
|
28685
28379
|
_registerText.__loaded = !1;
|
|
28686
28380
|
const registerText = _registerText;
|
|
28687
28381
|
|
|
28688
|
-
function pseudoRandom(n) {
|
|
28689
|
-
let seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28382
|
+
function pseudoRandom(n, seed = 0) {
|
|
28690
28383
|
let hash = 3735928559 ^ seed;
|
|
28691
28384
|
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;
|
|
28692
28385
|
}
|
|
28693
|
-
function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28694
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28695
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28386
|
+
function randomOpacity(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28696
28387
|
const targetRandomValue = 2 * pseudoRandom(row * columnCount + column) * Math.PI,
|
|
28697
28388
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI + targetRandomValue) + 1) / 2;
|
|
28698
28389
|
return Math.min(1, Math.max(0, _r));
|
|
28699
28390
|
}
|
|
28700
|
-
function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28701
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28702
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28391
|
+
function columnLeftToRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28703
28392
|
const delay = column / columnCount,
|
|
28704
28393
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28705
28394
|
return Math.min(1, Math.max(0, _r));
|
|
28706
28395
|
}
|
|
28707
|
-
function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28708
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28709
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28396
|
+
function columnRightToLeft(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28710
28397
|
const delay = (columnCount - 1 - column) / columnCount,
|
|
28711
28398
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28712
28399
|
return Math.min(1, Math.max(0, _r));
|
|
28713
28400
|
}
|
|
28714
|
-
function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28715
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28716
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28401
|
+
function rowTopToBottom(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28717
28402
|
const delay = row / rowCount,
|
|
28718
28403
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28719
28404
|
return Math.min(1, Math.max(0, _r));
|
|
28720
28405
|
}
|
|
28721
|
-
function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28722
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28723
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28406
|
+
function rowBottomToTop(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28724
28407
|
const delay = (rowCount - 1 - row) / rowCount,
|
|
28725
28408
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28726
28409
|
return Math.min(1, Math.max(0, _r));
|
|
28727
28410
|
}
|
|
28728
|
-
function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28729
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28730
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28411
|
+
function diagonalCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28731
28412
|
const centerRow = rowCount / 2,
|
|
28732
28413
|
centerCol = columnCount / 2,
|
|
28733
28414
|
distance = Math.sqrt(Math.pow((row - centerRow) / rowCount, 2) + Math.pow((column - centerCol) / columnCount, 2)),
|
|
28734
28415
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28735
28416
|
return Math.min(1, Math.max(0, _r));
|
|
28736
28417
|
}
|
|
28737
|
-
function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28738
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28739
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28418
|
+
function diagonalTopLeftToBottomRight(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28740
28419
|
const delay = (row / rowCount + column / columnCount) / 2,
|
|
28741
28420
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28742
28421
|
return Math.min(1, Math.max(0, _r));
|
|
28743
28422
|
}
|
|
28744
|
-
function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28745
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28746
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28423
|
+
function rotationScan(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28747
28424
|
const centerRow = rowCount / 2,
|
|
28748
28425
|
centerCol = columnCount / 2,
|
|
28749
28426
|
angle = Math.atan2(row - centerRow, column - centerCol),
|
|
@@ -28751,33 +28428,25 @@
|
|
|
28751
28428
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * delay * Math.PI) + 1) / 2;
|
|
28752
28429
|
return Math.min(1, Math.max(0, _r));
|
|
28753
28430
|
}
|
|
28754
|
-
function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28755
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28756
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28431
|
+
function rippleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28757
28432
|
const centerRow = rowCount / 2,
|
|
28758
28433
|
centerCol = columnCount / 2,
|
|
28759
28434
|
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)),
|
|
28760
28435
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI * 3 - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28761
28436
|
return Math.min(1, Math.max(0, _r));
|
|
28762
28437
|
}
|
|
28763
|
-
function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28764
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28765
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28438
|
+
function snakeWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28766
28439
|
const delay = (row + column) % (rowCount + columnCount) / (rowCount + columnCount),
|
|
28767
28440
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
|
|
28768
28441
|
return Math.min(1, Math.max(0, _r));
|
|
28769
28442
|
}
|
|
28770
|
-
function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28771
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28772
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28443
|
+
function alternatingWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28773
28444
|
const rowPhase = row / rowCount,
|
|
28774
28445
|
colPhase = column / columnCount,
|
|
28775
28446
|
_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;
|
|
28776
28447
|
return Math.min(1, Math.max(0, _r));
|
|
28777
28448
|
}
|
|
28778
|
-
function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28779
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28780
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28449
|
+
function spiralEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28781
28450
|
const centerRow = rowCount / 2,
|
|
28782
28451
|
centerCol = columnCount / 2,
|
|
28783
28452
|
distance = Math.sqrt(Math.pow(row - centerRow, 2) + Math.pow(column - centerCol, 2)),
|
|
@@ -28786,41 +28455,31 @@
|
|
|
28786
28455
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 4 * delay * Math.PI) + 1) / 2;
|
|
28787
28456
|
return Math.min(1, Math.max(0, _r));
|
|
28788
28457
|
}
|
|
28789
|
-
function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28790
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28791
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28458
|
+
function columnCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28792
28459
|
const centerCol = columnCount / 2,
|
|
28793
28460
|
distance = Math.abs(column - centerCol) / centerCol,
|
|
28794
28461
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28795
28462
|
return Math.min(1, Math.max(0, _r));
|
|
28796
28463
|
}
|
|
28797
|
-
function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28798
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28799
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28464
|
+
function columnEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28800
28465
|
const centerCol = columnCount / 2,
|
|
28801
28466
|
distance = 1 - Math.abs(column - centerCol) / centerCol,
|
|
28802
28467
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28803
28468
|
return Math.min(1, Math.max(0, _r));
|
|
28804
28469
|
}
|
|
28805
|
-
function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28806
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28807
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28470
|
+
function rowCenterToEdge(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28808
28471
|
const centerRow = rowCount / 2,
|
|
28809
28472
|
distance = Math.abs(row - centerRow) / centerRow,
|
|
28810
28473
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28811
28474
|
return Math.min(1, Math.max(0, _r));
|
|
28812
28475
|
}
|
|
28813
|
-
function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28814
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28815
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28476
|
+
function rowEdgeToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28816
28477
|
const centerRow = rowCount / 2,
|
|
28817
28478
|
distance = 1 - Math.abs(row - centerRow) / centerRow,
|
|
28818
28479
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * distance * Math.PI) + 1) / 2;
|
|
28819
28480
|
return Math.min(1, Math.max(0, _r));
|
|
28820
28481
|
}
|
|
28821
|
-
function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28822
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28823
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28482
|
+
function cornerToCenter(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28824
28483
|
const centerRow = rowCount / 2,
|
|
28825
28484
|
centerCol = columnCount / 2,
|
|
28826
28485
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28828,9 +28487,7 @@
|
|
|
28828
28487
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28829
28488
|
return Math.min(1, Math.max(0, _r));
|
|
28830
28489
|
}
|
|
28831
|
-
function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28832
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28833
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28490
|
+
function centerToCorner(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28834
28491
|
const centerRow = rowCount / 2,
|
|
28835
28492
|
centerCol = columnCount / 2,
|
|
28836
28493
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28838,9 +28495,7 @@
|
|
|
28838
28495
|
_r = minRatio + amplitude * (Math.sin(2 * ratio * Math.PI - 2 * normalizedDistance * Math.PI) + 1) / 2;
|
|
28839
28496
|
return Math.min(1, Math.max(0, _r));
|
|
28840
28497
|
}
|
|
28841
|
-
function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28842
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28843
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28498
|
+
function pulseWave(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28844
28499
|
const centerRow = rowCount / 2,
|
|
28845
28500
|
centerCol = columnCount / 2,
|
|
28846
28501
|
distance = Math.sqrt(Math.pow((row - centerRow) / centerRow, 2) + Math.pow((column - centerCol) / centerCol, 2)),
|
|
@@ -28850,9 +28505,7 @@
|
|
|
28850
28505
|
_r = minRatio + amplitude * ((Math.sin(wavePhase - 4 * normalizedDistance * Math.PI) + 1) / 2) * (.7 * decay + .3);
|
|
28851
28506
|
return Math.min(1, Math.max(0, _r));
|
|
28852
28507
|
}
|
|
28853
|
-
function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic) {
|
|
28854
|
-
let minRatio = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 0;
|
|
28855
|
-
let amplitude = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
|
|
28508
|
+
function particleEffect(ctx, row, column, rowCount, columnCount, ratio, graphic, minRatio = 0, amplitude = 1) {
|
|
28856
28509
|
const index = row * columnCount + column,
|
|
28857
28510
|
phase = 2 * pseudoRandom(index, 0) * Math.PI,
|
|
28858
28511
|
speed = .5 * pseudoRandom(index, 1) + .5,
|
|
@@ -28995,8 +28648,7 @@
|
|
|
28995
28648
|
}), this._clearDragEvents();
|
|
28996
28649
|
};
|
|
28997
28650
|
}
|
|
28998
|
-
setScrollRange(range) {
|
|
28999
|
-
let render = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
28651
|
+
setScrollRange(range, render = !0) {
|
|
29000
28652
|
const {
|
|
29001
28653
|
direction = "horizontal",
|
|
29002
28654
|
limitRange = [0, 1],
|
|
@@ -29499,8 +29151,7 @@
|
|
|
29499
29151
|
getTextBounds: useNaiveCanvas ? void 0 : getTextBounds,
|
|
29500
29152
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
29501
29153
|
}, null != option ? option : {}), textSpec);
|
|
29502
|
-
function measureTextSize(text, textSpec) {
|
|
29503
|
-
let defaultTextTheme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
29154
|
+
function measureTextSize(text, textSpec, defaultTextTheme = {}) {
|
|
29504
29155
|
if (!text) return {
|
|
29505
29156
|
width: 0,
|
|
29506
29157
|
height: 0
|
|
@@ -29521,12 +29172,10 @@
|
|
|
29521
29172
|
height: bounds.height()
|
|
29522
29173
|
};
|
|
29523
29174
|
}
|
|
29524
|
-
function isRichText(attributes) {
|
|
29525
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29175
|
+
function isRichText(attributes, typeKey = "type") {
|
|
29526
29176
|
return "rich" === getTextType(attributes, typeKey);
|
|
29527
29177
|
}
|
|
29528
|
-
function getTextType(attributes) {
|
|
29529
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29178
|
+
function getTextType(attributes, typeKey = "type") {
|
|
29530
29179
|
var _a, _b;
|
|
29531
29180
|
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";
|
|
29532
29181
|
}
|
|
@@ -29554,8 +29203,7 @@
|
|
|
29554
29203
|
} = text;
|
|
29555
29204
|
return attributes.react = react, attributes.text = _originText, attributes.renderable = !1, attributes;
|
|
29556
29205
|
}
|
|
29557
|
-
function createTextGraphicByType(textAttributes) {
|
|
29558
|
-
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
29206
|
+
function createTextGraphicByType(textAttributes, typeKey = "type") {
|
|
29559
29207
|
const textType = getTextType(textAttributes, typeKey);
|
|
29560
29208
|
return "rich" === textType ? graphicCreator.richtext(richTextAttributeTransform(textAttributes)) : ("html" === textType ? textAttributes = htmlAttributeTransform(textAttributes) : "react" === textType && (textAttributes = reactAttributeTransform(textAttributes)), graphicCreator.text(textAttributes));
|
|
29561
29209
|
}
|
|
@@ -30932,14 +30580,12 @@
|
|
|
30932
30580
|
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);
|
|
30933
30581
|
}
|
|
30934
30582
|
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
30935
|
-
function isAngleVertical(angle) {
|
|
30936
|
-
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
30583
|
+
function isAngleVertical(angle, delta = DELTA_ANGLE) {
|
|
30937
30584
|
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
30938
30585
|
cos = hasAngle ? Math.cos(angle) : 1;
|
|
30939
30586
|
return hasAngle && Math.abs(cos) <= delta;
|
|
30940
30587
|
}
|
|
30941
|
-
function isAngleHorizontal(angle) {
|
|
30942
|
-
let delta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DELTA_ANGLE;
|
|
30588
|
+
function isAngleHorizontal(angle, delta = DELTA_ANGLE) {
|
|
30943
30589
|
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
30944
30590
|
sin = hasAngle ? Math.sin(angle) : 0;
|
|
30945
30591
|
return !hasAngle || Math.abs(sin) <= delta;
|
|
@@ -30951,8 +30597,7 @@
|
|
|
30951
30597
|
y: tickPosition.y + tickVector[1]
|
|
30952
30598
|
};
|
|
30953
30599
|
}
|
|
30954
|
-
function getAxisBreakSymbolAttrs() {
|
|
30955
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30600
|
+
function getAxisBreakSymbolAttrs(props = {}) {
|
|
30956
30601
|
var _a, _b;
|
|
30957
30602
|
const {
|
|
30958
30603
|
style = {},
|
|
@@ -30977,9 +30622,7 @@
|
|
|
30977
30622
|
y: point.y + vector[1]
|
|
30978
30623
|
};
|
|
30979
30624
|
}
|
|
30980
|
-
function getCircleVerticalVector(offset, point, center) {
|
|
30981
|
-
let inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
30982
|
-
let axisInside = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
30625
|
+
function getCircleVerticalVector(offset, point, center, inside = !1, axisInside = !1) {
|
|
30983
30626
|
const vector = [point.x - center.x, point.y - center.y];
|
|
30984
30627
|
return scale(vector, (inside ? -1 : 1) * (axisInside ? -1 : 1) * offset / length(vector));
|
|
30985
30628
|
}
|
|
@@ -31389,7 +31032,7 @@
|
|
|
31389
31032
|
var _a;
|
|
31390
31033
|
if ("group" !== el.type && el.id) {
|
|
31391
31034
|
const oldEl = prevInnerView[el.id];
|
|
31392
|
-
if (el.
|
|
31035
|
+
if (el.setFinalAttributes(el.attribute), oldEl) {
|
|
31393
31036
|
oldEl.release();
|
|
31394
31037
|
const oldAttrs = oldEl.attribute,
|
|
31395
31038
|
finalAttrs = el.getFinalAttribute(),
|
|
@@ -31457,8 +31100,7 @@
|
|
|
31457
31100
|
function reset$1(items) {
|
|
31458
31101
|
return items.forEach(item => item.setAttribute("opacity", 1)), items;
|
|
31459
31102
|
}
|
|
31460
|
-
function forceItemVisible$1(sourceItem, items, check, comparator) {
|
|
31461
|
-
let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
31103
|
+
function forceItemVisible$1(sourceItem, items, check, comparator, inverse = !1) {
|
|
31462
31104
|
if (check && !sourceItem.attribute.opacity) {
|
|
31463
31105
|
const remainLength = items.length;
|
|
31464
31106
|
if (remainLength > 1) {
|
|
@@ -31486,10 +31128,7 @@
|
|
|
31486
31128
|
do {
|
|
31487
31129
|
items = reduce(items, sep);
|
|
31488
31130
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
31489
|
-
const shouldCheck =
|
|
31490
|
-
let checkLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
31491
|
-
return checkLength && length < 3 || visibility;
|
|
31492
|
-
},
|
|
31131
|
+
const shouldCheck = (length, visibility, checkLength = !0) => checkLength && length < 3 || visibility,
|
|
31493
31132
|
checkFirst = shouldCheck(items.length, config.firstVisible, !1);
|
|
31494
31133
|
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
31495
31134
|
const firstSourceItem = source[0],
|
|
@@ -31524,8 +31163,7 @@
|
|
|
31524
31163
|
function tryRotate(orient, items) {
|
|
31525
31164
|
"bottom" !== orient && "top" !== orient || rotateXAxis(orient, items), "left" !== orient && "right" !== orient || rotateYAxis(orient, items), genRotateBounds(items);
|
|
31526
31165
|
}
|
|
31527
|
-
function clampAngle() {
|
|
31528
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
31166
|
+
function clampAngle(angle = 0) {
|
|
31529
31167
|
if (angle < 0) for (; angle < 0;) angle += 2 * Math.PI;
|
|
31530
31168
|
if (angle > 0) for (; angle >= 2 * Math.PI;) angle -= 2 * Math.PI;
|
|
31531
31169
|
return angle;
|
|
@@ -31544,8 +31182,7 @@
|
|
|
31544
31182
|
}));
|
|
31545
31183
|
});
|
|
31546
31184
|
}
|
|
31547
|
-
function getXAxisLabelAlign(orient) {
|
|
31548
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
31185
|
+
function getXAxisLabelAlign(orient, angle = 0) {
|
|
31549
31186
|
let align = ["center", "left", "left", "left", "center", "right", "right", "right", "left"],
|
|
31550
31187
|
baseline = ["top", "top", "middle", "bottom", "bottom", "bottom", "middle", "top", "top"];
|
|
31551
31188
|
"top" === orient && (align = ["center", "right", "right", "right", "center", "left", "left", "left", "right"], baseline = ["bottom", "bottom", "middle", "top", "top", "top", "middle", "bottom", "bottom"]);
|
|
@@ -31556,8 +31193,7 @@
|
|
|
31556
31193
|
textBaseline: baseline[index]
|
|
31557
31194
|
};
|
|
31558
31195
|
}
|
|
31559
|
-
function getYAxisLabelAlign(orient) {
|
|
31560
|
-
let angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
31196
|
+
function getYAxisLabelAlign(orient, angle = 0) {
|
|
31561
31197
|
let align = ["right", "right", "center", "left", "left", "left", "center", "right", "right"],
|
|
31562
31198
|
baseline = ["middle", "middle", "top", "top", "middle", "middle", "bottom", "bottom", "middle"];
|
|
31563
31199
|
"right" === orient && (align = ["left", "left", "center", "right", "right", "right", "center", "left", "left"], baseline = ["middle", "middle", "bottom", "bottom", "middle", "middle", "top", "middle", "middle"]);
|
|
@@ -31735,8 +31371,7 @@
|
|
|
31735
31371
|
} = this.attribute;
|
|
31736
31372
|
return [end.x - start.x, end.y - start.y];
|
|
31737
31373
|
}
|
|
31738
|
-
getVerticalVector(offset) {
|
|
31739
|
-
let inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
31374
|
+
getVerticalVector(offset, inside = !1, point) {
|
|
31740
31375
|
const {
|
|
31741
31376
|
verticalFactor = 1
|
|
31742
31377
|
} = this.attribute,
|
|
@@ -31955,9 +31590,10 @@
|
|
|
31955
31590
|
function noop() {}
|
|
31956
31591
|
class Step {
|
|
31957
31592
|
constructor(type, props, duration, easing) {
|
|
31593
|
+
var _a;
|
|
31958
31594
|
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
31959
31595
|
this.target.setAttributes(this.target.attribute);
|
|
31960
|
-
}, 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;
|
|
31596
|
+
}, 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;
|
|
31961
31597
|
}
|
|
31962
31598
|
bind(target, animate) {
|
|
31963
31599
|
this.target = target, this.animate = animate, this.onBind(), this.syncAttributeUpdate();
|
|
@@ -31974,8 +31610,7 @@
|
|
|
31974
31610
|
getLastProps() {
|
|
31975
31611
|
return this.prev ? this.prev.props || {} : this.animate.getStartProps();
|
|
31976
31612
|
}
|
|
31977
|
-
setDuration(duration) {
|
|
31978
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31613
|
+
setDuration(duration, updateDownstream = !0) {
|
|
31979
31614
|
this.duration = duration, updateDownstream && this.updateDownstreamStartTimes();
|
|
31980
31615
|
}
|
|
31981
31616
|
getDuration() {
|
|
@@ -31996,8 +31631,7 @@
|
|
|
31996
31631
|
} else interpolateUpdateStore[key] ? funcs.push(interpolateUpdateStore[key]) : funcs.push(commonInterpolateUpdate);
|
|
31997
31632
|
}), this.interpolateUpdateFunctions = funcs;
|
|
31998
31633
|
}
|
|
31999
|
-
setStartTime(time) {
|
|
32000
|
-
let updateDownstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31634
|
+
setStartTime(time, updateDownstream = !0) {
|
|
32001
31635
|
this._startTime = time, updateDownstream && this.updateDownstreamStartTimes();
|
|
32002
31636
|
}
|
|
32003
31637
|
getStartTime() {
|
|
@@ -32123,8 +31757,7 @@
|
|
|
32123
31757
|
animate.release();
|
|
32124
31758
|
}), this.head = null, this.tail = null, this.animateMap.clear(), this._animateCount = 0, this._totalDuration = 0;
|
|
32125
31759
|
}
|
|
32126
|
-
removeAnimate(animate) {
|
|
32127
|
-
let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
31760
|
+
removeAnimate(animate, release = !0) {
|
|
32128
31761
|
const node = this.animateMap.get(animate);
|
|
32129
31762
|
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());
|
|
32130
31763
|
}
|
|
@@ -32162,10 +31795,7 @@
|
|
|
32162
31795
|
defaultTimeline.isGlobal = !0;
|
|
32163
31796
|
|
|
32164
31797
|
class Animate {
|
|
32165
|
-
constructor() {
|
|
32166
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
32167
|
-
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
32168
|
-
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
31798
|
+
constructor(id = Generator.GenAutoIncrementId(), timeline = defaultTimeline, slience) {
|
|
32169
31799
|
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;
|
|
32170
31800
|
}
|
|
32171
31801
|
getStartProps() {
|
|
@@ -32186,9 +31816,7 @@
|
|
|
32186
31816
|
bind(target) {
|
|
32187
31817
|
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
32188
31818
|
}
|
|
32189
|
-
to(props) {
|
|
32190
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
32191
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
31819
|
+
to(props, duration = 300, easing = "linear") {
|
|
32192
31820
|
const step = new Step(AnimateStepType.to, props, duration, easing);
|
|
32193
31821
|
return step.bind(this.target, this), this.updateStepAfterAppend(step), this;
|
|
32194
31822
|
}
|
|
@@ -32218,9 +31846,7 @@
|
|
|
32218
31846
|
this._endProps[key] = currentStep.props[key];
|
|
32219
31847
|
}), currentStep = currentStep.next;
|
|
32220
31848
|
}
|
|
32221
|
-
from(props) {
|
|
32222
|
-
let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
32223
|
-
let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "linear";
|
|
31849
|
+
from(props, duration = 300, easing = "linear") {
|
|
32224
31850
|
const step = new Step(AnimateStepType.from, props, duration, easing);
|
|
32225
31851
|
return this._firstStep ? (this._lastStep.append(step), this._lastStep = step) : (this._firstStep = step, this._lastStep = step), this.updateDuration(), this;
|
|
32226
31852
|
}
|
|
@@ -32458,8 +32084,7 @@
|
|
|
32458
32084
|
}
|
|
32459
32085
|
return !1;
|
|
32460
32086
|
}
|
|
32461
|
-
start() {
|
|
32462
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32087
|
+
start(force = !1) {
|
|
32463
32088
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
32464
32089
|
if (!this.tickerHandler) return !1;
|
|
32465
32090
|
if (!force) {
|
|
@@ -32520,8 +32145,7 @@
|
|
|
32520
32145
|
tickAt(time) {
|
|
32521
32146
|
this.tickTo(time);
|
|
32522
32147
|
}
|
|
32523
|
-
start() {
|
|
32524
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32148
|
+
start(force = !1) {
|
|
32525
32149
|
if (this.status === STATUS$1.RUNNING) return !1;
|
|
32526
32150
|
if (!this.tickerHandler) return !1;
|
|
32527
32151
|
if (!force) {
|
|
@@ -32867,14 +32491,10 @@
|
|
|
32867
32491
|
var _a, _b;
|
|
32868
32492
|
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;
|
|
32869
32493
|
}
|
|
32870
|
-
executeItem(params, graphic) {
|
|
32871
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
32872
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
32494
|
+
executeItem(params, graphic, index = 0, count = 1) {
|
|
32873
32495
|
return Array.isArray(params) ? params.map(param => this._executeItem(param, graphic, index, count)).filter(Boolean) : [this._executeItem(params, graphic, index, count)].filter(Boolean);
|
|
32874
32496
|
}
|
|
32875
|
-
_executeItem(params, graphic) {
|
|
32876
|
-
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
32877
|
-
let count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
32497
|
+
_executeItem(params, graphic, index = 0, count = 1) {
|
|
32878
32498
|
if (!graphic) return null;
|
|
32879
32499
|
const isTimeline = ("timeSlices" in params);
|
|
32880
32500
|
let animate = null;
|
|
@@ -33042,8 +32662,7 @@
|
|
|
33042
32662
|
}
|
|
33043
32663
|
|
|
33044
32664
|
class AnimateExtension {
|
|
33045
|
-
getAttributes() {
|
|
33046
|
-
let final = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
32665
|
+
getAttributes(final = !1) {
|
|
33047
32666
|
return final && this.finalAttribute ? this.finalAttribute : this.attribute;
|
|
33048
32667
|
}
|
|
33049
32668
|
animate(params) {
|
|
@@ -33068,10 +32687,10 @@
|
|
|
33068
32687
|
createTicker(stage) {
|
|
33069
32688
|
return new DefaultTicker(stage);
|
|
33070
32689
|
}
|
|
33071
|
-
|
|
32690
|
+
setFinalAttributes(finalAttribute) {
|
|
33072
32691
|
this.finalAttribute || (this.finalAttribute = {}), Object.assign(this.finalAttribute, finalAttribute);
|
|
33073
32692
|
}
|
|
33074
|
-
|
|
32693
|
+
initFinalAttributes(finalAttribute) {
|
|
33075
32694
|
this.finalAttribute = finalAttribute;
|
|
33076
32695
|
}
|
|
33077
32696
|
initAnimateExecutor() {
|
|
@@ -33088,8 +32707,7 @@
|
|
|
33088
32707
|
getFinalAttribute() {
|
|
33089
32708
|
return this.finalAttribute;
|
|
33090
32709
|
}
|
|
33091
|
-
getGraphicAttribute(key) {
|
|
33092
|
-
let prev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
32710
|
+
getGraphicAttribute(key, prev = !1) {
|
|
33093
32711
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
33094
32712
|
}
|
|
33095
32713
|
}
|
|
@@ -33722,8 +33340,7 @@
|
|
|
33722
33340
|
var _a, _b;
|
|
33723
33341
|
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";
|
|
33724
33342
|
}
|
|
33725
|
-
getPoints(attribute) {
|
|
33726
|
-
let cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
33343
|
+
getPoints(attribute, cache = !1) {
|
|
33727
33344
|
if (attribute.points) return attribute.points;
|
|
33728
33345
|
if (attribute.segments) {
|
|
33729
33346
|
const points = [];
|
|
@@ -36111,9 +35728,9 @@
|
|
|
36111
35728
|
const {
|
|
36112
35729
|
options: options
|
|
36113
35730
|
} = this.params;
|
|
36114
|
-
(null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) &&
|
|
35731
|
+
diffAttrs = Object.assign({}, diffAttrs), (null === (_b = null == options ? void 0 : options.excludeChannels) || void 0 === _b ? void 0 : _b.length) && options.excludeChannels.forEach(channel => {
|
|
36115
35732
|
delete diffAttrs[channel];
|
|
36116
|
-
})
|
|
35733
|
+
}), this.props = diffAttrs;
|
|
36117
35734
|
}
|
|
36118
35735
|
update(end, ratio, out) {
|
|
36119
35736
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -37072,9 +36689,7 @@
|
|
|
37072
36689
|
} = this.attribute;
|
|
37073
36690
|
return polarToCartesian(center, inside && innerRadius > 0 ? innerRadius : radius, startAngle + (endAngle - startAngle) * tickValue);
|
|
37074
36691
|
}
|
|
37075
|
-
getVerticalVector(offset) {
|
|
37076
|
-
let inside = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
37077
|
-
let point = arguments.length > 2 ? arguments[2] : undefined;
|
|
36692
|
+
getVerticalVector(offset, inside = !1, point) {
|
|
37078
36693
|
return getCircleVerticalVector(offset, point, this.attribute.center, inside, this.attribute.inside);
|
|
37079
36694
|
}
|
|
37080
36695
|
getRelativeVector(point) {
|
|
@@ -37352,8 +36967,7 @@
|
|
|
37352
36967
|
index: index,
|
|
37353
36968
|
value: t
|
|
37354
36969
|
}));
|
|
37355
|
-
const labelOverlap =
|
|
37356
|
-
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
36970
|
+
const labelOverlap = (prevLabel, nextLabel, gap = 0) => {
|
|
37357
36971
|
const prevBounds = new AABBBounds(prevLabel).expand(gap / 2),
|
|
37358
36972
|
nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
|
|
37359
36973
|
return prevBounds.intersects(nextBounds);
|
|
@@ -37501,8 +37115,7 @@
|
|
|
37501
37115
|
x1 = newDomain[endIndex];
|
|
37502
37116
|
return x1 < x0 && ([startIndex, endIndex] = [endIndex, startIndex], [x0, x1] = [x1, x0]), newDomain[startIndex] = options.floor(x0), newDomain[endIndex] = options.ceil(x1), newDomain;
|
|
37503
37117
|
};
|
|
37504
|
-
const niceNumber =
|
|
37505
|
-
let round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
37118
|
+
const niceNumber = (value, round = !1) => {
|
|
37506
37119
|
const exponent = Math.floor(Math.log10(value)),
|
|
37507
37120
|
fraction = value / Math.pow(10, exponent);
|
|
37508
37121
|
let niceFraction;
|
|
@@ -37742,22 +37355,19 @@
|
|
|
37742
37355
|
rangeRound(_, slience) {
|
|
37743
37356
|
return this._range = [toNumber(_[0]), toNumber(_[1])], this._round = !0, this.rescale(slience);
|
|
37744
37357
|
}
|
|
37745
|
-
ticks() {
|
|
37746
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37358
|
+
ticks(count = 10) {
|
|
37747
37359
|
const d = this.calculateVisibleDomain(this._range);
|
|
37748
37360
|
if (-1 === count) return d;
|
|
37749
37361
|
return ticks$1(0, d.length - 1, count, !1).map(i => d[i]);
|
|
37750
37362
|
}
|
|
37751
|
-
tickData() {
|
|
37752
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37363
|
+
tickData(count = 10) {
|
|
37753
37364
|
return this.ticks(count).map((tick, index) => ({
|
|
37754
37365
|
index: index,
|
|
37755
37366
|
tick: tick,
|
|
37756
37367
|
value: (this.scale(tick) - this._range[0] + this._bandwidth / 2) / (this._range[1] - this._range[0])
|
|
37757
37368
|
}));
|
|
37758
37369
|
}
|
|
37759
|
-
forceTicks() {
|
|
37760
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37370
|
+
forceTicks(count = 10) {
|
|
37761
37371
|
const d = this.calculateVisibleDomain(this._range);
|
|
37762
37372
|
return ticks$1(0, d.length - 1, count, !0).filter(i => i < d.length).map(i => d[i]);
|
|
37763
37373
|
}
|
|
@@ -37853,9 +37463,7 @@
|
|
|
37853
37463
|
}
|
|
37854
37464
|
|
|
37855
37465
|
class ContinuousScale extends BaseScale {
|
|
37856
|
-
constructor() {
|
|
37857
|
-
let transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : identity;
|
|
37858
|
-
let untransformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
37466
|
+
constructor(transformer = identity, untransformer = identity) {
|
|
37859
37467
|
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;
|
|
37860
37468
|
}
|
|
37861
37469
|
calculateVisibleDomain(range) {
|
|
@@ -37917,11 +37525,10 @@
|
|
|
37917
37525
|
interpolate(_, slience) {
|
|
37918
37526
|
return arguments.length ? (this._interpolate = _, this.rescale(slience)) : this._interpolate;
|
|
37919
37527
|
}
|
|
37920
|
-
ticks() {
|
|
37528
|
+
ticks(count = 10) {
|
|
37921
37529
|
return [];
|
|
37922
37530
|
}
|
|
37923
|
-
tickData() {
|
|
37924
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37531
|
+
tickData(count = 10) {
|
|
37925
37532
|
const ticks = this.ticks(count);
|
|
37926
37533
|
return (null != ticks ? ticks : []).map((tick, index) => ({
|
|
37927
37534
|
index: index,
|
|
@@ -38075,8 +37682,7 @@
|
|
|
38075
37682
|
for (; ++i < count;) ticks[i] = start + i * step;
|
|
38076
37683
|
return reverse && ticks.reverse(), ticks;
|
|
38077
37684
|
}
|
|
38078
|
-
function niceLinear(d) {
|
|
38079
|
-
let count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
37685
|
+
function niceLinear(d, count = 10) {
|
|
38080
37686
|
let prestep,
|
|
38081
37687
|
step,
|
|
38082
37688
|
i0 = 0,
|
|
@@ -38163,15 +37769,11 @@
|
|
|
38163
37769
|
tickFormat() {
|
|
38164
37770
|
return () => {};
|
|
38165
37771
|
}
|
|
38166
|
-
d3Ticks() {
|
|
38167
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38168
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37772
|
+
d3Ticks(count = 10, options) {
|
|
38169
37773
|
const d = this.calculateVisibleDomain(this._range);
|
|
38170
37774
|
return d3Ticks(d[0], d[d.length - 1], count, options);
|
|
38171
37775
|
}
|
|
38172
|
-
ticks() {
|
|
38173
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38174
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37776
|
+
ticks(count = 10, options) {
|
|
38175
37777
|
var _a;
|
|
38176
37778
|
if (isFunction$1(null == options ? void 0 : options.customTicks)) return options.customTicks(this, count);
|
|
38177
37779
|
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);
|
|
@@ -38191,8 +37793,7 @@
|
|
|
38191
37793
|
}
|
|
38192
37794
|
return ticksResult;
|
|
38193
37795
|
}
|
|
38194
|
-
forceTicks() {
|
|
38195
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37796
|
+
forceTicks(count = 10) {
|
|
38196
37797
|
const d = this.calculateVisibleDomain(this._range);
|
|
38197
37798
|
return forceTicks(d[0], d[d.length - 1], count);
|
|
38198
37799
|
}
|
|
@@ -38200,9 +37801,7 @@
|
|
|
38200
37801
|
const d = this.calculateVisibleDomain(this._range);
|
|
38201
37802
|
return stepTicks(d[0], d[d.length - 1], step);
|
|
38202
37803
|
}
|
|
38203
|
-
nice() {
|
|
38204
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38205
|
-
let option = arguments.length > 1 ? arguments[1] : undefined;
|
|
37804
|
+
nice(count = 10, option) {
|
|
38206
37805
|
var _a, _b;
|
|
38207
37806
|
const originalDomain = this._domain;
|
|
38208
37807
|
let niceMinMax = [];
|
|
@@ -38216,15 +37815,13 @@
|
|
|
38216
37815
|
}
|
|
38217
37816
|
return this;
|
|
38218
37817
|
}
|
|
38219
|
-
niceMin() {
|
|
38220
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37818
|
+
niceMin(count = 10) {
|
|
38221
37819
|
this._niceType = "min";
|
|
38222
37820
|
const maxD = this._domain[this._domain.length - 1],
|
|
38223
37821
|
niceDomain = niceLinear(this.domain(), count);
|
|
38224
37822
|
return niceDomain && (niceDomain[niceDomain.length - 1] = maxD, this._niceDomain = niceDomain, this.rescale()), this;
|
|
38225
37823
|
}
|
|
38226
|
-
niceMax() {
|
|
38227
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37824
|
+
niceMax(count = 10) {
|
|
38228
37825
|
this._niceType = "max";
|
|
38229
37826
|
const minD = this._domain[0],
|
|
38230
37827
|
niceDomain = niceLinear(this._domain.slice(), count);
|
|
@@ -38233,8 +37830,7 @@
|
|
|
38233
37830
|
}
|
|
38234
37831
|
|
|
38235
37832
|
class LogNiceMixin {
|
|
38236
|
-
nice() {
|
|
38237
|
-
let option = arguments.length > 1 ? arguments[1] : undefined;
|
|
37833
|
+
nice(count = 10, option) {
|
|
38238
37834
|
var _b, _c, _d, _e;
|
|
38239
37835
|
const originalDomain = this._domain;
|
|
38240
37836
|
let niceMinMax = [],
|
|
@@ -38269,12 +37865,10 @@
|
|
|
38269
37865
|
function reflect(f) {
|
|
38270
37866
|
return x => -f(-x);
|
|
38271
37867
|
}
|
|
38272
|
-
function limitPositiveZero() {
|
|
38273
|
-
let min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.EPSILON;
|
|
37868
|
+
function limitPositiveZero(min = Number.EPSILON) {
|
|
38274
37869
|
return x => Math.max(x, min);
|
|
38275
37870
|
}
|
|
38276
|
-
function limitNegativeZero() {
|
|
38277
|
-
let min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.EPSILON;
|
|
37871
|
+
function limitNegativeZero(min = Number.EPSILON) {
|
|
38278
37872
|
return x => Math.min(x, -min);
|
|
38279
37873
|
}
|
|
38280
37874
|
class LogScale extends ContinuousScale {
|
|
@@ -38305,21 +37899,17 @@
|
|
|
38305
37899
|
tickFormat() {
|
|
38306
37900
|
return identity;
|
|
38307
37901
|
}
|
|
38308
|
-
d3Ticks() {
|
|
38309
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38310
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37902
|
+
d3Ticks(count = 10, options) {
|
|
38311
37903
|
const d = this.domain(),
|
|
38312
37904
|
u = this._limit(d[0]),
|
|
38313
37905
|
v = this._limit(d[d.length - 1]);
|
|
38314
37906
|
return d3TicksForLog(u, v, count, this._base, this.transformer, this.untransformer, options);
|
|
38315
37907
|
}
|
|
38316
|
-
ticks() {
|
|
38317
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37908
|
+
ticks(count = 10) {
|
|
38318
37909
|
const d = this.calculateVisibleDomain(this._range);
|
|
38319
37910
|
return ticksBaseTransform(this._limit(d[0]), this._limit(d[d.length - 1]), count, this._base, this.transformer, this.untransformer);
|
|
38320
37911
|
}
|
|
38321
|
-
forceTicks() {
|
|
38322
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37912
|
+
forceTicks(count = 10) {
|
|
38323
37913
|
const d = this.calculateVisibleDomain(this._range);
|
|
38324
37914
|
return forceTicksBaseTransform(d[0], d[d.length - 1], count, this.transformer, this.untransformer);
|
|
38325
37915
|
}
|
|
@@ -38361,21 +37951,17 @@
|
|
|
38361
37951
|
constant(_, slience) {
|
|
38362
37952
|
return arguments.length ? (this._const = _, this.transformer = symlog(_), this.untransformer = symexp(_), this.rescale(slience)) : this._const;
|
|
38363
37953
|
}
|
|
38364
|
-
d3Ticks() {
|
|
38365
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
38366
|
-
let options = arguments.length > 1 ? arguments[1] : undefined;
|
|
37954
|
+
d3Ticks(count = 10, options) {
|
|
38367
37955
|
const d = this.domain(),
|
|
38368
37956
|
u = d[0],
|
|
38369
37957
|
v = d[d.length - 1];
|
|
38370
37958
|
return d3TicksForLog(u, v, count, this._const, this.transformer, this.untransformer, options);
|
|
38371
37959
|
}
|
|
38372
|
-
ticks() {
|
|
38373
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37960
|
+
ticks(count = 10) {
|
|
38374
37961
|
const d = this.calculateVisibleDomain(this._range);
|
|
38375
37962
|
return ticksBaseTransform(d[0], d[d.length - 1], count, this._const, this.transformer, this.untransformer);
|
|
38376
37963
|
}
|
|
38377
|
-
forceTicks() {
|
|
38378
|
-
let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;
|
|
37964
|
+
forceTicks(count = 10) {
|
|
38379
37965
|
const d = this.calculateVisibleDomain(this._range);
|
|
38380
37966
|
return forceTicksBaseTransform(d[0], d[d.length - 1], count, this.transformer, this.untransformer);
|
|
38381
37967
|
}
|
|
@@ -38431,8 +38017,7 @@
|
|
|
38431
38017
|
} else scaleTicks = getTicks(count);
|
|
38432
38018
|
return scaleTicks;
|
|
38433
38019
|
}
|
|
38434
|
-
function forceItemVisible(sourceItem, items, check, comparator) {
|
|
38435
|
-
let inverse = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
38020
|
+
function forceItemVisible(sourceItem, items, check, comparator, inverse = !1) {
|
|
38436
38021
|
if (check && !items.includes(sourceItem)) {
|
|
38437
38022
|
let remainLength = items.length;
|
|
38438
38023
|
if (remainLength > 1) {
|
|
@@ -38529,10 +38114,7 @@
|
|
|
38529
38114
|
};
|
|
38530
38115
|
|
|
38531
38116
|
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()]),
|
|
38532
|
-
boundsOverlap =
|
|
38533
|
-
let gap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
38534
|
-
return Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38535
|
-
};
|
|
38117
|
+
boundsOverlap = (prevBounds, nextBounds, gap = 0) => Math.max(prevBounds[0], nextBounds[0]) - gap / 2 <= Math.min(prevBounds[1], nextBounds[1]) + gap / 2;
|
|
38536
38118
|
const boundsDistance = (prevBounds, nextBounds) => prevBounds[1] < nextBounds[0] ? nextBounds[0] - prevBounds[1] : nextBounds[1] < prevBounds[0] ? prevBounds[0] - nextBounds[1] : 0;
|
|
38537
38119
|
const linearDiscreteTicks = (scale, op) => {
|
|
38538
38120
|
var _a;
|
|
@@ -38758,13 +38340,12 @@
|
|
|
38758
38340
|
const index = y * w + x;
|
|
38759
38341
|
_clear(index >>> 5, ~(1 << (31 & index)));
|
|
38760
38342
|
},
|
|
38761
|
-
getRange:
|
|
38762
|
-
|
|
38763
|
-
|
|
38764
|
-
|
|
38765
|
-
|
|
38766
|
-
|
|
38767
|
-
} = _ref;
|
|
38343
|
+
getRange: ({
|
|
38344
|
+
x1: x1,
|
|
38345
|
+
y1: y1,
|
|
38346
|
+
x2: x2,
|
|
38347
|
+
y2: y2
|
|
38348
|
+
}) => {
|
|
38768
38349
|
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return !0;
|
|
38769
38350
|
let start,
|
|
38770
38351
|
end,
|
|
@@ -38780,36 +38361,31 @@
|
|
|
38780
38361
|
}
|
|
38781
38362
|
return !1;
|
|
38782
38363
|
},
|
|
38783
|
-
setRange:
|
|
38784
|
-
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
|
|
38788
|
-
|
|
38789
|
-
} = _ref2;
|
|
38364
|
+
setRange: ({
|
|
38365
|
+
x1: x1,
|
|
38366
|
+
y1: y1,
|
|
38367
|
+
x2: x2,
|
|
38368
|
+
y2: y2
|
|
38369
|
+
}) => {
|
|
38790
38370
|
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return;
|
|
38791
38371
|
let start, end, indexStart, indexEnd, i;
|
|
38792
38372
|
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);
|
|
38793
38373
|
},
|
|
38794
|
-
clearRange:
|
|
38795
|
-
|
|
38796
|
-
|
|
38797
|
-
|
|
38798
|
-
|
|
38799
|
-
|
|
38800
|
-
} = _ref3;
|
|
38374
|
+
clearRange: ({
|
|
38375
|
+
x1: x1,
|
|
38376
|
+
y1: y1,
|
|
38377
|
+
x2: x2,
|
|
38378
|
+
y2: y2
|
|
38379
|
+
}) => {
|
|
38801
38380
|
let start, end, indexStart, indexEnd, i;
|
|
38802
38381
|
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);
|
|
38803
38382
|
},
|
|
38804
|
-
outOfBounds:
|
|
38805
|
-
|
|
38806
|
-
|
|
38807
|
-
|
|
38808
|
-
|
|
38809
|
-
|
|
38810
|
-
} = _ref4;
|
|
38811
|
-
return x1 < 0 || y1 < 0 || y2 >= h || x2 >= w;
|
|
38812
|
-
},
|
|
38383
|
+
outOfBounds: ({
|
|
38384
|
+
x1: x1,
|
|
38385
|
+
y1: y1,
|
|
38386
|
+
x2: x2,
|
|
38387
|
+
y2: y2
|
|
38388
|
+
}) => x1 < 0 || y1 < 0 || y2 >= h || x2 >= w,
|
|
38813
38389
|
toImageData: ctx => {
|
|
38814
38390
|
const imageData = ctx.createImageData(w, h),
|
|
38815
38391
|
data = imageData.data;
|
|
@@ -38824,13 +38400,12 @@
|
|
|
38824
38400
|
};
|
|
38825
38401
|
}
|
|
38826
38402
|
|
|
38827
|
-
function bitmapTool(width, height
|
|
38828
|
-
|
|
38829
|
-
|
|
38830
|
-
|
|
38831
|
-
|
|
38832
|
-
|
|
38833
|
-
};
|
|
38403
|
+
function bitmapTool(width, height, padding = {
|
|
38404
|
+
top: 0,
|
|
38405
|
+
left: 0,
|
|
38406
|
+
right: 0,
|
|
38407
|
+
bottom: 0
|
|
38408
|
+
}) {
|
|
38834
38409
|
const {
|
|
38835
38410
|
top = 0,
|
|
38836
38411
|
left = 0,
|
|
@@ -38867,8 +38442,7 @@
|
|
|
38867
38442
|
y2: $.y(_y2)
|
|
38868
38443
|
};
|
|
38869
38444
|
}
|
|
38870
|
-
function boundToRange($, bound) {
|
|
38871
|
-
let clamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
38445
|
+
function boundToRange($, bound, clamp = !1) {
|
|
38872
38446
|
return clamp ? clampRangeByBitmap($, bound) : {
|
|
38873
38447
|
x1: $.x(bound.x1),
|
|
38874
38448
|
x2: $.x(bound.x2),
|
|
@@ -38877,9 +38451,7 @@
|
|
|
38877
38451
|
};
|
|
38878
38452
|
}
|
|
38879
38453
|
|
|
38880
|
-
function canPlace($, bitmap, bound) {
|
|
38881
|
-
let checkBound = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
|
|
38882
|
-
let pad = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
38454
|
+
function canPlace($, bitmap, bound, checkBound = !0, pad = 0) {
|
|
38883
38455
|
let range = bound;
|
|
38884
38456
|
pad > 0 && (range = {
|
|
38885
38457
|
x1: bound.x1 - pad,
|
|
@@ -38890,11 +38462,7 @@
|
|
|
38890
38462
|
const outOfBounds = bitmap.outOfBounds(range);
|
|
38891
38463
|
return (!checkBound || !outOfBounds) && (outOfBounds && (range = clampRangeByBitmap($, range)), !bitmap.getRange(range));
|
|
38892
38464
|
}
|
|
38893
|
-
function placeToCandidates($, bitmap, text) {
|
|
38894
|
-
let candidates = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
38895
|
-
let clampForce = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !0;
|
|
38896
|
-
let pad = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
38897
|
-
let changePosition = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : !1;
|
|
38465
|
+
function placeToCandidates($, bitmap, text, candidates = [], clampForce = !0, pad = 0, changePosition = !1) {
|
|
38898
38466
|
const validCandidates = candidates.filter(candidate => isValid$1(candidate));
|
|
38899
38467
|
for (let i = 0; i < validCandidates.length; i++) {
|
|
38900
38468
|
let measureText;
|
|
@@ -38935,8 +38503,7 @@
|
|
|
38935
38503
|
function defaultLabelPosition(type) {
|
|
38936
38504
|
return "rect" === type ? DefaultRectPositions : DefaultPositions;
|
|
38937
38505
|
}
|
|
38938
|
-
function clampText(text, width, height) {
|
|
38939
|
-
let padding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
38506
|
+
function clampText(text, width, height, padding = {}) {
|
|
38940
38507
|
const {
|
|
38941
38508
|
x1: x1,
|
|
38942
38509
|
x2: x2,
|
|
@@ -39045,9 +38612,7 @@
|
|
|
39045
38612
|
} = boundsB;
|
|
39046
38613
|
return !(ax1 <= bx1 && ax2 <= bx1 || ax1 >= bx2 && ax2 >= bx2 || ay1 <= by1 && ay2 <= by1 || ay1 >= by2 && ay2 >= by2);
|
|
39047
38614
|
}
|
|
39048
|
-
const labelingPoint =
|
|
39049
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
39050
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
38615
|
+
const labelingPoint = (textBounds, graphicBounds, position = "top", offset = 0) => {
|
|
39051
38616
|
if (!textBounds) return;
|
|
39052
38617
|
const {
|
|
39053
38618
|
x1: x1,
|
|
@@ -39113,9 +38678,7 @@
|
|
|
39113
38678
|
}
|
|
39114
38679
|
return points;
|
|
39115
38680
|
};
|
|
39116
|
-
function labelingLineOrArea(textBounds, graphicBounds) {
|
|
39117
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
39118
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
38681
|
+
function labelingLineOrArea(textBounds, graphicBounds, position = "end", offset = 0) {
|
|
39119
38682
|
if (!textBounds || !graphicBounds) return {
|
|
39120
38683
|
x: 1 / 0,
|
|
39121
38684
|
y: 1 / 0
|
|
@@ -39244,7 +38807,7 @@
|
|
|
39244
38807
|
tryPreventConflict() {}
|
|
39245
38808
|
}
|
|
39246
38809
|
function registerLabelAnimate() {
|
|
39247
|
-
AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate), AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
|
|
38810
|
+
AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("labelUpdate", LabelUpdate), AnimateExecutor.registerBuiltInAnimate("labelEnter", LabelEnter);
|
|
39248
38811
|
}
|
|
39249
38812
|
|
|
39250
38813
|
function loadLabelComponent() {
|
|
@@ -39252,11 +38815,7 @@
|
|
|
39252
38815
|
}
|
|
39253
38816
|
|
|
39254
38817
|
const isIntersect = (top, bottom) => Math.ceil(top) > Math.floor(bottom),
|
|
39255
|
-
isXIntersect = (
|
|
39256
|
-
let [a, b] = _ref;
|
|
39257
|
-
let [c, d] = _ref2;
|
|
39258
|
-
return d > a && b > c;
|
|
39259
|
-
};
|
|
38818
|
+
isXIntersect = ([a, b], [c, d]) => d > a && b > c;
|
|
39260
38819
|
function getIntersectionLength(range1, range2) {
|
|
39261
38820
|
const [start1, end1] = range1,
|
|
39262
38821
|
[start2, end2] = range2,
|
|
@@ -39568,8 +39127,7 @@
|
|
|
39568
39127
|
getRelatedGraphic(item) {
|
|
39569
39128
|
return this._idToGraphic.get(item.id);
|
|
39570
39129
|
}
|
|
39571
|
-
_initText() {
|
|
39572
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
39130
|
+
_initText(data = []) {
|
|
39573
39131
|
const {
|
|
39574
39132
|
textStyle = {}
|
|
39575
39133
|
} = this.attribute,
|
|
@@ -39672,8 +39230,7 @@
|
|
|
39672
39230
|
}
|
|
39673
39231
|
return result;
|
|
39674
39232
|
}
|
|
39675
|
-
_processClampForce(text, bmpTool, bitmap) {
|
|
39676
|
-
let overlapPadding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39233
|
+
_processClampForce(text, bmpTool, bitmap, overlapPadding = 0) {
|
|
39677
39234
|
const {
|
|
39678
39235
|
dy = 0,
|
|
39679
39236
|
dx = 0
|
|
@@ -39784,9 +39341,7 @@
|
|
|
39784
39341
|
} = this.attribute;
|
|
39785
39342
|
if (baseMarkGroupName) return this.getRootNode().find(node => node.name === baseMarkGroupName, !0);
|
|
39786
39343
|
}
|
|
39787
|
-
getGraphicBounds(graphic) {
|
|
39788
|
-
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39789
|
-
let position = arguments.length > 2 ? arguments[2] : undefined;
|
|
39344
|
+
getGraphicBounds(graphic, point = {}, position) {
|
|
39790
39345
|
var _a;
|
|
39791
39346
|
if (graphic) {
|
|
39792
39347
|
if (!1 !== graphic.attribute.visible) {
|
|
@@ -39850,25 +39405,16 @@
|
|
|
39850
39405
|
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic,
|
|
39851
39406
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
39852
39407
|
let labelLine;
|
|
39853
|
-
|
|
39854
|
-
|
|
39855
|
-
labelLine: labelLine
|
|
39856
|
-
} : {
|
|
39857
|
-
text: text
|
|
39858
|
-
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
39408
|
+
showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic));
|
|
39409
|
+
const currentLabel = labelLine ? {
|
|
39859
39410
|
text: text,
|
|
39860
39411
|
labelLine: labelLine
|
|
39861
39412
|
} : {
|
|
39862
39413
|
text: text
|
|
39863
|
-
}
|
|
39864
|
-
|
|
39865
|
-
labelLine: labelLine
|
|
39866
|
-
}, texts, labelLines, index);else if ("update" === state) {
|
|
39414
|
+
};
|
|
39415
|
+
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) {
|
|
39867
39416
|
const prevLabel = prevTextMap.get(textKey);
|
|
39868
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), this._updateLabel(prevLabel,
|
|
39869
|
-
text: text,
|
|
39870
|
-
labelLine: labelLine
|
|
39871
|
-
});
|
|
39417
|
+
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), this._updateLabel(prevLabel, currentLabel);
|
|
39872
39418
|
}
|
|
39873
39419
|
}), this._removeLabel(prevTextMap), this._graphicToText = currentTextMap;
|
|
39874
39420
|
}
|
|
@@ -39894,7 +39440,6 @@
|
|
|
39894
39440
|
}]));
|
|
39895
39441
|
}
|
|
39896
39442
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
39897
|
-
if (!1 === this._enableAnimation || !this._animationConfig.update) return;
|
|
39898
39443
|
const {
|
|
39899
39444
|
text: prevText,
|
|
39900
39445
|
labelLine: prevLabelLine
|
|
@@ -39902,24 +39447,19 @@
|
|
|
39902
39447
|
{
|
|
39903
39448
|
text: curText,
|
|
39904
39449
|
labelLine: curLabelLine
|
|
39905
|
-
} = currentLabel
|
|
39906
|
-
{
|
|
39907
|
-
duration: duration,
|
|
39908
|
-
easing: easing
|
|
39909
|
-
} = this._animationConfig.update;
|
|
39450
|
+
} = currentLabel;
|
|
39910
39451
|
prevText.applyAnimationState(["update"], [{
|
|
39911
39452
|
name: "update",
|
|
39912
|
-
animation: {
|
|
39913
|
-
type: "labelUpdate"
|
|
39914
|
-
|
|
39915
|
-
easing: easing,
|
|
39453
|
+
animation: Object.assign(Object.assign({
|
|
39454
|
+
type: "labelUpdate"
|
|
39455
|
+
}, this._animationConfig.update), {
|
|
39916
39456
|
customParameters: {
|
|
39917
39457
|
prevText: prevText,
|
|
39918
39458
|
curText: curText,
|
|
39919
39459
|
prevLabelLine: prevLabelLine,
|
|
39920
39460
|
curLabelLine: curLabelLine
|
|
39921
39461
|
}
|
|
39922
|
-
}
|
|
39462
|
+
})
|
|
39923
39463
|
}]);
|
|
39924
39464
|
}
|
|
39925
39465
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
@@ -39942,7 +39482,7 @@
|
|
|
39942
39482
|
text: curText,
|
|
39943
39483
|
labelLine: curLabelLine
|
|
39944
39484
|
} = currentLabel;
|
|
39945
|
-
!1
|
|
39485
|
+
!1 === this._enableAnimation || !1 === this._animationConfig.update ? (prevLabel.text.setAttributes(curText.attribute), prevLabelLine && curLabelLine && prevLabel.labelLine.setAttributes(curLabelLine.attribute)) : this._runUpdateAnimation(prevLabel, currentLabel);
|
|
39946
39486
|
}
|
|
39947
39487
|
_removeLabel(textMap) {
|
|
39948
39488
|
const removeLabelAndLine = label => {
|
|
@@ -40078,9 +39618,7 @@
|
|
|
40078
39618
|
data: data
|
|
40079
39619
|
}, merge$1({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
|
|
40080
39620
|
}
|
|
40081
|
-
labeling(textBounds, graphicBounds) {
|
|
40082
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
40083
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39621
|
+
labeling(textBounds, graphicBounds, position = "top", offset = 0) {
|
|
40084
39622
|
return labelingPoint(textBounds, graphicBounds, position, offset);
|
|
40085
39623
|
}
|
|
40086
39624
|
}
|
|
@@ -40114,9 +39652,7 @@
|
|
|
40114
39652
|
data: data
|
|
40115
39653
|
}, merge$1({}, RectLabel.defaultAttributes, restAttributes)));
|
|
40116
39654
|
}
|
|
40117
|
-
labeling(textBounds, graphicBounds) {
|
|
40118
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
40119
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39655
|
+
labeling(textBounds, graphicBounds, position = "top", offset = 0) {
|
|
40120
39656
|
if (!textBounds || !graphicBounds) return;
|
|
40121
39657
|
const {
|
|
40122
39658
|
x1: x1,
|
|
@@ -40178,9 +39714,7 @@
|
|
|
40178
39714
|
data: data
|
|
40179
39715
|
}, merge$1({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
|
|
40180
39716
|
}
|
|
40181
|
-
getGraphicBounds(graphic) {
|
|
40182
|
-
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
40183
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
39717
|
+
getGraphicBounds(graphic, point = {}, position = "end") {
|
|
40184
39718
|
if (!graphic || "line" !== graphic.type && "area" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
40185
39719
|
let points = graphic.attribute.points;
|
|
40186
39720
|
const segments = graphic.attribute.segments;
|
|
@@ -40196,9 +39730,7 @@
|
|
|
40196
39730
|
y2: points[index].y
|
|
40197
39731
|
} : void 0;
|
|
40198
39732
|
}
|
|
40199
|
-
labeling(textBounds, graphicBounds) {
|
|
40200
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
40201
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
39733
|
+
labeling(textBounds, graphicBounds, position = "end", offset = 0) {
|
|
40202
39734
|
return labelingLineOrArea(textBounds, graphicBounds, position, offset);
|
|
40203
39735
|
}
|
|
40204
39736
|
};
|
|
@@ -40253,7 +39785,7 @@
|
|
|
40253
39785
|
_overlapping(labels) {
|
|
40254
39786
|
return ["inside", "inside-center"].includes(this.attribute.position) ? super._overlapping(labels) : labels;
|
|
40255
39787
|
}
|
|
40256
|
-
labeling(textBounds, graphicBounds) {
|
|
39788
|
+
labeling(textBounds, graphicBounds, position = "outside", offset = 0) {
|
|
40257
39789
|
if (textBounds && graphicBounds) return {
|
|
40258
39790
|
x: 0,
|
|
40259
39791
|
y: 0
|
|
@@ -44841,8 +44373,7 @@
|
|
|
44841
44373
|
item.hasState(LegendStateValue.selected) && selectedData.push(item.data);
|
|
44842
44374
|
}), selectedData;
|
|
44843
44375
|
}
|
|
44844
|
-
_appendDataToShape(shape, name, data, delegateShape) {
|
|
44845
|
-
let states = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
44376
|
+
_appendDataToShape(shape, name, data, delegateShape, states = {}) {
|
|
44846
44377
|
shape.name = name, shape.data = data, shape.delegate = delegateShape, shape.states = merge$1({}, DEFAULT_STATES, states);
|
|
44847
44378
|
}
|
|
44848
44379
|
_dispatchLegendEvent(eventName, legendItem, event) {
|
|
@@ -45802,8 +45333,7 @@
|
|
|
45802
45333
|
}
|
|
45803
45334
|
};
|
|
45804
45335
|
|
|
45805
|
-
function getSizeHandlerPath() {
|
|
45806
|
-
let align = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "bottom";
|
|
45336
|
+
function getSizeHandlerPath(align = "bottom") {
|
|
45807
45337
|
let centerX = 0;
|
|
45808
45338
|
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`;
|
|
45809
45339
|
}
|
|
@@ -46370,72 +45900,54 @@
|
|
|
46370
45900
|
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";
|
|
46371
45901
|
}(PlayerEventEnum || (PlayerEventEnum = {}));
|
|
46372
45902
|
|
|
46373
|
-
const isReachEndByDefault =
|
|
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
|
-
|
|
46417
|
-
|
|
46418
|
-
|
|
46419
|
-
|
|
46420
|
-
|
|
46421
|
-
};
|
|
46422
|
-
const isReachStart = _ref8 => {
|
|
46423
|
-
let {
|
|
46424
|
-
direction: direction,
|
|
46425
|
-
maxIndex: maxIndex,
|
|
46426
|
-
minIndex: minIndex,
|
|
46427
|
-
dataIndex: dataIndex
|
|
46428
|
-
} = _ref8;
|
|
46429
|
-
return isReachStartByDefault({
|
|
46430
|
-
direction: direction,
|
|
46431
|
-
minIndex: minIndex,
|
|
46432
|
-
dataIndex: dataIndex
|
|
46433
|
-
}) || isReachStartByReverse({
|
|
46434
|
-
direction: direction,
|
|
46435
|
-
maxIndex: maxIndex,
|
|
46436
|
-
dataIndex: dataIndex
|
|
46437
|
-
});
|
|
46438
|
-
};
|
|
45903
|
+
const isReachEndByDefault = ({
|
|
45904
|
+
direction: direction,
|
|
45905
|
+
maxIndex: maxIndex,
|
|
45906
|
+
dataIndex: dataIndex
|
|
45907
|
+
}) => direction === DirectionEnum.Default && dataIndex === maxIndex;
|
|
45908
|
+
const isReachEndByReverse = ({
|
|
45909
|
+
direction: direction,
|
|
45910
|
+
minIndex: minIndex,
|
|
45911
|
+
dataIndex: dataIndex
|
|
45912
|
+
}) => direction === DirectionEnum.Reverse && dataIndex === minIndex;
|
|
45913
|
+
const isReachEnd = ({
|
|
45914
|
+
direction: direction,
|
|
45915
|
+
maxIndex: maxIndex,
|
|
45916
|
+
minIndex: minIndex,
|
|
45917
|
+
dataIndex: dataIndex
|
|
45918
|
+
}) => isReachEndByDefault({
|
|
45919
|
+
direction: direction,
|
|
45920
|
+
maxIndex: maxIndex,
|
|
45921
|
+
dataIndex: dataIndex
|
|
45922
|
+
}) || isReachEndByReverse({
|
|
45923
|
+
direction: direction,
|
|
45924
|
+
minIndex: minIndex,
|
|
45925
|
+
dataIndex: dataIndex
|
|
45926
|
+
});
|
|
45927
|
+
const isReachStartByDefault = ({
|
|
45928
|
+
direction: direction,
|
|
45929
|
+
minIndex: minIndex,
|
|
45930
|
+
dataIndex: dataIndex
|
|
45931
|
+
}) => direction === DirectionEnum.Default && dataIndex === minIndex;
|
|
45932
|
+
const isReachStartByReverse = ({
|
|
45933
|
+
direction: direction,
|
|
45934
|
+
maxIndex: maxIndex,
|
|
45935
|
+
dataIndex: dataIndex
|
|
45936
|
+
}) => direction === DirectionEnum.Reverse && dataIndex === maxIndex;
|
|
45937
|
+
const isReachStart = ({
|
|
45938
|
+
direction: direction,
|
|
45939
|
+
maxIndex: maxIndex,
|
|
45940
|
+
minIndex: minIndex,
|
|
45941
|
+
dataIndex: dataIndex
|
|
45942
|
+
}) => isReachStartByDefault({
|
|
45943
|
+
direction: direction,
|
|
45944
|
+
minIndex: minIndex,
|
|
45945
|
+
dataIndex: dataIndex
|
|
45946
|
+
}) || isReachStartByReverse({
|
|
45947
|
+
direction: direction,
|
|
45948
|
+
maxIndex: maxIndex,
|
|
45949
|
+
dataIndex: dataIndex
|
|
45950
|
+
});
|
|
46439
45951
|
const isHorizontal$1 = orient => "top" === orient || "bottom" === orient;
|
|
46440
45952
|
const forwardStep = (direction, currentIndex, min, max) => "default" === direction ? Math.min(currentIndex + 1, max) : Math.max(currentIndex - 1, min);
|
|
46441
45953
|
|
|
@@ -47086,10 +46598,7 @@
|
|
|
47086
46598
|
};
|
|
47087
46599
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
47088
46600
|
|
|
47089
|
-
const mergeRowAttrs =
|
|
47090
|
-
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
47091
|
-
sources[_key - 1] = arguments[_key];
|
|
47092
|
-
}
|
|
46601
|
+
const mergeRowAttrs = (target, ...sources) => {
|
|
47093
46602
|
const shapeList = [target.shape, ...sources.map(s => null == s ? void 0 : s.shape)],
|
|
47094
46603
|
keyList = [target.key, ...sources.map(s => null == s ? void 0 : s.key)],
|
|
47095
46604
|
valueList = [target.value, ...sources.map(s => null == s ? void 0 : s.value)];
|
|
@@ -47407,8 +46916,7 @@
|
|
|
47407
46916
|
const shapeWidths = [],
|
|
47408
46917
|
keyWidths = [],
|
|
47409
46918
|
valueWidths = [];
|
|
47410
|
-
filteredContent.forEach((
|
|
47411
|
-
let [item, itemAttr] = _ref;
|
|
46919
|
+
filteredContent.forEach(([item, itemAttr], i) => {
|
|
47412
46920
|
var _a;
|
|
47413
46921
|
const {
|
|
47414
46922
|
key: key,
|
|
@@ -48515,16 +48023,15 @@
|
|
|
48515
48023
|
};
|
|
48516
48024
|
|
|
48517
48025
|
const ignoreWhen = value => isDataView(value) || isHTMLElement(value);
|
|
48518
|
-
function cloneDeepSpec(spec) {
|
|
48519
|
-
let excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ["data"];
|
|
48026
|
+
function cloneDeepSpec(spec, excludeKeys = ["data"]) {
|
|
48520
48027
|
return cloneDeep(spec, ignoreWhen, excludeKeys);
|
|
48521
48028
|
}
|
|
48522
48029
|
|
|
48523
|
-
function mergeSpec(target) {
|
|
48030
|
+
function mergeSpec(target, ...sources) {
|
|
48524
48031
|
let sourceIndex = -1;
|
|
48525
|
-
const length =
|
|
48032
|
+
const length = sources.length;
|
|
48526
48033
|
for (; ++sourceIndex < length;) {
|
|
48527
|
-
const source =
|
|
48034
|
+
const source = sources[sourceIndex];
|
|
48528
48035
|
baseMerge(target, source, !0, !0);
|
|
48529
48036
|
}
|
|
48530
48037
|
return target;
|
|
@@ -50791,10 +50298,13 @@
|
|
|
50791
50298
|
if (this._stage) {
|
|
50792
50299
|
this._rootMarks.forEach(g => {
|
|
50793
50300
|
traverseGroupMark(g, m => {
|
|
50794
|
-
if (
|
|
50795
|
-
|
|
50301
|
+
if (m.needClear) {
|
|
50302
|
+
if (!this._progressiveMarks) {
|
|
50303
|
+
m.runAnimation();
|
|
50304
|
+
}
|
|
50305
|
+
m.clearExitGraphics();
|
|
50306
|
+
m.needClear = false;
|
|
50796
50307
|
}
|
|
50797
|
-
m.clearExitGraphics();
|
|
50798
50308
|
}, null, true);
|
|
50799
50309
|
});
|
|
50800
50310
|
this._stage.disableDirtyBounds();
|
|
@@ -52295,8 +51805,6 @@
|
|
|
52295
51805
|
getSeriesInDataName(dataName) {
|
|
52296
51806
|
return this.getSeries({ dataName });
|
|
52297
51807
|
}
|
|
52298
|
-
onRender(ctx) {
|
|
52299
|
-
}
|
|
52300
51808
|
initSeriesDataflow() {
|
|
52301
51809
|
const viewDataFilters = this._series.map(s => { var _a; return (_a = s.getViewDataFilter()) !== null && _a !== void 0 ? _a : s.getViewData(); }).filter(v => !!v);
|
|
52302
51810
|
this._option.dataSet.multipleDataViewAddListener(viewDataFilters, 'change', this.seriesDataFilterOver);
|
|
@@ -54251,6 +53759,7 @@
|
|
|
54251
53759
|
});
|
|
54252
53760
|
this._dataByKey = mark._dataByKey;
|
|
54253
53761
|
this._prevDataByKey = mark._prevDataByKey;
|
|
53762
|
+
this.needClear = mark.needClear;
|
|
54254
53763
|
}
|
|
54255
53764
|
_parseProgressiveContext(data) {
|
|
54256
53765
|
const enableProgressive = this._markConfig.progressiveStep > 0 &&
|
|
@@ -54480,6 +53989,7 @@
|
|
|
54480
53989
|
});
|
|
54481
53990
|
this._dataByKey = newGroupedData;
|
|
54482
53991
|
this._graphics = newGraphics;
|
|
53992
|
+
this.needClear = true;
|
|
54483
53993
|
}
|
|
54484
53994
|
_runEncoderOfGraphic(styles, g, attrs = {}) {
|
|
54485
53995
|
return runEncoder(styles, g.context.data[0], attrs);
|
|
@@ -54538,9 +54048,9 @@
|
|
|
54538
54048
|
const hasStateAnimation = this.hasAnimationByState(g.context.animationState);
|
|
54539
54049
|
if (!g.setAttributes) {
|
|
54540
54050
|
const mockGraphic = g;
|
|
54541
|
-
g = this._createGraphic(
|
|
54051
|
+
g = this._createGraphic(finalAttrs);
|
|
54542
54052
|
if (hasAnimation) {
|
|
54543
|
-
g.
|
|
54053
|
+
g.setFinalAttributes(finalAttrs);
|
|
54544
54054
|
}
|
|
54545
54055
|
g.context = mockGraphic.context;
|
|
54546
54056
|
g.context.diffAttrs = finalAttrs;
|
|
@@ -54578,7 +54088,7 @@
|
|
|
54578
54088
|
hasAnimation ? g.setAttributesAndPreventAnimate(diffAttrs) : g.setAttributes(diffAttrs);
|
|
54579
54089
|
}
|
|
54580
54090
|
if (hasAnimation) {
|
|
54581
|
-
g.
|
|
54091
|
+
g.setFinalAttributes(finalAttrs);
|
|
54582
54092
|
}
|
|
54583
54093
|
}
|
|
54584
54094
|
this._setStateOfGraphic(g);
|
|
@@ -54919,7 +54429,7 @@
|
|
|
54919
54429
|
return Object.keys(this._animationConfig).length > 0;
|
|
54920
54430
|
}
|
|
54921
54431
|
runAnimation() {
|
|
54922
|
-
this._runStateAnimation(this.
|
|
54432
|
+
this._runStateAnimation(this.getGraphics());
|
|
54923
54433
|
}
|
|
54924
54434
|
}
|
|
54925
54435
|
|
|
@@ -54984,7 +54494,7 @@
|
|
|
54984
54494
|
getGraphics() {
|
|
54985
54495
|
return [this._product];
|
|
54986
54496
|
}
|
|
54987
|
-
|
|
54497
|
+
renderInner() {
|
|
54988
54498
|
var _a;
|
|
54989
54499
|
if (!this._product) {
|
|
54990
54500
|
return;
|
|
@@ -54992,11 +54502,12 @@
|
|
|
54992
54502
|
const style = (_a = this._simpleStyle) !== null && _a !== void 0 ? _a : this.getAttributesOfState({});
|
|
54993
54503
|
this._product.context = Object.assign(Object.assign({}, this._product.context), this._getCommonContext());
|
|
54994
54504
|
this._product.setAttributes(this._getAttrsFromConfig(style));
|
|
54505
|
+
this.needClear = true;
|
|
54995
54506
|
}
|
|
54996
54507
|
render() {
|
|
54997
54508
|
if (this._isCommited) {
|
|
54998
54509
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
54999
|
-
this.
|
|
54510
|
+
this.renderInner();
|
|
55000
54511
|
this.uncommit();
|
|
55001
54512
|
}
|
|
55002
54513
|
this.getMarks().forEach(mark => {
|
|
@@ -57219,7 +56730,7 @@
|
|
|
57219
56730
|
});
|
|
57220
56731
|
};
|
|
57221
56732
|
|
|
57222
|
-
const version = "2.0.0-alpha.
|
|
56733
|
+
const version = "2.0.0-alpha.4";
|
|
57223
56734
|
|
|
57224
56735
|
const addVChartProperty = (data, op) => {
|
|
57225
56736
|
const context = op.beforeCall();
|
|
@@ -58911,9 +58422,6 @@
|
|
|
58911
58422
|
onEvaluateEnd(ctx) {
|
|
58912
58423
|
this._data.updateData();
|
|
58913
58424
|
}
|
|
58914
|
-
onRender(ctx) {
|
|
58915
|
-
return;
|
|
58916
|
-
}
|
|
58917
58425
|
release() {
|
|
58918
58426
|
var _a, _b;
|
|
58919
58427
|
super.release();
|
|
@@ -61314,14 +60822,8 @@
|
|
|
61314
60822
|
this._regions = (_a = this._regions) !== null && _a !== void 0 ? _a : this._option.getRegionsInIndex();
|
|
61315
60823
|
this._layout && (this._layout.layoutBindRegionID = this._regions.map(x => x === null || x === void 0 ? void 0 : x.id));
|
|
61316
60824
|
}
|
|
61317
|
-
changeRegions(regions) {
|
|
61318
|
-
throw new Error('Method not implemented.');
|
|
61319
|
-
}
|
|
61320
60825
|
_getNeedClearVRenderComponents() {
|
|
61321
|
-
|
|
61322
|
-
}
|
|
61323
|
-
onRender(ctx) {
|
|
61324
|
-
throw new Error('Method not implemented.');
|
|
60826
|
+
return [];
|
|
61325
60827
|
}
|
|
61326
60828
|
getVRenderComponents() {
|
|
61327
60829
|
return this._getNeedClearVRenderComponents();
|
|
@@ -61489,6 +60991,7 @@
|
|
|
61489
60991
|
mark: this,
|
|
61490
60992
|
model: this.model
|
|
61491
60993
|
});
|
|
60994
|
+
this.needClear = true;
|
|
61492
60995
|
}
|
|
61493
60996
|
release() {
|
|
61494
60997
|
super.release();
|
|
@@ -61541,9 +61044,6 @@
|
|
|
61541
61044
|
this._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
61542
61045
|
this._coordinateType = 'none';
|
|
61543
61046
|
}
|
|
61544
|
-
_getNeedClearVRenderComponents() {
|
|
61545
|
-
return [];
|
|
61546
|
-
}
|
|
61547
61047
|
getVRenderComponents() {
|
|
61548
61048
|
var _a, _b;
|
|
61549
61049
|
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);
|
|
@@ -62453,14 +61953,6 @@
|
|
|
62453
61953
|
this.pluginService && plugin.onDidCompile && plugin.onDidCompile(this.pluginService, this);
|
|
62454
61954
|
});
|
|
62455
61955
|
}
|
|
62456
|
-
onRender(ctx) {
|
|
62457
|
-
}
|
|
62458
|
-
changeRegions(regions) {
|
|
62459
|
-
}
|
|
62460
|
-
update(ctx) {
|
|
62461
|
-
}
|
|
62462
|
-
resize(ctx) {
|
|
62463
|
-
}
|
|
62464
61956
|
collectScale() {
|
|
62465
61957
|
const scales = [];
|
|
62466
61958
|
eachSeries(this._regions, s => {
|
|
@@ -62645,6 +62137,9 @@
|
|
|
62645
62137
|
attrs.label = {
|
|
62646
62138
|
overflowLimitLength: this._getLabelOverflowLimit(isX)
|
|
62647
62139
|
};
|
|
62140
|
+
if (this._afterUpdateAttribute) {
|
|
62141
|
+
return this._afterUpdateAttribute(attrs, ignoreGrid);
|
|
62142
|
+
}
|
|
62648
62143
|
return attrs;
|
|
62649
62144
|
}
|
|
62650
62145
|
getLabelItems(length) {
|
|
@@ -65452,8 +64947,6 @@
|
|
|
65452
64947
|
}
|
|
65453
64948
|
this.getAllModels().forEach(model => model.onDataUpdate());
|
|
65454
64949
|
}
|
|
65455
|
-
onRender(option) {
|
|
65456
|
-
}
|
|
65457
64950
|
setCanvasRect(width, height) {
|
|
65458
64951
|
this._canvasRect = { width, height };
|
|
65459
64952
|
}
|
|
@@ -69891,13 +69384,6 @@
|
|
|
69891
69384
|
this._actualScale = this._initialScale;
|
|
69892
69385
|
super.onLayoutEnd();
|
|
69893
69386
|
}
|
|
69894
|
-
onRender(ctx) {
|
|
69895
|
-
}
|
|
69896
|
-
changeRegions(regions) {
|
|
69897
|
-
}
|
|
69898
|
-
_getNeedClearVRenderComponents() {
|
|
69899
|
-
return [];
|
|
69900
|
-
}
|
|
69901
69387
|
collectFeatures() {
|
|
69902
69388
|
const features = [];
|
|
69903
69389
|
this._regions.forEach(r => {
|
|
@@ -73859,12 +73345,12 @@
|
|
|
73859
73345
|
Factory.registerSeries(PieSeries.type, PieSeries);
|
|
73860
73346
|
};
|
|
73861
73347
|
|
|
73862
|
-
|
|
73348
|
+
function growInType(growField) {
|
|
73863
73349
|
return growField === 'angle' ? 'growAngleIn' : 'growRadiusIn';
|
|
73864
|
-
}
|
|
73865
|
-
|
|
73350
|
+
}
|
|
73351
|
+
function growOutType(growField) {
|
|
73866
73352
|
return growField === 'angle' ? 'growAngleOut' : 'growRadiusOut';
|
|
73867
|
-
}
|
|
73353
|
+
}
|
|
73868
73354
|
const Appear_Grow$4 = (params) => {
|
|
73869
73355
|
return {
|
|
73870
73356
|
type: growInType(params.growField),
|
|
@@ -74107,10 +73593,6 @@
|
|
|
74107
73593
|
this._endAngle = degreeToRadian(this._spec.endAngle);
|
|
74108
73594
|
this._inverse = this._spec.inverse;
|
|
74109
73595
|
}
|
|
74110
|
-
onRender(ctx) {
|
|
74111
|
-
}
|
|
74112
|
-
changeRegions() {
|
|
74113
|
-
}
|
|
74114
73596
|
_tickTransformOption() {
|
|
74115
73597
|
var _a;
|
|
74116
73598
|
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 });
|
|
@@ -76636,6 +76118,9 @@
|
|
|
76636
76118
|
});
|
|
76637
76119
|
if ((_a = this._spec.wordMask) === null || _a === void 0 ? void 0 : _a.visible) {
|
|
76638
76120
|
this._maskMark = this._createMark(BaseWordCloudSeries.mark.wordMask, { dataView: false });
|
|
76121
|
+
this._maskMark.setMarkConfig({
|
|
76122
|
+
zIndex: exports.LayoutZIndex.Mark - 1
|
|
76123
|
+
});
|
|
76639
76124
|
}
|
|
76640
76125
|
}
|
|
76641
76126
|
initMarkStyle() {
|
|
@@ -76890,12 +76375,7 @@
|
|
|
76890
76375
|
}));
|
|
76891
76376
|
};
|
|
76892
76377
|
|
|
76893
|
-
const calculateNodeValue$1 =
|
|
76894
|
-
let depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
76895
|
-
let flattenIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
|
|
76896
|
-
let parent = arguments.length > 4 ? arguments[4] : undefined;
|
|
76897
|
-
let getNodeKey = arguments.length > 5 ? arguments[5] : undefined;
|
|
76898
|
-
let valueField = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "value";
|
|
76378
|
+
const calculateNodeValue$1 = (subTree, output, depth = 0, flattenIndex = -1, parent, getNodeKey, valueField = "value") => {
|
|
76899
76379
|
let sum = 0,
|
|
76900
76380
|
prevFlattenIndex = null != flattenIndex ? flattenIndex : -1,
|
|
76901
76381
|
maxDepth = depth;
|
|
@@ -76938,9 +76418,7 @@
|
|
|
76938
76418
|
(null === (_a = node.children) || void 0 === _a ? void 0 : _a.length) && (ctxRes = eachAfter(node.children, callback, node, ctxRes)), ctxRes = callback(node, index, parent, ctxRes);
|
|
76939
76419
|
}), ctxRes;
|
|
76940
76420
|
};
|
|
76941
|
-
const flattenNodes =
|
|
76942
|
-
let output = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
76943
|
-
let options = arguments.length > 2 ? arguments[2] : undefined;
|
|
76421
|
+
const flattenNodes = (nodes, output = [], options) => {
|
|
76944
76422
|
const hasMaxDepth = (null == options ? void 0 : options.maxDepth) >= 0;
|
|
76945
76423
|
return nodes.forEach(node => {
|
|
76946
76424
|
(!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)));
|
|
@@ -77816,13 +77294,12 @@
|
|
|
77816
77294
|
dropIsolatedNode: !0
|
|
77817
77295
|
};
|
|
77818
77296
|
|
|
77819
|
-
function dice (parent, x0, y0, x1, y1
|
|
77820
|
-
|
|
77821
|
-
|
|
77822
|
-
|
|
77823
|
-
|
|
77824
|
-
|
|
77825
|
-
};
|
|
77297
|
+
function dice (parent, x0, y0, x1, y1, keyMap = {
|
|
77298
|
+
x0: "x0",
|
|
77299
|
+
x1: "x1",
|
|
77300
|
+
y0: "y0",
|
|
77301
|
+
y1: "y1"
|
|
77302
|
+
}) {
|
|
77826
77303
|
const nodes = parent.children;
|
|
77827
77304
|
let node,
|
|
77828
77305
|
i = -1;
|
|
@@ -78697,21 +78174,18 @@
|
|
|
78697
78174
|
circleList = Object.values(circles);
|
|
78698
78175
|
if (!circleList.length) return [];
|
|
78699
78176
|
intersectionArea(circleList, areaStats);
|
|
78700
|
-
const arcs = areaStats.arcs.map(
|
|
78701
|
-
|
|
78702
|
-
|
|
78703
|
-
|
|
78704
|
-
|
|
78705
|
-
|
|
78706
|
-
|
|
78707
|
-
|
|
78708
|
-
|
|
78709
|
-
|
|
78710
|
-
|
|
78711
|
-
|
|
78712
|
-
largeArcFlag: width > circle.radius
|
|
78713
|
-
};
|
|
78714
|
-
}),
|
|
78177
|
+
const arcs = areaStats.arcs.map(({
|
|
78178
|
+
p1: p1,
|
|
78179
|
+
p2: p2,
|
|
78180
|
+
circle: circle,
|
|
78181
|
+
width: width
|
|
78182
|
+
}) => ({
|
|
78183
|
+
p1: p1,
|
|
78184
|
+
p2: p2,
|
|
78185
|
+
radius: circle.radius,
|
|
78186
|
+
setId: circle.setId,
|
|
78187
|
+
largeArcFlag: width > circle.radius
|
|
78188
|
+
})),
|
|
78715
78189
|
result = [];
|
|
78716
78190
|
let i = 0,
|
|
78717
78191
|
arc = arcs[0];
|
|
@@ -79423,9 +78897,7 @@
|
|
|
79423
78897
|
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]);
|
|
79424
78898
|
};
|
|
79425
78899
|
};
|
|
79426
|
-
const generateMaskCanvas =
|
|
79427
|
-
let invert = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
79428
|
-
let createCanvas = arguments.length > 5 ? arguments[5] : undefined;
|
|
78900
|
+
const generateMaskCanvas = (shape, width, height, cacheCanvas, invert = !1, createCanvas) => {
|
|
79429
78901
|
let {
|
|
79430
78902
|
backgroundColor = "#fff"
|
|
79431
78903
|
} = shape,
|
|
@@ -79468,15 +78940,11 @@
|
|
|
79468
78940
|
ctx.fillText(text, width / 2, height / 2), ctx.scale(scale, scale);
|
|
79469
78941
|
} 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));
|
|
79470
78942
|
};
|
|
79471
|
-
const generatePoints =
|
|
79472
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79473
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
78943
|
+
const generatePoints = (center, radius, startAngle = 0, count) => {
|
|
79474
78944
|
const angle = 2 * Math.PI / count;
|
|
79475
78945
|
return new Array(count).fill(0).map((entry, index) => polarToCartesian(center, radius, startAngle + index * angle));
|
|
79476
78946
|
};
|
|
79477
|
-
const generateCardioidPoints =
|
|
79478
|
-
let startAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79479
|
-
let count = arguments.length > 3 ? arguments[3] : undefined;
|
|
78947
|
+
const generateCardioidPoints = (center, radius, startAngle = 0, count) => {
|
|
79480
78948
|
const angle = 2 * Math.PI / count,
|
|
79481
78949
|
func = getShapeFunction("cardioid");
|
|
79482
78950
|
return new Array(count).fill(0).map((entry, index) => {
|
|
@@ -79667,8 +79135,7 @@
|
|
|
79667
79135
|
}
|
|
79668
79136
|
return result;
|
|
79669
79137
|
}
|
|
79670
|
-
function drawContour(labels, boundaryPixels, width, height) {
|
|
79671
|
-
let thickness = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
79138
|
+
function drawContour(labels, boundaryPixels, width, height, thickness = 1) {
|
|
79672
79139
|
const result = new Array(labels.length).fill(0);
|
|
79673
79140
|
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++) {
|
|
79674
79141
|
if (Math.sqrt(di * di + dj * dj) < thickness) {
|
|
@@ -79754,9 +79221,7 @@
|
|
|
79754
79221
|
}
|
|
79755
79222
|
return this.pointsAtRadius[radius] = points, points;
|
|
79756
79223
|
}
|
|
79757
|
-
getTextInfo(item) {
|
|
79758
|
-
let shrinkRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
79759
|
-
let index = arguments.length > 2 ? arguments[2] : undefined;
|
|
79224
|
+
getTextInfo(item, shrinkRatio = 1, index) {
|
|
79760
79225
|
var _a;
|
|
79761
79226
|
const sizeShrinkRatio = this.options.clip ? 1 : shrinkRatio,
|
|
79762
79227
|
fontSize = Math.max(Math.floor((this.isTryRepeatFill ? this.options.fillTextFontSize : this.getTextFontSize(item)) * sizeShrinkRatio), this.options.minFontSize);
|
|
@@ -79837,8 +79302,7 @@
|
|
|
79837
79302
|
}
|
|
79838
79303
|
return !0;
|
|
79839
79304
|
}
|
|
79840
|
-
layoutWord(index) {
|
|
79841
|
-
let shrinkRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
79305
|
+
layoutWord(index, shrinkRatio = 1) {
|
|
79842
79306
|
const item = this.data[index],
|
|
79843
79307
|
info = this.getTextInfo(item, shrinkRatio, index);
|
|
79844
79308
|
if (!info) return !1;
|
|
@@ -81404,9 +80868,19 @@
|
|
|
81404
80868
|
this._rootMark.setAnimationConfig(animationConfig((_d = Factory.getAnimationInKey('cartesianGroupClip')) === null || _d === void 0 ? void 0 : _d({
|
|
81405
80869
|
direction: () => (this._isHorizontal() ? 'x' : 'y'),
|
|
81406
80870
|
width: () => {
|
|
80871
|
+
const rootMark = this.getRootMark().getProduct();
|
|
80872
|
+
if (rootMark) {
|
|
80873
|
+
const { x1, x2 } = rootMark.AABBBounds;
|
|
80874
|
+
return Math.max(x1, x2);
|
|
80875
|
+
}
|
|
81407
80876
|
return this.getLayoutRect().width;
|
|
81408
80877
|
},
|
|
81409
80878
|
height: () => {
|
|
80879
|
+
const rootMark = this.getRootMark().getProduct();
|
|
80880
|
+
if (rootMark) {
|
|
80881
|
+
const { y1, y2 } = rootMark.AABBBounds;
|
|
80882
|
+
return Math.max(y1, y2);
|
|
80883
|
+
}
|
|
81410
80884
|
return this.getLayoutRect().height;
|
|
81411
80885
|
},
|
|
81412
80886
|
orient: () => (this._isReverse() ? 'negative' : 'positive')
|
|
@@ -86146,8 +85620,7 @@
|
|
|
86146
85620
|
.getComponentsByKey('indicator')
|
|
86147
85621
|
.forEach((indicatorComponent) => {
|
|
86148
85622
|
var _a, _b, _c;
|
|
86149
|
-
const
|
|
86150
|
-
const waveItem = (_a = grammarMark.getGraphics()[0].getSubGraphic()) === null || _a === void 0 ? void 0 : _a[0];
|
|
85623
|
+
const waveItem = (_a = this._liquidMark.getGraphics()[0].getSubGraphic()) === null || _a === void 0 ? void 0 : _a[0];
|
|
86151
85624
|
let { y1: waveY1, y2: waveY2 } = waveItem.globalAABBBounds;
|
|
86152
85625
|
waveY1 += this._region.getLayoutStartPoint().y;
|
|
86153
85626
|
waveY2 += this._region.getLayoutStartPoint().y;
|
|
@@ -88769,8 +88242,6 @@
|
|
|
88769
88242
|
super.created();
|
|
88770
88243
|
this.initData();
|
|
88771
88244
|
}
|
|
88772
|
-
onRender(ctx) {
|
|
88773
|
-
}
|
|
88774
88245
|
_compareSpec(spec, prevSpec) {
|
|
88775
88246
|
const result = super._compareSpec(spec, prevSpec);
|
|
88776
88247
|
result.reRender = true;
|
|
@@ -88783,8 +88254,6 @@
|
|
|
88783
88254
|
}
|
|
88784
88255
|
return result;
|
|
88785
88256
|
}
|
|
88786
|
-
changeRegions(regions) {
|
|
88787
|
-
}
|
|
88788
88257
|
_bindLegendDataChange() {
|
|
88789
88258
|
this._preSelectedData = this._selectedData.slice();
|
|
88790
88259
|
this._initSelectedData();
|
|
@@ -90228,19 +89697,12 @@
|
|
|
90228
89697
|
isTooltipShown() {
|
|
90229
89698
|
return this._isTooltipShown;
|
|
90230
89699
|
}
|
|
90231
|
-
changeRegions(regions) {
|
|
90232
|
-
}
|
|
90233
|
-
_getNeedClearVRenderComponents() {
|
|
90234
|
-
return [];
|
|
90235
|
-
}
|
|
90236
89700
|
_registerEvent() {
|
|
90237
89701
|
}
|
|
90238
89702
|
_releaseEvent() {
|
|
90239
89703
|
}
|
|
90240
89704
|
onLayoutEnd() {
|
|
90241
89705
|
}
|
|
90242
|
-
onRender(ctx) {
|
|
90243
|
-
}
|
|
90244
89706
|
created() {
|
|
90245
89707
|
super.created();
|
|
90246
89708
|
this._regions = this._option.getAllRegions();
|
|
@@ -90864,16 +90326,12 @@
|
|
|
90864
90326
|
});
|
|
90865
90327
|
return map;
|
|
90866
90328
|
}
|
|
90867
|
-
changeRegions(regions) {
|
|
90868
|
-
}
|
|
90869
90329
|
onLayoutEnd() {
|
|
90870
90330
|
const region = this._regions[0];
|
|
90871
90331
|
this.setLayoutRect(region.getLayoutRect());
|
|
90872
90332
|
this.setLayoutStartPosition(region.getLayoutStartPoint());
|
|
90873
90333
|
super.onLayoutEnd();
|
|
90874
90334
|
}
|
|
90875
|
-
onRender(ctx) {
|
|
90876
|
-
}
|
|
90877
90335
|
_releaseEvent() {
|
|
90878
90336
|
this.clearOutEvent();
|
|
90879
90337
|
const triggerConfig = this._getTriggerEvent();
|
|
@@ -91659,11 +91117,12 @@
|
|
|
91659
91117
|
return data.filter(filter);
|
|
91660
91118
|
};
|
|
91661
91119
|
const dataFilterComputeDomain = (data, op) => {
|
|
91662
|
-
const { stateFields, valueFields, dataCollection } = op.input;
|
|
91120
|
+
const { stateFields, valueFields, dataCollection, isCategoryState } = op.input;
|
|
91663
91121
|
const { stateField, valueField } = op.output;
|
|
91664
91122
|
const resultObj = {};
|
|
91665
91123
|
const resultData = [];
|
|
91666
91124
|
const stateValues = [];
|
|
91125
|
+
let hasLockDomain = false;
|
|
91667
91126
|
dataCollection.forEach((dv, i) => {
|
|
91668
91127
|
var _a;
|
|
91669
91128
|
if (isNil$1(stateFields[i])) {
|
|
@@ -91671,6 +91130,7 @@
|
|
|
91671
91130
|
}
|
|
91672
91131
|
const stateFieldInfo = (_a = dv.getFields()) === null || _a === void 0 ? void 0 : _a[stateFields[i]];
|
|
91673
91132
|
if (stateFieldInfo && stateFieldInfo.lockStatisticsByDomain) {
|
|
91133
|
+
hasLockDomain = true;
|
|
91674
91134
|
stateFieldInfo.domain.forEach((d) => {
|
|
91675
91135
|
if (isNil$1(resultObj[d])) {
|
|
91676
91136
|
stateValues.push(d);
|
|
@@ -91692,7 +91152,12 @@
|
|
|
91692
91152
|
});
|
|
91693
91153
|
});
|
|
91694
91154
|
});
|
|
91695
|
-
|
|
91155
|
+
const sortedStateValues = hasLockDomain
|
|
91156
|
+
? stateValues
|
|
91157
|
+
: isCategoryState === false
|
|
91158
|
+
? stateValues.sort((a, b) => a - b)
|
|
91159
|
+
: Object.keys(resultObj);
|
|
91160
|
+
sortedStateValues.forEach(state => {
|
|
91696
91161
|
const res = { [stateField]: state };
|
|
91697
91162
|
if (valueField) {
|
|
91698
91163
|
res[valueField] = resultObj[state];
|
|
@@ -92045,6 +91510,7 @@
|
|
|
92045
91510
|
const dataCollection = [];
|
|
92046
91511
|
const stateFields = [];
|
|
92047
91512
|
const valueFields = [];
|
|
91513
|
+
let isCategoryState;
|
|
92048
91514
|
if (this._relatedAxisComponent) {
|
|
92049
91515
|
const originalStateFields = {};
|
|
92050
91516
|
eachSeries(this._regions, s => {
|
|
@@ -92070,8 +91536,6 @@
|
|
|
92070
91536
|
? xAxisHelper
|
|
92071
91537
|
: yAxisHelper;
|
|
92072
91538
|
const valueAxisHelper = stateAxisHelper === xAxisHelper ? yAxisHelper : xAxisHelper;
|
|
92073
|
-
const isValidateValueAxis = isContinuous(valueAxisHelper.getScale(0).type);
|
|
92074
|
-
const isValidateStateAxis = isContinuous(stateAxisHelper.getScale(0).type);
|
|
92075
91539
|
dataCollection.push(s.getRawData());
|
|
92076
91540
|
const seriesSpec = s.getSpec();
|
|
92077
91541
|
const xField = s.coordinate === 'cartesian'
|
|
@@ -92082,7 +91546,8 @@
|
|
|
92082
91546
|
: array((_b = seriesSpec.radiusField) !== null && _b !== void 0 ? _b : seriesSpec.valueField);
|
|
92083
91547
|
originalStateFields[s.id] =
|
|
92084
91548
|
s.type === 'link' ? ['from_xField'] : stateAxisHelper === xAxisHelper ? xField : yField;
|
|
92085
|
-
if (
|
|
91549
|
+
if (isContinuous(stateAxisHelper.getScale(0).type)) {
|
|
91550
|
+
isCategoryState = false;
|
|
92086
91551
|
stateFields.push(originalStateFields[s.id]);
|
|
92087
91552
|
}
|
|
92088
91553
|
else {
|
|
@@ -92090,7 +91555,7 @@
|
|
|
92090
91555
|
}
|
|
92091
91556
|
if (this._valueField) {
|
|
92092
91557
|
const valueField = s.type === 'link' ? ['from_yField'] : valueAxisHelper === xAxisHelper ? xField : yField;
|
|
92093
|
-
if (
|
|
91558
|
+
if (isContinuous(valueAxisHelper.getScale(0).type)) {
|
|
92094
91559
|
valueFields.push(...valueField);
|
|
92095
91560
|
}
|
|
92096
91561
|
}
|
|
@@ -92122,7 +91587,8 @@
|
|
|
92122
91587
|
input: {
|
|
92123
91588
|
dataCollection: dataCollection,
|
|
92124
91589
|
stateFields,
|
|
92125
|
-
valueFields
|
|
91590
|
+
valueFields,
|
|
91591
|
+
isCategoryState
|
|
92126
91592
|
},
|
|
92127
91593
|
output: {
|
|
92128
91594
|
stateField: this._stateField,
|
|
@@ -92302,8 +91768,6 @@
|
|
|
92302
91768
|
});
|
|
92303
91769
|
}
|
|
92304
91770
|
}
|
|
92305
|
-
onRender(ctx) {
|
|
92306
|
-
}
|
|
92307
91771
|
_compareSpec(spec, prevSpec) {
|
|
92308
91772
|
const result = super._compareSpec(spec, prevSpec);
|
|
92309
91773
|
if (!result.reMake && !isEqual(prevSpec, spec)) {
|
|
@@ -92320,12 +91784,6 @@
|
|
|
92320
91784
|
});
|
|
92321
91785
|
});
|
|
92322
91786
|
}
|
|
92323
|
-
changeRegions() {
|
|
92324
|
-
}
|
|
92325
|
-
update(ctx) {
|
|
92326
|
-
}
|
|
92327
|
-
resize(ctx) {
|
|
92328
|
-
}
|
|
92329
91787
|
_parseDomainFromState(startValue, endValue) {
|
|
92330
91788
|
if (isContinuous(this._stateScale.type)) {
|
|
92331
91789
|
return [Math.min(endValue, startValue), Math.max(endValue, startValue)];
|
|
@@ -93196,10 +92654,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93196
92654
|
this._content = array(this._spec.content);
|
|
93197
92655
|
this._regions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
93198
92656
|
}
|
|
93199
|
-
onRender(ctx) {
|
|
93200
|
-
}
|
|
93201
|
-
changeRegions(regions) {
|
|
93202
|
-
}
|
|
93203
92657
|
initEvent() {
|
|
93204
92658
|
if (this._option.disableTriggerEvent) {
|
|
93205
92659
|
return;
|
|
@@ -94208,10 +93662,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94208
93662
|
this._relativeSeries.event.on('scroll', this._markerLayout.bind(this));
|
|
94209
93663
|
}
|
|
94210
93664
|
}
|
|
94211
|
-
onRender(ctx) {
|
|
94212
|
-
}
|
|
94213
|
-
changeRegions(regions) {
|
|
94214
|
-
}
|
|
94215
93665
|
clear() {
|
|
94216
93666
|
super.clear();
|
|
94217
93667
|
this._firstSeries = null;
|
|
@@ -94886,8 +94336,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94886
94336
|
return s.visible !== false;
|
|
94887
94337
|
});
|
|
94888
94338
|
}
|
|
94889
|
-
onRender(ctx) {
|
|
94890
|
-
}
|
|
94891
94339
|
_compareSpec(spec, prevSpec) {
|
|
94892
94340
|
const result = super._compareSpec(spec, prevSpec);
|
|
94893
94341
|
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) {
|
|
@@ -94897,12 +94345,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94897
94345
|
result.reRender = true;
|
|
94898
94346
|
return result;
|
|
94899
94347
|
}
|
|
94900
|
-
changeRegions(regions) {
|
|
94901
|
-
}
|
|
94902
|
-
update(ctx) {
|
|
94903
|
-
}
|
|
94904
|
-
resize(ctx) {
|
|
94905
|
-
}
|
|
94906
94348
|
afterSetLayoutStartPoint(pos) {
|
|
94907
94349
|
if (isValidNumber$1(pos.x)) {
|
|
94908
94350
|
this._titleComponent && this._titleComponent.setAttribute('x', pos.x);
|
|
@@ -95600,10 +95042,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
95600
95042
|
this._createOrUpdatePlayerComponent();
|
|
95601
95043
|
return bounds;
|
|
95602
95044
|
}
|
|
95603
|
-
changeRegions(regions) {
|
|
95604
|
-
}
|
|
95605
|
-
onRender(ctx) {
|
|
95606
|
-
}
|
|
95607
95045
|
_getNeedClearVRenderComponents() {
|
|
95608
95046
|
return [this._playerComponent];
|
|
95609
95047
|
}
|
|
@@ -95672,10 +95110,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
95672
95110
|
}
|
|
95673
95111
|
changePlayerIndex(index) {
|
|
95674
95112
|
const spec = this._specs[index];
|
|
95675
|
-
|
|
95676
|
-
var _a, _b;
|
|
95677
|
-
(_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance) === null || _b === void 0 ? void 0 : _b.updateData(data.id, data.values);
|
|
95678
|
-
});
|
|
95113
|
+
this._option.globalInstance.updateFullData(spec.data);
|
|
95679
95114
|
this.event.emit(exports.ChartEvent.playerChange, {
|
|
95680
95115
|
model: this,
|
|
95681
95116
|
value: {
|
|
@@ -95796,12 +95231,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
95796
95231
|
};
|
|
95797
95232
|
});
|
|
95798
95233
|
}
|
|
95799
|
-
|
|
95800
|
-
|
|
95801
|
-
|
|
95234
|
+
getVRenderComponents() {
|
|
95235
|
+
const labels = [];
|
|
95236
|
+
this.getMarks().forEach(m => {
|
|
95237
|
+
const graphicItem = m.getComponent();
|
|
95238
|
+
if (graphicItem) {
|
|
95239
|
+
labels.push(graphicItem);
|
|
95240
|
+
}
|
|
95241
|
+
});
|
|
95242
|
+
return labels;
|
|
95802
95243
|
}
|
|
95803
|
-
|
|
95804
|
-
|
|
95244
|
+
clear() {
|
|
95245
|
+
super.clear();
|
|
95246
|
+
this.getMarks().forEach(m => {
|
|
95247
|
+
if (m) {
|
|
95248
|
+
m.clearComponent();
|
|
95249
|
+
}
|
|
95250
|
+
});
|
|
95805
95251
|
}
|
|
95806
95252
|
}
|
|
95807
95253
|
BaseLabelComponent.type = ComponentTypeEnum.label;
|
|
@@ -96086,7 +95532,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96086
95532
|
}
|
|
96087
95533
|
_updateLabelComponentAttribute(labelComponent, baseMark, labelInfos) {
|
|
96088
95534
|
const totalLabels = this._option.getComponentsByType('totalLabel');
|
|
96089
|
-
labelComponent.clearComponent();
|
|
96090
95535
|
labelComponent.setMarkConfig({
|
|
96091
95536
|
interactive: false
|
|
96092
95537
|
});
|
|
@@ -96147,16 +95592,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96147
95592
|
m.compile({ group });
|
|
96148
95593
|
});
|
|
96149
95594
|
}
|
|
96150
|
-
getVRenderComponents() {
|
|
96151
|
-
const labels = [];
|
|
96152
|
-
this._labelComponentMap.forEach((infoFunc, component) => {
|
|
96153
|
-
const graphicItem = component.getComponent();
|
|
96154
|
-
if (graphicItem) {
|
|
96155
|
-
labels.push(graphicItem);
|
|
96156
|
-
}
|
|
96157
|
-
});
|
|
96158
|
-
return labels;
|
|
96159
|
-
}
|
|
96160
95595
|
getLabelInfoByTextGraphic(text) {
|
|
96161
95596
|
let labelInfo;
|
|
96162
95597
|
const vrenderLabel = text === null || text === void 0 ? void 0 : text.parent;
|
|
@@ -96280,7 +95715,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96280
95715
|
super.updateLayoutAttribute();
|
|
96281
95716
|
const series = this._getSeries();
|
|
96282
95717
|
this._marks.forEach((componentMark, index) => {
|
|
96283
|
-
componentMark.clearComponent();
|
|
96284
95718
|
componentMark.setMarkConfig({
|
|
96285
95719
|
interactive: false
|
|
96286
95720
|
});
|
|
@@ -96327,16 +95761,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96327
95761
|
m.compile({ group, context: { model: this } });
|
|
96328
95762
|
});
|
|
96329
95763
|
}
|
|
96330
|
-
getVRenderComponents() {
|
|
96331
|
-
const labels = [];
|
|
96332
|
-
this.getMarks().forEach(m => {
|
|
96333
|
-
const graphicItem = m.getComponent();
|
|
96334
|
-
if (graphicItem) {
|
|
96335
|
-
labels.push(graphicItem);
|
|
96336
|
-
}
|
|
96337
|
-
});
|
|
96338
|
-
return labels;
|
|
96339
|
-
}
|
|
96340
95764
|
_getSeries() {
|
|
96341
95765
|
return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0];
|
|
96342
95766
|
}
|
|
@@ -96409,7 +95833,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96409
95833
|
dx: 0,
|
|
96410
95834
|
dy: 0
|
|
96411
95835
|
};
|
|
96412
|
-
itemContentStyle = transformLabelAttributes(merge$1((_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style
|
|
95836
|
+
itemContentStyle = transformLabelAttributes(merge$1(defaultStyle, (_b = label !== null && label !== void 0 ? label : textStyle) !== null && _b !== void 0 ? _b : style), this._markerData, this._markAttributeContext);
|
|
96413
95837
|
}
|
|
96414
95838
|
else if (type === 'richText') {
|
|
96415
95839
|
itemContentState = (_c = richText === null || richText === void 0 ? void 0 : richText.state) !== null && _c !== void 0 ? _c : state;
|
|
@@ -96821,10 +96245,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96821
96245
|
}
|
|
96822
96246
|
initEvent() {
|
|
96823
96247
|
}
|
|
96824
|
-
onRender(ctx) {
|
|
96825
|
-
}
|
|
96826
|
-
changeRegions(regions) {
|
|
96827
|
-
}
|
|
96828
96248
|
_compareSpec(spec, prevSpec) {
|
|
96829
96249
|
if (this._brushComponents) {
|
|
96830
96250
|
this._relativeRegions.forEach((region, index) => {
|
|
@@ -97370,13 +96790,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97370
96790
|
result.reRender = true;
|
|
97371
96791
|
return result;
|
|
97372
96792
|
}
|
|
97373
|
-
changeRegions(regions) {
|
|
97374
|
-
}
|
|
97375
|
-
_getNeedClearVRenderComponents() {
|
|
97376
|
-
return [];
|
|
97377
|
-
}
|
|
97378
|
-
onRender(ctx) {
|
|
97379
|
-
}
|
|
97380
96793
|
_getMarkAttributeContext() {
|
|
97381
96794
|
return {
|
|
97382
96795
|
vchart: this._option.globalInstance,
|