@visactor/vchart 1.9.1-alpha.0 → 1.9.2
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 +1083 -988
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/box-plot/box-plot-transformer.js +1 -1
- package/cjs/chart/box-plot/box-plot-transformer.js.map +1 -1
- package/cjs/chart/correlation/correlation-transformer.js.map +1 -1
- package/cjs/chart/stack.js +1 -2
- package/cjs/compile/grammar-item.js +2 -1
- package/cjs/component/axis/base-axis.d.ts +3 -2
- package/cjs/component/axis/base-axis.js +4 -4
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +4 -2
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/time-axis.js +3 -3
- package/cjs/component/axis/cartesian/time-axis.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +1 -0
- package/cjs/component/axis/mixin/band-axis-mixin.js +24 -12
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.js +2 -1
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/cjs/component/data-zoom/data-filter-base-component.js +2 -2
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +15 -13
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +15 -13
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/cjs/component/data-zoom/util.d.ts +1 -1
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/label/label.d.ts +2 -2
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/total-label.js.map +1 -1
- package/cjs/component/label/util.js +9 -13
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/util.d.ts +7 -1
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/component/title/title.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/core/vchart.js +3 -2
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/mark/group.d.ts +1 -1
- package/cjs/mark/group.js.map +1 -1
- package/cjs/plugin/components/axis-sync/axis-sync.js +1 -1
- package/cjs/plugin/components/axis-sync/axis-sync.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/base.js +4 -3
- package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js +27 -22
- package/cjs/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js +3 -3
- package/cjs/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js +2 -1
- package/cjs/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js +4 -1
- package/cjs/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
- package/cjs/series/area/area.js +9 -9
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/bar/bar.js +23 -23
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series-transformer.js +3 -2
- package/cjs/series/base/base-series-transformer.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +2 -1
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/box-plot/box-plot.js +19 -19
- package/cjs/series/box-plot/box-plot.js.map +1 -1
- package/cjs/series/cartesian/cartesian.d.ts +1 -0
- package/cjs/series/cartesian/cartesian.js +18 -13
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/circle-packing/circle-packing.js.map +1 -1
- package/cjs/series/correlation/correlation.js.map +1 -1
- package/cjs/series/heatmap/heatmap.d.ts +1 -1
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/line/constant.d.ts +1 -1
- package/cjs/series/line/constant.js.map +1 -1
- package/cjs/series/mixin/line-mixin.d.ts +1 -1
- package/cjs/series/mixin/line-mixin.js +3 -3
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/animation.js +3 -3
- package/cjs/series/polar/animation.js.map +1 -1
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/series/range-area/constant.d.ts +1 -1
- package/cjs/series/range-area/constant.js.map +1 -1
- package/cjs/series/range-area/range-area.js +12 -12
- package/cjs/series/range-area/range-area.js.map +1 -1
- package/cjs/series/range-column/range-column-transformer.d.ts +1 -1
- package/cjs/series/range-column/range-column-transformer.js.map +1 -1
- package/cjs/series/range-column/range-column.d.ts +1 -1
- package/cjs/series/range-column/range-column.js.map +1 -1
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/sunburst/sunburst.js.map +1 -1
- package/cjs/series/waterfall/waterfall.js +14 -14
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.d.ts +1 -1
- package/cjs/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/cjs/util/scale.d.ts +2 -1
- package/cjs/util/scale.js.map +1 -1
- package/cjs/util/space.d.ts +1 -1
- package/cjs/util/space.js.map +1 -1
- package/cjs/util/spec/common.d.ts +1 -1
- package/cjs/util/spec/common.js.map +1 -1
- package/cjs/util/spec/merge-theme.d.ts +1 -1
- package/cjs/util/spec/merge-theme.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/box-plot/box-plot-transformer.js +1 -1
- package/esm/chart/box-plot/box-plot-transformer.js.map +1 -1
- package/esm/chart/correlation/correlation-transformer.js.map +1 -1
- package/esm/chart/stack.js +1 -2
- package/esm/compile/grammar-item.js +2 -1
- package/esm/component/axis/base-axis.d.ts +3 -2
- package/esm/component/axis/base-axis.js +1 -3
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +4 -2
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/time-axis.js +3 -3
- package/esm/component/axis/cartesian/time-axis.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +1 -0
- package/esm/component/axis/mixin/band-axis-mixin.js +23 -12
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.js +2 -1
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +1 -0
- package/esm/component/data-zoom/data-filter-base-component.js +2 -2
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +15 -13
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js +15 -13
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/esm/component/data-zoom/util.d.ts +1 -1
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/label/label.d.ts +2 -2
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/total-label.js.map +1 -1
- package/esm/component/label/util.js +9 -13
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/util.d.ts +7 -1
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/component/title/title.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/core/vchart.js +3 -2
- package/esm/core/vchart.js.map +1 -1
- package/esm/mark/group.d.ts +1 -1
- package/esm/mark/group.js.map +1 -1
- package/esm/plugin/components/axis-sync/axis-sync.js +1 -1
- package/esm/plugin/components/axis-sync/axis-sync.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/base.js +4 -3
- package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js +25 -20
- package/esm/plugin/components/tooltip-handler/dom/model/content-column-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.d.ts +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/content-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js +3 -3
- package/esm/plugin/components/tooltip-handler/dom/model/shape-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js +2 -1
- package/esm/plugin/components/tooltip-handler/dom/model/style-constants.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js +4 -1
- package/esm/plugin/components/tooltip-handler/dom/utils/style.js.map +1 -1
- package/esm/series/area/area.js +9 -9
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/bar/bar.js +22 -22
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series-transformer.js +2 -2
- package/esm/series/base/base-series-transformer.js.map +1 -1
- package/esm/series/base/base-series.d.ts +2 -1
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/box-plot/box-plot.js +19 -19
- package/esm/series/box-plot/box-plot.js.map +1 -1
- package/esm/series/cartesian/cartesian.d.ts +1 -0
- package/esm/series/cartesian/cartesian.js +17 -12
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/circle-packing/circle-packing.js.map +1 -1
- package/esm/series/correlation/correlation.js.map +1 -1
- package/esm/series/heatmap/heatmap.d.ts +1 -1
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/line/constant.d.ts +1 -1
- package/esm/series/line/constant.js.map +1 -1
- package/esm/series/mixin/line-mixin.d.ts +1 -1
- package/esm/series/mixin/line-mixin.js +3 -3
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/animation.js +4 -2
- package/esm/series/polar/animation.js.map +1 -1
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/series/range-area/constant.d.ts +1 -1
- package/esm/series/range-area/constant.js.map +1 -1
- package/esm/series/range-area/range-area.js +12 -12
- package/esm/series/range-area/range-area.js.map +1 -1
- package/esm/series/range-column/range-column-transformer.d.ts +1 -1
- package/esm/series/range-column/range-column-transformer.js.map +1 -1
- package/esm/series/range-column/range-column.d.ts +1 -1
- package/esm/series/range-column/range-column.js.map +1 -1
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/sunburst/sunburst.js.map +1 -1
- package/esm/series/waterfall/waterfall.js +13 -13
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.d.ts +1 -1
- package/esm/theme/builtin/common/series/rangeColumn.js.map +1 -1
- package/esm/util/scale.d.ts +2 -1
- package/esm/util/scale.js.map +1 -1
- package/esm/util/space.d.ts +1 -1
- package/esm/util/space.js.map +1 -1
- package/esm/util/spec/common.d.ts +1 -1
- package/esm/util/spec/common.js.map +1 -1
- package/esm/util/spec/merge-theme.d.ts +1 -1
- package/esm/util/spec/merge-theme.js.map +1 -1
- package/package.json +12 -12
package/build/index.js
CHANGED
|
@@ -484,17 +484,17 @@
|
|
|
484
484
|
const isDate = value => isType$1(value, "Date");
|
|
485
485
|
var isDate$1 = isDate;
|
|
486
486
|
|
|
487
|
-
const isNumber
|
|
487
|
+
const isNumber = function (value) {
|
|
488
488
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
489
489
|
const type = typeof value;
|
|
490
490
|
return fuzzy ? "number" === type : "number" === type || isType$1(value, "Number");
|
|
491
491
|
};
|
|
492
|
-
var isNumber$
|
|
492
|
+
var isNumber$1 = isNumber;
|
|
493
493
|
|
|
494
494
|
const isNumeric = value => "string" == typeof value && !isNaN(Number(value)) && !isNaN(parseFloat(value));
|
|
495
495
|
var isNumeric$1 = isNumeric;
|
|
496
496
|
|
|
497
|
-
const isValidNumber = value => isNumber$
|
|
497
|
+
const isValidNumber = value => isNumber$1(value) && Number.isFinite(value);
|
|
498
498
|
var isValidNumber$1 = isValidNumber;
|
|
499
499
|
|
|
500
500
|
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
@@ -540,7 +540,7 @@
|
|
|
540
540
|
if (!isValid$1(value) || "object" != typeof value) return value;
|
|
541
541
|
const isArr = isArray$1(value),
|
|
542
542
|
length = value.length;
|
|
543
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$1(value) || isNumber$
|
|
543
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$1(value) || isNumber$1(value) || isString$1(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
544
544
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
545
545
|
let index = -1;
|
|
546
546
|
if (result) for (; ++index < (props || value).length;) {
|
|
@@ -1007,10 +1007,10 @@
|
|
|
1007
1007
|
return this.x = x, this.y = y, this;
|
|
1008
1008
|
}
|
|
1009
1009
|
add(point) {
|
|
1010
|
-
return isNumber$
|
|
1010
|
+
return isNumber$1(point) ? (this.x += point, void (this.y += point)) : (this.x += point.x, this.y += point.y, this);
|
|
1011
1011
|
}
|
|
1012
1012
|
sub(point) {
|
|
1013
|
-
return isNumber$
|
|
1013
|
+
return isNumber$1(point) ? (this.x -= point, void (this.y -= point)) : (this.x -= point.x, this.y -= point.y, this);
|
|
1014
1014
|
}
|
|
1015
1015
|
multi(point) {
|
|
1016
1016
|
throw new Error("暂不支持");
|
|
@@ -1600,10 +1600,10 @@
|
|
|
1600
1600
|
return ((value = Math.max(0, Math.min(255, Math.round(value) || 0))) < 16 ? "0" : "") + value.toString(16);
|
|
1601
1601
|
}
|
|
1602
1602
|
function rgb(value) {
|
|
1603
|
-
return isNumber$
|
|
1603
|
+
return isNumber$1(value) ? new RGB(value >> 16, value >> 8 & 255, 255 & value, 1) : isArray$1(value) ? new RGB(value[0], value[1], value[2]) : new RGB(255, 255, 255);
|
|
1604
1604
|
}
|
|
1605
1605
|
function rgba(value) {
|
|
1606
|
-
return isNumber$
|
|
1606
|
+
return isNumber$1(value) ? new RGB(value >>> 24, value >>> 16 & 255, value >>> 8 & 255, 255 & value) : isArray$1(value) ? new RGB(value[0], value[1], value[2], value[3]) : new RGB(255, 255, 255, 1);
|
|
1607
1607
|
}
|
|
1608
1608
|
function SRGBToLinear(c) {
|
|
1609
1609
|
return c < .04045 ? .0773993808 * c : Math.pow(.9478672986 * c + .0521327014, 2.4);
|
|
@@ -2248,7 +2248,7 @@
|
|
|
2248
2248
|
}(LoggerLevel || (LoggerLevel = {}));
|
|
2249
2249
|
class Logger {
|
|
2250
2250
|
static getInstance(level, method) {
|
|
2251
|
-
return Logger._instance && isNumber$
|
|
2251
|
+
return Logger._instance && isNumber$1(level) ? Logger._instance.level(level) : Logger._instance || (Logger._instance = new Logger(level, method)), Logger._instance;
|
|
2252
2252
|
}
|
|
2253
2253
|
static setInstance(logger) {
|
|
2254
2254
|
return Logger._instance = logger;
|
|
@@ -8336,6 +8336,9 @@
|
|
|
8336
8336
|
clear() {
|
|
8337
8337
|
this.transformCbList = null, this.commandList.length = 0, this.curves.length = 0;
|
|
8338
8338
|
}
|
|
8339
|
+
beginPath() {
|
|
8340
|
+
this.clear();
|
|
8341
|
+
}
|
|
8339
8342
|
toString() {
|
|
8340
8343
|
if (!this.toStringCbList) {
|
|
8341
8344
|
const list = [];
|
|
@@ -8345,7 +8348,7 @@
|
|
|
8345
8348
|
let path = "";
|
|
8346
8349
|
for (let i = 0; i < bezierPathList.length; i += 6) path += `C${bezierPathList[i]} ${bezierPathList[i + 1]} ${bezierPathList[i + 2]} ${bezierPathList[i + 3]} ${bezierPathList[i + 4]} ${bezierPathList[i + 5]}`;
|
|
8347
8350
|
return path;
|
|
8348
|
-
}, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
|
|
8351
|
+
}, list[enumCommandMap.R] = cmd => `M${cmd[1]} ${cmd[2]} h${cmd[3]} v${cmd[4]} H${cmd[1]}Z`, list[enumCommandMap.Z] = cmd => "Z", this.toStringCbList = list;
|
|
8349
8352
|
}
|
|
8350
8353
|
const list = this.toStringCbList;
|
|
8351
8354
|
let path = "";
|
|
@@ -8684,6 +8687,7 @@
|
|
|
8684
8687
|
zIndex: 0,
|
|
8685
8688
|
layout: null,
|
|
8686
8689
|
boundsPadding: 0,
|
|
8690
|
+
renderStyle: "default",
|
|
8687
8691
|
pickMode: "accurate",
|
|
8688
8692
|
customPickShape: null,
|
|
8689
8693
|
boundsMode: "accurate",
|
|
@@ -9236,9 +9240,6 @@
|
|
|
9236
9240
|
function isNotAroundZero(val) {
|
|
9237
9241
|
return val > EPSILON || val < -EPSILON;
|
|
9238
9242
|
}
|
|
9239
|
-
function isNumber(data) {
|
|
9240
|
-
return "number" == typeof data && Number.isFinite(data);
|
|
9241
|
-
}
|
|
9242
9243
|
const _v0 = [0, 0],
|
|
9243
9244
|
_v1 = [0, 0],
|
|
9244
9245
|
_v2 = [0, 0];
|
|
@@ -10013,7 +10014,7 @@
|
|
|
10013
10014
|
}
|
|
10014
10015
|
const globalTheme = new Theme();
|
|
10015
10016
|
function getTheme$1(graphic, theme) {
|
|
10016
|
-
return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
10017
|
+
return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme$1(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
10017
10018
|
}
|
|
10018
10019
|
function getThemeFromGroup(graphic) {
|
|
10019
10020
|
let g;
|
|
@@ -10178,10 +10179,13 @@
|
|
|
10178
10179
|
delete() {
|
|
10179
10180
|
this.parent && this.parent.removeChild(this);
|
|
10180
10181
|
}
|
|
10181
|
-
removeAllChild() {
|
|
10182
|
+
removeAllChild(deep) {
|
|
10182
10183
|
if (!this._idMap) return;
|
|
10183
10184
|
let child = this._firstChild;
|
|
10184
|
-
for (; child;)
|
|
10185
|
+
for (; child;) {
|
|
10186
|
+
const next = child._next;
|
|
10187
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
10188
|
+
}
|
|
10185
10189
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
10186
10190
|
}
|
|
10187
10191
|
replaceChild(newChild, oldChild) {
|
|
@@ -11782,7 +11786,7 @@
|
|
|
11782
11786
|
}
|
|
11783
11787
|
onBind() {
|
|
11784
11788
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11785
|
-
this.fromNumber = isNumber$
|
|
11789
|
+
this.fromNumber = isNumber$1(null === (_a = this.from) || void 0 === _a ? void 0 : _a.text) ? null === (_b = this.from) || void 0 === _b ? void 0 : _b.text : Number.parseFloat(null === (_c = this.from) || void 0 === _c ? void 0 : _c.text), this.toNumber = isNumber$1(null === (_d = this.to) || void 0 === _d ? void 0 : _d.text) ? null === (_e = this.to) || void 0 === _e ? void 0 : _e.text : Number.parseFloat(null === (_f = this.to) || void 0 === _f ? void 0 : _f.text), Number.isFinite(this.toNumber) || (this.fromNumber = 0), Number.isFinite(this.toNumber) || (this.valid = !1), !1 !== this.valid && (this.decimalLength = null !== (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.fixed) && void 0 !== _h ? _h : Math.max(getDecimalPlaces(this.fromNumber), getDecimalPlaces(this.toNumber)));
|
|
11786
11790
|
}
|
|
11787
11791
|
onEnd() {}
|
|
11788
11792
|
onUpdate(end, ratio, out) {
|
|
@@ -12468,7 +12472,7 @@
|
|
|
12468
12472
|
return res;
|
|
12469
12473
|
};
|
|
12470
12474
|
const samplingPoints = (points, count) => {
|
|
12471
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
12475
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
|
|
12472
12476
|
if (0 === validatePoints.length) return [];
|
|
12473
12477
|
if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
|
|
12474
12478
|
const res = [];
|
|
@@ -12504,7 +12508,7 @@
|
|
|
12504
12508
|
var _a;
|
|
12505
12509
|
return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
|
|
12506
12510
|
}, []));
|
|
12507
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
12511
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
|
|
12508
12512
|
if (!validatePoints.length) return [];
|
|
12509
12513
|
const allPoints = [];
|
|
12510
12514
|
validatePoints.forEach(point => {
|
|
@@ -13087,18 +13091,10 @@
|
|
|
13087
13091
|
class ResourceLoader {
|
|
13088
13092
|
static GetImage(url, mark) {
|
|
13089
13093
|
var _a;
|
|
13090
|
-
|
|
13094
|
+
const data = ResourceLoader.cache.get(url);
|
|
13091
13095
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(() => {
|
|
13092
13096
|
mark.imageLoadFail(url);
|
|
13093
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (
|
|
13094
|
-
type: "image",
|
|
13095
|
-
loadState: "init"
|
|
13096
|
-
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(res => {
|
|
13097
|
-
var _a;
|
|
13098
|
-
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
|
|
13099
|
-
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
13100
|
-
});
|
|
13101
|
-
})) : (data.loadState = "fail", mark.imageLoadFail(url)));
|
|
13097
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : ResourceLoader.loadImage(url, mark);
|
|
13102
13098
|
}
|
|
13103
13099
|
static GetSvg(svgStr, mark) {
|
|
13104
13100
|
var _a;
|
|
@@ -13124,8 +13120,60 @@
|
|
|
13124
13120
|
loadState: "init"
|
|
13125
13121
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
13126
13122
|
}
|
|
13123
|
+
static loading() {
|
|
13124
|
+
setTimeout(() => {
|
|
13125
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
13126
|
+
ResourceLoader.isLoading = !0;
|
|
13127
|
+
const tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
13128
|
+
promises = [];
|
|
13129
|
+
tasks.forEach(task => {
|
|
13130
|
+
const {
|
|
13131
|
+
url: url,
|
|
13132
|
+
marks: marks
|
|
13133
|
+
} = task,
|
|
13134
|
+
data = {
|
|
13135
|
+
type: "image",
|
|
13136
|
+
loadState: "init"
|
|
13137
|
+
};
|
|
13138
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
13139
|
+
data.waitingMark = marks;
|
|
13140
|
+
const end = data.dataPromise.then(res => {
|
|
13141
|
+
var _a;
|
|
13142
|
+
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
|
|
13143
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
13144
|
+
});
|
|
13145
|
+
});
|
|
13146
|
+
promises.push(end);
|
|
13147
|
+
} else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
|
|
13148
|
+
}), Promise.all(promises).then(() => {
|
|
13149
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
13150
|
+
}).catch(error => {
|
|
13151
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
13152
|
+
});
|
|
13153
|
+
}
|
|
13154
|
+
}, 0);
|
|
13155
|
+
}
|
|
13156
|
+
static loadImage(url, mark) {
|
|
13157
|
+
const index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
13158
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
13159
|
+
ResourceLoader.toLoadAueue.push({
|
|
13160
|
+
url: url,
|
|
13161
|
+
marks: [mark]
|
|
13162
|
+
}), ResourceLoader.loading();
|
|
13163
|
+
}
|
|
13164
|
+
static improveImageLoading(url) {
|
|
13165
|
+
const index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
13166
|
+
if (-1 !== index) {
|
|
13167
|
+
const elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
13168
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
13169
|
+
}
|
|
13170
|
+
}
|
|
13127
13171
|
}
|
|
13128
|
-
|
|
13172
|
+
function getIndex(url, arr) {
|
|
13173
|
+
for (let i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
13174
|
+
return -1;
|
|
13175
|
+
}
|
|
13176
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
13129
13177
|
|
|
13130
13178
|
const tempMatrix = new Matrix(),
|
|
13131
13179
|
tempBounds$1 = new AABBBounds();
|
|
@@ -13221,7 +13269,7 @@
|
|
|
13221
13269
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
13222
13270
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
13223
13271
|
const bounds = this.doUpdateAABBBounds(full);
|
|
13224
|
-
return
|
|
13272
|
+
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
13225
13273
|
}
|
|
13226
13274
|
combindShadowAABBBounds(bounds) {
|
|
13227
13275
|
if (this.shadowRoot) {
|
|
@@ -13230,7 +13278,8 @@
|
|
|
13230
13278
|
}
|
|
13231
13279
|
}
|
|
13232
13280
|
tryUpdateGlobalAABBBounds() {
|
|
13233
|
-
|
|
13281
|
+
const b = this.AABBBounds;
|
|
13282
|
+
return this._globalAABBBounds ? this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2) : this._globalAABBBounds = b.clone(), this.parent && this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix), this._globalAABBBounds;
|
|
13234
13283
|
}
|
|
13235
13284
|
tryUpdateGlobalTransMatrix() {
|
|
13236
13285
|
if (this._globalTransMatrix) {
|
|
@@ -13741,7 +13790,7 @@
|
|
|
13741
13790
|
data: "init",
|
|
13742
13791
|
state: null
|
|
13743
13792
|
};
|
|
13744
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
|
|
13793
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : isObject$2(image) ? (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background) : cache.state = "fail";
|
|
13745
13794
|
}
|
|
13746
13795
|
imageLoadSuccess(url, image, cb) {
|
|
13747
13796
|
if (!this.resources) return;
|
|
@@ -14211,8 +14260,9 @@
|
|
|
14211
14260
|
return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
|
|
14212
14261
|
}
|
|
14213
14262
|
removeAllChild() {
|
|
14263
|
+
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14214
14264
|
this.forEachChildren(child => {
|
|
14215
|
-
application.graphicService.onRemove(child);
|
|
14265
|
+
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
14216
14266
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
14217
14267
|
}
|
|
14218
14268
|
setStage(stage, layer) {
|
|
@@ -15538,7 +15588,7 @@
|
|
|
15538
15588
|
|
|
15539
15589
|
class BaseSymbol {
|
|
15540
15590
|
bounds(size, bounds) {
|
|
15541
|
-
if (isNumber$
|
|
15591
|
+
if (isNumber$1(size)) {
|
|
15542
15592
|
const halfS = size / 2;
|
|
15543
15593
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
15544
15594
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
@@ -15969,10 +16019,10 @@
|
|
|
15969
16019
|
super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
|
|
15970
16020
|
}
|
|
15971
16021
|
draw(ctx, size, x, y) {
|
|
15972
|
-
return isNumber$
|
|
16022
|
+
return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
15973
16023
|
}
|
|
15974
16024
|
drawOffset(ctx, size, x, y, offset) {
|
|
15975
|
-
return isNumber$
|
|
16025
|
+
return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
15976
16026
|
}
|
|
15977
16027
|
}
|
|
15978
16028
|
var rect = new RectSymbol();
|
|
@@ -16450,16 +16500,7 @@
|
|
|
16450
16500
|
deltaY = -height;
|
|
16451
16501
|
}
|
|
16452
16502
|
let deltaX = 0;
|
|
16453
|
-
|
|
16454
|
-
case "left":
|
|
16455
|
-
deltaX = 0;
|
|
16456
|
-
break;
|
|
16457
|
-
case "center":
|
|
16458
|
-
deltaX = -width / 2;
|
|
16459
|
-
break;
|
|
16460
|
-
case "right":
|
|
16461
|
-
deltaX = -width;
|
|
16462
|
-
}
|
|
16503
|
+
"right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
|
|
16463
16504
|
let frameHeight = this[this.directionKey.height];
|
|
16464
16505
|
this.singleLine && (frameHeight = this.lines[0].height + 1);
|
|
16465
16506
|
let lastLineTag = !1;
|
|
@@ -16608,9 +16649,9 @@
|
|
|
16608
16649
|
let direction = this.direction;
|
|
16609
16650
|
if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
16610
16651
|
if ("hide" === this.ellipsis) return;
|
|
16611
|
-
if ("add" === this.ellipsis) text += "...", "right"
|
|
16652
|
+
if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
16612
16653
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
16613
|
-
if (text = text.slice(0, index), text += "...", "right" === textAlign) {
|
|
16654
|
+
if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
|
|
16614
16655
|
const {
|
|
16615
16656
|
width: width
|
|
16616
16657
|
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
@@ -16801,17 +16842,7 @@
|
|
|
16801
16842
|
maxHeight = this.height;
|
|
16802
16843
|
let x = this.left,
|
|
16803
16844
|
spacing = 0;
|
|
16804
|
-
|
|
16805
|
-
case "right":
|
|
16806
|
-
x = width - this.actualWidth;
|
|
16807
|
-
break;
|
|
16808
|
-
case "center":
|
|
16809
|
-
x = (width - this.actualWidth) / 2;
|
|
16810
|
-
break;
|
|
16811
|
-
case "justify":
|
|
16812
|
-
this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1);
|
|
16813
|
-
}
|
|
16814
|
-
this.paragraphs.map(function (paragraph) {
|
|
16845
|
+
this.actualWidth < width && !isWidthMax && ("right" === this.textAlign || "end" === this.textAlign ? x = width - this.actualWidth : "center" === this.textAlign ? x = (width - this.actualWidth) / 2 : "justify" === this.textAlign && (this.paragraphs.length < 2 ? x = (width - this.actualWidth) / 2 : spacing = (width - this.actualWidth) / (this.paragraphs.length - 1))), this.paragraphs.map(function (paragraph) {
|
|
16815
16846
|
paragraph instanceof RichTextIcon ? (paragraph["_" + directionKey.x] = x, x += paragraph[directionKey.width] + spacing, paragraph["_" + directionKey.y] = "top" === paragraph.attribute.textBaseline ? 0 : "bottom" === paragraph.attribute.textBaseline ? maxHeight - paragraph.height : (maxHeight - paragraph.height) / 2) : (paragraph[directionKey.left] = x, x += paragraph[directionKey.width] + spacing);
|
|
16816
16847
|
});
|
|
16817
16848
|
}
|
|
@@ -17035,10 +17066,10 @@
|
|
|
17035
17066
|
}
|
|
17036
17067
|
} else {
|
|
17037
17068
|
const richTextConfig = textConfig[i];
|
|
17038
|
-
if (isNumber$
|
|
17069
|
+
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
17039
17070
|
const textParts = richTextConfig.text.split("\n");
|
|
17040
17071
|
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
17041
|
-
} else paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
17072
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
17042
17073
|
}
|
|
17043
17074
|
const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
17044
17075
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -17283,7 +17314,7 @@
|
|
|
17283
17314
|
} = this.attribute;
|
|
17284
17315
|
if (0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
17285
17316
|
const deltaRadius = Math.abs(outerRadius - innerRadius);
|
|
17286
|
-
return Math.min(isNumber$
|
|
17317
|
+
return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
17287
17318
|
}
|
|
17288
17319
|
getParsedAngle() {
|
|
17289
17320
|
const arcTheme = getTheme$1(this).arc;
|
|
@@ -19127,7 +19158,7 @@
|
|
|
19127
19158
|
const halfPi = pi$1 / 2;
|
|
19128
19159
|
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
19129
19160
|
let cornerRadius;
|
|
19130
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
19161
|
+
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$1(rectCornerRadius, !0)) cornerRadius = [rectCornerRadius = abs$1(rectCornerRadius), rectCornerRadius, rectCornerRadius, rectCornerRadius];else if (Array.isArray(rectCornerRadius)) {
|
|
19131
19162
|
const cornerRadiusArr = rectCornerRadius;
|
|
19132
19163
|
let cr0, cr1;
|
|
19133
19164
|
switch (cornerRadiusArr.length) {
|
|
@@ -19235,7 +19266,7 @@
|
|
|
19235
19266
|
y = bounds.y1,
|
|
19236
19267
|
width = bounds.width(),
|
|
19237
19268
|
height = bounds.height();
|
|
19238
|
-
return isNumber$
|
|
19269
|
+
return isNumber$1(boundsPadding) ? (x += boundsPadding, y += boundsPadding, width -= 2 * boundsPadding, height -= 2 * boundsPadding) : (x += boundsPadding[3], y += boundsPadding[0], width -= boundsPadding[1] + boundsPadding[3], height -= boundsPadding[0] + boundsPadding[2]), {
|
|
19239
19270
|
x: x,
|
|
19240
19271
|
y: y,
|
|
19241
19272
|
width: width,
|
|
@@ -20092,11 +20123,12 @@
|
|
|
20092
20123
|
}
|
|
20093
20124
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
20094
20125
|
var _a, _b, _c, _d, _e;
|
|
20126
|
+
const {
|
|
20127
|
+
points: points
|
|
20128
|
+
} = area.attribute;
|
|
20129
|
+
if (points.length < 2) return;
|
|
20095
20130
|
context.beginPath();
|
|
20096
20131
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
20097
|
-
{
|
|
20098
|
-
points: points
|
|
20099
|
-
} = area.attribute,
|
|
20100
20132
|
startP = points[0];
|
|
20101
20133
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
20102
20134
|
for (let i = 1; i < points.length; i++) {
|
|
@@ -20253,6 +20285,7 @@
|
|
|
20253
20285
|
}
|
|
20254
20286
|
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20255
20287
|
var _a, _b, _c, _d;
|
|
20288
|
+
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20256
20289
|
let {
|
|
20257
20290
|
connectedType: connectedType,
|
|
20258
20291
|
connectedX: connectedX,
|
|
@@ -20261,7 +20294,6 @@
|
|
|
20261
20294
|
} = attribute;
|
|
20262
20295
|
const da = [];
|
|
20263
20296
|
if (connect && (isArray$1(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray$1(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
20264
|
-
if (!cache) return;
|
|
20265
20297
|
context.beginPath();
|
|
20266
20298
|
const {
|
|
20267
20299
|
points: points,
|
|
@@ -20930,7 +20962,9 @@
|
|
|
20930
20962
|
image: url
|
|
20931
20963
|
} = image.attribute;
|
|
20932
20964
|
if (!url || !image.resources) return;
|
|
20933
|
-
|
|
20965
|
+
const res = image.resources.get(url);
|
|
20966
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
20967
|
+
if ("success" !== res.state) return;
|
|
20934
20968
|
const {
|
|
20935
20969
|
context: context
|
|
20936
20970
|
} = renderService.drawParams;
|
|
@@ -20970,6 +21004,197 @@
|
|
|
20970
21004
|
},
|
|
20971
21005
|
__metadata$V = undefined && undefined.__metadata || function (k, v) {
|
|
20972
21006
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21007
|
+
};
|
|
21008
|
+
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
21009
|
+
const tempDirtyBounds = new AABBBounds();
|
|
21010
|
+
class ShadowRootDrawItemInterceptorContribution {
|
|
21011
|
+
constructor() {
|
|
21012
|
+
this.order = 1;
|
|
21013
|
+
}
|
|
21014
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21015
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21016
|
+
}
|
|
21017
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21018
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21019
|
+
}
|
|
21020
|
+
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21021
|
+
if (!graphic.shadowRoot) return !1;
|
|
21022
|
+
const {
|
|
21023
|
+
context: context
|
|
21024
|
+
} = drawContext;
|
|
21025
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21026
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21027
|
+
const m = graphic.globalTransMatrix.getInverse();
|
|
21028
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21029
|
+
}
|
|
21030
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21031
|
+
}
|
|
21032
|
+
}
|
|
21033
|
+
class DebugDrawItemInterceptorContribution {
|
|
21034
|
+
constructor() {
|
|
21035
|
+
this.order = 1;
|
|
21036
|
+
}
|
|
21037
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21038
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21039
|
+
}
|
|
21040
|
+
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21041
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21042
|
+
const {
|
|
21043
|
+
context: context
|
|
21044
|
+
} = drawContext;
|
|
21045
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21046
|
+
const b = graphic.AABBBounds;
|
|
21047
|
+
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21048
|
+
}
|
|
21049
|
+
}
|
|
21050
|
+
let CommonDrawItemInterceptorContribution = class {
|
|
21051
|
+
constructor() {
|
|
21052
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21053
|
+
}
|
|
21054
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21055
|
+
for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21056
|
+
return !1;
|
|
21057
|
+
}
|
|
21058
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21059
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21060
|
+
for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21061
|
+
return !1;
|
|
21062
|
+
}
|
|
21063
|
+
};
|
|
21064
|
+
CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$V("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
21065
|
+
class InteractiveDrawItemInterceptorContribution {
|
|
21066
|
+
constructor() {
|
|
21067
|
+
this.order = 1;
|
|
21068
|
+
}
|
|
21069
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21070
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21071
|
+
}
|
|
21072
|
+
beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21073
|
+
let interactiveGraphic = graphic.interactiveGraphic;
|
|
21074
|
+
if (graphic.attribute.globalZIndex) {
|
|
21075
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21076
|
+
globalZIndex: 0,
|
|
21077
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21078
|
+
}, !1, {
|
|
21079
|
+
skipUpdateCallback: !0
|
|
21080
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21081
|
+
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21082
|
+
if (interactiveLayer) {
|
|
21083
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21084
|
+
}
|
|
21085
|
+
return !0;
|
|
21086
|
+
}
|
|
21087
|
+
if (interactiveGraphic) {
|
|
21088
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21089
|
+
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21090
|
+
if (interactiveLayer) {
|
|
21091
|
+
this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
|
|
21092
|
+
}
|
|
21093
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21094
|
+
}
|
|
21095
|
+
return !1;
|
|
21096
|
+
}
|
|
21097
|
+
beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21098
|
+
const baseGraphic = graphic.baseGraphic;
|
|
21099
|
+
if (baseGraphic) {
|
|
21100
|
+
this.processing = !0;
|
|
21101
|
+
const {
|
|
21102
|
+
context: context
|
|
21103
|
+
} = drawContext;
|
|
21104
|
+
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
21105
|
+
}
|
|
21106
|
+
return !1;
|
|
21107
|
+
}
|
|
21108
|
+
getShadowRoot(interactiveLayer) {
|
|
21109
|
+
var _a;
|
|
21110
|
+
let group = interactiveLayer.getElementById("_interactive_group");
|
|
21111
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21112
|
+
}
|
|
21113
|
+
}
|
|
21114
|
+
class Canvas3DDrawItemInterceptor {
|
|
21115
|
+
constructor() {
|
|
21116
|
+
this.order = 1;
|
|
21117
|
+
}
|
|
21118
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21119
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21120
|
+
drawContext.in3dInterceptor = !0;
|
|
21121
|
+
const {
|
|
21122
|
+
context: context,
|
|
21123
|
+
stage: stage
|
|
21124
|
+
} = renderService.drawParams;
|
|
21125
|
+
context.canvas;
|
|
21126
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21127
|
+
const m = context.currentMatrix;
|
|
21128
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21129
|
+
const matrix = mat4Allocate.allocate();
|
|
21130
|
+
mat3Tomat4(matrix, m);
|
|
21131
|
+
const lastModelMatrix = context.modelMatrix;
|
|
21132
|
+
if (lastModelMatrix) {
|
|
21133
|
+
if (matrix) {
|
|
21134
|
+
const m = mat4Allocate.allocate();
|
|
21135
|
+
context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
|
|
21136
|
+
}
|
|
21137
|
+
} else context.modelMatrix = matrix;
|
|
21138
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21139
|
+
let isPie = !1,
|
|
21140
|
+
is3d = !1;
|
|
21141
|
+
if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
|
|
21142
|
+
const children = graphic.getChildren(),
|
|
21143
|
+
sortedChildren = [...children];
|
|
21144
|
+
sortedChildren.sort((a, b) => {
|
|
21145
|
+
var _a, _b, _c, _d;
|
|
21146
|
+
let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21147
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21148
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21149
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21150
|
+
return angle2 - angle1;
|
|
21151
|
+
}), sortedChildren.forEach(c => {
|
|
21152
|
+
c._next = null, c._prev = null;
|
|
21153
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
|
|
21154
|
+
graphic.appendChild(c);
|
|
21155
|
+
});
|
|
21156
|
+
const m = graphic.parent.globalTransMatrix;
|
|
21157
|
+
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
|
|
21158
|
+
c._next = null, c._prev = null;
|
|
21159
|
+
}), children.forEach(c => {
|
|
21160
|
+
graphic.appendChild(c);
|
|
21161
|
+
});
|
|
21162
|
+
} else if (is3d) {
|
|
21163
|
+
const children = graphic.getChildren(),
|
|
21164
|
+
zChildren = children.map(g => ({
|
|
21165
|
+
ave_z: g.findFace().vertices.map(v => {
|
|
21166
|
+
var _a;
|
|
21167
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21168
|
+
}).reduce((a, b) => a + b, 0),
|
|
21169
|
+
g: g
|
|
21170
|
+
}));
|
|
21171
|
+
zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
|
|
21172
|
+
i.g._next = null, i.g._prev = null;
|
|
21173
|
+
}), graphic.update(), zChildren.forEach(i => {
|
|
21174
|
+
graphic.add(i.g);
|
|
21175
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
|
|
21176
|
+
g._next = null, g._prev = null;
|
|
21177
|
+
}), graphic.update(), children.forEach(g => {
|
|
21178
|
+
graphic.add(g);
|
|
21179
|
+
});
|
|
21180
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21181
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21182
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21183
|
+
}
|
|
21184
|
+
initCanvasCtx(context) {
|
|
21185
|
+
context.setTransformForCurrent();
|
|
21186
|
+
}
|
|
21187
|
+
}
|
|
21188
|
+
|
|
21189
|
+
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21190
|
+
var d,
|
|
21191
|
+
c = arguments.length,
|
|
21192
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21193
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21194
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21195
|
+
},
|
|
21196
|
+
__metadata$U = undefined && undefined.__metadata || function (k, v) {
|
|
21197
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
20973
21198
|
},
|
|
20974
21199
|
__param$z = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
20975
21200
|
return function (target, key) {
|
|
@@ -21008,7 +21233,7 @@
|
|
|
21008
21233
|
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
|
|
21009
21234
|
}
|
|
21010
21235
|
};
|
|
21011
|
-
DefaultRenderService = __decorate$
|
|
21236
|
+
DefaultRenderService = __decorate$1c([injectable(), __param$z(0, inject(DrawContribution)), __metadata$U("design:paramtypes", [Object])], DefaultRenderService);
|
|
21012
21237
|
|
|
21013
21238
|
var renderModule$1 = new ContainerModule(bind => {
|
|
21014
21239
|
bind(RenderService).to(DefaultRenderService).inSingletonScope();
|
|
@@ -21017,7 +21242,7 @@
|
|
|
21017
21242
|
const PickerService = Symbol.for("PickerService");
|
|
21018
21243
|
const GlobalPickerService = Symbol.for("GlobalPickerService");
|
|
21019
21244
|
|
|
21020
|
-
var __decorate$
|
|
21245
|
+
var __decorate$1b = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21021
21246
|
var d,
|
|
21022
21247
|
c = arguments.length,
|
|
21023
21248
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -21050,7 +21275,7 @@
|
|
|
21050
21275
|
return context.highPerformanceRestore(), result;
|
|
21051
21276
|
}
|
|
21052
21277
|
};
|
|
21053
|
-
ShadowRootPickItemInterceptorContribution = __decorate$
|
|
21278
|
+
ShadowRootPickItemInterceptorContribution = __decorate$1b([injectable()], ShadowRootPickItemInterceptorContribution);
|
|
21054
21279
|
let InteractivePickItemInterceptorContribution = class {
|
|
21055
21280
|
constructor() {
|
|
21056
21281
|
this.order = 1;
|
|
@@ -21069,7 +21294,7 @@
|
|
|
21069
21294
|
return null;
|
|
21070
21295
|
}
|
|
21071
21296
|
};
|
|
21072
|
-
InteractivePickItemInterceptorContribution = __decorate$
|
|
21297
|
+
InteractivePickItemInterceptorContribution = __decorate$1b([injectable()], InteractivePickItemInterceptorContribution);
|
|
21073
21298
|
let Canvas3DPickItemInterceptor = class {
|
|
21074
21299
|
constructor() {
|
|
21075
21300
|
this.order = 1;
|
|
@@ -21129,7 +21354,7 @@
|
|
|
21129
21354
|
context.setTransformForCurrent();
|
|
21130
21355
|
}
|
|
21131
21356
|
};
|
|
21132
|
-
Canvas3DPickItemInterceptor = __decorate$
|
|
21357
|
+
Canvas3DPickItemInterceptor = __decorate$1b([injectable()], Canvas3DPickItemInterceptor);
|
|
21133
21358
|
|
|
21134
21359
|
var pickModule = new ContainerModule((bind, unbind, isBound) => {
|
|
21135
21360
|
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor), bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution), bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
@@ -21142,14 +21367,14 @@
|
|
|
21142
21367
|
const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
|
|
21143
21368
|
const PluginService = Symbol.for("PluginService");
|
|
21144
21369
|
|
|
21145
|
-
var __decorate$
|
|
21370
|
+
var __decorate$1a = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21146
21371
|
var d,
|
|
21147
21372
|
c = arguments.length,
|
|
21148
21373
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21149
21374
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21150
21375
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21151
21376
|
},
|
|
21152
|
-
__metadata$
|
|
21377
|
+
__metadata$T = undefined && undefined.__metadata || function (k, v) {
|
|
21153
21378
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21154
21379
|
},
|
|
21155
21380
|
__param$y = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
@@ -21192,7 +21417,7 @@
|
|
|
21192
21417
|
}), this.onRegisterPlugin = [];
|
|
21193
21418
|
}
|
|
21194
21419
|
};
|
|
21195
|
-
DefaultPluginService = __decorate$
|
|
21420
|
+
DefaultPluginService = __decorate$1a([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(AutoEnablePlugins)), __metadata$T("design:paramtypes", [Object])], DefaultPluginService);
|
|
21196
21421
|
|
|
21197
21422
|
var pluginModule = new ContainerModule(bind => {
|
|
21198
21423
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -21206,14 +21431,14 @@
|
|
|
21206
21431
|
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21207
21432
|
});
|
|
21208
21433
|
|
|
21209
|
-
var __decorate$
|
|
21434
|
+
var __decorate$19 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21210
21435
|
var d,
|
|
21211
21436
|
c = arguments.length,
|
|
21212
21437
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21213
21438
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21214
21439
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21215
21440
|
},
|
|
21216
|
-
__metadata$
|
|
21441
|
+
__metadata$S = undefined && undefined.__metadata || function (k, v) {
|
|
21217
21442
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21218
21443
|
};
|
|
21219
21444
|
let CanvasLayerHandlerContribution = class {
|
|
@@ -21283,16 +21508,16 @@
|
|
|
21283
21508
|
this.canvas.release();
|
|
21284
21509
|
}
|
|
21285
21510
|
};
|
|
21286
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21511
|
+
CanvasLayerHandlerContribution = __decorate$19([injectable(), __metadata$S("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21287
21512
|
|
|
21288
|
-
var __decorate$
|
|
21513
|
+
var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21289
21514
|
var d,
|
|
21290
21515
|
c = arguments.length,
|
|
21291
21516
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21292
21517
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21293
21518
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21294
21519
|
},
|
|
21295
|
-
__metadata$
|
|
21520
|
+
__metadata$R = undefined && undefined.__metadata || function (k, v) {
|
|
21296
21521
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21297
21522
|
};
|
|
21298
21523
|
let EmptyLayerHandlerContribution = class {
|
|
@@ -21327,16 +21552,16 @@
|
|
|
21327
21552
|
}
|
|
21328
21553
|
release() {}
|
|
21329
21554
|
};
|
|
21330
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
21555
|
+
EmptyLayerHandlerContribution = __decorate$18([injectable(), __metadata$R("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21331
21556
|
|
|
21332
|
-
var __decorate$
|
|
21557
|
+
var __decorate$17 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21333
21558
|
var d,
|
|
21334
21559
|
c = arguments.length,
|
|
21335
21560
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21336
21561
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21337
21562
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21338
21563
|
},
|
|
21339
|
-
__metadata$
|
|
21564
|
+
__metadata$Q = undefined && undefined.__metadata || function (k, v) {
|
|
21340
21565
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21341
21566
|
};
|
|
21342
21567
|
let OffscreenLayerHandlerContribution = class {
|
|
@@ -21398,7 +21623,7 @@
|
|
|
21398
21623
|
}
|
|
21399
21624
|
merge(layerHandlers) {}
|
|
21400
21625
|
};
|
|
21401
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
21626
|
+
OffscreenLayerHandlerContribution = __decorate$17([injectable(), __metadata$Q("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21402
21627
|
|
|
21403
21628
|
var layerHandlerModules = new ContainerModule(bind => {
|
|
21404
21629
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21514,197 +21739,6 @@
|
|
|
21514
21739
|
return result;
|
|
21515
21740
|
}
|
|
21516
21741
|
|
|
21517
|
-
var __decorate$17 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21518
|
-
var d,
|
|
21519
|
-
c = arguments.length,
|
|
21520
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21521
|
-
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
21522
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21523
|
-
},
|
|
21524
|
-
__metadata$Q = undefined && undefined.__metadata || function (k, v) {
|
|
21525
|
-
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21526
|
-
};
|
|
21527
|
-
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
21528
|
-
const tempDirtyBounds = new AABBBounds();
|
|
21529
|
-
class ShadowRootDrawItemInterceptorContribution {
|
|
21530
|
-
constructor() {
|
|
21531
|
-
this.order = 1;
|
|
21532
|
-
}
|
|
21533
|
-
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21534
|
-
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21535
|
-
}
|
|
21536
|
-
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21537
|
-
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21538
|
-
}
|
|
21539
|
-
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21540
|
-
if (!graphic.shadowRoot) return !1;
|
|
21541
|
-
const {
|
|
21542
|
-
context: context
|
|
21543
|
-
} = drawContext;
|
|
21544
|
-
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21545
|
-
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21546
|
-
const m = graphic.globalTransMatrix.getInverse();
|
|
21547
|
-
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21548
|
-
}
|
|
21549
|
-
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21550
|
-
}
|
|
21551
|
-
}
|
|
21552
|
-
class DebugDrawItemInterceptorContribution {
|
|
21553
|
-
constructor() {
|
|
21554
|
-
this.order = 1;
|
|
21555
|
-
}
|
|
21556
|
-
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21557
|
-
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21558
|
-
}
|
|
21559
|
-
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21560
|
-
if (!graphic.attribute._debug_bounds) return !1;
|
|
21561
|
-
const {
|
|
21562
|
-
context: context
|
|
21563
|
-
} = drawContext;
|
|
21564
|
-
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21565
|
-
const b = graphic.AABBBounds;
|
|
21566
|
-
return !0 !== graphic.attribute._debug_bounds && graphic.attribute._debug_bounds(context, graphic), context.strokeRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore(), !0;
|
|
21567
|
-
}
|
|
21568
|
-
}
|
|
21569
|
-
let CommonDrawItemInterceptorContribution = class {
|
|
21570
|
-
constructor() {
|
|
21571
|
-
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21572
|
-
}
|
|
21573
|
-
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21574
|
-
for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21575
|
-
return !1;
|
|
21576
|
-
}
|
|
21577
|
-
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21578
|
-
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21579
|
-
for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].beforeDrawItem && this.interceptors[i].beforeDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
|
|
21580
|
-
return !1;
|
|
21581
|
-
}
|
|
21582
|
-
};
|
|
21583
|
-
CommonDrawItemInterceptorContribution = __decorate$17([injectable(), __metadata$Q("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
21584
|
-
class InteractiveDrawItemInterceptorContribution {
|
|
21585
|
-
constructor() {
|
|
21586
|
-
this.order = 1;
|
|
21587
|
-
}
|
|
21588
|
-
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21589
|
-
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21590
|
-
}
|
|
21591
|
-
beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21592
|
-
let interactiveGraphic = graphic.interactiveGraphic;
|
|
21593
|
-
if (graphic.attribute.globalZIndex) {
|
|
21594
|
-
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21595
|
-
globalZIndex: 0,
|
|
21596
|
-
zIndex: graphic.attribute.globalZIndex
|
|
21597
|
-
}, !1, {
|
|
21598
|
-
skipUpdateCallback: !0
|
|
21599
|
-
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21600
|
-
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21601
|
-
if (interactiveLayer) {
|
|
21602
|
-
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21603
|
-
}
|
|
21604
|
-
return !0;
|
|
21605
|
-
}
|
|
21606
|
-
if (interactiveGraphic) {
|
|
21607
|
-
drawContext.stage.tryInitInteractiveLayer();
|
|
21608
|
-
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21609
|
-
if (interactiveLayer) {
|
|
21610
|
-
this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
|
|
21611
|
-
}
|
|
21612
|
-
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21613
|
-
}
|
|
21614
|
-
return !1;
|
|
21615
|
-
}
|
|
21616
|
-
beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21617
|
-
const baseGraphic = graphic.baseGraphic;
|
|
21618
|
-
if (baseGraphic) {
|
|
21619
|
-
this.processing = !0;
|
|
21620
|
-
const {
|
|
21621
|
-
context: context
|
|
21622
|
-
} = drawContext;
|
|
21623
|
-
return context.highPerformanceSave(), context.setTransformFromMatrix(baseGraphic.parent.globalTransMatrix, !0), baseGraphic.isContainer ? drawContribution.renderGroup(baseGraphic, drawContext, baseGraphic.parent.globalTransMatrix) : drawContribution.renderItem(baseGraphic, drawContext), context.highPerformanceRestore(), this.processing = !1, !0;
|
|
21624
|
-
}
|
|
21625
|
-
return !1;
|
|
21626
|
-
}
|
|
21627
|
-
getShadowRoot(interactiveLayer) {
|
|
21628
|
-
var _a;
|
|
21629
|
-
let group = interactiveLayer.getElementById("_interactive_group");
|
|
21630
|
-
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21631
|
-
}
|
|
21632
|
-
}
|
|
21633
|
-
class Canvas3DDrawItemInterceptor {
|
|
21634
|
-
constructor() {
|
|
21635
|
-
this.order = 1;
|
|
21636
|
-
}
|
|
21637
|
-
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21638
|
-
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21639
|
-
drawContext.in3dInterceptor = !0;
|
|
21640
|
-
const {
|
|
21641
|
-
context: context,
|
|
21642
|
-
stage: stage
|
|
21643
|
-
} = renderService.drawParams;
|
|
21644
|
-
context.canvas;
|
|
21645
|
-
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21646
|
-
const m = context.currentMatrix;
|
|
21647
|
-
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21648
|
-
const matrix = mat4Allocate.allocate();
|
|
21649
|
-
mat3Tomat4(matrix, m);
|
|
21650
|
-
const lastModelMatrix = context.modelMatrix;
|
|
21651
|
-
if (lastModelMatrix) {
|
|
21652
|
-
if (matrix) {
|
|
21653
|
-
const m = mat4Allocate.allocate();
|
|
21654
|
-
context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
|
|
21655
|
-
}
|
|
21656
|
-
} else context.modelMatrix = matrix;
|
|
21657
|
-
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21658
|
-
let isPie = !1,
|
|
21659
|
-
is3d = !1;
|
|
21660
|
-
if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
|
|
21661
|
-
const children = graphic.getChildren(),
|
|
21662
|
-
sortedChildren = [...children];
|
|
21663
|
-
sortedChildren.sort((a, b) => {
|
|
21664
|
-
var _a, _b, _c, _d;
|
|
21665
|
-
let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21666
|
-
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21667
|
-
for (; angle1 < 0;) angle1 += pi2;
|
|
21668
|
-
for (; angle2 < 0;) angle2 += pi2;
|
|
21669
|
-
return angle2 - angle1;
|
|
21670
|
-
}), sortedChildren.forEach(c => {
|
|
21671
|
-
c._next = null, c._prev = null;
|
|
21672
|
-
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
|
|
21673
|
-
graphic.appendChild(c);
|
|
21674
|
-
});
|
|
21675
|
-
const m = graphic.parent.globalTransMatrix;
|
|
21676
|
-
drawContext.hack_pieFace = "outside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "inside", drawContribution.renderGroup(graphic, drawContext, m), drawContext.hack_pieFace = "top", drawContribution.renderGroup(graphic, drawContext, m), graphic.removeAllChild(), children.forEach(c => {
|
|
21677
|
-
c._next = null, c._prev = null;
|
|
21678
|
-
}), children.forEach(c => {
|
|
21679
|
-
graphic.appendChild(c);
|
|
21680
|
-
});
|
|
21681
|
-
} else if (is3d) {
|
|
21682
|
-
const children = graphic.getChildren(),
|
|
21683
|
-
zChildren = children.map(g => ({
|
|
21684
|
-
ave_z: g.findFace().vertices.map(v => {
|
|
21685
|
-
var _a;
|
|
21686
|
-
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21687
|
-
}).reduce((a, b) => a + b, 0),
|
|
21688
|
-
g: g
|
|
21689
|
-
}));
|
|
21690
|
-
zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
|
|
21691
|
-
i.g._next = null, i.g._prev = null;
|
|
21692
|
-
}), graphic.update(), zChildren.forEach(i => {
|
|
21693
|
-
graphic.add(i.g);
|
|
21694
|
-
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
|
|
21695
|
-
g._next = null, g._prev = null;
|
|
21696
|
-
}), graphic.update(), children.forEach(g => {
|
|
21697
|
-
graphic.add(g);
|
|
21698
|
-
});
|
|
21699
|
-
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21700
|
-
} else drawContribution.renderItem(graphic, drawContext);
|
|
21701
|
-
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21702
|
-
}
|
|
21703
|
-
initCanvasCtx(context) {
|
|
21704
|
-
context.setTransformForCurrent();
|
|
21705
|
-
}
|
|
21706
|
-
}
|
|
21707
|
-
|
|
21708
21742
|
var __decorate$16 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21709
21743
|
var d,
|
|
21710
21744
|
c = arguments.length,
|
|
@@ -21746,20 +21780,26 @@
|
|
|
21746
21780
|
height: height
|
|
21747
21781
|
} = drawContext;
|
|
21748
21782
|
if (!context) return;
|
|
21783
|
+
if (drawContext.keepMatrix) {
|
|
21784
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
21785
|
+
const t = context.nativeContext.getTransform();
|
|
21786
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
21787
|
+
}
|
|
21788
|
+
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
21749
21789
|
const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
21750
21790
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
21751
21791
|
const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
21752
21792
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
21753
21793
|
}
|
|
21754
21794
|
const d = context.dpr % 1;
|
|
21755
|
-
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds)
|
|
21795
|
+
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds);
|
|
21756
21796
|
const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
21757
21797
|
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
21758
21798
|
var _a, _b;
|
|
21759
21799
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
21760
21800
|
}).forEach(group => {
|
|
21761
21801
|
group.isContainer ? this.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
|
|
21762
|
-
}), context.restore(), context.restore(), context.draw(), context.inuse = !1;
|
|
21802
|
+
}), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
|
|
21763
21803
|
}
|
|
21764
21804
|
doRegister() {
|
|
21765
21805
|
throw new Error("暂不支持");
|
|
@@ -21840,7 +21880,7 @@
|
|
|
21840
21880
|
}
|
|
21841
21881
|
getRenderContribution(graphic) {
|
|
21842
21882
|
let renderer;
|
|
21843
|
-
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
21883
|
+
return renderer || (renderer = this.selectRenderByNumberType(graphic.numberType, graphic)), renderer || (renderer = this.selectRenderByType(graphic.type)), renderer;
|
|
21844
21884
|
}
|
|
21845
21885
|
renderItem(graphic, drawContext, params) {
|
|
21846
21886
|
if (this.InterceptorContributions.length) for (let i = 0; i < this.InterceptorContributions.length; i++) {
|
|
@@ -21872,8 +21912,13 @@
|
|
|
21872
21912
|
selectRenderByType(type) {
|
|
21873
21913
|
return Logger.getInstance().warn("未知错误,不应该走到这里"), null;
|
|
21874
21914
|
}
|
|
21875
|
-
selectRenderByNumberType(type) {
|
|
21876
|
-
|
|
21915
|
+
selectRenderByNumberType(type, graphic) {
|
|
21916
|
+
let data;
|
|
21917
|
+
if (graphic.attribute.renderStyle) {
|
|
21918
|
+
const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);
|
|
21919
|
+
data = currentRenderMap && currentRenderMap.get(type);
|
|
21920
|
+
}
|
|
21921
|
+
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
21877
21922
|
}
|
|
21878
21923
|
clearScreen(renderService, context, drawContext) {
|
|
21879
21924
|
var _a, _b;
|
|
@@ -22160,14 +22205,22 @@
|
|
|
22160
22205
|
x = 0,
|
|
22161
22206
|
y = 0
|
|
22162
22207
|
} = drawContext;
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22208
|
+
if (context) {
|
|
22209
|
+
if (drawContext.keepMatrix) {
|
|
22210
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
22211
|
+
const t = context.nativeContext.getTransform();
|
|
22212
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
22213
|
+
}
|
|
22214
|
+
} else context.inuse = !0, context.clearMatrix();
|
|
22215
|
+
context.setTransformForCurrent(!0), context.save(), drawContext.restartIncremental && this.clearScreen(this.currentRenderService, context, drawContext), context.translate(x, y, !0), context.save(), renderService.renderTreeRoots.sort((a, b) => {
|
|
22216
|
+
var _a, _b;
|
|
22217
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22218
|
+
}).forEach(group => {
|
|
22219
|
+
this.renderGroup(group, drawContext);
|
|
22220
|
+
}), this.hooks.completeDraw.tap("top-draw", () => {
|
|
22221
|
+
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
|
|
22222
|
+
});
|
|
22223
|
+
}
|
|
22171
22224
|
});
|
|
22172
22225
|
}
|
|
22173
22226
|
_increaseRender(group, drawContext) {
|
|
@@ -22360,6 +22413,8 @@
|
|
|
22360
22413
|
activate(context) {
|
|
22361
22414
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
|
|
22362
22415
|
stage && stage === this.pluginService.stage && this.drawHTML(context.stage.renderService);
|
|
22416
|
+
}), application.graphicService.hooks.onRemove.tap(this.key, graphic => {
|
|
22417
|
+
this.removeDom(graphic);
|
|
22363
22418
|
}), application.graphicService.hooks.onRelease.tap(this.key, graphic => {
|
|
22364
22419
|
this.removeDom(graphic);
|
|
22365
22420
|
});
|
|
@@ -22404,28 +22459,29 @@
|
|
|
22404
22459
|
} = html;
|
|
22405
22460
|
graphic.bindDom || (graphic.bindDom = new Map());
|
|
22406
22461
|
const lastDom = graphic.bindDom.get(dom);
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22462
|
+
let wrapGroup, nativeContainer;
|
|
22463
|
+
if (!lastDom || container && container !== lastDom.container) {
|
|
22464
|
+
let nativeDom;
|
|
22465
|
+
graphic.bindDom.forEach(_ref => {
|
|
22466
|
+
let {
|
|
22467
|
+
wrapGroup: wrapGroup
|
|
22468
|
+
} = _ref;
|
|
22469
|
+
application.global.removeDom(wrapGroup);
|
|
22470
|
+
}), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
|
|
22471
|
+
const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
22472
|
+
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
|
|
22473
|
+
tagName: "div",
|
|
22474
|
+
width: width,
|
|
22475
|
+
height: height,
|
|
22476
|
+
style: style,
|
|
22477
|
+
parent: nativeContainer
|
|
22478
|
+
}), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
22479
|
+
dom: nativeDom,
|
|
22480
|
+
container: container,
|
|
22411
22481
|
wrapGroup: wrapGroup
|
|
22412
|
-
}
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
22416
|
-
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer();
|
|
22417
|
-
const wrapGroup = application.global.createDom({
|
|
22418
|
-
tagName: "div",
|
|
22419
|
-
width: width,
|
|
22420
|
-
height: height,
|
|
22421
|
-
style: style,
|
|
22422
|
-
parent: nativeContainer
|
|
22423
|
-
});
|
|
22424
|
-
wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
22425
|
-
dom: nativeDom,
|
|
22426
|
-
container: container,
|
|
22427
|
-
wrapGroup: wrapGroup
|
|
22428
|
-
})), wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
22482
|
+
}));
|
|
22483
|
+
} else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
|
|
22484
|
+
wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
22429
22485
|
let left = 0,
|
|
22430
22486
|
top = 0;
|
|
22431
22487
|
const b = graphic.globalAABBBounds;
|
|
@@ -22468,34 +22524,48 @@
|
|
|
22468
22524
|
constructor() {
|
|
22469
22525
|
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
22470
22526
|
}
|
|
22527
|
+
pauseLayout(p) {
|
|
22528
|
+
this.pause = p;
|
|
22529
|
+
}
|
|
22530
|
+
tryLayoutChildren(graphic) {
|
|
22531
|
+
graphic.firstChild && this.tryLayout(graphic.firstChild);
|
|
22532
|
+
}
|
|
22471
22533
|
tryLayout(graphic) {
|
|
22472
|
-
|
|
22473
|
-
this.
|
|
22534
|
+
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
22535
|
+
if (this.pause) return;
|
|
22474
22536
|
const p = graphic.parent;
|
|
22475
|
-
if (!
|
|
22537
|
+
if (!(force || p && graphic.needUpdateLayout())) return;
|
|
22476
22538
|
const theme = getTheme$1(p).group,
|
|
22477
22539
|
{
|
|
22478
22540
|
display = theme.display
|
|
22479
22541
|
} = p.attribute;
|
|
22480
22542
|
if ("flex" !== display) return;
|
|
22481
22543
|
const {
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22544
|
+
flexDirection = theme.flexDirection,
|
|
22545
|
+
flexWrap = theme.flexWrap,
|
|
22546
|
+
alignItems = theme.alignItems,
|
|
22547
|
+
clip = theme.clip
|
|
22548
|
+
} = p.attribute,
|
|
22549
|
+
{
|
|
22550
|
+
alignContent = null != alignItems ? alignItems : theme.alignContent
|
|
22551
|
+
} = p.attribute;
|
|
22552
|
+
let {
|
|
22553
|
+
width: width,
|
|
22554
|
+
height: height,
|
|
22555
|
+
justifyContent = theme.justifyContent
|
|
22488
22556
|
} = p.attribute;
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22557
|
+
const children = p.getChildren();
|
|
22558
|
+
if (null == width || null == height) {
|
|
22559
|
+
let childrenWidth = 0,
|
|
22560
|
+
childrenHeight = 0,
|
|
22561
|
+
boundsLegal = 0;
|
|
22562
|
+
if (children.forEach(child => {
|
|
22563
|
+
const bounds = this.getAABBBounds(child);
|
|
22564
|
+
bounds.empty() || ("column" === flexDirection || "column-reverse" === flexDirection ? (childrenHeight += bounds.height(), childrenWidth = Math.max(childrenWidth, bounds.width())) : (childrenWidth += bounds.width(), childrenHeight = Math.max(childrenHeight, bounds.height())), boundsLegal += bounds.x1, boundsLegal += bounds.y1, boundsLegal += bounds.x2, boundsLegal += bounds.y2);
|
|
22565
|
+
}), !isFinite(boundsLegal)) return;
|
|
22566
|
+
width = childrenWidth, height = childrenHeight;
|
|
22567
|
+
}
|
|
22568
|
+
p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
|
|
22499
22569
|
const result = {
|
|
22500
22570
|
main: {
|
|
22501
22571
|
len: width,
|
|
@@ -22504,18 +22574,18 @@
|
|
|
22504
22574
|
cross: {
|
|
22505
22575
|
len: height,
|
|
22506
22576
|
field: "y"
|
|
22507
|
-
}
|
|
22508
|
-
dir: 1
|
|
22577
|
+
}
|
|
22509
22578
|
},
|
|
22510
22579
|
main = result.main,
|
|
22511
22580
|
cross = result.cross;
|
|
22512
|
-
"
|
|
22581
|
+
"column" !== flexDirection && "column-reverse" !== flexDirection || (main.len = height, cross.len = width, main.field = "y", cross.field = "x"), "row-reverse" !== flexDirection && "column-reverse" !== flexDirection || ("flex-start" === justifyContent ? justifyContent = "flex-end" : "flex-end" === justifyContent ? justifyContent = "flex-start" : children.reverse());
|
|
22513
22582
|
let mainLen = 0,
|
|
22514
22583
|
crossLen = 0;
|
|
22515
22584
|
const mianLenArray = [];
|
|
22516
|
-
|
|
22517
|
-
const b = c
|
|
22518
|
-
|
|
22585
|
+
children.forEach(c => {
|
|
22586
|
+
const b = this.getAABBBounds(c);
|
|
22587
|
+
if (b.empty()) return;
|
|
22588
|
+
const ml = "x" === main.field ? b.width() : b.height(),
|
|
22519
22589
|
cl = "x" === cross.field ? b.width() : b.height();
|
|
22520
22590
|
mianLenArray.push({
|
|
22521
22591
|
mainLen: ml,
|
|
@@ -22550,107 +22620,168 @@
|
|
|
22550
22620
|
mainLen: mainLen,
|
|
22551
22621
|
crossLen: crossLen
|
|
22552
22622
|
});
|
|
22553
|
-
const children = p.getChildren();
|
|
22554
22623
|
let lastIdx = 0;
|
|
22555
22624
|
if (mainList.forEach(s => {
|
|
22556
22625
|
this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
|
|
22557
22626
|
}), crossLen = mainList.reduce((a, b) => a + b.crossLen, 0), 1 === mainList.length) {
|
|
22558
|
-
|
|
22559
|
-
|
|
22560
|
-
|
|
22561
|
-
|
|
22562
|
-
|
|
22563
|
-
|
|
22564
|
-
} else children.forEach(child => {
|
|
22565
|
-
child.attribute[cross.field] = getPadding(child, cross.field);
|
|
22566
|
-
});
|
|
22627
|
+
const anchorPosMap = {
|
|
22628
|
+
"flex-start": 0,
|
|
22629
|
+
"flex-end": cross.len,
|
|
22630
|
+
center: cross.len / 2
|
|
22631
|
+
};
|
|
22632
|
+
this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
|
|
22567
22633
|
} else if ("flex-start" === alignContent) {
|
|
22568
22634
|
lastIdx = 0;
|
|
22569
22635
|
let anchorPos = 0;
|
|
22570
22636
|
mainList.forEach((s, i) => {
|
|
22571
|
-
|
|
22637
|
+
const anchorPosMap = {
|
|
22638
|
+
"flex-start": anchorPos,
|
|
22639
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22640
|
+
center: anchorPos + s.crossLen / 2
|
|
22641
|
+
};
|
|
22642
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
22572
22643
|
});
|
|
22573
22644
|
} else if ("center" === alignContent) {
|
|
22574
22645
|
lastIdx = 0;
|
|
22575
22646
|
let anchorPos = Math.max(0, (cross.len - crossLen) / 2);
|
|
22576
22647
|
mainList.forEach((s, i) => {
|
|
22577
|
-
|
|
22648
|
+
const anchorPosMap = {
|
|
22649
|
+
"flex-start": anchorPos,
|
|
22650
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22651
|
+
center: anchorPos + s.crossLen / 2
|
|
22652
|
+
};
|
|
22653
|
+
this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
22578
22654
|
});
|
|
22579
22655
|
} else if ("space-around" === alignContent) {
|
|
22580
22656
|
lastIdx = 0;
|
|
22581
22657
|
const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
|
|
22582
22658
|
let anchorPos = padding;
|
|
22583
22659
|
mainList.forEach((s, i) => {
|
|
22584
|
-
|
|
22660
|
+
const anchorPosMap = {
|
|
22661
|
+
"flex-start": anchorPos,
|
|
22662
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22663
|
+
center: anchorPos + s.crossLen / 2
|
|
22664
|
+
};
|
|
22665
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
22585
22666
|
});
|
|
22586
22667
|
} else if ("space-between" === alignContent) {
|
|
22587
22668
|
lastIdx = 0;
|
|
22588
22669
|
const padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
|
|
22589
22670
|
let anchorPos = 0;
|
|
22590
22671
|
mainList.forEach((s, i) => {
|
|
22591
|
-
|
|
22672
|
+
const anchorPosMap = {
|
|
22673
|
+
"flex-start": anchorPos,
|
|
22674
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22675
|
+
center: anchorPos + s.crossLen / 2
|
|
22676
|
+
};
|
|
22677
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
22592
22678
|
});
|
|
22593
22679
|
}
|
|
22594
22680
|
children.forEach((child, idx) => {
|
|
22595
22681
|
child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
|
|
22596
|
-
}), p.addUpdateLayoutTag()
|
|
22682
|
+
}), p.addUpdateLayoutTag();
|
|
22683
|
+
const b = this.getAABBBounds(p);
|
|
22684
|
+
clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
|
|
22685
|
+
}
|
|
22686
|
+
getAABBBounds(graphic) {
|
|
22687
|
+
this.skipBoundsTrigger = !0;
|
|
22688
|
+
const b = graphic.AABBBounds;
|
|
22689
|
+
return this.skipBoundsTrigger = !1, b;
|
|
22690
|
+
}
|
|
22691
|
+
updateChildPos(posBaseLeftTop, lastP, lastBP) {
|
|
22692
|
+
return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
|
|
22597
22693
|
}
|
|
22598
22694
|
layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
|
|
22599
22695
|
if ("flex-start" === justifyContent) {
|
|
22600
22696
|
let pos = 0;
|
|
22601
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22697
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22698
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22699
|
+
b = this.getAABBBounds(children[i]);
|
|
22700
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22701
|
+
}
|
|
22602
22702
|
} else if ("flex-end" === justifyContent) {
|
|
22603
22703
|
let pos = main.len;
|
|
22604
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22704
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22705
|
+
pos -= mianLenArray[i].mainLen;
|
|
22706
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22707
|
+
b = this.getAABBBounds(children[i]);
|
|
22708
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`]));
|
|
22709
|
+
}
|
|
22605
22710
|
} else if ("space-around" === justifyContent) {
|
|
22606
22711
|
if (currSeg.mainLen >= main.len) {
|
|
22607
22712
|
let pos = 0;
|
|
22608
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22713
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22714
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22715
|
+
b = this.getAABBBounds(children[i]);
|
|
22716
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22717
|
+
}
|
|
22609
22718
|
} else {
|
|
22610
22719
|
const size = currSeg.idx - lastIdx + 1,
|
|
22611
22720
|
padding = (main.len - currSeg.mainLen) / size / 2;
|
|
22612
22721
|
let pos = padding;
|
|
22613
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22722
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22723
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22724
|
+
b = this.getAABBBounds(children[i]);
|
|
22725
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
|
|
22726
|
+
}
|
|
22614
22727
|
}
|
|
22615
22728
|
} else if ("space-between" === justifyContent) {
|
|
22616
22729
|
if (currSeg.mainLen >= main.len) {
|
|
22617
22730
|
let pos = 0;
|
|
22618
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22731
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22732
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22733
|
+
b = this.getAABBBounds(children[i]);
|
|
22734
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22735
|
+
}
|
|
22619
22736
|
} else {
|
|
22620
22737
|
const size = currSeg.idx - lastIdx + 1,
|
|
22621
22738
|
padding = (main.len - currSeg.mainLen) / (2 * size - 2);
|
|
22622
22739
|
let pos = 0;
|
|
22623
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22740
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22741
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22742
|
+
b = this.getAABBBounds(children[i]);
|
|
22743
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen + 2 * padding;
|
|
22744
|
+
}
|
|
22624
22745
|
}
|
|
22625
22746
|
} else if ("center" === justifyContent) {
|
|
22626
22747
|
let pos = (main.len - currSeg.mainLen) / 2;
|
|
22627
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22748
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22749
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22750
|
+
b = this.getAABBBounds(children[i]);
|
|
22751
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22752
|
+
}
|
|
22628
22753
|
}
|
|
22629
22754
|
}
|
|
22630
|
-
layoutCross(children, alignItem, cross,
|
|
22631
|
-
|
|
22755
|
+
layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
|
|
22756
|
+
var _a;
|
|
22757
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22758
|
+
const child = children[i];
|
|
22759
|
+
let {
|
|
22760
|
+
alignSelf: alignSelf
|
|
22761
|
+
} = child.attribute;
|
|
22762
|
+
alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
|
|
22763
|
+
const b = this.getAABBBounds(child),
|
|
22764
|
+
anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
|
|
22765
|
+
"flex-end" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : "center" === alignSelf ? !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos - lenArray[i].crossLen / 2 + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`])) : !b.empty() && (child.attribute[cross.field] = this.updateChildPos(anchorPos + getPadding(child, cross.field), child.attribute[cross.field], b[`${cross.field}1`]));
|
|
22766
|
+
}
|
|
22632
22767
|
}
|
|
22633
22768
|
activate(context) {
|
|
22634
22769
|
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
|
|
22635
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
22770
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
|
|
22636
22771
|
}), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
22637
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && _tempBounds.copy(bounds);
|
|
22772
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
22638
22773
|
}), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
22639
|
-
stage && stage === this.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) ||
|
|
22774
|
+
stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
|
|
22640
22775
|
}), application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
22641
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
22776
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
|
|
22642
22777
|
});
|
|
22643
22778
|
}
|
|
22644
22779
|
deactivate(context) {
|
|
22645
|
-
application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
|
|
22780
|
+
application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
|
|
22646
22781
|
}
|
|
22647
22782
|
}
|
|
22648
22783
|
function getPadding(graphic, field) {
|
|
22649
|
-
|
|
22650
|
-
if (isNumber(graphic.attribute.boundsPadding)) return graphic.attribute.boundsPadding;
|
|
22651
|
-
if (isArray$1(graphic.attribute.boundsPadding) && 1 === graphic.attribute.boundsPadding.length) return graphic.attribute.boundsPadding[0];
|
|
22652
|
-
const paddingArray = parsePadding(graphic.attribute.boundsPadding);
|
|
22653
|
-
return "x" === field ? paddingArray[3] : "y" === field ? paddingArray[0] : 0;
|
|
22784
|
+
return 0;
|
|
22654
22785
|
}
|
|
22655
22786
|
|
|
22656
22787
|
const defaultTicker = new DefaultTicker();
|
|
@@ -23064,6 +23195,9 @@
|
|
|
23064
23195
|
this.pluginService.unRegister(plugin);
|
|
23065
23196
|
}));
|
|
23066
23197
|
}
|
|
23198
|
+
getPluginsByName(name) {
|
|
23199
|
+
return this.pluginService.findPluginsByName(name);
|
|
23200
|
+
}
|
|
23067
23201
|
tryUpdateAABBBounds() {
|
|
23068
23202
|
const viewBox = this._viewBox;
|
|
23069
23203
|
return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
|
|
@@ -23097,7 +23231,7 @@
|
|
|
23097
23231
|
render(layers, params) {
|
|
23098
23232
|
this.ticker.start(), this.timeline.resume();
|
|
23099
23233
|
const state = this.state;
|
|
23100
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
23234
|
+
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this.renderLayerList(this.children, params), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
23101
23235
|
}
|
|
23102
23236
|
combineLayersToWindow() {}
|
|
23103
23237
|
renderNextFrame(layers, force) {
|
|
@@ -23124,7 +23258,8 @@
|
|
|
23124
23258
|
background: layer === this.defaultLayer ? this.background : void 0,
|
|
23125
23259
|
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
23126
23260
|
}, Object.assign({
|
|
23127
|
-
renderStyle: this.renderStyle
|
|
23261
|
+
renderStyle: this.renderStyle,
|
|
23262
|
+
keepMatrix: this.params.renderKeepMatrix
|
|
23128
23263
|
}, params)));
|
|
23129
23264
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
23130
23265
|
renderService: this.renderService,
|
|
@@ -23723,11 +23858,17 @@
|
|
|
23723
23858
|
if (!params.bounds.contains(point.x, point.y)) return result;
|
|
23724
23859
|
offsetX = params.bounds.x1, offsetY = params.bounds.y1;
|
|
23725
23860
|
}
|
|
23726
|
-
|
|
23861
|
+
if (this.pickContext) if (params.keepMatrix) {
|
|
23862
|
+
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
23863
|
+
const t = this.pickContext.nativeContext.getTransform();
|
|
23864
|
+
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
23865
|
+
}
|
|
23866
|
+
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
23867
|
+
params.pickContext = this.pickContext;
|
|
23727
23868
|
const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
23728
23869
|
let group;
|
|
23729
23870
|
for (let i = graphics.length - 1; i >= 0 && (result = graphics[i].isContainer ? this.pickGroup(graphics[i], point, parentMatrix, params) : this.pickItem(graphics[i], point, parentMatrix, params), !result.graphic); i--) group || (group = result.group);
|
|
23730
|
-
if (result.graphic || (result.group = group), this.pickContext && (this.pickContext.inuse = !1), result.graphic) {
|
|
23871
|
+
if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
|
|
23731
23872
|
let g = result.graphic;
|
|
23732
23873
|
for (; g.parent;) g = g.parent;
|
|
23733
23874
|
g.shadowHost && (result.params = {
|
|
@@ -24439,7 +24580,7 @@
|
|
|
24439
24580
|
if (v === null || v === undefined || v === '') {
|
|
24440
24581
|
return false;
|
|
24441
24582
|
}
|
|
24442
|
-
if (isNumber$
|
|
24583
|
+
if (isNumber$1(v)) {
|
|
24443
24584
|
return true;
|
|
24444
24585
|
}
|
|
24445
24586
|
return +v === +v;
|
|
@@ -24532,7 +24673,7 @@
|
|
|
24532
24673
|
const n = array.length;
|
|
24533
24674
|
for (let i = 0; i < n; i += 1) {
|
|
24534
24675
|
let value = valueGetter(array[i]);
|
|
24535
|
-
isNil$1(value) || !isNumber$
|
|
24676
|
+
isNil$1(value) || !isNumber$1(value = +value) || Number.isNaN(value) || (isNil$1(min) ? (min = value, max = value) : (min = Math.min(min, value), max = Math.max(max, value)));
|
|
24536
24677
|
}
|
|
24537
24678
|
return [min, max];
|
|
24538
24679
|
}
|
|
@@ -25017,7 +25158,7 @@
|
|
|
25017
25158
|
return this._isFixed && !!this._bandwidth;
|
|
25018
25159
|
}
|
|
25019
25160
|
_isBandwidthFixedByUser() {
|
|
25020
|
-
return this._isFixed && this._userBandwidth && isNumber$
|
|
25161
|
+
return this._isFixed && this._userBandwidth && isNumber$1(this._userBandwidth);
|
|
25021
25162
|
}
|
|
25022
25163
|
clone() {
|
|
25023
25164
|
var _a, _b, _c;
|
|
@@ -25285,13 +25426,13 @@
|
|
|
25285
25426
|
}
|
|
25286
25427
|
}
|
|
25287
25428
|
function parseNiceOptions(originalDomain, option) {
|
|
25288
|
-
const hasForceMin = isNumber$
|
|
25289
|
-
hasForceMax = isNumber$
|
|
25429
|
+
const hasForceMin = isNumber$1(option.forceMin),
|
|
25430
|
+
hasForceMax = isNumber$1(option.forceMax);
|
|
25290
25431
|
let niceType = null;
|
|
25291
25432
|
const niceMinMax = [];
|
|
25292
25433
|
let niceDomain = null;
|
|
25293
25434
|
const domainValidator = hasForceMin && hasForceMax ? x => x >= option.forceMin && x <= option.forceMax : hasForceMin ? x => x >= option.forceMin : hasForceMax ? x => x <= option.forceMax : null;
|
|
25294
|
-
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$
|
|
25435
|
+
return hasForceMin ? niceMinMax[0] = option.forceMin : isNumber$1(option.min) && option.min <= Math.min(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[0] = option.min), hasForceMax ? niceMinMax[1] = option.forceMax : isNumber$1(option.max) && option.max >= Math.max(originalDomain[0], originalDomain[originalDomain.length - 1]) && (niceMinMax[1] = option.max), isNumber$1(niceMinMax[0]) && isNumber$1(niceMinMax[1]) ? (niceDomain = originalDomain.slice(), niceDomain[0] = niceMinMax[0], niceDomain[niceDomain.length - 1] = niceMinMax[1]) : niceType = isNumber$1(niceMinMax[0]) || isNumber$1(niceMinMax[1]) ? isNumber$1(niceMinMax[0]) ? "max" : "min" : "all", {
|
|
25295
25436
|
niceType: niceType,
|
|
25296
25437
|
niceDomain: niceDomain,
|
|
25297
25438
|
niceMinMax: niceMinMax,
|
|
@@ -26523,7 +26664,7 @@
|
|
|
26523
26664
|
}] : [];
|
|
26524
26665
|
}
|
|
26525
26666
|
function getLinePoints(items, includeOnePoint, lastPoints, isArea) {
|
|
26526
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26667
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26527
26668
|
return items.some(item => isValidPointsChannel(Object.keys(item.nextAttrs), "line")) ? items.map((item, index) => {
|
|
26528
26669
|
var _a;
|
|
26529
26670
|
const attrs = item.nextAttrs,
|
|
@@ -26539,7 +26680,7 @@
|
|
|
26539
26680
|
}
|
|
26540
26681
|
function getLargeRectsPoints(items, includeOnePoint) {
|
|
26541
26682
|
let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
26542
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26683
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26543
26684
|
const arr = new Float32Array(4 * items.length);
|
|
26544
26685
|
return items.forEach((item, index) => {
|
|
26545
26686
|
var _a, _b, _c, _d;
|
|
@@ -26553,7 +26694,7 @@
|
|
|
26553
26694
|
}
|
|
26554
26695
|
function getLargeSymbolsPoints(items, includeOnePoint) {
|
|
26555
26696
|
let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
26556
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26697
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26557
26698
|
const arr = new Float32Array(2 * items.length);
|
|
26558
26699
|
return items.forEach((item, index) => {
|
|
26559
26700
|
var _a, _b;
|
|
@@ -26594,6 +26735,57 @@
|
|
|
26594
26735
|
return [GrammarMarkType.line, GrammarMarkType.area, GrammarMarkType.largeRects, GrammarMarkType.largeSymbols].includes(markType);
|
|
26595
26736
|
}
|
|
26596
26737
|
|
|
26738
|
+
function invokeEncoderToItems(element, items, encoder, parameters, onlyFullEncodeFirst) {
|
|
26739
|
+
encoder && (isFunctionType(encoder) ? items.forEach(item => {
|
|
26740
|
+
const attributes = invokeFunctionType(encoder, parameters, item.datum, element);
|
|
26741
|
+
Object.assign(item.nextAttrs, attributes);
|
|
26742
|
+
}) : Object.keys(encoder).forEach(channel => {
|
|
26743
|
+
var _a, _b;
|
|
26744
|
+
const encode = encoder[channel],
|
|
26745
|
+
encodeItems = onlyFullEncodeFirst && !isPositionOrSizeChannel(element.mark.markType, channel) ? [items[0]] : items;
|
|
26746
|
+
if (isScaleEncode(encode)) {
|
|
26747
|
+
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26748
|
+
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26749
|
+
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26750
|
+
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26751
|
+
fieldAccessor = hasField ? field$3(encode.field) : null;
|
|
26752
|
+
let to = hasField ? null : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, encode.value);
|
|
26753
|
+
encodeItems.forEach(item => {
|
|
26754
|
+
var _a;
|
|
26755
|
+
hasField && (to = null === (_a = scale.scale) || void 0 === _a ? void 0 : _a.call(scale, fieldAccessor(item.datum))), item.nextAttrs[channel] = isNumber$1(to) || isNumber$1(bandOffset) ? to + offset + bandOffset : to;
|
|
26756
|
+
});
|
|
26757
|
+
} else if (isFieldEncode(encode)) {
|
|
26758
|
+
const fieldAccessor = field$3(encode.field);
|
|
26759
|
+
encodeItems.forEach(item => {
|
|
26760
|
+
item.nextAttrs[channel] = fieldAccessor(item.datum);
|
|
26761
|
+
});
|
|
26762
|
+
} else encodeItems.forEach(item => {
|
|
26763
|
+
item.nextAttrs[channel] = invokeFunctionType(encode, parameters, item.datum, element);
|
|
26764
|
+
});
|
|
26765
|
+
}));
|
|
26766
|
+
}
|
|
26767
|
+
function invokeEncoder(encoder, datum, element, parameters) {
|
|
26768
|
+
if (!encoder) return null;
|
|
26769
|
+
if (isFunctionType(encoder)) return invokeFunctionType(encoder, parameters, datum, element);
|
|
26770
|
+
const attributes = {};
|
|
26771
|
+
return Object.keys(encoder).forEach(channel => {
|
|
26772
|
+
var _a, _b, _c;
|
|
26773
|
+
const encode = encoder[channel];
|
|
26774
|
+
if (isScaleEncode(encode)) {
|
|
26775
|
+
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26776
|
+
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26777
|
+
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26778
|
+
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26779
|
+
fieldAccessor = hasField ? field$3(encode.field) : null,
|
|
26780
|
+
to = hasField ? null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, fieldAccessor(datum)) : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_c = scale.scale) || void 0 === _c ? void 0 : _c.call(scale, encode.value);
|
|
26781
|
+
attributes[channel] = isNumber$1(to) || isNumber$1(bandOffset) ? to + offset + bandOffset : to;
|
|
26782
|
+
} else if (isFieldEncode(encode)) {
|
|
26783
|
+
const fieldAccessor = field$3(encode.field);
|
|
26784
|
+
attributes[channel] = fieldAccessor(datum);
|
|
26785
|
+
} else attributes[channel] = invokeFunctionType(encode, parameters, datum, element);
|
|
26786
|
+
}), attributes;
|
|
26787
|
+
}
|
|
26788
|
+
|
|
26597
26789
|
class GlyphMeta {
|
|
26598
26790
|
constructor(marks, encoders, defaultEncoder, progressiveChannels) {
|
|
26599
26791
|
this.channelEncoder = {}, this.marks = marks, encoders && this.registerChannelEncoder(encoders), defaultEncoder && this.registerDefaultEncoder(defaultEncoder), this.progressiveChannels && this.registerProgressiveChannels(progressiveChannels);
|
|
@@ -26709,83 +26901,6 @@
|
|
|
26709
26901
|
return creator ? creator(attributes) : null;
|
|
26710
26902
|
};
|
|
26711
26903
|
|
|
26712
|
-
function invokeEncoderToItems(element, items, encoder, parameters, onlyFullEncodeFirst) {
|
|
26713
|
-
encoder && (isFunctionType(encoder) ? items.forEach(item => {
|
|
26714
|
-
const attributes = invokeFunctionType(encoder, parameters, item.datum, element);
|
|
26715
|
-
Object.assign(item.nextAttrs, attributes);
|
|
26716
|
-
}) : Object.keys(encoder).forEach(channel => {
|
|
26717
|
-
var _a, _b;
|
|
26718
|
-
const encode = encoder[channel],
|
|
26719
|
-
encodeItems = onlyFullEncodeFirst && !isPositionOrSizeChannel(element.mark.markType, channel) ? [items[0]] : items;
|
|
26720
|
-
if (isScaleEncode(encode)) {
|
|
26721
|
-
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26722
|
-
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26723
|
-
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26724
|
-
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26725
|
-
fieldAccessor = hasField ? field$3(encode.field) : null;
|
|
26726
|
-
let to = hasField ? null : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, encode.value);
|
|
26727
|
-
encodeItems.forEach(item => {
|
|
26728
|
-
var _a;
|
|
26729
|
-
hasField && (to = null === (_a = scale.scale) || void 0 === _a ? void 0 : _a.call(scale, fieldAccessor(item.datum))), item.nextAttrs[channel] = isNumber$2(to) || isNumber$2(bandOffset) ? to + offset + bandOffset : to;
|
|
26730
|
-
});
|
|
26731
|
-
} else if (isFieldEncode(encode)) {
|
|
26732
|
-
const fieldAccessor = field$3(encode.field);
|
|
26733
|
-
encodeItems.forEach(item => {
|
|
26734
|
-
item.nextAttrs[channel] = fieldAccessor(item.datum);
|
|
26735
|
-
});
|
|
26736
|
-
} else encodeItems.forEach(item => {
|
|
26737
|
-
item.nextAttrs[channel] = invokeFunctionType(encode, parameters, item.datum, element);
|
|
26738
|
-
});
|
|
26739
|
-
}));
|
|
26740
|
-
}
|
|
26741
|
-
function invokeEncoder(encoder, datum, element, parameters) {
|
|
26742
|
-
if (!encoder) return null;
|
|
26743
|
-
if (isFunctionType(encoder)) return invokeFunctionType(encoder, parameters, datum, element);
|
|
26744
|
-
const attributes = {};
|
|
26745
|
-
return Object.keys(encoder).forEach(channel => {
|
|
26746
|
-
var _a, _b, _c;
|
|
26747
|
-
const encode = encoder[channel];
|
|
26748
|
-
if (isScaleEncode(encode)) {
|
|
26749
|
-
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26750
|
-
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26751
|
-
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26752
|
-
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26753
|
-
fieldAccessor = hasField ? field$3(encode.field) : null,
|
|
26754
|
-
to = hasField ? null === (_b = scale.scale) || void 0 === _b ? void 0 : _b.call(scale, fieldAccessor(datum)) : isNil$1(null == encode ? void 0 : encode.value) ? 0 : null === (_c = scale.scale) || void 0 === _c ? void 0 : _c.call(scale, encode.value);
|
|
26755
|
-
attributes[channel] = isNumber$2(to) || isNumber$2(bandOffset) ? to + offset + bandOffset : to;
|
|
26756
|
-
} else if (isFieldEncode(encode)) {
|
|
26757
|
-
const fieldAccessor = field$3(encode.field);
|
|
26758
|
-
attributes[channel] = fieldAccessor(datum);
|
|
26759
|
-
} else attributes[channel] = invokeFunctionType(encode, parameters, datum, element);
|
|
26760
|
-
}), attributes;
|
|
26761
|
-
}
|
|
26762
|
-
function splitEncoderInLarge(markType, encoder, glyphType) {
|
|
26763
|
-
if (isFunctionType(encoder)) return {
|
|
26764
|
-
themeEncoder: {},
|
|
26765
|
-
positionEncoder: encoder
|
|
26766
|
-
};
|
|
26767
|
-
const themeEncoder = {},
|
|
26768
|
-
positionEncoder = {};
|
|
26769
|
-
if (markType === GrammarMarkType.glyph && Factory$1.getGlyph(glyphType)) {
|
|
26770
|
-
const glyphMeta = Factory$1.getGlyph(glyphType),
|
|
26771
|
-
progressiveChannels = glyphMeta.getProgressiveChannels();
|
|
26772
|
-
if (progressiveChannels) Object.keys(encoder).forEach(channel => {
|
|
26773
|
-
progressiveChannels.includes(channel) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
|
|
26774
|
-
});else {
|
|
26775
|
-
const markTypes = Array.from(new Set(Object.values(glyphMeta.getMarks())));
|
|
26776
|
-
Object.keys(encoder).forEach(channel => {
|
|
26777
|
-
markTypes.some(type => isPositionOrSizeChannel(type, channel)) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
|
|
26778
|
-
});
|
|
26779
|
-
}
|
|
26780
|
-
} else Object.keys(encoder).forEach(channel => {
|
|
26781
|
-
isPositionOrSizeChannel(markType, channel) ? positionEncoder[channel] = encoder[channel] : themeEncoder[channel] = encoder[channel];
|
|
26782
|
-
});
|
|
26783
|
-
return {
|
|
26784
|
-
positionEncoder: positionEncoder,
|
|
26785
|
-
themeEncoder: themeEncoder
|
|
26786
|
-
};
|
|
26787
|
-
}
|
|
26788
|
-
|
|
26789
26904
|
const isMarkType = type => !!GrammarMarkType[type];
|
|
26790
26905
|
function createGraphicItem(mark, markType) {
|
|
26791
26906
|
let attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -26841,20 +26956,15 @@
|
|
|
26841
26956
|
storedAttrs: "sizeAttrs"
|
|
26842
26957
|
}],
|
|
26843
26958
|
[GrammarMarkType.text]: [{
|
|
26844
|
-
channels: ["text", "limit", "autoLimit", "maxLineWidth"],
|
|
26959
|
+
channels: ["text", "limit", "autoLimit", "maxLineWidth", "textType"],
|
|
26845
26960
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26846
|
-
var _a, _b
|
|
26961
|
+
var _a, _b;
|
|
26847
26962
|
const limit = null !== (_a = storedAttrs.limit) && void 0 !== _a ? _a : 1 / 0,
|
|
26848
26963
|
autoLimit = null !== (_b = storedAttrs.autoLimit) && void 0 !== _b ? _b : 1 / 0,
|
|
26849
26964
|
maxWidth = Math.min(limit, autoLimit),
|
|
26850
26965
|
isTextConfig = isPlainObject$1(storedAttrs.text) && !isNil$1(storedAttrs.text.text),
|
|
26851
26966
|
text = isTextConfig ? storedAttrs.text.text : storedAttrs.text;
|
|
26852
|
-
graphicAttributes.maxLineWidth = maxWidth === 1 / 0 ? storedAttrs.maxLineWidth : maxWidth, isTextConfig
|
|
26853
|
-
dom: text,
|
|
26854
|
-
width: null !== (_c = nextAttrs.width) && void 0 !== _c ? _c : maxWidth,
|
|
26855
|
-
height: null !== (_d = nextAttrs.height) && void 0 !== _d ? _d : nextAttrs.fontSize,
|
|
26856
|
-
anchorType: "position"
|
|
26857
|
-
}, graphicAttributes.text = "") : "rich" === storedAttrs.text.type ? graphicAttributes.textConfig = text : graphicAttributes.text = text : graphicAttributes.text = text;
|
|
26967
|
+
graphicAttributes.maxLineWidth = maxWidth === 1 / 0 ? storedAttrs.maxLineWidth : maxWidth, (isTextConfig || storedAttrs.textType) && ("rich" === storedAttrs.text.type || "rich" === storedAttrs.textType) ? graphicAttributes.textConfig = text : graphicAttributes.text = text;
|
|
26858
26968
|
},
|
|
26859
26969
|
storedAttrs: "limitAttrs"
|
|
26860
26970
|
}],
|
|
@@ -26878,18 +26988,6 @@
|
|
|
26878
26988
|
nextAttrs.image ? (graphicAttributes.background = nextAttrs.image, graphicAttributes.fill = !1) : storedAttrs.image ? (graphicAttributes.background = storedAttrs.image, graphicAttributes.fill = !1) : (graphicAttributes.fill = storedAttrs.fill, graphicAttributes.background = storedAttrs.background);
|
|
26879
26989
|
},
|
|
26880
26990
|
storedAttrs: "imageAttrs"
|
|
26881
|
-
}],
|
|
26882
|
-
[GrammarMarkType.richtext]: [{
|
|
26883
|
-
channels: ["text", "textConfig"],
|
|
26884
|
-
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
26885
|
-
var _a, _b, _c, _d;
|
|
26886
|
-
graphicAttributes.text = null, "rich" === (null === (_a = nextAttrs.text) || void 0 === _a ? void 0 : _a.type) ? graphicAttributes.textConfig = nextAttrs.text.text : "html" === (null === (_b = nextAttrs.textConfig) || void 0 === _b ? void 0 : _b.type) ? (graphicAttributes.html = {
|
|
26887
|
-
dom: nextAttrs.textConfig.text,
|
|
26888
|
-
width: nextAttrs.width,
|
|
26889
|
-
height: null !== (_c = nextAttrs.height) && void 0 !== _c ? _c : nextAttrs.fontSize,
|
|
26890
|
-
anchorType: "position"
|
|
26891
|
-
}, graphicAttributes.text = "") : "rich" === (null === (_d = nextAttrs.textConfig) || void 0 === _d ? void 0 : _d.type) ? graphicAttributes.textConfig = nextAttrs.textConfig.text : graphicAttributes.textConfig = nextAttrs.textConfig;
|
|
26892
|
-
}
|
|
26893
26991
|
}]
|
|
26894
26992
|
};
|
|
26895
26993
|
function cloneTransformAttributes(markType, attributes) {
|
|
@@ -27032,7 +27130,7 @@
|
|
|
27032
27130
|
}
|
|
27033
27131
|
updateGraphicItem(config) {
|
|
27034
27132
|
if (!this.graphicItem) return;
|
|
27035
|
-
isNil$1(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$1(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
|
|
27133
|
+
isNil$1(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), isNil$1(config.clipPath) || this.graphicItem.setAttribute("path", isArray$1(config.clipPath) ? config.clipPath : config.clipPath([this])), isNil$1(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
|
|
27036
27134
|
const stateAnimation = this.mark.animate.getAnimationConfigs("state");
|
|
27037
27135
|
0 !== stateAnimation.length && (this.graphicItem.stateAnimateConfig = stateAnimation[0].originConfig);
|
|
27038
27136
|
}
|
|
@@ -27411,7 +27509,7 @@
|
|
|
27411
27509
|
handler: this.handleStart
|
|
27412
27510
|
}];
|
|
27413
27511
|
let eventName = triggerOff;
|
|
27414
|
-
return "empty" === triggerOff ? (eventName = trigger, this._resetType = "view") : isString$1(triggerOff) ? triggerOff.includes("view:") ? (eventName = triggerOff.replace("view:", ""), this._resetType = "view") : (eventName = triggerOff, this._resetType = "self") : isNumber$
|
|
27512
|
+
return "empty" === triggerOff ? (eventName = trigger, this._resetType = "view") : isString$1(triggerOff) ? triggerOff.includes("view:") ? (eventName = triggerOff.replace("view:", ""), this._resetType = "view") : (eventName = triggerOff, this._resetType = "self") : isNumber$1(triggerOff) ? (eventName = null, this._resetType = "timeout") : this._resetType = null, eventName && eventName !== trigger && events.push({
|
|
27415
27513
|
type: eventName,
|
|
27416
27514
|
handler: this.handleReset
|
|
27417
27515
|
}), events;
|
|
@@ -30862,7 +30960,7 @@
|
|
|
30862
30960
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30863
30961
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
30864
30962
|
let picked = !0;
|
|
30865
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
30963
|
+
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
30866
30964
|
if (picked) return !0;
|
|
30867
30965
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30868
30966
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -30930,7 +31028,7 @@
|
|
|
30930
31028
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30931
31029
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
30932
31030
|
let picked = !0;
|
|
30933
|
-
if (!onlyTranslate || isNumber$
|
|
31031
|
+
if (!onlyTranslate || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
30934
31032
|
if (picked) return !0;
|
|
30935
31033
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30936
31034
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -32525,6 +32623,14 @@
|
|
|
32525
32623
|
height: bounds.height()
|
|
32526
32624
|
};
|
|
32527
32625
|
}
|
|
32626
|
+
function isRichText(attributes) {
|
|
32627
|
+
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
32628
|
+
return typeKey in attributes && "rich" === attributes[typeKey] || isObject$2(attributes.text) && "rich" === attributes.text.type;
|
|
32629
|
+
}
|
|
32630
|
+
function richTextAttributeTransform(attributes) {
|
|
32631
|
+
var _a, _b;
|
|
32632
|
+
return attributes.width = null !== (_a = attributes.width) && void 0 !== _a ? _a : 0, attributes.height = null !== (_b = attributes.height) && void 0 !== _b ? _b : 0, attributes.maxWidth = attributes.maxLineWidth, attributes.textConfig = attributes.text.text || attributes.text, attributes;
|
|
32633
|
+
}
|
|
32528
32634
|
|
|
32529
32635
|
function loadTagComponent() {
|
|
32530
32636
|
registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
|
|
@@ -32545,7 +32651,7 @@
|
|
|
32545
32651
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
|
|
32546
32652
|
}
|
|
32547
32653
|
render() {
|
|
32548
|
-
var _a, _b
|
|
32654
|
+
var _a, _b;
|
|
32549
32655
|
const {
|
|
32550
32656
|
text = "",
|
|
32551
32657
|
textStyle = {},
|
|
@@ -32577,7 +32683,7 @@
|
|
|
32577
32683
|
shapeStyle = __rest$6(shape, ["visible"]);
|
|
32578
32684
|
if (isBoolean$1(shapeVisible)) {
|
|
32579
32685
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
32580
|
-
maxSize = isNumber$
|
|
32686
|
+
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
32581
32687
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
32582
32688
|
symbolType: "circle",
|
|
32583
32689
|
size: size,
|
|
@@ -32589,39 +32695,15 @@
|
|
|
32589
32695
|
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
32590
32696
|
}
|
|
32591
32697
|
let textShape;
|
|
32592
|
-
|
|
32593
|
-
|
|
32594
|
-
|
|
32595
|
-
|
|
32596
|
-
},
|
|
32597
|
-
|
|
32598
|
-
|
|
32599
|
-
|
|
32600
|
-
height: null !== (_b = textStyle.height) && void 0 !== _b ? _b : 0
|
|
32601
|
-
});
|
|
32602
|
-
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
32603
|
-
const {
|
|
32604
|
-
visible: bgVisible
|
|
32605
|
-
} = panel,
|
|
32606
|
-
backgroundStyle = __rest$6(panel, ["visible"]);
|
|
32607
|
-
if (visible && isBoolean$1(bgVisible)) {
|
|
32608
|
-
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32609
|
-
visible: bgVisible && !!text,
|
|
32610
|
-
x: textShape.AABBBounds.x1,
|
|
32611
|
-
y: textShape.AABBBounds.y1,
|
|
32612
|
-
width: textShape.AABBBounds.width(),
|
|
32613
|
-
height: textShape.AABBBounds.height()
|
|
32614
|
-
}), "rect");
|
|
32615
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
32616
|
-
}
|
|
32617
|
-
} else if ("html" === type) {
|
|
32618
|
-
const richTextAttrs = Object.assign(Object.assign({
|
|
32619
|
-
textConfig: [],
|
|
32698
|
+
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
32699
|
+
if (isRichText({
|
|
32700
|
+
text: text
|
|
32701
|
+
}) || "rich" === type) {
|
|
32702
|
+
const richTextAttrs = Object.assign(Object.assign(Object.assign({}, richTextAttributeTransform(Object.assign({
|
|
32703
|
+
type: type,
|
|
32704
|
+
text: text
|
|
32705
|
+
}, textStyle))), textStyle), {
|
|
32620
32706
|
visible: isValid$1(text) && !1 !== visible,
|
|
32621
|
-
html: Object.assign(Object.assign({
|
|
32622
|
-
dom: text
|
|
32623
|
-
}, DEFAULT_HTML_TEXT_SPEC), textStyle)
|
|
32624
|
-
}, textStyle), {
|
|
32625
32707
|
x: textX,
|
|
32626
32708
|
y: 0
|
|
32627
32709
|
});
|
|
@@ -32642,7 +32724,7 @@
|
|
|
32642
32724
|
}
|
|
32643
32725
|
} else {
|
|
32644
32726
|
const textAttrs = Object.assign(Object.assign({
|
|
32645
|
-
text: text,
|
|
32727
|
+
text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
32646
32728
|
visible: isValid$1(text) && !1 !== visible,
|
|
32647
32729
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
32648
32730
|
}, textStyle), {
|
|
@@ -32650,12 +32732,12 @@
|
|
|
32650
32732
|
y: 0
|
|
32651
32733
|
});
|
|
32652
32734
|
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);
|
|
32653
|
-
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (
|
|
32735
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme().text.fontFamily),
|
|
32654
32736
|
textWidth = textBounds.width,
|
|
32655
32737
|
textHeight = textBounds.height;
|
|
32656
32738
|
tagWidth += textWidth;
|
|
32657
|
-
const size = null !== (
|
|
32658
|
-
maxSize = isNumber$
|
|
32739
|
+
const size = null !== (_b = shape.size) && void 0 !== _b ? _b : 10,
|
|
32740
|
+
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
32659
32741
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
32660
32742
|
const {
|
|
32661
32743
|
textAlign: textAlign,
|
|
@@ -32663,11 +32745,21 @@
|
|
|
32663
32745
|
} = textStyle;
|
|
32664
32746
|
(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])));
|
|
32665
32747
|
let x = 0,
|
|
32666
|
-
y = 0
|
|
32667
|
-
|
|
32668
|
-
|
|
32669
|
-
|
|
32670
|
-
|
|
32748
|
+
y = 0,
|
|
32749
|
+
flag = 0;
|
|
32750
|
+
if ("left" === textAlign || "start" === textAlign ? flag = 1 : "right" === textAlign || "end" === textAlign ? flag = -1 : "center" === textAlign && (flag = 0), flag ? flag < 0 ? (x -= tagWidth, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth), group.setAttribute("x", -parsedPadding[1] - symbolPlaceWidth)) : flag > 0 && group.setAttribute("x", parsedPadding[3]) : (x -= tagWidth / 2, symbol && symbol.setAttribute("x", (symbol.attribute.x || 0) - textWidth / 2), group.setAttribute("x", -symbolPlaceWidth / 2)), textAlwaysCenter && flag) {
|
|
32751
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32752
|
+
tsWidth = textWidth + symbolPlaceWidth,
|
|
32753
|
+
textX = (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2,
|
|
32754
|
+
symbolX = (containerWidth - tsWidth) / 2 + maxSize / 2;
|
|
32755
|
+
textShape.setAttributes({
|
|
32756
|
+
x: textX * flag,
|
|
32757
|
+
textAlign: "center"
|
|
32758
|
+
}), null == symbol || symbol.setAttributes({
|
|
32759
|
+
x: symbolX * flag
|
|
32760
|
+
}), group.setAttribute("x", parsedPadding[2 + flag] * flag);
|
|
32761
|
+
}
|
|
32762
|
+
"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));
|
|
32671
32763
|
const {
|
|
32672
32764
|
visible: bgVisible
|
|
32673
32765
|
} = panel,
|
|
@@ -33927,18 +34019,7 @@
|
|
|
33927
34019
|
state && !isEmpty(state) && (target.states = state);
|
|
33928
34020
|
}
|
|
33929
34021
|
_createLabelText(attributes) {
|
|
33930
|
-
|
|
33931
|
-
if ("rich" === attributes.textType) {
|
|
33932
|
-
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, attributes.maxWidth = attributes.maxLineWidth;
|
|
33933
|
-
return graphicCreator.richtext(attributes);
|
|
33934
|
-
}
|
|
33935
|
-
if ("html" === attributes.textType) {
|
|
33936
|
-
attributes.textConfig = [], attributes.html = Object.assign(Object.assign({
|
|
33937
|
-
dom: attributes.text
|
|
33938
|
-
}, DEFAULT_HTML_TEXT_SPEC), attributes);
|
|
33939
|
-
return graphicCreator.richtext(attributes);
|
|
33940
|
-
}
|
|
33941
|
-
return graphicCreator.text(attributes);
|
|
34022
|
+
return isRichText(attributes, "textType") ? graphicCreator.richtext(richTextAttributeTransform(attributes)) : graphicCreator.text(attributes);
|
|
33942
34023
|
}
|
|
33943
34024
|
_prepare() {
|
|
33944
34025
|
var _a, _b, _c, _d, _e;
|
|
@@ -34009,8 +34090,10 @@
|
|
|
34009
34090
|
const textData = text.attribute,
|
|
34010
34091
|
baseMark = this.getRelatedGraphic(textData);
|
|
34011
34092
|
if (!baseMark) continue;
|
|
34012
|
-
|
|
34013
|
-
|
|
34093
|
+
text.attachedThemeGraphic = this;
|
|
34094
|
+
const textBounds = this.getGraphicBounds(text);
|
|
34095
|
+
text.attachedThemeGraphic = null;
|
|
34096
|
+
const actualPosition = isFunction$1(position) ? position(textData) : position,
|
|
34014
34097
|
graphicBounds = this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition) : this.getGraphicBounds(baseMark, {
|
|
34015
34098
|
x: textData.x,
|
|
34016
34099
|
y: textData.y
|
|
@@ -35174,7 +35257,7 @@
|
|
|
35174
35257
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Segment.defaultAttributes, attributes)), this.name = "segment";
|
|
35175
35258
|
}
|
|
35176
35259
|
render() {
|
|
35177
|
-
this.removeAllChild(), this._reset();
|
|
35260
|
+
this.removeAllChild(!0), this._reset();
|
|
35178
35261
|
const {
|
|
35179
35262
|
startSymbol: startSymbol,
|
|
35180
35263
|
endSymbol: endSymbol,
|
|
@@ -35443,7 +35526,7 @@
|
|
|
35443
35526
|
return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
|
|
35444
35527
|
}
|
|
35445
35528
|
render() {
|
|
35446
|
-
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
35529
|
+
this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
35447
35530
|
x: 0,
|
|
35448
35531
|
y: 0,
|
|
35449
35532
|
pickable: !1
|
|
@@ -35550,12 +35633,10 @@
|
|
|
35550
35633
|
pickable: !1
|
|
35551
35634
|
});
|
|
35552
35635
|
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
35553
|
-
var _a
|
|
35636
|
+
var _a;
|
|
35554
35637
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
35555
35638
|
let text;
|
|
35556
|
-
if (
|
|
35557
|
-
dom: labelStyle.text
|
|
35558
|
-
}, DEFAULT_HTML_TEXT_SPEC), labelStyle), text = graphicCreator.richtext(labelStyle)) : text = graphicCreator.text(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 {
|
|
35639
|
+
if (text = isRichText(labelStyle) ? graphicCreator.richtext(richTextAttributeTransform(labelStyle)) : graphicCreator.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
|
|
35559
35640
|
const labelState = merge$2({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
35560
35641
|
Object.keys(labelState).forEach(key => {
|
|
35561
35642
|
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
@@ -36681,7 +36762,7 @@
|
|
|
36681
36762
|
return this._prevInnerView;
|
|
36682
36763
|
}
|
|
36683
36764
|
render() {
|
|
36684
|
-
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
36765
|
+
this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
36685
36766
|
x: 0,
|
|
36686
36767
|
y: 0,
|
|
36687
36768
|
pickable: !1
|
|
@@ -37894,7 +37975,7 @@
|
|
|
37894
37975
|
var _a;
|
|
37895
37976
|
this.setAttribute("pickable", !1);
|
|
37896
37977
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
37897
|
-
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null, this.removeAllChild());
|
|
37978
|
+
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)) : (this._container = null, this.removeAllChild(!0));
|
|
37898
37979
|
}
|
|
37899
37980
|
}
|
|
37900
37981
|
|
|
@@ -38681,8 +38762,8 @@
|
|
|
38681
38762
|
textAlign: "center",
|
|
38682
38763
|
textBaseline: "middle"
|
|
38683
38764
|
}, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
|
|
38684
|
-
handlerSizeX = isNumber$
|
|
38685
|
-
handlerSizeY = isNumber$
|
|
38765
|
+
handlerSizeX = isNumber$1(handlerSize) ? handlerSize : handlerSize[0],
|
|
38766
|
+
handlerSizeY = isNumber$1(handlerSize) ? handlerSize : handlerSize[1],
|
|
38686
38767
|
text = graphicCreator.text(Object.assign({
|
|
38687
38768
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
38688
38769
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
@@ -38711,7 +38792,7 @@
|
|
|
38711
38792
|
this.attribute.disableTriggerEvent || (this.preHandler && (this.preHandler.addEventListener("pointerenter", this._onHover), this.preHandler.addEventListener("pointerleave", this._onUnHover), this.preHandler.addEventListener("pointerdown", this._onClick)), this.nextHandler && (this.nextHandler.addEventListener("pointerenter", this._onHover), this.nextHandler.addEventListener("pointerleave", this._onUnHover), this.nextHandler.addEventListener("pointerdown", this._onClick)));
|
|
38712
38793
|
}
|
|
38713
38794
|
_reset() {
|
|
38714
|
-
this.removeAllChild(), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
|
|
38795
|
+
this.removeAllChild(!0), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
|
|
38715
38796
|
}
|
|
38716
38797
|
}
|
|
38717
38798
|
Pager.defaultAttributes = {
|
|
@@ -38748,7 +38829,7 @@
|
|
|
38748
38829
|
super(...arguments), this.name = "legend", this._title = null;
|
|
38749
38830
|
}
|
|
38750
38831
|
render() {
|
|
38751
|
-
this.removeAllChild();
|
|
38832
|
+
this.removeAllChild(!0);
|
|
38752
38833
|
const {
|
|
38753
38834
|
interactive = !0,
|
|
38754
38835
|
title: title,
|
|
@@ -39011,7 +39092,8 @@
|
|
|
39011
39092
|
shape.fill && isNil$1(shapeStyle.state[key].fill) && color && (shapeStyle.state[key].fill = color), shape.stroke && isNil$1(shapeStyle.state[key].stroke) && color && (shapeStyle.state[key].stroke = color);
|
|
39012
39093
|
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
39013
39094
|
}
|
|
39014
|
-
let
|
|
39095
|
+
let labelShape,
|
|
39096
|
+
focusSpace = 0;
|
|
39015
39097
|
if (focus) {
|
|
39016
39098
|
const focusSize = get$1(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
|
|
39017
39099
|
focusShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
@@ -39024,29 +39106,32 @@
|
|
|
39024
39106
|
boundsPadding: parsedPadding
|
|
39025
39107
|
})), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
|
|
39026
39108
|
}
|
|
39027
|
-
const
|
|
39028
|
-
|
|
39029
|
-
|
|
39030
|
-
|
|
39031
|
-
|
|
39032
|
-
|
|
39033
|
-
|
|
39034
|
-
|
|
39035
|
-
|
|
39036
|
-
|
|
39109
|
+
const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label,
|
|
39110
|
+
labelAttributes = Object.assign(Object.assign({
|
|
39111
|
+
x: shapeSize / 2 + shapeSpace,
|
|
39112
|
+
y: 0,
|
|
39113
|
+
textAlign: "start",
|
|
39114
|
+
textBaseline: "middle",
|
|
39115
|
+
lineHeight: null === (_b = labelStyle.style) || void 0 === _b ? void 0 : _b.fontSize
|
|
39116
|
+
}, labelStyle.style), {
|
|
39117
|
+
text: text
|
|
39118
|
+
});
|
|
39119
|
+
labelShape = isRichText(labelAttributes) ? graphicCreator.richtext(richTextAttributeTransform(labelAttributes)) : graphicCreator.text(labelAttributes), this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state), labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(labelShape);
|
|
39037
39120
|
const labelSpace = get$1(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
39038
39121
|
if (isValid$1(value)) {
|
|
39039
39122
|
const valueSpace = get$1(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
39040
|
-
|
|
39123
|
+
valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
|
|
39124
|
+
valueAttributes = Object.assign(Object.assign({
|
|
39041
39125
|
x: 0,
|
|
39042
39126
|
y: 0,
|
|
39043
39127
|
textAlign: "start",
|
|
39044
39128
|
textBaseline: "middle",
|
|
39045
39129
|
lineHeight: valueStyle.style.fontSize
|
|
39046
39130
|
}, valueStyle.style), {
|
|
39047
|
-
text:
|
|
39048
|
-
})
|
|
39049
|
-
|
|
39131
|
+
text: valueText
|
|
39132
|
+
});
|
|
39133
|
+
let valueShape;
|
|
39134
|
+
if (valueShape = isRichText(valueAttributes) ? graphicCreator.richtext(richTextAttributeTransform(valueAttributes)) : graphicCreator.text(valueAttributes), this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state), valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), this._itemWidthByUser) {
|
|
39050
39135
|
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace,
|
|
39051
39136
|
valueBounds = valueShape.AABBBounds,
|
|
39052
39137
|
labelBounds = labelShape.AABBBounds,
|
|
@@ -39465,7 +39550,7 @@
|
|
|
39465
39550
|
}
|
|
39466
39551
|
render() {
|
|
39467
39552
|
var _a, _b;
|
|
39468
|
-
this.removeAllChild();
|
|
39553
|
+
this.removeAllChild(!0);
|
|
39469
39554
|
const {
|
|
39470
39555
|
layout = "horizontal",
|
|
39471
39556
|
railWidth: railWidth,
|
|
@@ -40278,7 +40363,7 @@
|
|
|
40278
40363
|
super(...arguments), this.name = "indicator";
|
|
40279
40364
|
}
|
|
40280
40365
|
render() {
|
|
40281
|
-
var _a
|
|
40366
|
+
var _a;
|
|
40282
40367
|
const {
|
|
40283
40368
|
visible: visible,
|
|
40284
40369
|
title = {},
|
|
@@ -40295,20 +40380,7 @@
|
|
|
40295
40380
|
if (!0 !== visible) return void (group && group.hideAll());
|
|
40296
40381
|
if (isValid$1(title)) if (!1 !== title.visible) {
|
|
40297
40382
|
const titleStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "title.style"), title.style);
|
|
40298
|
-
|
|
40299
|
-
textConfig: titleStyle.text
|
|
40300
|
-
}, titleStyle), {
|
|
40301
|
-
visible: title.visible,
|
|
40302
|
-
x: 0,
|
|
40303
|
-
y: 0,
|
|
40304
|
-
width: null !== (_a = titleStyle.width) && void 0 !== _a ? _a : 0,
|
|
40305
|
-
height: null !== (_b = titleStyle.height) && void 0 !== _b ? _b : 0
|
|
40306
|
-
}), "richtext") : "html" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
|
|
40307
|
-
textConfig: [],
|
|
40308
|
-
html: Object.assign(Object.assign({
|
|
40309
|
-
dom: titleStyle.text
|
|
40310
|
-
}, DEFAULT_HTML_TEXT_SPEC), titleStyle)
|
|
40311
|
-
}, titleStyle), {
|
|
40383
|
+
isRichText(titleStyle) ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({}, richTextAttributeTransform(titleStyle)), {
|
|
40312
40384
|
visible: title.visible,
|
|
40313
40385
|
x: 0,
|
|
40314
40386
|
y: 0
|
|
@@ -40326,24 +40398,10 @@
|
|
|
40326
40398
|
const contents = array(content),
|
|
40327
40399
|
contentComponents = [];
|
|
40328
40400
|
contents.forEach((contentItem, i) => {
|
|
40329
|
-
var _a, _b;
|
|
40330
40401
|
if (!1 !== contentItem.visible) {
|
|
40331
40402
|
const contentStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "content.style"), contentItem.style);
|
|
40332
40403
|
let contentComponent;
|
|
40333
|
-
contentComponent =
|
|
40334
|
-
textConfig: contentStyle.text
|
|
40335
|
-
}, contentStyle), {
|
|
40336
|
-
visible: title.visible,
|
|
40337
|
-
x: 0,
|
|
40338
|
-
y: 0,
|
|
40339
|
-
width: null !== (_a = contentStyle.width) && void 0 !== _a ? _a : 0,
|
|
40340
|
-
height: null !== (_b = contentStyle.height) && void 0 !== _b ? _b : 0
|
|
40341
|
-
}), "richtext") : "html" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
|
|
40342
|
-
textConfig: [],
|
|
40343
|
-
html: Object.assign(Object.assign({
|
|
40344
|
-
dom: contentStyle.text
|
|
40345
|
-
}, DEFAULT_HTML_TEXT_SPEC), contentStyle)
|
|
40346
|
-
}, contentStyle), {
|
|
40404
|
+
contentComponent = isRichText(contentStyle) ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({}, richTextAttributeTransform(contentStyle)), {
|
|
40347
40405
|
visible: title.visible,
|
|
40348
40406
|
x: 0,
|
|
40349
40407
|
y: 0
|
|
@@ -40360,7 +40418,7 @@
|
|
|
40360
40418
|
}), this._content = contentComponents;
|
|
40361
40419
|
}
|
|
40362
40420
|
this._setGlobalAutoFit(limit), this._setYPosition();
|
|
40363
|
-
const totalHeight = null !== (
|
|
40421
|
+
const totalHeight = null !== (_a = null == group ? void 0 : group.AABBBounds.height()) && void 0 !== _a ? _a : 0;
|
|
40364
40422
|
group.setAttribute("y", size.height / 2 - totalHeight / 2), group.setAttribute("x", size.width / 2);
|
|
40365
40423
|
}
|
|
40366
40424
|
_setLocalAutoFit(limit, indicatorItem, indicatorItemSpec) {
|
|
@@ -40736,7 +40794,7 @@
|
|
|
40736
40794
|
railSectionLength = null !== (_a = isHorizontal$1(this._orient) ? this._railStyle.height : this._railStyle.width) && void 0 !== _a ? _a : RailDefaultSize[1],
|
|
40737
40795
|
controllerPx = controllers.reduce((len, controller) => {
|
|
40738
40796
|
const size = controller.style.size,
|
|
40739
|
-
maxSize = isNumber$
|
|
40797
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40740
40798
|
return len + controller.space + maxSize;
|
|
40741
40799
|
}, 0),
|
|
40742
40800
|
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,
|
|
@@ -40749,7 +40807,7 @@
|
|
|
40749
40807
|
size: size
|
|
40750
40808
|
}
|
|
40751
40809
|
} = controller,
|
|
40752
|
-
maxSize = isNumber$
|
|
40810
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40753
40811
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
40754
40812
|
size: maxSize,
|
|
40755
40813
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -40768,7 +40826,7 @@
|
|
|
40768
40826
|
size: size
|
|
40769
40827
|
}
|
|
40770
40828
|
} = controller,
|
|
40771
|
-
maxSize = isNumber$
|
|
40829
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40772
40830
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
40773
40831
|
size: maxSize,
|
|
40774
40832
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -41448,7 +41506,7 @@
|
|
|
41448
41506
|
const titleHeight = isVisible(titleAttr) ? titleAttr.height + titleAttr.spaceRow : 0;
|
|
41449
41507
|
if (this._tooltipContent = this.createOrUpdateChild("tooltip-content", {
|
|
41450
41508
|
visible: !0
|
|
41451
|
-
}, "group"), this._tooltipContent.removeAllChild(), content && content.length) {
|
|
41509
|
+
}, "group"), this._tooltipContent.removeAllChild(!0), content && content.length) {
|
|
41452
41510
|
this._tooltipContent.setAttribute("x", padding[3]), this._tooltipContent.setAttribute("y", padding[0] + titleHeight);
|
|
41453
41511
|
let lastYPos = 0;
|
|
41454
41512
|
content.forEach((item, i) => {
|
|
@@ -42658,7 +42716,7 @@
|
|
|
42658
42716
|
};
|
|
42659
42717
|
const normalizePadding = value => {
|
|
42660
42718
|
var _a, _b, _c, _d;
|
|
42661
|
-
return isNumber$
|
|
42719
|
+
return isNumber$1(value) ? {
|
|
42662
42720
|
top: value,
|
|
42663
42721
|
bottom: value,
|
|
42664
42722
|
left: value,
|
|
@@ -43540,10 +43598,10 @@
|
|
|
43540
43598
|
delayAfter: delayAfter
|
|
43541
43599
|
}), loopTime += delay + duration + delayAfter;
|
|
43542
43600
|
});
|
|
43543
|
-
const oneByOneDelay = isNumber$
|
|
43601
|
+
const oneByOneDelay = isNumber$1(oneByOne) ? oneByOne : !0 === oneByOne ? loopTime : 0;
|
|
43544
43602
|
return {
|
|
43545
43603
|
initialDelay: startTime,
|
|
43546
|
-
loopCount: isNumber$
|
|
43604
|
+
loopCount: isNumber$1(loop) ? loop : !0 === loop ? 1 / 0 : 1,
|
|
43547
43605
|
loopDelay: oneByOneDelay * index,
|
|
43548
43606
|
loopDelayAfter: oneByOneDelay * (elementCount - index - 1),
|
|
43549
43607
|
loopAnimateDuration: loopTime,
|
|
@@ -43643,7 +43701,7 @@
|
|
|
43643
43701
|
if (this.markType === GrammarMarkType.group) return;
|
|
43644
43702
|
const res = groupData(null != data ? data : DefaultMarkData, this.spec.groupBy, this.spec.groupSort),
|
|
43645
43703
|
groupKeys = res.keys;
|
|
43646
|
-
this._groupKeys = groupKeys, this.differ.setCurrentData(res);
|
|
43704
|
+
this._groupKeys = groupKeys, this._groupEncodeResult = null, this.differ.setCurrentData(res);
|
|
43647
43705
|
}
|
|
43648
43706
|
_getTransformsAfterEncodeItems() {
|
|
43649
43707
|
return this.transforms && this.transforms.filter(entry => "afterEncodeItems" === entry.markPhase);
|
|
@@ -43714,7 +43772,7 @@
|
|
|
43714
43772
|
return nextTransforms && (this.attach(nextTransforms.refs), this.transforms = nextTransforms.transforms), this.spec.transform = transforms, this.commit(), this;
|
|
43715
43773
|
}
|
|
43716
43774
|
configure(config) {
|
|
43717
|
-
const keys = ["clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
|
|
43775
|
+
const keys = ["clip", "clipPath", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
|
|
43718
43776
|
return null === config ? (keys.forEach(key => {
|
|
43719
43777
|
isNil$1(this.spec[key]) || (this.spec[key] = void 0);
|
|
43720
43778
|
}), this) : (keys.forEach(key => {
|
|
@@ -43794,7 +43852,7 @@
|
|
|
43794
43852
|
this.graphicIndex = markIndex;
|
|
43795
43853
|
}
|
|
43796
43854
|
update(spec) {
|
|
43797
|
-
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 => {
|
|
43855
|
+
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), isNil$1(spec.clipPath) || this.graphicItem.setAttribute("path", isArray$1(spec.clipPath) ? spec.clipPath : spec.clipPath(this.elements)), this.elementMap.forEach(element => {
|
|
43798
43856
|
element.updateGraphicItem({
|
|
43799
43857
|
interactive: spec.interactive
|
|
43800
43858
|
});
|
|
@@ -43802,7 +43860,8 @@
|
|
|
43802
43860
|
element.updateGraphicItem({
|
|
43803
43861
|
clip: spec.clip,
|
|
43804
43862
|
zIndex: spec.zIndex,
|
|
43805
|
-
interactive: spec.interactive
|
|
43863
|
+
interactive: spec.interactive,
|
|
43864
|
+
clipPath: spec.clipPath
|
|
43806
43865
|
});
|
|
43807
43866
|
});
|
|
43808
43867
|
}
|
|
@@ -43851,25 +43910,27 @@
|
|
|
43851
43910
|
items = [Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
|
|
43852
43911
|
nextAttrs: nextAttrs
|
|
43853
43912
|
})];
|
|
43854
|
-
return invokeEncoderToItems(el, items, groupEncode, parameters), nextAttrs;
|
|
43913
|
+
return invokeEncoderToItems(el, items, groupEncode, parameters), this._groupEncodeResult = nextAttrs, nextAttrs;
|
|
43855
43914
|
}
|
|
43856
43915
|
if (!this._groupKeys || !groupEncode) return;
|
|
43857
43916
|
const res = {};
|
|
43858
43917
|
return this._groupKeys.forEach(key => {
|
|
43859
43918
|
const el = elements.find(el => el.groupKey === key);
|
|
43860
43919
|
el && (res[key] = invokeEncoder(groupEncode, el.items && el.items[0] && el.items[0].datum, el, parameters));
|
|
43861
|
-
}), res;
|
|
43920
|
+
}), this._groupEncodeResult = res, res;
|
|
43862
43921
|
}
|
|
43863
|
-
evaluateEncode(elements, encoders, parameters) {
|
|
43922
|
+
evaluateEncode(elements, encoders, parameters, noGroupEncode) {
|
|
43864
43923
|
if (encoders) {
|
|
43865
43924
|
this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
|
|
43866
43925
|
encoders: encoders,
|
|
43867
43926
|
parameters: parameters
|
|
43868
43927
|
}, this);
|
|
43869
|
-
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43928
|
+
const groupEncodeAttrs = noGroupEncode ? null : this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43870
43929
|
elements.forEach(element => {
|
|
43871
43930
|
this.markType === GrammarMarkType.group && groupEncodeAttrs ? element.items.forEach(item => {
|
|
43872
43931
|
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs);
|
|
43932
|
+
}) : this.markType === GrammarMarkType.glyph && this._groupEncodeResult ? element.items.forEach(item => {
|
|
43933
|
+
item.nextAttrs = Object.assign(item.nextAttrs, this._groupEncodeResult[element.groupKey]);
|
|
43873
43934
|
}) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() && element.items.forEach(item => {
|
|
43874
43935
|
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
43875
43936
|
}), element.encodeItems(element.items, encoders, this._isReentered, parameters);
|
|
@@ -43968,41 +44029,17 @@
|
|
|
43968
44029
|
};
|
|
43969
44030
|
}
|
|
43970
44031
|
evaluateEncodeProgressive(elements, encoders, parameters) {
|
|
43971
|
-
|
|
43972
|
-
|
|
43973
|
-
|
|
43974
|
-
|
|
43975
|
-
|
|
43976
|
-
|
|
43977
|
-
|
|
43978
|
-
|
|
43979
|
-
|
|
43980
|
-
}, this);
|
|
43981
|
-
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43982
|
-
if (elements.forEach((element, index) => {
|
|
43983
|
-
const onlyPos = progressiveIndex > 0 || !isCollection && index > 0;
|
|
43984
|
-
!onlyPos && (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && element.items.forEach(item => {
|
|
43985
|
-
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
43986
|
-
}), element.encodeItems(element.items, onlyPos ? positionEncoders : encoders, this._isReentered, parameters);
|
|
43987
|
-
}), this._isReentered = !1, this.evaluateTransform(this._getTransformsAfterEncodeItems(), elements, parameters), elements.forEach(element => {
|
|
43988
|
-
element.encodeGraphic();
|
|
43989
|
-
}), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
|
|
43990
|
-
encoders: encoders,
|
|
43991
|
-
parameters: parameters
|
|
43992
|
-
}, this), 0 === progressiveIndex && !isCollection) {
|
|
43993
|
-
const firstChild = elements[0].getGraphicItem(),
|
|
43994
|
-
group = null == firstChild ? void 0 : firstChild.parent;
|
|
43995
|
-
if (group) {
|
|
43996
|
-
const attrs = firstChild.attribute,
|
|
43997
|
-
theme = {},
|
|
43998
|
-
itemAttrs = {};
|
|
43999
|
-
Object.keys(attrs).forEach(key => {
|
|
44000
|
-
["pickable", "zIndex"].includes(key) || (isPositionOrSizeChannel(this.markType, key) ? itemAttrs[key] = attrs[key] : theme[key] = attrs[key]);
|
|
44001
|
-
}), group.setTheme({
|
|
44002
|
-
common: theme
|
|
44003
|
-
}), firstChild.initAttributes(itemAttrs);
|
|
44032
|
+
const progressiveIndex = this.renderContext.progressive.currentIndex;
|
|
44033
|
+
if (0 === progressiveIndex) {
|
|
44034
|
+
if (this.evaluateEncode(elements, encoders, parameters), 0 === progressiveIndex && this._groupEncodeResult && !this.isCollectionMark() && this.markType !== GrammarMarkType.glyph) {
|
|
44035
|
+
const firstElement = elements[0],
|
|
44036
|
+
firstChild = firstElement.getGraphicItem(),
|
|
44037
|
+
group = null == firstChild ? void 0 : firstChild.parent;
|
|
44038
|
+
group && this._groupEncodeResult[firstElement.groupKey] && group.setTheme({
|
|
44039
|
+
common: this._groupEncodeResult[firstElement.groupKey]
|
|
44040
|
+
});
|
|
44004
44041
|
}
|
|
44005
|
-
}
|
|
44042
|
+
} else this.evaluateEncode(elements, encoders, parameters, !0);
|
|
44006
44043
|
}
|
|
44007
44044
|
evaluateProgressive() {
|
|
44008
44045
|
var _a, _b, _c;
|
|
@@ -44472,7 +44509,7 @@
|
|
|
44472
44509
|
duration = invokeFunctionType(runningConfig.animation.duration, parameters, morphData, morphElements),
|
|
44473
44510
|
oneByOne = invokeFunctionType(runningConfig.animation.oneByOne, parameters, morphData, morphElements),
|
|
44474
44511
|
splitPath = invokeFunctionType(runningConfig.animation.splitPath, parameters, morphData, morphElements),
|
|
44475
|
-
individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$
|
|
44512
|
+
individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$1(oneByOne) ? index * oneByOne : !0 === oneByOne ? index * duration : 0 : void 0;
|
|
44476
44513
|
1 !== prev.length && 0 !== prev.length || 1 !== next.length ? 1 === prev.length && next.length > 1 ? oneToMultiMorph(prev[0].getGraphicItem(), next.map(element => element.getGraphicItem()), {
|
|
44477
44514
|
delay: delay,
|
|
44478
44515
|
duration: duration,
|
|
@@ -44747,14 +44784,10 @@
|
|
|
44747
44784
|
|
|
44748
44785
|
class Text extends Mark {
|
|
44749
44786
|
addGraphicItem(initAttrs, groupKey) {
|
|
44750
|
-
const
|
|
44751
|
-
isRich = "rich" ===
|
|
44787
|
+
const originalAttrs = initAttrs && initAttrs.limitAttrs,
|
|
44788
|
+
isRich = originalAttrs && ("rich" === originalAttrs.textType || originalAttrs.text && "rich" === originalAttrs.text.type),
|
|
44752
44789
|
graphicItem = createGraphicItem(this, isRich ? GrammarMarkType.richtext : GrammarMarkType.text, initAttrs);
|
|
44753
|
-
return
|
|
44754
|
-
}
|
|
44755
|
-
getAttributeTransforms() {
|
|
44756
|
-
var _a;
|
|
44757
|
-
return "richtext" === (null === (_a = this.getGroupGraphicItem()) || void 0 === _a ? void 0 : _a.type) ? transformsByType.richtext : transformsByType.text;
|
|
44790
|
+
return super.addGraphicItem(initAttrs, groupKey, graphicItem);
|
|
44758
44791
|
}
|
|
44759
44792
|
release() {
|
|
44760
44793
|
super.release();
|
|
@@ -45851,9 +45884,9 @@
|
|
|
45851
45884
|
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45852
45885
|
const hasResize = this._resizeRenderer(),
|
|
45853
45886
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45854
|
-
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(),
|
|
45887
|
+
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(), this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1), this._layoutState && (this._layoutState = LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = LayoutState.reevaluate, this._dataflow.evaluate()), this._layoutState = LayoutState.after, (null === (_a = this._layoutMarks) || void 0 === _a ? void 0 : _a.length) && this.handleLayoutEnd()), this._layoutState = null, this.findProgressiveMarks(), this._resizeRenderer(), null === (_b = this._willMorphMarks) || void 0 === _b || _b.forEach(morphMarks => {
|
|
45855
45888
|
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
45856
|
-
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this) : this;
|
|
45889
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doRender(!0), this.doPreProgressive(), this) : this;
|
|
45857
45890
|
}
|
|
45858
45891
|
reuseCachedGrammars(runningConfig) {
|
|
45859
45892
|
if (this._willMorphMarks || (this._willMorphMarks = []), runningConfig.reuse) {
|
|
@@ -47457,7 +47490,7 @@
|
|
|
47457
47490
|
const HIDE_KEY = "_mo_hide_";
|
|
47458
47491
|
function reset(elements) {
|
|
47459
47492
|
return elements.forEach(element => {
|
|
47460
|
-
element.getGraphicAttribute(
|
|
47493
|
+
element.getGraphicAttribute(HIDE_KEY) && (element.setGraphicAttribute("visible", !0), element.setGraphicAttribute(HIDE_KEY, !1));
|
|
47461
47494
|
}), elements;
|
|
47462
47495
|
}
|
|
47463
47496
|
function overlapX(elements, delta, deltaMul, useRadius) {
|
|
@@ -47519,7 +47552,7 @@
|
|
|
47519
47552
|
} = options,
|
|
47520
47553
|
handleOverlap = elements => {
|
|
47521
47554
|
reset(elements);
|
|
47522
|
-
const sortedElements = elements.slice().sort((a, b) => a.getGraphicAttribute("x") - b.getGraphicAttribute("x"));
|
|
47555
|
+
const sortedElements = options.sort ? elements.slice().sort((a, b) => a.getGraphicAttribute("x") - b.getGraphicAttribute("x")) : elements;
|
|
47523
47556
|
0 === direction ? overlapXY(sortedElements, delta, deltaMul, radius) : 1 === direction ? overlapX(sortedElements, delta, deltaMul, radius) : overlapY(sortedElements, delta, deltaMul, radius);
|
|
47524
47557
|
};
|
|
47525
47558
|
if (groupBy) {
|
|
@@ -47794,7 +47827,7 @@
|
|
|
47794
47827
|
x1 = element.getGraphicAttribute("x1", !1),
|
|
47795
47828
|
width = element.getGraphicAttribute("width", !1);
|
|
47796
47829
|
let overallValue;
|
|
47797
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47830
|
+
return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? null == options ? void 0 : options.overall : 0, {
|
|
47798
47831
|
from: {
|
|
47799
47832
|
x: overallValue,
|
|
47800
47833
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -47839,7 +47872,7 @@
|
|
|
47839
47872
|
const x1 = element.getGraphicAttribute("x1", !1),
|
|
47840
47873
|
width = element.getGraphicAttribute("width", !1);
|
|
47841
47874
|
let overallValue;
|
|
47842
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47875
|
+
return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupWidth) && void 0 !== _a ? _a : animationParameters.group.getBounds().width(), animationParameters.groupWidth = overallValue) : overallValue = animationParameters.width : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
47843
47876
|
to: {
|
|
47844
47877
|
x: overallValue,
|
|
47845
47878
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -47890,7 +47923,7 @@
|
|
|
47890
47923
|
y1 = element.getGraphicAttribute("y1", !1),
|
|
47891
47924
|
height = element.getGraphicAttribute("height", !1);
|
|
47892
47925
|
let overallValue;
|
|
47893
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47926
|
+
return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
47894
47927
|
from: {
|
|
47895
47928
|
y: overallValue,
|
|
47896
47929
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -47935,7 +47968,7 @@
|
|
|
47935
47968
|
const y1 = element.getGraphicAttribute("y1", !1),
|
|
47936
47969
|
height = element.getGraphicAttribute("height", !1);
|
|
47937
47970
|
let overallValue;
|
|
47938
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47971
|
+
return options && "negative" === options.orient ? isNumber$1(options.overall) ? overallValue = options.overall : animationParameters.group ? (overallValue = null !== (_a = animationParameters.groupHeight) && void 0 !== _a ? _a : animationParameters.group.getBounds().height(), animationParameters.groupHeight = overallValue) : overallValue = animationParameters.height : overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0, {
|
|
47939
47972
|
to: {
|
|
47940
47973
|
y: overallValue,
|
|
47941
47974
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -47965,7 +47998,7 @@
|
|
|
47965
47998
|
},
|
|
47966
47999
|
growAngleInOverall = (element, options, animationParameters) => {
|
|
47967
48000
|
if (options && "anticlockwise" === options.orient) {
|
|
47968
|
-
const overallValue = isNumber$
|
|
48001
|
+
const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
|
|
47969
48002
|
return {
|
|
47970
48003
|
from: {
|
|
47971
48004
|
startAngle: overallValue,
|
|
@@ -47977,7 +48010,7 @@
|
|
|
47977
48010
|
}
|
|
47978
48011
|
};
|
|
47979
48012
|
}
|
|
47980
|
-
const overallValue = isNumber$
|
|
48013
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
47981
48014
|
return {
|
|
47982
48015
|
from: {
|
|
47983
48016
|
startAngle: overallValue,
|
|
@@ -48010,7 +48043,7 @@
|
|
|
48010
48043
|
},
|
|
48011
48044
|
growAngleOutOverall = (element, options, animationParameters) => {
|
|
48012
48045
|
if (options && "anticlockwise" === options.orient) {
|
|
48013
|
-
const overallValue = isNumber$
|
|
48046
|
+
const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
|
|
48014
48047
|
return {
|
|
48015
48048
|
from: {
|
|
48016
48049
|
startAngle: element.getGraphicAttribute("startAngle", !0),
|
|
@@ -48022,7 +48055,7 @@
|
|
|
48022
48055
|
}
|
|
48023
48056
|
};
|
|
48024
48057
|
}
|
|
48025
|
-
const overallValue = isNumber$
|
|
48058
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48026
48059
|
return {
|
|
48027
48060
|
from: {
|
|
48028
48061
|
startAngle: element.getGraphicAttribute("startAngle", !0),
|
|
@@ -48054,7 +48087,7 @@
|
|
|
48054
48087
|
}
|
|
48055
48088
|
},
|
|
48056
48089
|
growRadiusInOverall = (element, options, animationParameters) => {
|
|
48057
|
-
const overallValue = isNumber$
|
|
48090
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48058
48091
|
return {
|
|
48059
48092
|
from: {
|
|
48060
48093
|
innerRadius: overallValue,
|
|
@@ -48086,7 +48119,7 @@
|
|
|
48086
48119
|
}
|
|
48087
48120
|
},
|
|
48088
48121
|
growRadiusOutOverall = (element, options, animationParameters) => {
|
|
48089
|
-
const overallValue = isNumber$
|
|
48122
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48090
48123
|
return {
|
|
48091
48124
|
from: {
|
|
48092
48125
|
innerRadius: element.getGraphicAttribute("innerRadius", !0),
|
|
@@ -48366,11 +48399,17 @@
|
|
|
48366
48399
|
}
|
|
48367
48400
|
};
|
|
48368
48401
|
|
|
48402
|
+
const BUILT_IN_EXCLUDE_CHANNELS = {
|
|
48403
|
+
symbol: ["_mo_hide_", "visible"]
|
|
48404
|
+
};
|
|
48369
48405
|
const update = (element, options, animationParameters) => {
|
|
48370
48406
|
const from = Object.assign({}, element.getPrevGraphicAttributes()),
|
|
48371
48407
|
to = Object.assign({}, element.getNextGraphicAttributes());
|
|
48408
|
+
let excludeChannels;
|
|
48372
48409
|
return options && array(options.excludeChannels).forEach(key => {
|
|
48373
48410
|
delete from[key], delete to[key];
|
|
48411
|
+
}), element.mark && element.mark.markType && (excludeChannels = BUILT_IN_EXCLUDE_CHANNELS[element.mark.markType]) && excludeChannels.forEach(key => {
|
|
48412
|
+
delete from[key], delete to[key];
|
|
48374
48413
|
}), Object.keys(to).forEach(key => {
|
|
48375
48414
|
isEqual(key, from, to) && (delete from[key], delete to[key]);
|
|
48376
48415
|
}), {
|
|
@@ -48519,7 +48558,7 @@
|
|
|
48519
48558
|
return [{
|
|
48520
48559
|
channels: ["size", "padding"],
|
|
48521
48560
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
48522
|
-
if (isNumber$
|
|
48561
|
+
if (isNumber$1(storedAttrs.padding) && storedAttrs.padding > 0) graphicAttributes.size = isArray$1(storedAttrs.size) ? storedAttrs.size.map(entry => Math.max(entry - storedAttrs.padding, 1)) : Math.max(storedAttrs.size - storedAttrs.padding, 1);else if (isArray$1(storedAttrs.padding) && 2 === storedAttrs.padding.length) {
|
|
48523
48562
|
const arraySize = isArray$1(storedAttrs.size) ? storedAttrs.size : [storedAttrs.size, storedAttrs.size];
|
|
48524
48563
|
graphicAttributes.size = [Math.max(arraySize[0] - storedAttrs.padding[0], 1), Math.max(arraySize[1] - storedAttrs.padding[1], 1)];
|
|
48525
48564
|
} else graphicAttributes.size = storedAttrs.size;
|
|
@@ -49161,7 +49200,7 @@
|
|
|
49161
49200
|
}
|
|
49162
49201
|
function calcLayoutNumber(v, size, callOp) {
|
|
49163
49202
|
var _a, _b;
|
|
49164
|
-
if (isNumber$
|
|
49203
|
+
if (isNumber$1(v)) {
|
|
49165
49204
|
return v;
|
|
49166
49205
|
}
|
|
49167
49206
|
if (isPercent(v)) {
|
|
@@ -49183,7 +49222,7 @@
|
|
|
49183
49222
|
left: 0,
|
|
49184
49223
|
right: 0
|
|
49185
49224
|
};
|
|
49186
|
-
if (Object.values(paddingSpec).every(value => isNumber$
|
|
49225
|
+
if (Object.values(paddingSpec).every(value => isNumber$1(value))) {
|
|
49187
49226
|
result.top = (_a = paddingSpec.top) !== null && _a !== void 0 ? _a : 0;
|
|
49188
49227
|
result.right = (_b = paddingSpec.right) !== null && _b !== void 0 ? _b : 0;
|
|
49189
49228
|
result.bottom = (_c = paddingSpec.bottom) !== null && _c !== void 0 ? _c : 0;
|
|
@@ -49233,7 +49272,7 @@
|
|
|
49233
49272
|
}
|
|
49234
49273
|
return result;
|
|
49235
49274
|
}
|
|
49236
|
-
if (isNumber$
|
|
49275
|
+
if (isNumber$1(spec) || isPercent(spec) || isFunction$1(spec) || isPercentOffset(spec)) {
|
|
49237
49276
|
result.top = result.left = result.bottom = result.right = spec;
|
|
49238
49277
|
return result;
|
|
49239
49278
|
}
|
|
@@ -51386,7 +51425,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
51386
51425
|
else if (typeof value === 'object') {
|
|
51387
51426
|
result = {};
|
|
51388
51427
|
}
|
|
51389
|
-
else if (isBoolean$1(value) || isNumber$
|
|
51428
|
+
else if (isBoolean$1(value) || isNumber$1(value) || isString$1(value)) {
|
|
51390
51429
|
result = value;
|
|
51391
51430
|
}
|
|
51392
51431
|
else if (isDate$1(value)) {
|
|
@@ -56573,7 +56612,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56573
56612
|
this._initSpecStyle(spec, this.stateStyle, key);
|
|
56574
56613
|
}
|
|
56575
56614
|
convertAngleToRadian(styleConverter) {
|
|
56576
|
-
if (isNumber$
|
|
56615
|
+
if (isNumber$1(styleConverter)) {
|
|
56577
56616
|
return degreeToRadian(styleConverter);
|
|
56578
56617
|
}
|
|
56579
56618
|
else if (styleConverter.scale) {
|
|
@@ -57434,11 +57473,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57434
57473
|
this._specInfo = (_a = this._chartSpecTransformer) === null || _a === void 0 ? void 0 : _a.createSpecInfo(this._spec);
|
|
57435
57474
|
}
|
|
57436
57475
|
_initChart(spec) {
|
|
57437
|
-
var _a, _b;
|
|
57476
|
+
var _a, _b, _c;
|
|
57438
57477
|
if (!this._compiler) {
|
|
57439
57478
|
(_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('compiler is not initialized');
|
|
57440
57479
|
return;
|
|
57441
57480
|
}
|
|
57481
|
+
if (this._chart) {
|
|
57482
|
+
(_b = this._option) === null || _b === void 0 ? void 0 : _b.onError('chart is already initialized');
|
|
57483
|
+
return;
|
|
57484
|
+
}
|
|
57442
57485
|
const chart = Factory.createChart(spec.type, spec, {
|
|
57443
57486
|
type: spec.type,
|
|
57444
57487
|
globalInstance: this,
|
|
@@ -57460,7 +57503,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57460
57503
|
disableTriggerEvent: this._option.disableTriggerEvent === true
|
|
57461
57504
|
});
|
|
57462
57505
|
if (!chart) {
|
|
57463
|
-
(
|
|
57506
|
+
(_c = this._option) === null || _c === void 0 ? void 0 : _c.onError('init chart fail');
|
|
57464
57507
|
return;
|
|
57465
57508
|
}
|
|
57466
57509
|
this._chart = chart;
|
|
@@ -58751,7 +58794,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58751
58794
|
registerChartPlugin(MediaQuery);
|
|
58752
58795
|
};
|
|
58753
58796
|
|
|
58754
|
-
const version = "1.9.
|
|
58797
|
+
const version = "1.9.2";
|
|
58755
58798
|
|
|
58756
58799
|
const addVChartProperty = (data, op) => {
|
|
58757
58800
|
const context = op.beforeCall();
|
|
@@ -59375,13 +59418,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59375
59418
|
_getDefaultSpecFromChart(chartSpec) {
|
|
59376
59419
|
var _a;
|
|
59377
59420
|
const spec = (_a = super._getDefaultSpecFromChart(chartSpec)) !== null && _a !== void 0 ? _a : {};
|
|
59378
|
-
const { outerRadius, innerRadius } = chartSpec;
|
|
59421
|
+
const { outerRadius, innerRadius, direction } = chartSpec;
|
|
59379
59422
|
if (isValid$1(outerRadius)) {
|
|
59380
59423
|
spec.outerRadius = outerRadius;
|
|
59381
59424
|
}
|
|
59382
59425
|
if (isValid$1(innerRadius)) {
|
|
59383
59426
|
spec.innerRadius = innerRadius;
|
|
59384
59427
|
}
|
|
59428
|
+
if (isValid$1(direction)) {
|
|
59429
|
+
spec.direction = direction;
|
|
59430
|
+
}
|
|
59385
59431
|
return Object.keys(spec).length > 0 ? spec : undefined;
|
|
59386
59432
|
}
|
|
59387
59433
|
}
|
|
@@ -60627,41 +60673,46 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60627
60673
|
getStackGroupFields() {
|
|
60628
60674
|
return this.getGroupFields();
|
|
60629
60675
|
}
|
|
60676
|
+
getStackValue() {
|
|
60677
|
+
var _a, _b;
|
|
60678
|
+
const axisId = (_a = (this.direction === "horizontal" ? this.getXAxisHelper() : this.getYAxisHelper())) === null || _a === void 0 ? void 0 : _a.getAxisId();
|
|
60679
|
+
return (_b = this._spec.stackValue) !== null && _b !== void 0 ? _b : `${PREFIX}_series_${this.type}_${axisId}`;
|
|
60680
|
+
}
|
|
60630
60681
|
getStackValueField() {
|
|
60631
|
-
if (this.direction === "
|
|
60632
|
-
return array(this._spec.
|
|
60682
|
+
if (this.direction === "horizontal") {
|
|
60683
|
+
return array(this._spec.xField)[0];
|
|
60633
60684
|
}
|
|
60634
|
-
return array(this._spec.
|
|
60685
|
+
return array(this._spec.yField)[0];
|
|
60635
60686
|
}
|
|
60636
60687
|
setValueFieldToStack() {
|
|
60637
|
-
if (this.direction === "
|
|
60638
|
-
this.setFieldY(STACK_FIELD_END);
|
|
60639
|
-
this.setFieldY2(STACK_FIELD_START);
|
|
60640
|
-
}
|
|
60641
|
-
else {
|
|
60688
|
+
if (this.direction === "horizontal") {
|
|
60642
60689
|
this.setFieldX(STACK_FIELD_END);
|
|
60643
60690
|
this.setFieldX2(STACK_FIELD_START);
|
|
60644
60691
|
}
|
|
60692
|
+
else {
|
|
60693
|
+
this.setFieldY(STACK_FIELD_END);
|
|
60694
|
+
this.setFieldY2(STACK_FIELD_START);
|
|
60695
|
+
}
|
|
60645
60696
|
}
|
|
60646
60697
|
setValueFieldToPercent() {
|
|
60647
|
-
if (this.direction === "
|
|
60648
|
-
this.setFieldY(STACK_FIELD_END_PERCENT);
|
|
60649
|
-
this.setFieldY2(STACK_FIELD_START_PERCENT);
|
|
60650
|
-
}
|
|
60651
|
-
else {
|
|
60698
|
+
if (this.direction === "horizontal") {
|
|
60652
60699
|
this.setFieldX(STACK_FIELD_END_PERCENT);
|
|
60653
60700
|
this.setFieldX2(STACK_FIELD_START_PERCENT);
|
|
60654
60701
|
}
|
|
60702
|
+
else {
|
|
60703
|
+
this.setFieldY(STACK_FIELD_END_PERCENT);
|
|
60704
|
+
this.setFieldY2(STACK_FIELD_START_PERCENT);
|
|
60705
|
+
}
|
|
60655
60706
|
}
|
|
60656
60707
|
setValueFieldToStackOffsetSilhouette() {
|
|
60657
|
-
if (this.direction === "
|
|
60658
|
-
this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
|
|
60659
|
-
this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
|
|
60660
|
-
}
|
|
60661
|
-
else {
|
|
60708
|
+
if (this.direction === "horizontal") {
|
|
60662
60709
|
this.setFieldX(STACK_FIELD_END_OffsetSilhouette);
|
|
60663
60710
|
this.setFieldX2(STACK_FIELD_START_OffsetSilhouette);
|
|
60664
60711
|
}
|
|
60712
|
+
else {
|
|
60713
|
+
this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
|
|
60714
|
+
this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
|
|
60715
|
+
}
|
|
60665
60716
|
}
|
|
60666
60717
|
onXAxisHelperUpdate() {
|
|
60667
60718
|
this.onMarkPositionUpdate();
|
|
@@ -60835,22 +60886,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60835
60886
|
this._buildScaleConfig();
|
|
60836
60887
|
}
|
|
60837
60888
|
getDimensionField() {
|
|
60838
|
-
if (this._direction === "
|
|
60839
|
-
return this.
|
|
60889
|
+
if (this._direction === "horizontal") {
|
|
60890
|
+
return this._specYField;
|
|
60840
60891
|
}
|
|
60841
|
-
return this.
|
|
60892
|
+
return this._specXField;
|
|
60842
60893
|
}
|
|
60843
60894
|
getDimensionContinuousField() {
|
|
60844
|
-
if (this._direction === "
|
|
60845
|
-
return [this.
|
|
60895
|
+
if (this._direction === "horizontal") {
|
|
60896
|
+
return [this.fieldY[0], this.fieldY2];
|
|
60846
60897
|
}
|
|
60847
|
-
return [this.
|
|
60898
|
+
return [this.fieldX[0], this.fieldX2];
|
|
60848
60899
|
}
|
|
60849
60900
|
getMeasureField() {
|
|
60850
|
-
if (this._direction === "
|
|
60851
|
-
return this.
|
|
60901
|
+
if (this._direction === "horizontal") {
|
|
60902
|
+
return this._specXField;
|
|
60852
60903
|
}
|
|
60853
|
-
return this.
|
|
60904
|
+
return this._specYField;
|
|
60854
60905
|
}
|
|
60855
60906
|
viewDataUpdate(d) {
|
|
60856
60907
|
super.viewDataUpdate(d);
|
|
@@ -60890,9 +60941,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60890
60941
|
const fieldsX = this._fieldX;
|
|
60891
60942
|
samplingTrans.push({
|
|
60892
60943
|
type: 'sampling',
|
|
60893
|
-
size: this._direction === "
|
|
60944
|
+
size: this._direction === "horizontal" ? height : width,
|
|
60894
60945
|
factor: this._spec.samplingFactor,
|
|
60895
|
-
yfield: this._direction === "
|
|
60946
|
+
yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
|
|
60896
60947
|
groupBy: this._seriesField,
|
|
60897
60948
|
mode: this._spec.sampling
|
|
60898
60949
|
});
|
|
@@ -60956,9 +61007,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60956
61007
|
else {
|
|
60957
61008
|
const userCurveType = areaCurveType !== null && areaCurveType !== void 0 ? areaCurveType : (_b = (_a = this.getSpec().line) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType;
|
|
60958
61009
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
60959
|
-
? direction === "
|
|
60960
|
-
? '
|
|
60961
|
-
: '
|
|
61010
|
+
? direction === "horizontal"
|
|
61011
|
+
? 'monotoneY'
|
|
61012
|
+
: 'monotoneX'
|
|
60962
61013
|
: userCurveType;
|
|
60963
61014
|
this.setMarkStyle(lineMark, {
|
|
60964
61015
|
curveType
|
|
@@ -63213,33 +63264,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63213
63264
|
var _a, _b, _c, _d, _e;
|
|
63214
63265
|
const userCurveType = ((_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType);
|
|
63215
63266
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
63216
|
-
? this._direction === "
|
|
63217
|
-
? '
|
|
63218
|
-
: '
|
|
63267
|
+
? this._direction === "horizontal"
|
|
63268
|
+
? 'monotoneY'
|
|
63269
|
+
: 'monotoneX'
|
|
63219
63270
|
: userCurveType;
|
|
63220
63271
|
const areaMark = this._areaMark;
|
|
63221
63272
|
if (areaMark) {
|
|
63222
|
-
if (this._direction === "
|
|
63273
|
+
if (this._direction === "horizontal") {
|
|
63223
63274
|
this.setMarkStyle(this._areaMark, {
|
|
63224
63275
|
x: this.dataToPositionX.bind(this),
|
|
63225
|
-
|
|
63276
|
+
x1: (datum) => {
|
|
63226
63277
|
var _a, _b;
|
|
63227
|
-
return valueInScaleRange(this.
|
|
63278
|
+
return valueInScaleRange(this.dataToPositionX1(datum), (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
|
|
63228
63279
|
},
|
|
63229
63280
|
y: this.dataToPositionY.bind(this),
|
|
63230
|
-
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63281
|
+
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
|
|
63282
|
+
orient: this._direction
|
|
63231
63283
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63232
63284
|
}
|
|
63233
63285
|
else {
|
|
63234
63286
|
this.setMarkStyle(this._areaMark, {
|
|
63235
63287
|
x: this.dataToPositionX.bind(this),
|
|
63236
|
-
|
|
63288
|
+
y1: (datum) => {
|
|
63237
63289
|
var _a, _b;
|
|
63238
|
-
return valueInScaleRange(this.
|
|
63290
|
+
return valueInScaleRange(this.dataToPositionY1(datum), (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0));
|
|
63239
63291
|
},
|
|
63240
63292
|
y: this.dataToPositionY.bind(this),
|
|
63241
|
-
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63242
|
-
orient: this._direction
|
|
63293
|
+
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63243
63294
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63244
63295
|
}
|
|
63245
63296
|
this.setMarkStyle(areaMark, {
|
|
@@ -63859,30 +63910,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63859
63910
|
var _a, _b, _c, _d;
|
|
63860
63911
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
63861
63912
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
63862
|
-
if (this.direction === "
|
|
63863
|
-
this.setMarkStyle(this._barMark, {
|
|
63864
|
-
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63865
|
-
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63866
|
-
y: (datum, ctx, opt, dataView) => {
|
|
63867
|
-
if (this._shouldDoPreCalculate()) {
|
|
63868
|
-
this._calculateStackRectPosition(true);
|
|
63869
|
-
return datum[RECT_Y];
|
|
63870
|
-
}
|
|
63871
|
-
if (this._spec.barMinHeight) {
|
|
63872
|
-
return this._calculateRectPosition(datum, true);
|
|
63873
|
-
}
|
|
63874
|
-
return valueInScaleRange(this.dataToPositionY(datum), yScale);
|
|
63875
|
-
},
|
|
63876
|
-
y1: (datum) => {
|
|
63877
|
-
if (this._shouldDoPreCalculate()) {
|
|
63878
|
-
this._calculateStackRectPosition(true);
|
|
63879
|
-
return datum[RECT_Y1];
|
|
63880
|
-
}
|
|
63881
|
-
return valueInScaleRange(this.dataToPositionY1(datum), yScale);
|
|
63882
|
-
}
|
|
63883
|
-
}, 'normal', exports.AttributeLevel.Series);
|
|
63884
|
-
}
|
|
63885
|
-
else {
|
|
63913
|
+
if (this.direction === "horizontal") {
|
|
63886
63914
|
this.setMarkStyle(this._barMark, {
|
|
63887
63915
|
x: (datum) => {
|
|
63888
63916
|
if (this._shouldDoPreCalculate()) {
|
|
@@ -63905,42 +63933,65 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63905
63933
|
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
63906
63934
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63907
63935
|
}
|
|
63936
|
+
else {
|
|
63937
|
+
this.setMarkStyle(this._barMark, {
|
|
63938
|
+
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63939
|
+
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63940
|
+
y: (datum, ctx, opt, dataView) => {
|
|
63941
|
+
if (this._shouldDoPreCalculate()) {
|
|
63942
|
+
this._calculateStackRectPosition(true);
|
|
63943
|
+
return datum[RECT_Y];
|
|
63944
|
+
}
|
|
63945
|
+
if (this._spec.barMinHeight) {
|
|
63946
|
+
return this._calculateRectPosition(datum, true);
|
|
63947
|
+
}
|
|
63948
|
+
return valueInScaleRange(this.dataToPositionY(datum), yScale);
|
|
63949
|
+
},
|
|
63950
|
+
y1: (datum) => {
|
|
63951
|
+
if (this._shouldDoPreCalculate()) {
|
|
63952
|
+
this._calculateStackRectPosition(true);
|
|
63953
|
+
return datum[RECT_Y1];
|
|
63954
|
+
}
|
|
63955
|
+
return valueInScaleRange(this.dataToPositionY1(datum), yScale);
|
|
63956
|
+
}
|
|
63957
|
+
}, 'normal', exports.AttributeLevel.Series);
|
|
63958
|
+
}
|
|
63908
63959
|
this._initLinearBarBackgroundMarkStyle();
|
|
63909
63960
|
}
|
|
63910
63961
|
_initLinearBarBackgroundMarkStyle() {
|
|
63911
63962
|
var _a, _b, _c, _d;
|
|
63912
63963
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
63913
63964
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
63914
|
-
if (this.direction === "
|
|
63965
|
+
if (this.direction === "horizontal") {
|
|
63915
63966
|
this.setMarkStyle(this._barBackgroundMark, {
|
|
63916
|
-
x: (
|
|
63917
|
-
|
|
63918
|
-
y: () => {
|
|
63919
|
-
const range = yScale.range();
|
|
63967
|
+
x: () => {
|
|
63968
|
+
const range = xScale.range();
|
|
63920
63969
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
63921
63970
|
return min;
|
|
63922
63971
|
},
|
|
63923
|
-
|
|
63924
|
-
const range =
|
|
63972
|
+
x1: () => {
|
|
63973
|
+
const range = xScale.range();
|
|
63925
63974
|
const max = Math.max(range[0], range[range.length - 1]);
|
|
63926
63975
|
return max;
|
|
63927
|
-
}
|
|
63976
|
+
},
|
|
63977
|
+
y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
|
|
63978
|
+
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
63928
63979
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63929
63980
|
}
|
|
63930
63981
|
else {
|
|
63931
63982
|
this.setMarkStyle(this._barBackgroundMark, {
|
|
63932
|
-
x: () =>
|
|
63933
|
-
|
|
63983
|
+
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63984
|
+
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63985
|
+
y: () => {
|
|
63986
|
+
const range = yScale.range();
|
|
63934
63987
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
63935
63988
|
return min;
|
|
63936
63989
|
},
|
|
63937
|
-
|
|
63938
|
-
const range =
|
|
63990
|
+
y1: () => {
|
|
63991
|
+
const range = yScale.range();
|
|
63939
63992
|
const max = Math.max(range[0], range[range.length - 1]);
|
|
63940
63993
|
return max;
|
|
63941
|
-
}
|
|
63942
|
-
y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
|
|
63943
|
-
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
63994
|
+
}
|
|
63944
63995
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63945
63996
|
}
|
|
63946
63997
|
}
|
|
@@ -64057,9 +64108,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64057
64108
|
const fieldsX = this._fieldX;
|
|
64058
64109
|
samplingTrans.push({
|
|
64059
64110
|
type: 'sampling',
|
|
64060
|
-
size: this._direction === "
|
|
64111
|
+
size: this._direction === "horizontal" ? height : width,
|
|
64061
64112
|
factor: this._spec.samplingFactor,
|
|
64062
|
-
yfield: this._direction === "
|
|
64113
|
+
yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
|
|
64063
64114
|
groupBy: this._seriesField,
|
|
64064
64115
|
mode: this._spec.sampling
|
|
64065
64116
|
});
|
|
@@ -64295,7 +64346,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64295
64346
|
if (isNil$1(sizeSpec)) {
|
|
64296
64347
|
return SCATTER_DEFAULT_SIZE;
|
|
64297
64348
|
}
|
|
64298
|
-
if (isNumber$
|
|
64349
|
+
if (isNumber$1(sizeSpec)) {
|
|
64299
64350
|
return sizeSpec;
|
|
64300
64351
|
}
|
|
64301
64352
|
if (isString$1(sizeSpec) && isNumeric$1(sizeSpec)) {
|
|
@@ -64360,7 +64411,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64360
64411
|
y: this.dataToPositionY.bind(this),
|
|
64361
64412
|
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
|
|
64362
64413
|
fill: this.getColorAttribute(),
|
|
64363
|
-
size: isNumber$
|
|
64414
|
+
size: isNumber$1(this._size) || isFunction$1(this._size) ? this._size : SCATTER_DEFAULT_SIZE,
|
|
64364
64415
|
symbolType: isString$1(this._shape) || isFunction$1(this._shape) ? this._shape : SCATTER_DEFAULT_SHAPE
|
|
64365
64416
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
64366
64417
|
if (isValid$1(this._sizeField) || isValid$1(this._size)) {
|
|
@@ -66733,59 +66784,59 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66733
66784
|
}
|
|
66734
66785
|
totalPositionX(datum, field, pos = 0.5) {
|
|
66735
66786
|
const { dataToPosition, getBandwidth } = this._xAxisHelper;
|
|
66736
|
-
if (this._direction === "
|
|
66737
|
-
return (dataToPosition([datum[field]], {
|
|
66787
|
+
if (this._direction === "horizontal") {
|
|
66788
|
+
return valueInScaleRange(dataToPosition([datum[field]], {
|
|
66738
66789
|
bandPosition: this._bandPosition
|
|
66739
|
-
})
|
|
66740
|
-
getBandwidth(0) * 0.5 -
|
|
66741
|
-
this._barMark.getAttribute('width', datum) * (0.5 - pos));
|
|
66790
|
+
}));
|
|
66742
66791
|
}
|
|
66743
|
-
return
|
|
66792
|
+
return (dataToPosition([datum[field]], {
|
|
66744
66793
|
bandPosition: this._bandPosition
|
|
66745
|
-
})
|
|
66794
|
+
}) +
|
|
66795
|
+
getBandwidth(0) * 0.5 -
|
|
66796
|
+
this._barMark.getAttribute('width', datum) * (0.5 - pos));
|
|
66746
66797
|
}
|
|
66747
66798
|
totalPositionY(datum, field, pos = 0.5) {
|
|
66748
66799
|
const { dataToPosition, getBandwidth } = this._yAxisHelper;
|
|
66749
|
-
if (this._direction === "
|
|
66750
|
-
return
|
|
66800
|
+
if (this._direction === "horizontal") {
|
|
66801
|
+
return (dataToPosition([datum[field]], {
|
|
66751
66802
|
bandPosition: this._bandPosition
|
|
66752
|
-
})
|
|
66803
|
+
}) +
|
|
66804
|
+
getBandwidth(0) * 0.5 -
|
|
66805
|
+
this._barMark.getAttribute('height', datum) * (0.5 - pos));
|
|
66753
66806
|
}
|
|
66754
|
-
return (dataToPosition([datum[field]], {
|
|
66807
|
+
return valueInScaleRange(dataToPosition([datum[field]], {
|
|
66755
66808
|
bandPosition: this._bandPosition
|
|
66756
|
-
})
|
|
66757
|
-
getBandwidth(0) * 0.5 -
|
|
66758
|
-
this._barMark.getAttribute('height', datum) * (0.5 - pos));
|
|
66809
|
+
}));
|
|
66759
66810
|
}
|
|
66760
66811
|
initMarkStyle() {
|
|
66761
66812
|
super.initMarkStyle();
|
|
66762
66813
|
if (this._leaderLineMark) {
|
|
66763
|
-
if (this._direction === "
|
|
66814
|
+
if (this._direction === "horizontal") {
|
|
66764
66815
|
this.setMarkStyle(this._leaderLineMark, {
|
|
66765
66816
|
visible: (datum) => !isNil$1(datum.lastIndex),
|
|
66766
|
-
x: (datum) =>
|
|
66817
|
+
x: (datum) => this.totalPositionX(datum, 'lastEnd', 0),
|
|
66818
|
+
x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
|
|
66819
|
+
y: (datum) => {
|
|
66767
66820
|
if (!datum.lastIndex) {
|
|
66768
66821
|
return 0;
|
|
66769
66822
|
}
|
|
66770
|
-
return this.
|
|
66823
|
+
return this.totalPositionY(datum, 'lastIndex', 1);
|
|
66771
66824
|
},
|
|
66772
|
-
|
|
66773
|
-
y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
|
|
66774
|
-
y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
|
|
66825
|
+
y1: (datum) => this.totalPositionY(datum, 'index', 0)
|
|
66775
66826
|
}, 'normal', exports.AttributeLevel.Series);
|
|
66776
66827
|
}
|
|
66777
66828
|
else {
|
|
66778
66829
|
this.setMarkStyle(this._leaderLineMark, {
|
|
66779
66830
|
visible: (datum) => !isNil$1(datum.lastIndex),
|
|
66780
|
-
x: (datum) =>
|
|
66781
|
-
x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
|
|
66782
|
-
y: (datum) => {
|
|
66831
|
+
x: (datum) => {
|
|
66783
66832
|
if (!datum.lastIndex) {
|
|
66784
66833
|
return 0;
|
|
66785
66834
|
}
|
|
66786
|
-
return this.
|
|
66835
|
+
return this.totalPositionX(datum, 'lastIndex', 1);
|
|
66787
66836
|
},
|
|
66788
|
-
|
|
66837
|
+
x1: (datum) => this.totalPositionX(datum, 'index', 0),
|
|
66838
|
+
y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
|
|
66839
|
+
y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
|
|
66789
66840
|
}, 'normal', exports.AttributeLevel.Series);
|
|
66790
66841
|
}
|
|
66791
66842
|
}
|
|
@@ -67132,15 +67183,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67132
67183
|
minMaxFillOpacity: this._shaftFillOpacity,
|
|
67133
67184
|
stroke: (_b = this._strokeColor) !== null && _b !== void 0 ? _b : (this._shaftShape === 'line' ? this.getColorAttribute() : DEFAULT_STROKE_COLOR)
|
|
67134
67185
|
};
|
|
67135
|
-
const boxPlotMarkStyles = this._direction === "
|
|
67136
|
-
? Object.assign(Object.assign({
|
|
67186
|
+
const boxPlotMarkStyles = this._direction === "horizontal"
|
|
67187
|
+
? Object.assign(Object.assign({ y: this.dataToPositionY.bind(this) }, commonBoxplotStyles), { boxHeight: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Height: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxHeight: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } }) : Object.assign(Object.assign({ x: this.dataToPositionX.bind(this) }, commonBoxplotStyles), { boxWidth: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, ruleWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, q1q3Width: () => { var _a; return (_a = this._boxWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); }, minMaxWidth: () => { var _a; return (_a = this._shaftWidth) !== null && _a !== void 0 ? _a : this._getMarkWidth(); } });
|
|
67137
67188
|
this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
67138
67189
|
}
|
|
67139
67190
|
const outlierMark = this._outlierMark;
|
|
67140
67191
|
if (outlierMark) {
|
|
67141
67192
|
this.setMarkStyle(outlierMark, {
|
|
67142
67193
|
fill: (_d = (_c = this._outliersStyle) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.getColorAttribute(),
|
|
67143
|
-
size: isNumber$
|
|
67194
|
+
size: isNumber$1((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE,
|
|
67144
67195
|
symbolType: 'circle'
|
|
67145
67196
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
67146
67197
|
}
|
|
@@ -67148,7 +67199,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67148
67199
|
initBoxPlotMarkStyle() {
|
|
67149
67200
|
var _a, _b;
|
|
67150
67201
|
const boxPlotMark = this._boxPlotMark;
|
|
67151
|
-
const axisHelper = this._direction === "
|
|
67202
|
+
const axisHelper = this._direction === "horizontal" ? this._xAxisHelper : this._yAxisHelper;
|
|
67152
67203
|
if (boxPlotMark && axisHelper) {
|
|
67153
67204
|
const { dataToPosition } = axisHelper;
|
|
67154
67205
|
const scale = (_a = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _a === void 0 ? void 0 : _a.call(axisHelper, 0);
|
|
@@ -67174,16 +67225,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67174
67225
|
if (outlierMark && axisHelper) {
|
|
67175
67226
|
const { dataToPosition } = axisHelper;
|
|
67176
67227
|
const scale = (_b = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _b === void 0 ? void 0 : _b.call(axisHelper, 0);
|
|
67177
|
-
const outlierMarkPositionChannel = this._direction === "
|
|
67228
|
+
const outlierMarkPositionChannel = this._direction === "horizontal"
|
|
67178
67229
|
? {
|
|
67179
|
-
|
|
67180
|
-
|
|
67230
|
+
y: this.dataToPositionY.bind(this),
|
|
67231
|
+
x: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
67181
67232
|
bandPosition: this._bandPosition
|
|
67182
67233
|
}), scale)
|
|
67183
67234
|
}
|
|
67184
67235
|
: {
|
|
67185
|
-
|
|
67186
|
-
|
|
67236
|
+
x: this.dataToPositionX.bind(this),
|
|
67237
|
+
y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
67187
67238
|
bandPosition: this._bandPosition
|
|
67188
67239
|
}), scale)
|
|
67189
67240
|
};
|
|
@@ -67205,7 +67256,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67205
67256
|
outlierDataView.transform({
|
|
67206
67257
|
type: 'foldOutlierData',
|
|
67207
67258
|
options: {
|
|
67208
|
-
dimensionField: this._direction === "
|
|
67259
|
+
dimensionField: this._direction === "horizontal" ? this._fieldY : this._fieldX,
|
|
67209
67260
|
outliersField: this._outliersField
|
|
67210
67261
|
}
|
|
67211
67262
|
});
|
|
@@ -67226,8 +67277,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67226
67277
|
if (this._autoBoxWidth) {
|
|
67227
67278
|
return this._autoBoxWidth;
|
|
67228
67279
|
}
|
|
67229
|
-
const bandAxisHelper = this._direction === "
|
|
67230
|
-
const xField = this._direction === "
|
|
67280
|
+
const bandAxisHelper = this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper;
|
|
67281
|
+
const xField = this._direction === "horizontal" ? this._fieldY : this._fieldX;
|
|
67231
67282
|
const innerBandWidth = bandAxisHelper.getBandwidth(xField.length - 1);
|
|
67232
67283
|
const autoBoxWidth = innerBandWidth / xField.length;
|
|
67233
67284
|
this._autoBoxWidth = autoBoxWidth;
|
|
@@ -67805,41 +67856,41 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67805
67856
|
var _a, _b, _c, _d, _e;
|
|
67806
67857
|
const userCurveType = (_c = (_b = (_a = this.getSpec().area) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.curveType) !== null && _c !== void 0 ? _c : (_e = (_d = this.getSpec().line) === null || _d === void 0 ? void 0 : _d.style) === null || _e === void 0 ? void 0 : _e.curveType;
|
|
67807
67858
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
67808
|
-
? this._direction === "
|
|
67809
|
-
? '
|
|
67810
|
-
: '
|
|
67859
|
+
? this._direction === "horizontal"
|
|
67860
|
+
? 'monotoneY'
|
|
67861
|
+
: 'monotoneX'
|
|
67811
67862
|
: userCurveType;
|
|
67812
67863
|
const areaMark = this._areaMark;
|
|
67813
67864
|
if (areaMark) {
|
|
67814
|
-
if (this._direction === "
|
|
67865
|
+
if (this._direction === "horizontal") {
|
|
67815
67866
|
this.setMarkStyle(this._areaMark, {
|
|
67816
67867
|
x: this.dataToPositionX.bind(this),
|
|
67817
|
-
|
|
67818
|
-
if (!this.
|
|
67868
|
+
x1: (datum) => {
|
|
67869
|
+
if (!this._xAxisHelper) {
|
|
67819
67870
|
return Number.NaN;
|
|
67820
67871
|
}
|
|
67821
|
-
const { dataToPosition } = this.
|
|
67822
|
-
return dataToPosition(this.getDatumPositionValues(datum, this._spec.
|
|
67872
|
+
const { dataToPosition } = this._xAxisHelper;
|
|
67873
|
+
return dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
|
|
67823
67874
|
bandPosition: this._bandPosition
|
|
67824
67875
|
});
|
|
67825
67876
|
},
|
|
67826
|
-
y: this.dataToPositionY.bind(this)
|
|
67877
|
+
y: this.dataToPositionY.bind(this),
|
|
67878
|
+
orient: this._direction
|
|
67827
67879
|
}, 'normal', exports.AttributeLevel.Series);
|
|
67828
67880
|
}
|
|
67829
67881
|
else {
|
|
67830
67882
|
this.setMarkStyle(this._areaMark, {
|
|
67831
67883
|
x: this.dataToPositionX.bind(this),
|
|
67832
|
-
|
|
67833
|
-
if (!this.
|
|
67884
|
+
y1: (datum) => {
|
|
67885
|
+
if (!this._yAxisHelper) {
|
|
67834
67886
|
return Number.NaN;
|
|
67835
67887
|
}
|
|
67836
|
-
const { dataToPosition } = this.
|
|
67837
|
-
return dataToPosition(this.getDatumPositionValues(datum, this._spec.
|
|
67888
|
+
const { dataToPosition } = this._yAxisHelper;
|
|
67889
|
+
return dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[1]), {
|
|
67838
67890
|
bandPosition: this._bandPosition
|
|
67839
67891
|
});
|
|
67840
67892
|
},
|
|
67841
|
-
y: this.dataToPositionY.bind(this)
|
|
67842
|
-
orient: this._direction
|
|
67893
|
+
y: this.dataToPositionY.bind(this)
|
|
67843
67894
|
}, 'normal', exports.AttributeLevel.Series);
|
|
67844
67895
|
}
|
|
67845
67896
|
this.setMarkStyle(areaMark, {
|
|
@@ -69056,11 +69107,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
69056
69107
|
polarPointInterpolation(pointA, pointB, ratio) {
|
|
69057
69108
|
const polarPointA0 = this._pointToCoord(pointA);
|
|
69058
69109
|
const polarPointA1 = this._pointToCoord({ x: pointA.x1, y: pointA.y1 });
|
|
69110
|
+
const angleA0 = normalizeAngle$1(polarPointA0.angle);
|
|
69111
|
+
const angleA1 = normalizeAngle$1(polarPointA1.angle);
|
|
69059
69112
|
const polarPointB0 = this._pointToCoord(pointB);
|
|
69060
69113
|
const polarPointB1 = this._pointToCoord({ x: pointB.x1, y: pointB.y1 });
|
|
69061
|
-
const
|
|
69114
|
+
const angleB0 = normalizeAngle$1(polarPointB0.angle);
|
|
69115
|
+
const angleB1 = normalizeAngle$1(polarPointB1.angle);
|
|
69116
|
+
const angle0 = angleA0 + (angleB0 - angleA0) * ratio;
|
|
69062
69117
|
const radius0 = polarPointA0.radius + (polarPointB0.radius - polarPointA0.radius) * ratio;
|
|
69063
|
-
const angle1 =
|
|
69118
|
+
const angle1 = angleA1 + (angleB1 - angleA1) * ratio;
|
|
69064
69119
|
const radius1 = polarPointA1.radius + (polarPointB1.radius - polarPointA1.radius) * ratio;
|
|
69065
69120
|
const { x, y } = this._coordToPoint({ angle: angle0, radius: radius0 });
|
|
69066
69121
|
const { x: x1, y: y1 } = this._coordToPoint({ angle: angle1, radius: radius1 });
|
|
@@ -72086,7 +72141,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72086
72141
|
postProjection = options.postProjection;
|
|
72087
72142
|
let fontSize = options.fontSize ? field$1(options.fontSize) : 14;
|
|
72088
72143
|
const fontSizeRange = options.fontSizeRange;
|
|
72089
|
-
if (fontSizeRange && !isNumber$
|
|
72144
|
+
if (fontSizeRange && !isNumber$1(fontSize)) {
|
|
72090
72145
|
const fsize = fontSize,
|
|
72091
72146
|
fontSizeSqrtScale = generateSqrtScale(extent$1(fsize, data), fontSizeRange);
|
|
72092
72147
|
fontSize = datum => fontSizeSqrtScale(fsize(datum));
|
|
@@ -72124,7 +72179,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72124
72179
|
progressive: layout
|
|
72125
72180
|
} : layout.output();
|
|
72126
72181
|
};
|
|
72127
|
-
const field$1 = option => isString$1(option) || isNumber$
|
|
72182
|
+
const field$1 = option => isString$1(option) || isNumber$1(option) || isFunction$1(option) ? option : datum => datum[option.field],
|
|
72128
72183
|
sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x),
|
|
72129
72184
|
generateSqrtScale = (domain, range) => {
|
|
72130
72185
|
if (domain[0] === domain[1]) return datum => range[0];
|
|
@@ -73847,7 +73902,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73847
73902
|
}
|
|
73848
73903
|
_computeLabelLimit(datum, labelSpec) {
|
|
73849
73904
|
const limit = labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.limit;
|
|
73850
|
-
if (isNumber$
|
|
73905
|
+
if (isNumber$1(limit)) {
|
|
73851
73906
|
return limit;
|
|
73852
73907
|
}
|
|
73853
73908
|
const points = this.getPoints(datum);
|
|
@@ -74525,11 +74580,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74525
74580
|
}
|
|
74526
74581
|
_filterChildren(node) {
|
|
74527
74582
|
const maxDepth = this.options.maxDepth;
|
|
74528
|
-
if (isNumber$
|
|
74583
|
+
if (isNumber$1(maxDepth) && maxDepth >= 0 && node.depth >= maxDepth) return !1;
|
|
74529
74584
|
const minChildrenVisibleArea = this.options.minChildrenVisibleArea;
|
|
74530
|
-
if (isNumber$
|
|
74585
|
+
if (isNumber$1(minChildrenVisibleArea) && Math.abs((node.x1 - node.x0) * (node.y1 - node.y0)) < minChildrenVisibleArea) return !1;
|
|
74531
74586
|
const minChildrenVisibleSize = this.options.minChildrenVisibleSize;
|
|
74532
|
-
return !isNumber$
|
|
74587
|
+
return !isNumber$1(minChildrenVisibleSize) || !(Math.abs(node.x1 - node.x0) < minChildrenVisibleSize || Math.abs(node.y1 - node.y0) < minChildrenVisibleSize);
|
|
74533
74588
|
}
|
|
74534
74589
|
_layout(parent) {
|
|
74535
74590
|
var _a;
|
|
@@ -74889,7 +74944,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74889
74944
|
this.options = options;
|
|
74890
74945
|
const keyOption = null == options ? void 0 : options.nodeKey,
|
|
74891
74946
|
keyFunc = isFunction$1(keyOption) ? keyOption : keyOption ? field$3(keyOption) : null;
|
|
74892
|
-
this._getNodeKey = keyFunc, this._getPadding = isNumber$
|
|
74947
|
+
this._getNodeKey = keyFunc, this._getPadding = isNumber$1(null == options ? void 0 : options.padding) ? node => options.padding : isArray$1(null == options ? void 0 : options.padding) ? node => {
|
|
74893
74948
|
var _a;
|
|
74894
74949
|
return null !== (_a = options.padding[node.depth + 1]) && void 0 !== _a ? _a : 0;
|
|
74895
74950
|
} : () => 0, this._maxDepth = -1;
|
|
@@ -75923,13 +75978,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75923
75978
|
const ratio = clamp$1(parseFloat(nodeWidthOption.replace("%", "")) / 100, 0, 1);
|
|
75924
75979
|
let stepWidth = width / (this._maxDepth - 1 + ratio);
|
|
75925
75980
|
minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), nodeWidth = stepWidth * ratio, linkWidth = stepWidth * (1 - ratio), isEvenWidth = !0;
|
|
75926
|
-
} else if (isNumber$
|
|
75927
|
-
if (nodeWidth = nodeWidthOption, isNumber$
|
|
75981
|
+
} else if (isNumber$1(nodeWidthOption)) {
|
|
75982
|
+
if (nodeWidth = nodeWidthOption, isNumber$1(linkWidthOption)) linkWidth = linkWidthOption;else if (isNil$1(linkWidthOption)) {
|
|
75928
75983
|
let stepWidth = (width - nodeWidthOption) / (this._maxDepth - 1);
|
|
75929
75984
|
minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), linkWidth = stepWidth - nodeWidthOption;
|
|
75930
75985
|
}
|
|
75931
75986
|
isEvenWidth = !0;
|
|
75932
|
-
} else isFunction$1(nodeWidthOption) && isNumber$
|
|
75987
|
+
} else isFunction$1(nodeWidthOption) && isNumber$1(linkWidthOption) && (linkWidth = linkWidthOption);
|
|
75933
75988
|
const columns = [];
|
|
75934
75989
|
for (let i = 0, len = nodes.length; i < len; i++) {
|
|
75935
75990
|
const node = nodes[i];
|
|
@@ -76300,7 +76355,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76300
76355
|
key: undefined,
|
|
76301
76356
|
value: (datum) => {
|
|
76302
76357
|
if (datum.source) {
|
|
76303
|
-
if (isNumber$
|
|
76358
|
+
if (isNumber$1(datum.source)) {
|
|
76304
76359
|
const seriesKeys = this.series.getSeriesKeys();
|
|
76305
76360
|
return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
|
|
76306
76361
|
}
|
|
@@ -78553,10 +78608,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78553
78608
|
const innerRadius = toPercent((_c = options.innerRadius) !== null && _c !== void 0 ? _c : 0, maxRadius);
|
|
78554
78609
|
const outerRadius = toPercent(options.outerRadius, maxRadius);
|
|
78555
78610
|
const center = [
|
|
78556
|
-
isNumber$
|
|
78611
|
+
isNumber$1((_d = options.center) === null || _d === void 0 ? void 0 : _d[0])
|
|
78557
78612
|
? options.center[0]
|
|
78558
78613
|
: viewBox.x0 + toPercent((_f = (_e = options.center) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : '50%', viewBox.x1 - viewBox.x0),
|
|
78559
|
-
isNumber$
|
|
78614
|
+
isNumber$1((_g = options.center) === null || _g === void 0 ? void 0 : _g[1])
|
|
78560
78615
|
? options.center[1]
|
|
78561
78616
|
: viewBox.y0 + toPercent((_j = (_h = options.center) === null || _h === void 0 ? void 0 : _h[1]) !== null && _j !== void 0 ? _j : '50%', viewBox.y1 - viewBox.y0)
|
|
78562
78617
|
];
|
|
@@ -80331,7 +80386,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80331
80386
|
var _a;
|
|
80332
80387
|
const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];
|
|
80333
80388
|
const seriesSpec = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { boxPlot: spec.boxPlot, direction: (_a = spec.direction) !== null && _a !== void 0 ? _a : "vertical", minField: spec.minField, maxField: spec.maxField, q1Field: spec.q1Field, medianField: spec.medianField, q3Field: spec.q3Field, outliersField: spec.outliersField, outliersStyle: spec.outliersStyle });
|
|
80334
|
-
seriesSpec[seriesSpec.direction === "
|
|
80389
|
+
seriesSpec[seriesSpec.direction === "horizontal" ? 'xField' : 'yField'] = dataFields;
|
|
80335
80390
|
return seriesSpec;
|
|
80336
80391
|
}
|
|
80337
80392
|
transformSpec(spec) {
|
|
@@ -80786,7 +80841,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80786
80841
|
if (!targetAxis) {
|
|
80787
80842
|
return;
|
|
80788
80843
|
}
|
|
80789
|
-
axis.event.on(exports.ChartEvent.scaleDomainUpdate, { filter: ({ model }) => model.id === axis.id }, () => {
|
|
80844
|
+
axis.event.on(exports.ChartEvent.scaleDomainUpdate, { filter: ({ model }) => model.id === axis.id || model.id === targetAxis.id }, () => {
|
|
80790
80845
|
zeroAlign(targetAxis, axis);
|
|
80791
80846
|
});
|
|
80792
80847
|
}
|
|
@@ -81672,6 +81727,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81672
81727
|
});
|
|
81673
81728
|
}
|
|
81674
81729
|
getBoundsInRect(rect) {
|
|
81730
|
+
var _a;
|
|
81675
81731
|
let result = { x1: 0, y1: 0, x2: 0, y2: 0 };
|
|
81676
81732
|
if (!this._visible) {
|
|
81677
81733
|
return result;
|
|
@@ -81679,7 +81735,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81679
81735
|
this._verticalLimitSize = isXAxis(this.getOrient()) ? rect.height : rect.width;
|
|
81680
81736
|
this.setLayoutRect(rect);
|
|
81681
81737
|
const isChanged = this.updateScaleRange();
|
|
81682
|
-
if (isChanged || !isArray$1(this.getTickData().getLatestData())) {
|
|
81738
|
+
if (isChanged || !isArray$1((_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData())) {
|
|
81683
81739
|
this.computeData('range');
|
|
81684
81740
|
}
|
|
81685
81741
|
const context = { skipLayout: false };
|
|
@@ -81851,8 +81907,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81851
81907
|
return attrs;
|
|
81852
81908
|
}
|
|
81853
81909
|
getLabelItems(length) {
|
|
81854
|
-
|
|
81855
|
-
const tickLatestData =
|
|
81910
|
+
var _a;
|
|
81911
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
81856
81912
|
if (tickLatestData && tickLatestData.length) {
|
|
81857
81913
|
return [
|
|
81858
81914
|
tickLatestData
|
|
@@ -82251,14 +82307,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82251
82307
|
if (layerConfig.visible !== false && layerConfig.tickCount !== 0 && layerConfig.forceTickCount !== 0) {
|
|
82252
82308
|
const tickData = this._initTickDataSet(Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig), layer);
|
|
82253
82309
|
tickData.target.addListener('change', this._forceLayout.bind(this));
|
|
82254
|
-
|
|
82310
|
+
const compilableData = new CompilableData(this._option, tickData);
|
|
82311
|
+
this._tickData.push(compilableData);
|
|
82312
|
+
if (!this._tickDataMap) {
|
|
82313
|
+
this._tickDataMap = {};
|
|
82314
|
+
}
|
|
82315
|
+
this._tickDataMap[layer] = compilableData;
|
|
82255
82316
|
}
|
|
82256
82317
|
}
|
|
82257
82318
|
}
|
|
82258
82319
|
else {
|
|
82259
82320
|
const tickData = this._initTickDataSet(this._tickTransformOption());
|
|
82260
82321
|
tickData.target.addListener('change', this._forceLayout.bind(this));
|
|
82261
|
-
|
|
82322
|
+
const compilableData = new CompilableData(this._option, tickData);
|
|
82323
|
+
this._tickData = [compilableData];
|
|
82324
|
+
this._tickDataMap = {
|
|
82325
|
+
0: compilableData
|
|
82326
|
+
};
|
|
82262
82327
|
}
|
|
82263
82328
|
}
|
|
82264
82329
|
dataToPosition(values, cfg = {}) {
|
|
@@ -82353,30 +82418,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82353
82418
|
getLabelItems(length) {
|
|
82354
82419
|
const labelItems = [];
|
|
82355
82420
|
let preData = [];
|
|
82356
|
-
this.
|
|
82357
|
-
|
|
82358
|
-
|
|
82421
|
+
this._scales.forEach((scale, index) => {
|
|
82422
|
+
var _a;
|
|
82423
|
+
const tickData = this._tickDataMap[index];
|
|
82424
|
+
const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
|
|
82425
|
+
const ticks = isTickDataHaveData
|
|
82426
|
+
? tickData.getLatestData().map((obj) => obj.value)
|
|
82427
|
+
: scale.domain();
|
|
82428
|
+
if (ticks && ticks.length) {
|
|
82359
82429
|
if (preData && preData.length) {
|
|
82360
82430
|
const currentLabelItems = [];
|
|
82361
82431
|
const curData = [];
|
|
82362
82432
|
preData.forEach(value => {
|
|
82363
|
-
|
|
82364
|
-
const values = array(value).concat(
|
|
82433
|
+
ticks.forEach(tick => {
|
|
82434
|
+
const values = array(value).concat(tick);
|
|
82365
82435
|
curData.push(values);
|
|
82366
|
-
|
|
82367
|
-
|
|
82436
|
+
if (isTickDataHaveData) {
|
|
82437
|
+
const axisItem = getAxisItem(tick, this._getNormalizedValue(values, length));
|
|
82438
|
+
currentLabelItems.push(axisItem);
|
|
82439
|
+
}
|
|
82368
82440
|
});
|
|
82369
82441
|
});
|
|
82370
|
-
|
|
82442
|
+
if (isTickDataHaveData) {
|
|
82443
|
+
labelItems.push(currentLabelItems.filter((entry) => entry.value >= 0 && entry.value <= 1));
|
|
82444
|
+
}
|
|
82371
82445
|
preData = curData;
|
|
82372
82446
|
}
|
|
82373
82447
|
else {
|
|
82374
|
-
|
|
82375
|
-
.
|
|
82376
|
-
|
|
82377
|
-
|
|
82378
|
-
|
|
82379
|
-
|
|
82448
|
+
ticks.forEach(tick => {
|
|
82449
|
+
preData.push(tick);
|
|
82450
|
+
});
|
|
82451
|
+
if (isTickDataHaveData) {
|
|
82452
|
+
labelItems.push(tickData
|
|
82453
|
+
.getLatestData()
|
|
82454
|
+
.map((obj) => {
|
|
82455
|
+
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
82456
|
+
})
|
|
82457
|
+
.filter((entry) => entry.value >= 0 && entry.value <= 1));
|
|
82458
|
+
}
|
|
82380
82459
|
}
|
|
82381
82460
|
}
|
|
82382
82461
|
});
|
|
@@ -82546,16 +82625,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82546
82625
|
};
|
|
82547
82626
|
}
|
|
82548
82627
|
getLabelItems(length) {
|
|
82549
|
-
var _a;
|
|
82628
|
+
var _a, _b;
|
|
82550
82629
|
const items = [];
|
|
82551
|
-
const
|
|
82552
|
-
const tickLatestData = tickData.getLatestData();
|
|
82630
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
82553
82631
|
if (tickLatestData && tickLatestData.length) {
|
|
82554
82632
|
items.push(tickLatestData.map((obj) => {
|
|
82555
82633
|
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
82556
82634
|
}));
|
|
82557
82635
|
}
|
|
82558
|
-
const layerLatestData = (
|
|
82636
|
+
const layerLatestData = (_b = this._layerTickData) === null || _b === void 0 ? void 0 : _b.getLatestData();
|
|
82559
82637
|
if (layerLatestData && layerLatestData.length) {
|
|
82560
82638
|
items.push(layerLatestData.map((obj) => {
|
|
82561
82639
|
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
@@ -82955,8 +83033,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82955
83033
|
return length === 0 ? 0 : (this.dataToPosition(values) - this._getStartValue()) / length;
|
|
82956
83034
|
}
|
|
82957
83035
|
getLabelItems(length) {
|
|
82958
|
-
|
|
82959
|
-
const tickLatestData =
|
|
83036
|
+
var _a;
|
|
83037
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
82960
83038
|
if (tickLatestData && tickLatestData.length) {
|
|
82961
83039
|
return [
|
|
82962
83040
|
tickLatestData.map((obj) => {
|
|
@@ -85010,7 +85088,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85010
85088
|
this._handleClickInEvent = (params) => {
|
|
85011
85089
|
this._handleIn(params);
|
|
85012
85090
|
this._clickLock = this._hasActive && this._spec.lockAfterClick;
|
|
85013
|
-
if (this._clickLock && isNumber$
|
|
85091
|
+
if (this._clickLock && isNumber$1(this.triggerOff)) {
|
|
85014
85092
|
if (this._timer) {
|
|
85015
85093
|
clearTimeout(this._timer);
|
|
85016
85094
|
}
|
|
@@ -85225,7 +85303,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85225
85303
|
if (trigger) {
|
|
85226
85304
|
this.trigger = trigger;
|
|
85227
85305
|
}
|
|
85228
|
-
if (triggerOff === 'none' || (isNumber$
|
|
85306
|
+
if (triggerOff === 'none' || (isNumber$1(triggerOff) && triggerOff > 0)) {
|
|
85229
85307
|
this.triggerOff = triggerOff;
|
|
85230
85308
|
}
|
|
85231
85309
|
if (labelZIndex !== undefined) {
|
|
@@ -85249,7 +85327,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85249
85327
|
const _d = style, { strokeOpacity, fillOpacity, opacity, stroke, fill, lineWidth } = _d, restStyle = __rest$7(_d, ["strokeOpacity", "fillOpacity", "opacity", "stroke", "fill", "lineWidth"]);
|
|
85250
85328
|
const isLineType = hair.type === 'line';
|
|
85251
85329
|
let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
|
|
85252
|
-
if (isNumber$
|
|
85330
|
+
if (isNumber$1(opacity)) {
|
|
85253
85331
|
finalOpacity = (finalOpacity !== null && finalOpacity !== void 0 ? finalOpacity : 1) * opacity;
|
|
85254
85332
|
}
|
|
85255
85333
|
hair.style = Object.assign({ opacity: finalOpacity, pickable: false, visible: true }, restStyle);
|
|
@@ -86290,7 +86368,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86290
86368
|
var _a, _b;
|
|
86291
86369
|
const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
|
|
86292
86370
|
if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
|
|
86293
|
-
|
|
86371
|
+
this._shouldChange = false;
|
|
86294
86372
|
}
|
|
86295
86373
|
}
|
|
86296
86374
|
_isReverse() {
|
|
@@ -86350,6 +86428,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86350
86428
|
this.layoutType = 'none';
|
|
86351
86429
|
this._orient = 'left';
|
|
86352
86430
|
this._cacheVisibility = undefined;
|
|
86431
|
+
this._shouldChange = true;
|
|
86353
86432
|
this._stateField = 'x';
|
|
86354
86433
|
this._activeRoam = true;
|
|
86355
86434
|
this._zoomAttr = {
|
|
@@ -87165,7 +87244,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87165
87244
|
if (this._visible === false) {
|
|
87166
87245
|
return 0;
|
|
87167
87246
|
}
|
|
87168
|
-
if (isNumber$
|
|
87247
|
+
if (isNumber$1(this._spec.width)) {
|
|
87169
87248
|
return this._spec.width;
|
|
87170
87249
|
}
|
|
87171
87250
|
if (this._isHorizontal) {
|
|
@@ -87177,7 +87256,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87177
87256
|
if (this._visible === false) {
|
|
87178
87257
|
return 0;
|
|
87179
87258
|
}
|
|
87180
|
-
if (isNumber$
|
|
87259
|
+
if (isNumber$1(this._spec.height)) {
|
|
87181
87260
|
return this._spec.height;
|
|
87182
87261
|
}
|
|
87183
87262
|
if (this._isHorizontal) {
|
|
@@ -87239,24 +87318,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87239
87318
|
}
|
|
87240
87319
|
_handleChange(start, end, updateComponent, tag) {
|
|
87241
87320
|
super._handleChange(start, end, updateComponent);
|
|
87242
|
-
if (
|
|
87243
|
-
this._component
|
|
87244
|
-
|
|
87245
|
-
|
|
87246
|
-
|
|
87247
|
-
|
|
87248
|
-
|
|
87249
|
-
|
|
87250
|
-
|
|
87251
|
-
|
|
87252
|
-
|
|
87253
|
-
|
|
87254
|
-
|
|
87255
|
-
|
|
87256
|
-
|
|
87257
|
-
|
|
87258
|
-
|
|
87259
|
-
|
|
87321
|
+
if (this._shouldChange) {
|
|
87322
|
+
if (updateComponent && this._component) {
|
|
87323
|
+
this._component.setStartAndEnd(start, end);
|
|
87324
|
+
}
|
|
87325
|
+
this._start = start;
|
|
87326
|
+
this._end = end;
|
|
87327
|
+
const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
|
|
87328
|
+
if (hasChange) {
|
|
87329
|
+
this.event.emit(exports.ChartEvent.dataZoomChange, {
|
|
87330
|
+
model: this,
|
|
87331
|
+
value: {
|
|
87332
|
+
filterData: this._filterMode !== "axis",
|
|
87333
|
+
start,
|
|
87334
|
+
end,
|
|
87335
|
+
startValue: this._startValue,
|
|
87336
|
+
endValue: this._endValue,
|
|
87337
|
+
newDomain: this._newDomain
|
|
87338
|
+
}
|
|
87339
|
+
});
|
|
87340
|
+
}
|
|
87260
87341
|
}
|
|
87261
87342
|
}
|
|
87262
87343
|
_handleDataCollectionChange() {
|
|
@@ -87388,7 +87469,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87388
87469
|
}
|
|
87389
87470
|
}
|
|
87390
87471
|
_computeWidth() {
|
|
87391
|
-
if (isNumber$
|
|
87472
|
+
if (isNumber$1(this._spec.width)) {
|
|
87392
87473
|
return this._spec.width;
|
|
87393
87474
|
}
|
|
87394
87475
|
if (this._isHorizontal) {
|
|
@@ -87397,7 +87478,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87397
87478
|
return SCROLL_BAR_DEFAULT_SIZE;
|
|
87398
87479
|
}
|
|
87399
87480
|
_computeHeight() {
|
|
87400
|
-
if (isNumber$
|
|
87481
|
+
if (isNumber$1(this._spec.height)) {
|
|
87401
87482
|
return this._spec.height;
|
|
87402
87483
|
}
|
|
87403
87484
|
if (!this._isHorizontal) {
|
|
@@ -87426,24 +87507,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87426
87507
|
}
|
|
87427
87508
|
_handleChange(start, end, updateComponent) {
|
|
87428
87509
|
super._handleChange(start, end, updateComponent);
|
|
87429
|
-
if (
|
|
87430
|
-
this._component
|
|
87431
|
-
|
|
87432
|
-
|
|
87433
|
-
|
|
87434
|
-
|
|
87435
|
-
|
|
87436
|
-
|
|
87437
|
-
|
|
87438
|
-
|
|
87439
|
-
|
|
87440
|
-
|
|
87441
|
-
|
|
87442
|
-
|
|
87443
|
-
|
|
87444
|
-
|
|
87445
|
-
|
|
87446
|
-
|
|
87510
|
+
if (this._shouldChange) {
|
|
87511
|
+
if (updateComponent && this._component) {
|
|
87512
|
+
this._component.setAttribute('range', [start, end]);
|
|
87513
|
+
}
|
|
87514
|
+
this._start = start;
|
|
87515
|
+
this._end = end;
|
|
87516
|
+
const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
|
|
87517
|
+
if (hasChange) {
|
|
87518
|
+
this.event.emit(exports.ChartEvent.scrollBarChange, {
|
|
87519
|
+
model: this,
|
|
87520
|
+
value: {
|
|
87521
|
+
filterData: this._filterMode !== "axis",
|
|
87522
|
+
start: this._start,
|
|
87523
|
+
end: this._end,
|
|
87524
|
+
startValue: this._startValue,
|
|
87525
|
+
endValue: this._endValue,
|
|
87526
|
+
newDomain: this._newDomain
|
|
87527
|
+
}
|
|
87528
|
+
});
|
|
87529
|
+
}
|
|
87447
87530
|
}
|
|
87448
87531
|
}
|
|
87449
87532
|
_handleDataCollectionChange() {
|
|
@@ -87822,7 +87905,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87822
87905
|
function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint) {
|
|
87823
87906
|
var _a, _b;
|
|
87824
87907
|
const { relativeSeries } = refSeries;
|
|
87825
|
-
isNumber$
|
|
87908
|
+
isNumber$1(datum.x) &&
|
|
87826
87909
|
isNeedExtendDomain(xDomain, datum.x, autoRange) &&
|
|
87827
87910
|
((_b = relativeSeries === null || relativeSeries === void 0 ? void 0 : (_a = relativeSeries.getXAxisHelper()).setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_xAxis_extend', datum.x));
|
|
87828
87911
|
let x;
|
|
@@ -87837,7 +87920,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87837
87920
|
function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint) {
|
|
87838
87921
|
var _a, _b;
|
|
87839
87922
|
const { relativeSeries } = refSeries;
|
|
87840
|
-
isNumber$
|
|
87923
|
+
isNumber$1(datum.y) &&
|
|
87841
87924
|
isNeedExtendDomain(yDomain, datum.y, autoRange) &&
|
|
87842
87925
|
((_b = (_a = relativeSeries.getYAxisHelper()) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_yAxis_extend', datum.y));
|
|
87843
87926
|
let y;
|
|
@@ -87942,11 +88025,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87942
88025
|
const xValue = array(datum.x);
|
|
87943
88026
|
const yValue = array(datum.y);
|
|
87944
88027
|
xValue.length === 1 &&
|
|
87945
|
-
isNumber$
|
|
88028
|
+
isNumber$1(xValue[0]) &&
|
|
87946
88029
|
isNeedExtendDomain(xDomain, xValue[0], autoRange) &&
|
|
87947
88030
|
((_b = (_a = refRelativeSeries.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.setExtendDomain) === null || _b === void 0 ? void 0 : _b.call(_a, 'marker_xAxis_extend', xValue[0]));
|
|
87948
88031
|
yValue.length === 1 &&
|
|
87949
|
-
isNumber$
|
|
88032
|
+
isNumber$1(yValue[0]) &&
|
|
87950
88033
|
isNeedExtendDomain(yDomain, yValue[0], autoRange) &&
|
|
87951
88034
|
((_d = (_c = refRelativeSeries.getYAxisHelper()) === null || _c === void 0 ? void 0 : _c.setExtendDomain) === null || _d === void 0 ? void 0 : _d.call(_c, 'marker_yAxis_extend', yValue[0]));
|
|
87952
88035
|
points.push({
|
|
@@ -89152,7 +89235,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89152
89235
|
}
|
|
89153
89236
|
}
|
|
89154
89237
|
_computeWidth(rect) {
|
|
89155
|
-
if (isNumber$
|
|
89238
|
+
if (isNumber$1(this._spec.width)) {
|
|
89156
89239
|
return Math.min(rect.width, Number(this._spec.width));
|
|
89157
89240
|
}
|
|
89158
89241
|
if (isVertical(this._orient)) {
|
|
@@ -89161,7 +89244,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89161
89244
|
return rect.width;
|
|
89162
89245
|
}
|
|
89163
89246
|
_computeHeight(rect) {
|
|
89164
|
-
if (isNumber$
|
|
89247
|
+
if (isNumber$1(this._spec.height)) {
|
|
89165
89248
|
this._height = this._spec.height;
|
|
89166
89249
|
return Math.min(rect.height, Number(this._spec.height));
|
|
89167
89250
|
}
|
|
@@ -89297,22 +89380,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89297
89380
|
? (_c = series.getXAxisHelper()) === null || _c === void 0 ? void 0 : _c.isInverse()
|
|
89298
89381
|
: (_d = series.getYAxisHelper()) === null || _d === void 0 ? void 0 : _d.isInverse();
|
|
89299
89382
|
let position = originPosition;
|
|
89300
|
-
if (isString$1(originPosition) &&
|
|
89383
|
+
if (isString$1(originPosition) && originPosition === 'outside') {
|
|
89301
89384
|
position = (data) => {
|
|
89302
89385
|
const { data: datum } = data;
|
|
89303
89386
|
const dataField = series.getMeasureField()[0];
|
|
89304
|
-
|
|
89305
|
-
|
|
89306
|
-
|
|
89307
|
-
return positionMap[direction][index];
|
|
89308
|
-
}
|
|
89309
|
-
if (originPosition === 'inside-bottom') {
|
|
89310
|
-
return series.direction === 'horizontal' ? 'inside-left' : 'inside-bottom';
|
|
89311
|
-
}
|
|
89312
|
-
if (originPosition === 'inside-top') {
|
|
89313
|
-
return series.direction === 'horizontal' ? 'inside-right' : 'inside-top';
|
|
89314
|
-
}
|
|
89315
|
-
return originPosition;
|
|
89387
|
+
const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
|
|
89388
|
+
const index = ((datum === null || datum === void 0 ? void 0 : datum[dataField]) >= 0 && isInverse) || ((datum === null || datum === void 0 ? void 0 : datum[dataField]) < 0 && !isInverse) ? 1 : 0;
|
|
89389
|
+
return positionMap[direction][index];
|
|
89316
89390
|
};
|
|
89317
89391
|
}
|
|
89318
89392
|
let overlap;
|
|
@@ -89395,46 +89469,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89395
89469
|
const datum = label.data;
|
|
89396
89470
|
const attribute = textAttribute(labelInfo, datum, labelSpec.formatMethod);
|
|
89397
89471
|
const x = (datum) => {
|
|
89398
|
-
if (series.direction === "
|
|
89399
|
-
return series.totalPositionX(datum, 'index', 0.5);
|
|
89400
|
-
}
|
|
89401
|
-
if (pos === 'middle') {
|
|
89402
|
-
return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89403
|
-
}
|
|
89404
|
-
else if (pos === 'max') {
|
|
89405
|
-
return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
|
|
89406
|
-
}
|
|
89407
|
-
else if (pos === 'min') {
|
|
89408
|
-
return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
|
|
89409
|
-
}
|
|
89410
|
-
return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
|
|
89411
|
-
};
|
|
89412
|
-
const y = (datum) => {
|
|
89413
|
-
if (series.direction === "vertical") {
|
|
89472
|
+
if (series.direction === "horizontal") {
|
|
89414
89473
|
if (pos === 'middle') {
|
|
89415
|
-
return (series.
|
|
89474
|
+
return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89416
89475
|
}
|
|
89417
89476
|
else if (pos === 'max') {
|
|
89418
|
-
return series.
|
|
89477
|
+
return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
|
|
89419
89478
|
}
|
|
89420
89479
|
else if (pos === 'min') {
|
|
89421
|
-
return series.
|
|
89480
|
+
return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
|
|
89422
89481
|
}
|
|
89423
|
-
return series.
|
|
89482
|
+
return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
|
|
89483
|
+
}
|
|
89484
|
+
return series.totalPositionX(datum, 'index', 0.5);
|
|
89485
|
+
};
|
|
89486
|
+
const y = (datum) => {
|
|
89487
|
+
if (series.direction === "horizontal") {
|
|
89488
|
+
return series.totalPositionY(datum, 'index', 0.5);
|
|
89489
|
+
}
|
|
89490
|
+
if (pos === 'middle') {
|
|
89491
|
+
return (series.totalPositionY(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89492
|
+
}
|
|
89493
|
+
else if (pos === 'max') {
|
|
89494
|
+
return series.totalPositionY(datum, datum.end >= datum.start ? 'end' : 'start') - offset;
|
|
89424
89495
|
}
|
|
89425
|
-
|
|
89496
|
+
else if (pos === 'min') {
|
|
89497
|
+
return series.totalPositionY(datum, datum.end >= datum.start ? 'start' : 'end') + offset;
|
|
89498
|
+
}
|
|
89499
|
+
return series.totalPositionY(datum, 'end') + (datum.end >= datum.start ? -offset : offset);
|
|
89426
89500
|
};
|
|
89427
89501
|
attribute.x = x(datum);
|
|
89428
89502
|
attribute.y = y(datum);
|
|
89429
|
-
if (series.direction === "
|
|
89430
|
-
attribute.textBaseline =
|
|
89431
|
-
pos === 'middle'
|
|
89432
|
-
? pos
|
|
89433
|
-
: (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
|
|
89434
|
-
? 'bottom'
|
|
89435
|
-
: 'top';
|
|
89436
|
-
}
|
|
89437
|
-
else {
|
|
89503
|
+
if (series.direction === "horizontal") {
|
|
89438
89504
|
attribute.textAlign =
|
|
89439
89505
|
pos === 'middle'
|
|
89440
89506
|
? 'center'
|
|
@@ -89442,6 +89508,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89442
89508
|
? 'left'
|
|
89443
89509
|
: 'right';
|
|
89444
89510
|
}
|
|
89511
|
+
else {
|
|
89512
|
+
attribute.textBaseline =
|
|
89513
|
+
pos === 'middle'
|
|
89514
|
+
? pos
|
|
89515
|
+
: (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
|
|
89516
|
+
? 'bottom'
|
|
89517
|
+
: 'top';
|
|
89518
|
+
}
|
|
89445
89519
|
return createText(Object.assign(Object.assign({}, attribute), { id: label.id }));
|
|
89446
89520
|
});
|
|
89447
89521
|
},
|
|
@@ -91650,12 +91724,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91650
91724
|
const getActualTooltipPositionValue = (position, event) => {
|
|
91651
91725
|
let result;
|
|
91652
91726
|
if (isValid$1(position)) {
|
|
91653
|
-
if (isNumber$
|
|
91727
|
+
if (isNumber$1(position)) {
|
|
91654
91728
|
result = position;
|
|
91655
91729
|
}
|
|
91656
91730
|
else if (isFunction$1(position)) {
|
|
91657
91731
|
const tooltipPosition = position(event);
|
|
91658
|
-
if (isNumber$
|
|
91732
|
+
if (isNumber$1(tooltipPosition)) {
|
|
91659
91733
|
result = tooltipPosition;
|
|
91660
91734
|
}
|
|
91661
91735
|
}
|
|
@@ -92652,7 +92726,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92652
92726
|
_throttle(callback) {
|
|
92653
92727
|
const tooltipSpec = this._component.getSpec();
|
|
92654
92728
|
let wait;
|
|
92655
|
-
if (isNumber$
|
|
92729
|
+
if (isNumber$1(tooltipSpec.throttleInterval)) {
|
|
92656
92730
|
wait = tooltipSpec.throttleInterval;
|
|
92657
92731
|
}
|
|
92658
92732
|
else {
|
|
@@ -92671,14 +92745,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92671
92745
|
return Object.assign(Object.assign({}, DEFAULT_OPTIONS), { offsetX: (_a = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.offsetX, offsetY: (_b = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.offsetY });
|
|
92672
92746
|
}
|
|
92673
92747
|
_getTooltipBoxSize(actualTooltip, changePositionOnly) {
|
|
92674
|
-
var _a, _b, _c
|
|
92748
|
+
var _a, _b, _c;
|
|
92675
92749
|
if (!changePositionOnly || isNil$1(this._attributes)) {
|
|
92676
92750
|
const chartTheme = (_b = (_a = this._chartOption) === null || _a === void 0 ? void 0 : _a.getTheme()) !== null && _b !== void 0 ? _b : {};
|
|
92677
92751
|
this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);
|
|
92678
92752
|
}
|
|
92753
|
+
const { panel, panelDomHeight } = (_c = this._attributes) !== null && _c !== void 0 ? _c : {};
|
|
92679
92754
|
return {
|
|
92680
|
-
width:
|
|
92681
|
-
height:
|
|
92755
|
+
width: panel === null || panel === void 0 ? void 0 : panel.width,
|
|
92756
|
+
height: panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height
|
|
92682
92757
|
};
|
|
92683
92758
|
}
|
|
92684
92759
|
_getPointerPositionRelativeToTooltipParent(params) {
|
|
@@ -92834,7 +92909,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92834
92909
|
content: {},
|
|
92835
92910
|
shapeColumn: {
|
|
92836
92911
|
common: shapeStyle,
|
|
92837
|
-
items:
|
|
92912
|
+
items: contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.map(({ spaceRow }, i) => ({
|
|
92913
|
+
marginTop: '0px',
|
|
92914
|
+
marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px'
|
|
92915
|
+
})),
|
|
92838
92916
|
width: getPixelPropertyStr(shape.size),
|
|
92839
92917
|
marginRight: getPixelPropertyStr((_a = shape.spacing) !== null && _a !== void 0 ? _a : DEFAULT_SHAPE_SPACING)
|
|
92840
92918
|
},
|
|
@@ -93025,7 +93103,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93025
93103
|
fontWeight: 'normal'
|
|
93026
93104
|
};
|
|
93027
93105
|
const defaultShapeStyle = {
|
|
93028
|
-
lineHeight: 'normal'
|
|
93106
|
+
lineHeight: 'normal',
|
|
93107
|
+
boxSizing: 'border-box'
|
|
93029
93108
|
};
|
|
93030
93109
|
|
|
93031
93110
|
class ShapeModel extends BaseTooltipModel {
|
|
@@ -93064,7 +93143,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93064
93143
|
}
|
|
93065
93144
|
const { symbolType, fill, stroke, hollow = false } = option;
|
|
93066
93145
|
const size = option.size ? valueToHtml(option.size) : '8px';
|
|
93067
|
-
const marginTop = option.marginTop ? valueToHtml(option.marginTop) : '0px';
|
|
93068
93146
|
const lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + 'px' : '0px';
|
|
93069
93147
|
let fillString = 'currentColor';
|
|
93070
93148
|
const getStroke = () => (stroke ? valueToHtml(stroke) : fillString);
|
|
@@ -93088,7 +93166,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93088
93166
|
fillString = hollow ? 'none' : fill ? valueToHtml(fill) : 'currentColor';
|
|
93089
93167
|
return `
|
|
93090
93168
|
<svg width="${size}" height="${size}" viewBox="${viewBox}"
|
|
93091
|
-
style="display:
|
|
93169
|
+
style="display: block;">
|
|
93092
93170
|
<path
|
|
93093
93171
|
d="${path}"
|
|
93094
93172
|
style="fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}"
|
|
@@ -93114,7 +93192,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93114
93192
|
}
|
|
93115
93193
|
return `
|
|
93116
93194
|
<svg width="${size}" height="${size}" viewBox="-0.5 -0.5 1 1"
|
|
93117
|
-
style="display:
|
|
93195
|
+
style="display: block;">
|
|
93118
93196
|
${gradient}
|
|
93119
93197
|
<path
|
|
93120
93198
|
d="${path}"
|
|
@@ -93198,29 +93276,47 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93198
93276
|
super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));
|
|
93199
93277
|
const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
|
|
93200
93278
|
const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
|
|
93279
|
+
const getKeyItemStyle = (line, i) => {
|
|
93280
|
+
var _a, _b;
|
|
93281
|
+
const { key, isKeyAdaptive } = line;
|
|
93282
|
+
const { height } = contentAttributes[i];
|
|
93283
|
+
const { keyColumn } = tooltipStyle;
|
|
93284
|
+
const style = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), keyColumn.common), (_a = keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
|
|
93285
|
+
const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$1(key);
|
|
93286
|
+
if (!hasContent && !style.visibility) {
|
|
93287
|
+
style.visibility = 'hidden';
|
|
93288
|
+
}
|
|
93289
|
+
else {
|
|
93290
|
+
style.visibility = 'visible';
|
|
93291
|
+
}
|
|
93292
|
+
return style;
|
|
93293
|
+
};
|
|
93294
|
+
const getValueItemStyle = (line, i) => {
|
|
93295
|
+
var _a;
|
|
93296
|
+
const { height } = contentAttributes[i];
|
|
93297
|
+
const { valueColumn } = tooltipStyle;
|
|
93298
|
+
const style = mergeSpec({}, defaultValueStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), valueColumn.common), (_a = valueColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
|
|
93299
|
+
return style;
|
|
93300
|
+
};
|
|
93301
|
+
const getShapeItemStyle = (line, i) => {
|
|
93302
|
+
var _a, _b, _c, _d;
|
|
93303
|
+
const { height } = contentAttributes[i];
|
|
93304
|
+
const { shapeColumn } = tooltipStyle;
|
|
93305
|
+
const keyStyle = getKeyItemStyle(line, i);
|
|
93306
|
+
const paddingTop = `calc((${(_b = (_a = keyStyle.lineHeight) !== null && _a !== void 0 ? _a : keyStyle.fontSize) !== null && _b !== void 0 ? _b : '18px'} - ${(_c = shapeColumn.width) !== null && _c !== void 0 ? _c : '8px'}) / 2)`;
|
|
93307
|
+
const style = mergeSpec({}, defaultShapeStyle, Object.assign(Object.assign({ height: getPixelPropertyStr(height), paddingTop }, shapeColumn.common), (_d = shapeColumn.items) === null || _d === void 0 ? void 0 : _d[i]));
|
|
93308
|
+
return style;
|
|
93309
|
+
};
|
|
93201
93310
|
renderContent.forEach((line, i) => {
|
|
93202
|
-
var _a
|
|
93203
|
-
let childStyle = {};
|
|
93204
|
-
const { height, spaceRow = 0 } = contentAttributes[i];
|
|
93311
|
+
var _a;
|
|
93205
93312
|
if (this.className === 'key-box') {
|
|
93206
|
-
|
|
93207
|
-
childStyle = mergeSpec({}, isKeyAdaptive ? defaultAdaptiveKeyStyle : defaultKeyStyle, Object.assign(Object.assign(Object.assign({ height: getPixelPropertyStr(height) }, defaultLabelStyle), tooltipStyle.keyColumn.common), (_a = tooltipStyle.keyColumn.items) === null || _a === void 0 ? void 0 : _a[i]));
|
|
93208
|
-
const hasContent = (isString$1(key) && ((_b = key === null || key === void 0 ? void 0 : key.trim) === null || _b === void 0 ? void 0 : _b.call(key)) !== '') || isNumber$2(key);
|
|
93209
|
-
if (!hasContent && !childStyle.visibility) {
|
|
93210
|
-
childStyle.visibility = 'hidden';
|
|
93211
|
-
}
|
|
93212
|
-
else {
|
|
93213
|
-
childStyle.visibility = 'visible';
|
|
93214
|
-
}
|
|
93215
|
-
this.children[i].setStyle(childStyle);
|
|
93313
|
+
this.children[i].setStyle(getKeyItemStyle(line, i));
|
|
93216
93314
|
}
|
|
93217
93315
|
else if (this.className === 'value-box') {
|
|
93218
|
-
|
|
93219
|
-
this.children[i].setStyle(childStyle);
|
|
93316
|
+
this.children[i].setStyle(getValueItemStyle(line, i));
|
|
93220
93317
|
}
|
|
93221
93318
|
else if (this.className === 'shape-box') {
|
|
93222
|
-
|
|
93223
|
-
(_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setStyle(childStyle, this._getShapeSvgOption(line, i));
|
|
93319
|
+
(_a = this.children[i]) === null || _a === void 0 ? void 0 : _a.setStyle(getShapeItemStyle(line, i), this._getShapeSvgOption(line, i));
|
|
93224
93320
|
}
|
|
93225
93321
|
});
|
|
93226
93322
|
}
|
|
@@ -93233,7 +93329,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93233
93329
|
let childContent;
|
|
93234
93330
|
if (this.className === 'key-box') {
|
|
93235
93331
|
const keyContent = line.key;
|
|
93236
|
-
if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$
|
|
93332
|
+
if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$1(keyContent)) {
|
|
93237
93333
|
childContent = keyContent;
|
|
93238
93334
|
}
|
|
93239
93335
|
else {
|
|
@@ -93243,7 +93339,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93243
93339
|
}
|
|
93244
93340
|
else if (this.className === 'value-box') {
|
|
93245
93341
|
const valueContent = line.value;
|
|
93246
|
-
if ((isString$1(valueContent) && ((_d = valueContent === null || valueContent === void 0 ? void 0 : valueContent.trim) === null || _d === void 0 ? void 0 : _d.call(valueContent)) !== '') || isNumber$
|
|
93342
|
+
if ((isString$1(valueContent) && ((_d = valueContent === null || valueContent === void 0 ? void 0 : valueContent.trim) === null || _d === void 0 ? void 0 : _d.call(valueContent)) !== '') || isNumber$1(valueContent)) {
|
|
93247
93343
|
childContent = valueContent;
|
|
93248
93344
|
}
|
|
93249
93345
|
else {
|
|
@@ -93273,10 +93369,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93273
93369
|
}
|
|
93274
93370
|
}
|
|
93275
93371
|
_getShapeSvgOption(line, index) {
|
|
93276
|
-
var _a, _b, _c
|
|
93372
|
+
var _a, _b, _c;
|
|
93277
93373
|
const tooltipStyle = this._option.getTooltipStyle();
|
|
93278
93374
|
const shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), (_a = tooltipStyle.shapeColumn.items) === null || _a === void 0 ? void 0 : _a[index]);
|
|
93279
|
-
|
|
93375
|
+
Object.assign(Object.assign({}, tooltipStyle.keyColumn), (_b = tooltipStyle.keyColumn.items) === null || _b === void 0 ? void 0 : _b[index]);
|
|
93280
93376
|
return {
|
|
93281
93377
|
hasShape: line.hasShape,
|
|
93282
93378
|
symbolType: line.shapeType,
|
|
@@ -93285,7 +93381,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93285
93381
|
stroke: line.shapeStroke,
|
|
93286
93382
|
lineWidth: line.shapeLineWidth,
|
|
93287
93383
|
hollow: line.shapeHollow,
|
|
93288
|
-
marginTop: `calc((${(_e = (_d = keyColumn.lineHeight) !== null && _d !== void 0 ? _d : keyColumn.fontSize) !== null && _e !== void 0 ? _e : '18px'} - ${(_f = shapeColumn.width) !== null && _f !== void 0 ? _f : '8px'}) / 2)`,
|
|
93289
93384
|
index
|
|
93290
93385
|
};
|
|
93291
93386
|
}
|