@visactor/vchart 1.7.0-alpha.1 → 1.7.0
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 +1 -1
- package/build/index.js +858 -491
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/cartesian/cartesian.js +6 -4
- package/cjs/chart/cartesian/cartesian.js.map +1 -1
- package/cjs/chart/common/common.js +5 -2
- package/cjs/chart/common/common.js.map +1 -1
- package/cjs/chart/util.d.ts +8 -0
- package/cjs/chart/util.js +12 -2
- package/cjs/chart/util.js.map +1 -1
- package/cjs/compile/compiler.js +1 -1
- package/cjs/compile/compiler.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +5 -0
- package/cjs/compile/mark/compilable-mark.js +9 -1
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/compile/mark/interface.d.ts +2 -0
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -25
- package/cjs/component/axis/base-axis.js +3 -3
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +6 -2
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +4 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +69 -46
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -2
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/indicator/interface.d.ts +5 -1
- package/cjs/component/indicator/interface.js.map +1 -1
- package/cjs/component/label/interface.d.ts +4 -1
- package/cjs/component/label/interface.js.map +1 -1
- package/cjs/component/label/label.js +2 -2
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/util.d.ts +1 -1
- package/cjs/component/label/util.js +10 -7
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +4 -3
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-point/interface/theme.js.map +1 -1
- package/cjs/component/marker/utils.js +2 -1
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/component/title/interface/spec.d.ts +4 -2
- package/cjs/component/title/interface/spec.js.map +1 -1
- package/cjs/component/title/title.d.ts +3 -3
- package/cjs/component/title/title.js +12 -10
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.js +4 -3
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/common.d.ts +3 -2
- package/cjs/component/tooltip/handler/utils/common.js +7 -6
- package/cjs/component/tooltip/handler/utils/common.js.map +1 -1
- 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/data/transforms/dimension-statistics.js +4 -4
- package/cjs/data/transforms/dimension-statistics.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.js +1 -1
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/mark/base/base-line.js +1 -1
- package/cjs/mark/base/base-line.js.map +1 -1
- package/cjs/mark/text.d.ts +3 -1
- package/cjs/mark/text.js +9 -3
- package/cjs/mark/text.js.map +1 -1
- package/cjs/series/area/area.js +5 -4
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/bar/bar.js +6 -3
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.js +9 -4
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/circle-packing/circle-packing.js +3 -2
- package/cjs/series/circle-packing/circle-packing.js.map +1 -1
- package/cjs/series/correlation/correlation.js +5 -2
- package/cjs/series/correlation/correlation.js.map +1 -1
- package/cjs/series/funnel/funnel.js +9 -7
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/heatmap/heatmap.js +5 -2
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/interface/common.d.ts +2 -0
- package/cjs/series/interface/common.js.map +1 -1
- package/cjs/series/mixin/line-mixin.js +10 -7
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/interface.js.map +1 -1
- package/cjs/series/pie/pie.js +3 -1
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/progress/circular/circular.js +6 -2
- package/cjs/series/progress/circular/circular.js.map +1 -1
- package/cjs/series/progress/linear/linear.js +6 -2
- package/cjs/series/progress/linear/linear.js.map +1 -1
- package/cjs/series/radar/radar.js +3 -1
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/series/range-area/range-area.js +3 -1
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/range-column/range-column.js +7 -6
- package/cjs/series/range-column/range-column.js.map +1 -1
- package/cjs/series/rose/rose.js +3 -1
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/sankey.js +6 -4
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/scatter.js +3 -1
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/sunburst/animation/enter.js +2 -1
- package/cjs/series/sunburst/animation/enter.js.map +1 -1
- package/cjs/series/sunburst/animation/exit.js +3 -1
- package/cjs/series/sunburst/animation/exit.js.map +1 -1
- package/cjs/series/sunburst/animation/utils.js +3 -2
- package/cjs/series/sunburst/animation/utils.js.map +1 -1
- package/cjs/series/sunburst/sunburst.js +3 -1
- package/cjs/series/sunburst/sunburst.js.map +1 -1
- package/cjs/series/treemap/treemap.js +7 -5
- package/cjs/series/treemap/treemap.js.map +1 -1
- package/cjs/series/waterfall/waterfall.js +4 -3
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/cjs/theme/color-scheme/legacy.js +2 -2
- package/cjs/theme/color-scheme/legacy.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +2 -0
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/tooltip/line.d.ts +3 -2
- package/cjs/typings/tooltip/line.js.map +1 -1
- package/cjs/typings/visual.d.ts +3 -2
- package/cjs/typings/visual.js.map +1 -1
- package/esm/chart/cartesian/cartesian.js +10 -3
- package/esm/chart/cartesian/cartesian.js.map +1 -1
- package/esm/chart/common/common.js +9 -2
- package/esm/chart/common/common.js.map +1 -1
- package/esm/chart/util.d.ts +8 -0
- package/esm/chart/util.js +9 -0
- package/esm/chart/util.js.map +1 -1
- package/esm/compile/compiler.js +1 -1
- package/esm/compile/compiler.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +5 -0
- package/esm/compile/mark/compilable-mark.js +9 -1
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/compile/mark/interface.d.ts +2 -0
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -25
- package/esm/component/axis/base-axis.js +4 -4
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +6 -2
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +4 -1
- package/esm/component/data-zoom/data-filter-base-component.js +70 -46
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +3 -3
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/indicator/interface.d.ts +5 -1
- package/esm/component/indicator/interface.js.map +1 -1
- package/esm/component/label/interface.d.ts +4 -1
- package/esm/component/label/interface.js.map +1 -1
- package/esm/component/label/label.js +2 -2
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/util.d.ts +1 -1
- package/esm/component/label/util.js +14 -7
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/marker/interface.d.ts +4 -3
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-point/interface/theme.js.map +1 -1
- package/esm/component/marker/utils.js +2 -2
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/component/title/interface/spec.d.ts +4 -2
- package/esm/component/title/interface/spec.js.map +1 -1
- package/esm/component/title/title.d.ts +3 -3
- package/esm/component/title/title.js +17 -15
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +1 -1
- package/esm/component/tooltip/handler/utils/attribute.js +3 -3
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/tooltip/handler/utils/common.d.ts +3 -2
- package/esm/component/tooltip/handler/utils/common.js +7 -6
- package/esm/component/tooltip/handler/utils/common.js.map +1 -1
- 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/data/transforms/dimension-statistics.js +5 -5
- package/esm/data/transforms/dimension-statistics.js.map +1 -1
- package/esm/event/events/dimension/util/polar.js +2 -2
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/mark/base/base-line.js +1 -1
- package/esm/mark/base/base-line.js.map +1 -1
- package/esm/mark/text.d.ts +3 -1
- package/esm/mark/text.js +10 -2
- package/esm/mark/text.js.map +1 -1
- package/esm/series/area/area.js +5 -4
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/bar/bar.js +6 -3
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.js +9 -5
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/circle-packing/circle-packing.js +3 -2
- package/esm/series/circle-packing/circle-packing.js.map +1 -1
- package/esm/series/correlation/correlation.js +5 -2
- package/esm/series/correlation/correlation.js.map +1 -1
- package/esm/series/funnel/funnel.js +9 -7
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/heatmap/heatmap.js +5 -2
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/interface/common.d.ts +2 -0
- package/esm/series/interface/common.js.map +1 -1
- package/esm/series/mixin/line-mixin.js +10 -7
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/interface.js.map +1 -1
- package/esm/series/pie/pie.js +3 -1
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/progress/circular/circular.js +6 -2
- package/esm/series/progress/circular/circular.js.map +1 -1
- package/esm/series/progress/linear/linear.js +6 -2
- package/esm/series/progress/linear/linear.js.map +1 -1
- package/esm/series/radar/radar.js +3 -1
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/series/range-area/range-area.js +3 -1
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/range-column/range-column.js +7 -6
- package/esm/series/range-column/range-column.js.map +1 -1
- package/esm/series/rose/rose.js +3 -1
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/sankey.js +6 -4
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/scatter.js +3 -1
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/sunburst/animation/enter.js +2 -2
- package/esm/series/sunburst/animation/enter.js.map +1 -1
- package/esm/series/sunburst/animation/exit.js +3 -1
- package/esm/series/sunburst/animation/exit.js.map +1 -1
- package/esm/series/sunburst/animation/utils.js +3 -1
- package/esm/series/sunburst/animation/utils.js.map +1 -1
- package/esm/series/sunburst/sunburst.js +3 -1
- package/esm/series/sunburst/sunburst.js.map +1 -1
- package/esm/series/treemap/treemap.js +7 -5
- package/esm/series/treemap/treemap.js.map +1 -1
- package/esm/series/waterfall/waterfall.js +4 -3
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/esm/theme/color-scheme/legacy.js +2 -2
- package/esm/theme/color-scheme/legacy.js.map +1 -1
- package/esm/typings/spec/common.d.ts +2 -0
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/tooltip/line.d.ts +3 -2
- package/esm/typings/tooltip/line.js.map +1 -1
- package/esm/typings/visual.d.ts +3 -2
- package/esm/typings/visual.js.map +1 -1
- package/package.json +16 -16
package/build/index.js
CHANGED
|
@@ -707,12 +707,26 @@
|
|
|
707
707
|
return val[val.length - 1];
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
710
|
+
const maxInArray = (arr, compareFn) => {
|
|
711
|
+
var _a;
|
|
712
|
+
if (0 === arr.length) return;
|
|
713
|
+
let max = arr[0];
|
|
714
|
+
for (let i = 1; i < arr.length; i++) {
|
|
715
|
+
const value = arr[i];
|
|
716
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max > 0) && (max = value);
|
|
717
|
+
}
|
|
718
|
+
return max;
|
|
719
|
+
};
|
|
720
|
+
const minInArray = (arr, compareFn) => {
|
|
721
|
+
var _a;
|
|
722
|
+
if (0 === arr.length) return;
|
|
723
|
+
let min = arr[0];
|
|
724
|
+
for (let i = 1; i < arr.length; i++) {
|
|
725
|
+
const value = arr[i];
|
|
726
|
+
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min < 0) && (min = value);
|
|
727
|
+
}
|
|
728
|
+
return min;
|
|
729
|
+
};
|
|
716
730
|
function arrayEqual(a, b) {
|
|
717
731
|
if (!isArray$1(a) || !isArray$1(b)) return !1;
|
|
718
732
|
if (a.length !== b.length) return !1;
|
|
@@ -991,6 +1005,10 @@
|
|
|
991
1005
|
return isNil$1(val) ? new Date(NaN) : new Date(Math.round(val));
|
|
992
1006
|
}
|
|
993
1007
|
|
|
1008
|
+
function substitute(str, o) {
|
|
1009
|
+
return str && o ? str.replace(/\\?\{([^{}]+)\}/g, (match, name) => "\\" === match.charAt(0) ? match.slice(1) : void 0 === o[name] ? "" : o[name]) : str;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
994
1012
|
const epsilon$1 = 1e-12;
|
|
995
1013
|
const pi$1 = Math.PI;
|
|
996
1014
|
const halfPi$2 = pi$1 / 2;
|
|
@@ -999,8 +1017,8 @@
|
|
|
999
1017
|
const abs$1 = Math.abs;
|
|
1000
1018
|
const atan2$1 = Math.atan2;
|
|
1001
1019
|
const cos$1 = Math.cos;
|
|
1002
|
-
const max$
|
|
1003
|
-
const min$
|
|
1020
|
+
const max$1 = Math.max;
|
|
1021
|
+
const min$1 = Math.min;
|
|
1004
1022
|
const sin$1 = Math.sin;
|
|
1005
1023
|
const sqrt$3 = Math.sqrt;
|
|
1006
1024
|
const pow$1 = Math.pow;
|
|
@@ -7282,7 +7300,9 @@
|
|
|
7282
7300
|
r0 = r1 - wholeLength;
|
|
7283
7301
|
this._wholeRange = [r0, r1];
|
|
7284
7302
|
}
|
|
7285
|
-
|
|
7303
|
+
const canAlignStart = this._rangeFactorStart + rangeFactorSize <= 1,
|
|
7304
|
+
canAlignEnd = this._rangeFactorEnd - rangeFactorSize >= 0;
|
|
7305
|
+
"rangeFactorStart" === changeProperty && canAlignStart ? this._rangeFactorEnd = this._rangeFactorStart + rangeFactorSize : "rangeFactorEnd" === changeProperty && canAlignEnd ? this._rangeFactorStart = this._rangeFactorEnd - rangeFactorSize : range[0] <= range[1] ? canAlignStart ? this._rangeFactorEnd = this._rangeFactorStart + rangeFactorSize : canAlignEnd ? this._rangeFactorStart = this._rangeFactorEnd - rangeFactorSize : (this._rangeFactorStart = 0, this._rangeFactorEnd = rangeFactorSize) : canAlignEnd ? this._rangeFactorStart = this._rangeFactorEnd - rangeFactorSize : canAlignStart ? this._rangeFactorEnd = this._rangeFactorStart + rangeFactorSize : (this._rangeFactorStart = 1 - rangeFactorSize, this._rangeFactorEnd = 1);
|
|
7286
7306
|
} else this._rangeFactorStart = 0, this._rangeFactorEnd = rangeFactorSize, this._wholeRange = [range[0], range[0] + wholeLength];
|
|
7287
7307
|
return this._wholeRange;
|
|
7288
7308
|
}
|
|
@@ -10366,8 +10386,8 @@
|
|
|
10366
10386
|
return direction === Direction$2.ROW ? abs$1(this.p0.x - this.p3.x) : direction === Direction$2.COLUMN ? abs$1(this.p0.y - this.p3.y) : 0;
|
|
10367
10387
|
}
|
|
10368
10388
|
getAngleAt(t) {
|
|
10369
|
-
const minT = max$
|
|
10370
|
-
maxT = min$
|
|
10389
|
+
const minT = max$1(t - .01, 0),
|
|
10390
|
+
maxT = min$1(t + .01, 1),
|
|
10371
10391
|
minP = this.getPointAt(minT),
|
|
10372
10392
|
maxP = this.getPointAt(maxT);
|
|
10373
10393
|
return atan2$1(maxP.y - minP.y, maxP.x - minP.x);
|
|
@@ -12745,7 +12765,7 @@
|
|
|
12745
12765
|
return "mouse" === pointerType || "pen" === pointerType;
|
|
12746
12766
|
}
|
|
12747
12767
|
class EventManager {
|
|
12748
|
-
constructor(root) {
|
|
12768
|
+
constructor(root, config) {
|
|
12749
12769
|
this.dispatch = new EventEmitter(), this.mappingState = {
|
|
12750
12770
|
trackingData: {}
|
|
12751
12771
|
}, this.eventPool = new Map(), this.onPointerDown = (from, target) => {
|
|
@@ -12811,6 +12831,7 @@
|
|
|
12811
12831
|
}
|
|
12812
12832
|
this.cursor = "";
|
|
12813
12833
|
}, this.onPointerUp = (from, target) => {
|
|
12834
|
+
var _a;
|
|
12814
12835
|
if (!(from instanceof FederatedPointerEvent)) return void console.warn("EventManager cannot map a non-pointer event as a pointer event");
|
|
12815
12836
|
const now = clock.now(),
|
|
12816
12837
|
e = this.createPointerEvent(from, from.type, target);
|
|
@@ -12840,7 +12861,7 @@
|
|
|
12840
12861
|
timeStamp: now
|
|
12841
12862
|
});
|
|
12842
12863
|
const clickHistory = trackingData.clicksByButton[from.button];
|
|
12843
|
-
clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < 200 ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && this.dispatchEvent(clickEvent, "tap"), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
|
|
12864
|
+
clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < (null !== (_a = this._config.clickInterval) && void 0 !== _a ? _a : 200) ? ++clickHistory.clickCount : clickHistory.clickCount = 1, clickHistory.target = clickEvent.target, clickHistory.timeStamp = now, clickEvent.detail = clickHistory.clickCount, isMouseLike(clickEvent.pointerType) ? (this.dispatchEvent(clickEvent, "click"), 2 === clickHistory.clickCount && this.dispatchEvent(clickEvent, "dblclick")) : "touch" === clickEvent.pointerType && this.dispatchEvent(clickEvent, "tap"), this.dispatchEvent(clickEvent, "pointertap"), this.freeEvent(clickEvent);
|
|
12844
12865
|
}
|
|
12845
12866
|
this.freeEvent(e);
|
|
12846
12867
|
}, this.onPointerUpOutside = (from, target) => {
|
|
@@ -12858,7 +12879,9 @@
|
|
|
12858
12879
|
if (!(from instanceof FederatedWheelEvent)) return void console.warn("EventManager cannot map a non-wheel event as a wheel event");
|
|
12859
12880
|
const wheelEvent = this.createWheelEvent(from, target);
|
|
12860
12881
|
this.dispatchEvent(wheelEvent), this.freeEvent(wheelEvent);
|
|
12861
|
-
}, this.rootTarget = root, this.mappingTable = {}, this.
|
|
12882
|
+
}, this.rootTarget = root, this.mappingTable = {}, this._config = Object.assign({
|
|
12883
|
+
clickInterval: 200
|
|
12884
|
+
}, config), this.addEventMapping("pointerdown", this.onPointerDown), this.addEventMapping("pointermove", this.onPointerMove), this.addEventMapping("pointerout", this.onPointerOut), this.addEventMapping("pointerleave", this.onPointerOut), this.addEventMapping("pointerover", this.onPointerOver), this.addEventMapping("pointerup", this.onPointerUp), this.addEventMapping("pointerupoutside", this.onPointerUpOutside), this.addEventMapping("wheel", this.onWheel);
|
|
12862
12885
|
}
|
|
12863
12886
|
addEventMapping(type, fn) {
|
|
12864
12887
|
this.mappingTable[type] || (this.mappingTable[type] = []), this.mappingTable[type].push({
|
|
@@ -13042,9 +13065,12 @@
|
|
|
13042
13065
|
rootNode: rootNode,
|
|
13043
13066
|
global: global,
|
|
13044
13067
|
viewport: viewport,
|
|
13045
|
-
autoPreventDefault = !1
|
|
13068
|
+
autoPreventDefault = !1,
|
|
13069
|
+
clickInterval: clickInterval
|
|
13046
13070
|
} = params;
|
|
13047
|
-
this.manager = new EventManager(rootNode
|
|
13071
|
+
this.manager = new EventManager(rootNode, {
|
|
13072
|
+
clickInterval: clickInterval
|
|
13073
|
+
}), this.globalObj = global, this.supportsPointerEvents = global.supportsPointerEvents, this.supportsTouchEvents = global.supportsTouchEvents, this.supportsMouseEvents = global.supportsMouseEvents, this.applyStyles = global.applyStyles, this.autoPreventDefault = autoPreventDefault, this.eventsAdded = !1, this.viewport = viewport, this.rootPointerEvent = new FederatedPointerEvent(), this.rootWheelEvent = new FederatedWheelEvent(), this.cursorStyles = {
|
|
13048
13074
|
default: "inherit",
|
|
13049
13075
|
pointer: "pointer"
|
|
13050
13076
|
}, this.resolution = resolution, this.setTargetElement(targetElement);
|
|
@@ -13543,7 +13569,7 @@
|
|
|
13543
13569
|
afterAll(list) {
|
|
13544
13570
|
let maxT = -1 / 0;
|
|
13545
13571
|
return list.forEach(a => {
|
|
13546
|
-
maxT = max$
|
|
13572
|
+
maxT = max$1(a.getDuration(), maxT);
|
|
13547
13573
|
}), this._startTime = maxT, this;
|
|
13548
13574
|
}
|
|
13549
13575
|
parallel(animate) {
|
|
@@ -15321,7 +15347,7 @@
|
|
|
15321
15347
|
|
|
15322
15348
|
const tempMatrix = new Matrix(),
|
|
15323
15349
|
tempBounds$1 = new AABBBounds();
|
|
15324
|
-
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "
|
|
15350
|
+
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
15325
15351
|
const tempConstantXYKey = ["x", "y"],
|
|
15326
15352
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
15327
15353
|
tempConstantAngleKey = ["angle"],
|
|
@@ -16892,19 +16918,19 @@
|
|
|
16892
16918
|
by = yore - oc[1],
|
|
16893
16919
|
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
16894
16920
|
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
16895
|
-
limitedIcr = min$
|
|
16921
|
+
limitedIcr = min$1(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$1(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
16896
16922
|
}
|
|
16897
16923
|
}
|
|
16898
16924
|
if (outerDeltaAngle < .001) partStroke && (partStroke[3] || partStroke[1]) && context.moveTo(cx + xors, cy + yors), collapsedToLine = !0;else if (limitedOcr > epsilon$1) {
|
|
16899
|
-
const cornerRadiusStart = min$
|
|
16900
|
-
cornerRadiusEnd = min$
|
|
16925
|
+
const cornerRadiusStart = min$1(outerCornerRadiusStart, limitedOcr),
|
|
16926
|
+
cornerRadiusEnd = min$1(outerCornerRadiusEnd, limitedOcr),
|
|
16901
16927
|
t0 = cornerTangents(xirs, yirs, xors, yors, outerRadius, cornerRadiusStart, Number(clockwise)),
|
|
16902
16928
|
t1 = cornerTangents(xore, yore, xire, yire, outerRadius, cornerRadiusEnd, Number(clockwise));
|
|
16903
16929
|
limitedOcr < maxOuterCornerRadius && cornerRadiusStart === cornerRadiusEnd ? !partStroke || partStroke[0] ? (context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01), context.arc(cx + t0.cx, cy + t0.cy, limitedOcr, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !clockwise)) : context.moveTo(cx + t0.cx + limitedOcr * cos$1(atan2$1(t1.y01, t1.x01)), cy + t0.cy + limitedOcr * sin$1(atan2$1(t1.y01, t1.x01))) : !partStroke || partStroke[0] ? (context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01), cornerRadiusStart > 0 && context.arc(cx + t0.cx, cy + t0.cy, cornerRadiusStart, atan2$1(t0.y01, t0.x01), atan2$1(t0.y11, t0.x11), !clockwise), context.arc(cx, cy, outerRadius, atan2$1(t0.cy + t0.y11, t0.cx + t0.x11), atan2$1(t1.cy + t1.y11, t1.cx + t1.x11), !clockwise), cornerRadiusEnd > 0 && context.arc(cx + t1.cx, cy + t1.cy, cornerRadiusEnd, atan2$1(t1.y11, t1.x11), atan2$1(t1.y01, t1.x01), !clockwise)) : cornerRadiusEnd > 0 ? context.moveTo(cx + t1.cx + cornerRadiusEnd * cos$1(atan2$1(t1.y01, t1.x01)), cy + t1.cy + cornerRadiusEnd * sin$1(atan2$1(t1.y01, t1.x01))) : context.moveTo(cx + xore, cy + outerRadius * sin$1(outerEndAngle));
|
|
16904
16930
|
} else !partStroke || partStroke[0] ? (context.moveTo(cx + xors, cy + yors), context.arc(cx, cy, outerRadius, outerStartAngle, outerEndAngle, !clockwise)) : context.moveTo(cx + outerRadius * cos$1(outerEndAngle), cy + outerRadius * sin$1(outerEndAngle));
|
|
16905
16931
|
if (!(innerRadius > epsilon$1) || innerDeltaAngle < .001) !partStroke || partStroke[1] ? context.lineTo(cx + xire, cy + yire) : context.moveTo(cx + xire, cy + yire), collapsedToLine = !0;else if (limitedIcr > epsilon$1) {
|
|
16906
|
-
const cornerRadiusStart = min$
|
|
16907
|
-
cornerRadiusEnd = min$
|
|
16932
|
+
const cornerRadiusStart = min$1(innerCornerRadiusStart, limitedIcr),
|
|
16933
|
+
cornerRadiusEnd = min$1(innerCornerRadiusEnd, limitedIcr),
|
|
16908
16934
|
t0 = cornerTangents(xire, yire, xore, yore, innerRadius, -cornerRadiusEnd, Number(clockwise)),
|
|
16909
16935
|
t1 = cornerTangents(xors, yors, xirs, yirs, innerRadius, -cornerRadiusStart, Number(clockwise));
|
|
16910
16936
|
if (!partStroke || partStroke[1] ? context.lineTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01) : context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01), limitedIcr < maxInnerCornerRadius && cornerRadiusStart === cornerRadiusEnd) {
|
|
@@ -17582,7 +17608,7 @@
|
|
|
17582
17608
|
if (width = 0, !this.shouldUpdateShape() && this.cache) {
|
|
17583
17609
|
this.cache.verticalList.forEach(item => {
|
|
17584
17610
|
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17585
|
-
width = max$
|
|
17611
|
+
width = max$1(w, width);
|
|
17586
17612
|
});
|
|
17587
17613
|
const dx = textDrawOffsetX(textAlign, width),
|
|
17588
17614
|
height = this.cache.verticalList.length * lineHeight,
|
|
@@ -17618,7 +17644,7 @@
|
|
|
17618
17644
|
});
|
|
17619
17645
|
}), this.cache.verticalList = verticalLists, this.clearUpdateShapeTag(), this.cache.verticalList.forEach(item => {
|
|
17620
17646
|
const w = item.reduce((a, b) => a + b.width, 0);
|
|
17621
|
-
width = max$
|
|
17647
|
+
width = max$1(w, width);
|
|
17622
17648
|
});
|
|
17623
17649
|
const dx = textDrawOffsetX(textAlign, width),
|
|
17624
17650
|
height = this.cache.verticalList.length * lineHeight,
|
|
@@ -18310,9 +18336,7 @@
|
|
|
18310
18336
|
cacheList = [];
|
|
18311
18337
|
path.forEach(item => {
|
|
18312
18338
|
const cache = new CustomPath2D().fromString(item.d),
|
|
18313
|
-
attribute = {
|
|
18314
|
-
fill: "black"
|
|
18315
|
-
};
|
|
18339
|
+
attribute = {};
|
|
18316
18340
|
SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {
|
|
18317
18341
|
item[k] && (attribute[SVG_PARSE_ATTRIBUTE_MAP[k]] = item[k]);
|
|
18318
18342
|
}), cacheList.push({
|
|
@@ -18322,13 +18346,13 @@
|
|
|
18322
18346
|
});
|
|
18323
18347
|
const width = b.width(),
|
|
18324
18348
|
height = b.height(),
|
|
18325
|
-
scale = 1 / max$
|
|
18349
|
+
scale = 1 / max$1(width, height);
|
|
18326
18350
|
return cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale)), this._parsedPath = new CustomSymbolClass(symbolType, cacheList, !0), Symbol.userSymbolMap[symbolType] = this._parsedPath, this._parsedPath;
|
|
18327
18351
|
}
|
|
18328
18352
|
const cache = new CustomPath2D().fromString(symbolType),
|
|
18329
18353
|
width = cache.bounds.width(),
|
|
18330
18354
|
height = cache.bounds.height(),
|
|
18331
|
-
scale = 1 / max$
|
|
18355
|
+
scale = 1 / max$1(width, height);
|
|
18332
18356
|
return cache.transform(0, 0, scale, scale), this._parsedPath = new CustomSymbolClass(symbolType, cache), Symbol.userSymbolMap[symbolType] = this._parsedPath, this._parsedPath;
|
|
18333
18357
|
}
|
|
18334
18358
|
doUpdateAABBBounds(full) {
|
|
@@ -18510,7 +18534,7 @@
|
|
|
18510
18534
|
{
|
|
18511
18535
|
width = rectTheme.width,
|
|
18512
18536
|
height = rectTheme.width,
|
|
18513
|
-
length = min$
|
|
18537
|
+
length = min$1(rectTheme.width, rectTheme.height)
|
|
18514
18538
|
} = this.attribute;
|
|
18515
18539
|
for (let i = 0; i < CUBE_VERTICES.length; i++) {
|
|
18516
18540
|
const v = CUBE_VERTICES[i];
|
|
@@ -19229,7 +19253,7 @@
|
|
|
19229
19253
|
doUpdateFrameCache() {
|
|
19230
19254
|
var _a;
|
|
19231
19255
|
const {
|
|
19232
|
-
textConfig
|
|
19256
|
+
textConfig = [],
|
|
19233
19257
|
maxWidth: maxWidth,
|
|
19234
19258
|
maxHeight: maxHeight,
|
|
19235
19259
|
width: width,
|
|
@@ -19737,9 +19761,9 @@
|
|
|
19737
19761
|
if (kList[i] === kList[j]) {
|
|
19738
19762
|
find = !0;
|
|
19739
19763
|
const d1 = PointService.distancePP(pointsMap[i].p, pointsMap[i + 1].p);
|
|
19740
|
-
pointsMap[i].d = d1, pointsMap[i + 1].d = d1, maxD = max$
|
|
19764
|
+
pointsMap[i].d = d1, pointsMap[i + 1].d = d1, maxD = max$1(maxD, d1);
|
|
19741
19765
|
const d2 = PointService.distancePP(pointsMap[j].p, pointsMap[j + 1].p);
|
|
19742
|
-
pointsMap[j].d = d2, pointsMap[j + 1].d = d2, maxD = max$
|
|
19766
|
+
pointsMap[j].d = d2, pointsMap[j + 1].d = d2, maxD = max$1(maxD, d2);
|
|
19743
19767
|
}
|
|
19744
19768
|
if (find) break;
|
|
19745
19769
|
}
|
|
@@ -20145,6 +20169,7 @@
|
|
|
20145
20169
|
return renderCommandList(path.commandList, boundsContext, 0, 0), !0;
|
|
20146
20170
|
}
|
|
20147
20171
|
updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
|
|
20172
|
+
if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20148
20173
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
20149
20174
|
const {
|
|
20150
20175
|
width = rectTheme.width,
|
|
@@ -20175,11 +20200,12 @@
|
|
|
20175
20200
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, graphic), aabbBounds;
|
|
20176
20201
|
}
|
|
20177
20202
|
updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
|
|
20178
|
-
return graphic.getSubGraphic().forEach(node => {
|
|
20203
|
+
return this._validCheck(attribute, theme, aabbBounds, graphic) ? (graphic.getSubGraphic().forEach(node => {
|
|
20179
20204
|
aabbBounds.union(node.AABBBounds);
|
|
20180
|
-
}), aabbBounds;
|
|
20205
|
+
}), aabbBounds) : aabbBounds;
|
|
20181
20206
|
}
|
|
20182
20207
|
updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
|
|
20208
|
+
if (!this._validCheck(attribute, richtextTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20183
20209
|
if (!graphic) return aabbBounds;
|
|
20184
20210
|
const {
|
|
20185
20211
|
width = richtextTheme.width,
|
|
@@ -20227,6 +20253,7 @@
|
|
|
20227
20253
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, graphic), aabbBounds;
|
|
20228
20254
|
}
|
|
20229
20255
|
updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
|
|
20256
|
+
if (!this._validCheck(attribute, textTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20230
20257
|
if (!graphic) return aabbBounds;
|
|
20231
20258
|
const {
|
|
20232
20259
|
text = textTheme.text
|
|
@@ -20248,6 +20275,7 @@
|
|
|
20248
20275
|
return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
|
|
20249
20276
|
}
|
|
20250
20277
|
updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
|
|
20278
|
+
if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20251
20279
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
|
|
20252
20280
|
const tb1 = this.tempAABBBounds1,
|
|
20253
20281
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20292,6 +20320,7 @@
|
|
|
20292
20320
|
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.transformAABBBounds(attribute, aabbBounds, arcTheme, !1, graphic), aabbBounds;
|
|
20293
20321
|
}
|
|
20294
20322
|
updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
|
|
20323
|
+
if (!this._validCheck(attribute, polygonTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20295
20324
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
|
|
20296
20325
|
const tb1 = this.tempAABBBounds1,
|
|
20297
20326
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20310,6 +20339,7 @@
|
|
|
20310
20339
|
}), aabbBounds;
|
|
20311
20340
|
}
|
|
20312
20341
|
updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
|
|
20342
|
+
if (!this._validCheck(attribute, lineTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20313
20343
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
|
|
20314
20344
|
const tb1 = this.tempAABBBounds1,
|
|
20315
20345
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20340,6 +20370,7 @@
|
|
|
20340
20370
|
}), b;
|
|
20341
20371
|
}
|
|
20342
20372
|
updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
|
|
20373
|
+
if (!this._validCheck(attribute, areaTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20343
20374
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
|
|
20344
20375
|
const tb1 = this.tempAABBBounds1,
|
|
20345
20376
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20372,6 +20403,7 @@
|
|
|
20372
20403
|
}), b;
|
|
20373
20404
|
}
|
|
20374
20405
|
updateCircleAABBBounds(attribute, circleTheme, aabbBounds, full, graphic) {
|
|
20406
|
+
if (!this._validCheck(attribute, circleTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20375
20407
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic));
|
|
20376
20408
|
const tb1 = this.tempAABBBounds1,
|
|
20377
20409
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20394,6 +20426,7 @@
|
|
|
20394
20426
|
return endAngle - startAngle > pi2 - epsilon$1 ? aabbBounds.set(-radius, -radius, radius, radius) : circleBounds(startAngle, endAngle, radius, aabbBounds), aabbBounds;
|
|
20395
20427
|
}
|
|
20396
20428
|
updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
|
|
20429
|
+
if (!this._validCheck(attribute, arcTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20397
20430
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
|
|
20398
20431
|
const tb1 = this.tempAABBBounds1,
|
|
20399
20432
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20431,6 +20464,7 @@
|
|
|
20431
20464
|
return outerRadius <= epsilon$1 ? aabbBounds.set(0, 0, 0, 0) : Math.abs(endAngle - startAngle) > pi2 - epsilon$1 ? aabbBounds.set(-outerRadius, -outerRadius, outerRadius, outerRadius) : (circleBounds(startAngle, endAngle, outerRadius, aabbBounds), circleBounds(startAngle, endAngle, innerRadius, aabbBounds)), aabbBounds;
|
|
20432
20465
|
}
|
|
20433
20466
|
updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
|
|
20467
|
+
if (!this._validCheck(attribute, symbolTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20434
20468
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
|
|
20435
20469
|
const tb1 = this.tempAABBBounds1,
|
|
20436
20470
|
tb2 = this.tempAABBBounds2;
|
|
@@ -20460,6 +20494,7 @@
|
|
|
20460
20494
|
return graphic.getParsedPath().bounds(size, aabbBounds), aabbBounds;
|
|
20461
20495
|
}
|
|
20462
20496
|
updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
|
|
20497
|
+
if (!this._validCheck(attribute, imageTheme, aabbBounds, graphic)) return aabbBounds;
|
|
20463
20498
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
20464
20499
|
const {
|
|
20465
20500
|
width = imageTheme.width,
|
|
@@ -20498,6 +20533,14 @@
|
|
|
20498
20533
|
}
|
|
20499
20534
|
this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
|
|
20500
20535
|
}
|
|
20536
|
+
_validCheck(attribute, theme, aabbBounds, graphic) {
|
|
20537
|
+
if (!graphic) return !0;
|
|
20538
|
+
if (!graphic.valid) return aabbBounds.clear(), !1;
|
|
20539
|
+
const {
|
|
20540
|
+
visible = theme.visible
|
|
20541
|
+
} = attribute;
|
|
20542
|
+
return !!visible || (aabbBounds.clear(), !1);
|
|
20543
|
+
}
|
|
20501
20544
|
};
|
|
20502
20545
|
DefaultGraphicService = __decorate$1B([injectable(), __param$P(0, inject(GraphicCreator)), __param$P(1, inject(ContributionProvider)), __param$P(1, named(RectBoundsContribution)), __param$P(2, inject(ContributionProvider)), __param$P(2, named(SymbolBoundsContribution)), __param$P(3, inject(ContributionProvider)), __param$P(3, named(CircleBoundsContribution)), __param$P(4, inject(ContributionProvider)), __param$P(4, named(ArcBoundsContribution)), __param$P(5, inject(ContributionProvider)), __param$P(5, named(PathBoundsContribution)), __metadata$13("design:paramtypes", [Object, Object, Object, Object, Object, Object])], DefaultGraphicService);
|
|
20503
20546
|
|
|
@@ -20815,12 +20858,12 @@
|
|
|
20815
20858
|
by = yore - oc[1],
|
|
20816
20859
|
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
20817
20860
|
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
20818
|
-
limitedIcr = min$
|
|
20861
|
+
limitedIcr = min$1(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$1(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
20819
20862
|
}
|
|
20820
20863
|
}
|
|
20821
20864
|
if (limitedOcr > epsilon$1) {
|
|
20822
|
-
const cornerRadiusStart = min$
|
|
20823
|
-
cornerRadiusEnd = min$
|
|
20865
|
+
const cornerRadiusStart = min$1(outerCornerRadiusStart, limitedOcr),
|
|
20866
|
+
cornerRadiusEnd = min$1(outerCornerRadiusEnd, limitedOcr),
|
|
20824
20867
|
t0 = cornerTangents(xirs, yirs, xors, yors, outerRadius, cornerRadiusStart, Number(clockwise)),
|
|
20825
20868
|
t1 = cornerTangents(xore, yore, xire, yire, outerRadius, cornerRadiusEnd, Number(clockwise));
|
|
20826
20869
|
if (limitedOcr < maxOuterCornerRadius && cornerRadiusStart === cornerRadiusEnd) context.moveTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01), context.arc(cx + t0.cx, cy + t0.cy, limitedOcr, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !clockwise);else {
|
|
@@ -20830,8 +20873,8 @@
|
|
|
20830
20873
|
}
|
|
20831
20874
|
} else context.moveTo(cx + xors, cy + yors);
|
|
20832
20875
|
if (!(innerRadius > epsilon$1) || innerDeltaAngle < .001) context.lineTo(cx + xire, cy + yire), collapsedToLine = !0;else if (limitedIcr > epsilon$1) {
|
|
20833
|
-
const cornerRadiusStart = min$
|
|
20834
|
-
cornerRadiusEnd = min$
|
|
20876
|
+
const cornerRadiusStart = min$1(innerCornerRadiusStart, limitedIcr),
|
|
20877
|
+
cornerRadiusEnd = min$1(innerCornerRadiusEnd, limitedIcr),
|
|
20835
20878
|
t0 = cornerTangents(xire, yire, xore, yore, innerRadius, -cornerRadiusEnd, Number(clockwise)),
|
|
20836
20879
|
t1 = cornerTangents(xors, yors, xirs, yirs, innerRadius, -cornerRadiusStart, Number(clockwise));
|
|
20837
20880
|
if (context.lineTo(cx + t0.cx + t0.x01, cy + t0.cy + t0.y01), limitedIcr < maxInnerCornerRadius && cornerRadiusStart === cornerRadiusEnd) {
|
|
@@ -21048,7 +21091,7 @@
|
|
|
21048
21091
|
needMoveTo = !0;
|
|
21049
21092
|
continue;
|
|
21050
21093
|
}
|
|
21051
|
-
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, min$
|
|
21094
|
+
needMoveTo && path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), drawSegItem$1(path, curve, min$1(_p, 1), params), needMoveTo = !1;
|
|
21052
21095
|
}
|
|
21053
21096
|
}
|
|
21054
21097
|
}
|
|
@@ -21229,7 +21272,7 @@
|
|
|
21229
21272
|
if (skip) return;
|
|
21230
21273
|
const curSegLength = cache.getLength(),
|
|
21231
21274
|
_cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;
|
|
21232
|
-
drawedLengthUntilLast += curSegLength, _cr > 0 && (skip = this.drawSegmentItem(context, cache, !!fill, !!stroke, fillOpacity, strokeOpacity, segments[index], [lineAttribute, line.attribute], min$
|
|
21275
|
+
drawedLengthUntilLast += curSegLength, _cr > 0 && (skip = this.drawSegmentItem(context, cache, !!fill, !!stroke, fillOpacity, strokeOpacity, segments[index], [lineAttribute, line.attribute], min$1(_cr, 1), clipRangeByDimension, x, y, line, fillCb, strokeCb));
|
|
21233
21276
|
});
|
|
21234
21277
|
}
|
|
21235
21278
|
} else this.drawSegmentItem(context, line.cache, !!fill, !!stroke, fillOpacity, strokeOpacity, line.attribute, lineAttribute, clipRange, clipRangeByDimension, x, y, line, fillCb, strokeCb);
|
|
@@ -21515,7 +21558,7 @@
|
|
|
21515
21558
|
if (skip) return;
|
|
21516
21559
|
const curSegLength = cache.top.getLength(),
|
|
21517
21560
|
_cr = (totalDrawLength - drawedLengthUntilLast) / curSegLength;
|
|
21518
|
-
drawedLengthUntilLast += curSegLength, _cr > 0 && (skip = this.drawSegmentItem(context, cache, doFill, fillOpacity, doStroke, strokeOpacity, segments[index], [areaAttribute, area.attribute], min$
|
|
21561
|
+
drawedLengthUntilLast += curSegLength, _cr > 0 && (skip = this.drawSegmentItem(context, cache, doFill, fillOpacity, doStroke, strokeOpacity, segments[index], [areaAttribute, area.attribute], min$1(_cr, 1), x, y, z, area, drawContext, fillCb, strokeCb));
|
|
21519
21562
|
});
|
|
21520
21563
|
}
|
|
21521
21564
|
} else this.drawSegmentItem(context, area.cacheArea, doFill, fillOpacity, doStroke, strokeOpacity, area.attribute, areaAttribute, clipRange, x, y, z, area, drawContext, fillCb, strokeCb);
|
|
@@ -21795,10 +21838,20 @@
|
|
|
21795
21838
|
const p = context.project(x, y, z),
|
|
21796
21839
|
camera = context.camera;
|
|
21797
21840
|
context.camera = null, !1 === parsedPath.draw(context, size, p.x, p.y, void 0, (p, a) => {
|
|
21798
|
-
|
|
21841
|
+
var _a, _b, _c;
|
|
21842
|
+
if (symbol._parsedPath.svgCache) {
|
|
21843
|
+
const obj = Object.assign({}, a);
|
|
21844
|
+
obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.fill) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
|
|
21845
|
+
}
|
|
21846
|
+
a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill())), a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
21799
21847
|
}) && context.closePath(), context.camera = camera;
|
|
21800
21848
|
} else !1 === parsedPath.draw(context, size, x, y, z, (p, a) => {
|
|
21801
|
-
|
|
21849
|
+
var _a, _b, _c;
|
|
21850
|
+
if (symbol._parsedPath.svgCache) {
|
|
21851
|
+
const obj = Object.assign({}, a);
|
|
21852
|
+
obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
|
|
21853
|
+
}
|
|
21854
|
+
a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill())), a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
21802
21855
|
}) && context.closePath();
|
|
21803
21856
|
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb), doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill())), doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke())), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
21804
21857
|
}
|
|
@@ -21904,7 +21957,7 @@
|
|
|
21904
21957
|
let totalW = 0;
|
|
21905
21958
|
verticalList.forEach(verticalData => {
|
|
21906
21959
|
const _w = verticalData.reduce((a, b) => a + (b.width || 0), 0);
|
|
21907
|
-
totalW = max$
|
|
21960
|
+
totalW = max$1(_w, totalW);
|
|
21908
21961
|
});
|
|
21909
21962
|
let offsetY = 0,
|
|
21910
21963
|
offsetX = 0;
|
|
@@ -22172,7 +22225,7 @@
|
|
|
22172
22225
|
let repeat = 0;
|
|
22173
22226
|
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
22174
22227
|
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
22175
|
-
context.fillStyle = pattern, context.
|
|
22228
|
+
context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
|
|
22176
22229
|
} else context.drawImage(res.data, x, y, width, height);
|
|
22177
22230
|
needRestore && context.restore();
|
|
22178
22231
|
}
|
|
@@ -23169,7 +23222,7 @@
|
|
|
23169
23222
|
graphic.add(g);
|
|
23170
23223
|
});
|
|
23171
23224
|
} else result = pickerService.pickGroup(graphic, point, params.parentMatrix, pickParams);
|
|
23172
|
-
return context.camera = null, pickParams.in3dInterceptor = !1, result;
|
|
23225
|
+
return context.camera = null, pickParams.in3dInterceptor = !1, context.restore(), result;
|
|
23173
23226
|
}
|
|
23174
23227
|
return context.restore(), null;
|
|
23175
23228
|
}
|
|
@@ -25262,7 +25315,7 @@
|
|
|
25262
25315
|
}
|
|
25263
25316
|
computeColor(normal, color) {
|
|
25264
25317
|
const lightDir = this.formatedDir,
|
|
25265
|
-
brightness = min$
|
|
25318
|
+
brightness = min$1(max$1((normal[0] * lightDir[0] + normal[1] * lightDir[1] + normal[2] * lightDir[2]) * (1 - this.ambient / 2), 0) + this.ambient, 1);
|
|
25266
25319
|
let colorArray;
|
|
25267
25320
|
colorArray = isString$1(color) ? ColorStore.Get(color, ColorType.Color1) : color;
|
|
25268
25321
|
const lightColorArray = this.colorRgb;
|
|
@@ -25474,7 +25527,7 @@
|
|
|
25474
25527
|
canvasId: params.canvas
|
|
25475
25528
|
} : {
|
|
25476
25529
|
main: !0
|
|
25477
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, this.global.supportEvent && (this.eventSystem = new EventSystem({
|
|
25530
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, this.global.supportEvent && (this.eventSystem = new EventSystem(Object.assign({
|
|
25478
25531
|
targetElement: this.window,
|
|
25479
25532
|
resolution: this.window.dpr || this.global.devicePixelRatio,
|
|
25480
25533
|
rootNode: this,
|
|
@@ -25494,7 +25547,7 @@
|
|
|
25494
25547
|
return this.viewBox.height();
|
|
25495
25548
|
}
|
|
25496
25549
|
}
|
|
25497
|
-
})), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize),
|
|
25550
|
+
}, params.event))), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
25498
25551
|
background: this._background
|
|
25499
25552
|
});
|
|
25500
25553
|
}
|
|
@@ -26598,8 +26651,8 @@
|
|
|
26598
26651
|
scaleTicks = scale.ticks(count);
|
|
26599
26652
|
} else if (op.sampling) {
|
|
26600
26653
|
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2,
|
|
26601
|
-
rangeStart =
|
|
26602
|
-
rangeEnd =
|
|
26654
|
+
rangeStart = minInArray(range),
|
|
26655
|
+
rangeEnd = maxInArray(range);
|
|
26603
26656
|
if (domain.length <= rangeSize / fontSize) {
|
|
26604
26657
|
const incrementUnit = (rangeEnd - rangeStart) / domain.length,
|
|
26605
26658
|
labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal),
|
|
@@ -26699,8 +26752,8 @@
|
|
|
26699
26752
|
const domain = scale.domain(),
|
|
26700
26753
|
range = scale.range(),
|
|
26701
26754
|
labelBoundsList = getPolarAngleLabelBounds(scale, domain, op),
|
|
26702
|
-
rangeStart =
|
|
26703
|
-
rangeEnd =
|
|
26755
|
+
rangeStart = minInArray(range),
|
|
26756
|
+
rangeEnd = maxInArray(range),
|
|
26704
26757
|
incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length,
|
|
26705
26758
|
{
|
|
26706
26759
|
step: step,
|
|
@@ -26800,7 +26853,7 @@
|
|
|
26800
26853
|
function outOfBounds(bounds, x, y) {
|
|
26801
26854
|
return bounds.x1 > x || bounds.x2 < x || bounds.y1 > y || bounds.y2 < y;
|
|
26802
26855
|
}
|
|
26803
|
-
function min
|
|
26856
|
+
function min(data, field) {
|
|
26804
26857
|
const dataArray = [];
|
|
26805
26858
|
data.forEach(d => {
|
|
26806
26859
|
const value = +d[field];
|
|
@@ -26813,7 +26866,7 @@
|
|
|
26813
26866
|
}
|
|
26814
26867
|
return minInArray(dataArray);
|
|
26815
26868
|
}
|
|
26816
|
-
function max
|
|
26869
|
+
function max(data, field) {
|
|
26817
26870
|
const dataArray = [];
|
|
26818
26871
|
data.forEach(d => {
|
|
26819
26872
|
const value = +d[field];
|
|
@@ -26867,8 +26920,8 @@
|
|
|
26867
26920
|
}
|
|
26868
26921
|
function regression(data, fieldX, fieldY) {
|
|
26869
26922
|
const { predict } = regressionLinear(data, datum => datum[fieldX], datum => datum[fieldY]);
|
|
26870
|
-
const x1 = min
|
|
26871
|
-
const x2 = max
|
|
26923
|
+
const x1 = min(data, fieldX);
|
|
26924
|
+
const x2 = max(data, fieldX);
|
|
26872
26925
|
const predict1 = predict(x1);
|
|
26873
26926
|
const predict2 = predict(x2);
|
|
26874
26927
|
return [
|
|
@@ -27214,7 +27267,7 @@
|
|
|
27214
27267
|
|
|
27215
27268
|
const newTokenToLegacyToken = {
|
|
27216
27269
|
primaryFontColor: 'titleFontColor',
|
|
27217
|
-
|
|
27270
|
+
tertiaryFontColor: 'labelFontColor',
|
|
27218
27271
|
axisLabelFontColor: 'axisFontColor',
|
|
27219
27272
|
axisMarkerFontColor: 'labelReverseFontColor',
|
|
27220
27273
|
dataZoomHandleStrokeColor: 'dataZoomHandlerStrokeColor',
|
|
@@ -27227,7 +27280,7 @@
|
|
|
27227
27280
|
};
|
|
27228
27281
|
const legacyTokenToNewToken = {
|
|
27229
27282
|
titleFontColor: 'primaryFontColor',
|
|
27230
|
-
labelFontColor: '
|
|
27283
|
+
labelFontColor: 'tertiaryFontColor',
|
|
27231
27284
|
axisFontColor: 'axisLabelFontColor',
|
|
27232
27285
|
labelReverseFontColor: 'axisMarkerFontColor',
|
|
27233
27286
|
dataZoomHandlerStrokeColor: 'dataZoomHandleStrokeColor',
|
|
@@ -28256,6 +28309,7 @@
|
|
|
28256
28309
|
const DefaultAnimationStartTime = 0;
|
|
28257
28310
|
const DefaultAnimationDuration = 1e3;
|
|
28258
28311
|
const DefaultAnimationDelay = 0;
|
|
28312
|
+
const DefaultAnimationDelayAfter = 0;
|
|
28259
28313
|
const DefaultAnimationLoop = !1;
|
|
28260
28314
|
const DefaultAnimationOneByOne = !1;
|
|
28261
28315
|
const DefaultAnimationEasing = "quintInOut";
|
|
@@ -28642,7 +28696,7 @@
|
|
|
28642
28696
|
path2d = null !== (_b = pathNode.attribute.path) && void 0 !== _b ? _b : new CustomPath2D();
|
|
28643
28697
|
let x, y;
|
|
28644
28698
|
path2d.clear();
|
|
28645
|
-
const maxSize = isNumber$2(size) ? size : max$
|
|
28699
|
+
const maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
|
|
28646
28700
|
for (let i = 0, len = points.length; i < len; i += 4) x = points[i], y = points[i + 1], path2d.arc(x, y, maxSize / 2, 0, 2 * Math.PI), path2d.closePath();
|
|
28647
28701
|
const pathAttrs = Object.assign({}, this.attribute, {
|
|
28648
28702
|
path: path2d,
|
|
@@ -28732,7 +28786,7 @@
|
|
|
28732
28786
|
}
|
|
28733
28787
|
}],
|
|
28734
28788
|
[GrammarMarkType.line]: [{
|
|
28735
|
-
channels: ["x", "y", "defined"
|
|
28789
|
+
channels: ["x", "y", "defined"],
|
|
28736
28790
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
28737
28791
|
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
28738
28792
|
}
|
|
@@ -28897,11 +28951,11 @@
|
|
|
28897
28951
|
initGraphicItem() {
|
|
28898
28952
|
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28899
28953
|
if (this.graphicItem) return;
|
|
28900
|
-
const
|
|
28901
|
-
this.graphicItem = this.mark.addGraphicItem(
|
|
28954
|
+
const attrTransforms = this.mark.getAttributeTransforms();
|
|
28955
|
+
this.graphicItem = this.mark.addGraphicItem(attrTransforms ? {} : attributes, this.groupKey), this.graphicItem && (this.graphicItem[BridgeElementKey] = this, attrTransforms && (this.graphicItem.onBeforeAttributeUpdate = attributes => {
|
|
28902
28956
|
if (!this.mark) return attributes;
|
|
28903
|
-
return transformAttributes(
|
|
28904
|
-
}, this.graphicItem.setAttributes(
|
|
28957
|
+
return transformAttributes(attrTransforms, attributes, this);
|
|
28958
|
+
}, this.graphicItem.setAttributes(attributes)), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes({}), this.setNextGraphicAttributes(attributes), this.setFinalGraphicAttributes(attributes)));
|
|
28905
28959
|
}
|
|
28906
28960
|
updateGraphicItem(config) {
|
|
28907
28961
|
if (!this.graphicItem) return;
|
|
@@ -28956,14 +29010,13 @@
|
|
|
28956
29010
|
this.states = newStateValues, !isCollectionMark && isStateChanged && this.diffState === DiffState.unChange && (this.diffState = DiffState.update);
|
|
28957
29011
|
}
|
|
28958
29012
|
encodeGraphic(attrs) {
|
|
28959
|
-
|
|
28960
|
-
this.coordinateTransformEncode(this.items), !isNil$1(null == attrs ? void 0 : attrs.enableSegments) && (null === (_b = null === (_a = this.items) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.nextAttrs) && (this.items[0].nextAttrs.enableSegments = attrs.enableSegments);
|
|
29013
|
+
this.coordinateTransformEncode(this.items);
|
|
28961
29014
|
const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);
|
|
28962
29015
|
attrs && Object.assign(graphicAttributes, attrs), this.graphicItem ? (this.graphicItem.clearStates(), this.graphicItem.states = {}, this.graphicItem.stateProxy = null, this.applyGraphicAttributes(graphicAttributes)) : this.initGraphicItem(graphicAttributes), this.diffState !== DiffState.enter && this.diffState !== DiffState.update || !this.states.length || this.useStates(this.states), this.mark.markType === GrammarMarkType.shape && (this.graphicItem.datum = this.items[0].datum), this.items.forEach(item => {
|
|
28963
29016
|
item.nextAttrs = {};
|
|
28964
|
-
}), this.
|
|
29017
|
+
}), this._setCustomizedShape();
|
|
28965
29018
|
}
|
|
28966
|
-
|
|
29019
|
+
_setCustomizedShape() {
|
|
28967
29020
|
var _a;
|
|
28968
29021
|
if (!this.graphicItem) return;
|
|
28969
29022
|
const setCustomizedShape = null === (_a = this.mark.getSpec()) || void 0 === _a ? void 0 : _a.setCustomizedShape;
|
|
@@ -28976,7 +29029,7 @@
|
|
|
28976
29029
|
updateEncoder = encoders[BuiltInEncodeNames.update],
|
|
28977
29030
|
enterEncoder = encoders[BuiltInEncodeNames.enter],
|
|
28978
29031
|
exitEncoder = encoders[BuiltInEncodeNames.exit],
|
|
28979
|
-
onlyFullEncodeFirst = this.mark.isLargeMode();
|
|
29032
|
+
onlyFullEncodeFirst = this.mark.isLargeMode() || isCollectionMark && !this.mark.getSpec().enableSegments;
|
|
28980
29033
|
this.diffState === DiffState.enter ? (enterEncoder && invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst), updateEncoder && invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst)) : this.diffState === DiffState.update ? ((isCollectionMark && enterEncoder || isReentered) && invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst), updateEncoder && invokeEncoderToItems(this, items, updateEncoder, parameters, onlyFullEncodeFirst)) : this.diffState === DiffState.exit && exitEncoder && (isReentered && invokeEncoderToItems(this, items, enterEncoder, parameters, onlyFullEncodeFirst), invokeEncoderToItems(this, items, exitEncoder, parameters, onlyFullEncodeFirst));
|
|
28981
29034
|
}
|
|
28982
29035
|
coordinateTransformEncode(items) {
|
|
@@ -29031,14 +29084,14 @@
|
|
|
29031
29084
|
return diffResult;
|
|
29032
29085
|
}
|
|
29033
29086
|
transformElementItems(items, markType, computePoints) {
|
|
29034
|
-
var _a, _b, _c, _d
|
|
29087
|
+
var _a, _b, _c, _d;
|
|
29035
29088
|
const item = items[0];
|
|
29036
29089
|
if (!item.nextAttrs || 0 === Object.keys(item.nextAttrs).length) return {};
|
|
29037
29090
|
let nextAttrs = null == item ? void 0 : item.nextAttrs;
|
|
29038
29091
|
if (items && items.length && isNil$1(null === (_a = item.nextAttrs) || void 0 === _a ? void 0 : _a.points) && (!0 === computePoints || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType)) && isPointsMarkType(markType)) {
|
|
29039
29092
|
const lastPoints = this.getGraphicAttribute("points", !1),
|
|
29040
29093
|
lastSegments = this.getGraphicAttribute("segments", !1),
|
|
29041
|
-
enableSegments =
|
|
29094
|
+
enableSegments = this.mark.getSpec().enableSegments,
|
|
29042
29095
|
itemNextAttrs = items.map(item => item.nextAttrs),
|
|
29043
29096
|
isProgressive = this.mark.isProgressive();
|
|
29044
29097
|
if (nextAttrs = Object.assign({}, nextAttrs), delete nextAttrs.x, delete nextAttrs.y, markType === GrammarMarkType.line || markType === GrammarMarkType.area) {
|
|
@@ -29047,7 +29100,7 @@
|
|
|
29047
29100
|
const points = linePoints && 0 !== linePoints.length ? linePoints : getLinePointsFromSegments(lastSegments),
|
|
29048
29101
|
segments = getLineSegmentConfigs(itemNextAttrs, points, this);
|
|
29049
29102
|
segments ? (nextAttrs.segments = segments, nextAttrs.points = null) : (nextAttrs.segments = null, nextAttrs.points = points);
|
|
29050
|
-
} else isProgressive ? nextAttrs.segments = (null !== (
|
|
29103
|
+
} else isProgressive ? nextAttrs.segments = (null !== (_d = null === (_c = null === (_b = this.graphicItem) || void 0 === _b ? void 0 : _b.attribute) || void 0 === _c ? void 0 : _c.segments) && void 0 !== _d ? _d : []).concat([{
|
|
29051
29104
|
points: linePoints
|
|
29052
29105
|
}]) : (nextAttrs.points = linePoints, nextAttrs.segments = null);
|
|
29053
29106
|
} else markType === GrammarMarkType.largeRects ? nextAttrs.points = getLargeRectsPoints(items, !0, lastPoints) : markType === GrammarMarkType.largeSymbols && (nextAttrs.points = getLargeSymbolsPoints(items, !0, lastPoints));
|
|
@@ -29449,18 +29502,22 @@
|
|
|
29449
29502
|
{
|
|
29450
29503
|
Color: Color
|
|
29451
29504
|
} = ColorUtil;
|
|
29452
|
-
function labelSmartInvert(foregroundColorOrigin, backgroundColorOrogin, textType, contrastRatiosThreshold, alternativeColors) {
|
|
29505
|
+
function labelSmartInvert(foregroundColorOrigin, backgroundColorOrogin, textType, contrastRatiosThreshold, alternativeColors, mode) {
|
|
29453
29506
|
if ("string" != typeof foregroundColorOrigin || "string" != typeof backgroundColorOrogin) return foregroundColorOrigin;
|
|
29454
29507
|
const foregroundColor = new Color(foregroundColorOrigin).toHex(),
|
|
29455
29508
|
backgroundColor = new Color(backgroundColorOrogin).toHex();
|
|
29456
|
-
return contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold) ? foregroundColor : improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors);
|
|
29509
|
+
return contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, mode) ? foregroundColor : improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode);
|
|
29457
29510
|
}
|
|
29458
|
-
function improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors) {
|
|
29511
|
+
function improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode) {
|
|
29459
29512
|
const alternativeColorPalletes = [];
|
|
29460
29513
|
alternativeColors && (alternativeColors instanceof Array ? alternativeColorPalletes.push(...alternativeColors) : alternativeColorPalletes.push(alternativeColors)), alternativeColorPalletes.push(...defaultAlternativeColors);
|
|
29461
|
-
for (const alternativeColor of alternativeColorPalletes) if (foregroundColor !== alternativeColor && contrastAccessibilityChecker(alternativeColor, backgroundColor, textType, contrastRatiosThreshold)) return alternativeColor;
|
|
29514
|
+
for (const alternativeColor of alternativeColorPalletes) if (foregroundColor !== alternativeColor && contrastAccessibilityChecker(alternativeColor, backgroundColor, textType, contrastRatiosThreshold, mode)) return alternativeColor;
|
|
29462
29515
|
}
|
|
29463
|
-
function contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold) {
|
|
29516
|
+
function contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, mode) {
|
|
29517
|
+
if ("lightness" === mode) {
|
|
29518
|
+
const backgroundColorLightness = Color.getColorBrightness(new Color(backgroundColor));
|
|
29519
|
+
return Color.getColorBrightness(new Color(foregroundColor)) < .5 ? backgroundColorLightness >= .5 : backgroundColorLightness < .5;
|
|
29520
|
+
}
|
|
29464
29521
|
return contrastRatiosThreshold ? contrastRatios(foregroundColor, backgroundColor) > contrastRatiosThreshold : "largeText" === textType ? contrastRatios(foregroundColor, backgroundColor) > 3 : contrastRatios(foregroundColor, backgroundColor) > 4.5;
|
|
29465
29522
|
}
|
|
29466
29523
|
function contrastRatios(foregroundColor, backgroundColor) {
|
|
@@ -29534,6 +29591,12 @@
|
|
|
29534
29591
|
[StateValue.hover]: {},
|
|
29535
29592
|
[StateValue.hoverReverse]: {}
|
|
29536
29593
|
};
|
|
29594
|
+
const DEFAULT_HTML_TEXT_SPEC = {
|
|
29595
|
+
container: "",
|
|
29596
|
+
width: 30,
|
|
29597
|
+
height: 30,
|
|
29598
|
+
style: {}
|
|
29599
|
+
};
|
|
29537
29600
|
|
|
29538
29601
|
const initTextMeasure$1 = (textSpec, option, useNaiveCanvas) => new TextMeasure(Object.assign({
|
|
29539
29602
|
defaultFontParams: {
|
|
@@ -29580,7 +29643,7 @@
|
|
|
29580
29643
|
super(merge$1({}, Tag.defaultAttributes, attributes)), this.name = "tag";
|
|
29581
29644
|
}
|
|
29582
29645
|
render() {
|
|
29583
|
-
var _a;
|
|
29646
|
+
var _a, _b, _c;
|
|
29584
29647
|
const {
|
|
29585
29648
|
text = "",
|
|
29586
29649
|
textStyle = {},
|
|
@@ -29591,7 +29654,8 @@
|
|
|
29591
29654
|
maxWidth: maxWidth,
|
|
29592
29655
|
padding = 4,
|
|
29593
29656
|
visible: visible,
|
|
29594
|
-
state: state
|
|
29657
|
+
state: state,
|
|
29658
|
+
type: type
|
|
29595
29659
|
} = this.attribute,
|
|
29596
29660
|
parsedPadding = normalizePadding$1(padding),
|
|
29597
29661
|
group = this.createOrUpdateChild("tag-content", {
|
|
@@ -29621,46 +29685,97 @@
|
|
|
29621
29685
|
y: maxSize / 2
|
|
29622
29686
|
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
29623
29687
|
}
|
|
29624
|
-
|
|
29625
|
-
|
|
29626
|
-
|
|
29627
|
-
|
|
29628
|
-
|
|
29629
|
-
|
|
29630
|
-
|
|
29631
|
-
|
|
29632
|
-
|
|
29633
|
-
|
|
29634
|
-
|
|
29635
|
-
|
|
29636
|
-
|
|
29637
|
-
|
|
29638
|
-
|
|
29639
|
-
|
|
29640
|
-
|
|
29641
|
-
|
|
29642
|
-
|
|
29643
|
-
|
|
29644
|
-
|
|
29645
|
-
|
|
29646
|
-
|
|
29647
|
-
|
|
29648
|
-
|
|
29649
|
-
|
|
29650
|
-
|
|
29651
|
-
|
|
29652
|
-
|
|
29653
|
-
|
|
29654
|
-
|
|
29655
|
-
|
|
29656
|
-
|
|
29657
|
-
|
|
29658
|
-
x:
|
|
29659
|
-
y:
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29663
|
-
|
|
29688
|
+
let textShape;
|
|
29689
|
+
if (tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth, "rich" === type) {
|
|
29690
|
+
const richTextAttrs = Object.assign(Object.assign({
|
|
29691
|
+
textConfig: text,
|
|
29692
|
+
visible: isValid$1(text) && !1 !== visible
|
|
29693
|
+
}, textStyle), {
|
|
29694
|
+
x: textX,
|
|
29695
|
+
y: 0,
|
|
29696
|
+
width: null !== (_a = textStyle.width) && void 0 !== _a ? _a : 0,
|
|
29697
|
+
height: null !== (_b = textStyle.height) && void 0 !== _b ? _b : 0
|
|
29698
|
+
});
|
|
29699
|
+
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
29700
|
+
const {
|
|
29701
|
+
visible: bgVisible
|
|
29702
|
+
} = panel,
|
|
29703
|
+
backgroundStyle = __rest$7(panel, ["visible"]);
|
|
29704
|
+
if (visible && isBoolean$1(bgVisible)) {
|
|
29705
|
+
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
29706
|
+
visible: bgVisible && !!text,
|
|
29707
|
+
x: textShape.AABBBounds.x1,
|
|
29708
|
+
y: textShape.AABBBounds.y1,
|
|
29709
|
+
width: textShape.AABBBounds.width(),
|
|
29710
|
+
height: textShape.AABBBounds.height()
|
|
29711
|
+
}), "rect");
|
|
29712
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
29713
|
+
}
|
|
29714
|
+
} else if ("html" === type) {
|
|
29715
|
+
const richTextAttrs = Object.assign(Object.assign({
|
|
29716
|
+
textConfig: [],
|
|
29717
|
+
visible: isValid$1(text) && !1 !== visible,
|
|
29718
|
+
html: Object.assign(Object.assign({
|
|
29719
|
+
dom: text
|
|
29720
|
+
}, DEFAULT_HTML_TEXT_SPEC), textStyle)
|
|
29721
|
+
}, textStyle), {
|
|
29722
|
+
x: textX,
|
|
29723
|
+
y: 0
|
|
29724
|
+
});
|
|
29725
|
+
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
29726
|
+
const {
|
|
29727
|
+
visible: bgVisible
|
|
29728
|
+
} = panel,
|
|
29729
|
+
backgroundStyle = __rest$7(panel, ["visible"]);
|
|
29730
|
+
if (visible && isBoolean$1(bgVisible)) {
|
|
29731
|
+
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
29732
|
+
visible: bgVisible && !!text,
|
|
29733
|
+
x: textShape.AABBBounds.x1,
|
|
29734
|
+
y: textShape.AABBBounds.y1,
|
|
29735
|
+
width: textShape.AABBBounds.width(),
|
|
29736
|
+
height: textShape.AABBBounds.height()
|
|
29737
|
+
}), "rect");
|
|
29738
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
29739
|
+
}
|
|
29740
|
+
} else {
|
|
29741
|
+
const textAttrs = Object.assign(Object.assign({
|
|
29742
|
+
text: text,
|
|
29743
|
+
visible: isValid$1(text) && !1 !== visible,
|
|
29744
|
+
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
29745
|
+
}, textStyle), {
|
|
29746
|
+
x: textX,
|
|
29747
|
+
y: 0
|
|
29748
|
+
});
|
|
29749
|
+
isNil$1(textAttrs.lineHeight) && (textAttrs.lineHeight = textStyle.fontSize), textShape = group.createOrUpdateChild("tag-text", textAttrs, "text"), isEmpty(null == state ? void 0 : state.text) || (textShape.states = state.text);
|
|
29750
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle),
|
|
29751
|
+
textWidth = textBounds.width,
|
|
29752
|
+
textHeight = textBounds.height;
|
|
29753
|
+
tagWidth += textWidth;
|
|
29754
|
+
const size = null !== (_c = shape.size) && void 0 !== _c ? _c : 10,
|
|
29755
|
+
maxSize = isNumber$2(size) ? size : Math.max(size[0], size[1]);
|
|
29756
|
+
tagHeight += Math.max(textHeight, (null == shape ? void 0 : shape.visible) ? maxSize : 0);
|
|
29757
|
+
const {
|
|
29758
|
+
textAlign: textAlign,
|
|
29759
|
+
textBaseline: textBaseline
|
|
29760
|
+
} = textStyle;
|
|
29761
|
+
(isValid$1(minWidth) || isValid$1(maxWidth)) && (isValid$1(minWidth) && tagWidth < minWidth && (tagWidth = minWidth), isValid$1(maxWidth) && tagWidth > maxWidth && (tagWidth = maxWidth, textShape.setAttribute("maxLineWidth", maxWidth - parsedPadding[1] - parsedPadding[2])));
|
|
29762
|
+
let x = 0,
|
|
29763
|
+
y = 0;
|
|
29764
|
+
"center" === textAlign ? (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)) : "right" === textAlign || "end" === textAlign ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : "left" !== textAlign && "start" !== textAlign || group.setAttribute("x", parsedPadding[3]), "middle" === textBaseline ? (y -= tagHeight / 2, symbol && symbol.setAttribute("y", 0)) : "bottom" === textBaseline ? (y -= tagHeight, symbol && symbol.setAttribute("y", -textHeight / 2), group.setAttribute("y", -parsedPadding[2])) : "top" === textBaseline && (group.setAttribute("y", parsedPadding[0]), symbol && symbol.setAttribute("y", textHeight / 2));
|
|
29765
|
+
const {
|
|
29766
|
+
visible: bgVisible
|
|
29767
|
+
} = panel,
|
|
29768
|
+
backgroundStyle = __rest$7(panel, ["visible"]);
|
|
29769
|
+
if (visible && isBoolean$1(bgVisible)) {
|
|
29770
|
+
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
29771
|
+
visible: bgVisible && !!text,
|
|
29772
|
+
x: x,
|
|
29773
|
+
y: y,
|
|
29774
|
+
width: tagWidth,
|
|
29775
|
+
height: tagHeight
|
|
29776
|
+
}), "rect");
|
|
29777
|
+
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
29778
|
+
}
|
|
29664
29779
|
}
|
|
29665
29780
|
}
|
|
29666
29781
|
}
|
|
@@ -29757,7 +29872,7 @@
|
|
|
29757
29872
|
contentHeight = contentBounds.height(),
|
|
29758
29873
|
contentWidth = contentBounds.width();
|
|
29759
29874
|
contentVisible && (height += contentHeight);
|
|
29760
|
-
let popTipWidth = max$
|
|
29875
|
+
let popTipWidth = max$1(titleWidth + parsedPadding[1] + parsedPadding[3], contentWidth + parsedPadding[1] + parsedPadding[3]);
|
|
29761
29876
|
popTipWidth > maxWidth ? popTipWidth = maxWidth : popTipWidth < minWidth && (popTipWidth = minWidth);
|
|
29762
29877
|
let poptipHeight = parsedPadding[0] + parsedPadding[2] + height;
|
|
29763
29878
|
const {
|
|
@@ -30833,6 +30948,19 @@
|
|
|
30833
30948
|
state && !isEmpty(state) && (target.states = state);
|
|
30834
30949
|
}
|
|
30835
30950
|
_createLabelText(attributes) {
|
|
30951
|
+
var _a, _b;
|
|
30952
|
+
if ("rich" === attributes.textType) {
|
|
30953
|
+
attributes.textConfig = attributes.text, attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0;
|
|
30954
|
+
const text = createRichText(attributes);
|
|
30955
|
+
return this._bindEvent(text), this._setStatesOfText(text), text;
|
|
30956
|
+
}
|
|
30957
|
+
if ("html" === attributes.textType) {
|
|
30958
|
+
attributes.textConfig = [], attributes.html = Object.assign(Object.assign({
|
|
30959
|
+
dom: attributes.text
|
|
30960
|
+
}, DEFAULT_HTML_TEXT_SPEC), attributes);
|
|
30961
|
+
const text = createRichText(attributes);
|
|
30962
|
+
return this._bindEvent(text), this._setStatesOfText(text), text;
|
|
30963
|
+
}
|
|
30836
30964
|
const text = createText(attributes);
|
|
30837
30965
|
return this._bindEvent(text), this._setStatesOfText(text), text;
|
|
30838
30966
|
}
|
|
@@ -30889,11 +31017,12 @@
|
|
|
30889
31017
|
}, textStyle), textData),
|
|
30890
31018
|
text = this._createLabelText(labelAttribute),
|
|
30891
31019
|
textBounds = this.getGraphicBounds(text),
|
|
30892
|
-
|
|
31020
|
+
actualPosition = isFunction$1(position) ? position(textData) : position,
|
|
31021
|
+
graphicBounds = this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition) : this.getGraphicBounds(baseMark, {
|
|
30893
31022
|
x: textData.x,
|
|
30894
31023
|
y: textData.y
|
|
30895
|
-
}),
|
|
30896
|
-
textLocation = this.labeling(textBounds, graphicBounds,
|
|
31024
|
+
}, actualPosition),
|
|
31025
|
+
textLocation = this.labeling(textBounds, graphicBounds, actualPosition, offset);
|
|
30897
31026
|
textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation)), labels.push(text);
|
|
30898
31027
|
}
|
|
30899
31028
|
return labels;
|
|
@@ -30960,7 +31089,12 @@
|
|
|
30960
31089
|
dx = 0,
|
|
30961
31090
|
dy = 0
|
|
30962
31091
|
} = clampText(text, bmpTool.width, bmpTool.height);
|
|
30963
|
-
if (
|
|
31092
|
+
if (0 === dx && 0 === dy) {
|
|
31093
|
+
if (canPlace(bmpTool, bitmap, text.AABBBounds)) {
|
|
31094
|
+
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
31095
|
+
continue;
|
|
31096
|
+
}
|
|
31097
|
+
} else if (canPlace(bmpTool, bitmap, {
|
|
30964
31098
|
x1: text.AABBBounds.x1 + dx,
|
|
30965
31099
|
x2: text.AABBBounds.x2 + dx,
|
|
30966
31100
|
y1: text.AABBBounds.y1 + dy,
|
|
@@ -31120,7 +31254,8 @@
|
|
|
31120
31254
|
{
|
|
31121
31255
|
textType: textType,
|
|
31122
31256
|
contrastRatiosThreshold: contrastRatiosThreshold,
|
|
31123
|
-
alternativeColors: alternativeColors
|
|
31257
|
+
alternativeColors: alternativeColors,
|
|
31258
|
+
mode: mode
|
|
31124
31259
|
} = option,
|
|
31125
31260
|
fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
|
|
31126
31261
|
strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
|
|
@@ -31134,7 +31269,7 @@
|
|
|
31134
31269
|
backgroundColor = baseMark.attribute.fill,
|
|
31135
31270
|
foregroundColor = label.attribute.fill,
|
|
31136
31271
|
baseColor = backgroundColor,
|
|
31137
|
-
invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors),
|
|
31272
|
+
invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors, mode),
|
|
31138
31273
|
similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
|
|
31139
31274
|
if (outsideEnable) {
|
|
31140
31275
|
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
@@ -31159,7 +31294,7 @@
|
|
|
31159
31294
|
if (0 === label.attribute.lineWidth) continue;
|
|
31160
31295
|
if (label.attribute.stroke) {
|
|
31161
31296
|
label.setAttributes({
|
|
31162
|
-
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
|
|
31297
|
+
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors, mode)
|
|
31163
31298
|
});
|
|
31164
31299
|
continue;
|
|
31165
31300
|
}
|
|
@@ -31311,12 +31446,10 @@
|
|
|
31311
31446
|
}
|
|
31312
31447
|
getGraphicBounds(graphic) {
|
|
31313
31448
|
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31449
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
31314
31450
|
var _a;
|
|
31315
|
-
if ("line" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
31316
|
-
const
|
|
31317
|
-
position = "end"
|
|
31318
|
-
} = this.attribute,
|
|
31319
|
-
points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
31451
|
+
if (!graphic || "line" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
31452
|
+
const points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
31320
31453
|
index = "start" === position ? 0 : points.length - 1;
|
|
31321
31454
|
return {
|
|
31322
31455
|
x1: points[index].x,
|
|
@@ -31875,41 +32008,16 @@
|
|
|
31875
32008
|
pickable: !1
|
|
31876
32009
|
};
|
|
31877
32010
|
|
|
31878
|
-
class LineDataLabel extends LabelBase {
|
|
31879
|
-
constructor(attributes) {
|
|
31880
|
-
super(merge$1({}, LineDataLabel.defaultAttributes, attributes)), this.name = "line-data-label";
|
|
31881
|
-
}
|
|
31882
|
-
labeling(textBounds, graphicBounds) {
|
|
31883
|
-
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
31884
|
-
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
31885
|
-
return labelingPoint(textBounds, graphicBounds, position, offset);
|
|
31886
|
-
}
|
|
31887
|
-
}
|
|
31888
|
-
LineDataLabel.defaultAttributes = {
|
|
31889
|
-
textStyle: {
|
|
31890
|
-
fontSize: 12,
|
|
31891
|
-
fill: "#000",
|
|
31892
|
-
textAlign: "center",
|
|
31893
|
-
textBaseline: "middle",
|
|
31894
|
-
boundsPadding: [-1, 0, -1, 0]
|
|
31895
|
-
},
|
|
31896
|
-
position: "top",
|
|
31897
|
-
offset: 5,
|
|
31898
|
-
pickable: !1
|
|
31899
|
-
};
|
|
31900
|
-
|
|
31901
32011
|
class AreaLabel extends LabelBase {
|
|
31902
32012
|
constructor(attributes) {
|
|
31903
32013
|
super(merge$1({}, AreaLabel.defaultAttributes, attributes)), this.name = "line-label";
|
|
31904
32014
|
}
|
|
31905
32015
|
getGraphicBounds(graphic) {
|
|
31906
32016
|
let point = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
32017
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "end";
|
|
31907
32018
|
var _a;
|
|
31908
32019
|
if ("area" !== graphic.type) return super.getGraphicBounds(graphic, point);
|
|
31909
|
-
const
|
|
31910
|
-
position = "end"
|
|
31911
|
-
} = this.attribute,
|
|
31912
|
-
points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
32020
|
+
const points = (null === (_a = null == graphic ? void 0 : graphic.attribute) || void 0 === _a ? void 0 : _a.points) || [point],
|
|
31913
32021
|
index = "start" === position ? 0 : points.length - 1;
|
|
31914
32022
|
return {
|
|
31915
32023
|
x1: points[index].x,
|
|
@@ -31937,6 +32045,29 @@
|
|
|
31937
32045
|
pickable: !1
|
|
31938
32046
|
};
|
|
31939
32047
|
|
|
32048
|
+
class LineDataLabel extends LabelBase {
|
|
32049
|
+
constructor(attributes) {
|
|
32050
|
+
super(merge$1({}, LineDataLabel.defaultAttributes, attributes)), this.name = "line-data-label";
|
|
32051
|
+
}
|
|
32052
|
+
labeling(textBounds, graphicBounds) {
|
|
32053
|
+
let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "top";
|
|
32054
|
+
let offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
32055
|
+
return labelingPoint(textBounds, graphicBounds, position, offset);
|
|
32056
|
+
}
|
|
32057
|
+
}
|
|
32058
|
+
LineDataLabel.defaultAttributes = {
|
|
32059
|
+
textStyle: {
|
|
32060
|
+
fontSize: 12,
|
|
32061
|
+
fill: "#000",
|
|
32062
|
+
textAlign: "center",
|
|
32063
|
+
textBaseline: "middle",
|
|
32064
|
+
boundsPadding: [-1, 0, -1, 0]
|
|
32065
|
+
},
|
|
32066
|
+
position: "top",
|
|
32067
|
+
offset: 5,
|
|
32068
|
+
pickable: !1
|
|
32069
|
+
};
|
|
32070
|
+
|
|
31940
32071
|
const labelComponentMap = {
|
|
31941
32072
|
rect: RectLabel,
|
|
31942
32073
|
symbol: SymbolLabel,
|
|
@@ -32387,17 +32518,19 @@
|
|
|
32387
32518
|
textAlign = "center",
|
|
32388
32519
|
textBaseline = "middle";
|
|
32389
32520
|
return data.forEach((item, index) => {
|
|
32390
|
-
var _a, _b;
|
|
32391
|
-
const labelStyle = this._getLabelAttribute(item, index, data, layer)
|
|
32392
|
-
|
|
32393
|
-
if (
|
|
32521
|
+
var _a, _b, _c, _d;
|
|
32522
|
+
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
32523
|
+
let text;
|
|
32524
|
+
if ("rich" === labelStyle.type ? (labelStyle.textConfig = labelStyle.text, labelStyle.width = null !== (_a = labelStyle.width) && void 0 !== _a ? _a : 0, labelStyle.height = null !== (_b = labelStyle.height) && void 0 !== _b ? _b : 0, text = createRichText(labelStyle)) : "html" === labelStyle.type ? (labelStyle.textConfig = [], labelStyle.html = Object.assign(Object.assign({
|
|
32525
|
+
dom: labelStyle.text
|
|
32526
|
+
}, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = createRichText(labelStyle)) : text = createText(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_c = this.attribute.label) || void 0 === _c ? void 0 : _c.state)) text.states = DEFAULT_STATES$2;else {
|
|
32394
32527
|
const labelState = merge$1({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
32395
32528
|
Object.keys(labelState).forEach(key => {
|
|
32396
32529
|
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
32397
32530
|
}), text.states = labelState;
|
|
32398
32531
|
}
|
|
32399
32532
|
labelGroup.add(text);
|
|
32400
|
-
const angle = null !== (
|
|
32533
|
+
const angle = null !== (_d = labelStyle.angle) && void 0 !== _d ? _d : 0;
|
|
32401
32534
|
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width()), maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height()), angle && (maxTextWidth = Math.abs(maxTextWidth * Math.cos(angle)), maxTextHeight = Math.abs(maxTextHeight * Math.sin(angle))), textAlign = labelStyle.textAlign, textBaseline = labelStyle.textBaseline;
|
|
32402
32535
|
}), this.axisLabelLayerSize[layer] = {
|
|
32403
32536
|
width: maxTextWidth,
|
|
@@ -32519,9 +32652,11 @@
|
|
|
32519
32652
|
{
|
|
32520
32653
|
space = 4,
|
|
32521
32654
|
inside = !1,
|
|
32522
|
-
formatMethod: formatMethod
|
|
32655
|
+
formatMethod: formatMethod,
|
|
32656
|
+
type = "text",
|
|
32657
|
+
text: text
|
|
32523
32658
|
} = _g,
|
|
32524
|
-
tagAttributes = __rest$5(_g, ["space", "inside", "formatMethod"]);
|
|
32659
|
+
tagAttributes = __rest$5(_g, ["space", "inside", "formatMethod", "type", "text"]);
|
|
32525
32660
|
let offset = space,
|
|
32526
32661
|
tickLength = 0;
|
|
32527
32662
|
(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && (null === (_b = this.attribute.tick) || void 0 === _b ? void 0 : _b.inside) === inside && (tickLength = (null === (_c = this.attribute.tick) || void 0 === _c ? void 0 : _c.length) || 4), (null === (_d = this.attribute.subTick) || void 0 === _d ? void 0 : _d.visible) && (null === (_e = this.attribute.subTick) || void 0 === _e ? void 0 : _e.inside) === inside && (tickLength = Math.max(tickLength, (null === (_f = this.attribute.subTick) || void 0 === _f ? void 0 : _f.length) || 2)), offset += tickLength;
|
|
@@ -32529,7 +32664,7 @@
|
|
|
32529
32664
|
layer > 0 && (0 === axisVector[1] ? offset += (this.axisLabelLayerSize[layer - 1].height + get$1(this.attribute, "label.space", 4)) * layer : offset += (this.axisLabelLayerSize[layer - 1].width + get$1(this.attribute, "label.space", 4)) * layer);
|
|
32530
32665
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside),
|
|
32531
32666
|
vector = this.getVerticalVector(offset, inside, point),
|
|
32532
|
-
|
|
32667
|
+
textContent = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
|
|
32533
32668
|
let {
|
|
32534
32669
|
style: textStyle
|
|
32535
32670
|
} = tagAttributes;
|
|
@@ -32540,9 +32675,10 @@
|
|
|
32540
32675
|
value: tickDatum.rawValue,
|
|
32541
32676
|
index: tickDatum.index,
|
|
32542
32677
|
layer: layer
|
|
32543
|
-
})), Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector,
|
|
32544
|
-
text: text,
|
|
32545
|
-
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
32678
|
+
})), Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), {
|
|
32679
|
+
text: null != text ? text : textContent,
|
|
32680
|
+
lineHeight: null == textStyle ? void 0 : textStyle.fontSize,
|
|
32681
|
+
type: type
|
|
32546
32682
|
}), textStyle);
|
|
32547
32683
|
}
|
|
32548
32684
|
getLabelPosition(point, vector, text, style) {
|
|
@@ -33111,7 +33247,7 @@
|
|
|
33111
33247
|
titleSpacing = 0;
|
|
33112
33248
|
const axisLineWidth = (null == line ? void 0 : line.visible) ? null !== (_b = line.style.lineWidth) && void 0 !== _b ? _b : 1 : 0,
|
|
33113
33249
|
tickLength = (null == tick ? void 0 : tick.visible) ? null !== (_c = tick.length) && void 0 !== _c ? _c : 4 : 0;
|
|
33114
|
-
if (null == title ? void 0 : title.visible) {
|
|
33250
|
+
if ((null == title ? void 0 : title.visible) && "string" == typeof title.text) {
|
|
33115
33251
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
33116
33252
|
const padding = normalizePadding$1(title.padding);
|
|
33117
33253
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -35587,7 +35723,7 @@
|
|
|
35587
35723
|
y: -focusSize / 2 - 1,
|
|
35588
35724
|
strokeBoundsBuffer: 0
|
|
35589
35725
|
}, focusIconStyle), {
|
|
35590
|
-
visible: !
|
|
35726
|
+
visible: !0,
|
|
35591
35727
|
pickMode: "imprecise",
|
|
35592
35728
|
boundsPadding: parsedPadding
|
|
35593
35729
|
})), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
|
|
@@ -35633,7 +35769,7 @@
|
|
|
35633
35769
|
innerGroupHeight = innerGroupBounds.height(),
|
|
35634
35770
|
itemGroupWidth = isValid$1(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
|
|
35635
35771
|
itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
35636
|
-
return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
|
|
35772
|
+
return itemGroup.attribute.width = itemGroupWidth, itemGroup.attribute.height = itemGroupHeight, focusShape && focusShape.setAttribute("visible", !1), innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
|
|
35637
35773
|
}
|
|
35638
35774
|
_renderPager(isHorizontal) {
|
|
35639
35775
|
const renderStartY = this._title ? this._title.AABBBounds.height() + get$1(this.attribute, "title.space", 8) : 0,
|
|
@@ -36650,9 +36786,11 @@
|
|
|
36650
36786
|
super(merge$1({}, Title.defaultAttributes, attributes)), this.name = "title";
|
|
36651
36787
|
}
|
|
36652
36788
|
render() {
|
|
36653
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
|
|
36789
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55;
|
|
36654
36790
|
const {
|
|
36791
|
+
textType: textType,
|
|
36655
36792
|
text: text,
|
|
36793
|
+
subtextType: subtextType,
|
|
36656
36794
|
textStyle: textStyle,
|
|
36657
36795
|
subtext: subtext,
|
|
36658
36796
|
subtextStyle: subtextStyle,
|
|
@@ -36672,8 +36810,8 @@
|
|
|
36672
36810
|
y: parsedPadding[0],
|
|
36673
36811
|
zIndex: 1
|
|
36674
36812
|
}, "group");
|
|
36675
|
-
if (!1 !== (null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.visible) && !1 !== (null == textStyle ? void 0 : textStyle.visible)) if (
|
|
36676
|
-
const attr = {
|
|
36813
|
+
if (!1 !== (null === (_a = this.attribute) || void 0 === _a ? void 0 : _a.visible) && !1 !== (null == textStyle ? void 0 : textStyle.visible)) if ("rich" === textType || isValid$1(textStyle.character)) {
|
|
36814
|
+
const attr = Object.assign({
|
|
36677
36815
|
x: null !== (_b = textStyle.x) && void 0 !== _b ? _b : 0,
|
|
36678
36816
|
y: null !== (_c = textStyle.y) && void 0 !== _c ? _c : 0,
|
|
36679
36817
|
width: null !== (_e = null !== (_d = textStyle.width) && void 0 !== _d ? _d : width) && void 0 !== _e ? _e : 0,
|
|
@@ -36682,68 +36820,100 @@
|
|
|
36682
36820
|
wordBreak: null !== (_j = textStyle.wordBreak) && void 0 !== _j ? _j : "break-word",
|
|
36683
36821
|
maxHeight: textStyle.maxHeight,
|
|
36684
36822
|
maxWidth: textStyle.maxWidth,
|
|
36685
|
-
textConfig: textStyle.character
|
|
36686
|
-
};
|
|
36823
|
+
textConfig: null !== (_k = textStyle.character) && void 0 !== _k ? _k : text
|
|
36824
|
+
}, textStyle);
|
|
36825
|
+
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
36826
|
+
} else if ("html" === textType) {
|
|
36827
|
+
const attr = Object.assign({
|
|
36828
|
+
html: Object.assign(Object.assign({
|
|
36829
|
+
dom: text
|
|
36830
|
+
}, DEFAULT_HTML_TEXT_SPEC), textStyle),
|
|
36831
|
+
x: null !== (_l = textStyle.x) && void 0 !== _l ? _l : 0,
|
|
36832
|
+
y: null !== (_m = textStyle.y) && void 0 !== _m ? _m : 0,
|
|
36833
|
+
width: null !== (_p = null !== (_o = textStyle.width) && void 0 !== _o ? _o : width) && void 0 !== _p ? _p : 0,
|
|
36834
|
+
height: null !== (_r = null !== (_q = textStyle.height) && void 0 !== _q ? _q : height) && void 0 !== _r ? _r : 0,
|
|
36835
|
+
ellipsis: null === (_s = textStyle.ellipsis) || void 0 === _s || _s,
|
|
36836
|
+
wordBreak: null !== (_t = textStyle.wordBreak) && void 0 !== _t ? _t : "break-word",
|
|
36837
|
+
maxHeight: textStyle.maxHeight,
|
|
36838
|
+
maxWidth: textStyle.maxWidth,
|
|
36839
|
+
textConfig: []
|
|
36840
|
+
}, textStyle);
|
|
36687
36841
|
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
36688
36842
|
} else isValid$1(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
|
|
36689
36843
|
text: [text]
|
|
36690
36844
|
}, textStyle), {
|
|
36691
|
-
maxLineWidth: null !== (
|
|
36845
|
+
maxLineWidth: null !== (_u = null == textStyle ? void 0 : textStyle.maxLineWidth) && void 0 !== _u ? _u : width,
|
|
36692
36846
|
heightLimit: null == textStyle ? void 0 : textStyle.heightLimit,
|
|
36693
36847
|
lineClamp: null == textStyle ? void 0 : textStyle.lineClamp,
|
|
36694
|
-
ellipsis: null === (
|
|
36848
|
+
ellipsis: null === (_v = null == textStyle ? void 0 : textStyle.ellipsis) || void 0 === _v || _v,
|
|
36695
36849
|
x: 0,
|
|
36696
36850
|
y: 0
|
|
36697
36851
|
}), "wrapText"));
|
|
36698
|
-
const maintextHeight = this._mainTitle ? null === (
|
|
36699
|
-
maintextWidth = this._mainTitle ? null === (
|
|
36700
|
-
if (!1 !== (null === (
|
|
36701
|
-
const attr = {
|
|
36702
|
-
x: null !== (
|
|
36703
|
-
y: null !== (
|
|
36704
|
-
width: null !== (
|
|
36705
|
-
height: null !== (
|
|
36706
|
-
ellipsis: null === (
|
|
36707
|
-
wordBreak: null !== (
|
|
36852
|
+
const maintextHeight = this._mainTitle ? null === (_w = this._mainTitle) || void 0 === _w ? void 0 : _w.AABBBounds.height() : 0,
|
|
36853
|
+
maintextWidth = this._mainTitle ? null === (_x = this._mainTitle) || void 0 === _x ? void 0 : _x.AABBBounds.width() : 0;
|
|
36854
|
+
if (!1 !== (null === (_y = this.attribute) || void 0 === _y ? void 0 : _y.visible) && !1 !== (null == subtextStyle ? void 0 : subtextStyle.visible)) if ("rich" === subtextType || isValid$1(subtextStyle.character)) {
|
|
36855
|
+
const attr = Object.assign({
|
|
36856
|
+
x: null !== (_z = subtextStyle.x) && void 0 !== _z ? _z : 0,
|
|
36857
|
+
y: null !== (_0 = subtextStyle.y) && void 0 !== _0 ? _0 : 0,
|
|
36858
|
+
width: null !== (_2 = null !== (_1 = subtextStyle.width) && void 0 !== _1 ? _1 : width) && void 0 !== _2 ? _2 : 0,
|
|
36859
|
+
height: null !== (_4 = null !== (_3 = subtextStyle.height) && void 0 !== _3 ? _3 : height) && void 0 !== _4 ? _4 : 0,
|
|
36860
|
+
ellipsis: null === (_5 = subtextStyle.ellipsis) || void 0 === _5 || _5,
|
|
36861
|
+
wordBreak: null !== (_6 = subtextStyle.wordBreak) && void 0 !== _6 ? _6 : "break-word",
|
|
36708
36862
|
maxHeight: subtextStyle.maxHeight,
|
|
36709
36863
|
maxWidth: subtextStyle.maxWidth,
|
|
36710
|
-
textConfig: subtextStyle.character
|
|
36711
|
-
};
|
|
36864
|
+
textConfig: null !== (_7 = subtextStyle.character) && void 0 !== _7 ? _7 : subtext
|
|
36865
|
+
}, subtextStyle);
|
|
36866
|
+
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
36867
|
+
} else if ("html" === subtextType) {
|
|
36868
|
+
const attr = Object.assign({
|
|
36869
|
+
html: Object.assign(Object.assign({
|
|
36870
|
+
dom: subtext
|
|
36871
|
+
}, DEFAULT_HTML_TEXT_SPEC), subtextStyle),
|
|
36872
|
+
x: null !== (_8 = subtextStyle.x) && void 0 !== _8 ? _8 : 0,
|
|
36873
|
+
y: null !== (_9 = subtextStyle.y) && void 0 !== _9 ? _9 : 0,
|
|
36874
|
+
width: null !== (_11 = null !== (_10 = subtextStyle.width) && void 0 !== _10 ? _10 : width) && void 0 !== _11 ? _11 : 0,
|
|
36875
|
+
height: null !== (_13 = null !== (_12 = subtextStyle.height) && void 0 !== _12 ? _12 : height) && void 0 !== _13 ? _13 : 0,
|
|
36876
|
+
ellipsis: null === (_14 = subtextStyle.ellipsis) || void 0 === _14 || _14,
|
|
36877
|
+
wordBreak: null !== (_15 = subtextStyle.wordBreak) && void 0 !== _15 ? _15 : "break-word",
|
|
36878
|
+
maxHeight: subtextStyle.maxHeight,
|
|
36879
|
+
maxWidth: subtextStyle.maxWidth,
|
|
36880
|
+
textConfig: []
|
|
36881
|
+
}, subtextStyle);
|
|
36712
36882
|
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
36713
36883
|
} else isValid$1(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
|
|
36714
36884
|
text: [subtext]
|
|
36715
36885
|
}, subtextStyle), {
|
|
36716
|
-
maxLineWidth: null !== (
|
|
36886
|
+
maxLineWidth: null !== (_16 = null == subtextStyle ? void 0 : subtextStyle.maxLineWidth) && void 0 !== _16 ? _16 : width,
|
|
36717
36887
|
heightLimit: null == subtextStyle ? void 0 : subtextStyle.heightLimit,
|
|
36718
36888
|
lineClamp: null == subtextStyle ? void 0 : subtextStyle.lineClamp,
|
|
36719
|
-
ellipsis: null === (
|
|
36889
|
+
ellipsis: null === (_17 = null == subtextStyle ? void 0 : subtextStyle.ellipsis) || void 0 === _17 || _17,
|
|
36720
36890
|
x: 0,
|
|
36721
36891
|
y: maintextHeight
|
|
36722
36892
|
}), "wrapText"));
|
|
36723
|
-
const subtextHeight = this._subTitle ? null === (
|
|
36724
|
-
subtextWidth = this._subTitle ? null === (
|
|
36893
|
+
const subtextHeight = this._subTitle ? null === (_18 = this._subTitle) || void 0 === _18 ? void 0 : _18.AABBBounds.height() : 0,
|
|
36894
|
+
subtextWidth = this._subTitle ? null === (_19 = this._subTitle) || void 0 === _19 ? void 0 : _19.AABBBounds.width() : 0;
|
|
36725
36895
|
let titleWidth = Math.max(maintextWidth, subtextWidth),
|
|
36726
|
-
titleHeight = maintextHeight + (null !== (
|
|
36727
|
-
if (isValid$1(width) && (titleWidth = width, null === (
|
|
36896
|
+
titleHeight = maintextHeight + (null !== (_20 = null == subtextStyle ? void 0 : subtextStyle.height) && void 0 !== _20 ? _20 : subtextHeight);
|
|
36897
|
+
if (isValid$1(width) && (titleWidth = width, null === (_21 = this._mainTitle) || void 0 === _21 || _21.setAttribute("maxLineWidth", width), null === (_22 = this._subTitle) || void 0 === _22 || _22.setAttribute("maxLineWidth", width)), isValid$1(height) && (titleHeight = height), isValid$1(minWidth) && titleWidth < minWidth && (titleWidth = minWidth), isValid$1(maxWidth) && (null === (_23 = this._mainTitle) || void 0 === _23 || _23.setAttribute("maxLineWidth", maxWidth), null === (_24 = this._subTitle) || void 0 === _24 || _24.setAttribute("maxLineWidth", maxWidth), null === (_25 = this._mainTitle) || void 0 === _25 || _25.setAttribute("maxWidth", maxWidth), null === (_26 = this._subTitle) || void 0 === _26 || _26.setAttribute("maxWidth", maxWidth), titleWidth > maxWidth && (titleWidth = maxWidth)), isValid$1(minHeight) && titleHeight < minHeight && (titleHeight = minHeight), isValid$1(maxHeight) && (null === (_27 = this._mainTitle) || void 0 === _27 || _27.setAttribute("maxHeight", maxHeight), null === (_28 = this._subTitle) || void 0 === _28 || _28.setAttribute("maxHeight", maxHeight - maintextHeight), titleHeight > maxHeight && (titleHeight = maxHeight)), group.attribute.width = titleWidth, group.attribute.height = titleHeight, group.attribute.boundsPadding = parsedPadding, isValid$1(align) || isValid$1(null == textStyle ? void 0 : textStyle.align)) {
|
|
36728
36898
|
const mainTitleAlign = (null == textStyle ? void 0 : textStyle.align) ? null == textStyle ? void 0 : textStyle.align : align,
|
|
36729
|
-
mainTitleWidth = null !== (
|
|
36730
|
-
"left" === mainTitleAlign ? (null === (
|
|
36899
|
+
mainTitleWidth = null !== (_29 = null == textStyle ? void 0 : textStyle.width) && void 0 !== _29 ? _29 : maintextWidth;
|
|
36900
|
+
"left" === mainTitleAlign ? (null === (_30 = this._mainTitle) || void 0 === _30 || _30.setAttribute("x", 0), null === (_31 = this._mainTitle) || void 0 === _31 || _31.setAttribute("textAlign", "left")) : "center" === mainTitleAlign ? (null === (_32 = this._mainTitle) || void 0 === _32 || _32.setAttribute("x", mainTitleWidth / 2), null === (_33 = this._mainTitle) || void 0 === _33 || _33.setAttribute("textAlign", "center")) : "right" === mainTitleAlign && (null === (_34 = this._mainTitle) || void 0 === _34 || _34.setAttribute("x", mainTitleWidth), null === (_35 = this._mainTitle) || void 0 === _35 || _35.setAttribute("textAlign", "right"));
|
|
36731
36901
|
}
|
|
36732
36902
|
if (isValid$1(verticalAlign) || isValid$1(null == textStyle ? void 0 : textStyle.verticalAlign)) {
|
|
36733
36903
|
const mainTitleVerticalAlign = (null == textStyle ? void 0 : textStyle.verticalAlign) ? null == textStyle ? void 0 : textStyle.verticalAlign : verticalAlign,
|
|
36734
36904
|
mainTitleHeight = (null == textStyle ? void 0 : textStyle.height) ? null == textStyle ? void 0 : textStyle.height : titleHeight;
|
|
36735
|
-
"top" === mainTitleVerticalAlign ? (null === (
|
|
36905
|
+
"top" === mainTitleVerticalAlign ? (null === (_36 = this._mainTitle) || void 0 === _36 || _36.setAttribute("y", 0), null === (_37 = this._mainTitle) || void 0 === _37 || _37.setAttribute("textBaseline", "top")) : "middle" === mainTitleVerticalAlign ? (null === (_38 = this._mainTitle) || void 0 === _38 || _38.setAttribute("y", mainTitleHeight / 2), null === (_39 = this._mainTitle) || void 0 === _39 || _39.setAttribute("textBaseline", "middle")) : "bottom" === mainTitleVerticalAlign && (null === (_40 = this._mainTitle) || void 0 === _40 || _40.setAttribute("y", mainTitleHeight), null === (_41 = this._mainTitle) || void 0 === _41 || _41.setAttribute("textBaseline", "bottom"));
|
|
36736
36906
|
}
|
|
36737
36907
|
if (isValid$1(align) || isValid$1(null == subtextStyle ? void 0 : subtextStyle.align)) {
|
|
36738
36908
|
const subTitleAlign = (null == subtextStyle ? void 0 : subtextStyle.align) ? null == subtextStyle ? void 0 : subtextStyle.align : align,
|
|
36739
|
-
subTitleWidth = null !== (
|
|
36740
|
-
"left" === subTitleAlign ? (null === (
|
|
36909
|
+
subTitleWidth = null !== (_42 = null == subtextStyle ? void 0 : subtextStyle.width) && void 0 !== _42 ? _42 : subtextWidth;
|
|
36910
|
+
"left" === subTitleAlign ? (null === (_43 = this._subTitle) || void 0 === _43 || _43.setAttribute("x", 0), null === (_44 = this._subTitle) || void 0 === _44 || _44.setAttribute("textAlign", "left")) : "center" === subTitleAlign ? (null === (_45 = this._subTitle) || void 0 === _45 || _45.setAttribute("x", subTitleWidth / 2), null === (_46 = this._subTitle) || void 0 === _46 || _46.setAttribute("textAlign", "center")) : "right" === subTitleAlign && (null === (_47 = this._subTitle) || void 0 === _47 || _47.setAttribute("x", subTitleWidth), null === (_48 = this._subTitle) || void 0 === _48 || _48.setAttribute("textAlign", "right"));
|
|
36741
36911
|
}
|
|
36742
36912
|
if (isValid$1(verticalAlign) || isValid$1(null == textStyle ? void 0 : textStyle.verticalAlign)) {
|
|
36743
36913
|
const subTitleVerticalAlign = (null == subtextStyle ? void 0 : subtextStyle.verticalAlign) ? null == subtextStyle ? void 0 : subtextStyle.verticalAlign : verticalAlign,
|
|
36744
36914
|
subTitleYStart = maintextHeight,
|
|
36745
|
-
subTitleHeight = null !== (
|
|
36746
|
-
"top" === subTitleVerticalAlign ? (null === (
|
|
36915
|
+
subTitleHeight = null !== (_49 = null == subtextStyle ? void 0 : subtextStyle.height) && void 0 !== _49 ? _49 : 0;
|
|
36916
|
+
"top" === subTitleVerticalAlign ? (null === (_50 = this._subTitle) || void 0 === _50 || _50.setAttribute("y", subTitleYStart), null === (_51 = this._subTitle) || void 0 === _51 || _51.setAttribute("textBaseline", "top")) : "middle" === subTitleVerticalAlign ? (null === (_52 = this._subTitle) || void 0 === _52 || _52.setAttribute("y", subTitleYStart + subTitleHeight / 2), null === (_53 = this._subTitle) || void 0 === _53 || _53.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && (null === (_54 = this._subTitle) || void 0 === _54 || _54.setAttribute("y", subTitleYStart + subTitleHeight), null === (_55 = this._subTitle) || void 0 === _55 || _55.setAttribute("textBaseline", "bottom"));
|
|
36747
36917
|
}
|
|
36748
36918
|
}
|
|
36749
36919
|
};
|
|
@@ -36796,7 +36966,7 @@
|
|
|
36796
36966
|
super(...arguments), this.name = "indicator";
|
|
36797
36967
|
}
|
|
36798
36968
|
render() {
|
|
36799
|
-
var _a;
|
|
36969
|
+
var _a, _b, _c;
|
|
36800
36970
|
const {
|
|
36801
36971
|
visible: visible,
|
|
36802
36972
|
title: title,
|
|
@@ -36813,7 +36983,24 @@
|
|
|
36813
36983
|
if (!0 !== visible) return void (group && group.hideAll());
|
|
36814
36984
|
if (isValid$1(title)) if (!1 !== title.visible) {
|
|
36815
36985
|
const titleStyle = merge$1({}, get$1(DEFAULT_INDICATOR_THEME, "title.style"), title.style);
|
|
36816
|
-
this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
|
|
36986
|
+
"rich" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
|
|
36987
|
+
textConfig: titleStyle.text
|
|
36988
|
+
}, titleStyle), {
|
|
36989
|
+
visible: title.visible,
|
|
36990
|
+
x: 0,
|
|
36991
|
+
y: 0,
|
|
36992
|
+
width: null !== (_a = titleStyle.width) && void 0 !== _a ? _a : 0,
|
|
36993
|
+
height: null !== (_b = titleStyle.height) && void 0 !== _b ? _b : 0
|
|
36994
|
+
}), "richtext") : "html" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
|
|
36995
|
+
textConfig: [],
|
|
36996
|
+
html: Object.assign(Object.assign({
|
|
36997
|
+
dom: titleStyle.text
|
|
36998
|
+
}, DEFAULT_HTML_TEXT_SPEC), titleStyle)
|
|
36999
|
+
}, titleStyle), {
|
|
37000
|
+
visible: title.visible,
|
|
37001
|
+
x: 0,
|
|
37002
|
+
y: 0
|
|
37003
|
+
}), "richtext") : this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({}, titleStyle), {
|
|
36817
37004
|
lineHeight: isValid$1(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize,
|
|
36818
37005
|
visible: title.visible,
|
|
36819
37006
|
x: 0,
|
|
@@ -36830,15 +37017,33 @@
|
|
|
36830
37017
|
contentComponents = [];
|
|
36831
37018
|
let lastContentHeight = 0;
|
|
36832
37019
|
contents.forEach((contentItem, i) => {
|
|
37020
|
+
var _a, _b;
|
|
36833
37021
|
if (!1 !== contentItem.visible) {
|
|
36834
|
-
const contentStyle = merge$1({}, get$1(DEFAULT_INDICATOR_THEME, "content.style"), contentItem.style)
|
|
36835
|
-
|
|
36836
|
-
|
|
36837
|
-
|
|
36838
|
-
|
|
36839
|
-
|
|
36840
|
-
|
|
36841
|
-
|
|
37022
|
+
const contentStyle = merge$1({}, get$1(DEFAULT_INDICATOR_THEME, "content.style"), contentItem.style);
|
|
37023
|
+
let contentComponent;
|
|
37024
|
+
contentComponent = "rich" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
|
|
37025
|
+
textConfig: contentStyle.text
|
|
37026
|
+
}, contentStyle), {
|
|
37027
|
+
visible: title.visible,
|
|
37028
|
+
x: 0,
|
|
37029
|
+
y: titleHeight + titleSpace + lastContentHeight,
|
|
37030
|
+
width: null !== (_a = contentStyle.width) && void 0 !== _a ? _a : 0,
|
|
37031
|
+
height: null !== (_b = contentStyle.height) && void 0 !== _b ? _b : 0
|
|
37032
|
+
}), "richtext") : "html" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
|
|
37033
|
+
textConfig: [],
|
|
37034
|
+
html: Object.assign(Object.assign({
|
|
37035
|
+
dom: contentStyle.text
|
|
37036
|
+
}, DEFAULT_HTML_TEXT_SPEC), contentStyle)
|
|
37037
|
+
}, contentStyle), {
|
|
37038
|
+
visible: title.visible,
|
|
37039
|
+
x: 0,
|
|
37040
|
+
y: titleHeight + titleSpace + lastContentHeight
|
|
37041
|
+
}), "richtext") : group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({}, contentStyle), {
|
|
37042
|
+
lineHeight: isValid$1(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize,
|
|
37043
|
+
visible: contentItem.visible,
|
|
37044
|
+
x: 0,
|
|
37045
|
+
y: titleHeight + titleSpace + lastContentHeight
|
|
37046
|
+
}), "text"), contentItem.autoFit && isValidNumber$1(limit) && this._setAutoFit(limit, contentComponent, contentItem), contentItem.autoLimit && isValidNumber$1(limitRatio) && contentComponent.setAttribute("maxLineWidth", limit), contentComponents.push(contentComponent);
|
|
36842
37047
|
const contentSpace = (null == contentItem ? void 0 : contentItem.space) ? contentItem.space : 0;
|
|
36843
37048
|
lastContentHeight += contentComponent.AABBBounds.height() + contentSpace;
|
|
36844
37049
|
} else {
|
|
@@ -36847,7 +37052,7 @@
|
|
|
36847
37052
|
}
|
|
36848
37053
|
}), this._content = contentComponents;
|
|
36849
37054
|
}
|
|
36850
|
-
const totalHeight = null !== (
|
|
37055
|
+
const totalHeight = null !== (_c = null == group ? void 0 : group.AABBBounds.height()) && void 0 !== _c ? _c : 0;
|
|
36851
37056
|
group.setAttribute("y", size.height / 2 - totalHeight / 2), group.setAttribute("x", size.width / 2);
|
|
36852
37057
|
}
|
|
36853
37058
|
_setAutoFit(limit, indicatorItem, indicatorItemSpec) {
|
|
@@ -37075,7 +37280,7 @@
|
|
|
37075
37280
|
super(merge$1({}, BasePlayer.defaultAttributes, attributes)), this._data = [], this._layoutInfo = {}, this._updateSliderAttrs = () => {
|
|
37076
37281
|
var _a, _b, _c;
|
|
37077
37282
|
let handlerSize;
|
|
37078
|
-
isValidNumber$1(this._handlerStyle.size) ? handlerSize = this._handlerStyle.size : this._handlerStyle.size && this._handlerStyle.size.length && (handlerSize = max$
|
|
37283
|
+
isValidNumber$1(this._handlerStyle.size) ? handlerSize = this._handlerStyle.size : this._handlerStyle.size && this._handlerStyle.size.length && (handlerSize = max$1(this._handlerStyle.size[0], this._handlerStyle.size[1]));
|
|
37079
37284
|
const attrs = {
|
|
37080
37285
|
visible: this._sliderVisible,
|
|
37081
37286
|
min: this._minIndex,
|
|
@@ -37181,7 +37386,7 @@
|
|
|
37181
37386
|
railSectionLength = null !== (_a = isHorizontal$1(this._orient) ? this._railStyle.height : this._railStyle.width) && void 0 !== _a ? _a : RailDefaultSize[1],
|
|
37182
37387
|
controllerPx = controllers.reduce((len, controller) => {
|
|
37183
37388
|
const size = controller.style.size,
|
|
37184
|
-
maxSize = isNumber$2(size) ? size : max$
|
|
37389
|
+
maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
|
|
37185
37390
|
return len + controller.space + maxSize;
|
|
37186
37391
|
}, 0),
|
|
37187
37392
|
sliderPx = this._sliderVisible ? (isHorizontal$1(this._orient) ? null === (_b = this._size) || void 0 === _b ? void 0 : _b.width : null === (_c = this._size) || void 0 === _c ? void 0 : _c.height) - controllerPx : 0,
|
|
@@ -37194,7 +37399,7 @@
|
|
|
37194
37399
|
size: size
|
|
37195
37400
|
}
|
|
37196
37401
|
} = controller,
|
|
37197
|
-
maxSize = isNumber$2(size) ? size : max$
|
|
37402
|
+
maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
|
|
37198
37403
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
37199
37404
|
size: maxSize,
|
|
37200
37405
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -37213,7 +37418,7 @@
|
|
|
37213
37418
|
size: size
|
|
37214
37419
|
}
|
|
37215
37420
|
} = controller,
|
|
37216
|
-
maxSize = isNumber$2(size) ? size : max$
|
|
37421
|
+
maxSize = isNumber$2(size) ? size : max$1(size[0], size[1]);
|
|
37217
37422
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
37218
37423
|
size: maxSize,
|
|
37219
37424
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -37723,7 +37928,7 @@
|
|
|
37723
37928
|
textBaseline: textBaseline,
|
|
37724
37929
|
text: text
|
|
37725
37930
|
} = attr;
|
|
37726
|
-
return {
|
|
37931
|
+
return Array.isArray(text) ? {
|
|
37727
37932
|
width: width,
|
|
37728
37933
|
height: height,
|
|
37729
37934
|
wordBreak: wordBreak,
|
|
@@ -37733,6 +37938,14 @@
|
|
|
37733
37938
|
textConfig: array(text).map(text => Object.assign(Object.assign({}, attr), {
|
|
37734
37939
|
text: text
|
|
37735
37940
|
}))
|
|
37941
|
+
} : {
|
|
37942
|
+
width: width,
|
|
37943
|
+
height: height,
|
|
37944
|
+
wordBreak: wordBreak,
|
|
37945
|
+
textAlign: textAlign,
|
|
37946
|
+
textBaseline: textBaseline,
|
|
37947
|
+
singleLine: !1,
|
|
37948
|
+
textConfig: text.text
|
|
37736
37949
|
};
|
|
37737
37950
|
};
|
|
37738
37951
|
|
|
@@ -37806,6 +38019,7 @@
|
|
|
37806
38019
|
super(merge$1({}, Tooltip.defaultAttributes, attributes)), this.name = "tooltip";
|
|
37807
38020
|
}
|
|
37808
38021
|
render() {
|
|
38022
|
+
var _a;
|
|
37809
38023
|
const {
|
|
37810
38024
|
visible: visible,
|
|
37811
38025
|
content: content,
|
|
@@ -37831,12 +38045,26 @@
|
|
|
37831
38045
|
symbolType: "circle"
|
|
37832
38046
|
}, titleAttr.shape, {
|
|
37833
38047
|
visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
|
|
37834
|
-
}), "symbol"), titleAttr.value.multiLine ? this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value", Object.assign({
|
|
38048
|
+
}), "symbol"), "object" != typeof titleAttr.value.text || null === titleAttr.value.text || "rich" !== titleAttr.value.text.type && "html" !== titleAttr.value.text.type ? titleAttr.value.multiLine ? this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value", Object.assign({
|
|
37835
38049
|
visible: isVisible(titleAttr) && isVisible(titleAttr.value)
|
|
37836
38050
|
}, getRichTextAttribute(titleAttr.value)), "richtext") : this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value", Object.assign({
|
|
37837
|
-
text: "",
|
|
38051
|
+
text: null !== (_a = titleAttr.value.text) && void 0 !== _a ? _a : "",
|
|
37838
38052
|
visible: isVisible(titleAttr) && isVisible(titleAttr.value)
|
|
37839
|
-
}, titleAttr.value), "text")
|
|
38053
|
+
}, titleAttr.value), "text") : "rich" === titleAttr.value.text.type ? this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value", Object.assign({
|
|
38054
|
+
visible: isVisible(titleAttr) && isVisible(titleAttr.value)
|
|
38055
|
+
}, getRichTextAttribute(titleAttr.value)), "richtext") : "html" === titleAttr.value.text.type && (this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value", Object.assign({
|
|
38056
|
+
html: Object.assign(Object.assign({
|
|
38057
|
+
dom: titleAttr.value.text.text
|
|
38058
|
+
}, DEFAULT_HTML_TEXT_SPEC), titleAttr.value),
|
|
38059
|
+
visible: isVisible(titleAttr) && isVisible(titleAttr.value),
|
|
38060
|
+
width: titleAttr.value.width,
|
|
38061
|
+
height: titleAttr.value.height,
|
|
38062
|
+
wordBreak: titleAttr.value.wordBreak,
|
|
38063
|
+
textAlign: titleAttr.value.textAlign,
|
|
38064
|
+
textBaseline: titleAttr.value.textBaseline,
|
|
38065
|
+
singleLine: !1,
|
|
38066
|
+
textConfig: []
|
|
38067
|
+
}, titleAttr.value), "richtext"));
|
|
37840
38068
|
const titlePaddingLeft = isVisible(titleAttr.shape) ? titleAttr.shape.size + titleAttr.shape.spacing : 0,
|
|
37841
38069
|
{
|
|
37842
38070
|
textAlign: textAlign,
|
|
@@ -37851,7 +38079,7 @@
|
|
|
37851
38079
|
this._tooltipContent.setAttribute("x", padding[3]), this._tooltipContent.setAttribute("y", padding[0] + titleHeight);
|
|
37852
38080
|
let lastYPos = 0;
|
|
37853
38081
|
content.forEach((item, i) => {
|
|
37854
|
-
var _a;
|
|
38082
|
+
var _a, _b, _c;
|
|
37855
38083
|
const itemAttr = Tooltip.getContentAttr(this.attribute, i);
|
|
37856
38084
|
if (!isVisible(itemAttr)) return;
|
|
37857
38085
|
const itemGroupName = `tooltip-content-${i}`,
|
|
@@ -37871,11 +38099,20 @@
|
|
|
37871
38099
|
visible: !0
|
|
37872
38100
|
}, getRichTextAttribute(itemAttr.key)), {
|
|
37873
38101
|
textBaseline: "top"
|
|
37874
|
-
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
37875
|
-
visible: !0
|
|
38102
|
+
}), "richtext") : "object" != typeof itemAttr.key.text || null === itemAttr.key.text || "rich" !== itemAttr.key.text.type && "html" !== itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-key`, Object.assign(Object.assign({
|
|
38103
|
+
visible: !0,
|
|
38104
|
+
text: null !== (_b = itemAttr.key.text) && void 0 !== _b ? _b : ""
|
|
37876
38105
|
}, itemAttr.key), {
|
|
37877
38106
|
textBaseline: "top"
|
|
37878
|
-
}), "text")
|
|
38107
|
+
}), "text") : "rich" === itemAttr.key.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
38108
|
+
visible: !0
|
|
38109
|
+
}, getRichTextAttribute(itemAttr.key)), {
|
|
38110
|
+
textBaseline: "top"
|
|
38111
|
+
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
38112
|
+
html: Object.assign(Object.assign({
|
|
38113
|
+
dom: itemAttr.key.text.text
|
|
38114
|
+
}, DEFAULT_HTML_TEXT_SPEC), itemAttr.key)
|
|
38115
|
+
}, "richtext");
|
|
37879
38116
|
const {
|
|
37880
38117
|
textAlign: textAlign
|
|
37881
38118
|
} = itemAttr.key;
|
|
@@ -37887,11 +38124,24 @@
|
|
|
37887
38124
|
visible: !0
|
|
37888
38125
|
}, getRichTextAttribute(itemAttr.value)), {
|
|
37889
38126
|
textBaseline: "top"
|
|
37890
|
-
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
37891
|
-
visible: !0
|
|
38127
|
+
}), "richtext") : "object" != typeof itemAttr.value.text || null === itemAttr.value.text || "rich" !== itemAttr.value.text.type && "html" !== itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
38128
|
+
visible: !0,
|
|
38129
|
+
text: null !== (_c = itemAttr.value.text) && void 0 !== _c ? _c : ""
|
|
37892
38130
|
}, itemAttr.value), {
|
|
37893
38131
|
textBaseline: "top"
|
|
37894
|
-
}), "text")
|
|
38132
|
+
}), "text") : "rich" === itemAttr.value.text.type ? itemGroup.createOrUpdateChild(`${itemGroupName}-value`, Object.assign(Object.assign({
|
|
38133
|
+
visible: !0
|
|
38134
|
+
}, getRichTextAttribute(itemAttr.value)), {
|
|
38135
|
+
textBaseline: "top"
|
|
38136
|
+
}), "richtext") : itemGroup.createOrUpdateChild(`${itemGroupName}-value`, {
|
|
38137
|
+
html: Object.assign({
|
|
38138
|
+
dom: itemAttr.value.text.text,
|
|
38139
|
+
container: "",
|
|
38140
|
+
width: 30,
|
|
38141
|
+
height: 30,
|
|
38142
|
+
style: {}
|
|
38143
|
+
}, itemAttr.value)
|
|
38144
|
+
}, "richtext");
|
|
37895
38145
|
let textAlign = "right";
|
|
37896
38146
|
isValid$1(itemAttr.value.textAlign) ? textAlign = itemAttr.value.textAlign : isVisible(itemAttr.key) || (textAlign = "left"), element.setAttribute("textAlign", textAlign), "center" === textAlign ? element.setAttribute("x", x + valueWidth / 2) : "right" === textAlign || "end" === textAlign ? element.setAttribute("x", x + valueWidth) : element.setAttribute("x", x), x += valueWidth, element.setAttribute("y", 0), itemGroup.add(element);
|
|
37897
38147
|
}
|
|
@@ -37942,7 +38192,7 @@
|
|
|
37942
38192
|
visible: titleHasShape = !1,
|
|
37943
38193
|
symbolType: titleShapeType = ""
|
|
37944
38194
|
} = null != titleShape ? titleShape : {};
|
|
37945
|
-
if (isValid$1(titleValue)) {
|
|
38195
|
+
if (isValid$1(titleValue) && "object" != typeof titleAttr.value.text) {
|
|
37946
38196
|
const {
|
|
37947
38197
|
width: width,
|
|
37948
38198
|
height: height
|
|
@@ -38835,7 +39085,7 @@
|
|
|
38835
39085
|
class Gesture extends EventEmitter {
|
|
38836
39086
|
constructor(element) {
|
|
38837
39087
|
let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
38838
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
39088
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
38839
39089
|
super(), this.cachedEvents = [], this.startPoints = [], this.processEvent = {}, this.throttleTimer = 0, this.emitThrottles = [], this.onStart = ev => {
|
|
38840
39090
|
this.reset(), this.startTime = clock.now();
|
|
38841
39091
|
const {
|
|
@@ -38923,13 +39173,14 @@
|
|
|
38923
39173
|
velocity > this.config.swipe.velocity && distance > this.config.swipe.threshold && (endEvent.velocity = velocity, endEvent.direction = calcDirection(prevMovePoint, lastMovePoint), this.triggerEvent("swipe", endEvent));
|
|
38924
39174
|
}
|
|
38925
39175
|
}
|
|
39176
|
+
now - this.lastTapTime < this.config.tap.interval ? this.tapCount++ : this.tapCount = 1, this.lastTapTime = now, 1 === this.tapCount ? this.triggerEvent("tap", endEvent) : 2 === this.tapCount && (this.triggerEvent("doubletap", endEvent), this.tapCount = 0);
|
|
38926
39177
|
}
|
|
38927
39178
|
for (let i = 0, len = cachedEvents.length; i < len; i++) if (cachedEvents[i].pointerId === endEvent.pointerId) {
|
|
38928
39179
|
cachedEvents.splice(i, 1), startPoints.splice(i, 1);
|
|
38929
39180
|
break;
|
|
38930
39181
|
}
|
|
38931
39182
|
this.reset(), cachedEvents.length > 0 && this.onStart();
|
|
38932
|
-
}, this.element = element, this.config = {
|
|
39183
|
+
}, this.element = element, this.tapCount = 0, this.lastTapTime = 0, this.config = {
|
|
38933
39184
|
press: {
|
|
38934
39185
|
time: null !== (_b = null === (_a = null == config ? void 0 : config.press) || void 0 === _a ? void 0 : _a.time) && void 0 !== _b ? _b : 251,
|
|
38935
39186
|
threshold: null !== (_d = null === (_c = null == config ? void 0 : config.press) || void 0 === _c ? void 0 : _c.threshold) && void 0 !== _d ? _d : 9
|
|
@@ -38937,6 +39188,9 @@
|
|
|
38937
39188
|
swipe: {
|
|
38938
39189
|
threshold: null !== (_f = null === (_e = null == config ? void 0 : config.swipe) || void 0 === _e ? void 0 : _e.threshold) && void 0 !== _f ? _f : 10,
|
|
38939
39190
|
velocity: null !== (_h = null === (_g = null == config ? void 0 : config.swipe) || void 0 === _g ? void 0 : _g.velocity) && void 0 !== _h ? _h : .3
|
|
39191
|
+
},
|
|
39192
|
+
tap: {
|
|
39193
|
+
interval: null !== (_k = null === (_j = null == config ? void 0 : config.tap) || void 0 === _j ? void 0 : _j.interval) && void 0 !== _k ? _k : 300
|
|
38940
39194
|
}
|
|
38941
39195
|
}, this.initEvents();
|
|
38942
39196
|
}
|
|
@@ -40979,6 +41233,7 @@
|
|
|
40979
41233
|
}
|
|
40980
41234
|
contains(polygon, point, params) {
|
|
40981
41235
|
if (!polygon.AABBBounds.contains(point.x, point.y)) return !1;
|
|
41236
|
+
if ("imprecise" === polygon.attribute.pickMode) return !0;
|
|
40982
41237
|
const {
|
|
40983
41238
|
pickContext: pickContext
|
|
40984
41239
|
} = null != params ? params : {};
|
|
@@ -43414,7 +43669,7 @@
|
|
|
43414
43669
|
}), fieldData;
|
|
43415
43670
|
}
|
|
43416
43671
|
function parseScaleDataTypeValue(fieldData, scale, sort, filterNumber) {
|
|
43417
|
-
return sort && fieldData.sort(sort), isContinuous(scale.type) ? (filterNumber && fieldData.filter(entry => isNumber$2(entry)), [
|
|
43672
|
+
return sort && fieldData.sort(sort), isContinuous(scale.type) ? (filterNumber && fieldData.filter(entry => isNumber$2(entry)), [minInArray(fieldData), maxInArray(fieldData)]) : fieldData;
|
|
43418
43673
|
}
|
|
43419
43674
|
function configureScale(spec, scale, parameters) {
|
|
43420
43675
|
if (isScaleDataType(spec.domain) ? scale.domain(parseScaleDataTypeValue(parseFieldData(spec.domain, parameters), scale, spec.domain.sort, !0), !0) : isMultiScaleDataType(spec.domain) ? scale.domain(parseScaleDataTypeValue(parseMultiFieldData(spec.domain, parameters), scale, spec.domain.sort, !0), !0) : scale.domain(invokeFunctionType(spec.domain, parameters, scale), !0), "identity" !== spec.type) if (isScaleDataType(spec.range)) scale.range(parseScaleDataTypeValue(parseFieldData(spec.range, parameters), scale), !0);else if (isMultiScaleDataType(spec.range)) scale.range(parseScaleDataTypeValue(parseMultiFieldData(spec.range, parameters), scale), !0);else if (isScaleCoordinateType(spec.range)) {
|
|
@@ -43763,12 +44018,10 @@
|
|
|
43763
44018
|
};
|
|
43764
44019
|
}
|
|
43765
44020
|
_generateGlyphItems(markType, items, additionalAttributes) {
|
|
43766
|
-
|
|
43767
|
-
|
|
43768
|
-
|
|
43769
|
-
|
|
43770
|
-
}));
|
|
43771
|
-
return CollectionMarkType.includes(markType) && nextAttrs.enableSegments && glyphItems.forEach((glyphItem, index) => {
|
|
44021
|
+
const glyphItems = items.map(item => Object.assign({}, item, {
|
|
44022
|
+
nextAttrs: additionalAttributes
|
|
44023
|
+
}));
|
|
44024
|
+
return CollectionMarkType.includes(markType) && this.mark.getSpec().enableSegments && glyphItems.forEach((glyphItem, index) => {
|
|
43772
44025
|
glyphItem.nextAttrs = Object.assign({}, items[index].nextAttrs, additionalAttributes);
|
|
43773
44026
|
}), glyphItems;
|
|
43774
44027
|
}
|
|
@@ -44123,6 +44376,7 @@
|
|
|
44123
44376
|
}
|
|
44124
44377
|
animateTimeSlice(graphicAnimate, timeSlice, animationParameters, parameters) {
|
|
44125
44378
|
const delay = timeSlice.delay,
|
|
44379
|
+
delayAfter = timeSlice.delayAfter,
|
|
44126
44380
|
duration = timeSlice.duration,
|
|
44127
44381
|
effects = timeSlice.effects;
|
|
44128
44382
|
if (delay > 0 && graphicAnimate.wait(delay), effects.length < 0) graphicAnimate.wait(duration);else {
|
|
@@ -44141,11 +44395,12 @@
|
|
|
44141
44395
|
}).filter(animate => !isNil$1(animate));
|
|
44142
44396
|
1 === customAnimates.length ? graphicAnimate.play(customAnimates[0]) : graphicAnimate.play(new AnimateGroup(duration, customAnimates));
|
|
44143
44397
|
}
|
|
44398
|
+
delayAfter > 0 && graphicAnimate.wait(delayAfter);
|
|
44144
44399
|
}
|
|
44145
44400
|
}
|
|
44146
44401
|
|
|
44147
44402
|
function transformToTimelineConfig(animationConfig) {
|
|
44148
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
44403
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
44149
44404
|
if (isNil$1(animationConfig.timeSlices)) {
|
|
44150
44405
|
const typeConfig = animationConfig;
|
|
44151
44406
|
return {
|
|
@@ -44157,11 +44412,12 @@
|
|
|
44157
44412
|
timeSlices: [{
|
|
44158
44413
|
duration: null !== (_e = typeConfig.duration) && void 0 !== _e ? _e : DefaultAnimationDuration,
|
|
44159
44414
|
delay: null !== (_f = typeConfig.delay) && void 0 !== _f ? _f : DefaultAnimationDelay,
|
|
44415
|
+
delayAfter: null !== (_g = typeConfig.delayAfter) && void 0 !== _g ? _g : DefaultAnimationDelayAfter,
|
|
44160
44416
|
effects: [{
|
|
44161
44417
|
type: typeConfig.type,
|
|
44162
44418
|
channel: typeConfig.channel,
|
|
44163
44419
|
custom: typeConfig.custom,
|
|
44164
|
-
easing: null !== (
|
|
44420
|
+
easing: null !== (_h = typeConfig.easing) && void 0 !== _h ? _h : DefaultAnimationEasing,
|
|
44165
44421
|
customParameters: typeConfig.customParameters,
|
|
44166
44422
|
options: typeConfig.options
|
|
44167
44423
|
}]
|
|
@@ -44170,16 +44426,17 @@
|
|
|
44170
44426
|
}
|
|
44171
44427
|
const formattedTimeSlices = array(animationConfig.timeSlices).filter(timeSlice => timeSlice.effects && array(timeSlice.effects).filter(effect => effect.channel || effect.type).length);
|
|
44172
44428
|
if (formattedTimeSlices.length) return {
|
|
44173
|
-
startTime: null !== (
|
|
44429
|
+
startTime: null !== (_j = animationConfig.startTime) && void 0 !== _j ? _j : DefaultAnimationStartTime,
|
|
44174
44430
|
totalTime: animationConfig.totalTime,
|
|
44175
|
-
oneByOne: null !== (
|
|
44176
|
-
loop: null !== (
|
|
44177
|
-
controlOptions: merge$1({}, DefaultAnimationControlOptions, null !== (
|
|
44431
|
+
oneByOne: null !== (_k = animationConfig.oneByOne) && void 0 !== _k ? _k : DefaultAnimationOneByOne,
|
|
44432
|
+
loop: null !== (_l = animationConfig.loop) && void 0 !== _l ? _l : DefaultAnimationLoop,
|
|
44433
|
+
controlOptions: merge$1({}, DefaultAnimationControlOptions, null !== (_m = animationConfig.controlOptions) && void 0 !== _m ? _m : {}),
|
|
44178
44434
|
timeSlices: formattedTimeSlices.map(timeSlice => {
|
|
44179
|
-
var _a;
|
|
44435
|
+
var _a, _b;
|
|
44180
44436
|
return {
|
|
44181
44437
|
duration: timeSlice.duration,
|
|
44182
44438
|
delay: null !== (_a = timeSlice.delay) && void 0 !== _a ? _a : DefaultAnimationDelay,
|
|
44439
|
+
delayAfter: null !== (_b = timeSlice.delayAfter) && void 0 !== _b ? _b : DefaultAnimationDelayAfter,
|
|
44183
44440
|
effects: array(timeSlice.effects).filter(effect => effect.channel || effect.type).map(effect => {
|
|
44184
44441
|
var _a;
|
|
44185
44442
|
return {
|
|
@@ -44446,6 +44703,7 @@
|
|
|
44446
44703
|
timeline.timeSlices.forEach(timeSlice => {
|
|
44447
44704
|
var _a;
|
|
44448
44705
|
const delay = invokeAnimateSpec(timeSlice.delay, element, parameters),
|
|
44706
|
+
delayAfter = invokeAnimateSpec(timeSlice.delayAfter, element, parameters),
|
|
44449
44707
|
duration = null !== (_a = invokeAnimateSpec(timeSlice.duration, element, parameters)) && void 0 !== _a ? _a : totalTime / elementCount,
|
|
44450
44708
|
effects = array(timeSlice.effects).map(effect => Object.assign({}, effect, {
|
|
44451
44709
|
customParameters: invokeAnimateSpec(effect.customParameters, element, parameters)
|
|
@@ -44453,8 +44711,9 @@
|
|
|
44453
44711
|
timeSlices.push({
|
|
44454
44712
|
effects: effects,
|
|
44455
44713
|
duration: duration,
|
|
44456
|
-
delay: delay
|
|
44457
|
-
|
|
44714
|
+
delay: delay,
|
|
44715
|
+
delayAfter: delayAfter
|
|
44716
|
+
}), loopTime += delay + duration + delayAfter;
|
|
44458
44717
|
});
|
|
44459
44718
|
const oneByOneDelay = isNumber$2(oneByOne) ? oneByOne : !0 === oneByOne ? loopTime : 0;
|
|
44460
44719
|
return {
|
|
@@ -44563,7 +44822,7 @@
|
|
|
44563
44822
|
reuse(grammar) {
|
|
44564
44823
|
if (grammar.grammarType !== this.grammarType) return this;
|
|
44565
44824
|
const mark = grammar;
|
|
44566
|
-
return this.markType = mark.markType, this.coord = mark.coord, this.elementMap = mark.elementMap, this.elements = mark.elements, this.elementMap.forEach(element => element.mark = this), this.differ = mark.differ, this.animate = mark.animate, this.animate.mark = this, this.
|
|
44825
|
+
return this.markType = mark.markType, this.coord = mark.coord, this.elementMap = mark.elementMap, this.elements = mark.elements, this.elementMap.forEach(element => element.mark = this), this.differ = mark.differ, this.animate = mark.animate, this.animate.mark = this, this._context = mark._context, this.graphicItem = mark.graphicItem, this.graphicIndex = mark.graphicIndex, this.graphicParent = mark.graphicParent, this.needClear = mark.needClear, this.isUpdated = mark.isUpdated, this;
|
|
44567
44826
|
}
|
|
44568
44827
|
needLayout() {
|
|
44569
44828
|
return !isNil$1(this.spec.layout);
|
|
@@ -44658,13 +44917,16 @@
|
|
|
44658
44917
|
return nextTransforms && (this.attach(nextTransforms.refs), this.transforms = nextTransforms.transforms), this.spec.transform = transforms, this.commit(), this;
|
|
44659
44918
|
}
|
|
44660
44919
|
configure(config) {
|
|
44661
|
-
const keys = ["clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme"];
|
|
44920
|
+
const keys = ["clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments"];
|
|
44662
44921
|
return null === config ? (keys.forEach(key => {
|
|
44663
44922
|
isNil$1(this.spec[key]) || (this.spec[key] = void 0);
|
|
44664
44923
|
}), this) : (keys.forEach(key => {
|
|
44665
44924
|
isNil$1(config[key]) || (this.spec[key] = config[key]);
|
|
44666
44925
|
}), this);
|
|
44667
44926
|
}
|
|
44927
|
+
context(context) {
|
|
44928
|
+
return this.spec.context = context, this._context = context, this;
|
|
44929
|
+
}
|
|
44668
44930
|
isCollectionMark() {
|
|
44669
44931
|
return CollectionMarkType.includes(this.markType);
|
|
44670
44932
|
}
|
|
@@ -44735,7 +44997,7 @@
|
|
|
44735
44997
|
this.graphicIndex = markIndex;
|
|
44736
44998
|
}
|
|
44737
44999
|
update(spec) {
|
|
44738
|
-
this.
|
|
45000
|
+
this._context = this.spec.context, this.isUpdated = !0, this.renderContext.progressive || (spec.animation && this.animate.updateConfig(spec.animation), this.animate.updateState(spec.animationState)), this.markType !== GrammarMarkType.group ? (isNil$1(spec.zIndex) || this.graphicItem.setAttribute("zIndex", spec.zIndex), isNil$1(spec.clip) || this.graphicItem.setAttribute("clip", spec.clip), this.elementMap.forEach(element => {
|
|
44739
45001
|
element.updateGraphicItem({
|
|
44740
45002
|
interactive: spec.interactive
|
|
44741
45003
|
});
|
|
@@ -45009,6 +45271,9 @@
|
|
|
45009
45271
|
var _a;
|
|
45010
45272
|
return null !== (_a = this.spec.attributeTransforms) && void 0 !== _a ? _a : transformsByType[this.markType];
|
|
45011
45273
|
}
|
|
45274
|
+
getContext() {
|
|
45275
|
+
return this._context;
|
|
45276
|
+
}
|
|
45012
45277
|
needSkipBeforeLayout() {
|
|
45013
45278
|
var _a, _b;
|
|
45014
45279
|
if (!0 === (null === (_a = this.spec.layout) || void 0 === _a ? void 0 : _a.skipBeforeLayouted)) return !0;
|
|
@@ -45441,10 +45706,10 @@
|
|
|
45441
45706
|
p1 = polarToCartesian$2(origin, this.outerRadius, angles[i]);
|
|
45442
45707
|
xs.push(p0.x), xs.push(p1.x), ys.push(p0.y), ys.push(p1.y);
|
|
45443
45708
|
}
|
|
45444
|
-
const minX =
|
|
45445
|
-
minY =
|
|
45446
|
-
maxX =
|
|
45447
|
-
maxY =
|
|
45709
|
+
const minX = minInArray(xs),
|
|
45710
|
+
minY = minInArray(ys),
|
|
45711
|
+
maxX = maxInArray(xs),
|
|
45712
|
+
maxY = maxInArray(ys);
|
|
45448
45713
|
this.startPoint = {
|
|
45449
45714
|
x: minX,
|
|
45450
45715
|
y: minY
|
|
@@ -48592,16 +48857,10 @@
|
|
|
48592
48857
|
if (0 === arr.length) return 0;
|
|
48593
48858
|
return sum(arr) / arr.length;
|
|
48594
48859
|
}
|
|
48595
|
-
function min(arr) {
|
|
48596
|
-
return Math.min(...arr);
|
|
48597
|
-
}
|
|
48598
|
-
function max(arr) {
|
|
48599
|
-
return Math.max(...arr);
|
|
48600
|
-
}
|
|
48601
48860
|
|
|
48602
48861
|
const samplerMap = {
|
|
48603
|
-
min:
|
|
48604
|
-
max:
|
|
48862
|
+
min: minInArray,
|
|
48863
|
+
max: maxInArray,
|
|
48605
48864
|
average: average,
|
|
48606
48865
|
sum: sum
|
|
48607
48866
|
};
|
|
@@ -51772,7 +52031,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
51772
52031
|
function stackTotal(stackData, valueField) {
|
|
51773
52032
|
if ('values' in stackData && stackData.values.length) {
|
|
51774
52033
|
const total = sum$1(stackData.values, valueField);
|
|
51775
|
-
const percent = max
|
|
52034
|
+
const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
|
|
51776
52035
|
stackData.values.forEach(v => {
|
|
51777
52036
|
v[STACK_FIELD_TOTAL] = total;
|
|
51778
52037
|
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
@@ -52204,8 +52463,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
52204
52463
|
};
|
|
52205
52464
|
const angleStandardize = (angle, range) => {
|
|
52206
52465
|
const unit = Math.PI * 2;
|
|
52207
|
-
const min =
|
|
52208
|
-
const max =
|
|
52466
|
+
const min = minInArray(range);
|
|
52467
|
+
const max = maxInArray(range);
|
|
52209
52468
|
if (angle < min) {
|
|
52210
52469
|
angle += Math.ceil((min - angle) / unit) * unit;
|
|
52211
52470
|
}
|
|
@@ -53470,7 +53729,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53470
53729
|
if (source === exports.Event_Source_Type.chart) {
|
|
53471
53730
|
const wrappedCallback = function (event, element) {
|
|
53472
53731
|
var _a, _b, _c;
|
|
53473
|
-
const context = (_b = (_a = element === null || element === void 0 ? void 0 : element.mark) === null || _a === void 0 ? void 0 : _a.
|
|
53732
|
+
const context = (_b = (_a = element === null || element === void 0 ? void 0 : element.mark) === null || _a === void 0 ? void 0 : _a.getContext()) !== null && _b !== void 0 ? _b : {};
|
|
53474
53733
|
const modelId = isValid$1(context.modelId) ? context.modelId : null;
|
|
53475
53734
|
const markId = isValid$1(context.markId) ? context.markId : null;
|
|
53476
53735
|
const modelUserId = isValid$1(context.modelUserId) ? context.modelUserId : null;
|
|
@@ -53793,6 +54052,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53793
54052
|
resultA.reSize = resultA.reSize || resultB.reSize;
|
|
53794
54053
|
return resultA;
|
|
53795
54054
|
}
|
|
54055
|
+
function getTrimPaddingConfig(chartType, spec) {
|
|
54056
|
+
if (chartType === 'line' ||
|
|
54057
|
+
chartType === 'area' ||
|
|
54058
|
+
(chartType === 'common' && spec.series.every(item => item.type === 'area' || item.type === 'line'))) {
|
|
54059
|
+
return {
|
|
54060
|
+
paddingInner: 1,
|
|
54061
|
+
paddingOuter: 0
|
|
54062
|
+
};
|
|
54063
|
+
}
|
|
54064
|
+
return {
|
|
54065
|
+
paddingOuter: 0
|
|
54066
|
+
};
|
|
54067
|
+
}
|
|
53796
54068
|
|
|
53797
54069
|
var STATE_VALUE_ENUM;
|
|
53798
54070
|
(function (STATE_VALUE_ENUM) {
|
|
@@ -56379,6 +56651,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56379
56651
|
setProgressiveConfig(config) {
|
|
56380
56652
|
this._progressiveConfig = config;
|
|
56381
56653
|
}
|
|
56654
|
+
setCustomizedShapeCallback(callback) {
|
|
56655
|
+
this._setCustomizedShape = callback;
|
|
56656
|
+
}
|
|
56657
|
+
setEnableSegments(enable) {
|
|
56658
|
+
this._enableSegments = enable;
|
|
56659
|
+
}
|
|
56382
56660
|
constructor(option, name, model) {
|
|
56383
56661
|
super(option);
|
|
56384
56662
|
this.grammarType = GrammarType.mark;
|
|
@@ -56560,7 +56838,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56560
56838
|
modelUserId: this.model.userId
|
|
56561
56839
|
},
|
|
56562
56840
|
skipTheme: this.getSkipTheme(),
|
|
56563
|
-
support3d: this.getSupport3d()
|
|
56841
|
+
support3d: this.getSupport3d(),
|
|
56842
|
+
enableSegments: !!this._enableSegments
|
|
56564
56843
|
};
|
|
56565
56844
|
if (this._progressiveConfig) {
|
|
56566
56845
|
config.progressiveStep = this._progressiveConfig.progressiveStep;
|
|
@@ -56573,6 +56852,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56573
56852
|
config.morphKey = this._morphKey;
|
|
56574
56853
|
config.morphElementKey = this._morphElementKey;
|
|
56575
56854
|
}
|
|
56855
|
+
if (this._setCustomizedShape) {
|
|
56856
|
+
config.setCustomizedShape = this._setCustomizedShape;
|
|
56857
|
+
}
|
|
56576
56858
|
this._product.configure(config);
|
|
56577
56859
|
}
|
|
56578
56860
|
compileSignal() {
|
|
@@ -58348,7 +58630,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58348
58630
|
};
|
|
58349
58631
|
registerVChartCore();
|
|
58350
58632
|
|
|
58351
|
-
const version = "1.7.0
|
|
58633
|
+
const version = "1.7.0";
|
|
58352
58634
|
|
|
58353
58635
|
class ChartData {
|
|
58354
58636
|
get dataList() {
|
|
@@ -59804,36 +60086,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59804
60086
|
if (!spec.axes) {
|
|
59805
60087
|
spec.axes = [];
|
|
59806
60088
|
}
|
|
59807
|
-
|
|
59808
|
-
|
|
59809
|
-
|
|
59810
|
-
|
|
59811
|
-
|
|
59812
|
-
haxAxes.x = true;
|
|
59813
|
-
}
|
|
59814
|
-
if (orient === 'left' || orient === 'right') {
|
|
59815
|
-
haxAxes.y = true;
|
|
59816
|
-
}
|
|
59817
|
-
if (orient === 'z') {
|
|
59818
|
-
haxAxes.z = true;
|
|
59819
|
-
}
|
|
59820
|
-
});
|
|
59821
|
-
if (!haxAxes.x) {
|
|
59822
|
-
spec.axes.push({
|
|
59823
|
-
orient: 'bottom'
|
|
59824
|
-
});
|
|
60089
|
+
const haxAxes = { x: false, y: false, z: false };
|
|
60090
|
+
spec.axes.forEach((axis) => {
|
|
60091
|
+
const { orient } = axis;
|
|
60092
|
+
if (orient === 'top' || orient === 'bottom') {
|
|
60093
|
+
haxAxes.x = true;
|
|
59825
60094
|
}
|
|
59826
|
-
if (
|
|
59827
|
-
|
|
59828
|
-
orient: 'left'
|
|
59829
|
-
});
|
|
60095
|
+
if (orient === 'left' || orient === 'right') {
|
|
60096
|
+
haxAxes.y = true;
|
|
59830
60097
|
}
|
|
59831
|
-
if (
|
|
59832
|
-
|
|
59833
|
-
|
|
59834
|
-
|
|
60098
|
+
if (orient === 'z') {
|
|
60099
|
+
haxAxes.z = true;
|
|
60100
|
+
}
|
|
60101
|
+
if (get$1(axis, 'trimPadding')) {
|
|
60102
|
+
mergeSpec(axis, getTrimPaddingConfig(this.type, spec));
|
|
59835
60103
|
}
|
|
59836
60104
|
});
|
|
60105
|
+
if (!haxAxes.x) {
|
|
60106
|
+
spec.axes.push({
|
|
60107
|
+
orient: 'bottom'
|
|
60108
|
+
});
|
|
60109
|
+
}
|
|
60110
|
+
if (!haxAxes.y) {
|
|
60111
|
+
spec.axes.push({
|
|
60112
|
+
orient: 'left'
|
|
60113
|
+
});
|
|
60114
|
+
}
|
|
60115
|
+
if (spec.zField && !haxAxes.z) {
|
|
60116
|
+
spec.axes.push({
|
|
60117
|
+
orient: 'z'
|
|
60118
|
+
});
|
|
60119
|
+
}
|
|
59837
60120
|
}
|
|
59838
60121
|
const defaultSeriesSpec = this._getDefaultSeriesSpec(spec);
|
|
59839
60122
|
if (!spec.series || spec.series.length === 0) {
|
|
@@ -60302,16 +60585,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60302
60585
|
|
|
60303
60586
|
const methods = {
|
|
60304
60587
|
min: (arr) => {
|
|
60305
|
-
return arr.length ?
|
|
60588
|
+
return arr.length ? minInArray(arr.map(n => n * 1)) : 0;
|
|
60306
60589
|
},
|
|
60307
60590
|
max: (arr) => {
|
|
60308
|
-
return arr.length ?
|
|
60591
|
+
return arr.length ? maxInArray(arr.map(n => n * 1)) : 0;
|
|
60309
60592
|
},
|
|
60310
60593
|
'array-min': (arr) => {
|
|
60311
|
-
return arr.length ?
|
|
60594
|
+
return arr.length ? minInArray(arr.map(n => n * 1)) : 0;
|
|
60312
60595
|
},
|
|
60313
60596
|
'array-max': (arr) => {
|
|
60314
|
-
return arr.length ?
|
|
60597
|
+
return arr.length ? maxInArray(arr.map(n => n * 1)) : 0;
|
|
60315
60598
|
},
|
|
60316
60599
|
values: (arr) => {
|
|
60317
60600
|
const map = {};
|
|
@@ -61062,11 +61345,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61062
61345
|
const mark = this._createMark({ type: spec.type, name: `${namePrefix}_${index}` }, {
|
|
61063
61346
|
markSpec: spec,
|
|
61064
61347
|
parent: parentMark,
|
|
61065
|
-
dataView: false
|
|
61348
|
+
dataView: false,
|
|
61349
|
+
customShape: spec === null || spec === void 0 ? void 0 : spec.customShape
|
|
61066
61350
|
});
|
|
61067
61351
|
if (!mark) {
|
|
61068
61352
|
return;
|
|
61069
61353
|
}
|
|
61354
|
+
const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
|
|
61355
|
+
mark.setAnimationConfig(config);
|
|
61070
61356
|
if (spec.type === 'group') {
|
|
61071
61357
|
namePrefix = `${namePrefix}_${index}`;
|
|
61072
61358
|
(_a = spec.children) === null || _a === void 0 ? void 0 : _a.forEach((s, i) => {
|
|
@@ -61409,7 +61695,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61409
61695
|
}
|
|
61410
61696
|
_createMark(markInfo, option = {}) {
|
|
61411
61697
|
var _a, _b, _c, _d;
|
|
61412
|
-
const { key, groupKey, skipBeforeLayouted, themeSpec = {}, markSpec, dataView, dataProductId, parent, isSeriesMark, depend, label, progressive, support3d = this._spec.support3d || !!this._spec.zField, morph = false } = option;
|
|
61698
|
+
const { key, groupKey, skipBeforeLayouted, themeSpec = {}, markSpec, dataView, dataProductId, parent, isSeriesMark, depend, label, progressive, support3d = this._spec.support3d || !!this._spec.zField, morph = false, customShape } = option;
|
|
61413
61699
|
const m = super._createMark(markInfo, {
|
|
61414
61700
|
key: key !== null && key !== void 0 ? key : this._getDataIdKey(),
|
|
61415
61701
|
support3d,
|
|
@@ -61453,6 +61739,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61453
61739
|
if (!isNil$1(groupKey)) {
|
|
61454
61740
|
m.setGroupKey(groupKey);
|
|
61455
61741
|
}
|
|
61742
|
+
if (customShape) {
|
|
61743
|
+
m.setCustomizedShapeCallback(customShape);
|
|
61744
|
+
}
|
|
61456
61745
|
this.initMarkStyleWithSpec(m, mergeSpec({}, themeSpec, markSpec || spec[m.name]));
|
|
61457
61746
|
}
|
|
61458
61747
|
return m;
|
|
@@ -62000,18 +62289,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62000
62289
|
}
|
|
62001
62290
|
}
|
|
62002
62291
|
initLineMark(progressive, isSeriesMark) {
|
|
62003
|
-
var _a, _b, _c, _d;
|
|
62292
|
+
var _a, _b, _c, _d, _e;
|
|
62004
62293
|
this._lineMark = this._createMark(lineLikeSeriesMark.line, {
|
|
62005
62294
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
62006
62295
|
groupKey: this._seriesField,
|
|
62007
62296
|
isSeriesMark: isSeriesMark !== null && isSeriesMark !== void 0 ? isSeriesMark : true,
|
|
62008
|
-
progressive
|
|
62297
|
+
progressive,
|
|
62298
|
+
customShape: (_a = this._spec.line) === null || _a === void 0 ? void 0 : _a.customShape
|
|
62009
62299
|
});
|
|
62010
|
-
const isPointVisible = ((
|
|
62300
|
+
const isPointVisible = ((_b = this._spec.point) === null || _b === void 0 ? void 0 : _b.visible) !== false && ((_d = (_c = this._spec.point) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.visible) !== false;
|
|
62011
62301
|
if (!isPointVisible && this._lineMark) {
|
|
62012
62302
|
this._lineMark.setLabelSpec(this._preprocessLabelSpec(this._spec.label, this.initLabelMarkStyle));
|
|
62013
62303
|
}
|
|
62014
|
-
if (this._lineMark && ((
|
|
62304
|
+
if (this._lineMark && ((_e = this._spec.lineLabel) === null || _e === void 0 ? void 0 : _e.visible)) {
|
|
62015
62305
|
this._lineMark.addLabelSpec(this._preprocessLabelSpec(this._spec.lineLabel, this.initLineLabelMarkStyle), true);
|
|
62016
62306
|
}
|
|
62017
62307
|
return this._lineMark;
|
|
@@ -62086,7 +62376,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62086
62376
|
}
|
|
62087
62377
|
}
|
|
62088
62378
|
initSymbolMark(progressive, isSeriesMark) {
|
|
62089
|
-
var _a;
|
|
62379
|
+
var _a, _b, _c;
|
|
62090
62380
|
if (((_a = this._spec.point) === null || _a === void 0 ? void 0 : _a.visible) !== false) {
|
|
62091
62381
|
this._symbolMark = this._createMark(lineLikeSeriesMark.point, {
|
|
62092
62382
|
morph: shouldMarkDoMorph(this._spec, lineLikeSeriesMark.point.name),
|
|
@@ -62094,7 +62384,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62094
62384
|
groupKey: this._seriesField,
|
|
62095
62385
|
label: this._preprocessLabelSpec(this._spec.label),
|
|
62096
62386
|
progressive,
|
|
62097
|
-
isSeriesMark: !!isSeriesMark
|
|
62387
|
+
isSeriesMark: !!isSeriesMark,
|
|
62388
|
+
customShape: (_b = this._spec.point) === null || _b === void 0 ? void 0 : _b.customShape
|
|
62098
62389
|
});
|
|
62099
62390
|
}
|
|
62100
62391
|
if (this._spec.activePoint === true) {
|
|
@@ -62104,7 +62395,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62104
62395
|
morph: false,
|
|
62105
62396
|
groupKey: this._seriesField,
|
|
62106
62397
|
isSeriesMark: false,
|
|
62107
|
-
dataView: activeData
|
|
62398
|
+
dataView: activeData,
|
|
62399
|
+
customShape: (_c = this._spec.point) === null || _c === void 0 ? void 0 : _c.customShape
|
|
62108
62400
|
});
|
|
62109
62401
|
this._symbolActiveMark.setVisible(false);
|
|
62110
62402
|
}
|
|
@@ -62256,7 +62548,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62256
62548
|
this.setAttribute(attr, styleConverter, state, level, stateStyle);
|
|
62257
62549
|
});
|
|
62258
62550
|
if (enableSegments) {
|
|
62259
|
-
this.
|
|
62551
|
+
this.setEnableSegments(enableSegments);
|
|
62260
62552
|
}
|
|
62261
62553
|
}
|
|
62262
62554
|
}
|
|
@@ -62414,9 +62706,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62414
62706
|
this.type = TextMark.type;
|
|
62415
62707
|
}
|
|
62416
62708
|
_getDefaultStyle() {
|
|
62417
|
-
const defaultStyle = Object.assign(Object.assign({}, super._getDefaultStyle()), { angle: 0, textAlign: 'center', lineWidth: 0 });
|
|
62709
|
+
const defaultStyle = Object.assign(Object.assign({}, super._getDefaultStyle()), { angle: 0, textAlign: 'center', lineWidth: 0, textConfig: [] });
|
|
62418
62710
|
return defaultStyle;
|
|
62419
62711
|
}
|
|
62712
|
+
_initProduct(group) {
|
|
62713
|
+
const view = this.getVGrammarView();
|
|
62714
|
+
const id = this.getProductId();
|
|
62715
|
+
if (this.getStyle('textType') === 'rich') {
|
|
62716
|
+
this._product = view.mark(GrammarMarkType.richtext, group !== null && group !== void 0 ? group : view.rootMark).id(id);
|
|
62717
|
+
}
|
|
62718
|
+
else {
|
|
62719
|
+
this._product = view.mark(GrammarMarkType.text, group !== null && group !== void 0 ? group : view.rootMark).id(id);
|
|
62720
|
+
}
|
|
62721
|
+
this._compiledProductId = id;
|
|
62722
|
+
}
|
|
62420
62723
|
}
|
|
62421
62724
|
TextMark.type = MarkTypeEnum.text;
|
|
62422
62725
|
|
|
@@ -62535,7 +62838,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62535
62838
|
areaSpec.visible = !(!isAreaVisible && !isLineVisible);
|
|
62536
62839
|
}
|
|
62537
62840
|
initMark() {
|
|
62538
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
62841
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
62539
62842
|
const progressive = {
|
|
62540
62843
|
progressiveStep: this._spec.progressiveStep,
|
|
62541
62844
|
progressiveThreshold: this._spec.progressiveThreshold,
|
|
@@ -62549,12 +62852,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62549
62852
|
groupKey: this._seriesField,
|
|
62550
62853
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
62551
62854
|
progressive,
|
|
62552
|
-
isSeriesMark: isAreaVisible && seriesMark !== 'point'
|
|
62855
|
+
isSeriesMark: isAreaVisible && seriesMark !== 'point',
|
|
62856
|
+
customShape: (_h = this._spec.area) === null || _h === void 0 ? void 0 : _h.customShape
|
|
62553
62857
|
});
|
|
62554
|
-
if (this._areaMark && ((
|
|
62858
|
+
if (this._areaMark && ((_k = (_j = this._spec) === null || _j === void 0 ? void 0 : _j.areaLabel) === null || _k === void 0 ? void 0 : _k.visible)) {
|
|
62555
62859
|
this._areaMark.addLabelSpec(this._preprocessLabelSpec(this._spec.areaLabel, this.initLineLabelMarkStyle), true);
|
|
62556
62860
|
}
|
|
62557
|
-
if (!isPointVisible && this._areaMark && ((
|
|
62861
|
+
if (!isPointVisible && this._areaMark && ((_l = this._spec.label) === null || _l === void 0 ? void 0 : _l.visible)) {
|
|
62558
62862
|
this._areaMark.addLabelSpec(this._preprocessLabelSpec(this._spec.label));
|
|
62559
62863
|
}
|
|
62560
62864
|
this.initSymbolMark(progressive, seriesMark === 'point');
|
|
@@ -62846,6 +63150,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62846
63150
|
this._bandPosition = 0;
|
|
62847
63151
|
}
|
|
62848
63152
|
initMark() {
|
|
63153
|
+
var _a;
|
|
62849
63154
|
const progressive = {
|
|
62850
63155
|
progressiveStep: this._spec.progressiveStep,
|
|
62851
63156
|
progressiveThreshold: this._spec.progressiveThreshold,
|
|
@@ -62859,16 +63164,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62859
63164
|
groupKey: this._seriesField,
|
|
62860
63165
|
isSeriesMark: true,
|
|
62861
63166
|
label: this._preprocessLabelSpec(this._spec.label),
|
|
62862
|
-
progressive
|
|
63167
|
+
progressive,
|
|
63168
|
+
customShape: (_a = this._spec.bar) === null || _a === void 0 ? void 0 : _a.customShape
|
|
62863
63169
|
});
|
|
62864
63170
|
}
|
|
62865
63171
|
_initBarBackgroundMark(progressive) {
|
|
62866
|
-
var _a;
|
|
63172
|
+
var _a, _b;
|
|
62867
63173
|
if ((_a = this._spec.barBackground) === null || _a === void 0 ? void 0 : _a.visible) {
|
|
62868
63174
|
this._barBackgroundMark = this._createMark(BarSeries.mark.barBackground, {
|
|
62869
63175
|
dataView: this._barBackgroundViewData.getDataView(),
|
|
62870
63176
|
dataProductId: this._barBackgroundViewData.getProductId(),
|
|
62871
|
-
progressive
|
|
63177
|
+
progressive,
|
|
63178
|
+
customShape: (_b = this._spec.barBackground) === null || _b === void 0 ? void 0 : _b.customShape
|
|
62872
63179
|
});
|
|
62873
63180
|
}
|
|
62874
63181
|
}
|
|
@@ -63513,6 +63820,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63513
63820
|
}, 'shape');
|
|
63514
63821
|
}
|
|
63515
63822
|
initMark() {
|
|
63823
|
+
var _a;
|
|
63516
63824
|
const progressive = {
|
|
63517
63825
|
progressiveStep: this._spec.progressiveStep,
|
|
63518
63826
|
progressiveThreshold: this._spec.progressiveThreshold,
|
|
@@ -63525,7 +63833,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63525
63833
|
groupKey: this._seriesField,
|
|
63526
63834
|
label: this._preprocessLabelSpec(this._spec.label),
|
|
63527
63835
|
progressive,
|
|
63528
|
-
isSeriesMark: true
|
|
63836
|
+
isSeriesMark: true,
|
|
63837
|
+
customShape: (_a = this._spec.point) === null || _a === void 0 ? void 0 : _a.customShape
|
|
63529
63838
|
});
|
|
63530
63839
|
}
|
|
63531
63840
|
initMarkStyle() {
|
|
@@ -66060,6 +66369,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66060
66369
|
this._viewDataLabel = new SeriesData(this._option, viewDataLabel);
|
|
66061
66370
|
}
|
|
66062
66371
|
initMark() {
|
|
66372
|
+
var _a;
|
|
66063
66373
|
this._pieMark = this._createMark(Object.assign(Object.assign({}, BasePieSeries.mark.pie), { name: this._pieMarkName, type: this._pieMarkType }), {
|
|
66064
66374
|
morph: shouldMarkDoMorph(this._spec, this._pieMarkName),
|
|
66065
66375
|
defaultMorphElementKey: this._seriesField,
|
|
@@ -66067,7 +66377,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66067
66377
|
groupKey: this._seriesField,
|
|
66068
66378
|
skipBeforeLayouted: true,
|
|
66069
66379
|
isSeriesMark: true,
|
|
66070
|
-
label: this._preprocessLabelSpec(this._spec.label)
|
|
66380
|
+
label: this._preprocessLabelSpec(this._spec.label),
|
|
66381
|
+
customShape: (_a = this._spec.pie) === null || _a === void 0 ? void 0 : _a.customShape
|
|
66071
66382
|
});
|
|
66072
66383
|
}
|
|
66073
66384
|
initMarkStyle() {
|
|
@@ -66632,12 +66943,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66632
66943
|
this.initRoseMarkStyle();
|
|
66633
66944
|
}
|
|
66634
66945
|
initRoseMark() {
|
|
66946
|
+
var _a;
|
|
66635
66947
|
this._roseMark = this._createMark(RoseSeries.mark.rose, {
|
|
66636
66948
|
morph: shouldMarkDoMorph(this._spec, RoseSeries.mark.rose.name),
|
|
66637
66949
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
66638
66950
|
groupKey: this._seriesField,
|
|
66639
66951
|
isSeriesMark: true,
|
|
66640
|
-
label: this._preprocessLabelSpec(this._spec.label)
|
|
66952
|
+
label: this._preprocessLabelSpec(this._spec.label),
|
|
66953
|
+
customShape: (_a = this._spec.rose) === null || _a === void 0 ? void 0 : _a.customShape
|
|
66641
66954
|
});
|
|
66642
66955
|
}
|
|
66643
66956
|
getRoseAngle() {
|
|
@@ -67030,9 +67343,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67030
67343
|
this.initSymbolMarkStyle();
|
|
67031
67344
|
}
|
|
67032
67345
|
initAreaMark(progressive, isSeriesMark) {
|
|
67346
|
+
var _a;
|
|
67033
67347
|
this._areaMark = this._createMark(RadarSeries.mark.area, {
|
|
67034
67348
|
progressive,
|
|
67035
|
-
isSeriesMark
|
|
67349
|
+
isSeriesMark,
|
|
67350
|
+
customShape: (_a = this._spec.area) === null || _a === void 0 ? void 0 : _a.customShape
|
|
67036
67351
|
});
|
|
67037
67352
|
}
|
|
67038
67353
|
initAreaMarkStyle() {
|
|
@@ -67199,7 +67514,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67199
67514
|
}
|
|
67200
67515
|
transformSpec(spec) {
|
|
67201
67516
|
super.transformSpec(spec);
|
|
67202
|
-
if (
|
|
67517
|
+
if (spec.series && spec.series.length) {
|
|
67203
67518
|
const defaultSeriesSpec = this._getDefaultSeriesSpec(spec);
|
|
67204
67519
|
spec.series.forEach((s) => {
|
|
67205
67520
|
if (!this.isValidSeries(s.type)) {
|
|
@@ -67212,6 +67527,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67212
67527
|
});
|
|
67213
67528
|
});
|
|
67214
67529
|
}
|
|
67530
|
+
if (spec.axes && spec.axes.length) {
|
|
67531
|
+
spec.axes.forEach((axis) => {
|
|
67532
|
+
if (get$1(axis, 'trimPadding')) {
|
|
67533
|
+
mergeSpec(axis, getTrimPaddingConfig(this.type, spec));
|
|
67534
|
+
}
|
|
67535
|
+
});
|
|
67536
|
+
}
|
|
67215
67537
|
}
|
|
67216
67538
|
}
|
|
67217
67539
|
CommonChart.type = ChartTypeEnum.common;
|
|
@@ -68745,9 +69067,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68745
69067
|
this._initProgressMarkStyle();
|
|
68746
69068
|
}
|
|
68747
69069
|
_initProgressMark() {
|
|
69070
|
+
var _a;
|
|
68748
69071
|
this._progressMark = this._createMark(CircularProgressSeries.mark.progress, {
|
|
68749
69072
|
parent: this._arcGroupMark,
|
|
68750
|
-
isSeriesMark: true
|
|
69073
|
+
isSeriesMark: true,
|
|
69074
|
+
customShape: (_a = this._spec.progress) === null || _a === void 0 ? void 0 : _a.customShape
|
|
68751
69075
|
});
|
|
68752
69076
|
return this._progressMark;
|
|
68753
69077
|
}
|
|
@@ -68777,8 +69101,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68777
69101
|
this._progressMark && this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark);
|
|
68778
69102
|
}
|
|
68779
69103
|
_initTrackMark() {
|
|
69104
|
+
var _a;
|
|
68780
69105
|
this._trackMark = this._createMark(CircularProgressSeries.mark.track, {
|
|
68781
|
-
parent: this._arcGroupMark
|
|
69106
|
+
parent: this._arcGroupMark,
|
|
69107
|
+
customShape: (_a = this._spec.track) === null || _a === void 0 ? void 0 : _a.customShape
|
|
68782
69108
|
});
|
|
68783
69109
|
return this._trackMark;
|
|
68784
69110
|
}
|
|
@@ -71590,7 +71916,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71590
71916
|
hasPlaced: !1
|
|
71591
71917
|
};
|
|
71592
71918
|
}),
|
|
71593
|
-
wordsMaxFontSize =
|
|
71919
|
+
wordsMaxFontSize = maxInArray(words.map(word => word.fontSize));
|
|
71594
71920
|
words.forEach(word => word.weight = word.fontSize / wordsMaxFontSize), words.sort((a, b) => b.weight - a.weight);
|
|
71595
71921
|
const {
|
|
71596
71922
|
fillingWords: fillingWords,
|
|
@@ -72240,7 +72566,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72240
72566
|
});
|
|
72241
72567
|
}
|
|
72242
72568
|
initMark() {
|
|
72243
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
72569
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
72244
72570
|
this._funnelMark = this._createMark(Object.assign(Object.assign({}, FunnelSeries.mark.funnel), { name: this._funnelMarkName, type: this._funnelMarkType }), {
|
|
72245
72571
|
themeSpec: (_a = this._theme) === null || _a === void 0 ? void 0 : _a.funnel,
|
|
72246
72572
|
morph: shouldMarkDoMorph(this._spec, this._funnelMarkName),
|
|
@@ -72248,23 +72574,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72248
72574
|
key: this._seriesField,
|
|
72249
72575
|
groupKey: this._seriesField,
|
|
72250
72576
|
isSeriesMark: true,
|
|
72251
|
-
label: this._preprocessLabelSpec(this._spec.label)
|
|
72577
|
+
label: this._preprocessLabelSpec(this._spec.label),
|
|
72578
|
+
customShape: (_b = this._spec.funnel) === null || _b === void 0 ? void 0 : _b.customShape
|
|
72252
72579
|
});
|
|
72253
72580
|
if (this._spec.isTransform) {
|
|
72254
72581
|
this._funnelTransformMark = this._createMark(Object.assign(Object.assign({}, FunnelSeries.mark.transform), { name: this._transformMarkName, type: this._transformMarkType }), {
|
|
72255
|
-
themeSpec: (
|
|
72582
|
+
themeSpec: (_c = this._theme) === null || _c === void 0 ? void 0 : _c.transform,
|
|
72256
72583
|
key: this._seriesField,
|
|
72257
72584
|
skipBeforeLayouted: false,
|
|
72258
72585
|
dataView: this._viewDataTransform.getDataView(),
|
|
72259
72586
|
dataProductId: this._viewDataTransform.getProductId(),
|
|
72260
|
-
label: this._preprocessLabelSpec(this._spec.transformLabel)
|
|
72587
|
+
label: this._preprocessLabelSpec(this._spec.transformLabel),
|
|
72588
|
+
customShape: (_d = this._spec.transform) === null || _d === void 0 ? void 0 : _d.customShape
|
|
72261
72589
|
});
|
|
72262
72590
|
}
|
|
72263
|
-
if ((
|
|
72264
|
-
const { line } = (
|
|
72265
|
-
const { line: lineTheme } = (
|
|
72591
|
+
if ((_f = (_e = this._spec) === null || _e === void 0 ? void 0 : _e.outerLabel) === null || _f === void 0 ? void 0 : _f.visible) {
|
|
72592
|
+
const { line } = (_g = this._spec.outerLabel) !== null && _g !== void 0 ? _g : {};
|
|
72593
|
+
const { line: lineTheme } = (_j = (_h = this._theme) === null || _h === void 0 ? void 0 : _h.outerLabel) !== null && _j !== void 0 ? _j : {};
|
|
72266
72594
|
this._funnelOuterLabelMark.label = this._createMark(FunnelSeries.mark.outerLabel, {
|
|
72267
|
-
themeSpec: (
|
|
72595
|
+
themeSpec: (_k = this._theme) === null || _k === void 0 ? void 0 : _k.outerLabel,
|
|
72268
72596
|
key: this._seriesField,
|
|
72269
72597
|
markSpec: this._spec.outerLabel,
|
|
72270
72598
|
skipBeforeLayouted: true
|
|
@@ -72994,9 +73322,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72994
73322
|
this._initProgressMarkStyle();
|
|
72995
73323
|
}
|
|
72996
73324
|
_initProgressMark() {
|
|
73325
|
+
var _a;
|
|
72997
73326
|
this._progressMark = this._createMark(LinearProgressSeries.mark.progress, {
|
|
72998
73327
|
isSeriesMark: true,
|
|
72999
|
-
parent: this._progressGroupMark
|
|
73328
|
+
parent: this._progressGroupMark,
|
|
73329
|
+
customShape: (_a = this._spec.progress) === null || _a === void 0 ? void 0 : _a.customShape
|
|
73000
73330
|
});
|
|
73001
73331
|
return this._progressMark;
|
|
73002
73332
|
}
|
|
@@ -73046,8 +73376,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73046
73376
|
}
|
|
73047
73377
|
}
|
|
73048
73378
|
_initTrackMark() {
|
|
73379
|
+
var _a;
|
|
73049
73380
|
this._trackMark = this._createMark(LinearProgressSeries.mark.track, {
|
|
73050
|
-
parent: this._progressGroupMark
|
|
73381
|
+
parent: this._progressGroupMark,
|
|
73382
|
+
customShape: (_a = this._spec.track) === null || _a === void 0 ? void 0 : _a.customShape
|
|
73051
73383
|
});
|
|
73052
73384
|
return this._trackMark;
|
|
73053
73385
|
}
|
|
@@ -73488,7 +73820,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73488
73820
|
this._stack = false;
|
|
73489
73821
|
}
|
|
73490
73822
|
initMark() {
|
|
73491
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
73823
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73492
73824
|
this._initBarBackgroundMark();
|
|
73493
73825
|
const labelPosition = (_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.position;
|
|
73494
73826
|
this._barMark = this._createMark(RangeColumnSeries.mark.bar, {
|
|
@@ -73496,17 +73828,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73496
73828
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
73497
73829
|
groupKey: this._seriesField,
|
|
73498
73830
|
label: labelPosition === PositionEnum.bothEnd ? undefined : this._preprocessLabelSpec(this._spec.label),
|
|
73499
|
-
isSeriesMark: true
|
|
73831
|
+
isSeriesMark: true,
|
|
73832
|
+
customShape: (_b = this._spec.bar) === null || _b === void 0 ? void 0 : _b.customShape
|
|
73500
73833
|
});
|
|
73501
|
-
if (((
|
|
73502
|
-
if (((
|
|
73834
|
+
if (((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.visible) !== false && labelPosition === PositionEnum.bothEnd) {
|
|
73835
|
+
if (((_e = (_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.minLabel) === null || _e === void 0 ? void 0 : _e.visible) !== false) {
|
|
73503
73836
|
this._minLabelMark = this._createMark(RangeColumnSeries.mark.minLabel, {
|
|
73504
|
-
markSpec: (
|
|
73837
|
+
markSpec: (_f = this._spec.label) === null || _f === void 0 ? void 0 : _f.minLabel
|
|
73505
73838
|
});
|
|
73506
73839
|
}
|
|
73507
|
-
if (((
|
|
73840
|
+
if (((_h = (_g = this._spec.label) === null || _g === void 0 ? void 0 : _g.maxLabel) === null || _h === void 0 ? void 0 : _h.visible) !== false) {
|
|
73508
73841
|
this._maxLabelMark = this._createMark(RangeColumnSeries.mark.maxLabel, {
|
|
73509
|
-
markSpec: (
|
|
73842
|
+
markSpec: (_j = this._spec.label) === null || _j === void 0 ? void 0 : _j.maxLabel
|
|
73510
73843
|
});
|
|
73511
73844
|
}
|
|
73512
73845
|
}
|
|
@@ -73735,7 +74068,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73735
74068
|
};
|
|
73736
74069
|
const getInnerMostElements = (element) => {
|
|
73737
74070
|
const updateElements = element.mark.elements.filter(e => e.diffState === DiffState.update);
|
|
73738
|
-
const minDepth =
|
|
74071
|
+
const minDepth = minInArray(updateElements.map(e => { var _a; return (_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a[0].depth; }));
|
|
73739
74072
|
return updateElements.filter(e => { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a[0].depth) === minDepth; });
|
|
73740
74073
|
};
|
|
73741
74074
|
|
|
@@ -73743,8 +74076,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73743
74076
|
if (isEmpty(elements)) {
|
|
73744
74077
|
return [startAngle, endAngle];
|
|
73745
74078
|
}
|
|
73746
|
-
const minStartAngle =
|
|
73747
|
-
const maxEndAngle =
|
|
74079
|
+
const minStartAngle = minInArray(elements.map(m => m.getGraphicAttribute('startAngle', false) * 1));
|
|
74080
|
+
const maxEndAngle = maxInArray(elements.map(m => m.getGraphicAttribute('endAngle', false) * 1));
|
|
73748
74081
|
return [minStartAngle, maxEndAngle];
|
|
73749
74082
|
};
|
|
73750
74083
|
const sunburstEnter = (params) => {
|
|
@@ -73783,8 +74116,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73783
74116
|
};
|
|
73784
74117
|
|
|
73785
74118
|
const computeInnerAngleRange = (elements) => {
|
|
73786
|
-
const minStartAngle =
|
|
73787
|
-
const maxEndAngle =
|
|
74119
|
+
const minStartAngle = minInArray(elements.map(m => m.getGraphicAttribute('startAngle', false) * 1));
|
|
74120
|
+
const maxEndAngle = maxInArray(elements.map(m => m.getGraphicAttribute('endAngle', false) * 1));
|
|
73788
74121
|
return [minStartAngle, maxEndAngle];
|
|
73789
74122
|
};
|
|
73790
74123
|
const sunburstExit = (params) => {
|
|
@@ -74833,11 +75166,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74833
75166
|
this._initLabelMarkStyle();
|
|
74834
75167
|
}
|
|
74835
75168
|
_initArcMark() {
|
|
75169
|
+
var _a;
|
|
74836
75170
|
if (this._sunburst.visible === false) {
|
|
74837
75171
|
return;
|
|
74838
75172
|
}
|
|
74839
75173
|
const sunburstMark = this._createMark(SunburstSeries.mark.sunburst, {
|
|
74840
|
-
isSeriesMark: true
|
|
75174
|
+
isSeriesMark: true,
|
|
75175
|
+
customShape: (_a = this._spec.sunburst) === null || _a === void 0 ? void 0 : _a.customShape
|
|
74841
75176
|
});
|
|
74842
75177
|
this._sunburstMark = sunburstMark;
|
|
74843
75178
|
this._trigger.registerMark(this._sunburstMark);
|
|
@@ -75160,12 +75495,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75160
75495
|
this._initLabelMarkStyle();
|
|
75161
75496
|
}
|
|
75162
75497
|
_initCirclePackingMark() {
|
|
75163
|
-
var _a;
|
|
75498
|
+
var _a, _b;
|
|
75164
75499
|
if (((_a = this._circlePacking) === null || _a === void 0 ? void 0 : _a.visible) === false) {
|
|
75165
75500
|
return;
|
|
75166
75501
|
}
|
|
75167
75502
|
const circlePacking = this._createMark(CirclePackingSeries.mark.circlePacking, {
|
|
75168
|
-
isSeriesMark: true
|
|
75503
|
+
isSeriesMark: true,
|
|
75504
|
+
customShape: (_b = this._spec.circlePacking) === null || _b === void 0 ? void 0 : _b.customShape
|
|
75169
75505
|
});
|
|
75170
75506
|
this._circlePackingMark = circlePacking;
|
|
75171
75507
|
this._trigger.registerMark(circlePacking);
|
|
@@ -75549,8 +75885,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75549
75885
|
]);
|
|
75550
75886
|
}
|
|
75551
75887
|
initMark() {
|
|
75552
|
-
var _a, _b;
|
|
75553
|
-
const nonLeafMark = this._createMark(TreemapSeries.mark.nonLeaf, {
|
|
75888
|
+
var _a, _b, _c, _d;
|
|
75889
|
+
const nonLeafMark = this._createMark(TreemapSeries.mark.nonLeaf, {
|
|
75890
|
+
isSeriesMark: true,
|
|
75891
|
+
customShape: (_a = this._spec.nonLeaf) === null || _a === void 0 ? void 0 : _a.customShape
|
|
75892
|
+
});
|
|
75554
75893
|
if (nonLeafMark) {
|
|
75555
75894
|
nonLeafMark.setTransform([
|
|
75556
75895
|
{
|
|
@@ -75563,7 +75902,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75563
75902
|
this._trigger.registerMark(nonLeafMark);
|
|
75564
75903
|
this._nonLeafMark = nonLeafMark;
|
|
75565
75904
|
}
|
|
75566
|
-
const leafMark = this._createMark(TreemapSeries.mark.leaf, {
|
|
75905
|
+
const leafMark = this._createMark(TreemapSeries.mark.leaf, {
|
|
75906
|
+
isSeriesMark: true,
|
|
75907
|
+
customShape: (_b = this._spec.leaf) === null || _b === void 0 ? void 0 : _b.customShape
|
|
75908
|
+
});
|
|
75567
75909
|
if (leafMark) {
|
|
75568
75910
|
leafMark.setTransform([
|
|
75569
75911
|
{
|
|
@@ -75576,7 +75918,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75576
75918
|
this._leafMark = leafMark;
|
|
75577
75919
|
this._trigger.registerMark(leafMark);
|
|
75578
75920
|
}
|
|
75579
|
-
if ((
|
|
75921
|
+
if ((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.visible) {
|
|
75580
75922
|
const textMark = this._createMark(TreemapSeries.mark.label, {
|
|
75581
75923
|
skipBeforeLayouted: false
|
|
75582
75924
|
});
|
|
@@ -75593,7 +75935,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75593
75935
|
this._trigger.registerMark(textMark);
|
|
75594
75936
|
}
|
|
75595
75937
|
}
|
|
75596
|
-
if ((
|
|
75938
|
+
if ((_d = this._spec.nonLeafLabel) === null || _d === void 0 ? void 0 : _d.visible) {
|
|
75597
75939
|
const textMark = this._createMark(TreemapSeries.mark.nonLeafLabel);
|
|
75598
75940
|
if (textMark) {
|
|
75599
75941
|
textMark.setTransform([
|
|
@@ -76088,17 +76430,27 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76088
76430
|
LabelRule["stackLabel"] = "stackLabel";
|
|
76089
76431
|
LabelRule["line"] = "line";
|
|
76090
76432
|
})(LabelRule || (LabelRule = {}));
|
|
76091
|
-
function textAttribute(labelInfo, datum, formatMethod) {
|
|
76433
|
+
function textAttribute(labelInfo, datum, formatMethod, formatter) {
|
|
76434
|
+
var _a;
|
|
76092
76435
|
const { labelMark, series } = labelInfo;
|
|
76093
76436
|
const field = series.getMeasureField()[0];
|
|
76094
|
-
const textAttribute = { text: datum[field], data: datum };
|
|
76437
|
+
const textAttribute = { text: datum[field], data: datum, textType: (_a = labelInfo.labelSpec.textType) !== null && _a !== void 0 ? _a : 'text' };
|
|
76095
76438
|
const attributes = Object.keys(labelMark.stateStyle.normal);
|
|
76096
76439
|
for (const key of attributes) {
|
|
76097
76440
|
const attr = labelMark.getAttribute(key, datum);
|
|
76098
76441
|
textAttribute[key] = attr;
|
|
76099
|
-
|
|
76100
|
-
|
|
76442
|
+
}
|
|
76443
|
+
if (formatMethod) {
|
|
76444
|
+
textAttribute.text = formatMethod(textAttribute.text, datum, { series });
|
|
76445
|
+
}
|
|
76446
|
+
if (formatter) {
|
|
76447
|
+
if (series.type === 'pie') {
|
|
76448
|
+
datum._percent_ = (datum[ARC_RATIO] * 100).toFixed(2) + '%';
|
|
76449
|
+
}
|
|
76450
|
+
else if (datum[STACK_FIELD_END_PERCENT]) {
|
|
76451
|
+
datum._percent_ = (datum[STACK_FIELD_END_PERCENT] * 100).toFixed(2) + '%';
|
|
76101
76452
|
}
|
|
76453
|
+
textAttribute.text = substitute(formatter, datum);
|
|
76102
76454
|
}
|
|
76103
76455
|
return textAttribute;
|
|
76104
76456
|
}
|
|
@@ -76441,16 +76793,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76441
76793
|
this._totalData.updateData();
|
|
76442
76794
|
}
|
|
76443
76795
|
initMark() {
|
|
76444
|
-
var _a;
|
|
76796
|
+
var _a, _b;
|
|
76445
76797
|
super.initMark();
|
|
76446
76798
|
const leaderLine = this._createMark(WaterfallSeries.mark.leaderLine, {
|
|
76447
|
-
key: 'index'
|
|
76799
|
+
key: 'index',
|
|
76800
|
+
customShape: (_a = this._spec.leaderLine) === null || _a === void 0 ? void 0 : _a.customShape
|
|
76448
76801
|
});
|
|
76449
76802
|
if (leaderLine) {
|
|
76450
76803
|
this._leaderLineMark = leaderLine;
|
|
76451
76804
|
leaderLine.setDataView(this._totalData.getDataView(), this._totalData.getProductId());
|
|
76452
76805
|
}
|
|
76453
|
-
if ((
|
|
76806
|
+
if ((_b = this._spec.stackLabel) === null || _b === void 0 ? void 0 : _b.visible) {
|
|
76454
76807
|
this._barMark.addLabelSpec(this._preprocessLabelSpec(this._spec.stackLabel));
|
|
76455
76808
|
}
|
|
76456
76809
|
}
|
|
@@ -77287,7 +77640,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77287
77640
|
this.options.divideNodeValueToLink && isNil$1(link.value) && invalidLinks.push(linkElement), links.push(linkElement), nodeMap[link.source].sourceLinks.push(linkElement), nodeMap[link.target].targetLinks.push(linkElement);
|
|
77288
77641
|
}), this.options.divideNodeValueToLink && invalidLinks.length && invalidLinks.forEach(link => {
|
|
77289
77642
|
const values = [calcDivideValue(nodeMap[link.source]), calcDivideValue(nodeMap[link.target], !0)].filter(entry => !isNil$1(entry));
|
|
77290
|
-
values.length && (link.value =
|
|
77643
|
+
values.length && (link.value = minInArray(values));
|
|
77291
77644
|
}), this.options.linkSortBy) for (let i = 0, len = nodes.length; i < len; i++) nodes[i].sourceLinks.sort(this.options.linkSortBy), nodes[i].targetLinks.sort(this.options.linkSortBy);
|
|
77292
77645
|
return this.options.dropIsolatedNode && (nodes = nodes.filter(node => node.targetLinks.length || node.sourceLinks.length)), {
|
|
77293
77646
|
nodes: nodes,
|
|
@@ -78511,12 +78864,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78511
78864
|
}
|
|
78512
78865
|
}
|
|
78513
78866
|
initMark() {
|
|
78514
|
-
var _a;
|
|
78867
|
+
var _a, _b, _c;
|
|
78515
78868
|
const nodeMark = this._createMark(SankeySeries.mark.node, {
|
|
78516
78869
|
isSeriesMark: true,
|
|
78517
78870
|
key: DEFAULT_DATA_INDEX,
|
|
78518
78871
|
dataView: this._nodesSeriesData.getDataView(),
|
|
78519
|
-
dataProductId: this._nodesSeriesData.getProductId()
|
|
78872
|
+
dataProductId: this._nodesSeriesData.getProductId(),
|
|
78873
|
+
customShape: (_a = this._spec.node) === null || _a === void 0 ? void 0 : _a.customShape
|
|
78520
78874
|
});
|
|
78521
78875
|
if (nodeMark) {
|
|
78522
78876
|
nodeMark.setZIndex(this._nodeLayoutZIndex);
|
|
@@ -78525,12 +78879,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78525
78879
|
const linkMark = this._createMark(SankeySeries.mark.link, {
|
|
78526
78880
|
key: DEFAULT_DATA_INDEX,
|
|
78527
78881
|
dataView: this._linksSeriesData.getDataView(),
|
|
78528
|
-
dataProductId: this._linksSeriesData.getProductId()
|
|
78882
|
+
dataProductId: this._linksSeriesData.getProductId(),
|
|
78883
|
+
customShape: (_b = this._spec.link) === null || _b === void 0 ? void 0 : _b.customShape
|
|
78529
78884
|
});
|
|
78530
78885
|
if (linkMark) {
|
|
78531
78886
|
this._linkMark = linkMark;
|
|
78532
78887
|
}
|
|
78533
|
-
if ((
|
|
78888
|
+
if ((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.visible) {
|
|
78534
78889
|
const labelMark = this._createMark(SankeySeries.mark.label, {
|
|
78535
78890
|
key: DEFAULT_DATA_INDEX,
|
|
78536
78891
|
dataView: this._nodesSeriesData.getDataView(),
|
|
@@ -79051,10 +79406,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79051
79406
|
this.type = exports.SeriesTypeEnum.rangeArea;
|
|
79052
79407
|
}
|
|
79053
79408
|
initMark() {
|
|
79409
|
+
var _a;
|
|
79054
79410
|
this._areaMark = this._createMark(RangeAreaSeries.mark.area, {
|
|
79055
79411
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
79056
79412
|
groupKey: this._seriesField,
|
|
79057
|
-
isSeriesMark: true
|
|
79413
|
+
isSeriesMark: true,
|
|
79414
|
+
customShape: (_a = this._spec.area) === null || _a === void 0 ? void 0 : _a.customShape
|
|
79058
79415
|
});
|
|
79059
79416
|
}
|
|
79060
79417
|
initMarkStyle() {
|
|
@@ -79202,6 +79559,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79202
79559
|
this.setFieldValue(this._spec.valueField);
|
|
79203
79560
|
}
|
|
79204
79561
|
initMark() {
|
|
79562
|
+
var _a, _b;
|
|
79205
79563
|
const progressive = {
|
|
79206
79564
|
progressiveStep: this._spec.progressiveStep,
|
|
79207
79565
|
progressiveThreshold: this._spec.progressiveThreshold,
|
|
@@ -79213,10 +79571,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79213
79571
|
defaultMorphElementKey: this.getDimensionField()[0],
|
|
79214
79572
|
isSeriesMark: true,
|
|
79215
79573
|
label: this._preprocessLabelSpec(this._spec.label),
|
|
79216
|
-
progressive
|
|
79574
|
+
progressive,
|
|
79575
|
+
customShape: (_a = this._spec.cell) === null || _a === void 0 ? void 0 : _a.customShape
|
|
79217
79576
|
});
|
|
79218
79577
|
this._backgroundMark = this._createMark(HeatmapSeries.mark.cellBackground, {
|
|
79219
|
-
progressive
|
|
79578
|
+
progressive,
|
|
79579
|
+
customShape: (_b = this._spec.cellBackground) === null || _b === void 0 ? void 0 : _b.customShape
|
|
79220
79580
|
});
|
|
79221
79581
|
}
|
|
79222
79582
|
initMarkStyle() {
|
|
@@ -79606,11 +79966,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79606
79966
|
});
|
|
79607
79967
|
}
|
|
79608
79968
|
initMark() {
|
|
79969
|
+
var _a, _b;
|
|
79609
79970
|
const nodePointMark = this._createMark(CorrelationSeries.mark.nodePoint, {
|
|
79610
79971
|
groupKey: this._seriesField,
|
|
79611
79972
|
label: this._preprocessLabelSpec(this._spec.label),
|
|
79612
79973
|
isSeriesMark: true,
|
|
79613
|
-
key: DEFAULT_DATA_INDEX
|
|
79974
|
+
key: DEFAULT_DATA_INDEX,
|
|
79975
|
+
customShape: (_a = this._spec.nodePoint) === null || _a === void 0 ? void 0 : _a.customShape
|
|
79614
79976
|
});
|
|
79615
79977
|
if (nodePointMark) {
|
|
79616
79978
|
nodePointMark.setZIndex(exports.LayoutZIndex.Node);
|
|
@@ -79628,7 +79990,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79628
79990
|
label: this._preprocessLabelSpec(this._spec.centerLabel),
|
|
79629
79991
|
key: DEFAULT_DATA_INDEX,
|
|
79630
79992
|
dataView: this._centerSeriesData.getDataView(),
|
|
79631
|
-
dataProductId: this._centerSeriesData.getProductId()
|
|
79993
|
+
dataProductId: this._centerSeriesData.getProductId(),
|
|
79994
|
+
customShape: (_b = this._spec.centerPoint) === null || _b === void 0 ? void 0 : _b.customShape
|
|
79632
79995
|
});
|
|
79633
79996
|
if (centerPointMark) {
|
|
79634
79997
|
centerPointMark.setZIndex(exports.LayoutZIndex.Node);
|
|
@@ -80279,7 +80642,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80279
80642
|
specIndex: this._seriesIndex
|
|
80280
80643
|
});
|
|
80281
80644
|
if (groups.length !== 0) {
|
|
80282
|
-
const depth =
|
|
80645
|
+
const depth = maxInArray(groups.map(g => g.fields.length));
|
|
80283
80646
|
for (let i = 1; i < depth; i++) {
|
|
80284
80647
|
const scale = this._scale.clone();
|
|
80285
80648
|
this._scales.push(scale);
|
|
@@ -80378,31 +80741,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80378
80741
|
: transformToGraphic(spec.subTick.style),
|
|
80379
80742
|
state: transformStateStyle(spec.subTick.state)
|
|
80380
80743
|
},
|
|
80381
|
-
title: {
|
|
80382
|
-
visible: spec.title.visible,
|
|
80383
|
-
position: spec.title.position,
|
|
80384
|
-
space: spec.title.space,
|
|
80385
|
-
autoRotate: false,
|
|
80386
|
-
angle: titleAngle ? degreeToRadian(titleAngle) : null,
|
|
80387
|
-
textStyle: mergeSpec({}, titleTextStyle, transformToGraphic(spec.title.style)),
|
|
80388
|
-
padding: spec.title.padding,
|
|
80389
|
-
shape: {
|
|
80744
|
+
title: Object.assign({ visible: spec.title.visible, position: spec.title.position, space: spec.title.space, autoRotate: false, angle: titleAngle ? degreeToRadian(titleAngle) : null, textStyle: mergeSpec({}, titleTextStyle, transformToGraphic(spec.title.style)), padding: spec.title.padding, shape: {
|
|
80390
80745
|
visible: (_b = spec.title.shape) === null || _b === void 0 ? void 0 : _b.visible,
|
|
80391
80746
|
space: (_c = spec.title.shape) === null || _c === void 0 ? void 0 : _c.space,
|
|
80392
80747
|
style: transformToGraphic((_d = spec.title.shape) === null || _d === void 0 ? void 0 : _d.style)
|
|
80393
|
-
},
|
|
80394
|
-
background: {
|
|
80748
|
+
}, background: {
|
|
80395
80749
|
visible: (_e = spec.title.background) === null || _e === void 0 ? void 0 : _e.visible,
|
|
80396
80750
|
style: transformToGraphic((_f = spec.title.background) === null || _f === void 0 ? void 0 : _f.style)
|
|
80397
|
-
},
|
|
80398
|
-
state: {
|
|
80751
|
+
}, state: {
|
|
80399
80752
|
text: transformStateStyle(spec.title.state),
|
|
80400
80753
|
shape: transformStateStyle((_g = spec.title.shape) === null || _g === void 0 ? void 0 : _g.state),
|
|
80401
80754
|
background: transformStateStyle((_h = spec.title.background) === null || _h === void 0 ? void 0 : _h.state)
|
|
80402
|
-
},
|
|
80403
|
-
pickable: ((_j = spec.title.style) === null || _j === void 0 ? void 0 : _j.pickable) !== false,
|
|
80404
|
-
childrenPickable: ((_k = spec.title.style) === null || _k === void 0 ? void 0 : _k.pickable) !== false
|
|
80405
|
-
},
|
|
80755
|
+
}, pickable: ((_j = spec.title.style) === null || _j === void 0 ? void 0 : _j.pickable) !== false, childrenPickable: ((_k = spec.title.style) === null || _k === void 0 ? void 0 : _k.pickable) !== false }, spec.title),
|
|
80406
80756
|
panel: {
|
|
80407
80757
|
visible: (_l = spec.background) === null || _l === void 0 ? void 0 : _l.visible,
|
|
80408
80758
|
style: transformToGraphic((_m = spec.background) === null || _m === void 0 ? void 0 : _m.style),
|
|
@@ -83048,21 +83398,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83048
83398
|
};
|
|
83049
83399
|
const measureTooltipText = (text, style) => {
|
|
83050
83400
|
var _a;
|
|
83051
|
-
text = (text !== null && text !== void 0 ? text : '').toString();
|
|
83052
83401
|
let textLines;
|
|
83053
|
-
|
|
83054
|
-
|
|
83055
|
-
|
|
83402
|
+
let textConfig;
|
|
83403
|
+
if (!((text === null || text === void 0 ? void 0 : text.type) === 'rich' || (text === null || text === void 0 ? void 0 : text.type) === 'html')) {
|
|
83404
|
+
text = (text !== null && text !== void 0 ? text : '').toString();
|
|
83405
|
+
if (style.multiLine) {
|
|
83406
|
+
textLines = text.split('\n');
|
|
83407
|
+
textLines = textLines.map((line, i) => (i < textLines.length - 1 ? line + '\n' : line));
|
|
83408
|
+
}
|
|
83409
|
+
else {
|
|
83410
|
+
textLines = [text];
|
|
83411
|
+
}
|
|
83412
|
+
textConfig = textLines.map(line => (Object.assign(Object.assign({}, style), { text: line })));
|
|
83056
83413
|
}
|
|
83057
83414
|
else {
|
|
83058
|
-
|
|
83415
|
+
textConfig = text.text;
|
|
83416
|
+
textLines = text;
|
|
83059
83417
|
}
|
|
83060
83418
|
const bound = getRichTextBounds({
|
|
83061
83419
|
wordBreak: (_a = style.wordBreak) !== null && _a !== void 0 ? _a : 'break-word',
|
|
83062
83420
|
maxWidth: style.maxWidth ? style.maxWidth : undefined,
|
|
83063
83421
|
width: 0,
|
|
83064
83422
|
height: 0,
|
|
83065
|
-
textConfig:
|
|
83423
|
+
textConfig: textConfig
|
|
83066
83424
|
});
|
|
83067
83425
|
return {
|
|
83068
83426
|
width: bound.width(),
|
|
@@ -83594,10 +83952,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83594
83952
|
}
|
|
83595
83953
|
return itemAttrs;
|
|
83596
83954
|
});
|
|
83597
|
-
maxKeyWidth = keyWidths.length ?
|
|
83598
|
-
maxAdaptiveKeyWidth = adaptiveKeyWidths.length ?
|
|
83599
|
-
maxValueWidth = valueWidths.length ?
|
|
83600
|
-
maxShapeWidth = shapeWidths.length ?
|
|
83955
|
+
maxKeyWidth = keyWidths.length ? maxInArray(keyWidths) : 0;
|
|
83956
|
+
maxAdaptiveKeyWidth = adaptiveKeyWidths.length ? maxInArray(adaptiveKeyWidths) : 0;
|
|
83957
|
+
maxValueWidth = valueWidths.length ? maxInArray(valueWidths) : 0;
|
|
83958
|
+
maxShapeWidth = shapeWidths.length ? maxInArray(shapeWidths) + shapeStyle.spacing : 0;
|
|
83601
83959
|
contentMaxWidth = Math.max(maxShapeWidth + maxKeyWidth + keyStyle.spacing + maxValueWidth + valueStyle.spacing, maxShapeWidth + maxAdaptiveKeyWidth, contentMaxWidth);
|
|
83602
83960
|
attributes.hasContentShape = !!shapeWidths.length;
|
|
83603
83961
|
attributes.keyWidth = maxKeyWidth;
|
|
@@ -87092,6 +87450,56 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87092
87450
|
return;
|
|
87093
87451
|
}
|
|
87094
87452
|
}
|
|
87453
|
+
_isReverse() {
|
|
87454
|
+
const axis = this._relatedAxisComponent;
|
|
87455
|
+
if (!axis) {
|
|
87456
|
+
return false;
|
|
87457
|
+
}
|
|
87458
|
+
const axisScale = axis.getScale();
|
|
87459
|
+
const axisSpec = axis.getSpec();
|
|
87460
|
+
return axisScale.range()[0] > axisScale.range()[1] && (!axisSpec.inverse || this._isHorizontal);
|
|
87461
|
+
}
|
|
87462
|
+
_updateRangeFactor(tag, label) {
|
|
87463
|
+
const axis = this._relatedAxisComponent;
|
|
87464
|
+
const axisScale = axis.getScale();
|
|
87465
|
+
const reverse = this._isReverse();
|
|
87466
|
+
const newRangeFactor = reverse ? [1 - this._end, 1 - this._start] : [this._start, this._end];
|
|
87467
|
+
if (reverse) {
|
|
87468
|
+
switch (tag) {
|
|
87469
|
+
case 'startHandler':
|
|
87470
|
+
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87471
|
+
break;
|
|
87472
|
+
case 'endHandler':
|
|
87473
|
+
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87474
|
+
break;
|
|
87475
|
+
default:
|
|
87476
|
+
axisScale.rangeFactorStart(newRangeFactor[0], true);
|
|
87477
|
+
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87478
|
+
}
|
|
87479
|
+
}
|
|
87480
|
+
else {
|
|
87481
|
+
switch (tag) {
|
|
87482
|
+
case 'startHandler':
|
|
87483
|
+
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87484
|
+
break;
|
|
87485
|
+
case 'endHandler':
|
|
87486
|
+
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87487
|
+
break;
|
|
87488
|
+
default:
|
|
87489
|
+
axisScale.rangeFactorEnd(newRangeFactor[1], true);
|
|
87490
|
+
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87491
|
+
}
|
|
87492
|
+
}
|
|
87493
|
+
const newFactor = axisScale.rangeFactor();
|
|
87494
|
+
if (newFactor) {
|
|
87495
|
+
this._start = reverse ? 1 - newFactor[1] : newFactor[0];
|
|
87496
|
+
this._end = reverse ? 1 - newFactor[0] : newFactor[1];
|
|
87497
|
+
}
|
|
87498
|
+
else {
|
|
87499
|
+
this._start = 0;
|
|
87500
|
+
this._end = 1;
|
|
87501
|
+
}
|
|
87502
|
+
}
|
|
87095
87503
|
get visible() {
|
|
87096
87504
|
return this._visible;
|
|
87097
87505
|
}
|
|
@@ -87129,43 +87537,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87129
87537
|
axisScale.maxBandwidth('auto');
|
|
87130
87538
|
axisScale.minBandwidth('auto');
|
|
87131
87539
|
}
|
|
87132
|
-
|
|
87133
|
-
const newRangeFactor = reverse ? [1 - this._end, 1 - this._start] : [this._start, this._end];
|
|
87134
|
-
if (reverse) {
|
|
87135
|
-
switch (tag) {
|
|
87136
|
-
case 'startHandler':
|
|
87137
|
-
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87138
|
-
break;
|
|
87139
|
-
case 'endHandler':
|
|
87140
|
-
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87141
|
-
break;
|
|
87142
|
-
default:
|
|
87143
|
-
axisScale.rangeFactorStart(newRangeFactor[0], true);
|
|
87144
|
-
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87145
|
-
}
|
|
87146
|
-
}
|
|
87147
|
-
else {
|
|
87148
|
-
switch (tag) {
|
|
87149
|
-
case 'startHandler':
|
|
87150
|
-
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87151
|
-
break;
|
|
87152
|
-
case 'endHandler':
|
|
87153
|
-
axisScale.rangeFactorEnd(newRangeFactor[1]);
|
|
87154
|
-
break;
|
|
87155
|
-
default:
|
|
87156
|
-
axisScale.rangeFactorEnd(newRangeFactor[1], true);
|
|
87157
|
-
axisScale.rangeFactorStart(newRangeFactor[0]);
|
|
87158
|
-
}
|
|
87159
|
-
}
|
|
87160
|
-
const newFactor = axisScale.rangeFactor();
|
|
87161
|
-
if (newFactor) {
|
|
87162
|
-
this._start = reverse ? 1 - newFactor[1] : newFactor[0];
|
|
87163
|
-
this._end = reverse ? 1 - newFactor[0] : newFactor[1];
|
|
87164
|
-
}
|
|
87165
|
-
else {
|
|
87166
|
-
this._start = 0;
|
|
87167
|
-
this._end = 1;
|
|
87168
|
-
}
|
|
87540
|
+
this._updateRangeFactor(tag, 'zoomChange');
|
|
87169
87541
|
(_b = (_a = this._component) === null || _a === void 0 ? void 0 : _a.setStartAndEnd) === null || _b === void 0 ? void 0 : _b.call(_a, this._start, this._end);
|
|
87170
87542
|
axis.effect.scaleUpdate();
|
|
87171
87543
|
}
|
|
@@ -87346,7 +87718,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87346
87718
|
_computeDomainOfStateScale(isContinuous) {
|
|
87347
87719
|
const domain = this._data.getLatestData().map((d) => d[this._stateField]);
|
|
87348
87720
|
if (isContinuous) {
|
|
87349
|
-
|
|
87721
|
+
const domainNum = domain.map((n) => n * 1);
|
|
87722
|
+
return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [-Infinity, Infinity];
|
|
87350
87723
|
}
|
|
87351
87724
|
return domain;
|
|
87352
87725
|
}
|
|
@@ -87466,7 +87839,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87466
87839
|
_statePointToData(state) {
|
|
87467
87840
|
const scale = this._stateScale;
|
|
87468
87841
|
let range = scale.range();
|
|
87469
|
-
if (
|
|
87842
|
+
if (this._isReverse()) {
|
|
87470
87843
|
range = range.slice().reverse();
|
|
87471
87844
|
}
|
|
87472
87845
|
const posInRange = range[0] + (range[1] - range[0]) * state;
|
|
@@ -87540,8 +87913,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87540
87913
|
const domain = this._computeDomainOfStateScale(isContinuousScale);
|
|
87541
87914
|
this._stateScale = scale.clone();
|
|
87542
87915
|
if (isContinuousScale) {
|
|
87916
|
+
const domainNum = domain.map((n) => n * 1);
|
|
87543
87917
|
this._stateScale
|
|
87544
|
-
.domain(domain.length ? [
|
|
87918
|
+
.domain(domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : [0, 1], true)
|
|
87545
87919
|
.range(defaultRange);
|
|
87546
87920
|
}
|
|
87547
87921
|
else {
|
|
@@ -87637,11 +88011,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87637
88011
|
}
|
|
87638
88012
|
super.updateLayoutAttribute();
|
|
87639
88013
|
}
|
|
88014
|
+
onLayoutStart(layoutRect, viewRect, ctx) {
|
|
88015
|
+
super.onLayoutStart(layoutRect, viewRect, ctx);
|
|
88016
|
+
const isShown = this._autoUpdate(layoutRect);
|
|
88017
|
+
const sizeKey = this._isHorizontal ? 'height' : 'width';
|
|
88018
|
+
this.layout.setLayoutRect({
|
|
88019
|
+
[sizeKey]: isShown ? this[`_${sizeKey}`] : 0
|
|
88020
|
+
}, {
|
|
88021
|
+
[sizeKey]: exports.AttributeLevel.Built_In
|
|
88022
|
+
});
|
|
88023
|
+
}
|
|
87640
88024
|
getBoundsInRect(rect) {
|
|
87641
|
-
const isShown = this._autoUpdate(rect);
|
|
87642
|
-
if (!isShown) {
|
|
87643
|
-
return { x1: 0, y1: 0, x2: 0, y2: 0 };
|
|
87644
|
-
}
|
|
87645
88025
|
const result = { x1: this.getLayoutStartPoint().x, y1: this.getLayoutStartPoint().y, x2: 0, y2: 0 };
|
|
87646
88026
|
if (this._isHorizontal) {
|
|
87647
88027
|
result.y2 = result.y1 + this._height;
|
|
@@ -87671,7 +88051,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87671
88051
|
return undefined;
|
|
87672
88052
|
}
|
|
87673
88053
|
_autoUpdate(rect) {
|
|
87674
|
-
var _a, _b, _c, _d;
|
|
88054
|
+
var _a, _b, _c, _d, _e, _f;
|
|
87675
88055
|
if (!this._auto) {
|
|
87676
88056
|
this._cacheVisibility = undefined;
|
|
87677
88057
|
return true;
|
|
@@ -87680,37 +88060,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87680
88060
|
const axisSpec = axis === null || axis === void 0 ? void 0 : axis.getSpec();
|
|
87681
88061
|
const axisScale = axis === null || axis === void 0 ? void 0 : axis.getScale();
|
|
87682
88062
|
const bandSizeResult = this._getAxisBandSize(axisSpec);
|
|
88063
|
+
if (isDiscrete(axisScale.type) &&
|
|
88064
|
+
(rect === null || rect === void 0 ? void 0 : rect.height) === ((_a = this._cacheRect) === null || _a === void 0 ? void 0 : _a.height) &&
|
|
88065
|
+
(rect === null || rect === void 0 ? void 0 : rect.width) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.width) &&
|
|
88066
|
+
this._fixedBandSize === (bandSizeResult === null || bandSizeResult === void 0 ? void 0 : bandSizeResult.bandSize)) {
|
|
88067
|
+
return this._cacheVisibility;
|
|
88068
|
+
}
|
|
87683
88069
|
let isShown = true;
|
|
87684
|
-
if (this._isHorizontal) {
|
|
88070
|
+
if (this._isHorizontal && (rect === null || rect === void 0 ? void 0 : rect.width) !== ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width)) {
|
|
87685
88071
|
axisScale.range(axisSpec.inverse ? [rect.width, 0] : [0, rect.width]);
|
|
87686
88072
|
}
|
|
87687
|
-
else {
|
|
88073
|
+
else if ((rect === null || rect === void 0 ? void 0 : rect.height) !== ((_d = this._cacheRect) === null || _d === void 0 ? void 0 : _d.height)) {
|
|
87688
88074
|
axisScale.range(axisSpec.inverse ? [0, rect.height] : [rect.height, 0]);
|
|
87689
88075
|
}
|
|
88076
|
+
this._cacheRect = {
|
|
88077
|
+
width: rect === null || rect === void 0 ? void 0 : rect.width,
|
|
88078
|
+
height: rect === null || rect === void 0 ? void 0 : rect.height
|
|
88079
|
+
};
|
|
88080
|
+
this._fixedBandSize = bandSizeResult === null || bandSizeResult === void 0 ? void 0 : bandSizeResult.bandSize;
|
|
87690
88081
|
if (isDiscrete(axisScale.type)) {
|
|
87691
|
-
if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_a = this._cacheRect) === null || _a === void 0 ? void 0 : _a.height) &&
|
|
87692
|
-
(rect === null || rect === void 0 ? void 0 : rect.width) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.width) &&
|
|
87693
|
-
this._fixedBandSize === (bandSizeResult === null || bandSizeResult === void 0 ? void 0 : bandSizeResult.bandSize)) {
|
|
87694
|
-
return this._cacheVisibility;
|
|
87695
|
-
}
|
|
87696
|
-
this._cacheRect = rect;
|
|
87697
88082
|
if (bandSizeResult && (this._start || this._end)) {
|
|
87698
|
-
|
|
88083
|
+
this._updateRangeFactor(null, 'auto');
|
|
87699
88084
|
}
|
|
87700
|
-
|
|
88085
|
+
const [start, end] = (_e = axisScale.rangeFactor()) !== null && _e !== void 0 ? _e : [];
|
|
87701
88086
|
if (isNil$1(start) && isNil$1(end)) {
|
|
87702
|
-
start = 0;
|
|
87703
|
-
end = 1;
|
|
87704
88087
|
isShown = false;
|
|
87705
88088
|
}
|
|
87706
88089
|
else {
|
|
87707
88090
|
isShown = !(start === 0 && end === 1);
|
|
87708
88091
|
}
|
|
87709
|
-
this._start = start;
|
|
87710
|
-
this._end = end;
|
|
87711
88092
|
}
|
|
87712
88093
|
else {
|
|
87713
|
-
const [start, end] = (
|
|
88094
|
+
const [start, end] = (_f = axisScale.rangeFactor()) !== null && _f !== void 0 ? _f : [this._start, this._end];
|
|
87714
88095
|
isShown = !(start === 0 && end === 1);
|
|
87715
88096
|
}
|
|
87716
88097
|
this.setStartAndEnd(this._start, this._end);
|
|
@@ -87883,7 +88264,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87883
88264
|
}
|
|
87884
88265
|
_computeDomainOfValueScale() {
|
|
87885
88266
|
const domain = this._data.getLatestData().map((d) => d[this._valueField]);
|
|
87886
|
-
|
|
88267
|
+
const domainNum = domain.map((n) => n * 1);
|
|
88268
|
+
return domain.length ? [minInArray(domainNum), maxInArray(domainNum)] : null;
|
|
87887
88269
|
}
|
|
87888
88270
|
_computeMiddleHandlerSize() {
|
|
87889
88271
|
var _a, _b, _c, _d;
|
|
@@ -88399,11 +88781,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88399
88781
|
|
|
88400
88782
|
const markerMin = (_data, opt) => {
|
|
88401
88783
|
const data = _data[0].latestData;
|
|
88402
|
-
return min
|
|
88784
|
+
return min(data, opt.field);
|
|
88403
88785
|
};
|
|
88404
88786
|
const markerMax = (_data, opt) => {
|
|
88405
88787
|
const data = _data[0].latestData;
|
|
88406
|
-
return max
|
|
88788
|
+
return max(data, opt.field);
|
|
88407
88789
|
};
|
|
88408
88790
|
function markerSum(_data, opt) {
|
|
88409
88791
|
const data = _data[0].latestData;
|
|
@@ -88560,8 +88942,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88560
88942
|
if (!autoRange) {
|
|
88561
88943
|
return false;
|
|
88562
88944
|
}
|
|
88563
|
-
const
|
|
88564
|
-
const
|
|
88945
|
+
const domainNum = domain.map((n) => n * 1);
|
|
88946
|
+
const min = minInArray(domainNum);
|
|
88947
|
+
const max = maxInArray(domainNum);
|
|
88565
88948
|
if (datum < min || datum > max) {
|
|
88566
88949
|
return true;
|
|
88567
88950
|
}
|
|
@@ -89213,25 +89596,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89213
89596
|
};
|
|
89214
89597
|
}
|
|
89215
89598
|
_getTitleAttrs() {
|
|
89216
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
89599
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89217
89600
|
const realWidth = Math.max(0, (_a = this._spec.width) !== null && _a !== void 0 ? _a : this.getLayoutRect().width);
|
|
89218
|
-
return {
|
|
89219
|
-
text: (_b = this._spec.text) !== null && _b !== void 0 ? _b : '',
|
|
89220
|
-
subtext: (_c = this._spec.subtext) !== null && _c !== void 0 ? _c : '',
|
|
89221
|
-
x: (_d = this._spec.x) !== null && _d !== void 0 ? _d : 0,
|
|
89222
|
-
y: (_e = this._spec.y) !== null && _e !== void 0 ? _e : 0,
|
|
89223
|
-
width: realWidth,
|
|
89224
|
-
height: this._spec.height,
|
|
89225
|
-
minWidth: this._spec.minWidth,
|
|
89226
|
-
maxWidth: this._spec.maxWidth,
|
|
89227
|
-
minHeight: this._spec.minHeight,
|
|
89228
|
-
maxHeight: this._spec.maxHeight,
|
|
89229
|
-
padding: this._spec.innerPadding,
|
|
89230
|
-
align: (_f = this._spec.align) !== null && _f !== void 0 ? _f : 'left',
|
|
89231
|
-
verticalAlign: (_g = this._spec.verticalAlign) !== null && _g !== void 0 ? _g : 'top',
|
|
89232
|
-
textStyle: Object.assign({ width: realWidth }, this._spec.textStyle),
|
|
89233
|
-
subtextStyle: Object.assign({ width: realWidth }, this._spec.subtextStyle)
|
|
89234
|
-
};
|
|
89601
|
+
return Object.assign(Object.assign({}, pickWithout(this._spec, ['padding'])), { textType: (_b = this._spec.textType) !== null && _b !== void 0 ? _b : 'text', text: (_c = this._spec.text) !== null && _c !== void 0 ? _c : '', subtextType: (_d = this._spec.subtextType) !== null && _d !== void 0 ? _d : 'text', subtext: (_e = this._spec.subtext) !== null && _e !== void 0 ? _e : '', x: (_f = this._spec.x) !== null && _f !== void 0 ? _f : 0, y: (_g = this._spec.y) !== null && _g !== void 0 ? _g : 0, width: realWidth, height: this._spec.height, minWidth: this._spec.minWidth, maxWidth: this._spec.maxWidth, minHeight: this._spec.minHeight, maxHeight: this._spec.maxHeight, padding: this._spec.innerPadding, align: (_h = this._spec.align) !== null && _h !== void 0 ? _h : 'left', verticalAlign: (_j = this._spec.verticalAlign) !== null && _j !== void 0 ? _j : 'top', textStyle: Object.assign({ width: realWidth }, this._spec.textStyle), subtextStyle: Object.assign({ width: realWidth }, this._spec.subtextStyle) });
|
|
89235
89602
|
}
|
|
89236
89603
|
_createOrUpdateTitleComponent(attrs) {
|
|
89237
89604
|
if (this._titleComponent) {
|
|
@@ -89856,7 +90223,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89856
90223
|
this.event.on('afterElementEncode', eventParams => {
|
|
89857
90224
|
var _a;
|
|
89858
90225
|
const mark = eventParams.item;
|
|
89859
|
-
if (this._option.getChart().getLayoutTag() === false && ((_a = mark.
|
|
90226
|
+
if (this._option.getChart().getLayoutTag() === false && ((_a = mark.getContext()) === null || _a === void 0 ? void 0 : _a.model) === this) {
|
|
89860
90227
|
this._delegateLabelEvent(mark.getGroupGraphicItem());
|
|
89861
90228
|
}
|
|
89862
90229
|
});
|
|
@@ -90000,7 +90367,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90000
90367
|
const { labelSpec, labelMark } = labelInfos[params.labelIndex];
|
|
90001
90368
|
return labelMark.skipEncode
|
|
90002
90369
|
? { data: datum }
|
|
90003
|
-
: textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod);
|
|
90370
|
+
: textAttribute(labelInfos[params.labelIndex], datum, labelSpec.formatMethod, labelSpec.formatter);
|
|
90004
90371
|
}
|
|
90005
90372
|
})
|
|
90006
90373
|
.size(() => labelInfos[0].series.getRegion().getLayoutRect());
|