@visactor/vchart 1.9.1 → 1.10.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +1130 -991
- 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/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/interface/spec.d.ts +5 -6
- package/cjs/component/axis/interface/spec.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/indicator/indicator.js.map +1 -1
- package/cjs/component/indicator/interface.d.ts +5 -5
- package/cjs/component/indicator/interface.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +4 -4
- package/cjs/component/label/interface.d.ts +6 -8
- package/cjs/component/label/interface.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.d.ts +1 -1
- package/cjs/component/label/util.js +10 -21
- package/cjs/component/label/util.js.map +1 -1
- package/cjs/component/legend/discrete/interface.d.ts +2 -2
- package/cjs/component/legend/discrete/interface.js.map +1 -1
- package/cjs/component/legend/util.d.ts +7 -1
- package/cjs/component/marker/interface.d.ts +6 -6
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/theme.d.ts +1 -1
- package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +15 -10
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/theme.d.ts +1 -1
- package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/interface/theme.d.ts +1 -1
- package/cjs/component/marker/mark-point/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/component/title/interface/spec.d.ts +18 -7
- package/cjs/component/title/interface/spec.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/mark/label.d.ts +2 -2
- package/cjs/mark/label.js.map +1 -1
- package/cjs/mark/text.d.ts +16 -7
- package/cjs/mark/text.js +12 -6
- package/cjs/mark/text.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/dot/interface.d.ts +2 -2
- package/cjs/series/dot/interface.js.map +1 -1
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/funnel/interface.d.ts +6 -4
- package/cjs/series/funnel/interface.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/line/interface.d.ts +1 -1
- package/cjs/series/line/interface.js.map +1 -1
- package/cjs/series/map/interface.d.ts +2 -5
- package/cjs/series/map/interface.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/interface.d.ts +3 -2
- package/cjs/series/pie/interface.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/interface.d.ts +5 -5
- package/cjs/series/range-column/interface.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/treemap/interface.d.ts +3 -2
- package/cjs/series/treemap/interface.js.map +1 -1
- package/cjs/series/treemap/treemap.js +10 -0
- package/cjs/series/treemap/treemap.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/interface.d.ts +2 -6
- package/cjs/series/word-cloud/interface.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/typings/spec/common.d.ts +16 -7
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/tooltip/line.js.map +1 -1
- package/cjs/typings/visual.d.ts +10 -5
- package/cjs/typings/visual.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/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/interface/spec.d.ts +5 -6
- package/esm/component/axis/interface/spec.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/indicator/indicator.js.map +1 -1
- package/esm/component/indicator/interface.d.ts +5 -5
- package/esm/component/indicator/interface.js.map +1 -1
- package/esm/component/label/base-label.d.ts +4 -4
- package/esm/component/label/interface.d.ts +6 -8
- package/esm/component/label/interface.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.d.ts +1 -1
- package/esm/component/label/util.js +10 -21
- package/esm/component/label/util.js.map +1 -1
- package/esm/component/legend/discrete/interface.d.ts +2 -2
- package/esm/component/legend/discrete/interface.js.map +1 -1
- package/esm/component/legend/util.d.ts +7 -1
- package/esm/component/marker/interface.d.ts +6 -6
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-area/interface/theme.d.ts +1 -1
- package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +15 -9
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/interface/theme.d.ts +1 -1
- package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/interface/theme.d.ts +1 -1
- package/esm/component/marker/mark-point/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/component/title/interface/spec.d.ts +18 -7
- package/esm/component/title/interface/spec.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/mark/label.d.ts +2 -2
- package/esm/mark/label.js.map +1 -1
- package/esm/mark/text.d.ts +16 -7
- package/esm/mark/text.js +13 -7
- package/esm/mark/text.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/dot/interface.d.ts +2 -2
- package/esm/series/dot/interface.js.map +1 -1
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/funnel/interface.d.ts +6 -4
- package/esm/series/funnel/interface.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/line/interface.d.ts +1 -1
- package/esm/series/line/interface.js.map +1 -1
- package/esm/series/map/interface.d.ts +2 -5
- package/esm/series/map/interface.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/interface.d.ts +3 -2
- package/esm/series/pie/interface.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/interface.d.ts +5 -5
- package/esm/series/range-column/interface.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/treemap/interface.d.ts +3 -2
- package/esm/series/treemap/interface.js.map +1 -1
- package/esm/series/treemap/treemap.js +8 -0
- package/esm/series/treemap/treemap.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/interface.d.ts +2 -6
- package/esm/series/word-cloud/interface.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/typings/spec/common.d.ts +16 -7
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/tooltip/line.js.map +1 -1
- package/esm/typings/visual.d.ts +10 -5
- package/esm/typings/visual.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 +14 -14
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;
|
|
@@ -8781,7 +8781,7 @@
|
|
|
8781
8781
|
strokeBoundsBuffer: 0,
|
|
8782
8782
|
keepDirIn3d: !0
|
|
8783
8783
|
});
|
|
8784
|
-
const DefaultRichTextAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
8784
|
+
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
|
|
8785
8785
|
width: 300,
|
|
8786
8786
|
height: 300,
|
|
8787
8787
|
ellipsis: !0,
|
|
@@ -9236,9 +9236,6 @@
|
|
|
9236
9236
|
function isNotAroundZero(val) {
|
|
9237
9237
|
return val > EPSILON || val < -EPSILON;
|
|
9238
9238
|
}
|
|
9239
|
-
function isNumber(data) {
|
|
9240
|
-
return "number" == typeof data && Number.isFinite(data);
|
|
9241
|
-
}
|
|
9242
9239
|
const _v0 = [0, 0],
|
|
9243
9240
|
_v1 = [0, 0],
|
|
9244
9241
|
_v2 = [0, 0];
|
|
@@ -10013,7 +10010,7 @@
|
|
|
10013
10010
|
}
|
|
10014
10011
|
const globalTheme = new Theme();
|
|
10015
10012
|
function getTheme$1(graphic, theme) {
|
|
10016
|
-
return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || globalTheme.getTheme();
|
|
10013
|
+
return graphic.glyphHost ? getTheme$1(graphic.glyphHost) : theme ? (graphic.isContainer, theme) : getThemeFromGroup(graphic) || graphic.attachedThemeGraphic && getTheme$1(graphic.attachedThemeGraphic) || globalTheme.getTheme();
|
|
10017
10014
|
}
|
|
10018
10015
|
function getThemeFromGroup(graphic) {
|
|
10019
10016
|
let g;
|
|
@@ -10178,10 +10175,13 @@
|
|
|
10178
10175
|
delete() {
|
|
10179
10176
|
this.parent && this.parent.removeChild(this);
|
|
10180
10177
|
}
|
|
10181
|
-
removeAllChild() {
|
|
10178
|
+
removeAllChild(deep) {
|
|
10182
10179
|
if (!this._idMap) return;
|
|
10183
10180
|
let child = this._firstChild;
|
|
10184
|
-
for (; child;)
|
|
10181
|
+
for (; child;) {
|
|
10182
|
+
const next = child._next;
|
|
10183
|
+
child.parent = null, child._prev = null, child._next = null, child = child._next, child = next;
|
|
10184
|
+
}
|
|
10185
10185
|
this._firstChild = null, this._lastChild = null, this._idMap.clear(), this._structEdit = !0, this.setCount(1 - this._count);
|
|
10186
10186
|
}
|
|
10187
10187
|
replaceChild(newChild, oldChild) {
|
|
@@ -11782,7 +11782,7 @@
|
|
|
11782
11782
|
}
|
|
11783
11783
|
onBind() {
|
|
11784
11784
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11785
|
-
this.fromNumber = isNumber$
|
|
11785
|
+
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
11786
|
}
|
|
11787
11787
|
onEnd() {}
|
|
11788
11788
|
onUpdate(end, ratio, out) {
|
|
@@ -12468,7 +12468,7 @@
|
|
|
12468
12468
|
return res;
|
|
12469
12469
|
};
|
|
12470
12470
|
const samplingPoints = (points, count) => {
|
|
12471
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
12471
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
|
|
12472
12472
|
if (0 === validatePoints.length) return [];
|
|
12473
12473
|
if (1 === validatePoints.length) return new Array(count).fill(0).map(i => validatePoints[0]);
|
|
12474
12474
|
const res = [];
|
|
@@ -12504,7 +12504,7 @@
|
|
|
12504
12504
|
var _a;
|
|
12505
12505
|
return res.concat(null !== (_a = seg.points) && void 0 !== _a ? _a : []);
|
|
12506
12506
|
}, []));
|
|
12507
|
-
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$
|
|
12507
|
+
const validatePoints = points.filter(point => !1 !== point.defined && isNumber$1(point.x) && isNumber$1(point.y));
|
|
12508
12508
|
if (!validatePoints.length) return [];
|
|
12509
12509
|
const allPoints = [];
|
|
12510
12510
|
validatePoints.forEach(point => {
|
|
@@ -13087,18 +13087,10 @@
|
|
|
13087
13087
|
class ResourceLoader {
|
|
13088
13088
|
static GetImage(url, mark) {
|
|
13089
13089
|
var _a;
|
|
13090
|
-
|
|
13090
|
+
const data = ResourceLoader.cache.get(url);
|
|
13091
13091
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(() => {
|
|
13092
13092
|
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)));
|
|
13093
|
+
}) : "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
13094
|
}
|
|
13103
13095
|
static GetSvg(svgStr, mark) {
|
|
13104
13096
|
var _a;
|
|
@@ -13124,8 +13116,60 @@
|
|
|
13124
13116
|
loadState: "init"
|
|
13125
13117
|
}, 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
13118
|
}
|
|
13119
|
+
static loading() {
|
|
13120
|
+
setTimeout(() => {
|
|
13121
|
+
if (!ResourceLoader.isLoading && ResourceLoader.toLoadAueue.length) {
|
|
13122
|
+
ResourceLoader.isLoading = !0;
|
|
13123
|
+
const tasks = ResourceLoader.toLoadAueue.splice(0, 10),
|
|
13124
|
+
promises = [];
|
|
13125
|
+
tasks.forEach(task => {
|
|
13126
|
+
const {
|
|
13127
|
+
url: url,
|
|
13128
|
+
marks: marks
|
|
13129
|
+
} = task,
|
|
13130
|
+
data = {
|
|
13131
|
+
type: "image",
|
|
13132
|
+
loadState: "init"
|
|
13133
|
+
};
|
|
13134
|
+
if (ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise) {
|
|
13135
|
+
data.waitingMark = marks;
|
|
13136
|
+
const end = data.dataPromise.then(res => {
|
|
13137
|
+
var _a;
|
|
13138
|
+
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) => {
|
|
13139
|
+
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
13140
|
+
});
|
|
13141
|
+
});
|
|
13142
|
+
promises.push(end);
|
|
13143
|
+
} else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
|
|
13144
|
+
}), Promise.all(promises).then(() => {
|
|
13145
|
+
ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
13146
|
+
}).catch(error => {
|
|
13147
|
+
console.error(error), ResourceLoader.isLoading = !1, ResourceLoader.loading();
|
|
13148
|
+
});
|
|
13149
|
+
}
|
|
13150
|
+
}, 0);
|
|
13151
|
+
}
|
|
13152
|
+
static loadImage(url, mark) {
|
|
13153
|
+
const index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
13154
|
+
if (-1 !== index) return ResourceLoader.toLoadAueue[index].marks.push(mark), void ResourceLoader.loading();
|
|
13155
|
+
ResourceLoader.toLoadAueue.push({
|
|
13156
|
+
url: url,
|
|
13157
|
+
marks: [mark]
|
|
13158
|
+
}), ResourceLoader.loading();
|
|
13159
|
+
}
|
|
13160
|
+
static improveImageLoading(url) {
|
|
13161
|
+
const index = getIndex(url, ResourceLoader.toLoadAueue);
|
|
13162
|
+
if (-1 !== index) {
|
|
13163
|
+
const elememt = ResourceLoader.toLoadAueue.splice(index, 1);
|
|
13164
|
+
ResourceLoader.toLoadAueue.unshift(elememt[0]);
|
|
13165
|
+
}
|
|
13166
|
+
}
|
|
13167
|
+
}
|
|
13168
|
+
function getIndex(url, arr) {
|
|
13169
|
+
for (let i = 0; i < arr.length; i++) if (arr[i].url === url) return i;
|
|
13170
|
+
return -1;
|
|
13127
13171
|
}
|
|
13128
|
-
ResourceLoader.cache = new Map();
|
|
13172
|
+
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
13129
13173
|
|
|
13130
13174
|
const tempMatrix = new Matrix(),
|
|
13131
13175
|
tempBounds$1 = new AABBBounds();
|
|
@@ -13221,7 +13265,7 @@
|
|
|
13221
13265
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
13222
13266
|
application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
13223
13267
|
const bounds = this.doUpdateAABBBounds(full);
|
|
13224
|
-
return
|
|
13268
|
+
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
13225
13269
|
}
|
|
13226
13270
|
combindShadowAABBBounds(bounds) {
|
|
13227
13271
|
if (this.shadowRoot) {
|
|
@@ -13230,7 +13274,8 @@
|
|
|
13230
13274
|
}
|
|
13231
13275
|
}
|
|
13232
13276
|
tryUpdateGlobalAABBBounds() {
|
|
13233
|
-
|
|
13277
|
+
const b = this.AABBBounds;
|
|
13278
|
+
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
13279
|
}
|
|
13235
13280
|
tryUpdateGlobalTransMatrix() {
|
|
13236
13281
|
if (this._globalTransMatrix) {
|
|
@@ -13741,7 +13786,7 @@
|
|
|
13741
13786
|
data: "init",
|
|
13742
13787
|
state: null
|
|
13743
13788
|
};
|
|
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);
|
|
13789
|
+
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
13790
|
}
|
|
13746
13791
|
imageLoadSuccess(url, image, cb) {
|
|
13747
13792
|
if (!this.resources) return;
|
|
@@ -14211,8 +14256,9 @@
|
|
|
14211
14256
|
return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
|
|
14212
14257
|
}
|
|
14213
14258
|
removeAllChild() {
|
|
14259
|
+
let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
|
|
14214
14260
|
this.forEachChildren(child => {
|
|
14215
|
-
application.graphicService.onRemove(child);
|
|
14261
|
+
application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
|
|
14216
14262
|
}), super.removeAllChild(), this.addUpdateBoundTag();
|
|
14217
14263
|
}
|
|
14218
14264
|
setStage(stage, layer) {
|
|
@@ -15538,7 +15584,7 @@
|
|
|
15538
15584
|
|
|
15539
15585
|
class BaseSymbol {
|
|
15540
15586
|
bounds(size, bounds) {
|
|
15541
|
-
if (isNumber$
|
|
15587
|
+
if (isNumber$1(size)) {
|
|
15542
15588
|
const halfS = size / 2;
|
|
15543
15589
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
15544
15590
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
@@ -15969,10 +16015,10 @@
|
|
|
15969
16015
|
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
16016
|
}
|
|
15971
16017
|
draw(ctx, size, x, y) {
|
|
15972
|
-
return isNumber$
|
|
16018
|
+
return isNumber$1(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
|
|
15973
16019
|
}
|
|
15974
16020
|
drawOffset(ctx, size, x, y, offset) {
|
|
15975
|
-
return isNumber$
|
|
16021
|
+
return isNumber$1(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
|
|
15976
16022
|
}
|
|
15977
16023
|
}
|
|
15978
16024
|
var rect = new RectSymbol();
|
|
@@ -16450,16 +16496,7 @@
|
|
|
16450
16496
|
deltaY = -height;
|
|
16451
16497
|
}
|
|
16452
16498
|
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
|
-
}
|
|
16499
|
+
"right" === this.globalAlign || "end" === this.globalAlign ? deltaX = -width : "center" === this.globalAlign && (deltaX = -width / 2);
|
|
16463
16500
|
let frameHeight = this[this.directionKey.height];
|
|
16464
16501
|
this.singleLine && (frameHeight = this.lines[0].height + 1);
|
|
16465
16502
|
let lastLineTag = !1;
|
|
@@ -16608,9 +16645,9 @@
|
|
|
16608
16645
|
let direction = this.direction;
|
|
16609
16646
|
if (this.verticalEllipsis) text = "...", direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
16610
16647
|
if ("hide" === this.ellipsis) return;
|
|
16611
|
-
if ("add" === this.ellipsis) text += "...", "right"
|
|
16648
|
+
if ("add" === this.ellipsis) text += "...", "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
16612
16649
|
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) {
|
|
16650
|
+
if (text = text.slice(0, index), text += "...", "right" === textAlign || "end" === textAlign) {
|
|
16614
16651
|
const {
|
|
16615
16652
|
width: width
|
|
16616
16653
|
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
@@ -16801,17 +16838,7 @@
|
|
|
16801
16838
|
maxHeight = this.height;
|
|
16802
16839
|
let x = this.left,
|
|
16803
16840
|
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) {
|
|
16841
|
+
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
16842
|
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
16843
|
});
|
|
16817
16844
|
}
|
|
@@ -17006,6 +17033,24 @@
|
|
|
17006
17033
|
getFrameCache() {
|
|
17007
17034
|
return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
|
|
17008
17035
|
}
|
|
17036
|
+
combinedStyleToCharacter(config) {
|
|
17037
|
+
const {
|
|
17038
|
+
fill: fill,
|
|
17039
|
+
stroke: stroke,
|
|
17040
|
+
fontSize: fontSize,
|
|
17041
|
+
fontFamily: fontFamily,
|
|
17042
|
+
fontStyle: fontStyle,
|
|
17043
|
+
fontWeight: fontWeight
|
|
17044
|
+
} = this.attribute;
|
|
17045
|
+
return Object.assign({
|
|
17046
|
+
fill: fill,
|
|
17047
|
+
stroke: stroke,
|
|
17048
|
+
fontSize: fontSize,
|
|
17049
|
+
fontFamily: fontFamily,
|
|
17050
|
+
fontStyle: fontStyle,
|
|
17051
|
+
fontWeight: fontWeight
|
|
17052
|
+
}, config);
|
|
17053
|
+
}
|
|
17009
17054
|
doUpdateFrameCache() {
|
|
17010
17055
|
var _a;
|
|
17011
17056
|
const {
|
|
@@ -17024,7 +17069,7 @@
|
|
|
17024
17069
|
} = this.attribute,
|
|
17025
17070
|
paragraphs = [];
|
|
17026
17071
|
for (let i = 0; i < textConfig.length; i++) if ("image" in textConfig[i]) {
|
|
17027
|
-
const config = textConfig[i],
|
|
17072
|
+
const config = this.combinedStyleToCharacter(textConfig[i]),
|
|
17028
17073
|
iconCache = config.id && this._frameCache && this._frameCache.icons && this._frameCache.icons.get(config.id);
|
|
17029
17074
|
if (iconCache) paragraphs.push(iconCache);else {
|
|
17030
17075
|
const icon = new RichTextIcon(config);
|
|
@@ -17034,11 +17079,11 @@
|
|
|
17034
17079
|
}, icon.richtextId = config.id, paragraphs.push(icon);
|
|
17035
17080
|
}
|
|
17036
17081
|
} else {
|
|
17037
|
-
const richTextConfig = textConfig[i];
|
|
17038
|
-
if (isNumber$
|
|
17082
|
+
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
17083
|
+
if (isNumber$1(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
17039
17084
|
const textParts = richTextConfig.text.split("\n");
|
|
17040
17085
|
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));
|
|
17086
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
17042
17087
|
}
|
|
17043
17088
|
const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
17044
17089
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -17283,7 +17328,7 @@
|
|
|
17283
17328
|
} = this.attribute;
|
|
17284
17329
|
if (0 === cornerRadius || "0%" === cornerRadius) return 0;
|
|
17285
17330
|
const deltaRadius = Math.abs(outerRadius - innerRadius);
|
|
17286
|
-
return Math.min(isNumber$
|
|
17331
|
+
return Math.min(isNumber$1(cornerRadius, !0) ? cornerRadius : deltaRadius * parseFloat(cornerRadius) / 100, deltaRadius / 2);
|
|
17287
17332
|
}
|
|
17288
17333
|
getParsedAngle() {
|
|
17289
17334
|
const arcTheme = getTheme$1(this).arc;
|
|
@@ -19127,7 +19172,7 @@
|
|
|
19127
19172
|
const halfPi = pi$1 / 2;
|
|
19128
19173
|
function createRectPath(path, x, y, width, height, rectCornerRadius) {
|
|
19129
19174
|
let cornerRadius;
|
|
19130
|
-
if (width < 0 && (x += width, width = -width), height < 0 && (y += height, height = -height), isNumber$
|
|
19175
|
+
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
19176
|
const cornerRadiusArr = rectCornerRadius;
|
|
19132
19177
|
let cr0, cr1;
|
|
19133
19178
|
switch (cornerRadiusArr.length) {
|
|
@@ -19235,7 +19280,7 @@
|
|
|
19235
19280
|
y = bounds.y1,
|
|
19236
19281
|
width = bounds.width(),
|
|
19237
19282
|
height = bounds.height();
|
|
19238
|
-
return isNumber$
|
|
19283
|
+
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
19284
|
x: x,
|
|
19240
19285
|
y: y,
|
|
19241
19286
|
width: width,
|
|
@@ -20092,11 +20137,12 @@
|
|
|
20092
20137
|
}
|
|
20093
20138
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
20094
20139
|
var _a, _b, _c, _d, _e;
|
|
20140
|
+
const {
|
|
20141
|
+
points: points
|
|
20142
|
+
} = area.attribute;
|
|
20143
|
+
if (points.length < 2) return;
|
|
20095
20144
|
context.beginPath();
|
|
20096
20145
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0,
|
|
20097
|
-
{
|
|
20098
|
-
points: points
|
|
20099
|
-
} = area.attribute,
|
|
20100
20146
|
startP = points[0];
|
|
20101
20147
|
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
20102
20148
|
for (let i = 1; i < points.length; i++) {
|
|
@@ -20253,6 +20299,7 @@
|
|
|
20253
20299
|
}
|
|
20254
20300
|
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, connect, fillCb, strokeCb) {
|
|
20255
20301
|
var _a, _b, _c, _d;
|
|
20302
|
+
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
20256
20303
|
let {
|
|
20257
20304
|
connectedType: connectedType,
|
|
20258
20305
|
connectedX: connectedX,
|
|
@@ -20261,7 +20308,6 @@
|
|
|
20261
20308
|
} = attribute;
|
|
20262
20309
|
const da = [];
|
|
20263
20310
|
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
20311
|
context.beginPath();
|
|
20266
20312
|
const {
|
|
20267
20313
|
points: points,
|
|
@@ -20930,7 +20976,9 @@
|
|
|
20930
20976
|
image: url
|
|
20931
20977
|
} = image.attribute;
|
|
20932
20978
|
if (!url || !image.resources) return;
|
|
20933
|
-
|
|
20979
|
+
const res = image.resources.get(url);
|
|
20980
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
20981
|
+
if ("success" !== res.state) return;
|
|
20934
20982
|
const {
|
|
20935
20983
|
context: context
|
|
20936
20984
|
} = renderService.drawParams;
|
|
@@ -20970,6 +21018,197 @@
|
|
|
20970
21018
|
},
|
|
20971
21019
|
__metadata$V = undefined && undefined.__metadata || function (k, v) {
|
|
20972
21020
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21021
|
+
};
|
|
21022
|
+
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
21023
|
+
const tempDirtyBounds = new AABBBounds();
|
|
21024
|
+
class ShadowRootDrawItemInterceptorContribution {
|
|
21025
|
+
constructor() {
|
|
21026
|
+
this.order = 1;
|
|
21027
|
+
}
|
|
21028
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21029
|
+
return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21030
|
+
}
|
|
21031
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21032
|
+
return graphic.attribute.shadowRootIdx < 0 && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21033
|
+
}
|
|
21034
|
+
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21035
|
+
if (!graphic.shadowRoot) return !1;
|
|
21036
|
+
const {
|
|
21037
|
+
context: context
|
|
21038
|
+
} = drawContext;
|
|
21039
|
+
if (context.highPerformanceSave(), context.transformFromMatrix(graphic.transMatrix, !0), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
21040
|
+
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
21041
|
+
const m = graphic.globalTransMatrix.getInverse();
|
|
21042
|
+
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
21043
|
+
}
|
|
21044
|
+
return drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix), context.highPerformanceRestore(), drawContribution.dirtyBounds && drawContribution.backupDirtyBounds && drawContribution.dirtyBounds.copy(tempDirtyBounds), !0;
|
|
21045
|
+
}
|
|
21046
|
+
}
|
|
21047
|
+
class DebugDrawItemInterceptorContribution {
|
|
21048
|
+
constructor() {
|
|
21049
|
+
this.order = 1;
|
|
21050
|
+
}
|
|
21051
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21052
|
+
return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params), !1;
|
|
21053
|
+
}
|
|
21054
|
+
drawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21055
|
+
if (!graphic.attribute._debug_bounds) return !1;
|
|
21056
|
+
const {
|
|
21057
|
+
context: context
|
|
21058
|
+
} = drawContext;
|
|
21059
|
+
context.highPerformanceSave(), graphic.parent && context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0), graphic.glyphHost && graphic.glyphHost.parent && context.setTransformFromMatrix(graphic.glyphHost.parent.globalTransMatrix, !0);
|
|
21060
|
+
const b = graphic.AABBBounds;
|
|
21061
|
+
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;
|
|
21062
|
+
}
|
|
21063
|
+
}
|
|
21064
|
+
let CommonDrawItemInterceptorContribution = class {
|
|
21065
|
+
constructor() {
|
|
21066
|
+
this.order = 1, this.interceptors = [new ShadowRootDrawItemInterceptorContribution(), new Canvas3DDrawItemInterceptor(), new InteractiveDrawItemInterceptorContribution(), new DebugDrawItemInterceptorContribution()];
|
|
21067
|
+
}
|
|
21068
|
+
afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21069
|
+
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;
|
|
21070
|
+
return !1;
|
|
21071
|
+
}
|
|
21072
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21073
|
+
if ((!graphic.in3dMode || drawContext.in3dInterceptor) && !graphic.shadowRoot && !(graphic.baseGraphic || graphic.attribute.globalZIndex || graphic.interactiveGraphic)) return !1;
|
|
21074
|
+
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;
|
|
21075
|
+
return !1;
|
|
21076
|
+
}
|
|
21077
|
+
};
|
|
21078
|
+
CommonDrawItemInterceptorContribution = __decorate$1d([injectable(), __metadata$V("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
21079
|
+
class InteractiveDrawItemInterceptorContribution {
|
|
21080
|
+
constructor() {
|
|
21081
|
+
this.order = 1;
|
|
21082
|
+
}
|
|
21083
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21084
|
+
return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
|
|
21085
|
+
}
|
|
21086
|
+
beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21087
|
+
let interactiveGraphic = graphic.interactiveGraphic;
|
|
21088
|
+
if (graphic.attribute.globalZIndex) {
|
|
21089
|
+
interactiveGraphic || (interactiveGraphic = graphic.clone(), graphic.interactiveGraphic = interactiveGraphic, interactiveGraphic.baseGraphic = graphic), interactiveGraphic.setAttributes({
|
|
21090
|
+
globalZIndex: 0,
|
|
21091
|
+
zIndex: graphic.attribute.globalZIndex
|
|
21092
|
+
}, !1, {
|
|
21093
|
+
skipUpdateCallback: !0
|
|
21094
|
+
}), drawContext.stage.tryInitInteractiveLayer();
|
|
21095
|
+
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21096
|
+
if (interactiveLayer) {
|
|
21097
|
+
this.getShadowRoot(interactiveLayer).add(interactiveGraphic);
|
|
21098
|
+
}
|
|
21099
|
+
return !0;
|
|
21100
|
+
}
|
|
21101
|
+
if (interactiveGraphic) {
|
|
21102
|
+
drawContext.stage.tryInitInteractiveLayer();
|
|
21103
|
+
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
21104
|
+
if (interactiveLayer) {
|
|
21105
|
+
this.getShadowRoot(interactiveLayer).removeChild(interactiveGraphic);
|
|
21106
|
+
}
|
|
21107
|
+
graphic.interactiveGraphic = null, interactiveGraphic.baseGraphic = null;
|
|
21108
|
+
}
|
|
21109
|
+
return !1;
|
|
21110
|
+
}
|
|
21111
|
+
beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
21112
|
+
const baseGraphic = graphic.baseGraphic;
|
|
21113
|
+
if (baseGraphic) {
|
|
21114
|
+
this.processing = !0;
|
|
21115
|
+
const {
|
|
21116
|
+
context: context
|
|
21117
|
+
} = drawContext;
|
|
21118
|
+
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;
|
|
21119
|
+
}
|
|
21120
|
+
return !1;
|
|
21121
|
+
}
|
|
21122
|
+
getShadowRoot(interactiveLayer) {
|
|
21123
|
+
var _a;
|
|
21124
|
+
let group = interactiveLayer.getElementById("_interactive_group");
|
|
21125
|
+
return group || (group = graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group", interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
|
|
21126
|
+
}
|
|
21127
|
+
}
|
|
21128
|
+
class Canvas3DDrawItemInterceptor {
|
|
21129
|
+
constructor() {
|
|
21130
|
+
this.order = 1;
|
|
21131
|
+
}
|
|
21132
|
+
beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
|
|
21133
|
+
if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
|
|
21134
|
+
drawContext.in3dInterceptor = !0;
|
|
21135
|
+
const {
|
|
21136
|
+
context: context,
|
|
21137
|
+
stage: stage
|
|
21138
|
+
} = renderService.drawParams;
|
|
21139
|
+
context.canvas;
|
|
21140
|
+
context.save(), this.initCanvasCtx(context), context.camera = stage.camera;
|
|
21141
|
+
const m = context.currentMatrix;
|
|
21142
|
+
m.a /= context.dpr, m.b /= context.dpr, m.c /= context.dpr, m.d /= context.dpr, m.e /= context.dpr, m.f /= context.dpr;
|
|
21143
|
+
const matrix = mat4Allocate.allocate();
|
|
21144
|
+
mat3Tomat4(matrix, m);
|
|
21145
|
+
const lastModelMatrix = context.modelMatrix;
|
|
21146
|
+
if (lastModelMatrix) {
|
|
21147
|
+
if (matrix) {
|
|
21148
|
+
const m = mat4Allocate.allocate();
|
|
21149
|
+
context.modelMatrix = multiplyMat4Mat4(m, lastModelMatrix, matrix);
|
|
21150
|
+
}
|
|
21151
|
+
} else context.modelMatrix = matrix;
|
|
21152
|
+
if (context.setTransform(1, 0, 0, 1, 0, 0, !0), graphic.isContainer) {
|
|
21153
|
+
let isPie = !1,
|
|
21154
|
+
is3d = !1;
|
|
21155
|
+
if (graphic.forEachChildren(c => (isPie = c.numberType === ARC3D_NUMBER_TYPE, !isPie)), graphic.forEachChildren(c => (is3d = !!c.findFace, !is3d)), isPie) {
|
|
21156
|
+
const children = graphic.getChildren(),
|
|
21157
|
+
sortedChildren = [...children];
|
|
21158
|
+
sortedChildren.sort((a, b) => {
|
|
21159
|
+
var _a, _b, _c, _d;
|
|
21160
|
+
let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2,
|
|
21161
|
+
angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
|
|
21162
|
+
for (; angle1 < 0;) angle1 += pi2;
|
|
21163
|
+
for (; angle2 < 0;) angle2 += pi2;
|
|
21164
|
+
return angle2 - angle1;
|
|
21165
|
+
}), sortedChildren.forEach(c => {
|
|
21166
|
+
c._next = null, c._prev = null;
|
|
21167
|
+
}), graphic.removeAllChild(), graphic.update(), sortedChildren.forEach(c => {
|
|
21168
|
+
graphic.appendChild(c);
|
|
21169
|
+
});
|
|
21170
|
+
const m = graphic.parent.globalTransMatrix;
|
|
21171
|
+
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 => {
|
|
21172
|
+
c._next = null, c._prev = null;
|
|
21173
|
+
}), children.forEach(c => {
|
|
21174
|
+
graphic.appendChild(c);
|
|
21175
|
+
});
|
|
21176
|
+
} else if (is3d) {
|
|
21177
|
+
const children = graphic.getChildren(),
|
|
21178
|
+
zChildren = children.map(g => ({
|
|
21179
|
+
ave_z: g.findFace().vertices.map(v => {
|
|
21180
|
+
var _a;
|
|
21181
|
+
return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
|
|
21182
|
+
}).reduce((a, b) => a + b, 0),
|
|
21183
|
+
g: g
|
|
21184
|
+
}));
|
|
21185
|
+
zChildren.sort((a, b) => b.ave_z - a.ave_z), graphic.removeAllChild(), zChildren.forEach(i => {
|
|
21186
|
+
i.g._next = null, i.g._prev = null;
|
|
21187
|
+
}), graphic.update(), zChildren.forEach(i => {
|
|
21188
|
+
graphic.add(i.g);
|
|
21189
|
+
}), drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix, !0), graphic.removeAllChild(), children.forEach(g => {
|
|
21190
|
+
g._next = null, g._prev = null;
|
|
21191
|
+
}), graphic.update(), children.forEach(g => {
|
|
21192
|
+
graphic.add(g);
|
|
21193
|
+
});
|
|
21194
|
+
} else drawContribution.renderGroup(graphic, drawContext, graphic.parent.globalTransMatrix);
|
|
21195
|
+
} else drawContribution.renderItem(graphic, drawContext);
|
|
21196
|
+
return context.camera = null, context.restore(), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, drawContext.in3dInterceptor = !1, !0;
|
|
21197
|
+
}
|
|
21198
|
+
initCanvasCtx(context) {
|
|
21199
|
+
context.setTransformForCurrent();
|
|
21200
|
+
}
|
|
21201
|
+
}
|
|
21202
|
+
|
|
21203
|
+
var __decorate$1c = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21204
|
+
var d,
|
|
21205
|
+
c = arguments.length,
|
|
21206
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21207
|
+
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);
|
|
21208
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21209
|
+
},
|
|
21210
|
+
__metadata$U = undefined && undefined.__metadata || function (k, v) {
|
|
21211
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
20973
21212
|
},
|
|
20974
21213
|
__param$z = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
20975
21214
|
return function (target, key) {
|
|
@@ -21008,7 +21247,7 @@
|
|
|
21008
21247
|
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params);
|
|
21009
21248
|
}
|
|
21010
21249
|
};
|
|
21011
|
-
DefaultRenderService = __decorate$
|
|
21250
|
+
DefaultRenderService = __decorate$1c([injectable(), __param$z(0, inject(DrawContribution)), __metadata$U("design:paramtypes", [Object])], DefaultRenderService);
|
|
21012
21251
|
|
|
21013
21252
|
var renderModule$1 = new ContainerModule(bind => {
|
|
21014
21253
|
bind(RenderService).to(DefaultRenderService).inSingletonScope();
|
|
@@ -21017,7 +21256,7 @@
|
|
|
21017
21256
|
const PickerService = Symbol.for("PickerService");
|
|
21018
21257
|
const GlobalPickerService = Symbol.for("GlobalPickerService");
|
|
21019
21258
|
|
|
21020
|
-
var __decorate$
|
|
21259
|
+
var __decorate$1b = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21021
21260
|
var d,
|
|
21022
21261
|
c = arguments.length,
|
|
21023
21262
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -21050,7 +21289,7 @@
|
|
|
21050
21289
|
return context.highPerformanceRestore(), result;
|
|
21051
21290
|
}
|
|
21052
21291
|
};
|
|
21053
|
-
ShadowRootPickItemInterceptorContribution = __decorate$
|
|
21292
|
+
ShadowRootPickItemInterceptorContribution = __decorate$1b([injectable()], ShadowRootPickItemInterceptorContribution);
|
|
21054
21293
|
let InteractivePickItemInterceptorContribution = class {
|
|
21055
21294
|
constructor() {
|
|
21056
21295
|
this.order = 1;
|
|
@@ -21069,7 +21308,7 @@
|
|
|
21069
21308
|
return null;
|
|
21070
21309
|
}
|
|
21071
21310
|
};
|
|
21072
|
-
InteractivePickItemInterceptorContribution = __decorate$
|
|
21311
|
+
InteractivePickItemInterceptorContribution = __decorate$1b([injectable()], InteractivePickItemInterceptorContribution);
|
|
21073
21312
|
let Canvas3DPickItemInterceptor = class {
|
|
21074
21313
|
constructor() {
|
|
21075
21314
|
this.order = 1;
|
|
@@ -21129,7 +21368,7 @@
|
|
|
21129
21368
|
context.setTransformForCurrent();
|
|
21130
21369
|
}
|
|
21131
21370
|
};
|
|
21132
|
-
Canvas3DPickItemInterceptor = __decorate$
|
|
21371
|
+
Canvas3DPickItemInterceptor = __decorate$1b([injectable()], Canvas3DPickItemInterceptor);
|
|
21133
21372
|
|
|
21134
21373
|
var pickModule = new ContainerModule((bind, unbind, isBound) => {
|
|
21135
21374
|
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 +21381,14 @@
|
|
|
21142
21381
|
const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
|
|
21143
21382
|
const PluginService = Symbol.for("PluginService");
|
|
21144
21383
|
|
|
21145
|
-
var __decorate$
|
|
21384
|
+
var __decorate$1a = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21146
21385
|
var d,
|
|
21147
21386
|
c = arguments.length,
|
|
21148
21387
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21149
21388
|
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
21389
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21151
21390
|
},
|
|
21152
|
-
__metadata$
|
|
21391
|
+
__metadata$T = undefined && undefined.__metadata || function (k, v) {
|
|
21153
21392
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21154
21393
|
},
|
|
21155
21394
|
__param$y = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
@@ -21192,7 +21431,7 @@
|
|
|
21192
21431
|
}), this.onRegisterPlugin = [];
|
|
21193
21432
|
}
|
|
21194
21433
|
};
|
|
21195
|
-
DefaultPluginService = __decorate$
|
|
21434
|
+
DefaultPluginService = __decorate$1a([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(AutoEnablePlugins)), __metadata$T("design:paramtypes", [Object])], DefaultPluginService);
|
|
21196
21435
|
|
|
21197
21436
|
var pluginModule = new ContainerModule(bind => {
|
|
21198
21437
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -21206,14 +21445,14 @@
|
|
|
21206
21445
|
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
21207
21446
|
});
|
|
21208
21447
|
|
|
21209
|
-
var __decorate$
|
|
21448
|
+
var __decorate$19 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21210
21449
|
var d,
|
|
21211
21450
|
c = arguments.length,
|
|
21212
21451
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21213
21452
|
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
21453
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21215
21454
|
},
|
|
21216
|
-
__metadata$
|
|
21455
|
+
__metadata$S = undefined && undefined.__metadata || function (k, v) {
|
|
21217
21456
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21218
21457
|
};
|
|
21219
21458
|
let CanvasLayerHandlerContribution = class {
|
|
@@ -21283,16 +21522,16 @@
|
|
|
21283
21522
|
this.canvas.release();
|
|
21284
21523
|
}
|
|
21285
21524
|
};
|
|
21286
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
21525
|
+
CanvasLayerHandlerContribution = __decorate$19([injectable(), __metadata$S("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
21287
21526
|
|
|
21288
|
-
var __decorate$
|
|
21527
|
+
var __decorate$18 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21289
21528
|
var d,
|
|
21290
21529
|
c = arguments.length,
|
|
21291
21530
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21292
21531
|
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
21532
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21294
21533
|
},
|
|
21295
|
-
__metadata$
|
|
21534
|
+
__metadata$R = undefined && undefined.__metadata || function (k, v) {
|
|
21296
21535
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21297
21536
|
};
|
|
21298
21537
|
let EmptyLayerHandlerContribution = class {
|
|
@@ -21327,16 +21566,16 @@
|
|
|
21327
21566
|
}
|
|
21328
21567
|
release() {}
|
|
21329
21568
|
};
|
|
21330
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
21569
|
+
EmptyLayerHandlerContribution = __decorate$18([injectable(), __metadata$R("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
21331
21570
|
|
|
21332
|
-
var __decorate$
|
|
21571
|
+
var __decorate$17 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21333
21572
|
var d,
|
|
21334
21573
|
c = arguments.length,
|
|
21335
21574
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
21336
21575
|
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
21576
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21338
21577
|
},
|
|
21339
|
-
__metadata$
|
|
21578
|
+
__metadata$Q = undefined && undefined.__metadata || function (k, v) {
|
|
21340
21579
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
21341
21580
|
};
|
|
21342
21581
|
let OffscreenLayerHandlerContribution = class {
|
|
@@ -21398,7 +21637,7 @@
|
|
|
21398
21637
|
}
|
|
21399
21638
|
merge(layerHandlers) {}
|
|
21400
21639
|
};
|
|
21401
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
21640
|
+
OffscreenLayerHandlerContribution = __decorate$17([injectable(), __metadata$Q("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
21402
21641
|
|
|
21403
21642
|
var layerHandlerModules = new ContainerModule(bind => {
|
|
21404
21643
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -21514,197 +21753,6 @@
|
|
|
21514
21753
|
return result;
|
|
21515
21754
|
}
|
|
21516
21755
|
|
|
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
21756
|
var __decorate$16 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
21709
21757
|
var d,
|
|
21710
21758
|
c = arguments.length,
|
|
@@ -21746,20 +21794,26 @@
|
|
|
21746
21794
|
height: height
|
|
21747
21795
|
} = drawContext;
|
|
21748
21796
|
if (!context) return;
|
|
21797
|
+
if (drawContext.keepMatrix) {
|
|
21798
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
21799
|
+
const t = context.nativeContext.getTransform();
|
|
21800
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
21801
|
+
}
|
|
21802
|
+
} else context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
21749
21803
|
const dirtyBounds = this.dirtyBounds.setValue(0, 0, width, height);
|
|
21750
21804
|
if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {
|
|
21751
21805
|
const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, !1);
|
|
21752
21806
|
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
21807
|
}
|
|
21754
21808
|
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)
|
|
21809
|
+
(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
21810
|
const drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
21757
21811
|
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
21812
|
var _a, _b;
|
|
21759
21813
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
21760
21814
|
}).forEach(group => {
|
|
21761
21815
|
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;
|
|
21816
|
+
}), context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1);
|
|
21763
21817
|
}
|
|
21764
21818
|
doRegister() {
|
|
21765
21819
|
throw new Error("暂不支持");
|
|
@@ -22160,14 +22214,22 @@
|
|
|
22160
22214
|
x = 0,
|
|
22161
22215
|
y = 0
|
|
22162
22216
|
} = drawContext;
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22217
|
+
if (context) {
|
|
22218
|
+
if (drawContext.keepMatrix) {
|
|
22219
|
+
if (context.nativeContext && context.nativeContext.getTransform) {
|
|
22220
|
+
const t = context.nativeContext.getTransform();
|
|
22221
|
+
context.setTransformFromMatrix(t, !0, 1);
|
|
22222
|
+
}
|
|
22223
|
+
} else context.inuse = !0, context.clearMatrix();
|
|
22224
|
+
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) => {
|
|
22225
|
+
var _a, _b;
|
|
22226
|
+
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
22227
|
+
}).forEach(group => {
|
|
22228
|
+
this.renderGroup(group, drawContext);
|
|
22229
|
+
}), this.hooks.completeDraw.tap("top-draw", () => {
|
|
22230
|
+
context.restore(), context.restore(), context.draw(), drawContext.keepMatrix || (context.inuse = !1), this.rendering = !1;
|
|
22231
|
+
});
|
|
22232
|
+
}
|
|
22171
22233
|
});
|
|
22172
22234
|
}
|
|
22173
22235
|
_increaseRender(group, drawContext) {
|
|
@@ -22360,6 +22422,8 @@
|
|
|
22360
22422
|
activate(context) {
|
|
22361
22423
|
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
|
|
22362
22424
|
stage && stage === this.pluginService.stage && this.drawHTML(context.stage.renderService);
|
|
22425
|
+
}), application.graphicService.hooks.onRemove.tap(this.key, graphic => {
|
|
22426
|
+
this.removeDom(graphic);
|
|
22363
22427
|
}), application.graphicService.hooks.onRelease.tap(this.key, graphic => {
|
|
22364
22428
|
this.removeDom(graphic);
|
|
22365
22429
|
});
|
|
@@ -22404,28 +22468,29 @@
|
|
|
22404
22468
|
} = html;
|
|
22405
22469
|
graphic.bindDom || (graphic.bindDom = new Map());
|
|
22406
22470
|
const lastDom = graphic.bindDom.get(dom);
|
|
22407
|
-
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22471
|
+
let wrapGroup, nativeContainer;
|
|
22472
|
+
if (!lastDom || container && container !== lastDom.container) {
|
|
22473
|
+
let nativeDom;
|
|
22474
|
+
graphic.bindDom.forEach(_ref => {
|
|
22475
|
+
let {
|
|
22476
|
+
wrapGroup: wrapGroup
|
|
22477
|
+
} = _ref;
|
|
22478
|
+
application.global.removeDom(wrapGroup);
|
|
22479
|
+
}), "string" == typeof dom ? (nativeDom = new DOMParser().parseFromString(dom, "text/html").firstChild, nativeDom.lastChild && (nativeDom = nativeDom.lastChild.firstChild)) : nativeDom = dom;
|
|
22480
|
+
const _container = container || (!0 === stage.params.enableHtmlAttribute ? null : stage.params.enableHtmlAttribute);
|
|
22481
|
+
nativeContainer = _container ? "string" == typeof _container ? application.global.getElementById(_container) : _container : graphic.stage.window.getContainer(), wrapGroup = application.global.createDom({
|
|
22482
|
+
tagName: "div",
|
|
22483
|
+
width: width,
|
|
22484
|
+
height: height,
|
|
22485
|
+
style: style,
|
|
22486
|
+
parent: nativeContainer
|
|
22487
|
+
}), wrapGroup && (wrapGroup.appendChild(nativeDom), graphic.bindDom.set(dom, {
|
|
22488
|
+
dom: nativeDom,
|
|
22489
|
+
container: container,
|
|
22411
22490
|
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");
|
|
22491
|
+
}));
|
|
22492
|
+
} else wrapGroup = lastDom.wrapGroup, nativeContainer = wrapGroup.parentNode;
|
|
22493
|
+
wrapGroup.style.pointerEvents = "none", wrapGroup.style.position || (wrapGroup.style.position = "absolute", nativeContainer.style.position = "relative");
|
|
22429
22494
|
let left = 0,
|
|
22430
22495
|
top = 0;
|
|
22431
22496
|
const b = graphic.globalAABBBounds;
|
|
@@ -22468,34 +22533,48 @@
|
|
|
22468
22533
|
constructor() {
|
|
22469
22534
|
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
22470
22535
|
}
|
|
22536
|
+
pauseLayout(p) {
|
|
22537
|
+
this.pause = p;
|
|
22538
|
+
}
|
|
22539
|
+
tryLayoutChildren(graphic) {
|
|
22540
|
+
graphic.firstChild && this.tryLayout(graphic.firstChild);
|
|
22541
|
+
}
|
|
22471
22542
|
tryLayout(graphic) {
|
|
22472
|
-
|
|
22473
|
-
this.
|
|
22543
|
+
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
22544
|
+
if (this.pause) return;
|
|
22474
22545
|
const p = graphic.parent;
|
|
22475
|
-
if (!
|
|
22546
|
+
if (!(force || p && graphic.needUpdateLayout())) return;
|
|
22476
22547
|
const theme = getTheme$1(p).group,
|
|
22477
22548
|
{
|
|
22478
22549
|
display = theme.display
|
|
22479
22550
|
} = p.attribute;
|
|
22480
22551
|
if ("flex" !== display) return;
|
|
22481
22552
|
const {
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22553
|
+
flexDirection = theme.flexDirection,
|
|
22554
|
+
flexWrap = theme.flexWrap,
|
|
22555
|
+
alignItems = theme.alignItems,
|
|
22556
|
+
clip = theme.clip
|
|
22557
|
+
} = p.attribute,
|
|
22558
|
+
{
|
|
22559
|
+
alignContent = null != alignItems ? alignItems : theme.alignContent
|
|
22560
|
+
} = p.attribute;
|
|
22561
|
+
let {
|
|
22562
|
+
width: width,
|
|
22563
|
+
height: height,
|
|
22564
|
+
justifyContent = theme.justifyContent
|
|
22488
22565
|
} = p.attribute;
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22566
|
+
const children = p.getChildren();
|
|
22567
|
+
if (null == width || null == height) {
|
|
22568
|
+
let childrenWidth = 0,
|
|
22569
|
+
childrenHeight = 0,
|
|
22570
|
+
boundsLegal = 0;
|
|
22571
|
+
if (children.forEach(child => {
|
|
22572
|
+
const bounds = this.getAABBBounds(child);
|
|
22573
|
+
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);
|
|
22574
|
+
}), !isFinite(boundsLegal)) return;
|
|
22575
|
+
width = childrenWidth, height = childrenHeight;
|
|
22576
|
+
}
|
|
22577
|
+
p.attribute.width = width, p.attribute.height = height, this.tempBounds.copy(p._AABBBounds);
|
|
22499
22578
|
const result = {
|
|
22500
22579
|
main: {
|
|
22501
22580
|
len: width,
|
|
@@ -22504,18 +22583,18 @@
|
|
|
22504
22583
|
cross: {
|
|
22505
22584
|
len: height,
|
|
22506
22585
|
field: "y"
|
|
22507
|
-
}
|
|
22508
|
-
dir: 1
|
|
22586
|
+
}
|
|
22509
22587
|
},
|
|
22510
22588
|
main = result.main,
|
|
22511
22589
|
cross = result.cross;
|
|
22512
|
-
"
|
|
22590
|
+
"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
22591
|
let mainLen = 0,
|
|
22514
22592
|
crossLen = 0;
|
|
22515
22593
|
const mianLenArray = [];
|
|
22516
|
-
|
|
22517
|
-
const b = c
|
|
22518
|
-
|
|
22594
|
+
children.forEach(c => {
|
|
22595
|
+
const b = this.getAABBBounds(c);
|
|
22596
|
+
if (b.empty()) return;
|
|
22597
|
+
const ml = "x" === main.field ? b.width() : b.height(),
|
|
22519
22598
|
cl = "x" === cross.field ? b.width() : b.height();
|
|
22520
22599
|
mianLenArray.push({
|
|
22521
22600
|
mainLen: ml,
|
|
@@ -22550,107 +22629,168 @@
|
|
|
22550
22629
|
mainLen: mainLen,
|
|
22551
22630
|
crossLen: crossLen
|
|
22552
22631
|
});
|
|
22553
|
-
const children = p.getChildren();
|
|
22554
22632
|
let lastIdx = 0;
|
|
22555
22633
|
if (mainList.forEach(s => {
|
|
22556
22634
|
this.layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, s), lastIdx = s.idx + 1;
|
|
22557
22635
|
}), 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
|
-
});
|
|
22636
|
+
const anchorPosMap = {
|
|
22637
|
+
"flex-start": 0,
|
|
22638
|
+
"flex-end": cross.len,
|
|
22639
|
+
center: cross.len / 2
|
|
22640
|
+
};
|
|
22641
|
+
this.layoutCross(children, alignItems, cross, anchorPosMap, mianLenArray, mainList[0], 0);
|
|
22567
22642
|
} else if ("flex-start" === alignContent) {
|
|
22568
22643
|
lastIdx = 0;
|
|
22569
22644
|
let anchorPos = 0;
|
|
22570
22645
|
mainList.forEach((s, i) => {
|
|
22571
|
-
|
|
22646
|
+
const anchorPosMap = {
|
|
22647
|
+
"flex-start": anchorPos,
|
|
22648
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22649
|
+
center: anchorPos + s.crossLen / 2
|
|
22650
|
+
};
|
|
22651
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
22572
22652
|
});
|
|
22573
22653
|
} else if ("center" === alignContent) {
|
|
22574
22654
|
lastIdx = 0;
|
|
22575
22655
|
let anchorPos = Math.max(0, (cross.len - crossLen) / 2);
|
|
22576
22656
|
mainList.forEach((s, i) => {
|
|
22577
|
-
|
|
22657
|
+
const anchorPosMap = {
|
|
22658
|
+
"flex-start": anchorPos,
|
|
22659
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22660
|
+
center: anchorPos + s.crossLen / 2
|
|
22661
|
+
};
|
|
22662
|
+
this.layoutCross(children, "center", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen;
|
|
22578
22663
|
});
|
|
22579
22664
|
} else if ("space-around" === alignContent) {
|
|
22580
22665
|
lastIdx = 0;
|
|
22581
22666
|
const padding = Math.max(0, (cross.len - crossLen) / mainList.length / 2);
|
|
22582
22667
|
let anchorPos = padding;
|
|
22583
22668
|
mainList.forEach((s, i) => {
|
|
22584
|
-
|
|
22669
|
+
const anchorPosMap = {
|
|
22670
|
+
"flex-start": anchorPos,
|
|
22671
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22672
|
+
center: anchorPos + s.crossLen / 2
|
|
22673
|
+
};
|
|
22674
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
22585
22675
|
});
|
|
22586
22676
|
} else if ("space-between" === alignContent) {
|
|
22587
22677
|
lastIdx = 0;
|
|
22588
22678
|
const padding = Math.max(0, (cross.len - crossLen) / (2 * mainList.length - 2));
|
|
22589
22679
|
let anchorPos = 0;
|
|
22590
22680
|
mainList.forEach((s, i) => {
|
|
22591
|
-
|
|
22681
|
+
const anchorPosMap = {
|
|
22682
|
+
"flex-start": anchorPos,
|
|
22683
|
+
"flex-end": anchorPos + s.crossLen,
|
|
22684
|
+
center: anchorPos + s.crossLen / 2
|
|
22685
|
+
};
|
|
22686
|
+
this.layoutCross(children, "flex-start", cross, anchorPosMap, mianLenArray, mainList[i], lastIdx), lastIdx = s.idx + 1, anchorPos += s.crossLen + 2 * padding;
|
|
22592
22687
|
});
|
|
22593
22688
|
}
|
|
22594
22689
|
children.forEach((child, idx) => {
|
|
22595
22690
|
child.addUpdateBoundTag(), child.addUpdatePositionTag(), child.clearUpdateLayoutTag();
|
|
22596
|
-
}), p.addUpdateLayoutTag()
|
|
22691
|
+
}), p.addUpdateLayoutTag();
|
|
22692
|
+
const b = this.getAABBBounds(p);
|
|
22693
|
+
clip || this.tempBounds.equals(b) || this.tryLayout(p, !1);
|
|
22694
|
+
}
|
|
22695
|
+
getAABBBounds(graphic) {
|
|
22696
|
+
this.skipBoundsTrigger = !0;
|
|
22697
|
+
const b = graphic.AABBBounds;
|
|
22698
|
+
return this.skipBoundsTrigger = !1, b;
|
|
22699
|
+
}
|
|
22700
|
+
updateChildPos(posBaseLeftTop, lastP, lastBP) {
|
|
22701
|
+
return posBaseLeftTop + (null != lastP ? lastP : 0) - lastBP;
|
|
22597
22702
|
}
|
|
22598
22703
|
layoutMain(p, children, justifyContent, main, mianLenArray, lastIdx, currSeg) {
|
|
22599
22704
|
if ("flex-start" === justifyContent) {
|
|
22600
22705
|
let pos = 0;
|
|
22601
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22706
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22707
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22708
|
+
b = this.getAABBBounds(children[i]);
|
|
22709
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22710
|
+
}
|
|
22602
22711
|
} else if ("flex-end" === justifyContent) {
|
|
22603
22712
|
let pos = main.len;
|
|
22604
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22713
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22714
|
+
pos -= mianLenArray[i].mainLen;
|
|
22715
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22716
|
+
b = this.getAABBBounds(children[i]);
|
|
22717
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`]));
|
|
22718
|
+
}
|
|
22605
22719
|
} else if ("space-around" === justifyContent) {
|
|
22606
22720
|
if (currSeg.mainLen >= main.len) {
|
|
22607
22721
|
let pos = 0;
|
|
22608
|
-
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;
|
|
22726
|
+
}
|
|
22609
22727
|
} else {
|
|
22610
22728
|
const size = currSeg.idx - lastIdx + 1,
|
|
22611
22729
|
padding = (main.len - currSeg.mainLen) / size / 2;
|
|
22612
22730
|
let pos = padding;
|
|
22613
|
-
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 + 2 * padding;
|
|
22735
|
+
}
|
|
22614
22736
|
}
|
|
22615
22737
|
} else if ("space-between" === justifyContent) {
|
|
22616
22738
|
if (currSeg.mainLen >= main.len) {
|
|
22617
22739
|
let pos = 0;
|
|
22618
|
-
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;
|
|
22744
|
+
}
|
|
22619
22745
|
} else {
|
|
22620
22746
|
const size = currSeg.idx - lastIdx + 1,
|
|
22621
22747
|
padding = (main.len - currSeg.mainLen) / (2 * size - 2);
|
|
22622
22748
|
let pos = 0;
|
|
22623
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22749
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22750
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22751
|
+
b = this.getAABBBounds(children[i]);
|
|
22752
|
+
!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;
|
|
22753
|
+
}
|
|
22624
22754
|
}
|
|
22625
22755
|
} else if ("center" === justifyContent) {
|
|
22626
22756
|
let pos = (main.len - currSeg.mainLen) / 2;
|
|
22627
|
-
for (let i = lastIdx; i <= currSeg.idx; i++)
|
|
22757
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22758
|
+
const posBaseLeftTop = pos + getPadding(children[i], main.field),
|
|
22759
|
+
b = this.getAABBBounds(children[i]);
|
|
22760
|
+
!b.empty() && (children[i].attribute[main.field] = this.updateChildPos(posBaseLeftTop, children[i].attribute[main.field], b[`${main.field}1`])), pos += mianLenArray[i].mainLen;
|
|
22761
|
+
}
|
|
22628
22762
|
}
|
|
22629
22763
|
}
|
|
22630
|
-
layoutCross(children, alignItem, cross,
|
|
22631
|
-
|
|
22764
|
+
layoutCross(children, alignItem, cross, anchorPosMap, lenArray, currSeg, lastIdx) {
|
|
22765
|
+
var _a;
|
|
22766
|
+
for (let i = lastIdx; i <= currSeg.idx; i++) {
|
|
22767
|
+
const child = children[i];
|
|
22768
|
+
let {
|
|
22769
|
+
alignSelf: alignSelf
|
|
22770
|
+
} = child.attribute;
|
|
22771
|
+
alignSelf && "auto" !== alignSelf || (alignSelf = alignItem);
|
|
22772
|
+
const b = this.getAABBBounds(child),
|
|
22773
|
+
anchorPos = null !== (_a = anchorPosMap[alignSelf]) && void 0 !== _a ? _a : anchorPosMap["flex-start"];
|
|
22774
|
+
"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`]));
|
|
22775
|
+
}
|
|
22632
22776
|
}
|
|
22633
22777
|
activate(context) {
|
|
22634
22778
|
this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
|
|
22635
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
22779
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
|
|
22636
22780
|
}), 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);
|
|
22781
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
22638
22782
|
}), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
22639
|
-
stage && stage === this.pluginService.stage && graphic.isContainer && (_tempBounds.equals(bounds) ||
|
|
22783
|
+
stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
|
|
22640
22784
|
}), application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
22641
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic
|
|
22785
|
+
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
|
|
22642
22786
|
});
|
|
22643
22787
|
}
|
|
22644
22788
|
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);
|
|
22789
|
+
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
22790
|
}
|
|
22647
22791
|
}
|
|
22648
22792
|
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;
|
|
22793
|
+
return 0;
|
|
22654
22794
|
}
|
|
22655
22795
|
|
|
22656
22796
|
const defaultTicker = new DefaultTicker();
|
|
@@ -23064,6 +23204,9 @@
|
|
|
23064
23204
|
this.pluginService.unRegister(plugin);
|
|
23065
23205
|
}));
|
|
23066
23206
|
}
|
|
23207
|
+
getPluginsByName(name) {
|
|
23208
|
+
return this.pluginService.findPluginsByName(name);
|
|
23209
|
+
}
|
|
23067
23210
|
tryUpdateAABBBounds() {
|
|
23068
23211
|
const viewBox = this._viewBox;
|
|
23069
23212
|
return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2), this._AABBBounds;
|
|
@@ -23097,7 +23240,7 @@
|
|
|
23097
23240
|
render(layers, params) {
|
|
23098
23241
|
this.ticker.start(), this.timeline.resume();
|
|
23099
23242
|
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++;
|
|
23243
|
+
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
23244
|
}
|
|
23102
23245
|
combineLayersToWindow() {}
|
|
23103
23246
|
renderNextFrame(layers, force) {
|
|
@@ -23124,7 +23267,8 @@
|
|
|
23124
23267
|
background: layer === this.defaultLayer ? this.background : void 0,
|
|
23125
23268
|
updateBounds: !(!this.dirtyBounds || this.dirtyBounds.empty())
|
|
23126
23269
|
}, Object.assign({
|
|
23127
|
-
renderStyle: this.renderStyle
|
|
23270
|
+
renderStyle: this.renderStyle,
|
|
23271
|
+
keepMatrix: this.params.renderKeepMatrix
|
|
23128
23272
|
}, params)));
|
|
23129
23273
|
}), this.interactiveLayer && !layerList.includes(this.interactiveLayer) && this.interactiveLayer.render({
|
|
23130
23274
|
renderService: this.renderService,
|
|
@@ -23723,11 +23867,17 @@
|
|
|
23723
23867
|
if (!params.bounds.contains(point.x, point.y)) return result;
|
|
23724
23868
|
offsetX = params.bounds.x1, offsetY = params.bounds.y1;
|
|
23725
23869
|
}
|
|
23726
|
-
|
|
23870
|
+
if (this.pickContext) if (params.keepMatrix) {
|
|
23871
|
+
if (this.pickContext.nativeContext && this.pickContext.nativeContext.getTransform) {
|
|
23872
|
+
const t = this.pickContext.nativeContext.getTransform();
|
|
23873
|
+
this.pickContext.setTransformFromMatrix(t, !0, 1);
|
|
23874
|
+
}
|
|
23875
|
+
} else this.pickContext.inuse = !0, this.pickContext.clearMatrix(!0, 1);
|
|
23876
|
+
params.pickContext = this.pickContext;
|
|
23727
23877
|
const parentMatrix = new Matrix(1, 0, 0, 1, offsetX, offsetY);
|
|
23728
23878
|
let group;
|
|
23729
23879
|
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) {
|
|
23880
|
+
if (result.graphic || (result.group = group), this.pickContext && !params.keepMatrix && (this.pickContext.inuse = !1), result.graphic) {
|
|
23731
23881
|
let g = result.graphic;
|
|
23732
23882
|
for (; g.parent;) g = g.parent;
|
|
23733
23883
|
g.shadowHost && (result.params = {
|
|
@@ -24439,7 +24589,7 @@
|
|
|
24439
24589
|
if (v === null || v === undefined || v === '') {
|
|
24440
24590
|
return false;
|
|
24441
24591
|
}
|
|
24442
|
-
if (isNumber$
|
|
24592
|
+
if (isNumber$1(v)) {
|
|
24443
24593
|
return true;
|
|
24444
24594
|
}
|
|
24445
24595
|
return +v === +v;
|
|
@@ -24532,7 +24682,7 @@
|
|
|
24532
24682
|
const n = array.length;
|
|
24533
24683
|
for (let i = 0; i < n; i += 1) {
|
|
24534
24684
|
let value = valueGetter(array[i]);
|
|
24535
|
-
isNil$1(value) || !isNumber$
|
|
24685
|
+
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
24686
|
}
|
|
24537
24687
|
return [min, max];
|
|
24538
24688
|
}
|
|
@@ -25017,7 +25167,7 @@
|
|
|
25017
25167
|
return this._isFixed && !!this._bandwidth;
|
|
25018
25168
|
}
|
|
25019
25169
|
_isBandwidthFixedByUser() {
|
|
25020
|
-
return this._isFixed && this._userBandwidth && isNumber$
|
|
25170
|
+
return this._isFixed && this._userBandwidth && isNumber$1(this._userBandwidth);
|
|
25021
25171
|
}
|
|
25022
25172
|
clone() {
|
|
25023
25173
|
var _a, _b, _c;
|
|
@@ -25285,13 +25435,13 @@
|
|
|
25285
25435
|
}
|
|
25286
25436
|
}
|
|
25287
25437
|
function parseNiceOptions(originalDomain, option) {
|
|
25288
|
-
const hasForceMin = isNumber$
|
|
25289
|
-
hasForceMax = isNumber$
|
|
25438
|
+
const hasForceMin = isNumber$1(option.forceMin),
|
|
25439
|
+
hasForceMax = isNumber$1(option.forceMax);
|
|
25290
25440
|
let niceType = null;
|
|
25291
25441
|
const niceMinMax = [];
|
|
25292
25442
|
let niceDomain = null;
|
|
25293
25443
|
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$
|
|
25444
|
+
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
25445
|
niceType: niceType,
|
|
25296
25446
|
niceDomain: niceDomain,
|
|
25297
25447
|
niceMinMax: niceMinMax,
|
|
@@ -26523,7 +26673,7 @@
|
|
|
26523
26673
|
}] : [];
|
|
26524
26674
|
}
|
|
26525
26675
|
function getLinePoints(items, includeOnePoint, lastPoints, isArea) {
|
|
26526
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26676
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26527
26677
|
return items.some(item => isValidPointsChannel(Object.keys(item.nextAttrs), "line")) ? items.map((item, index) => {
|
|
26528
26678
|
var _a;
|
|
26529
26679
|
const attrs = item.nextAttrs,
|
|
@@ -26539,7 +26689,7 @@
|
|
|
26539
26689
|
}
|
|
26540
26690
|
function getLargeRectsPoints(items, includeOnePoint) {
|
|
26541
26691
|
let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
26542
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26692
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26543
26693
|
const arr = new Float32Array(4 * items.length);
|
|
26544
26694
|
return items.forEach((item, index) => {
|
|
26545
26695
|
var _a, _b, _c, _d;
|
|
@@ -26553,7 +26703,7 @@
|
|
|
26553
26703
|
}
|
|
26554
26704
|
function getLargeSymbolsPoints(items, includeOnePoint) {
|
|
26555
26705
|
let lastPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
26556
|
-
if (!items || !items.length || 1 === items.length && includeOnePoint) return [];
|
|
26706
|
+
if (!items || !items.length || 1 === items.length && !includeOnePoint) return [];
|
|
26557
26707
|
const arr = new Float32Array(2 * items.length);
|
|
26558
26708
|
return items.forEach((item, index) => {
|
|
26559
26709
|
var _a, _b;
|
|
@@ -26594,6 +26744,57 @@
|
|
|
26594
26744
|
return [GrammarMarkType.line, GrammarMarkType.area, GrammarMarkType.largeRects, GrammarMarkType.largeSymbols].includes(markType);
|
|
26595
26745
|
}
|
|
26596
26746
|
|
|
26747
|
+
function invokeEncoderToItems(element, items, encoder, parameters, onlyFullEncodeFirst) {
|
|
26748
|
+
encoder && (isFunctionType(encoder) ? items.forEach(item => {
|
|
26749
|
+
const attributes = invokeFunctionType(encoder, parameters, item.datum, element);
|
|
26750
|
+
Object.assign(item.nextAttrs, attributes);
|
|
26751
|
+
}) : Object.keys(encoder).forEach(channel => {
|
|
26752
|
+
var _a, _b;
|
|
26753
|
+
const encode = encoder[channel],
|
|
26754
|
+
encodeItems = onlyFullEncodeFirst && !isPositionOrSizeChannel(element.mark.markType, channel) ? [items[0]] : items;
|
|
26755
|
+
if (isScaleEncode(encode)) {
|
|
26756
|
+
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26757
|
+
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26758
|
+
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26759
|
+
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26760
|
+
fieldAccessor = hasField ? field$3(encode.field) : null;
|
|
26761
|
+
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);
|
|
26762
|
+
encodeItems.forEach(item => {
|
|
26763
|
+
var _a;
|
|
26764
|
+
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;
|
|
26765
|
+
});
|
|
26766
|
+
} else if (isFieldEncode(encode)) {
|
|
26767
|
+
const fieldAccessor = field$3(encode.field);
|
|
26768
|
+
encodeItems.forEach(item => {
|
|
26769
|
+
item.nextAttrs[channel] = fieldAccessor(item.datum);
|
|
26770
|
+
});
|
|
26771
|
+
} else encodeItems.forEach(item => {
|
|
26772
|
+
item.nextAttrs[channel] = invokeFunctionType(encode, parameters, item.datum, element);
|
|
26773
|
+
});
|
|
26774
|
+
}));
|
|
26775
|
+
}
|
|
26776
|
+
function invokeEncoder(encoder, datum, element, parameters) {
|
|
26777
|
+
if (!encoder) return null;
|
|
26778
|
+
if (isFunctionType(encoder)) return invokeFunctionType(encoder, parameters, datum, element);
|
|
26779
|
+
const attributes = {};
|
|
26780
|
+
return Object.keys(encoder).forEach(channel => {
|
|
26781
|
+
var _a, _b, _c;
|
|
26782
|
+
const encode = encoder[channel];
|
|
26783
|
+
if (isScaleEncode(encode)) {
|
|
26784
|
+
const scale = getGrammarOutput(encode.scale, parameters),
|
|
26785
|
+
offset = null !== (_a = null == encode ? void 0 : encode.offset) && void 0 !== _a ? _a : 0,
|
|
26786
|
+
bandOffset = !isNil$1(encode.band) && scale.bandwidth ? scale.bandwidth() * encode.band : null,
|
|
26787
|
+
hasField = isString$1(null == encode ? void 0 : encode.field),
|
|
26788
|
+
fieldAccessor = hasField ? field$3(encode.field) : null,
|
|
26789
|
+
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);
|
|
26790
|
+
attributes[channel] = isNumber$1(to) || isNumber$1(bandOffset) ? to + offset + bandOffset : to;
|
|
26791
|
+
} else if (isFieldEncode(encode)) {
|
|
26792
|
+
const fieldAccessor = field$3(encode.field);
|
|
26793
|
+
attributes[channel] = fieldAccessor(datum);
|
|
26794
|
+
} else attributes[channel] = invokeFunctionType(encode, parameters, datum, element);
|
|
26795
|
+
}), attributes;
|
|
26796
|
+
}
|
|
26797
|
+
|
|
26597
26798
|
class GlyphMeta {
|
|
26598
26799
|
constructor(marks, encoders, defaultEncoder, progressiveChannels) {
|
|
26599
26800
|
this.channelEncoder = {}, this.marks = marks, encoders && this.registerChannelEncoder(encoders), defaultEncoder && this.registerDefaultEncoder(defaultEncoder), this.progressiveChannels && this.registerProgressiveChannels(progressiveChannels);
|
|
@@ -26709,83 +26910,6 @@
|
|
|
26709
26910
|
return creator ? creator(attributes) : null;
|
|
26710
26911
|
};
|
|
26711
26912
|
|
|
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
26913
|
const isMarkType = type => !!GrammarMarkType[type];
|
|
26790
26914
|
function createGraphicItem(mark, markType) {
|
|
26791
26915
|
let attrs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -27015,7 +27139,7 @@
|
|
|
27015
27139
|
}
|
|
27016
27140
|
updateGraphicItem(config) {
|
|
27017
27141
|
if (!this.graphicItem) return;
|
|
27018
|
-
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;
|
|
27142
|
+
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;
|
|
27019
27143
|
const stateAnimation = this.mark.animate.getAnimationConfigs("state");
|
|
27020
27144
|
0 !== stateAnimation.length && (this.graphicItem.stateAnimateConfig = stateAnimation[0].originConfig);
|
|
27021
27145
|
}
|
|
@@ -27394,7 +27518,7 @@
|
|
|
27394
27518
|
handler: this.handleStart
|
|
27395
27519
|
}];
|
|
27396
27520
|
let eventName = triggerOff;
|
|
27397
|
-
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$
|
|
27521
|
+
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({
|
|
27398
27522
|
type: eventName,
|
|
27399
27523
|
handler: this.handleReset
|
|
27400
27524
|
}), events;
|
|
@@ -30845,7 +30969,7 @@
|
|
|
30845
30969
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30846
30970
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
30847
30971
|
let picked = !0;
|
|
30848
|
-
if (!onlyTranslate || rect.shadowRoot || isNumber$
|
|
30972
|
+
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) => {
|
|
30849
30973
|
if (picked) return !0;
|
|
30850
30974
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30851
30975
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -30913,7 +31037,7 @@
|
|
|
30913
31037
|
x += point.x, y += point.y, pickContext.setTransformForCurrent();
|
|
30914
31038
|
} else x = 0, y = 0, onlyTranslate = !1, pickContext.transformFromMatrix(rect.transMatrix, !0);
|
|
30915
31039
|
let picked = !0;
|
|
30916
|
-
if (!onlyTranslate || isNumber$
|
|
31040
|
+
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) => {
|
|
30917
31041
|
if (picked) return !0;
|
|
30918
31042
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
30919
31043
|
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
|
|
@@ -32508,6 +32632,14 @@
|
|
|
32508
32632
|
height: bounds.height()
|
|
32509
32633
|
};
|
|
32510
32634
|
}
|
|
32635
|
+
function isRichText(attributes) {
|
|
32636
|
+
let typeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "type";
|
|
32637
|
+
return typeKey in attributes && "rich" === attributes[typeKey] || isObject$2(attributes.text) && "rich" === attributes.text.type;
|
|
32638
|
+
}
|
|
32639
|
+
function richTextAttributeTransform(attributes) {
|
|
32640
|
+
var _a, _b;
|
|
32641
|
+
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;
|
|
32642
|
+
}
|
|
32511
32643
|
|
|
32512
32644
|
function loadTagComponent() {
|
|
32513
32645
|
registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
|
|
@@ -32528,7 +32660,7 @@
|
|
|
32528
32660
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
|
|
32529
32661
|
}
|
|
32530
32662
|
render() {
|
|
32531
|
-
var _a, _b
|
|
32663
|
+
var _a, _b;
|
|
32532
32664
|
const {
|
|
32533
32665
|
text = "",
|
|
32534
32666
|
textStyle = {},
|
|
@@ -32560,7 +32692,7 @@
|
|
|
32560
32692
|
shapeStyle = __rest$6(shape, ["visible"]);
|
|
32561
32693
|
if (isBoolean$1(shapeVisible)) {
|
|
32562
32694
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
32563
|
-
maxSize = isNumber$
|
|
32695
|
+
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
32564
32696
|
symbol = group.createOrUpdateChild("tag-shape", Object.assign(Object.assign({
|
|
32565
32697
|
symbolType: "circle",
|
|
32566
32698
|
size: size,
|
|
@@ -32572,39 +32704,15 @@
|
|
|
32572
32704
|
}), "symbol"), isEmpty(null == state ? void 0 : state.shape) || (symbol.states = state.shape), shapeVisible && (symbolPlaceWidth = maxSize + space);
|
|
32573
32705
|
}
|
|
32574
32706
|
let textShape;
|
|
32575
|
-
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
|
|
32579
|
-
},
|
|
32580
|
-
|
|
32581
|
-
|
|
32582
|
-
|
|
32583
|
-
height: null !== (_b = textStyle.height) && void 0 !== _b ? _b : 0
|
|
32584
|
-
});
|
|
32585
|
-
textShape = group.createOrUpdateChild("tag-text", richTextAttrs, "richtext");
|
|
32586
|
-
const {
|
|
32587
|
-
visible: bgVisible
|
|
32588
|
-
} = panel,
|
|
32589
|
-
backgroundStyle = __rest$6(panel, ["visible"]);
|
|
32590
|
-
if (visible && isBoolean$1(bgVisible)) {
|
|
32591
|
-
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32592
|
-
visible: bgVisible && !!text,
|
|
32593
|
-
x: textShape.AABBBounds.x1,
|
|
32594
|
-
y: textShape.AABBBounds.y1,
|
|
32595
|
-
width: textShape.AABBBounds.width(),
|
|
32596
|
-
height: textShape.AABBBounds.height()
|
|
32597
|
-
}), "rect");
|
|
32598
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
32599
|
-
}
|
|
32600
|
-
} else if ("html" === type) {
|
|
32601
|
-
const richTextAttrs = Object.assign(Object.assign({
|
|
32602
|
-
textConfig: [],
|
|
32707
|
+
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
32708
|
+
if (isRichText({
|
|
32709
|
+
text: text
|
|
32710
|
+
}) || "rich" === type) {
|
|
32711
|
+
const richTextAttrs = Object.assign(Object.assign(Object.assign({}, richTextAttributeTransform(Object.assign({
|
|
32712
|
+
type: type,
|
|
32713
|
+
text: text
|
|
32714
|
+
}, textStyle))), textStyle), {
|
|
32603
32715
|
visible: isValid$1(text) && !1 !== visible,
|
|
32604
|
-
html: Object.assign(Object.assign({
|
|
32605
|
-
dom: text
|
|
32606
|
-
}, DEFAULT_HTML_TEXT_SPEC), textStyle)
|
|
32607
|
-
}, textStyle), {
|
|
32608
32716
|
x: textX,
|
|
32609
32717
|
y: 0
|
|
32610
32718
|
});
|
|
@@ -32625,7 +32733,7 @@
|
|
|
32625
32733
|
}
|
|
32626
32734
|
} else {
|
|
32627
32735
|
const textAttrs = Object.assign(Object.assign({
|
|
32628
|
-
text: text,
|
|
32736
|
+
text: isObject$2(text) && "type" in text && "text" === text.type ? text.text : text,
|
|
32629
32737
|
visible: isValid$1(text) && !1 !== visible,
|
|
32630
32738
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
32631
32739
|
}, textStyle), {
|
|
@@ -32633,12 +32741,12 @@
|
|
|
32633
32741
|
y: 0
|
|
32634
32742
|
});
|
|
32635
32743
|
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);
|
|
32636
|
-
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (
|
|
32744
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle, null === (_a = this.stage) || void 0 === _a ? void 0 : _a.getTheme().text.fontFamily),
|
|
32637
32745
|
textWidth = textBounds.width,
|
|
32638
32746
|
textHeight = textBounds.height;
|
|
32639
32747
|
tagWidth += textWidth;
|
|
32640
|
-
const size = null !== (
|
|
32641
|
-
maxSize = isNumber$
|
|
32748
|
+
const size = null !== (_b = shape.size) && void 0 !== _b ? _b : 10,
|
|
32749
|
+
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
32642
32750
|
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
32643
32751
|
const {
|
|
32644
32752
|
textAlign: textAlign,
|
|
@@ -32646,11 +32754,21 @@
|
|
|
32646
32754
|
} = textStyle;
|
|
32647
32755
|
(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])));
|
|
32648
32756
|
let x = 0,
|
|
32649
|
-
y = 0
|
|
32650
|
-
|
|
32651
|
-
|
|
32652
|
-
|
|
32653
|
-
|
|
32757
|
+
y = 0,
|
|
32758
|
+
flag = 0;
|
|
32759
|
+
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) {
|
|
32760
|
+
const containerWidth = tagWidth - parsedPadding[1] - parsedPadding[3],
|
|
32761
|
+
tsWidth = textWidth + symbolPlaceWidth,
|
|
32762
|
+
textX = (containerWidth - tsWidth) / 2 + symbolPlaceWidth + textWidth / 2,
|
|
32763
|
+
symbolX = (containerWidth - tsWidth) / 2 + maxSize / 2;
|
|
32764
|
+
textShape.setAttributes({
|
|
32765
|
+
x: textX * flag,
|
|
32766
|
+
textAlign: "center"
|
|
32767
|
+
}), null == symbol || symbol.setAttributes({
|
|
32768
|
+
x: symbolX * flag
|
|
32769
|
+
}), group.setAttribute("x", parsedPadding[2 + flag] * flag);
|
|
32770
|
+
}
|
|
32771
|
+
"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));
|
|
32654
32772
|
const {
|
|
32655
32773
|
visible: bgVisible
|
|
32656
32774
|
} = panel,
|
|
@@ -33910,18 +34028,7 @@
|
|
|
33910
34028
|
state && !isEmpty(state) && (target.states = state);
|
|
33911
34029
|
}
|
|
33912
34030
|
_createLabelText(attributes) {
|
|
33913
|
-
|
|
33914
|
-
if ("rich" === attributes.textType) {
|
|
33915
|
-
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;
|
|
33916
|
-
return graphicCreator.richtext(attributes);
|
|
33917
|
-
}
|
|
33918
|
-
if ("html" === attributes.textType) {
|
|
33919
|
-
attributes.textConfig = [], attributes.html = Object.assign(Object.assign({
|
|
33920
|
-
dom: attributes.text
|
|
33921
|
-
}, DEFAULT_HTML_TEXT_SPEC), attributes);
|
|
33922
|
-
return graphicCreator.richtext(attributes);
|
|
33923
|
-
}
|
|
33924
|
-
return graphicCreator.text(attributes);
|
|
34031
|
+
return isRichText(attributes, "textType") ? graphicCreator.richtext(richTextAttributeTransform(attributes)) : graphicCreator.text(attributes);
|
|
33925
34032
|
}
|
|
33926
34033
|
_prepare() {
|
|
33927
34034
|
var _a, _b, _c, _d, _e;
|
|
@@ -33992,8 +34099,10 @@
|
|
|
33992
34099
|
const textData = text.attribute,
|
|
33993
34100
|
baseMark = this.getRelatedGraphic(textData);
|
|
33994
34101
|
if (!baseMark) continue;
|
|
33995
|
-
|
|
33996
|
-
|
|
34102
|
+
text.attachedThemeGraphic = this;
|
|
34103
|
+
const textBounds = this.getGraphicBounds(text);
|
|
34104
|
+
text.attachedThemeGraphic = null;
|
|
34105
|
+
const actualPosition = isFunction$1(position) ? position(textData) : position,
|
|
33997
34106
|
graphicBounds = this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(textData.id), actualPosition) : this.getGraphicBounds(baseMark, {
|
|
33998
34107
|
x: textData.x,
|
|
33999
34108
|
y: textData.y
|
|
@@ -35157,7 +35266,7 @@
|
|
|
35157
35266
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Segment.defaultAttributes, attributes)), this.name = "segment";
|
|
35158
35267
|
}
|
|
35159
35268
|
render() {
|
|
35160
|
-
this.removeAllChild(), this._reset();
|
|
35269
|
+
this.removeAllChild(!0), this._reset();
|
|
35161
35270
|
const {
|
|
35162
35271
|
startSymbol: startSymbol,
|
|
35163
35272
|
endSymbol: endSymbol,
|
|
@@ -35426,7 +35535,7 @@
|
|
|
35426
35535
|
return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
|
|
35427
35536
|
}
|
|
35428
35537
|
render() {
|
|
35429
|
-
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
35538
|
+
this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
35430
35539
|
x: 0,
|
|
35431
35540
|
y: 0,
|
|
35432
35541
|
pickable: !1
|
|
@@ -35533,12 +35642,10 @@
|
|
|
35533
35642
|
pickable: !1
|
|
35534
35643
|
});
|
|
35535
35644
|
return labelGroup.name = `${AXIS_ELEMENT_NAME.labelContainer}-layer-${layer}`, labelGroup.id = this._getNodeId(`label-container-layer-${layer}`), container.add(labelGroup), data.forEach((item, index) => {
|
|
35536
|
-
var _a
|
|
35645
|
+
var _a;
|
|
35537
35646
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
35538
35647
|
let text;
|
|
35539
|
-
if (
|
|
35540
|
-
dom: labelStyle.text
|
|
35541
|
-
}, 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 {
|
|
35648
|
+
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 {
|
|
35542
35649
|
const labelState = merge$2({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
35543
35650
|
Object.keys(labelState).forEach(key => {
|
|
35544
35651
|
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
@@ -36664,7 +36771,7 @@
|
|
|
36664
36771
|
return this._prevInnerView;
|
|
36665
36772
|
}
|
|
36666
36773
|
render() {
|
|
36667
|
-
this.removeAllChild(), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
36774
|
+
this.removeAllChild(!0), this._prevInnerView = this._innerView, this._innerView = graphicCreator.group({
|
|
36668
36775
|
x: 0,
|
|
36669
36776
|
y: 0,
|
|
36670
36777
|
pickable: !1
|
|
@@ -37877,7 +37984,7 @@
|
|
|
37877
37984
|
var _a;
|
|
37878
37985
|
this.setAttribute("pickable", !1);
|
|
37879
37986
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
37880
|
-
!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());
|
|
37987
|
+
!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));
|
|
37881
37988
|
}
|
|
37882
37989
|
}
|
|
37883
37990
|
|
|
@@ -38664,8 +38771,8 @@
|
|
|
38664
38771
|
textAlign: "center",
|
|
38665
38772
|
textBaseline: "middle"
|
|
38666
38773
|
}, textStyle), null === (_b = this.stage) || void 0 === _b ? void 0 : _b.getTheme().text.fontFamily),
|
|
38667
|
-
handlerSizeX = isNumber$
|
|
38668
|
-
handlerSizeY = isNumber$
|
|
38774
|
+
handlerSizeX = isNumber$1(handlerSize) ? handlerSize : handlerSize[0],
|
|
38775
|
+
handlerSizeY = isNumber$1(handlerSize) ? handlerSize : handlerSize[1],
|
|
38669
38776
|
text = graphicCreator.text(Object.assign({
|
|
38670
38777
|
x: isHorizontal ? handlerSizeX / 2 + handlerSpace + maxTextWidth / 2 : 0,
|
|
38671
38778
|
y: isHorizontal ? 0 : handlerSizeY / 2 + handlerSpace + maxTextHeight / 2,
|
|
@@ -38694,7 +38801,7 @@
|
|
|
38694
38801
|
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)));
|
|
38695
38802
|
}
|
|
38696
38803
|
_reset() {
|
|
38697
|
-
this.removeAllChild(), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
|
|
38804
|
+
this.removeAllChild(!0), this._current = 1, this._total = this.attribute.total, this.preHandler = this.nextHandler = this.text = null;
|
|
38698
38805
|
}
|
|
38699
38806
|
}
|
|
38700
38807
|
Pager.defaultAttributes = {
|
|
@@ -38731,7 +38838,7 @@
|
|
|
38731
38838
|
super(...arguments), this.name = "legend", this._title = null;
|
|
38732
38839
|
}
|
|
38733
38840
|
render() {
|
|
38734
|
-
this.removeAllChild();
|
|
38841
|
+
this.removeAllChild(!0);
|
|
38735
38842
|
const {
|
|
38736
38843
|
interactive = !0,
|
|
38737
38844
|
title: title,
|
|
@@ -38994,7 +39101,8 @@
|
|
|
38994
39101
|
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);
|
|
38995
39102
|
}), this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state), itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected), innerGroup.add(itemShape);
|
|
38996
39103
|
}
|
|
38997
|
-
let
|
|
39104
|
+
let labelShape,
|
|
39105
|
+
focusSpace = 0;
|
|
38998
39106
|
if (focus) {
|
|
38999
39107
|
const focusSize = get$1(focusIconStyle, "size", DEFAULT_SHAPE_SIZE);
|
|
39000
39108
|
focusShape = graphicCreator.symbol(Object.assign(Object.assign({
|
|
@@ -39007,29 +39115,32 @@
|
|
|
39007
39115
|
boundsPadding: parsedPadding
|
|
39008
39116
|
})), this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup), focusSpace = focusSize;
|
|
39009
39117
|
}
|
|
39010
|
-
const
|
|
39011
|
-
|
|
39012
|
-
|
|
39013
|
-
|
|
39014
|
-
|
|
39015
|
-
|
|
39016
|
-
|
|
39017
|
-
|
|
39018
|
-
|
|
39019
|
-
|
|
39118
|
+
const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label,
|
|
39119
|
+
labelAttributes = Object.assign(Object.assign({
|
|
39120
|
+
x: shapeSize / 2 + shapeSpace,
|
|
39121
|
+
y: 0,
|
|
39122
|
+
textAlign: "start",
|
|
39123
|
+
textBaseline: "middle",
|
|
39124
|
+
lineHeight: null === (_b = labelStyle.style) || void 0 === _b ? void 0 : _b.fontSize
|
|
39125
|
+
}, labelStyle.style), {
|
|
39126
|
+
text: text
|
|
39127
|
+
});
|
|
39128
|
+
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);
|
|
39020
39129
|
const labelSpace = get$1(labelAttr, "space", DEFAULT_LABEL_SPACE);
|
|
39021
39130
|
if (isValid$1(value)) {
|
|
39022
39131
|
const valueSpace = get$1(valueAttr, "space", focus ? DEFAULT_VALUE_SPACE : 0),
|
|
39023
|
-
|
|
39132
|
+
valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value,
|
|
39133
|
+
valueAttributes = Object.assign(Object.assign({
|
|
39024
39134
|
x: 0,
|
|
39025
39135
|
y: 0,
|
|
39026
39136
|
textAlign: "start",
|
|
39027
39137
|
textBaseline: "middle",
|
|
39028
39138
|
lineHeight: valueStyle.style.fontSize
|
|
39029
39139
|
}, valueStyle.style), {
|
|
39030
|
-
text:
|
|
39031
|
-
})
|
|
39032
|
-
|
|
39140
|
+
text: valueText
|
|
39141
|
+
});
|
|
39142
|
+
let valueShape;
|
|
39143
|
+
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) {
|
|
39033
39144
|
const layoutWidth = this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - labelSpace - focusSpace - valueSpace,
|
|
39034
39145
|
valueBounds = valueShape.AABBBounds,
|
|
39035
39146
|
labelBounds = labelShape.AABBBounds,
|
|
@@ -39448,7 +39559,7 @@
|
|
|
39448
39559
|
}
|
|
39449
39560
|
render() {
|
|
39450
39561
|
var _a, _b;
|
|
39451
|
-
this.removeAllChild();
|
|
39562
|
+
this.removeAllChild(!0);
|
|
39452
39563
|
const {
|
|
39453
39564
|
layout = "horizontal",
|
|
39454
39565
|
railWidth: railWidth,
|
|
@@ -40261,7 +40372,7 @@
|
|
|
40261
40372
|
super(...arguments), this.name = "indicator";
|
|
40262
40373
|
}
|
|
40263
40374
|
render() {
|
|
40264
|
-
var _a
|
|
40375
|
+
var _a;
|
|
40265
40376
|
const {
|
|
40266
40377
|
visible: visible,
|
|
40267
40378
|
title = {},
|
|
@@ -40278,20 +40389,7 @@
|
|
|
40278
40389
|
if (!0 !== visible) return void (group && group.hideAll());
|
|
40279
40390
|
if (isValid$1(title)) if (!1 !== title.visible) {
|
|
40280
40391
|
const titleStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "title.style"), title.style);
|
|
40281
|
-
|
|
40282
|
-
textConfig: titleStyle.text
|
|
40283
|
-
}, titleStyle), {
|
|
40284
|
-
visible: title.visible,
|
|
40285
|
-
x: 0,
|
|
40286
|
-
y: 0,
|
|
40287
|
-
width: null !== (_a = titleStyle.width) && void 0 !== _a ? _a : 0,
|
|
40288
|
-
height: null !== (_b = titleStyle.height) && void 0 !== _b ? _b : 0
|
|
40289
|
-
}), "richtext") : "html" === titleStyle.type ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({
|
|
40290
|
-
textConfig: [],
|
|
40291
|
-
html: Object.assign(Object.assign({
|
|
40292
|
-
dom: titleStyle.text
|
|
40293
|
-
}, DEFAULT_HTML_TEXT_SPEC), titleStyle)
|
|
40294
|
-
}, titleStyle), {
|
|
40392
|
+
isRichText(titleStyle) ? this._title = group.createOrUpdateChild("indicator-title", Object.assign(Object.assign({}, richTextAttributeTransform(titleStyle)), {
|
|
40295
40393
|
visible: title.visible,
|
|
40296
40394
|
x: 0,
|
|
40297
40395
|
y: 0
|
|
@@ -40309,24 +40407,10 @@
|
|
|
40309
40407
|
const contents = array(content),
|
|
40310
40408
|
contentComponents = [];
|
|
40311
40409
|
contents.forEach((contentItem, i) => {
|
|
40312
|
-
var _a, _b;
|
|
40313
40410
|
if (!1 !== contentItem.visible) {
|
|
40314
40411
|
const contentStyle = merge$2({}, get$1(DEFAULT_INDICATOR_THEME, "content.style"), contentItem.style);
|
|
40315
40412
|
let contentComponent;
|
|
40316
|
-
contentComponent =
|
|
40317
|
-
textConfig: contentStyle.text
|
|
40318
|
-
}, contentStyle), {
|
|
40319
|
-
visible: title.visible,
|
|
40320
|
-
x: 0,
|
|
40321
|
-
y: 0,
|
|
40322
|
-
width: null !== (_a = contentStyle.width) && void 0 !== _a ? _a : 0,
|
|
40323
|
-
height: null !== (_b = contentStyle.height) && void 0 !== _b ? _b : 0
|
|
40324
|
-
}), "richtext") : "html" === contentStyle.type ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({
|
|
40325
|
-
textConfig: [],
|
|
40326
|
-
html: Object.assign(Object.assign({
|
|
40327
|
-
dom: contentStyle.text
|
|
40328
|
-
}, DEFAULT_HTML_TEXT_SPEC), contentStyle)
|
|
40329
|
-
}, contentStyle), {
|
|
40413
|
+
contentComponent = isRichText(contentStyle) ? group.createOrUpdateChild("indicator-content-" + i, Object.assign(Object.assign({}, richTextAttributeTransform(contentStyle)), {
|
|
40330
40414
|
visible: title.visible,
|
|
40331
40415
|
x: 0,
|
|
40332
40416
|
y: 0
|
|
@@ -40343,7 +40427,7 @@
|
|
|
40343
40427
|
}), this._content = contentComponents;
|
|
40344
40428
|
}
|
|
40345
40429
|
this._setGlobalAutoFit(limit), this._setYPosition();
|
|
40346
|
-
const totalHeight = null !== (
|
|
40430
|
+
const totalHeight = null !== (_a = null == group ? void 0 : group.AABBBounds.height()) && void 0 !== _a ? _a : 0;
|
|
40347
40431
|
group.setAttribute("y", size.height / 2 - totalHeight / 2), group.setAttribute("x", size.width / 2);
|
|
40348
40432
|
}
|
|
40349
40433
|
_setLocalAutoFit(limit, indicatorItem, indicatorItemSpec) {
|
|
@@ -40719,7 +40803,7 @@
|
|
|
40719
40803
|
railSectionLength = null !== (_a = isHorizontal$1(this._orient) ? this._railStyle.height : this._railStyle.width) && void 0 !== _a ? _a : RailDefaultSize[1],
|
|
40720
40804
|
controllerPx = controllers.reduce((len, controller) => {
|
|
40721
40805
|
const size = controller.style.size,
|
|
40722
|
-
maxSize = isNumber$
|
|
40806
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40723
40807
|
return len + controller.space + maxSize;
|
|
40724
40808
|
}, 0),
|
|
40725
40809
|
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,
|
|
@@ -40732,7 +40816,7 @@
|
|
|
40732
40816
|
size: size
|
|
40733
40817
|
}
|
|
40734
40818
|
} = controller,
|
|
40735
|
-
maxSize = isNumber$
|
|
40819
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40736
40820
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
40737
40821
|
size: maxSize,
|
|
40738
40822
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -40751,7 +40835,7 @@
|
|
|
40751
40835
|
size: size
|
|
40752
40836
|
}
|
|
40753
40837
|
} = controller,
|
|
40754
|
-
maxSize = isNumber$
|
|
40838
|
+
maxSize = isNumber$1(size) ? size : max$1(size[0], size[1]);
|
|
40755
40839
|
return this._layoutInfo[key] = Object.assign(Object.assign({}, this._layoutInfo[key]), {
|
|
40756
40840
|
size: maxSize,
|
|
40757
40841
|
x: isHorizontal$1(this._orient) ? px + space : (this._size.width - maxSize) / 2,
|
|
@@ -41431,7 +41515,7 @@
|
|
|
41431
41515
|
const titleHeight = isVisible(titleAttr) ? titleAttr.height + titleAttr.spaceRow : 0;
|
|
41432
41516
|
if (this._tooltipContent = this.createOrUpdateChild("tooltip-content", {
|
|
41433
41517
|
visible: !0
|
|
41434
|
-
}, "group"), this._tooltipContent.removeAllChild(), content && content.length) {
|
|
41518
|
+
}, "group"), this._tooltipContent.removeAllChild(!0), content && content.length) {
|
|
41435
41519
|
this._tooltipContent.setAttribute("x", padding[3]), this._tooltipContent.setAttribute("y", padding[0] + titleHeight);
|
|
41436
41520
|
let lastYPos = 0;
|
|
41437
41521
|
content.forEach((item, i) => {
|
|
@@ -42641,7 +42725,7 @@
|
|
|
42641
42725
|
};
|
|
42642
42726
|
const normalizePadding = value => {
|
|
42643
42727
|
var _a, _b, _c, _d;
|
|
42644
|
-
return isNumber$
|
|
42728
|
+
return isNumber$1(value) ? {
|
|
42645
42729
|
top: value,
|
|
42646
42730
|
bottom: value,
|
|
42647
42731
|
left: value,
|
|
@@ -43523,10 +43607,10 @@
|
|
|
43523
43607
|
delayAfter: delayAfter
|
|
43524
43608
|
}), loopTime += delay + duration + delayAfter;
|
|
43525
43609
|
});
|
|
43526
|
-
const oneByOneDelay = isNumber$
|
|
43610
|
+
const oneByOneDelay = isNumber$1(oneByOne) ? oneByOne : !0 === oneByOne ? loopTime : 0;
|
|
43527
43611
|
return {
|
|
43528
43612
|
initialDelay: startTime,
|
|
43529
|
-
loopCount: isNumber$
|
|
43613
|
+
loopCount: isNumber$1(loop) ? loop : !0 === loop ? 1 / 0 : 1,
|
|
43530
43614
|
loopDelay: oneByOneDelay * index,
|
|
43531
43615
|
loopDelayAfter: oneByOneDelay * (elementCount - index - 1),
|
|
43532
43616
|
loopAnimateDuration: loopTime,
|
|
@@ -43626,7 +43710,7 @@
|
|
|
43626
43710
|
if (this.markType === GrammarMarkType.group) return;
|
|
43627
43711
|
const res = groupData(null != data ? data : DefaultMarkData, this.spec.groupBy, this.spec.groupSort),
|
|
43628
43712
|
groupKeys = res.keys;
|
|
43629
|
-
this._groupKeys = groupKeys, this.differ.setCurrentData(res);
|
|
43713
|
+
this._groupKeys = groupKeys, this._groupEncodeResult = null, this.differ.setCurrentData(res);
|
|
43630
43714
|
}
|
|
43631
43715
|
_getTransformsAfterEncodeItems() {
|
|
43632
43716
|
return this.transforms && this.transforms.filter(entry => "afterEncodeItems" === entry.markPhase);
|
|
@@ -43697,7 +43781,7 @@
|
|
|
43697
43781
|
return nextTransforms && (this.attach(nextTransforms.refs), this.transforms = nextTransforms.transforms), this.spec.transform = transforms, this.commit(), this;
|
|
43698
43782
|
}
|
|
43699
43783
|
configure(config) {
|
|
43700
|
-
const keys = ["clip", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
|
|
43784
|
+
const keys = ["clip", "clipPath", "zIndex", "interactive", "context", "setCustomizedShape", "large", "largeThreshold", "progressiveStep", "progressiveThreshold", "support3d", "morph", "morphKey", "morphElementKey", "attributeTransforms", "skipTheme", "enableSegments", "stateSort"];
|
|
43701
43785
|
return null === config ? (keys.forEach(key => {
|
|
43702
43786
|
isNil$1(this.spec[key]) || (this.spec[key] = void 0);
|
|
43703
43787
|
}), this) : (keys.forEach(key => {
|
|
@@ -43777,7 +43861,7 @@
|
|
|
43777
43861
|
this.graphicIndex = markIndex;
|
|
43778
43862
|
}
|
|
43779
43863
|
update(spec) {
|
|
43780
|
-
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 => {
|
|
43864
|
+
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 => {
|
|
43781
43865
|
element.updateGraphicItem({
|
|
43782
43866
|
interactive: spec.interactive
|
|
43783
43867
|
});
|
|
@@ -43785,7 +43869,8 @@
|
|
|
43785
43869
|
element.updateGraphicItem({
|
|
43786
43870
|
clip: spec.clip,
|
|
43787
43871
|
zIndex: spec.zIndex,
|
|
43788
|
-
interactive: spec.interactive
|
|
43872
|
+
interactive: spec.interactive,
|
|
43873
|
+
clipPath: spec.clipPath
|
|
43789
43874
|
});
|
|
43790
43875
|
});
|
|
43791
43876
|
}
|
|
@@ -43834,25 +43919,27 @@
|
|
|
43834
43919
|
items = [Object.assign({}, null === (_a = el.items) || void 0 === _a ? void 0 : _a[0], {
|
|
43835
43920
|
nextAttrs: nextAttrs
|
|
43836
43921
|
})];
|
|
43837
|
-
return invokeEncoderToItems(el, items, groupEncode, parameters), nextAttrs;
|
|
43922
|
+
return invokeEncoderToItems(el, items, groupEncode, parameters), this._groupEncodeResult = nextAttrs, nextAttrs;
|
|
43838
43923
|
}
|
|
43839
43924
|
if (!this._groupKeys || !groupEncode) return;
|
|
43840
43925
|
const res = {};
|
|
43841
43926
|
return this._groupKeys.forEach(key => {
|
|
43842
43927
|
const el = elements.find(el => el.groupKey === key);
|
|
43843
43928
|
el && (res[key] = invokeEncoder(groupEncode, el.items && el.items[0] && el.items[0].datum, el, parameters));
|
|
43844
|
-
}), res;
|
|
43929
|
+
}), this._groupEncodeResult = res, res;
|
|
43845
43930
|
}
|
|
43846
|
-
evaluateEncode(elements, encoders, parameters) {
|
|
43931
|
+
evaluateEncode(elements, encoders, parameters, noGroupEncode) {
|
|
43847
43932
|
if (encoders) {
|
|
43848
43933
|
this.emit(exports.VGRAMMAR_HOOK_EVENT.BEFORE_ELEMENT_ENCODE, {
|
|
43849
43934
|
encoders: encoders,
|
|
43850
43935
|
parameters: parameters
|
|
43851
43936
|
}, this);
|
|
43852
|
-
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43937
|
+
const groupEncodeAttrs = noGroupEncode ? null : this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43853
43938
|
elements.forEach(element => {
|
|
43854
43939
|
this.markType === GrammarMarkType.group && groupEncodeAttrs ? element.items.forEach(item => {
|
|
43855
43940
|
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs);
|
|
43941
|
+
}) : this.markType === GrammarMarkType.glyph && this._groupEncodeResult ? element.items.forEach(item => {
|
|
43942
|
+
item.nextAttrs = Object.assign(item.nextAttrs, this._groupEncodeResult[element.groupKey]);
|
|
43856
43943
|
}) : (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && !this.isCollectionMark() && element.items.forEach(item => {
|
|
43857
43944
|
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
43858
43945
|
}), element.encodeItems(element.items, encoders, this._isReentered, parameters);
|
|
@@ -43951,41 +44038,17 @@
|
|
|
43951
44038
|
};
|
|
43952
44039
|
}
|
|
43953
44040
|
evaluateEncodeProgressive(elements, encoders, parameters) {
|
|
43954
|
-
|
|
43955
|
-
|
|
43956
|
-
|
|
43957
|
-
|
|
43958
|
-
|
|
43959
|
-
|
|
43960
|
-
|
|
43961
|
-
|
|
43962
|
-
|
|
43963
|
-
}, this);
|
|
43964
|
-
const groupEncodeAttrs = this.evaluateGroupEncode(elements, encoders[BuiltInEncodeNames.group], parameters);
|
|
43965
|
-
if (elements.forEach((element, index) => {
|
|
43966
|
-
const onlyPos = progressiveIndex > 0 || !isCollection && index > 0;
|
|
43967
|
-
!onlyPos && (null == groupEncodeAttrs ? void 0 : groupEncodeAttrs[element.groupKey]) && element.items.forEach(item => {
|
|
43968
|
-
item.nextAttrs = Object.assign(item.nextAttrs, groupEncodeAttrs[element.groupKey]);
|
|
43969
|
-
}), element.encodeItems(element.items, onlyPos ? positionEncoders : encoders, this._isReentered, parameters);
|
|
43970
|
-
}), this._isReentered = !1, this.evaluateTransform(this._getTransformsAfterEncodeItems(), elements, parameters), elements.forEach(element => {
|
|
43971
|
-
element.encodeGraphic();
|
|
43972
|
-
}), this.emit(exports.VGRAMMAR_HOOK_EVENT.AFTER_ELEMENT_ENCODE, {
|
|
43973
|
-
encoders: encoders,
|
|
43974
|
-
parameters: parameters
|
|
43975
|
-
}, this), 0 === progressiveIndex && !isCollection) {
|
|
43976
|
-
const firstChild = elements[0].getGraphicItem(),
|
|
43977
|
-
group = null == firstChild ? void 0 : firstChild.parent;
|
|
43978
|
-
if (group) {
|
|
43979
|
-
const attrs = firstChild.attribute,
|
|
43980
|
-
theme = {},
|
|
43981
|
-
itemAttrs = {};
|
|
43982
|
-
Object.keys(attrs).forEach(key => {
|
|
43983
|
-
["pickable", "zIndex"].includes(key) || (isPositionOrSizeChannel(this.markType, key) ? itemAttrs[key] = attrs[key] : theme[key] = attrs[key]);
|
|
43984
|
-
}), group.setTheme({
|
|
43985
|
-
common: theme
|
|
43986
|
-
}), firstChild.initAttributes(itemAttrs);
|
|
44041
|
+
const progressiveIndex = this.renderContext.progressive.currentIndex;
|
|
44042
|
+
if (0 === progressiveIndex) {
|
|
44043
|
+
if (this.evaluateEncode(elements, encoders, parameters), 0 === progressiveIndex && this._groupEncodeResult && !this.isCollectionMark() && this.markType !== GrammarMarkType.glyph) {
|
|
44044
|
+
const firstElement = elements[0],
|
|
44045
|
+
firstChild = firstElement.getGraphicItem(),
|
|
44046
|
+
group = null == firstChild ? void 0 : firstChild.parent;
|
|
44047
|
+
group && this._groupEncodeResult[firstElement.groupKey] && group.setTheme({
|
|
44048
|
+
common: this._groupEncodeResult[firstElement.groupKey]
|
|
44049
|
+
});
|
|
43987
44050
|
}
|
|
43988
|
-
}
|
|
44051
|
+
} else this.evaluateEncode(elements, encoders, parameters, !0);
|
|
43989
44052
|
}
|
|
43990
44053
|
evaluateProgressive() {
|
|
43991
44054
|
var _a, _b, _c;
|
|
@@ -44455,7 +44518,7 @@
|
|
|
44455
44518
|
duration = invokeFunctionType(runningConfig.animation.duration, parameters, morphData, morphElements),
|
|
44456
44519
|
oneByOne = invokeFunctionType(runningConfig.animation.oneByOne, parameters, morphData, morphElements),
|
|
44457
44520
|
splitPath = invokeFunctionType(runningConfig.animation.splitPath, parameters, morphData, morphElements),
|
|
44458
|
-
individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$
|
|
44521
|
+
individualDelay = isValidNumber$1(oneByOne) && oneByOne > 0 ? index => isNumber$1(oneByOne) ? index * oneByOne : !0 === oneByOne ? index * duration : 0 : void 0;
|
|
44459
44522
|
1 !== prev.length && 0 !== prev.length || 1 !== next.length ? 1 === prev.length && next.length > 1 ? oneToMultiMorph(prev[0].getGraphicItem(), next.map(element => element.getGraphicItem()), {
|
|
44460
44523
|
delay: delay,
|
|
44461
44524
|
duration: duration,
|
|
@@ -45830,9 +45893,9 @@
|
|
|
45830
45893
|
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
45831
45894
|
const hasResize = this._resizeRenderer(),
|
|
45832
45895
|
hasUpdate = this._dataflow.hasCommitted();
|
|
45833
|
-
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(),
|
|
45896
|
+
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 => {
|
|
45834
45897
|
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
45835
|
-
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doPreProgressive(), this) : this;
|
|
45898
|
+
}), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig), this.doRender(!0), this.doPreProgressive(), this) : this;
|
|
45836
45899
|
}
|
|
45837
45900
|
reuseCachedGrammars(runningConfig) {
|
|
45838
45901
|
if (this._willMorphMarks || (this._willMorphMarks = []), runningConfig.reuse) {
|
|
@@ -47773,7 +47836,7 @@
|
|
|
47773
47836
|
x1 = element.getGraphicAttribute("x1", !1),
|
|
47774
47837
|
width = element.getGraphicAttribute("width", !1);
|
|
47775
47838
|
let overallValue;
|
|
47776
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47839
|
+
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, {
|
|
47777
47840
|
from: {
|
|
47778
47841
|
x: overallValue,
|
|
47779
47842
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -47818,7 +47881,7 @@
|
|
|
47818
47881
|
const x1 = element.getGraphicAttribute("x1", !1),
|
|
47819
47882
|
width = element.getGraphicAttribute("width", !1);
|
|
47820
47883
|
let overallValue;
|
|
47821
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47884
|
+
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, {
|
|
47822
47885
|
to: {
|
|
47823
47886
|
x: overallValue,
|
|
47824
47887
|
x1: isNil$1(x1) ? void 0 : overallValue,
|
|
@@ -47869,7 +47932,7 @@
|
|
|
47869
47932
|
y1 = element.getGraphicAttribute("y1", !1),
|
|
47870
47933
|
height = element.getGraphicAttribute("height", !1);
|
|
47871
47934
|
let overallValue;
|
|
47872
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47935
|
+
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, {
|
|
47873
47936
|
from: {
|
|
47874
47937
|
y: overallValue,
|
|
47875
47938
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -47914,7 +47977,7 @@
|
|
|
47914
47977
|
const y1 = element.getGraphicAttribute("y1", !1),
|
|
47915
47978
|
height = element.getGraphicAttribute("height", !1);
|
|
47916
47979
|
let overallValue;
|
|
47917
|
-
return options && "negative" === options.orient ? isNumber$
|
|
47980
|
+
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, {
|
|
47918
47981
|
to: {
|
|
47919
47982
|
y: overallValue,
|
|
47920
47983
|
y1: isNil$1(y1) ? void 0 : overallValue,
|
|
@@ -47944,7 +48007,7 @@
|
|
|
47944
48007
|
},
|
|
47945
48008
|
growAngleInOverall = (element, options, animationParameters) => {
|
|
47946
48009
|
if (options && "anticlockwise" === options.orient) {
|
|
47947
|
-
const overallValue = isNumber$
|
|
48010
|
+
const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
|
|
47948
48011
|
return {
|
|
47949
48012
|
from: {
|
|
47950
48013
|
startAngle: overallValue,
|
|
@@ -47956,7 +48019,7 @@
|
|
|
47956
48019
|
}
|
|
47957
48020
|
};
|
|
47958
48021
|
}
|
|
47959
|
-
const overallValue = isNumber$
|
|
48022
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
47960
48023
|
return {
|
|
47961
48024
|
from: {
|
|
47962
48025
|
startAngle: overallValue,
|
|
@@ -47989,7 +48052,7 @@
|
|
|
47989
48052
|
},
|
|
47990
48053
|
growAngleOutOverall = (element, options, animationParameters) => {
|
|
47991
48054
|
if (options && "anticlockwise" === options.orient) {
|
|
47992
|
-
const overallValue = isNumber$
|
|
48055
|
+
const overallValue = isNumber$1(options.overall) ? options.overall : 2 * Math.PI;
|
|
47993
48056
|
return {
|
|
47994
48057
|
from: {
|
|
47995
48058
|
startAngle: element.getGraphicAttribute("startAngle", !0),
|
|
@@ -48001,7 +48064,7 @@
|
|
|
48001
48064
|
}
|
|
48002
48065
|
};
|
|
48003
48066
|
}
|
|
48004
|
-
const overallValue = isNumber$
|
|
48067
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48005
48068
|
return {
|
|
48006
48069
|
from: {
|
|
48007
48070
|
startAngle: element.getGraphicAttribute("startAngle", !0),
|
|
@@ -48033,7 +48096,7 @@
|
|
|
48033
48096
|
}
|
|
48034
48097
|
},
|
|
48035
48098
|
growRadiusInOverall = (element, options, animationParameters) => {
|
|
48036
|
-
const overallValue = isNumber$
|
|
48099
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48037
48100
|
return {
|
|
48038
48101
|
from: {
|
|
48039
48102
|
innerRadius: overallValue,
|
|
@@ -48065,7 +48128,7 @@
|
|
|
48065
48128
|
}
|
|
48066
48129
|
},
|
|
48067
48130
|
growRadiusOutOverall = (element, options, animationParameters) => {
|
|
48068
|
-
const overallValue = isNumber$
|
|
48131
|
+
const overallValue = isNumber$1(null == options ? void 0 : options.overall) ? options.overall : 0;
|
|
48069
48132
|
return {
|
|
48070
48133
|
from: {
|
|
48071
48134
|
innerRadius: element.getGraphicAttribute("innerRadius", !0),
|
|
@@ -48504,7 +48567,7 @@
|
|
|
48504
48567
|
return [{
|
|
48505
48568
|
channels: ["size", "padding"],
|
|
48506
48569
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
48507
|
-
if (isNumber$
|
|
48570
|
+
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) {
|
|
48508
48571
|
const arraySize = isArray$1(storedAttrs.size) ? storedAttrs.size : [storedAttrs.size, storedAttrs.size];
|
|
48509
48572
|
graphicAttributes.size = [Math.max(arraySize[0] - storedAttrs.padding[0], 1), Math.max(arraySize[1] - storedAttrs.padding[1], 1)];
|
|
48510
48573
|
} else graphicAttributes.size = storedAttrs.size;
|
|
@@ -49146,7 +49209,7 @@
|
|
|
49146
49209
|
}
|
|
49147
49210
|
function calcLayoutNumber(v, size, callOp) {
|
|
49148
49211
|
var _a, _b;
|
|
49149
|
-
if (isNumber$
|
|
49212
|
+
if (isNumber$1(v)) {
|
|
49150
49213
|
return v;
|
|
49151
49214
|
}
|
|
49152
49215
|
if (isPercent(v)) {
|
|
@@ -49168,7 +49231,7 @@
|
|
|
49168
49231
|
left: 0,
|
|
49169
49232
|
right: 0
|
|
49170
49233
|
};
|
|
49171
|
-
if (Object.values(paddingSpec).every(value => isNumber$
|
|
49234
|
+
if (Object.values(paddingSpec).every(value => isNumber$1(value))) {
|
|
49172
49235
|
result.top = (_a = paddingSpec.top) !== null && _a !== void 0 ? _a : 0;
|
|
49173
49236
|
result.right = (_b = paddingSpec.right) !== null && _b !== void 0 ? _b : 0;
|
|
49174
49237
|
result.bottom = (_c = paddingSpec.bottom) !== null && _c !== void 0 ? _c : 0;
|
|
@@ -49218,7 +49281,7 @@
|
|
|
49218
49281
|
}
|
|
49219
49282
|
return result;
|
|
49220
49283
|
}
|
|
49221
|
-
if (isNumber$
|
|
49284
|
+
if (isNumber$1(spec) || isPercent(spec) || isFunction$1(spec) || isPercentOffset(spec)) {
|
|
49222
49285
|
result.top = result.left = result.bottom = result.right = spec;
|
|
49223
49286
|
return result;
|
|
49224
49287
|
}
|
|
@@ -51371,7 +51434,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
51371
51434
|
else if (typeof value === 'object') {
|
|
51372
51435
|
result = {};
|
|
51373
51436
|
}
|
|
51374
|
-
else if (isBoolean$1(value) || isNumber$
|
|
51437
|
+
else if (isBoolean$1(value) || isNumber$1(value) || isString$1(value)) {
|
|
51375
51438
|
result = value;
|
|
51376
51439
|
}
|
|
51377
51440
|
else if (isDate$1(value)) {
|
|
@@ -56558,7 +56621,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56558
56621
|
this._initSpecStyle(spec, this.stateStyle, key);
|
|
56559
56622
|
}
|
|
56560
56623
|
convertAngleToRadian(styleConverter) {
|
|
56561
|
-
if (isNumber$
|
|
56624
|
+
if (isNumber$1(styleConverter)) {
|
|
56562
56625
|
return degreeToRadian(styleConverter);
|
|
56563
56626
|
}
|
|
56564
56627
|
else if (styleConverter.scale) {
|
|
@@ -57419,11 +57482,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57419
57482
|
this._specInfo = (_a = this._chartSpecTransformer) === null || _a === void 0 ? void 0 : _a.createSpecInfo(this._spec);
|
|
57420
57483
|
}
|
|
57421
57484
|
_initChart(spec) {
|
|
57422
|
-
var _a, _b;
|
|
57485
|
+
var _a, _b, _c;
|
|
57423
57486
|
if (!this._compiler) {
|
|
57424
57487
|
(_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('compiler is not initialized');
|
|
57425
57488
|
return;
|
|
57426
57489
|
}
|
|
57490
|
+
if (this._chart) {
|
|
57491
|
+
(_b = this._option) === null || _b === void 0 ? void 0 : _b.onError('chart is already initialized');
|
|
57492
|
+
return;
|
|
57493
|
+
}
|
|
57427
57494
|
const chart = Factory.createChart(spec.type, spec, {
|
|
57428
57495
|
type: spec.type,
|
|
57429
57496
|
globalInstance: this,
|
|
@@ -57445,7 +57512,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57445
57512
|
disableTriggerEvent: this._option.disableTriggerEvent === true
|
|
57446
57513
|
});
|
|
57447
57514
|
if (!chart) {
|
|
57448
|
-
(
|
|
57515
|
+
(_c = this._option) === null || _c === void 0 ? void 0 : _c.onError('init chart fail');
|
|
57449
57516
|
return;
|
|
57450
57517
|
}
|
|
57451
57518
|
this._chart = chart;
|
|
@@ -58736,7 +58803,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58736
58803
|
registerChartPlugin(MediaQuery);
|
|
58737
58804
|
};
|
|
58738
58805
|
|
|
58739
|
-
const version = "1.
|
|
58806
|
+
const version = "1.10.0-alpha.0";
|
|
58740
58807
|
|
|
58741
58808
|
const addVChartProperty = (data, op) => {
|
|
58742
58809
|
const context = op.beforeCall();
|
|
@@ -59360,13 +59427,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59360
59427
|
_getDefaultSpecFromChart(chartSpec) {
|
|
59361
59428
|
var _a;
|
|
59362
59429
|
const spec = (_a = super._getDefaultSpecFromChart(chartSpec)) !== null && _a !== void 0 ? _a : {};
|
|
59363
|
-
const { outerRadius, innerRadius } = chartSpec;
|
|
59430
|
+
const { outerRadius, innerRadius, direction } = chartSpec;
|
|
59364
59431
|
if (isValid$1(outerRadius)) {
|
|
59365
59432
|
spec.outerRadius = outerRadius;
|
|
59366
59433
|
}
|
|
59367
59434
|
if (isValid$1(innerRadius)) {
|
|
59368
59435
|
spec.innerRadius = innerRadius;
|
|
59369
59436
|
}
|
|
59437
|
+
if (isValid$1(direction)) {
|
|
59438
|
+
spec.direction = direction;
|
|
59439
|
+
}
|
|
59370
59440
|
return Object.keys(spec).length > 0 ? spec : undefined;
|
|
59371
59441
|
}
|
|
59372
59442
|
}
|
|
@@ -60612,41 +60682,46 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60612
60682
|
getStackGroupFields() {
|
|
60613
60683
|
return this.getGroupFields();
|
|
60614
60684
|
}
|
|
60685
|
+
getStackValue() {
|
|
60686
|
+
var _a, _b;
|
|
60687
|
+
const axisId = (_a = (this.direction === "horizontal" ? this.getXAxisHelper() : this.getYAxisHelper())) === null || _a === void 0 ? void 0 : _a.getAxisId();
|
|
60688
|
+
return (_b = this._spec.stackValue) !== null && _b !== void 0 ? _b : `${PREFIX}_series_${this.type}_${axisId}`;
|
|
60689
|
+
}
|
|
60615
60690
|
getStackValueField() {
|
|
60616
|
-
if (this.direction === "
|
|
60617
|
-
return array(this._spec.
|
|
60691
|
+
if (this.direction === "horizontal") {
|
|
60692
|
+
return array(this._spec.xField)[0];
|
|
60618
60693
|
}
|
|
60619
|
-
return array(this._spec.
|
|
60694
|
+
return array(this._spec.yField)[0];
|
|
60620
60695
|
}
|
|
60621
60696
|
setValueFieldToStack() {
|
|
60622
|
-
if (this.direction === "
|
|
60623
|
-
this.setFieldY(STACK_FIELD_END);
|
|
60624
|
-
this.setFieldY2(STACK_FIELD_START);
|
|
60625
|
-
}
|
|
60626
|
-
else {
|
|
60697
|
+
if (this.direction === "horizontal") {
|
|
60627
60698
|
this.setFieldX(STACK_FIELD_END);
|
|
60628
60699
|
this.setFieldX2(STACK_FIELD_START);
|
|
60629
60700
|
}
|
|
60701
|
+
else {
|
|
60702
|
+
this.setFieldY(STACK_FIELD_END);
|
|
60703
|
+
this.setFieldY2(STACK_FIELD_START);
|
|
60704
|
+
}
|
|
60630
60705
|
}
|
|
60631
60706
|
setValueFieldToPercent() {
|
|
60632
|
-
if (this.direction === "
|
|
60633
|
-
this.setFieldY(STACK_FIELD_END_PERCENT);
|
|
60634
|
-
this.setFieldY2(STACK_FIELD_START_PERCENT);
|
|
60635
|
-
}
|
|
60636
|
-
else {
|
|
60707
|
+
if (this.direction === "horizontal") {
|
|
60637
60708
|
this.setFieldX(STACK_FIELD_END_PERCENT);
|
|
60638
60709
|
this.setFieldX2(STACK_FIELD_START_PERCENT);
|
|
60639
60710
|
}
|
|
60711
|
+
else {
|
|
60712
|
+
this.setFieldY(STACK_FIELD_END_PERCENT);
|
|
60713
|
+
this.setFieldY2(STACK_FIELD_START_PERCENT);
|
|
60714
|
+
}
|
|
60640
60715
|
}
|
|
60641
60716
|
setValueFieldToStackOffsetSilhouette() {
|
|
60642
|
-
if (this.direction === "
|
|
60643
|
-
this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
|
|
60644
|
-
this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
|
|
60645
|
-
}
|
|
60646
|
-
else {
|
|
60717
|
+
if (this.direction === "horizontal") {
|
|
60647
60718
|
this.setFieldX(STACK_FIELD_END_OffsetSilhouette);
|
|
60648
60719
|
this.setFieldX2(STACK_FIELD_START_OffsetSilhouette);
|
|
60649
60720
|
}
|
|
60721
|
+
else {
|
|
60722
|
+
this.setFieldY(STACK_FIELD_END_OffsetSilhouette);
|
|
60723
|
+
this.setFieldY2(STACK_FIELD_START_OffsetSilhouette);
|
|
60724
|
+
}
|
|
60650
60725
|
}
|
|
60651
60726
|
onXAxisHelperUpdate() {
|
|
60652
60727
|
this.onMarkPositionUpdate();
|
|
@@ -60820,22 +60895,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60820
60895
|
this._buildScaleConfig();
|
|
60821
60896
|
}
|
|
60822
60897
|
getDimensionField() {
|
|
60823
|
-
if (this._direction === "
|
|
60824
|
-
return this.
|
|
60898
|
+
if (this._direction === "horizontal") {
|
|
60899
|
+
return this._specYField;
|
|
60825
60900
|
}
|
|
60826
|
-
return this.
|
|
60901
|
+
return this._specXField;
|
|
60827
60902
|
}
|
|
60828
60903
|
getDimensionContinuousField() {
|
|
60829
|
-
if (this._direction === "
|
|
60830
|
-
return [this.
|
|
60904
|
+
if (this._direction === "horizontal") {
|
|
60905
|
+
return [this.fieldY[0], this.fieldY2];
|
|
60831
60906
|
}
|
|
60832
|
-
return [this.
|
|
60907
|
+
return [this.fieldX[0], this.fieldX2];
|
|
60833
60908
|
}
|
|
60834
60909
|
getMeasureField() {
|
|
60835
|
-
if (this._direction === "
|
|
60836
|
-
return this.
|
|
60910
|
+
if (this._direction === "horizontal") {
|
|
60911
|
+
return this._specXField;
|
|
60837
60912
|
}
|
|
60838
|
-
return this.
|
|
60913
|
+
return this._specYField;
|
|
60839
60914
|
}
|
|
60840
60915
|
viewDataUpdate(d) {
|
|
60841
60916
|
super.viewDataUpdate(d);
|
|
@@ -60875,9 +60950,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60875
60950
|
const fieldsX = this._fieldX;
|
|
60876
60951
|
samplingTrans.push({
|
|
60877
60952
|
type: 'sampling',
|
|
60878
|
-
size: this._direction === "
|
|
60953
|
+
size: this._direction === "horizontal" ? height : width,
|
|
60879
60954
|
factor: this._spec.samplingFactor,
|
|
60880
|
-
yfield: this._direction === "
|
|
60955
|
+
yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
|
|
60881
60956
|
groupBy: this._seriesField,
|
|
60882
60957
|
mode: this._spec.sampling
|
|
60883
60958
|
});
|
|
@@ -60941,9 +61016,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60941
61016
|
else {
|
|
60942
61017
|
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;
|
|
60943
61018
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
60944
|
-
? direction === "
|
|
60945
|
-
? '
|
|
60946
|
-
: '
|
|
61019
|
+
? direction === "horizontal"
|
|
61020
|
+
? 'monotoneY'
|
|
61021
|
+
: 'monotoneX'
|
|
60947
61022
|
: userCurveType;
|
|
60948
61023
|
this.setMarkStyle(lineMark, {
|
|
60949
61024
|
curveType
|
|
@@ -63198,33 +63273,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63198
63273
|
var _a, _b, _c, _d, _e;
|
|
63199
63274
|
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);
|
|
63200
63275
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
63201
|
-
? this._direction === "
|
|
63202
|
-
? '
|
|
63203
|
-
: '
|
|
63276
|
+
? this._direction === "horizontal"
|
|
63277
|
+
? 'monotoneY'
|
|
63278
|
+
: 'monotoneX'
|
|
63204
63279
|
: userCurveType;
|
|
63205
63280
|
const areaMark = this._areaMark;
|
|
63206
63281
|
if (areaMark) {
|
|
63207
|
-
if (this._direction === "
|
|
63282
|
+
if (this._direction === "horizontal") {
|
|
63208
63283
|
this.setMarkStyle(this._areaMark, {
|
|
63209
63284
|
x: this.dataToPositionX.bind(this),
|
|
63210
|
-
|
|
63285
|
+
x1: (datum) => {
|
|
63211
63286
|
var _a, _b;
|
|
63212
|
-
return valueInScaleRange(this.
|
|
63287
|
+
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));
|
|
63213
63288
|
},
|
|
63214
63289
|
y: this.dataToPositionY.bind(this),
|
|
63215
|
-
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63290
|
+
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
|
|
63291
|
+
orient: this._direction
|
|
63216
63292
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63217
63293
|
}
|
|
63218
63294
|
else {
|
|
63219
63295
|
this.setMarkStyle(this._areaMark, {
|
|
63220
63296
|
x: this.dataToPositionX.bind(this),
|
|
63221
|
-
|
|
63297
|
+
y1: (datum) => {
|
|
63222
63298
|
var _a, _b;
|
|
63223
|
-
return valueInScaleRange(this.
|
|
63299
|
+
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));
|
|
63224
63300
|
},
|
|
63225
63301
|
y: this.dataToPositionY.bind(this),
|
|
63226
|
-
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63227
|
-
orient: this._direction
|
|
63302
|
+
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null
|
|
63228
63303
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63229
63304
|
}
|
|
63230
63305
|
this.setMarkStyle(areaMark, {
|
|
@@ -63844,30 +63919,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63844
63919
|
var _a, _b, _c, _d;
|
|
63845
63920
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
63846
63921
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
63847
|
-
if (this.direction === "
|
|
63848
|
-
this.setMarkStyle(this._barMark, {
|
|
63849
|
-
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63850
|
-
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63851
|
-
y: (datum, ctx, opt, dataView) => {
|
|
63852
|
-
if (this._shouldDoPreCalculate()) {
|
|
63853
|
-
this._calculateStackRectPosition(true);
|
|
63854
|
-
return datum[RECT_Y];
|
|
63855
|
-
}
|
|
63856
|
-
if (this._spec.barMinHeight) {
|
|
63857
|
-
return this._calculateRectPosition(datum, true);
|
|
63858
|
-
}
|
|
63859
|
-
return valueInScaleRange(this.dataToPositionY(datum), yScale);
|
|
63860
|
-
},
|
|
63861
|
-
y1: (datum) => {
|
|
63862
|
-
if (this._shouldDoPreCalculate()) {
|
|
63863
|
-
this._calculateStackRectPosition(true);
|
|
63864
|
-
return datum[RECT_Y1];
|
|
63865
|
-
}
|
|
63866
|
-
return valueInScaleRange(this.dataToPositionY1(datum), yScale);
|
|
63867
|
-
}
|
|
63868
|
-
}, 'normal', exports.AttributeLevel.Series);
|
|
63869
|
-
}
|
|
63870
|
-
else {
|
|
63922
|
+
if (this.direction === "horizontal") {
|
|
63871
63923
|
this.setMarkStyle(this._barMark, {
|
|
63872
63924
|
x: (datum) => {
|
|
63873
63925
|
if (this._shouldDoPreCalculate()) {
|
|
@@ -63890,42 +63942,65 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63890
63942
|
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
63891
63943
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63892
63944
|
}
|
|
63945
|
+
else {
|
|
63946
|
+
this.setMarkStyle(this._barMark, {
|
|
63947
|
+
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63948
|
+
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63949
|
+
y: (datum, ctx, opt, dataView) => {
|
|
63950
|
+
if (this._shouldDoPreCalculate()) {
|
|
63951
|
+
this._calculateStackRectPosition(true);
|
|
63952
|
+
return datum[RECT_Y];
|
|
63953
|
+
}
|
|
63954
|
+
if (this._spec.barMinHeight) {
|
|
63955
|
+
return this._calculateRectPosition(datum, true);
|
|
63956
|
+
}
|
|
63957
|
+
return valueInScaleRange(this.dataToPositionY(datum), yScale);
|
|
63958
|
+
},
|
|
63959
|
+
y1: (datum) => {
|
|
63960
|
+
if (this._shouldDoPreCalculate()) {
|
|
63961
|
+
this._calculateStackRectPosition(true);
|
|
63962
|
+
return datum[RECT_Y1];
|
|
63963
|
+
}
|
|
63964
|
+
return valueInScaleRange(this.dataToPositionY1(datum), yScale);
|
|
63965
|
+
}
|
|
63966
|
+
}, 'normal', exports.AttributeLevel.Series);
|
|
63967
|
+
}
|
|
63893
63968
|
this._initLinearBarBackgroundMarkStyle();
|
|
63894
63969
|
}
|
|
63895
63970
|
_initLinearBarBackgroundMarkStyle() {
|
|
63896
63971
|
var _a, _b, _c, _d;
|
|
63897
63972
|
const xScale = (_b = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
63898
63973
|
const yScale = (_d = (_c = this._yAxisHelper) === null || _c === void 0 ? void 0 : _c.getScale) === null || _d === void 0 ? void 0 : _d.call(_c, 0);
|
|
63899
|
-
if (this.direction === "
|
|
63974
|
+
if (this.direction === "horizontal") {
|
|
63900
63975
|
this.setMarkStyle(this._barBackgroundMark, {
|
|
63901
|
-
x: (
|
|
63902
|
-
|
|
63903
|
-
y: () => {
|
|
63904
|
-
const range = yScale.range();
|
|
63976
|
+
x: () => {
|
|
63977
|
+
const range = xScale.range();
|
|
63905
63978
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
63906
63979
|
return min;
|
|
63907
63980
|
},
|
|
63908
|
-
|
|
63909
|
-
const range =
|
|
63981
|
+
x1: () => {
|
|
63982
|
+
const range = xScale.range();
|
|
63910
63983
|
const max = Math.max(range[0], range[range.length - 1]);
|
|
63911
63984
|
return max;
|
|
63912
|
-
}
|
|
63985
|
+
},
|
|
63986
|
+
y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
|
|
63987
|
+
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
63913
63988
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63914
63989
|
}
|
|
63915
63990
|
else {
|
|
63916
63991
|
this.setMarkStyle(this._barBackgroundMark, {
|
|
63917
|
-
x: () =>
|
|
63918
|
-
|
|
63992
|
+
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63993
|
+
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63994
|
+
y: () => {
|
|
63995
|
+
const range = yScale.range();
|
|
63919
63996
|
const min = Math.min(range[0], range[range.length - 1]);
|
|
63920
63997
|
return min;
|
|
63921
63998
|
},
|
|
63922
|
-
|
|
63923
|
-
const range =
|
|
63999
|
+
y1: () => {
|
|
64000
|
+
const range = yScale.range();
|
|
63924
64001
|
const max = Math.max(range[0], range[range.length - 1]);
|
|
63925
64002
|
return max;
|
|
63926
|
-
}
|
|
63927
|
-
y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
|
|
63928
|
-
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale)
|
|
64003
|
+
}
|
|
63929
64004
|
}, 'normal', exports.AttributeLevel.Series);
|
|
63930
64005
|
}
|
|
63931
64006
|
}
|
|
@@ -64042,9 +64117,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64042
64117
|
const fieldsX = this._fieldX;
|
|
64043
64118
|
samplingTrans.push({
|
|
64044
64119
|
type: 'sampling',
|
|
64045
|
-
size: this._direction === "
|
|
64120
|
+
size: this._direction === "horizontal" ? height : width,
|
|
64046
64121
|
factor: this._spec.samplingFactor,
|
|
64047
|
-
yfield: this._direction === "
|
|
64122
|
+
yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
|
|
64048
64123
|
groupBy: this._seriesField,
|
|
64049
64124
|
mode: this._spec.sampling
|
|
64050
64125
|
});
|
|
@@ -64280,7 +64355,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64280
64355
|
if (isNil$1(sizeSpec)) {
|
|
64281
64356
|
return SCATTER_DEFAULT_SIZE;
|
|
64282
64357
|
}
|
|
64283
|
-
if (isNumber$
|
|
64358
|
+
if (isNumber$1(sizeSpec)) {
|
|
64284
64359
|
return sizeSpec;
|
|
64285
64360
|
}
|
|
64286
64361
|
if (isString$1(sizeSpec) && isNumeric$1(sizeSpec)) {
|
|
@@ -64345,7 +64420,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64345
64420
|
y: this.dataToPositionY.bind(this),
|
|
64346
64421
|
z: this._fieldZ ? this.dataToPositionZ.bind(this) : null,
|
|
64347
64422
|
fill: this.getColorAttribute(),
|
|
64348
|
-
size: isNumber$
|
|
64423
|
+
size: isNumber$1(this._size) || isFunction$1(this._size) ? this._size : SCATTER_DEFAULT_SIZE,
|
|
64349
64424
|
symbolType: isString$1(this._shape) || isFunction$1(this._shape) ? this._shape : SCATTER_DEFAULT_SHAPE
|
|
64350
64425
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
64351
64426
|
if (isValid$1(this._sizeField) || isValid$1(this._size)) {
|
|
@@ -66718,59 +66793,59 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66718
66793
|
}
|
|
66719
66794
|
totalPositionX(datum, field, pos = 0.5) {
|
|
66720
66795
|
const { dataToPosition, getBandwidth } = this._xAxisHelper;
|
|
66721
|
-
if (this._direction === "
|
|
66722
|
-
return (dataToPosition([datum[field]], {
|
|
66796
|
+
if (this._direction === "horizontal") {
|
|
66797
|
+
return valueInScaleRange(dataToPosition([datum[field]], {
|
|
66723
66798
|
bandPosition: this._bandPosition
|
|
66724
|
-
})
|
|
66725
|
-
getBandwidth(0) * 0.5 -
|
|
66726
|
-
this._barMark.getAttribute('width', datum) * (0.5 - pos));
|
|
66799
|
+
}));
|
|
66727
66800
|
}
|
|
66728
|
-
return
|
|
66801
|
+
return (dataToPosition([datum[field]], {
|
|
66729
66802
|
bandPosition: this._bandPosition
|
|
66730
|
-
})
|
|
66803
|
+
}) +
|
|
66804
|
+
getBandwidth(0) * 0.5 -
|
|
66805
|
+
this._barMark.getAttribute('width', datum) * (0.5 - pos));
|
|
66731
66806
|
}
|
|
66732
66807
|
totalPositionY(datum, field, pos = 0.5) {
|
|
66733
66808
|
const { dataToPosition, getBandwidth } = this._yAxisHelper;
|
|
66734
|
-
if (this._direction === "
|
|
66735
|
-
return
|
|
66809
|
+
if (this._direction === "horizontal") {
|
|
66810
|
+
return (dataToPosition([datum[field]], {
|
|
66736
66811
|
bandPosition: this._bandPosition
|
|
66737
|
-
})
|
|
66812
|
+
}) +
|
|
66813
|
+
getBandwidth(0) * 0.5 -
|
|
66814
|
+
this._barMark.getAttribute('height', datum) * (0.5 - pos));
|
|
66738
66815
|
}
|
|
66739
|
-
return (dataToPosition([datum[field]], {
|
|
66816
|
+
return valueInScaleRange(dataToPosition([datum[field]], {
|
|
66740
66817
|
bandPosition: this._bandPosition
|
|
66741
|
-
})
|
|
66742
|
-
getBandwidth(0) * 0.5 -
|
|
66743
|
-
this._barMark.getAttribute('height', datum) * (0.5 - pos));
|
|
66818
|
+
}));
|
|
66744
66819
|
}
|
|
66745
66820
|
initMarkStyle() {
|
|
66746
66821
|
super.initMarkStyle();
|
|
66747
66822
|
if (this._leaderLineMark) {
|
|
66748
|
-
if (this._direction === "
|
|
66823
|
+
if (this._direction === "horizontal") {
|
|
66749
66824
|
this.setMarkStyle(this._leaderLineMark, {
|
|
66750
66825
|
visible: (datum) => !isNil$1(datum.lastIndex),
|
|
66751
|
-
x: (datum) =>
|
|
66826
|
+
x: (datum) => this.totalPositionX(datum, 'lastEnd', 0),
|
|
66827
|
+
x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
|
|
66828
|
+
y: (datum) => {
|
|
66752
66829
|
if (!datum.lastIndex) {
|
|
66753
66830
|
return 0;
|
|
66754
66831
|
}
|
|
66755
|
-
return this.
|
|
66832
|
+
return this.totalPositionY(datum, 'lastIndex', 1);
|
|
66756
66833
|
},
|
|
66757
|
-
|
|
66758
|
-
y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
|
|
66759
|
-
y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
|
|
66834
|
+
y1: (datum) => this.totalPositionY(datum, 'index', 0)
|
|
66760
66835
|
}, 'normal', exports.AttributeLevel.Series);
|
|
66761
66836
|
}
|
|
66762
66837
|
else {
|
|
66763
66838
|
this.setMarkStyle(this._leaderLineMark, {
|
|
66764
66839
|
visible: (datum) => !isNil$1(datum.lastIndex),
|
|
66765
|
-
x: (datum) =>
|
|
66766
|
-
x1: (datum) => this.totalPositionX(datum, datum.isTotal ? 'end' : 'start', 0),
|
|
66767
|
-
y: (datum) => {
|
|
66840
|
+
x: (datum) => {
|
|
66768
66841
|
if (!datum.lastIndex) {
|
|
66769
66842
|
return 0;
|
|
66770
66843
|
}
|
|
66771
|
-
return this.
|
|
66844
|
+
return this.totalPositionX(datum, 'lastIndex', 1);
|
|
66772
66845
|
},
|
|
66773
|
-
|
|
66846
|
+
x1: (datum) => this.totalPositionX(datum, 'index', 0),
|
|
66847
|
+
y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
|
|
66848
|
+
y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
|
|
66774
66849
|
}, 'normal', exports.AttributeLevel.Series);
|
|
66775
66850
|
}
|
|
66776
66851
|
}
|
|
@@ -67117,15 +67192,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67117
67192
|
minMaxFillOpacity: this._shaftFillOpacity,
|
|
67118
67193
|
stroke: (_b = this._strokeColor) !== null && _b !== void 0 ? _b : (this._shaftShape === 'line' ? this.getColorAttribute() : DEFAULT_STROKE_COLOR)
|
|
67119
67194
|
};
|
|
67120
|
-
const boxPlotMarkStyles = this._direction === "
|
|
67121
|
-
? Object.assign(Object.assign({
|
|
67195
|
+
const boxPlotMarkStyles = this._direction === "horizontal"
|
|
67196
|
+
? 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(); } });
|
|
67122
67197
|
this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
67123
67198
|
}
|
|
67124
67199
|
const outlierMark = this._outlierMark;
|
|
67125
67200
|
if (outlierMark) {
|
|
67126
67201
|
this.setMarkStyle(outlierMark, {
|
|
67127
67202
|
fill: (_d = (_c = this._outliersStyle) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.getColorAttribute(),
|
|
67128
|
-
size: isNumber$
|
|
67203
|
+
size: isNumber$1((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE,
|
|
67129
67204
|
symbolType: 'circle'
|
|
67130
67205
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
67131
67206
|
}
|
|
@@ -67133,7 +67208,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67133
67208
|
initBoxPlotMarkStyle() {
|
|
67134
67209
|
var _a, _b;
|
|
67135
67210
|
const boxPlotMark = this._boxPlotMark;
|
|
67136
|
-
const axisHelper = this._direction === "
|
|
67211
|
+
const axisHelper = this._direction === "horizontal" ? this._xAxisHelper : this._yAxisHelper;
|
|
67137
67212
|
if (boxPlotMark && axisHelper) {
|
|
67138
67213
|
const { dataToPosition } = axisHelper;
|
|
67139
67214
|
const scale = (_a = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _a === void 0 ? void 0 : _a.call(axisHelper, 0);
|
|
@@ -67159,16 +67234,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67159
67234
|
if (outlierMark && axisHelper) {
|
|
67160
67235
|
const { dataToPosition } = axisHelper;
|
|
67161
67236
|
const scale = (_b = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _b === void 0 ? void 0 : _b.call(axisHelper, 0);
|
|
67162
|
-
const outlierMarkPositionChannel = this._direction === "
|
|
67237
|
+
const outlierMarkPositionChannel = this._direction === "horizontal"
|
|
67163
67238
|
? {
|
|
67164
|
-
|
|
67165
|
-
|
|
67239
|
+
y: this.dataToPositionY.bind(this),
|
|
67240
|
+
x: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
67166
67241
|
bandPosition: this._bandPosition
|
|
67167
67242
|
}), scale)
|
|
67168
67243
|
}
|
|
67169
67244
|
: {
|
|
67170
|
-
|
|
67171
|
-
|
|
67245
|
+
x: this.dataToPositionX.bind(this),
|
|
67246
|
+
y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
67172
67247
|
bandPosition: this._bandPosition
|
|
67173
67248
|
}), scale)
|
|
67174
67249
|
};
|
|
@@ -67190,7 +67265,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67190
67265
|
outlierDataView.transform({
|
|
67191
67266
|
type: 'foldOutlierData',
|
|
67192
67267
|
options: {
|
|
67193
|
-
dimensionField: this._direction === "
|
|
67268
|
+
dimensionField: this._direction === "horizontal" ? this._fieldY : this._fieldX,
|
|
67194
67269
|
outliersField: this._outliersField
|
|
67195
67270
|
}
|
|
67196
67271
|
});
|
|
@@ -67211,8 +67286,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67211
67286
|
if (this._autoBoxWidth) {
|
|
67212
67287
|
return this._autoBoxWidth;
|
|
67213
67288
|
}
|
|
67214
|
-
const bandAxisHelper = this._direction === "
|
|
67215
|
-
const xField = this._direction === "
|
|
67289
|
+
const bandAxisHelper = this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper;
|
|
67290
|
+
const xField = this._direction === "horizontal" ? this._fieldY : this._fieldX;
|
|
67216
67291
|
const innerBandWidth = bandAxisHelper.getBandwidth(xField.length - 1);
|
|
67217
67292
|
const autoBoxWidth = innerBandWidth / xField.length;
|
|
67218
67293
|
this._autoBoxWidth = autoBoxWidth;
|
|
@@ -67287,24 +67362,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67287
67362
|
};
|
|
67288
67363
|
|
|
67289
67364
|
class TextMark extends BaseMark {
|
|
67290
|
-
|
|
67291
|
-
|
|
67365
|
+
getTextType() {
|
|
67366
|
+
return this._textType;
|
|
67367
|
+
}
|
|
67368
|
+
constructor(name, option) {
|
|
67369
|
+
super(name, option);
|
|
67292
67370
|
this.type = TextMark.type;
|
|
67371
|
+
this._textType = 'text';
|
|
67293
67372
|
}
|
|
67294
67373
|
_getDefaultStyle() {
|
|
67295
67374
|
const defaultStyle = Object.assign(Object.assign({}, super._getDefaultStyle()), { angle: 0, textAlign: 'center', lineWidth: 0, textConfig: [] });
|
|
67296
67375
|
return defaultStyle;
|
|
67297
67376
|
}
|
|
67298
|
-
|
|
67299
|
-
|
|
67300
|
-
|
|
67301
|
-
|
|
67302
|
-
this._product = view.mark(GrammarMarkType.richtext, group !== null && group !== void 0 ? group : view.rootMark).id(id);
|
|
67377
|
+
initStyleWithSpec(spec, key) {
|
|
67378
|
+
super.initStyleWithSpec(spec, key);
|
|
67379
|
+
if (spec.textType) {
|
|
67380
|
+
this._textType = spec.textType;
|
|
67303
67381
|
}
|
|
67304
|
-
|
|
67305
|
-
|
|
67382
|
+
}
|
|
67383
|
+
compileEncode() {
|
|
67384
|
+
super.compileEncode();
|
|
67385
|
+
if (this._textType === 'rich') {
|
|
67386
|
+
this._product.encodeState('group', { textType: this._textType });
|
|
67306
67387
|
}
|
|
67307
|
-
this._compiledProductId = id;
|
|
67308
67388
|
}
|
|
67309
67389
|
}
|
|
67310
67390
|
TextMark.type = "text";
|
|
@@ -67790,41 +67870,41 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67790
67870
|
var _a, _b, _c, _d, _e;
|
|
67791
67871
|
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;
|
|
67792
67872
|
const curveType = userCurveType === DEFAULT_SMOOTH_INTERPOLATE
|
|
67793
|
-
? this._direction === "
|
|
67794
|
-
? '
|
|
67795
|
-
: '
|
|
67873
|
+
? this._direction === "horizontal"
|
|
67874
|
+
? 'monotoneY'
|
|
67875
|
+
: 'monotoneX'
|
|
67796
67876
|
: userCurveType;
|
|
67797
67877
|
const areaMark = this._areaMark;
|
|
67798
67878
|
if (areaMark) {
|
|
67799
|
-
if (this._direction === "
|
|
67879
|
+
if (this._direction === "horizontal") {
|
|
67800
67880
|
this.setMarkStyle(this._areaMark, {
|
|
67801
67881
|
x: this.dataToPositionX.bind(this),
|
|
67802
|
-
|
|
67803
|
-
if (!this.
|
|
67882
|
+
x1: (datum) => {
|
|
67883
|
+
if (!this._xAxisHelper) {
|
|
67804
67884
|
return Number.NaN;
|
|
67805
67885
|
}
|
|
67806
|
-
const { dataToPosition } = this.
|
|
67807
|
-
return dataToPosition(this.getDatumPositionValues(datum, this._spec.
|
|
67886
|
+
const { dataToPosition } = this._xAxisHelper;
|
|
67887
|
+
return dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
|
|
67808
67888
|
bandPosition: this._bandPosition
|
|
67809
67889
|
});
|
|
67810
67890
|
},
|
|
67811
|
-
y: this.dataToPositionY.bind(this)
|
|
67891
|
+
y: this.dataToPositionY.bind(this),
|
|
67892
|
+
orient: this._direction
|
|
67812
67893
|
}, 'normal', exports.AttributeLevel.Series);
|
|
67813
67894
|
}
|
|
67814
67895
|
else {
|
|
67815
67896
|
this.setMarkStyle(this._areaMark, {
|
|
67816
67897
|
x: this.dataToPositionX.bind(this),
|
|
67817
|
-
|
|
67818
|
-
if (!this.
|
|
67898
|
+
y1: (datum) => {
|
|
67899
|
+
if (!this._yAxisHelper) {
|
|
67819
67900
|
return Number.NaN;
|
|
67820
67901
|
}
|
|
67821
|
-
const { dataToPosition } = this.
|
|
67822
|
-
return dataToPosition(this.getDatumPositionValues(datum, this._spec.
|
|
67902
|
+
const { dataToPosition } = this._yAxisHelper;
|
|
67903
|
+
return dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[1]), {
|
|
67823
67904
|
bandPosition: this._bandPosition
|
|
67824
67905
|
});
|
|
67825
67906
|
},
|
|
67826
|
-
y: this.dataToPositionY.bind(this)
|
|
67827
|
-
orient: this._direction
|
|
67907
|
+
y: this.dataToPositionY.bind(this)
|
|
67828
67908
|
}, 'normal', exports.AttributeLevel.Series);
|
|
67829
67909
|
}
|
|
67830
67910
|
this.setMarkStyle(areaMark, {
|
|
@@ -69041,11 +69121,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
69041
69121
|
polarPointInterpolation(pointA, pointB, ratio) {
|
|
69042
69122
|
const polarPointA0 = this._pointToCoord(pointA);
|
|
69043
69123
|
const polarPointA1 = this._pointToCoord({ x: pointA.x1, y: pointA.y1 });
|
|
69124
|
+
const angleA0 = normalizeAngle$1(polarPointA0.angle);
|
|
69125
|
+
const angleA1 = normalizeAngle$1(polarPointA1.angle);
|
|
69044
69126
|
const polarPointB0 = this._pointToCoord(pointB);
|
|
69045
69127
|
const polarPointB1 = this._pointToCoord({ x: pointB.x1, y: pointB.y1 });
|
|
69046
|
-
const
|
|
69128
|
+
const angleB0 = normalizeAngle$1(polarPointB0.angle);
|
|
69129
|
+
const angleB1 = normalizeAngle$1(polarPointB1.angle);
|
|
69130
|
+
const angle0 = angleA0 + (angleB0 - angleA0) * ratio;
|
|
69047
69131
|
const radius0 = polarPointA0.radius + (polarPointB0.radius - polarPointA0.radius) * ratio;
|
|
69048
|
-
const angle1 =
|
|
69132
|
+
const angle1 = angleA1 + (angleB1 - angleA1) * ratio;
|
|
69049
69133
|
const radius1 = polarPointA1.radius + (polarPointB1.radius - polarPointA1.radius) * ratio;
|
|
69050
69134
|
const { x, y } = this._coordToPoint({ angle: angle0, radius: radius0 });
|
|
69051
69135
|
const { x: x1, y: y1 } = this._coordToPoint({ angle: angle1, radius: radius1 });
|
|
@@ -72071,7 +72155,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72071
72155
|
postProjection = options.postProjection;
|
|
72072
72156
|
let fontSize = options.fontSize ? field$1(options.fontSize) : 14;
|
|
72073
72157
|
const fontSizeRange = options.fontSizeRange;
|
|
72074
|
-
if (fontSizeRange && !isNumber$
|
|
72158
|
+
if (fontSizeRange && !isNumber$1(fontSize)) {
|
|
72075
72159
|
const fsize = fontSize,
|
|
72076
72160
|
fontSizeSqrtScale = generateSqrtScale(extent$1(fsize, data), fontSizeRange);
|
|
72077
72161
|
fontSize = datum => fontSizeSqrtScale(fsize(datum));
|
|
@@ -72109,7 +72193,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72109
72193
|
progressive: layout
|
|
72110
72194
|
} : layout.output();
|
|
72111
72195
|
};
|
|
72112
|
-
const field$1 = option => isString$1(option) || isNumber$
|
|
72196
|
+
const field$1 = option => isString$1(option) || isNumber$1(option) || isFunction$1(option) ? option : datum => datum[option.field],
|
|
72113
72197
|
sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x),
|
|
72114
72198
|
generateSqrtScale = (domain, range) => {
|
|
72115
72199
|
if (domain[0] === domain[1]) return datum => range[0];
|
|
@@ -73832,7 +73916,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73832
73916
|
}
|
|
73833
73917
|
_computeLabelLimit(datum, labelSpec) {
|
|
73834
73918
|
const limit = labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.limit;
|
|
73835
|
-
if (isNumber$
|
|
73919
|
+
if (isNumber$1(limit)) {
|
|
73836
73920
|
return limit;
|
|
73837
73921
|
}
|
|
73838
73922
|
const points = this.getPoints(datum);
|
|
@@ -74510,11 +74594,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74510
74594
|
}
|
|
74511
74595
|
_filterChildren(node) {
|
|
74512
74596
|
const maxDepth = this.options.maxDepth;
|
|
74513
|
-
if (isNumber$
|
|
74597
|
+
if (isNumber$1(maxDepth) && maxDepth >= 0 && node.depth >= maxDepth) return !1;
|
|
74514
74598
|
const minChildrenVisibleArea = this.options.minChildrenVisibleArea;
|
|
74515
|
-
if (isNumber$
|
|
74599
|
+
if (isNumber$1(minChildrenVisibleArea) && Math.abs((node.x1 - node.x0) * (node.y1 - node.y0)) < minChildrenVisibleArea) return !1;
|
|
74516
74600
|
const minChildrenVisibleSize = this.options.minChildrenVisibleSize;
|
|
74517
|
-
return !isNumber$
|
|
74601
|
+
return !isNumber$1(minChildrenVisibleSize) || !(Math.abs(node.x1 - node.x0) < minChildrenVisibleSize || Math.abs(node.y1 - node.y0) < minChildrenVisibleSize);
|
|
74518
74602
|
}
|
|
74519
74603
|
_layout(parent) {
|
|
74520
74604
|
var _a;
|
|
@@ -74874,7 +74958,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74874
74958
|
this.options = options;
|
|
74875
74959
|
const keyOption = null == options ? void 0 : options.nodeKey,
|
|
74876
74960
|
keyFunc = isFunction$1(keyOption) ? keyOption : keyOption ? field$3(keyOption) : null;
|
|
74877
|
-
this._getNodeKey = keyFunc, this._getPadding = isNumber$
|
|
74961
|
+
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 => {
|
|
74878
74962
|
var _a;
|
|
74879
74963
|
return null !== (_a = options.padding[node.depth + 1]) && void 0 !== _a ? _a : 0;
|
|
74880
74964
|
} : () => 0, this._maxDepth = -1;
|
|
@@ -75278,7 +75362,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75278
75362
|
textAlign: d => { var _a; return (_a = d.label) === null || _a === void 0 ? void 0 : _a.textAlign; },
|
|
75279
75363
|
angle: d => { var _a, _b; return (_b = (_a = d.label) === null || _a === void 0 ? void 0 : _a.angle) !== null && _b !== void 0 ? _b : 0; },
|
|
75280
75364
|
fontSize: 10,
|
|
75281
|
-
text: d => d.name
|
|
75365
|
+
text: (d) => d.name
|
|
75282
75366
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
75283
75367
|
}
|
|
75284
75368
|
initTooltip() {
|
|
@@ -75908,13 +75992,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75908
75992
|
const ratio = clamp$1(parseFloat(nodeWidthOption.replace("%", "")) / 100, 0, 1);
|
|
75909
75993
|
let stepWidth = width / (this._maxDepth - 1 + ratio);
|
|
75910
75994
|
minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), nodeWidth = stepWidth * ratio, linkWidth = stepWidth * (1 - ratio), isEvenWidth = !0;
|
|
75911
|
-
} else if (isNumber$
|
|
75912
|
-
if (nodeWidth = nodeWidthOption, isNumber$
|
|
75995
|
+
} else if (isNumber$1(nodeWidthOption)) {
|
|
75996
|
+
if (nodeWidth = nodeWidthOption, isNumber$1(linkWidthOption)) linkWidth = linkWidthOption;else if (isNil$1(linkWidthOption)) {
|
|
75913
75997
|
let stepWidth = (width - nodeWidthOption) / (this._maxDepth - 1);
|
|
75914
75998
|
minStepWidth > 0 && (stepWidth = Math.max(minStepWidth, stepWidth)), linkWidth = stepWidth - nodeWidthOption;
|
|
75915
75999
|
}
|
|
75916
76000
|
isEvenWidth = !0;
|
|
75917
|
-
} else isFunction$1(nodeWidthOption) && isNumber$
|
|
76001
|
+
} else isFunction$1(nodeWidthOption) && isNumber$1(linkWidthOption) && (linkWidth = linkWidthOption);
|
|
75918
76002
|
const columns = [];
|
|
75919
76003
|
for (let i = 0, len = nodes.length; i < len; i++) {
|
|
75920
76004
|
const node = nodes[i];
|
|
@@ -76285,7 +76369,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76285
76369
|
key: undefined,
|
|
76286
76370
|
value: (datum) => {
|
|
76287
76371
|
if (datum.source) {
|
|
76288
|
-
if (isNumber$
|
|
76372
|
+
if (isNumber$1(datum.source)) {
|
|
76289
76373
|
const seriesKeys = this.series.getSeriesKeys();
|
|
76290
76374
|
return seriesKeys[datum.source] + ' => ' + seriesKeys[datum.target];
|
|
76291
76375
|
}
|
|
@@ -77842,6 +77926,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77842
77926
|
return datum.x1 === datum.x0 ? Number.MIN_VALUE : datum.x1 - datum.x0;
|
|
77843
77927
|
}
|
|
77844
77928
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
77929
|
+
if (labelMark.getTextType() === 'rich') {
|
|
77930
|
+
this.setMarkStyle(labelMark, {
|
|
77931
|
+
maxWidth: datum => Math.abs(datum.x0 - datum.x1),
|
|
77932
|
+
maxHeight: datum => Math.abs(datum.y0 - datum.y1),
|
|
77933
|
+
ellipsis: true
|
|
77934
|
+
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
77935
|
+
}
|
|
77845
77936
|
}
|
|
77846
77937
|
initNonLeafLabelMarkStyle(labelMark) {
|
|
77847
77938
|
if (!labelMark) {
|
|
@@ -77870,6 +77961,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77870
77961
|
return datum.x1 === datum.x0 ? Number.MIN_VALUE : datum.x1 - datum.x0;
|
|
77871
77962
|
}
|
|
77872
77963
|
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
77964
|
+
if (labelMark.getTextType() === 'rich') {
|
|
77965
|
+
this.setMarkStyle(labelMark, {
|
|
77966
|
+
maxWidth: datum => Math.abs(datum.x0 - datum.x1),
|
|
77967
|
+
maxHeight: datum => Math.abs(datum.y0 - datum.y1),
|
|
77968
|
+
ellipsis: true
|
|
77969
|
+
}, STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
77970
|
+
}
|
|
77873
77971
|
}
|
|
77874
77972
|
initAnimation() {
|
|
77875
77973
|
this.getMarksInType("rect").forEach(mark => {
|
|
@@ -78538,10 +78636,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78538
78636
|
const innerRadius = toPercent((_c = options.innerRadius) !== null && _c !== void 0 ? _c : 0, maxRadius);
|
|
78539
78637
|
const outerRadius = toPercent(options.outerRadius, maxRadius);
|
|
78540
78638
|
const center = [
|
|
78541
|
-
isNumber$
|
|
78639
|
+
isNumber$1((_d = options.center) === null || _d === void 0 ? void 0 : _d[0])
|
|
78542
78640
|
? options.center[0]
|
|
78543
78641
|
: 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),
|
|
78544
|
-
isNumber$
|
|
78642
|
+
isNumber$1((_g = options.center) === null || _g === void 0 ? void 0 : _g[1])
|
|
78545
78643
|
? options.center[1]
|
|
78546
78644
|
: 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)
|
|
78547
78645
|
];
|
|
@@ -80316,7 +80414,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80316
80414
|
var _a;
|
|
80317
80415
|
const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];
|
|
80318
80416
|
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 });
|
|
80319
|
-
seriesSpec[seriesSpec.direction === "
|
|
80417
|
+
seriesSpec[seriesSpec.direction === "horizontal" ? 'xField' : 'yField'] = dataFields;
|
|
80320
80418
|
return seriesSpec;
|
|
80321
80419
|
}
|
|
80322
80420
|
transformSpec(spec) {
|
|
@@ -81657,6 +81755,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81657
81755
|
});
|
|
81658
81756
|
}
|
|
81659
81757
|
getBoundsInRect(rect) {
|
|
81758
|
+
var _a;
|
|
81660
81759
|
let result = { x1: 0, y1: 0, x2: 0, y2: 0 };
|
|
81661
81760
|
if (!this._visible) {
|
|
81662
81761
|
return result;
|
|
@@ -81664,7 +81763,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81664
81763
|
this._verticalLimitSize = isXAxis(this.getOrient()) ? rect.height : rect.width;
|
|
81665
81764
|
this.setLayoutRect(rect);
|
|
81666
81765
|
const isChanged = this.updateScaleRange();
|
|
81667
|
-
if (isChanged || !isArray$1(this.getTickData().getLatestData())) {
|
|
81766
|
+
if (isChanged || !isArray$1((_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData())) {
|
|
81668
81767
|
this.computeData('range');
|
|
81669
81768
|
}
|
|
81670
81769
|
const context = { skipLayout: false };
|
|
@@ -81836,8 +81935,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
81836
81935
|
return attrs;
|
|
81837
81936
|
}
|
|
81838
81937
|
getLabelItems(length) {
|
|
81839
|
-
|
|
81840
|
-
const tickLatestData =
|
|
81938
|
+
var _a;
|
|
81939
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
81841
81940
|
if (tickLatestData && tickLatestData.length) {
|
|
81842
81941
|
return [
|
|
81843
81942
|
tickLatestData
|
|
@@ -82236,14 +82335,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82236
82335
|
if (layerConfig.visible !== false && layerConfig.tickCount !== 0 && layerConfig.forceTickCount !== 0) {
|
|
82237
82336
|
const tickData = this._initTickDataSet(Object.assign(Object.assign({}, this._tickTransformOption()), layerConfig), layer);
|
|
82238
82337
|
tickData.target.addListener('change', this._forceLayout.bind(this));
|
|
82239
|
-
|
|
82338
|
+
const compilableData = new CompilableData(this._option, tickData);
|
|
82339
|
+
this._tickData.push(compilableData);
|
|
82340
|
+
if (!this._tickDataMap) {
|
|
82341
|
+
this._tickDataMap = {};
|
|
82342
|
+
}
|
|
82343
|
+
this._tickDataMap[layer] = compilableData;
|
|
82240
82344
|
}
|
|
82241
82345
|
}
|
|
82242
82346
|
}
|
|
82243
82347
|
else {
|
|
82244
82348
|
const tickData = this._initTickDataSet(this._tickTransformOption());
|
|
82245
82349
|
tickData.target.addListener('change', this._forceLayout.bind(this));
|
|
82246
|
-
|
|
82350
|
+
const compilableData = new CompilableData(this._option, tickData);
|
|
82351
|
+
this._tickData = [compilableData];
|
|
82352
|
+
this._tickDataMap = {
|
|
82353
|
+
0: compilableData
|
|
82354
|
+
};
|
|
82247
82355
|
}
|
|
82248
82356
|
}
|
|
82249
82357
|
dataToPosition(values, cfg = {}) {
|
|
@@ -82338,30 +82446,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82338
82446
|
getLabelItems(length) {
|
|
82339
82447
|
const labelItems = [];
|
|
82340
82448
|
let preData = [];
|
|
82341
|
-
this.
|
|
82342
|
-
|
|
82343
|
-
|
|
82449
|
+
this._scales.forEach((scale, index) => {
|
|
82450
|
+
var _a;
|
|
82451
|
+
const tickData = this._tickDataMap[index];
|
|
82452
|
+
const isTickDataHaveData = (_a = tickData === null || tickData === void 0 ? void 0 : tickData.getLatestData()) === null || _a === void 0 ? void 0 : _a.length;
|
|
82453
|
+
const ticks = isTickDataHaveData
|
|
82454
|
+
? tickData.getLatestData().map((obj) => obj.value)
|
|
82455
|
+
: scale.domain();
|
|
82456
|
+
if (ticks && ticks.length) {
|
|
82344
82457
|
if (preData && preData.length) {
|
|
82345
82458
|
const currentLabelItems = [];
|
|
82346
82459
|
const curData = [];
|
|
82347
82460
|
preData.forEach(value => {
|
|
82348
|
-
|
|
82349
|
-
const values = array(value).concat(
|
|
82461
|
+
ticks.forEach(tick => {
|
|
82462
|
+
const values = array(value).concat(tick);
|
|
82350
82463
|
curData.push(values);
|
|
82351
|
-
|
|
82352
|
-
|
|
82464
|
+
if (isTickDataHaveData) {
|
|
82465
|
+
const axisItem = getAxisItem(tick, this._getNormalizedValue(values, length));
|
|
82466
|
+
currentLabelItems.push(axisItem);
|
|
82467
|
+
}
|
|
82353
82468
|
});
|
|
82354
82469
|
});
|
|
82355
|
-
|
|
82470
|
+
if (isTickDataHaveData) {
|
|
82471
|
+
labelItems.push(currentLabelItems.filter((entry) => entry.value >= 0 && entry.value <= 1));
|
|
82472
|
+
}
|
|
82356
82473
|
preData = curData;
|
|
82357
82474
|
}
|
|
82358
82475
|
else {
|
|
82359
|
-
|
|
82360
|
-
.
|
|
82361
|
-
|
|
82362
|
-
|
|
82363
|
-
|
|
82364
|
-
|
|
82476
|
+
ticks.forEach(tick => {
|
|
82477
|
+
preData.push(tick);
|
|
82478
|
+
});
|
|
82479
|
+
if (isTickDataHaveData) {
|
|
82480
|
+
labelItems.push(tickData
|
|
82481
|
+
.getLatestData()
|
|
82482
|
+
.map((obj) => {
|
|
82483
|
+
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
82484
|
+
})
|
|
82485
|
+
.filter((entry) => entry.value >= 0 && entry.value <= 1));
|
|
82486
|
+
}
|
|
82365
82487
|
}
|
|
82366
82488
|
}
|
|
82367
82489
|
});
|
|
@@ -82531,16 +82653,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82531
82653
|
};
|
|
82532
82654
|
}
|
|
82533
82655
|
getLabelItems(length) {
|
|
82534
|
-
var _a;
|
|
82656
|
+
var _a, _b;
|
|
82535
82657
|
const items = [];
|
|
82536
|
-
const
|
|
82537
|
-
const tickLatestData = tickData.getLatestData();
|
|
82658
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
82538
82659
|
if (tickLatestData && tickLatestData.length) {
|
|
82539
82660
|
items.push(tickLatestData.map((obj) => {
|
|
82540
82661
|
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
82541
82662
|
}));
|
|
82542
82663
|
}
|
|
82543
|
-
const layerLatestData = (
|
|
82664
|
+
const layerLatestData = (_b = this._layerTickData) === null || _b === void 0 ? void 0 : _b.getLatestData();
|
|
82544
82665
|
if (layerLatestData && layerLatestData.length) {
|
|
82545
82666
|
items.push(layerLatestData.map((obj) => {
|
|
82546
82667
|
return getAxisItem(obj.value, this._getNormalizedValue([obj.value], length));
|
|
@@ -82940,8 +83061,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82940
83061
|
return length === 0 ? 0 : (this.dataToPosition(values) - this._getStartValue()) / length;
|
|
82941
83062
|
}
|
|
82942
83063
|
getLabelItems(length) {
|
|
82943
|
-
|
|
82944
|
-
const tickLatestData =
|
|
83064
|
+
var _a;
|
|
83065
|
+
const tickLatestData = (_a = this.getTickData()) === null || _a === void 0 ? void 0 : _a.getLatestData();
|
|
82945
83066
|
if (tickLatestData && tickLatestData.length) {
|
|
82946
83067
|
return [
|
|
82947
83068
|
tickLatestData.map((obj) => {
|
|
@@ -84995,7 +85116,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84995
85116
|
this._handleClickInEvent = (params) => {
|
|
84996
85117
|
this._handleIn(params);
|
|
84997
85118
|
this._clickLock = this._hasActive && this._spec.lockAfterClick;
|
|
84998
|
-
if (this._clickLock && isNumber$
|
|
85119
|
+
if (this._clickLock && isNumber$1(this.triggerOff)) {
|
|
84999
85120
|
if (this._timer) {
|
|
85000
85121
|
clearTimeout(this._timer);
|
|
85001
85122
|
}
|
|
@@ -85210,7 +85331,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85210
85331
|
if (trigger) {
|
|
85211
85332
|
this.trigger = trigger;
|
|
85212
85333
|
}
|
|
85213
|
-
if (triggerOff === 'none' || (isNumber$
|
|
85334
|
+
if (triggerOff === 'none' || (isNumber$1(triggerOff) && triggerOff > 0)) {
|
|
85214
85335
|
this.triggerOff = triggerOff;
|
|
85215
85336
|
}
|
|
85216
85337
|
if (labelZIndex !== undefined) {
|
|
@@ -85234,7 +85355,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85234
85355
|
const _d = style, { strokeOpacity, fillOpacity, opacity, stroke, fill, lineWidth } = _d, restStyle = __rest$7(_d, ["strokeOpacity", "fillOpacity", "opacity", "stroke", "fill", "lineWidth"]);
|
|
85235
85356
|
const isLineType = hair.type === 'line';
|
|
85236
85357
|
let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
|
|
85237
|
-
if (isNumber$
|
|
85358
|
+
if (isNumber$1(opacity)) {
|
|
85238
85359
|
finalOpacity = (finalOpacity !== null && finalOpacity !== void 0 ? finalOpacity : 1) * opacity;
|
|
85239
85360
|
}
|
|
85240
85361
|
hair.style = Object.assign({ opacity: finalOpacity, pickable: false, visible: true }, restStyle);
|
|
@@ -86275,7 +86396,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86275
86396
|
var _a, _b;
|
|
86276
86397
|
const zoomLock = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.zoomLock) !== null && _b !== void 0 ? _b : false;
|
|
86277
86398
|
if (zoomLock || end - start < this._minSpan || end - start > this._maxSpan) {
|
|
86278
|
-
|
|
86399
|
+
this._shouldChange = false;
|
|
86279
86400
|
}
|
|
86280
86401
|
}
|
|
86281
86402
|
_isReverse() {
|
|
@@ -86335,6 +86456,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
86335
86456
|
this.layoutType = 'none';
|
|
86336
86457
|
this._orient = 'left';
|
|
86337
86458
|
this._cacheVisibility = undefined;
|
|
86459
|
+
this._shouldChange = true;
|
|
86338
86460
|
this._stateField = 'x';
|
|
86339
86461
|
this._activeRoam = true;
|
|
86340
86462
|
this._zoomAttr = {
|
|
@@ -87150,7 +87272,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87150
87272
|
if (this._visible === false) {
|
|
87151
87273
|
return 0;
|
|
87152
87274
|
}
|
|
87153
|
-
if (isNumber$
|
|
87275
|
+
if (isNumber$1(this._spec.width)) {
|
|
87154
87276
|
return this._spec.width;
|
|
87155
87277
|
}
|
|
87156
87278
|
if (this._isHorizontal) {
|
|
@@ -87162,7 +87284,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87162
87284
|
if (this._visible === false) {
|
|
87163
87285
|
return 0;
|
|
87164
87286
|
}
|
|
87165
|
-
if (isNumber$
|
|
87287
|
+
if (isNumber$1(this._spec.height)) {
|
|
87166
87288
|
return this._spec.height;
|
|
87167
87289
|
}
|
|
87168
87290
|
if (this._isHorizontal) {
|
|
@@ -87224,24 +87346,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87224
87346
|
}
|
|
87225
87347
|
_handleChange(start, end, updateComponent, tag) {
|
|
87226
87348
|
super._handleChange(start, end, updateComponent);
|
|
87227
|
-
if (
|
|
87228
|
-
this._component
|
|
87229
|
-
|
|
87230
|
-
|
|
87231
|
-
|
|
87232
|
-
|
|
87233
|
-
|
|
87234
|
-
|
|
87235
|
-
|
|
87236
|
-
|
|
87237
|
-
|
|
87238
|
-
|
|
87239
|
-
|
|
87240
|
-
|
|
87241
|
-
|
|
87242
|
-
|
|
87243
|
-
|
|
87244
|
-
|
|
87349
|
+
if (this._shouldChange) {
|
|
87350
|
+
if (updateComponent && this._component) {
|
|
87351
|
+
this._component.setStartAndEnd(start, end);
|
|
87352
|
+
}
|
|
87353
|
+
this._start = start;
|
|
87354
|
+
this._end = end;
|
|
87355
|
+
const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end), tag);
|
|
87356
|
+
if (hasChange) {
|
|
87357
|
+
this.event.emit(exports.ChartEvent.dataZoomChange, {
|
|
87358
|
+
model: this,
|
|
87359
|
+
value: {
|
|
87360
|
+
filterData: this._filterMode !== "axis",
|
|
87361
|
+
start,
|
|
87362
|
+
end,
|
|
87363
|
+
startValue: this._startValue,
|
|
87364
|
+
endValue: this._endValue,
|
|
87365
|
+
newDomain: this._newDomain
|
|
87366
|
+
}
|
|
87367
|
+
});
|
|
87368
|
+
}
|
|
87245
87369
|
}
|
|
87246
87370
|
}
|
|
87247
87371
|
_handleDataCollectionChange() {
|
|
@@ -87373,7 +87497,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87373
87497
|
}
|
|
87374
87498
|
}
|
|
87375
87499
|
_computeWidth() {
|
|
87376
|
-
if (isNumber$
|
|
87500
|
+
if (isNumber$1(this._spec.width)) {
|
|
87377
87501
|
return this._spec.width;
|
|
87378
87502
|
}
|
|
87379
87503
|
if (this._isHorizontal) {
|
|
@@ -87382,7 +87506,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87382
87506
|
return SCROLL_BAR_DEFAULT_SIZE;
|
|
87383
87507
|
}
|
|
87384
87508
|
_computeHeight() {
|
|
87385
|
-
if (isNumber$
|
|
87509
|
+
if (isNumber$1(this._spec.height)) {
|
|
87386
87510
|
return this._spec.height;
|
|
87387
87511
|
}
|
|
87388
87512
|
if (!this._isHorizontal) {
|
|
@@ -87411,24 +87535,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87411
87535
|
}
|
|
87412
87536
|
_handleChange(start, end, updateComponent) {
|
|
87413
87537
|
super._handleChange(start, end, updateComponent);
|
|
87414
|
-
if (
|
|
87415
|
-
this._component
|
|
87416
|
-
|
|
87417
|
-
|
|
87418
|
-
|
|
87419
|
-
|
|
87420
|
-
|
|
87421
|
-
|
|
87422
|
-
|
|
87423
|
-
|
|
87424
|
-
|
|
87425
|
-
|
|
87426
|
-
|
|
87427
|
-
|
|
87428
|
-
|
|
87429
|
-
|
|
87430
|
-
|
|
87431
|
-
|
|
87538
|
+
if (this._shouldChange) {
|
|
87539
|
+
if (updateComponent && this._component) {
|
|
87540
|
+
this._component.setAttribute('range', [start, end]);
|
|
87541
|
+
}
|
|
87542
|
+
this._start = start;
|
|
87543
|
+
this._end = end;
|
|
87544
|
+
const hasChange = this._handleStateChange(this._statePointToData(start), this._statePointToData(end));
|
|
87545
|
+
if (hasChange) {
|
|
87546
|
+
this.event.emit(exports.ChartEvent.scrollBarChange, {
|
|
87547
|
+
model: this,
|
|
87548
|
+
value: {
|
|
87549
|
+
filterData: this._filterMode !== "axis",
|
|
87550
|
+
start: this._start,
|
|
87551
|
+
end: this._end,
|
|
87552
|
+
startValue: this._startValue,
|
|
87553
|
+
endValue: this._endValue,
|
|
87554
|
+
newDomain: this._newDomain
|
|
87555
|
+
}
|
|
87556
|
+
});
|
|
87557
|
+
}
|
|
87432
87558
|
}
|
|
87433
87559
|
}
|
|
87434
87560
|
_handleDataCollectionChange() {
|
|
@@ -87807,7 +87933,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87807
87933
|
function getXValue(datum, xDomain, autoRange, refSeries, regionWidth, regionStartLayoutStartPoint) {
|
|
87808
87934
|
var _a, _b;
|
|
87809
87935
|
const { relativeSeries } = refSeries;
|
|
87810
|
-
isNumber$
|
|
87936
|
+
isNumber$1(datum.x) &&
|
|
87811
87937
|
isNeedExtendDomain(xDomain, datum.x, autoRange) &&
|
|
87812
87938
|
((_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));
|
|
87813
87939
|
let x;
|
|
@@ -87822,7 +87948,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87822
87948
|
function getYValue(datum, yDomain, autoRange, refSeries, regionHeight, regionStartLayoutStartPoint) {
|
|
87823
87949
|
var _a, _b;
|
|
87824
87950
|
const { relativeSeries } = refSeries;
|
|
87825
|
-
isNumber$
|
|
87951
|
+
isNumber$1(datum.y) &&
|
|
87826
87952
|
isNeedExtendDomain(yDomain, datum.y, autoRange) &&
|
|
87827
87953
|
((_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));
|
|
87828
87954
|
let y;
|
|
@@ -87927,11 +88053,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87927
88053
|
const xValue = array(datum.x);
|
|
87928
88054
|
const yValue = array(datum.y);
|
|
87929
88055
|
xValue.length === 1 &&
|
|
87930
|
-
isNumber$
|
|
88056
|
+
isNumber$1(xValue[0]) &&
|
|
87931
88057
|
isNeedExtendDomain(xDomain, xValue[0], autoRange) &&
|
|
87932
88058
|
((_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]));
|
|
87933
88059
|
yValue.length === 1 &&
|
|
87934
|
-
isNumber$
|
|
88060
|
+
isNumber$1(yValue[0]) &&
|
|
87935
88061
|
isNeedExtendDomain(yDomain, yValue[0], autoRange) &&
|
|
87936
88062
|
((_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]));
|
|
87937
88063
|
points.push({
|
|
@@ -88774,22 +88900,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88774
88900
|
let lines = [];
|
|
88775
88901
|
if (isXYLayout) {
|
|
88776
88902
|
lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
|
|
88777
|
-
|
|
88778
|
-
|
|
88779
|
-
|
|
88780
|
-
|
|
88781
|
-
|
|
88782
|
-
|
|
88783
|
-
|
|
88784
|
-
|
|
88785
|
-
|
|
88786
|
-
|
|
88787
|
-
|
|
88788
|
-
|
|
88903
|
+
const [start, end] = lines;
|
|
88904
|
+
if (start && start.length && end && end.length) {
|
|
88905
|
+
points = [
|
|
88906
|
+
{
|
|
88907
|
+
x: start[0].x,
|
|
88908
|
+
y: end[0].y
|
|
88909
|
+
},
|
|
88910
|
+
start[0],
|
|
88911
|
+
{
|
|
88912
|
+
x: end[0].x,
|
|
88913
|
+
y: start[0].y
|
|
88914
|
+
},
|
|
88915
|
+
end[0]
|
|
88916
|
+
];
|
|
88917
|
+
}
|
|
88789
88918
|
}
|
|
88790
88919
|
else if (isXLayout || isYLayout) {
|
|
88791
88920
|
lines = xyLayout(data, startRelativeSeries, endRelativeSeries, relativeSeries, autoRange);
|
|
88792
|
-
|
|
88921
|
+
const [start, end] = lines;
|
|
88922
|
+
if (start && start.length && end && end.length) {
|
|
88923
|
+
points = [...start, end[1], end[0]];
|
|
88924
|
+
}
|
|
88793
88925
|
}
|
|
88794
88926
|
else if (isCoordinateLayout) {
|
|
88795
88927
|
points = coordinateLayout(data, relativeSeries, autoRange, spec.coordinatesOffset);
|
|
@@ -88821,7 +88953,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88821
88953
|
this._markerComponent.setAttributes({
|
|
88822
88954
|
points: points,
|
|
88823
88955
|
label: Object.assign(Object.assign({}, (_c = this._markerComponent.attribute) === null || _c === void 0 ? void 0 : _c.label), { text: this._spec.label.formatMethod
|
|
88824
|
-
?
|
|
88956
|
+
?
|
|
88957
|
+
this._spec.label.formatMethod(dataPoints, seriesData)
|
|
88825
88958
|
: (_e = (_d = this._markerComponent.attribute) === null || _d === void 0 ? void 0 : _d.label) === null || _e === void 0 ? void 0 : _e.text }),
|
|
88826
88959
|
limitRect,
|
|
88827
88960
|
dx: this._layoutOffsetX,
|
|
@@ -89137,7 +89270,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89137
89270
|
}
|
|
89138
89271
|
}
|
|
89139
89272
|
_computeWidth(rect) {
|
|
89140
|
-
if (isNumber$
|
|
89273
|
+
if (isNumber$1(this._spec.width)) {
|
|
89141
89274
|
return Math.min(rect.width, Number(this._spec.width));
|
|
89142
89275
|
}
|
|
89143
89276
|
if (isVertical(this._orient)) {
|
|
@@ -89146,7 +89279,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89146
89279
|
return rect.width;
|
|
89147
89280
|
}
|
|
89148
89281
|
_computeHeight(rect) {
|
|
89149
|
-
if (isNumber$
|
|
89282
|
+
if (isNumber$1(this._spec.height)) {
|
|
89150
89283
|
this._height = this._spec.height;
|
|
89151
89284
|
return Math.min(rect.height, Number(this._spec.height));
|
|
89152
89285
|
}
|
|
@@ -89282,22 +89415,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89282
89415
|
? (_c = series.getXAxisHelper()) === null || _c === void 0 ? void 0 : _c.isInverse()
|
|
89283
89416
|
: (_d = series.getYAxisHelper()) === null || _d === void 0 ? void 0 : _d.isInverse();
|
|
89284
89417
|
let position = originPosition;
|
|
89285
|
-
if (isString$1(originPosition) &&
|
|
89418
|
+
if (isString$1(originPosition) && originPosition === 'outside') {
|
|
89286
89419
|
position = (data) => {
|
|
89287
89420
|
const { data: datum } = data;
|
|
89288
89421
|
const dataField = series.getMeasureField()[0];
|
|
89289
|
-
|
|
89290
|
-
|
|
89291
|
-
|
|
89292
|
-
return positionMap[direction][index];
|
|
89293
|
-
}
|
|
89294
|
-
if (originPosition === 'inside-bottom') {
|
|
89295
|
-
return series.direction === 'horizontal' ? 'inside-left' : 'inside-bottom';
|
|
89296
|
-
}
|
|
89297
|
-
if (originPosition === 'inside-top') {
|
|
89298
|
-
return series.direction === 'horizontal' ? 'inside-right' : 'inside-top';
|
|
89299
|
-
}
|
|
89300
|
-
return originPosition;
|
|
89422
|
+
const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
|
|
89423
|
+
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;
|
|
89424
|
+
return positionMap[direction][index];
|
|
89301
89425
|
};
|
|
89302
89426
|
}
|
|
89303
89427
|
let overlap;
|
|
@@ -89380,46 +89504,38 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89380
89504
|
const datum = label.data;
|
|
89381
89505
|
const attribute = textAttribute(labelInfo, datum, labelSpec.formatMethod);
|
|
89382
89506
|
const x = (datum) => {
|
|
89383
|
-
if (series.direction === "
|
|
89384
|
-
return series.totalPositionX(datum, 'index', 0.5);
|
|
89385
|
-
}
|
|
89386
|
-
if (pos === 'middle') {
|
|
89387
|
-
return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89388
|
-
}
|
|
89389
|
-
else if (pos === 'max') {
|
|
89390
|
-
return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
|
|
89391
|
-
}
|
|
89392
|
-
else if (pos === 'min') {
|
|
89393
|
-
return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
|
|
89394
|
-
}
|
|
89395
|
-
return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
|
|
89396
|
-
};
|
|
89397
|
-
const y = (datum) => {
|
|
89398
|
-
if (series.direction === "vertical") {
|
|
89507
|
+
if (series.direction === "horizontal") {
|
|
89399
89508
|
if (pos === 'middle') {
|
|
89400
|
-
return (series.
|
|
89509
|
+
return (series.totalPositionX(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89401
89510
|
}
|
|
89402
89511
|
else if (pos === 'max') {
|
|
89403
|
-
return series.
|
|
89512
|
+
return series.totalPositionX(datum, datum.end >= datum.start ? 'end' : 'start') + offset;
|
|
89404
89513
|
}
|
|
89405
89514
|
else if (pos === 'min') {
|
|
89406
|
-
return series.
|
|
89515
|
+
return series.totalPositionX(datum, datum.end >= datum.start ? 'start' : 'end') - offset;
|
|
89407
89516
|
}
|
|
89408
|
-
return series.
|
|
89517
|
+
return series.totalPositionX(datum, 'end') + (datum.end >= datum.start ? offset : -offset);
|
|
89409
89518
|
}
|
|
89410
|
-
return series.
|
|
89519
|
+
return series.totalPositionX(datum, 'index', 0.5);
|
|
89520
|
+
};
|
|
89521
|
+
const y = (datum) => {
|
|
89522
|
+
if (series.direction === "horizontal") {
|
|
89523
|
+
return series.totalPositionY(datum, 'index', 0.5);
|
|
89524
|
+
}
|
|
89525
|
+
if (pos === 'middle') {
|
|
89526
|
+
return (series.totalPositionY(datum, 'end') + series.totalPositionY(datum, 'start')) * 0.5;
|
|
89527
|
+
}
|
|
89528
|
+
else if (pos === 'max') {
|
|
89529
|
+
return series.totalPositionY(datum, datum.end >= datum.start ? 'end' : 'start') - offset;
|
|
89530
|
+
}
|
|
89531
|
+
else if (pos === 'min') {
|
|
89532
|
+
return series.totalPositionY(datum, datum.end >= datum.start ? 'start' : 'end') + offset;
|
|
89533
|
+
}
|
|
89534
|
+
return series.totalPositionY(datum, 'end') + (datum.end >= datum.start ? -offset : offset);
|
|
89411
89535
|
};
|
|
89412
89536
|
attribute.x = x(datum);
|
|
89413
89537
|
attribute.y = y(datum);
|
|
89414
|
-
if (series.direction === "
|
|
89415
|
-
attribute.textBaseline =
|
|
89416
|
-
pos === 'middle'
|
|
89417
|
-
? pos
|
|
89418
|
-
: (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
|
|
89419
|
-
? 'bottom'
|
|
89420
|
-
: 'top';
|
|
89421
|
-
}
|
|
89422
|
-
else {
|
|
89538
|
+
if (series.direction === "horizontal") {
|
|
89423
89539
|
attribute.textAlign =
|
|
89424
89540
|
pos === 'middle'
|
|
89425
89541
|
? 'center'
|
|
@@ -89427,6 +89543,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89427
89543
|
? 'left'
|
|
89428
89544
|
: 'right';
|
|
89429
89545
|
}
|
|
89546
|
+
else {
|
|
89547
|
+
attribute.textBaseline =
|
|
89548
|
+
pos === 'middle'
|
|
89549
|
+
? pos
|
|
89550
|
+
: (pos === 'withChange' && datum.end - datum.start >= 0) || pos === 'max'
|
|
89551
|
+
? 'bottom'
|
|
89552
|
+
: 'top';
|
|
89553
|
+
}
|
|
89430
89554
|
return createText(Object.assign(Object.assign({}, attribute), { id: label.id }));
|
|
89431
89555
|
});
|
|
89432
89556
|
},
|
|
@@ -89450,15 +89574,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89450
89574
|
};
|
|
89451
89575
|
}
|
|
89452
89576
|
function treemapLabel(labelInfo) {
|
|
89453
|
-
const labelSpec = labelInfo.labelSpec;
|
|
89454
89577
|
return {
|
|
89455
|
-
customLayoutFunc: (labels) =>
|
|
89456
|
-
return labels.map(label => {
|
|
89457
|
-
const datum = label.data;
|
|
89458
|
-
const attribute = textAttribute(labelInfo, datum, labelSpec.formatMethod);
|
|
89459
|
-
return createText(Object.assign(Object.assign({}, attribute), { id: label.id, pickable: false }));
|
|
89460
|
-
});
|
|
89461
|
-
},
|
|
89578
|
+
customLayoutFunc: (labels, text) => text,
|
|
89462
89579
|
overlap: false
|
|
89463
89580
|
};
|
|
89464
89581
|
}
|
|
@@ -90069,7 +90186,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90069
90186
|
this._markerComponent.setAttributes({
|
|
90070
90187
|
position: point,
|
|
90071
90188
|
itemContent: Object.assign(Object.assign({}, attribute.itemContent), { textStyle: Object.assign(Object.assign({}, textStyle), { text: ((_f = this._spec.itemContent.text) === null || _f === void 0 ? void 0 : _f.formatMethod)
|
|
90072
|
-
?
|
|
90189
|
+
?
|
|
90190
|
+
this._spec.itemContent.text.formatMethod(dataPoints, seriesData)
|
|
90073
90191
|
: textStyle.text }) }),
|
|
90074
90192
|
limitRect,
|
|
90075
90193
|
dx: this._layoutOffsetX,
|
|
@@ -91635,12 +91753,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91635
91753
|
const getActualTooltipPositionValue = (position, event) => {
|
|
91636
91754
|
let result;
|
|
91637
91755
|
if (isValid$1(position)) {
|
|
91638
|
-
if (isNumber$
|
|
91756
|
+
if (isNumber$1(position)) {
|
|
91639
91757
|
result = position;
|
|
91640
91758
|
}
|
|
91641
91759
|
else if (isFunction$1(position)) {
|
|
91642
91760
|
const tooltipPosition = position(event);
|
|
91643
|
-
if (isNumber$
|
|
91761
|
+
if (isNumber$1(tooltipPosition)) {
|
|
91644
91762
|
result = tooltipPosition;
|
|
91645
91763
|
}
|
|
91646
91764
|
}
|
|
@@ -92637,7 +92755,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92637
92755
|
_throttle(callback) {
|
|
92638
92756
|
const tooltipSpec = this._component.getSpec();
|
|
92639
92757
|
let wait;
|
|
92640
|
-
if (isNumber$
|
|
92758
|
+
if (isNumber$1(tooltipSpec.throttleInterval)) {
|
|
92641
92759
|
wait = tooltipSpec.throttleInterval;
|
|
92642
92760
|
}
|
|
92643
92761
|
else {
|
|
@@ -92656,14 +92774,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92656
92774
|
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 });
|
|
92657
92775
|
}
|
|
92658
92776
|
_getTooltipBoxSize(actualTooltip, changePositionOnly) {
|
|
92659
|
-
var _a, _b, _c
|
|
92777
|
+
var _a, _b, _c;
|
|
92660
92778
|
if (!changePositionOnly || isNil$1(this._attributes)) {
|
|
92661
92779
|
const chartTheme = (_b = (_a = this._chartOption) === null || _a === void 0 ? void 0 : _a.getTheme()) !== null && _b !== void 0 ? _b : {};
|
|
92662
92780
|
this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartTheme);
|
|
92663
92781
|
}
|
|
92782
|
+
const { panel, panelDomHeight } = (_c = this._attributes) !== null && _c !== void 0 ? _c : {};
|
|
92664
92783
|
return {
|
|
92665
|
-
width:
|
|
92666
|
-
height:
|
|
92784
|
+
width: panel === null || panel === void 0 ? void 0 : panel.width,
|
|
92785
|
+
height: panelDomHeight !== null && panelDomHeight !== void 0 ? panelDomHeight : panel === null || panel === void 0 ? void 0 : panel.height
|
|
92667
92786
|
};
|
|
92668
92787
|
}
|
|
92669
92788
|
_getPointerPositionRelativeToTooltipParent(params) {
|
|
@@ -92819,7 +92938,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92819
92938
|
content: {},
|
|
92820
92939
|
shapeColumn: {
|
|
92821
92940
|
common: shapeStyle,
|
|
92822
|
-
items:
|
|
92941
|
+
items: contentAttribute === null || contentAttribute === void 0 ? void 0 : contentAttribute.map(({ spaceRow }, i) => ({
|
|
92942
|
+
marginTop: '0px',
|
|
92943
|
+
marginBottom: i < contentAttribute.length - 1 ? getPixelPropertyStr(spaceRow) : '0px'
|
|
92944
|
+
})),
|
|
92823
92945
|
width: getPixelPropertyStr(shape.size),
|
|
92824
92946
|
marginRight: getPixelPropertyStr((_a = shape.spacing) !== null && _a !== void 0 ? _a : DEFAULT_SHAPE_SPACING)
|
|
92825
92947
|
},
|
|
@@ -93010,7 +93132,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93010
93132
|
fontWeight: 'normal'
|
|
93011
93133
|
};
|
|
93012
93134
|
const defaultShapeStyle = {
|
|
93013
|
-
lineHeight: 'normal'
|
|
93135
|
+
lineHeight: 'normal',
|
|
93136
|
+
boxSizing: 'border-box'
|
|
93014
93137
|
};
|
|
93015
93138
|
|
|
93016
93139
|
class ShapeModel extends BaseTooltipModel {
|
|
@@ -93049,7 +93172,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93049
93172
|
}
|
|
93050
93173
|
const { symbolType, fill, stroke, hollow = false } = option;
|
|
93051
93174
|
const size = option.size ? valueToHtml(option.size) : '8px';
|
|
93052
|
-
const marginTop = option.marginTop ? valueToHtml(option.marginTop) : '0px';
|
|
93053
93175
|
const lineWidth = option.lineWidth ? valueToHtml(option.lineWidth) + 'px' : '0px';
|
|
93054
93176
|
let fillString = 'currentColor';
|
|
93055
93177
|
const getStroke = () => (stroke ? valueToHtml(stroke) : fillString);
|
|
@@ -93073,7 +93195,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93073
93195
|
fillString = hollow ? 'none' : fill ? valueToHtml(fill) : 'currentColor';
|
|
93074
93196
|
return `
|
|
93075
93197
|
<svg width="${size}" height="${size}" viewBox="${viewBox}"
|
|
93076
|
-
style="display:
|
|
93198
|
+
style="display: block;">
|
|
93077
93199
|
<path
|
|
93078
93200
|
d="${path}"
|
|
93079
93201
|
style="fill: ${fillString}; stroke: ${getStroke()}; stroke-width: ${lineWidth}"
|
|
@@ -93099,7 +93221,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93099
93221
|
}
|
|
93100
93222
|
return `
|
|
93101
93223
|
<svg width="${size}" height="${size}" viewBox="-0.5 -0.5 1 1"
|
|
93102
|
-
style="display:
|
|
93224
|
+
style="display: block;">
|
|
93103
93225
|
${gradient}
|
|
93104
93226
|
<path
|
|
93105
93227
|
d="${path}"
|
|
@@ -93183,29 +93305,47 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93183
93305
|
super.setStyle(mergeSpec({}, defaultContentColumnStyle, tooltipStyle.content, this._getContentColumnStyle()));
|
|
93184
93306
|
const renderContent = (_b = (_a = this._option.getTooltipActual()) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : [];
|
|
93185
93307
|
const contentAttributes = (_d = (_c = this._option.getTooltipAttributes()) === null || _c === void 0 ? void 0 : _c.content) !== null && _d !== void 0 ? _d : [];
|
|
93308
|
+
const getKeyItemStyle = (line, i) => {
|
|
93309
|
+
var _a, _b;
|
|
93310
|
+
const { key, isKeyAdaptive } = line;
|
|
93311
|
+
const { height } = contentAttributes[i];
|
|
93312
|
+
const { keyColumn } = tooltipStyle;
|
|
93313
|
+
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]));
|
|
93314
|
+
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);
|
|
93315
|
+
if (!hasContent && !style.visibility) {
|
|
93316
|
+
style.visibility = 'hidden';
|
|
93317
|
+
}
|
|
93318
|
+
else {
|
|
93319
|
+
style.visibility = 'visible';
|
|
93320
|
+
}
|
|
93321
|
+
return style;
|
|
93322
|
+
};
|
|
93323
|
+
const getValueItemStyle = (line, i) => {
|
|
93324
|
+
var _a;
|
|
93325
|
+
const { height } = contentAttributes[i];
|
|
93326
|
+
const { valueColumn } = tooltipStyle;
|
|
93327
|
+
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]));
|
|
93328
|
+
return style;
|
|
93329
|
+
};
|
|
93330
|
+
const getShapeItemStyle = (line, i) => {
|
|
93331
|
+
var _a, _b, _c, _d;
|
|
93332
|
+
const { height } = contentAttributes[i];
|
|
93333
|
+
const { shapeColumn } = tooltipStyle;
|
|
93334
|
+
const keyStyle = getKeyItemStyle(line, i);
|
|
93335
|
+
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)`;
|
|
93336
|
+
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]));
|
|
93337
|
+
return style;
|
|
93338
|
+
};
|
|
93186
93339
|
renderContent.forEach((line, i) => {
|
|
93187
|
-
var _a
|
|
93188
|
-
let childStyle = {};
|
|
93189
|
-
const { height, spaceRow = 0 } = contentAttributes[i];
|
|
93340
|
+
var _a;
|
|
93190
93341
|
if (this.className === 'key-box') {
|
|
93191
|
-
|
|
93192
|
-
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]));
|
|
93193
|
-
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);
|
|
93194
|
-
if (!hasContent && !childStyle.visibility) {
|
|
93195
|
-
childStyle.visibility = 'hidden';
|
|
93196
|
-
}
|
|
93197
|
-
else {
|
|
93198
|
-
childStyle.visibility = 'visible';
|
|
93199
|
-
}
|
|
93200
|
-
this.children[i].setStyle(childStyle);
|
|
93342
|
+
this.children[i].setStyle(getKeyItemStyle(line, i));
|
|
93201
93343
|
}
|
|
93202
93344
|
else if (this.className === 'value-box') {
|
|
93203
|
-
|
|
93204
|
-
this.children[i].setStyle(childStyle);
|
|
93345
|
+
this.children[i].setStyle(getValueItemStyle(line, i));
|
|
93205
93346
|
}
|
|
93206
93347
|
else if (this.className === 'shape-box') {
|
|
93207
|
-
|
|
93208
|
-
(_e = this.children[i]) === null || _e === void 0 ? void 0 : _e.setStyle(childStyle, this._getShapeSvgOption(line, i));
|
|
93348
|
+
(_a = this.children[i]) === null || _a === void 0 ? void 0 : _a.setStyle(getShapeItemStyle(line, i), this._getShapeSvgOption(line, i));
|
|
93209
93349
|
}
|
|
93210
93350
|
});
|
|
93211
93351
|
}
|
|
@@ -93218,7 +93358,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93218
93358
|
let childContent;
|
|
93219
93359
|
if (this.className === 'key-box') {
|
|
93220
93360
|
const keyContent = line.key;
|
|
93221
|
-
if ((isString$1(keyContent) && ((_a = keyContent === null || keyContent === void 0 ? void 0 : keyContent.trim) === null || _a === void 0 ? void 0 : _a.call(keyContent)) !== '') || isNumber$
|
|
93361
|
+
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)) {
|
|
93222
93362
|
childContent = keyContent;
|
|
93223
93363
|
}
|
|
93224
93364
|
else {
|
|
@@ -93228,7 +93368,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93228
93368
|
}
|
|
93229
93369
|
else if (this.className === 'value-box') {
|
|
93230
93370
|
const valueContent = line.value;
|
|
93231
|
-
if ((isString$1(valueContent) && ((_d = valueContent === null || valueContent === void 0 ? void 0 : valueContent.trim) === null || _d === void 0 ? void 0 : _d.call(valueContent)) !== '') || isNumber$
|
|
93371
|
+
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)) {
|
|
93232
93372
|
childContent = valueContent;
|
|
93233
93373
|
}
|
|
93234
93374
|
else {
|
|
@@ -93258,10 +93398,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93258
93398
|
}
|
|
93259
93399
|
}
|
|
93260
93400
|
_getShapeSvgOption(line, index) {
|
|
93261
|
-
var _a, _b, _c
|
|
93401
|
+
var _a, _b, _c;
|
|
93262
93402
|
const tooltipStyle = this._option.getTooltipStyle();
|
|
93263
93403
|
const shapeColumn = Object.assign(Object.assign({}, tooltipStyle.shapeColumn), (_a = tooltipStyle.shapeColumn.items) === null || _a === void 0 ? void 0 : _a[index]);
|
|
93264
|
-
|
|
93404
|
+
Object.assign(Object.assign({}, tooltipStyle.keyColumn), (_b = tooltipStyle.keyColumn.items) === null || _b === void 0 ? void 0 : _b[index]);
|
|
93265
93405
|
return {
|
|
93266
93406
|
hasShape: line.hasShape,
|
|
93267
93407
|
symbolType: line.shapeType,
|
|
@@ -93270,7 +93410,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93270
93410
|
stroke: line.shapeStroke,
|
|
93271
93411
|
lineWidth: line.shapeLineWidth,
|
|
93272
93412
|
hollow: line.shapeHollow,
|
|
93273
|
-
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)`,
|
|
93274
93413
|
index
|
|
93275
93414
|
};
|
|
93276
93415
|
}
|