@visactor/vchart 1.4.0-beta.2 → 1.5.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 +2 -2
- package/build/index.js +979 -528
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base-chart.js +2 -1
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/stack.d.ts +0 -4
- package/cjs/chart/stack.js +8 -52
- package/cjs/chart/stack.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.js +4 -2
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/compile/mark/interface.d.ts +1 -0
- package/cjs/compile/mark/interface.js.map +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -0
- package/cjs/component/axis/base-axis.js +5 -1
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.js +8 -3
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +1 -0
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/cartesian/util/common.d.ts +2 -0
- package/cjs/component/axis/cartesian/util/common.js +14 -2
- package/cjs/component/axis/cartesian/util/common.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +1 -0
- package/cjs/component/base/base-component.js +11 -3
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +3 -0
- package/cjs/component/brush/brush.js +34 -12
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/cartesian.d.ts +2 -1
- package/cjs/component/crosshair/cartesian.js +2 -6
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/polar.d.ts +2 -1
- package/cjs/component/crosshair/polar.js +2 -6
- package/cjs/component/crosshair/polar.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.d.ts +2 -0
- package/cjs/component/custom-mark/custom-mark.js +3 -0
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.d.ts +6 -0
- package/cjs/component/data-zoom/data-filter-base-component.js +15 -7
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.d.ts +2 -2
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +2 -4
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.d.ts +2 -1
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js +2 -4
- package/cjs/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.d.ts +2 -0
- package/cjs/component/geo/geo-coordinate.js +3 -0
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/indicator/indicator.d.ts +2 -0
- package/cjs/component/indicator/indicator.js +4 -3
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/interface/common.d.ts +2 -0
- package/cjs/component/interface/common.js.map +1 -1
- package/cjs/component/label/base-label.d.ts +2 -0
- package/cjs/component/label/base-label.js +3 -0
- package/cjs/component/label/base-label.js.map +1 -1
- package/cjs/component/legend/base-legend.d.ts +1 -0
- package/cjs/component/legend/base-legend.js +17 -12
- package/cjs/component/legend/base-legend.js.map +1 -1
- package/cjs/component/map-label/component.d.ts +2 -0
- package/cjs/component/map-label/component.js +3 -0
- package/cjs/component/map-label/component.js.map +1 -1
- package/cjs/component/marker/base-marker.d.ts +2 -1
- package/cjs/component/marker/base-marker.js +2 -4
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/player/player.d.ts +2 -1
- package/cjs/component/player/player.js +2 -4
- package/cjs/component/player/player.js.map +1 -1
- package/cjs/component/title/title.d.ts +2 -0
- package/cjs/component/title/title.js +6 -4
- package/cjs/component/title/title.js.map +1 -1
- package/cjs/component/tooltip/handler/base.d.ts +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +2 -0
- package/cjs/component/tooltip/tooltip.js +3 -0
- package/cjs/component/tooltip/tooltip.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/layout/base-layout.d.ts +5 -5
- package/cjs/layout/base-layout.js +52 -96
- package/cjs/layout/base-layout.js.map +1 -1
- package/cjs/layout/layout3d/index.d.ts +1 -1
- package/cjs/layout/layout3d/index.js +22 -22
- package/cjs/layout/layout3d/index.js.map +1 -1
- package/cjs/layout/util.d.ts +6 -0
- package/cjs/layout/util.js +220 -0
- package/cjs/layout/util.js.map +1 -0
- package/cjs/mark/cell.js +1 -1
- package/cjs/model/interface.d.ts +1 -0
- package/cjs/model/interface.js.map +1 -1
- package/cjs/region/interface.d.ts +6 -0
- package/cjs/region/interface.js.map +1 -1
- package/cjs/region/region.d.ts +7 -0
- package/cjs/region/region.js +17 -1
- package/cjs/region/region.js.map +1 -1
- package/cjs/series/bar/bar.js +11 -30
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +1 -0
- package/cjs/series/base/base-series.js +7 -2
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/interface/series.d.ts +2 -1
- package/cjs/series/interface/series.js.map +1 -1
- package/cjs/series/mixin/line-mixin.js +13 -6
- package/cjs/series/mixin/line-mixin.js.map +1 -1
- package/cjs/series/util/stack.d.ts +9 -0
- package/cjs/series/util/stack.js +31 -0
- package/cjs/series/util/stack.js.map +1 -0
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js +8 -4
- package/cjs/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/cjs/theme/builtin/common/component/mark-line.js +4 -4
- package/cjs/theme/builtin/common/component/mark-line.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +3 -1
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/typings/visual.d.ts +3 -6
- package/cjs/typings/visual.js.map +1 -1
- package/cjs/util/data.d.ts +25 -0
- package/cjs/util/data.js +73 -4
- package/cjs/util/data.js.map +1 -1
- package/esm/chart/base-chart.js +2 -1
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/stack.d.ts +0 -4
- package/esm/chart/stack.js +7 -55
- package/esm/chart/stack.js.map +1 -1
- package/esm/compile/mark/compilable-mark.js +5 -1
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/compile/mark/interface.d.ts +1 -0
- package/esm/compile/mark/interface.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -0
- package/esm/component/axis/base-axis.js +5 -1
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.js +9 -2
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +1 -0
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/cartesian/util/common.d.ts +2 -0
- package/esm/component/axis/cartesian/util/common.js +11 -0
- package/esm/component/axis/cartesian/util/common.js.map +1 -1
- package/esm/component/base/base-component.d.ts +1 -0
- package/esm/component/base/base-component.js +11 -3
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/brush/brush.d.ts +3 -0
- package/esm/component/brush/brush.js +31 -9
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/cartesian.d.ts +2 -1
- package/esm/component/crosshair/cartesian.js +2 -6
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/polar.d.ts +2 -1
- package/esm/component/crosshair/polar.js +2 -6
- package/esm/component/crosshair/polar.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.d.ts +2 -0
- package/esm/component/custom-mark/custom-mark.js +3 -0
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.d.ts +6 -0
- package/esm/component/data-zoom/data-filter-base-component.js +15 -7
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.d.ts +2 -2
- package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -4
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.d.ts +2 -1
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js +2 -4
- package/esm/component/data-zoom/scroll-bar/scroll-bar.js.map +1 -1
- package/esm/component/geo/geo-coordinate.d.ts +2 -0
- package/esm/component/geo/geo-coordinate.js +3 -0
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/indicator/indicator.d.ts +2 -0
- package/esm/component/indicator/indicator.js +4 -3
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/interface/common.d.ts +2 -0
- package/esm/component/interface/common.js.map +1 -1
- package/esm/component/label/base-label.d.ts +2 -0
- package/esm/component/label/base-label.js +3 -0
- package/esm/component/label/base-label.js.map +1 -1
- package/esm/component/legend/base-legend.d.ts +1 -0
- package/esm/component/legend/base-legend.js +17 -12
- package/esm/component/legend/base-legend.js.map +1 -1
- package/esm/component/map-label/component.d.ts +2 -0
- package/esm/component/map-label/component.js +3 -0
- package/esm/component/map-label/component.js.map +1 -1
- package/esm/component/marker/base-marker.d.ts +2 -1
- package/esm/component/marker/base-marker.js +2 -4
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/player/player.d.ts +2 -1
- package/esm/component/player/player.js +2 -4
- package/esm/component/player/player.js.map +1 -1
- package/esm/component/title/title.d.ts +2 -0
- package/esm/component/title/title.js +6 -4
- package/esm/component/title/title.js.map +1 -1
- package/esm/component/tooltip/handler/base.d.ts +1 -1
- package/esm/component/tooltip/tooltip.d.ts +2 -0
- package/esm/component/tooltip/tooltip.js +3 -0
- package/esm/component/tooltip/tooltip.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/layout/base-layout.d.ts +5 -5
- package/esm/layout/base-layout.js +53 -95
- package/esm/layout/base-layout.js.map +1 -1
- package/esm/layout/layout3d/index.d.ts +1 -1
- package/esm/layout/layout3d/index.js +22 -22
- package/esm/layout/layout3d/index.js.map +1 -1
- package/esm/layout/util.d.ts +6 -0
- package/esm/layout/util.js +211 -0
- package/esm/layout/util.js.map +1 -0
- package/esm/mark/cell.js +1 -1
- package/esm/model/interface.d.ts +1 -0
- package/esm/model/interface.js.map +1 -1
- package/esm/region/interface.d.ts +6 -0
- package/esm/region/interface.js.map +1 -1
- package/esm/region/region.d.ts +7 -0
- package/esm/region/region.js +17 -1
- package/esm/region/region.js.map +1 -1
- package/esm/series/bar/bar.js +13 -30
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.d.ts +1 -0
- package/esm/series/base/base-series.js +7 -2
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/interface/series.d.ts +2 -1
- package/esm/series/interface/series.js.map +1 -1
- package/esm/series/mixin/line-mixin.js +13 -6
- package/esm/series/mixin/line-mixin.js.map +1 -1
- package/esm/series/util/stack.d.ts +9 -0
- package/esm/series/util/stack.js +23 -0
- package/esm/series/util/stack.js.map +1 -0
- package/esm/theme/builtin/common/component/legend/discrete-legend.js +8 -4
- package/esm/theme/builtin/common/component/legend/discrete-legend.js.map +1 -1
- package/esm/theme/builtin/common/component/mark-line.js +4 -4
- package/esm/theme/builtin/common/component/mark-line.js.map +1 -1
- package/esm/typings/spec/common.d.ts +3 -1
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/typings/visual.d.ts +3 -6
- package/esm/typings/visual.js.map +1 -1
- package/esm/util/data.d.ts +25 -0
- package/esm/util/data.js +69 -0
- package/esm/util/data.js.map +1 -1
- package/package.json +11 -11
package/build/index.js
CHANGED
|
@@ -1510,7 +1510,7 @@
|
|
|
1510
1510
|
function LinearToSRGB(c) {
|
|
1511
1511
|
return c < .0031308 ? 12.92 * c : 1.055 * Math.pow(c, .41666) - .055;
|
|
1512
1512
|
}
|
|
1513
|
-
let Color$
|
|
1513
|
+
let Color$2 = class Color {
|
|
1514
1514
|
static Brighter(source) {
|
|
1515
1515
|
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1516
1516
|
return 1 === b ? source : new Color(source).brighter(b).toRGBA();
|
|
@@ -1729,7 +1729,7 @@
|
|
|
1729
1729
|
|
|
1730
1730
|
var ColorUtil = /*#__PURE__*/Object.freeze({
|
|
1731
1731
|
__proto__: null,
|
|
1732
|
-
Color: Color$
|
|
1732
|
+
Color: Color$2,
|
|
1733
1733
|
DEFAULT_COLORS: DEFAULT_COLORS,
|
|
1734
1734
|
RGB: RGB,
|
|
1735
1735
|
hexToRgb: hexToRgb,
|
|
@@ -6760,7 +6760,7 @@
|
|
|
6760
6760
|
}
|
|
6761
6761
|
}
|
|
6762
6762
|
|
|
6763
|
-
const { Color } = ColorUtil;
|
|
6763
|
+
const { Color: Color$1 } = ColorUtil;
|
|
6764
6764
|
|
|
6765
6765
|
const warn = (msg, detail) => {
|
|
6766
6766
|
if (isFunction$1(config.warnHandler)) {
|
|
@@ -7111,15 +7111,15 @@
|
|
|
7111
7111
|
let d0Fuc, r0Fuc;
|
|
7112
7112
|
return d1 < d0 ? (d0Fuc = normalize$2(d1, d0), r0Fuc = interpolate(r1, r0)) : (d0Fuc = normalize$2(d0, d1), r0Fuc = interpolate(r0, r1)), x => r0Fuc(d0Fuc(x));
|
|
7113
7113
|
}
|
|
7114
|
-
function bandSpace(count, paddingInner, paddingOuter) {
|
|
7114
|
+
function bandSpace$1(count, paddingInner, paddingOuter) {
|
|
7115
7115
|
let space;
|
|
7116
7116
|
return space = 1 === count ? count + 2 * paddingOuter : count - paddingInner + 2 * paddingOuter, count ? space > 0 ? space : 1 : 0;
|
|
7117
7117
|
}
|
|
7118
|
-
function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
|
|
7119
|
-
return bandSpace(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
|
|
7118
|
+
function scaleWholeRangeSize$1(count, bandwidth, paddingInner, paddingOuter) {
|
|
7119
|
+
return bandSpace$1(count, paddingInner, paddingOuter) * (bandwidth / (1 - paddingInner));
|
|
7120
7120
|
}
|
|
7121
7121
|
function calculateBandwidthFromWholeRangeSize(count, wholeSize, paddingInner, paddingOuter, round) {
|
|
7122
|
-
const space = bandSpace(count, paddingInner, paddingOuter);
|
|
7122
|
+
const space = bandSpace$1(count, paddingInner, paddingOuter);
|
|
7123
7123
|
let step = wholeSize / Math.max(1, space || 1);
|
|
7124
7124
|
round && (step = Math.floor(step));
|
|
7125
7125
|
let bandwidth = step * (1 - paddingInner);
|
|
@@ -7196,7 +7196,7 @@
|
|
|
7196
7196
|
reverse = wholeRange[1] < wholeRange[0];
|
|
7197
7197
|
let start = wholeRange[Number(reverse) - 0];
|
|
7198
7198
|
const stop = wholeRange[1 - Number(reverse)],
|
|
7199
|
-
space = bandSpace(n, this._paddingInner, this._paddingOuter);
|
|
7199
|
+
space = bandSpace$1(n, this._paddingInner, this._paddingOuter);
|
|
7200
7200
|
this._step = (stop - start) / Math.max(1, space || 1), this._round && (this._step = Math.floor(this._step)), start += (stop - start - this._step * (n - this._paddingInner)) * this._align, this.isBandwidthFixed() || (this._bandwidth = this._step * (1 - this._paddingInner)), this._round && (start = Math.round(start), this.isBandwidthFixed() || (this._bandwidth = Math.round(this._bandwidth)));
|
|
7201
7201
|
const values = range(n).map(i => start + this._step * i);
|
|
7202
7202
|
return super.range(reverse ? values.reverse() : values), this;
|
|
@@ -7209,7 +7209,7 @@
|
|
|
7209
7209
|
autoBandwidth < this._minBandwidth ? (this._bandwidth = this._minBandwidth, this._isFixed = !0) : autoBandwidth > this._maxBandwidth ? (this._bandwidth = this._maxBandwidth, this._isFixed = !0) : (this._bandwidth = void 0, this._isFixed = !1);
|
|
7210
7210
|
}
|
|
7211
7211
|
if (this.isBandwidthFixed()) {
|
|
7212
|
-
const wholeLength = scaleWholeRangeSize(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
|
|
7212
|
+
const wholeLength = scaleWholeRangeSize$1(super.domain().length, this._bandwidth, this._paddingInner, this._paddingOuter),
|
|
7213
7213
|
rangeFactorSize = Math.min((range[1] - range[0]) / wholeLength, 1);
|
|
7214
7214
|
if (null === (_a = this._rangeFactor) || void 0 === _a ? void 0 : _a.length) {
|
|
7215
7215
|
const [rangeFactorStart, rangeFactorEnd] = this._rangeFactor,
|
|
@@ -7335,13 +7335,13 @@
|
|
|
7335
7335
|
if (isNil$1(b) || "boolean" === t) return () => b;
|
|
7336
7336
|
if ("number" === t) return interpolateNumber(a, b);
|
|
7337
7337
|
if ("string" === t) {
|
|
7338
|
-
if (c = Color$
|
|
7339
|
-
const rgb = interpolateRgb(Color$
|
|
7338
|
+
if (c = Color$2.parseColorString(b)) {
|
|
7339
|
+
const rgb = interpolateRgb(Color$2.parseColorString(a), c);
|
|
7340
7340
|
return t => rgb(t).formatRgb();
|
|
7341
7341
|
}
|
|
7342
7342
|
return interpolateNumber(Number(a), Number(b));
|
|
7343
7343
|
}
|
|
7344
|
-
return b instanceof RGB ? interpolateRgb(a, b) : b instanceof Color$
|
|
7344
|
+
return b instanceof RGB ? interpolateRgb(a, b) : b instanceof Color$2 ? interpolateRgb(a.color, b.color) : b instanceof Date ? interpolateDate(a, b) : interpolateNumber(Number(a), Number(b));
|
|
7345
7345
|
}
|
|
7346
7346
|
|
|
7347
7347
|
class ContinuousScale extends BaseScale {
|
|
@@ -19912,7 +19912,8 @@
|
|
|
19912
19912
|
}
|
|
19913
19913
|
ResourceLoader.cache = new Map();
|
|
19914
19914
|
|
|
19915
|
-
const tempMatrix = new Matrix()
|
|
19915
|
+
const tempMatrix = new Matrix(),
|
|
19916
|
+
tempBounds$1 = new AABBBounds();
|
|
19916
19917
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "lineCap", "lineJoin", "miterLimit", "scaleX", "scaleY", "angle", "anchor"];
|
|
19917
19918
|
const tempConstantXYKey = ["x", "y"],
|
|
19918
19919
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -20234,9 +20235,18 @@
|
|
|
20234
20235
|
var _a, _b, _c, _d;
|
|
20235
20236
|
if (hasAnimation) {
|
|
20236
20237
|
const keys = Object.keys(attrs),
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20238
|
+
noWorkAAttr = this.getNoWorkAnimateAttr(),
|
|
20239
|
+
animateAttrs = {};
|
|
20240
|
+
let noAnimateAttrs;
|
|
20241
|
+
isClear ? keys.forEach(key => {
|
|
20242
|
+
noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
|
|
20243
|
+
}) : keys.forEach(key => {
|
|
20244
|
+
noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = attrs[key];
|
|
20245
|
+
});
|
|
20246
|
+
const animate = this.animate();
|
|
20247
|
+
animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing), noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
|
|
20248
|
+
type: AttributeUpdateType.STATE
|
|
20249
|
+
});
|
|
20240
20250
|
} else this.setAttributes(attrs, !1, {
|
|
20241
20251
|
type: AttributeUpdateType.STATE
|
|
20242
20252
|
});
|
|
@@ -20330,35 +20340,55 @@
|
|
|
20330
20340
|
needUpdateLayout() {
|
|
20331
20341
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
20332
20342
|
}
|
|
20343
|
+
getAnchor(anchor, params) {
|
|
20344
|
+
const _anchor = [0, 0],
|
|
20345
|
+
getBounds = () => {
|
|
20346
|
+
if (params.b) return params.b;
|
|
20347
|
+
const {
|
|
20348
|
+
scaleX: scaleX,
|
|
20349
|
+
scaleY: scaleY,
|
|
20350
|
+
angle: angle
|
|
20351
|
+
} = this.attribute;
|
|
20352
|
+
return tempBounds$1.copy(this._AABBBounds), this.setAttributes({
|
|
20353
|
+
scaleX: 1,
|
|
20354
|
+
scaleY: 1,
|
|
20355
|
+
angle: 0
|
|
20356
|
+
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds$1), this.setAttributes({
|
|
20357
|
+
scaleX: scaleX,
|
|
20358
|
+
scaleY: scaleY,
|
|
20359
|
+
angle: angle
|
|
20360
|
+
}), params.b;
|
|
20361
|
+
};
|
|
20362
|
+
if ("string" == typeof anchor[0]) {
|
|
20363
|
+
const ratio = parseFloat(anchor[0]) / 100,
|
|
20364
|
+
bounds = getBounds();
|
|
20365
|
+
_anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
20366
|
+
} else _anchor[0] = anchor[0];
|
|
20367
|
+
if ("string" == typeof anchor[1]) {
|
|
20368
|
+
const ratio = parseFloat(anchor[1]) / 100,
|
|
20369
|
+
bounds = getBounds();
|
|
20370
|
+
_anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;
|
|
20371
|
+
} else _anchor[1] = anchor[1];
|
|
20372
|
+
return _anchor;
|
|
20373
|
+
}
|
|
20333
20374
|
doUpdateLocalMatrix() {
|
|
20334
20375
|
const {
|
|
20335
|
-
|
|
20336
|
-
|
|
20337
|
-
|
|
20338
|
-
|
|
20339
|
-
|
|
20340
|
-
|
|
20341
|
-
|
|
20342
|
-
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20346
|
-
|
|
20347
|
-
const ratio = parseFloat(anchor[0]) / 100,
|
|
20348
|
-
bounds = this.AABBBounds;
|
|
20349
|
-
_anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
20350
|
-
} else _anchor[0] = anchor[0];
|
|
20351
|
-
if ("string" == typeof anchor[1]) {
|
|
20352
|
-
const ratio = parseFloat(anchor[1]) / 100,
|
|
20353
|
-
bounds = this.AABBBounds;
|
|
20354
|
-
_anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
|
|
20355
|
-
} else _anchor[1] = anchor[1];
|
|
20356
|
-
}
|
|
20357
|
-
if (!scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
20376
|
+
x = DefaultTransform.x,
|
|
20377
|
+
y = DefaultTransform.y,
|
|
20378
|
+
scaleX = DefaultTransform.scaleX,
|
|
20379
|
+
scaleY = DefaultTransform.scaleY,
|
|
20380
|
+
angle = DefaultTransform.angle,
|
|
20381
|
+
scaleCenter: scaleCenter,
|
|
20382
|
+
anchor: anchor,
|
|
20383
|
+
postMatrix: postMatrix
|
|
20384
|
+
} = this.attribute;
|
|
20385
|
+
let _anchor = [0, 0];
|
|
20386
|
+
const params = {};
|
|
20387
|
+
if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
20358
20388
|
const m = this._transMatrix;
|
|
20359
|
-
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
20360
|
-
x:
|
|
20361
|
-
y:
|
|
20389
|
+
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]), m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
20390
|
+
x: _anchor[0],
|
|
20391
|
+
y: _anchor[1]
|
|
20362
20392
|
});
|
|
20363
20393
|
}
|
|
20364
20394
|
const p = this.getOffsetXY(DefaultTransform);
|
|
@@ -26342,7 +26372,7 @@
|
|
|
26342
26372
|
distance = defaultOuterBorder.distance,
|
|
26343
26373
|
lineWidth = defaultOuterBorder.lineWidth
|
|
26344
26374
|
} = outerBorder;
|
|
26345
|
-
aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
|
|
26375
|
+
aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
|
|
26346
26376
|
}
|
|
26347
26377
|
return aabbBounds;
|
|
26348
26378
|
}
|
|
@@ -26381,7 +26411,7 @@
|
|
|
26381
26411
|
distance = defaultOuterBorder.distance,
|
|
26382
26412
|
lineWidth = defaultOuterBorder.lineWidth
|
|
26383
26413
|
} = outerBorder;
|
|
26384
|
-
boundStroke(aabbBounds, distance + shadowBlur + lineWidth / 2, !0, strokeBoundsBuffer);
|
|
26414
|
+
boundStroke(aabbBounds, distance + (shadowBlur + lineWidth) / 2, !0, strokeBoundsBuffer);
|
|
26385
26415
|
}
|
|
26386
26416
|
return aabbBounds;
|
|
26387
26417
|
}
|
|
@@ -33718,7 +33748,7 @@
|
|
|
33718
33748
|
const {
|
|
33719
33749
|
context: context
|
|
33720
33750
|
} = drawContext;
|
|
33721
|
-
context.highPerformanceSave();
|
|
33751
|
+
context.highPerformanceSave(), context.setTransformFromMatrix(graphic.parent.globalTransMatrix, !0);
|
|
33722
33752
|
const b = graphic.AABBBounds;
|
|
33723
33753
|
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;
|
|
33724
33754
|
}
|
|
@@ -37656,12 +37686,12 @@
|
|
|
37656
37686
|
if ((!isValid$1(colorKey.a) && !isValid$1(colorKey.l)) || !isString$1(color)) {
|
|
37657
37687
|
return color;
|
|
37658
37688
|
}
|
|
37659
|
-
let c = new Color(color);
|
|
37689
|
+
let c = new Color$1(color);
|
|
37660
37690
|
if (isValid$1(colorKey.l)) {
|
|
37661
37691
|
const { r, g, b } = c.color;
|
|
37662
37692
|
const { h, s } = rgbToHsl(r, g, b);
|
|
37663
37693
|
const rgb = hslToRgb(h, s, colorKey.l);
|
|
37664
|
-
const newColor = new Color(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);
|
|
37694
|
+
const newColor = new Color$1(`rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`);
|
|
37665
37695
|
newColor.setOpacity(c.color.opacity);
|
|
37666
37696
|
c = newColor;
|
|
37667
37697
|
}
|
|
@@ -40285,9 +40315,9 @@
|
|
|
40285
40315
|
});
|
|
40286
40316
|
(null === (_b = viewOptions.options3d) || void 0 === _b ? void 0 : _b.enable) && stage.set3dOptions(viewOptions.options3d), stage.enableIncrementalAutoRender(), this._viewBox = viewOptions.viewBox, this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_STAGE), this._view.emit(HOOK_EVENT.BEFORE_CREATE_VRENDER_LAYER);
|
|
40287
40317
|
const layer = null !== (_c = viewOptions.layer) && void 0 !== _c ? _c : stage.defaultLayer;
|
|
40288
|
-
if (this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER), (null === (_d = this._eventConfig) || void 0 === _d ? void 0 : _d.drag) && (this._dragController = new DragNDrop(
|
|
40318
|
+
if (this._view.emit(HOOK_EVENT.AFTER_CREATE_VRENDER_LAYER), (null === (_d = this._eventConfig) || void 0 === _d ? void 0 : _d.drag) && (this._dragController = new DragNDrop(stage)), null === (_e = this._eventConfig) || void 0 === _e ? void 0 : _e.gesture) {
|
|
40289
40319
|
const gestureConfig = isObject$g(this._eventConfig.gesture) ? this._eventConfig.gesture : {};
|
|
40290
|
-
this._gestureController = new Gesture(
|
|
40320
|
+
this._gestureController = new Gesture(stage, gestureConfig);
|
|
40291
40321
|
}
|
|
40292
40322
|
return {
|
|
40293
40323
|
stage: stage,
|
|
@@ -40599,17 +40629,17 @@
|
|
|
40599
40629
|
}
|
|
40600
40630
|
function parseFieldData(spec, parameters) {
|
|
40601
40631
|
const field = spec.field,
|
|
40602
|
-
refData = getGrammarOutput(spec.data, parameters)
|
|
40603
|
-
|
|
40632
|
+
refData = getGrammarOutput(spec.data, parameters),
|
|
40633
|
+
fieldData = [];
|
|
40604
40634
|
if (isArray$4(field)) field.forEach(entry => {
|
|
40605
40635
|
const getter = field$3(entry);
|
|
40606
40636
|
refData && refData.forEach(datum => {
|
|
40607
|
-
fieldData
|
|
40637
|
+
fieldData.push(getter(datum));
|
|
40608
40638
|
});
|
|
40609
40639
|
});else {
|
|
40610
40640
|
const getter = field$3(field);
|
|
40611
40641
|
refData && refData.forEach(datum => {
|
|
40612
|
-
fieldData
|
|
40642
|
+
fieldData.push(getter(datum));
|
|
40613
40643
|
});
|
|
40614
40644
|
}
|
|
40615
40645
|
return fieldData;
|
|
@@ -45628,10 +45658,14 @@
|
|
|
45628
45658
|
return group ? group.findAll(node => "group" !== node.type, !0) : [];
|
|
45629
45659
|
}
|
|
45630
45660
|
|
|
45631
|
-
const defaultAlternativeColors = ["#ffffff", "#000000"]
|
|
45661
|
+
const defaultAlternativeColors = ["#ffffff", "#000000"],
|
|
45662
|
+
{
|
|
45663
|
+
Color: Color
|
|
45664
|
+
} = ColorUtil;
|
|
45632
45665
|
function labelSmartInvert(foregroundColorOrigin, backgroundColorOrogin, textType, contrastRatiosThreshold, alternativeColors) {
|
|
45633
|
-
|
|
45634
|
-
|
|
45666
|
+
if ("string" != typeof foregroundColorOrigin || "string" != typeof backgroundColorOrogin) return foregroundColorOrigin;
|
|
45667
|
+
const foregroundColor = new Color(foregroundColorOrigin).toHex(),
|
|
45668
|
+
backgroundColor = new Color(backgroundColorOrogin).toHex();
|
|
45635
45669
|
return contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold) ? foregroundColor : improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors);
|
|
45636
45670
|
}
|
|
45637
45671
|
function improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors) {
|
|
@@ -45656,16 +45690,6 @@
|
|
|
45656
45690
|
R = RsRGB <= .03928 ? RsRGB / 12.92 : Math.pow((RsRGB + .055) / 1.055, 2.4), G = GsRGB <= .03928 ? GsRGB / 12.92 : Math.pow((GsRGB + .055) / 1.055, 2.4), B = BsRGB <= .03928 ? BsRGB / 12.92 : Math.pow((BsRGB + .055) / 1.055, 2.4);
|
|
45657
45691
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
45658
45692
|
}
|
|
45659
|
-
function formatColorToHex(originColor) {
|
|
45660
|
-
if (null == originColor ? void 0 : originColor.includes("#")) return originColor;
|
|
45661
|
-
const c = new Color$1(originColor),
|
|
45662
|
-
{
|
|
45663
|
-
r: r,
|
|
45664
|
-
g: g,
|
|
45665
|
-
b: b
|
|
45666
|
-
} = c.color;
|
|
45667
|
-
return "#" + rgbToHex(r, g, b);
|
|
45668
|
-
}
|
|
45669
45693
|
function smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor) {
|
|
45670
45694
|
let result;
|
|
45671
45695
|
switch (fillStrategy) {
|
|
@@ -47039,7 +47063,7 @@
|
|
|
47039
47063
|
return listener;
|
|
47040
47064
|
}
|
|
47041
47065
|
_smartInvert(labels) {
|
|
47042
|
-
var _a, _b, _c, _d;
|
|
47066
|
+
var _a, _b, _c, _d, _e;
|
|
47043
47067
|
const option = this.attribute.smartInvert || {},
|
|
47044
47068
|
{
|
|
47045
47069
|
textType: textType,
|
|
@@ -47049,18 +47073,18 @@
|
|
|
47049
47073
|
fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
|
|
47050
47074
|
strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
|
|
47051
47075
|
brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff",
|
|
47052
|
-
darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000"
|
|
47076
|
+
darkColor = null !== (_d = option.darkColor) && void 0 !== _d ? _d : "#000000",
|
|
47077
|
+
outsideEnable = null !== (_e = option.outsideEnable) && void 0 !== _e && _e;
|
|
47053
47078
|
if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
|
|
47054
47079
|
const label = labels[i];
|
|
47055
47080
|
if (!label) continue;
|
|
47056
47081
|
const baseMark = this._idToGraphic.get(label.attribute.id),
|
|
47057
|
-
isInside = this._canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds),
|
|
47058
47082
|
backgroundColor = baseMark.attribute.fill,
|
|
47059
47083
|
foregroundColor = label.attribute.fill,
|
|
47060
47084
|
baseColor = backgroundColor,
|
|
47061
47085
|
invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors),
|
|
47062
47086
|
similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
|
|
47063
|
-
if (
|
|
47087
|
+
if (outsideEnable) {
|
|
47064
47088
|
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47065
47089
|
if (fill && label.setAttributes({
|
|
47066
47090
|
fill: fill
|
|
@@ -47070,21 +47094,32 @@
|
|
|
47070
47094
|
stroke: stroke
|
|
47071
47095
|
});
|
|
47072
47096
|
} else {
|
|
47073
|
-
if (0
|
|
47074
|
-
|
|
47075
|
-
label.setAttributes({
|
|
47076
|
-
fill:
|
|
47097
|
+
if (this._canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
|
|
47098
|
+
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47099
|
+
if (fill && label.setAttributes({
|
|
47100
|
+
fill: fill
|
|
47101
|
+
}), 0 === label.attribute.lineWidth) continue;
|
|
47102
|
+
const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
|
|
47103
|
+
stroke && label.setAttributes({
|
|
47104
|
+
stroke: stroke
|
|
47105
|
+
});
|
|
47106
|
+
} else {
|
|
47107
|
+
if (0 === label.attribute.lineWidth) continue;
|
|
47108
|
+
if (label.attribute.stroke) {
|
|
47109
|
+
label.setAttributes({
|
|
47110
|
+
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
|
|
47111
|
+
});
|
|
47112
|
+
continue;
|
|
47113
|
+
}
|
|
47114
|
+
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47115
|
+
fill && label.setAttributes({
|
|
47116
|
+
fill: fill
|
|
47117
|
+
});
|
|
47118
|
+
const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
|
|
47119
|
+
stroke && label.setAttributes({
|
|
47120
|
+
stroke: stroke
|
|
47077
47121
|
});
|
|
47078
|
-
continue;
|
|
47079
47122
|
}
|
|
47080
|
-
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47081
|
-
fill && label.setAttributes({
|
|
47082
|
-
fill: fill
|
|
47083
|
-
});
|
|
47084
|
-
const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
|
|
47085
|
-
stroke && label.setAttributes({
|
|
47086
|
-
stroke: stroke
|
|
47087
|
-
});
|
|
47088
47123
|
}
|
|
47089
47124
|
}
|
|
47090
47125
|
}
|
|
@@ -51635,7 +51670,7 @@
|
|
|
51635
51670
|
opacity: .85
|
|
51636
51671
|
},
|
|
51637
51672
|
unSelected: {
|
|
51638
|
-
|
|
51673
|
+
opacity: .5
|
|
51639
51674
|
}
|
|
51640
51675
|
}
|
|
51641
51676
|
},
|
|
@@ -53960,8 +53995,11 @@
|
|
|
53960
53995
|
const generateLabelAttributes = (marks, groupSize, encoder, labelStyle, parameters, theme) => {
|
|
53961
53996
|
var _a;
|
|
53962
53997
|
const labelTheme = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.dataLabel,
|
|
53963
|
-
dataLabels = marks.map(mark => {
|
|
53998
|
+
dataLabels = marks.map((mark, index) => {
|
|
53964
53999
|
var _a, _b, _c, _d, _e, _f;
|
|
54000
|
+
const labelParameters = Object.assign(Object.assign({}, parameters), {
|
|
54001
|
+
labelIndex: index
|
|
54002
|
+
});
|
|
53965
54003
|
let currentTheme = {};
|
|
53966
54004
|
switch (mark.markType) {
|
|
53967
54005
|
case GrammarMarkType.line:
|
|
@@ -53989,12 +54027,12 @@
|
|
|
53989
54027
|
mark.elements.forEach(element => {
|
|
53990
54028
|
var _a, _b;
|
|
53991
54029
|
if ("willRelease" !== element.getGraphicItem().releaseStatus) {
|
|
53992
|
-
const attributes = invokeEncoder(encoder, element.getDatum(), element,
|
|
54030
|
+
const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters),
|
|
53993
54031
|
datum = merge$1({}, null !== (_b = null === (_a = null == currentTheme ? void 0 : currentTheme.data) || void 0 === _a ? void 0 : _a[0]) && void 0 !== _b ? _b : {}, attributes);
|
|
53994
54032
|
data.push(datum);
|
|
53995
54033
|
}
|
|
53996
54034
|
});
|
|
53997
|
-
const addition = invokeFunctionType(labelStyle,
|
|
54035
|
+
const addition = invokeFunctionType(labelStyle, labelParameters, mark),
|
|
53998
54036
|
graphicItemName = null === (_f = mark.graphicItem) || void 0 === _f ? void 0 : _f.name;
|
|
53999
54037
|
return merge$1({}, currentTheme, {
|
|
54000
54038
|
data: data,
|
|
@@ -56069,11 +56107,13 @@
|
|
|
56069
56107
|
space: 6,
|
|
56070
56108
|
style: {
|
|
56071
56109
|
lineWidth: 0,
|
|
56072
|
-
fillOpacity: 1
|
|
56110
|
+
fillOpacity: 1,
|
|
56111
|
+
opacity: 1
|
|
56073
56112
|
},
|
|
56074
56113
|
state: {
|
|
56075
56114
|
unSelected: {
|
|
56076
|
-
fillOpacity: 0.
|
|
56115
|
+
fillOpacity: 0.2,
|
|
56116
|
+
opacity: 1
|
|
56077
56117
|
}
|
|
56078
56118
|
}
|
|
56079
56119
|
},
|
|
@@ -56083,11 +56123,13 @@
|
|
|
56083
56123
|
fill: { type: 'palette', key: 'secondaryFontColor', default: '#89909d' },
|
|
56084
56124
|
fontSize: THEME_CONSTANTS.l5FontSize,
|
|
56085
56125
|
lineHeight: THEME_CONSTANTS.l5LineHeight,
|
|
56086
|
-
fontFamily: THEME_CONSTANTS.defaultFontFamily
|
|
56126
|
+
fontFamily: THEME_CONSTANTS.defaultFontFamily,
|
|
56127
|
+
opacity: 1
|
|
56087
56128
|
},
|
|
56088
56129
|
state: {
|
|
56089
56130
|
unSelected: {
|
|
56090
|
-
fill: { type: 'palette', key: 'disableFontColor' }
|
|
56131
|
+
fill: { type: 'palette', key: 'disableFontColor' },
|
|
56132
|
+
opacity: 1
|
|
56091
56133
|
}
|
|
56092
56134
|
}
|
|
56093
56135
|
}
|
|
@@ -56221,21 +56263,21 @@
|
|
|
56221
56263
|
startSymbol: {
|
|
56222
56264
|
visible: false,
|
|
56223
56265
|
symbolType: 'triangle',
|
|
56266
|
+
size: 10,
|
|
56224
56267
|
style: {
|
|
56225
56268
|
stroke: null,
|
|
56226
56269
|
lineWidth: 0,
|
|
56227
|
-
fill: 'rgba(46, 47, 50)'
|
|
56228
|
-
size: 10
|
|
56270
|
+
fill: 'rgba(46, 47, 50)'
|
|
56229
56271
|
}
|
|
56230
56272
|
},
|
|
56231
56273
|
endSymbol: {
|
|
56232
56274
|
visible: true,
|
|
56233
56275
|
symbolType: 'triangle',
|
|
56276
|
+
size: 10,
|
|
56234
56277
|
style: {
|
|
56235
56278
|
stroke: null,
|
|
56236
56279
|
lineWidth: 0,
|
|
56237
|
-
fill: 'rgba(46, 47, 50)'
|
|
56238
|
-
size: 10
|
|
56280
|
+
fill: 'rgba(46, 47, 50)'
|
|
56239
56281
|
}
|
|
56240
56282
|
},
|
|
56241
56283
|
label: {
|
|
@@ -57278,6 +57320,103 @@
|
|
|
57278
57320
|
}
|
|
57279
57321
|
return (_a = fields[field].alias) !== null && _a !== void 0 ? _a : field;
|
|
57280
57322
|
}
|
|
57323
|
+
function getRegionStackGroup(region, setInitialValue, filter) {
|
|
57324
|
+
const stackValueGroup = {};
|
|
57325
|
+
region.getSeries().forEach(s => {
|
|
57326
|
+
var _a;
|
|
57327
|
+
const stackData = s.getStackData();
|
|
57328
|
+
const stackValue = s.getStackValue();
|
|
57329
|
+
const stackValueField = s.getStackValueField();
|
|
57330
|
+
const filterEnable = filter ? filter(s) : true;
|
|
57331
|
+
if (stackData && stackValueField && filterEnable) {
|
|
57332
|
+
stackValueGroup[stackValue] = (_a = stackValueGroup[stackValue]) !== null && _a !== void 0 ? _a : {
|
|
57333
|
+
nodes: {}
|
|
57334
|
+
};
|
|
57335
|
+
stackGroup(s, stackData, stackValueGroup[stackValue], stackValueField, setInitialValue);
|
|
57336
|
+
}
|
|
57337
|
+
});
|
|
57338
|
+
return stackValueGroup;
|
|
57339
|
+
}
|
|
57340
|
+
function stackTotal(stackData, valueField) {
|
|
57341
|
+
if ('values' in stackData && stackData.values.length) {
|
|
57342
|
+
const total = sum(stackData.values, valueField);
|
|
57343
|
+
const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
|
|
57344
|
+
stackData.values.forEach(v => {
|
|
57345
|
+
v[STACK_FIELD_TOTAL] = total;
|
|
57346
|
+
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
57347
|
+
delete v[STACK_FIELD_TOTAL_TOP];
|
|
57348
|
+
});
|
|
57349
|
+
const maxNode = stackData.values.reduce((max, current) => {
|
|
57350
|
+
return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
|
|
57351
|
+
});
|
|
57352
|
+
maxNode[STACK_FIELD_TOTAL_TOP] = true;
|
|
57353
|
+
return;
|
|
57354
|
+
}
|
|
57355
|
+
for (const key in stackData.nodes) {
|
|
57356
|
+
stackTotal(stackData.nodes[key], valueField);
|
|
57357
|
+
}
|
|
57358
|
+
}
|
|
57359
|
+
function stackOffsetSilhouette(stackCache) {
|
|
57360
|
+
if (!stackCache.values.length) {
|
|
57361
|
+
return;
|
|
57362
|
+
}
|
|
57363
|
+
const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
|
|
57364
|
+
for (let j = 0; j < stackCache.values.length; j++) {
|
|
57365
|
+
stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
|
|
57366
|
+
stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
|
|
57367
|
+
}
|
|
57368
|
+
}
|
|
57369
|
+
function stack(stackCache, stackInverse) {
|
|
57370
|
+
if (stackCache.values.length > 0) {
|
|
57371
|
+
let positiveStart = 0;
|
|
57372
|
+
let negativeStart = 0;
|
|
57373
|
+
let sign = 1;
|
|
57374
|
+
let value = 0;
|
|
57375
|
+
const maxLength = stackCache.values.length;
|
|
57376
|
+
for (let index = 0; index < maxLength; index++) {
|
|
57377
|
+
const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
|
|
57378
|
+
value = v[STACK_FIELD_END];
|
|
57379
|
+
if (value >= 0) {
|
|
57380
|
+
v[STACK_FIELD_START] = positiveStart;
|
|
57381
|
+
positiveStart += v[STACK_FIELD_END];
|
|
57382
|
+
v[STACK_FIELD_END] = positiveStart;
|
|
57383
|
+
}
|
|
57384
|
+
else {
|
|
57385
|
+
v[STACK_FIELD_START] = negativeStart;
|
|
57386
|
+
negativeStart += v[STACK_FIELD_END];
|
|
57387
|
+
v[STACK_FIELD_END] = negativeStart;
|
|
57388
|
+
}
|
|
57389
|
+
}
|
|
57390
|
+
for (let index = 0; index < maxLength; index++) {
|
|
57391
|
+
const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
|
|
57392
|
+
value = v[STACK_FIELD_END];
|
|
57393
|
+
const denominator = value >= 0 ? positiveStart : negativeStart;
|
|
57394
|
+
sign = value >= 0 ? 1 : -1;
|
|
57395
|
+
v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
|
|
57396
|
+
v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
|
|
57397
|
+
}
|
|
57398
|
+
}
|
|
57399
|
+
for (const key in stackCache.nodes) {
|
|
57400
|
+
stack(stackCache.nodes[key], stackInverse);
|
|
57401
|
+
}
|
|
57402
|
+
}
|
|
57403
|
+
function stackGroup(s, stackData, stackCache, valueField, setInitialValue) {
|
|
57404
|
+
if ('values' in stackData) {
|
|
57405
|
+
setInitialValue && stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
|
|
57406
|
+
stackCache.values.push(...stackData.values);
|
|
57407
|
+
stackCache.series.push({ s: s, values: stackData.values });
|
|
57408
|
+
return;
|
|
57409
|
+
}
|
|
57410
|
+
for (const key in stackData.nodes) {
|
|
57411
|
+
!stackCache.nodes[key] &&
|
|
57412
|
+
(stackCache.nodes[key] = {
|
|
57413
|
+
values: [],
|
|
57414
|
+
series: [],
|
|
57415
|
+
nodes: {}
|
|
57416
|
+
});
|
|
57417
|
+
stackGroup(s, stackData.nodes[key], stackCache.nodes[key], valueField, setInitialValue);
|
|
57418
|
+
}
|
|
57419
|
+
}
|
|
57281
57420
|
|
|
57282
57421
|
const findHierarchyNode = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
|
|
57283
57422
|
for (let i = 0; i < hierarchyData.length; i++) {
|
|
@@ -57667,6 +57806,25 @@
|
|
|
57667
57806
|
}
|
|
57668
57807
|
return inverse;
|
|
57669
57808
|
}
|
|
57809
|
+
function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
|
|
57810
|
+
if (paddingInner === 1) {
|
|
57811
|
+
paddingInner = 0;
|
|
57812
|
+
}
|
|
57813
|
+
const space = bandSpace(count, paddingInner, paddingOuter);
|
|
57814
|
+
const step = bandwidth / (1 - paddingInner);
|
|
57815
|
+
const wholeSize = space * step;
|
|
57816
|
+
return wholeSize;
|
|
57817
|
+
}
|
|
57818
|
+
function bandSpace(count, paddingInner, paddingOuter) {
|
|
57819
|
+
let space;
|
|
57820
|
+
if (count === 1) {
|
|
57821
|
+
space = count + paddingOuter * 2;
|
|
57822
|
+
}
|
|
57823
|
+
else {
|
|
57824
|
+
space = count - paddingInner + paddingOuter * 2;
|
|
57825
|
+
}
|
|
57826
|
+
return count ? (space > 0 ? space : 1) : 0;
|
|
57827
|
+
}
|
|
57670
57828
|
|
|
57671
57829
|
const getAxis$1 = (chart, type, pos) => {
|
|
57672
57830
|
const axesComponents = chart
|
|
@@ -61378,9 +61536,24 @@
|
|
|
61378
61536
|
})(IFilterMode || (IFilterMode = {}));
|
|
61379
61537
|
|
|
61380
61538
|
class Region extends BaseModel {
|
|
61539
|
+
getMaxWidth() {
|
|
61540
|
+
return this._maxRegionWidth;
|
|
61541
|
+
}
|
|
61542
|
+
setMaxWidth(value) {
|
|
61543
|
+
this._maxRegionWidth = value;
|
|
61544
|
+
}
|
|
61545
|
+
getMaxHeight() {
|
|
61546
|
+
return this._maxRegionHeight;
|
|
61547
|
+
}
|
|
61548
|
+
setMaxHeight(value) {
|
|
61549
|
+
this._maxRegionHeight = value;
|
|
61550
|
+
}
|
|
61381
61551
|
getGroupMark() {
|
|
61382
61552
|
return this._groupMark;
|
|
61383
61553
|
}
|
|
61554
|
+
getStackInverse() {
|
|
61555
|
+
return this._spec.stackInverse === true;
|
|
61556
|
+
}
|
|
61384
61557
|
constructor(spec, ctx) {
|
|
61385
61558
|
var _a;
|
|
61386
61559
|
super(spec, ctx);
|
|
@@ -61486,8 +61659,9 @@
|
|
|
61486
61659
|
}
|
|
61487
61660
|
}
|
|
61488
61661
|
_compareSpec() {
|
|
61662
|
+
var _a, _b;
|
|
61489
61663
|
const result = super._compareSpec();
|
|
61490
|
-
if (!isEqual$1(this._originalSpec.style, this._spec.style)) {
|
|
61664
|
+
if (!isEqual$1((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.style, (_b = this._spec) === null || _b === void 0 ? void 0 : _b.style)) {
|
|
61491
61665
|
result.reMake = true;
|
|
61492
61666
|
}
|
|
61493
61667
|
return result;
|
|
@@ -61604,92 +61778,105 @@
|
|
|
61604
61778
|
}
|
|
61605
61779
|
Region.type = 'region';
|
|
61606
61780
|
|
|
61607
|
-
|
|
61608
|
-
|
|
61609
|
-
|
|
61610
|
-
|
|
61611
|
-
|
|
61612
|
-
|
|
61613
|
-
|
|
61614
|
-
}
|
|
61615
|
-
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
61616
|
-
this._chartLayoutRect = chartLayoutRect;
|
|
61617
|
-
this._chartViewBox = chartViewBox;
|
|
61618
|
-
this._leftCurrent = chartLayoutRect.x;
|
|
61619
|
-
this._topCurrent = chartLayoutRect.y;
|
|
61620
|
-
this._rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
61621
|
-
this._bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
61622
|
-
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
61623
|
-
this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
|
|
61624
|
-
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
61625
|
-
const layoutTemp = {
|
|
61626
|
-
_leftCurrent: this._leftCurrent,
|
|
61627
|
-
_topCurrent: this._topCurrent,
|
|
61628
|
-
_rightCurrent: this._rightCurrent,
|
|
61629
|
-
_bottomCurrent: this._bottomCurrent
|
|
61630
|
-
};
|
|
61631
|
-
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
61632
|
-
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
61633
|
-
this.layoutRegionItems(regionItems, relativeItems);
|
|
61634
|
-
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
61635
|
-
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
61636
|
-
if (top || bottom || left || right) {
|
|
61637
|
-
this._topCurrent = layoutTemp._topCurrent + top;
|
|
61638
|
-
this._bottomCurrent = layoutTemp._bottomCurrent - bottom;
|
|
61639
|
-
this._leftCurrent = layoutTemp._leftCurrent + left;
|
|
61640
|
-
this._rightCurrent = layoutTemp._rightCurrent - right;
|
|
61641
|
-
this.layoutRegionItems(regionItems, relativeItems);
|
|
61642
|
-
}
|
|
61781
|
+
function getPositionItems(items) {
|
|
61782
|
+
const startItems = [];
|
|
61783
|
+
const middleItems = [];
|
|
61784
|
+
const endItems = [];
|
|
61785
|
+
items.forEach(item => {
|
|
61786
|
+
if (isNil$1(item.getSpec().position) || item.getSpec().position === 'start') {
|
|
61787
|
+
startItems.push(item);
|
|
61643
61788
|
}
|
|
61644
|
-
|
|
61645
|
-
|
|
61646
|
-
|
|
61647
|
-
|
|
61648
|
-
|
|
61649
|
-
|
|
61650
|
-
|
|
61651
|
-
|
|
61789
|
+
else if (item.getSpec().position === 'middle') {
|
|
61790
|
+
middleItems.push(item);
|
|
61791
|
+
}
|
|
61792
|
+
else if (item.getSpec().position === 'end') {
|
|
61793
|
+
endItems.push(item);
|
|
61794
|
+
}
|
|
61795
|
+
});
|
|
61796
|
+
return {
|
|
61797
|
+
startItems,
|
|
61798
|
+
endItems,
|
|
61799
|
+
middleItems
|
|
61800
|
+
};
|
|
61801
|
+
}
|
|
61802
|
+
function adjustItemsToCenter(allItems, isVertical, containerLength) {
|
|
61803
|
+
if (isVertical) {
|
|
61804
|
+
allItems.forEach(items => {
|
|
61805
|
+
const lastItem = last(items);
|
|
61806
|
+
const length = lastItem.getLayoutStartPoint().y + lastItem.getLayoutRect().height - items[0].getLayoutStartPoint().y;
|
|
61807
|
+
const centerY = (containerLength - length) / 2;
|
|
61808
|
+
items.forEach(item => {
|
|
61652
61809
|
item.setLayoutStartPosition({
|
|
61653
|
-
x:
|
|
61654
|
-
y:
|
|
61810
|
+
x: item.getLayoutStartPoint().x,
|
|
61811
|
+
y: item.getLayoutStartPoint().y + centerY
|
|
61655
61812
|
});
|
|
61656
|
-
|
|
61657
|
-
|
|
61658
|
-
|
|
61813
|
+
});
|
|
61814
|
+
});
|
|
61815
|
+
}
|
|
61816
|
+
else {
|
|
61817
|
+
allItems.forEach(items => {
|
|
61818
|
+
const lastItem = last(items);
|
|
61819
|
+
const length = lastItem.getLayoutStartPoint().x + lastItem.getLayoutRect().width - items[0].getLayoutStartPoint().x;
|
|
61820
|
+
const centerX = (containerLength - length) / 2;
|
|
61821
|
+
items.forEach(item => {
|
|
61659
61822
|
item.setLayoutStartPosition({
|
|
61660
|
-
x:
|
|
61661
|
-
y:
|
|
61823
|
+
x: item.getLayoutStartPoint().x + centerX,
|
|
61824
|
+
y: item.getLayoutStartPoint().y
|
|
61662
61825
|
});
|
|
61663
|
-
|
|
61664
|
-
|
|
61665
|
-
|
|
61826
|
+
});
|
|
61827
|
+
});
|
|
61828
|
+
}
|
|
61829
|
+
}
|
|
61830
|
+
function layoutRightStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
|
|
61831
|
+
if (items.length) {
|
|
61832
|
+
let maxWidth = 0;
|
|
61833
|
+
let preRight = layout.rightCurrent;
|
|
61834
|
+
let preTop = layout.topCurrent;
|
|
61835
|
+
const allItems = [];
|
|
61836
|
+
let singleLineItems = [];
|
|
61837
|
+
items.forEach(item => {
|
|
61838
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61839
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
61840
|
+
item.setLayoutRect(rect);
|
|
61841
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61842
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61843
|
+
item.setLayoutStartPosition({
|
|
61844
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61845
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
61846
|
+
});
|
|
61847
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
61848
|
+
preTop += itemTotalHeight;
|
|
61849
|
+
if (preTop > limitHeight) {
|
|
61850
|
+
preRight -= maxWidth;
|
|
61851
|
+
maxWidth = itemTotalWidth;
|
|
61852
|
+
preTop = layout.topCurrent + itemTotalHeight;
|
|
61666
61853
|
item.setLayoutStartPosition({
|
|
61667
|
-
x:
|
|
61668
|
-
y:
|
|
61854
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61855
|
+
y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61669
61856
|
});
|
|
61670
|
-
|
|
61857
|
+
allItems.push(singleLineItems);
|
|
61858
|
+
singleLineItems = [item];
|
|
61671
61859
|
}
|
|
61672
|
-
else
|
|
61673
|
-
|
|
61674
|
-
x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
|
|
61675
|
-
y: this._bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61676
|
-
});
|
|
61677
|
-
this._bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61860
|
+
else {
|
|
61861
|
+
singleLineItems.push(item);
|
|
61678
61862
|
}
|
|
61679
61863
|
});
|
|
61864
|
+
allItems.push(singleLineItems);
|
|
61865
|
+
if (isMiddle) {
|
|
61866
|
+
adjustItemsToCenter(allItems, true, limitHeight);
|
|
61867
|
+
}
|
|
61868
|
+
layout.rightCurrent = preRight - maxWidth;
|
|
61680
61869
|
}
|
|
61681
|
-
|
|
61682
|
-
|
|
61683
|
-
|
|
61684
|
-
const topItems = normalItems.filter(item => item.layoutOrient === 'top');
|
|
61685
|
-
const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
|
|
61686
|
-
const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
|
|
61687
|
-
const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
|
|
61870
|
+
}
|
|
61871
|
+
function layoutLeftStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
|
|
61872
|
+
if (items.length) {
|
|
61688
61873
|
let maxWidth = 0;
|
|
61689
|
-
let preLeft =
|
|
61690
|
-
let preTop =
|
|
61691
|
-
|
|
61692
|
-
|
|
61874
|
+
let preLeft = layout.leftCurrent;
|
|
61875
|
+
let preTop = layout.topCurrent;
|
|
61876
|
+
const allItems = [];
|
|
61877
|
+
let singleLineItems = [];
|
|
61878
|
+
items.forEach(item => {
|
|
61879
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61693
61880
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61694
61881
|
item.setLayoutRect(rect);
|
|
61695
61882
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
@@ -61703,19 +61890,34 @@
|
|
|
61703
61890
|
if (preTop > limitHeight) {
|
|
61704
61891
|
preLeft += maxWidth;
|
|
61705
61892
|
maxWidth = itemTotalWidth;
|
|
61706
|
-
preTop =
|
|
61893
|
+
preTop = layout.topCurrent + itemTotalHeight;
|
|
61707
61894
|
item.setLayoutStartPosition({
|
|
61708
61895
|
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61709
|
-
y:
|
|
61896
|
+
y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61710
61897
|
});
|
|
61898
|
+
allItems.push(singleLineItems);
|
|
61899
|
+
singleLineItems = [item];
|
|
61900
|
+
}
|
|
61901
|
+
else {
|
|
61902
|
+
singleLineItems.push(item);
|
|
61711
61903
|
}
|
|
61712
61904
|
});
|
|
61713
|
-
|
|
61905
|
+
allItems.push(singleLineItems);
|
|
61906
|
+
if (isMiddle) {
|
|
61907
|
+
adjustItemsToCenter(allItems, true, limitHeight);
|
|
61908
|
+
}
|
|
61909
|
+
layout.leftCurrent = preLeft + maxWidth;
|
|
61910
|
+
}
|
|
61911
|
+
}
|
|
61912
|
+
function layoutTopStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
|
|
61913
|
+
if (items.length) {
|
|
61714
61914
|
let maxHeight = 0;
|
|
61715
|
-
preLeft =
|
|
61716
|
-
preTop =
|
|
61717
|
-
|
|
61718
|
-
|
|
61915
|
+
let preLeft = layout.leftCurrent;
|
|
61916
|
+
let preTop = layout.topCurrent;
|
|
61917
|
+
const allItems = [];
|
|
61918
|
+
let singleLineItems = [];
|
|
61919
|
+
items.forEach(item => {
|
|
61920
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61719
61921
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61720
61922
|
item.setLayoutRect(rect);
|
|
61721
61923
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
@@ -61727,72 +61929,314 @@
|
|
|
61727
61929
|
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
61728
61930
|
preLeft += itemTotalWidth;
|
|
61729
61931
|
if (preLeft > limitWidth) {
|
|
61730
|
-
preLeft =
|
|
61932
|
+
preLeft = layout.leftCurrent + itemTotalWidth;
|
|
61731
61933
|
preTop += maxHeight;
|
|
61732
61934
|
maxHeight = itemTotalHeight;
|
|
61733
61935
|
item.setLayoutStartPosition({
|
|
61734
|
-
x:
|
|
61936
|
+
x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61735
61937
|
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
61736
61938
|
});
|
|
61939
|
+
allItems.push(singleLineItems);
|
|
61940
|
+
singleLineItems = [item];
|
|
61941
|
+
}
|
|
61942
|
+
else {
|
|
61943
|
+
singleLineItems.push(item);
|
|
61737
61944
|
}
|
|
61738
61945
|
});
|
|
61739
|
-
|
|
61740
|
-
|
|
61741
|
-
|
|
61742
|
-
|
|
61743
|
-
|
|
61744
|
-
|
|
61946
|
+
allItems.push(singleLineItems);
|
|
61947
|
+
if (isMiddle) {
|
|
61948
|
+
adjustItemsToCenter(allItems, false, limitWidth);
|
|
61949
|
+
}
|
|
61950
|
+
layout.topCurrent = preTop + maxHeight;
|
|
61951
|
+
}
|
|
61952
|
+
}
|
|
61953
|
+
function layoutBottomStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
|
|
61954
|
+
if (items.length) {
|
|
61955
|
+
let maxHeight = 0;
|
|
61956
|
+
let preLeft = layout.leftCurrent;
|
|
61957
|
+
let preBottom = layout.bottomCurrent;
|
|
61958
|
+
const allItems = [];
|
|
61959
|
+
let singleLineItems = [];
|
|
61960
|
+
items.forEach(item => {
|
|
61961
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61745
61962
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61746
61963
|
item.setLayoutRect(rect);
|
|
61747
61964
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61748
61965
|
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61749
61966
|
item.setLayoutStartPosition({
|
|
61750
|
-
x:
|
|
61751
|
-
y:
|
|
61967
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61968
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61752
61969
|
});
|
|
61753
|
-
|
|
61754
|
-
|
|
61755
|
-
if (
|
|
61970
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
61971
|
+
preLeft += itemTotalWidth;
|
|
61972
|
+
if (preLeft > limitWidth) {
|
|
61973
|
+
allItems.push(singleLineItems);
|
|
61974
|
+
preLeft = layout.leftCurrent + itemTotalWidth;
|
|
61975
|
+
preBottom -= maxHeight;
|
|
61976
|
+
maxHeight = itemTotalHeight;
|
|
61977
|
+
item.setLayoutStartPosition({
|
|
61978
|
+
x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61979
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61980
|
+
});
|
|
61981
|
+
singleLineItems = [item];
|
|
61982
|
+
}
|
|
61983
|
+
else {
|
|
61984
|
+
singleLineItems.push(item);
|
|
61985
|
+
}
|
|
61986
|
+
});
|
|
61987
|
+
allItems.push(singleLineItems);
|
|
61988
|
+
if (isMiddle) {
|
|
61989
|
+
adjustItemsToCenter(allItems, false, limitWidth);
|
|
61990
|
+
}
|
|
61991
|
+
layout.bottomCurrent = preBottom - maxHeight;
|
|
61992
|
+
}
|
|
61993
|
+
}
|
|
61994
|
+
function layoutLeftInlineItems(items, layout, limitHeight) {
|
|
61995
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
61996
|
+
if (startItems.length) {
|
|
61997
|
+
layoutLeftStartOrMiddleItems(startItems, layout, limitHeight, false);
|
|
61998
|
+
}
|
|
61999
|
+
if (middleItems.length) {
|
|
62000
|
+
layoutLeftStartOrMiddleItems(middleItems, layout, limitHeight, true);
|
|
62001
|
+
}
|
|
62002
|
+
if (endItems.length) {
|
|
62003
|
+
let maxWidth = 0;
|
|
62004
|
+
let preLeft = layout.leftCurrent;
|
|
62005
|
+
let preBottom = layout.bottomCurrent;
|
|
62006
|
+
endItems.forEach(item => {
|
|
62007
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62008
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62009
|
+
item.setLayoutRect(rect);
|
|
62010
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62011
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62012
|
+
if (preBottom < itemTotalHeight) {
|
|
62013
|
+
preLeft += maxWidth;
|
|
62014
|
+
maxWidth = itemTotalWidth;
|
|
62015
|
+
preBottom = layout.bottomCurrent;
|
|
62016
|
+
item.setLayoutStartPosition({
|
|
62017
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62018
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62019
|
+
});
|
|
62020
|
+
}
|
|
62021
|
+
else {
|
|
62022
|
+
item.setLayoutStartPosition({
|
|
62023
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62024
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62025
|
+
});
|
|
62026
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
62027
|
+
preBottom -= itemTotalHeight;
|
|
62028
|
+
}
|
|
62029
|
+
});
|
|
62030
|
+
layout.leftCurrent = preLeft + maxWidth;
|
|
62031
|
+
}
|
|
62032
|
+
}
|
|
62033
|
+
function layoutRightInlineItems(items, layout, limitHeight) {
|
|
62034
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62035
|
+
if (startItems.length) {
|
|
62036
|
+
layoutRightStartOrMiddleItems(startItems, layout, limitHeight, false);
|
|
62037
|
+
}
|
|
62038
|
+
if (middleItems.length) {
|
|
62039
|
+
layoutRightStartOrMiddleItems(middleItems, layout, limitHeight, true);
|
|
62040
|
+
}
|
|
62041
|
+
if (endItems.length) {
|
|
62042
|
+
let maxWidth = 0;
|
|
62043
|
+
let preRight = layout.rightCurrent;
|
|
62044
|
+
let preBottom = layout.bottomCurrent;
|
|
62045
|
+
endItems.forEach(item => {
|
|
62046
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62047
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62048
|
+
item.setLayoutRect(rect);
|
|
62049
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62050
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62051
|
+
if (preBottom < itemTotalHeight) {
|
|
61756
62052
|
preRight -= maxWidth;
|
|
61757
62053
|
maxWidth = itemTotalWidth;
|
|
61758
|
-
|
|
62054
|
+
preBottom = layout.bottomCurrent;
|
|
61759
62055
|
item.setLayoutStartPosition({
|
|
61760
62056
|
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61761
|
-
y:
|
|
62057
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61762
62058
|
});
|
|
61763
62059
|
}
|
|
62060
|
+
else {
|
|
62061
|
+
item.setLayoutStartPosition({
|
|
62062
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62063
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62064
|
+
});
|
|
62065
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
62066
|
+
preBottom -= itemTotalHeight;
|
|
62067
|
+
}
|
|
61764
62068
|
});
|
|
61765
|
-
|
|
61766
|
-
|
|
61767
|
-
|
|
61768
|
-
|
|
61769
|
-
|
|
61770
|
-
|
|
62069
|
+
layout.rightCurrent = preRight - maxWidth;
|
|
62070
|
+
}
|
|
62071
|
+
}
|
|
62072
|
+
function layoutTopInlineItems(items, layout, limitWidth) {
|
|
62073
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62074
|
+
if (startItems.length) {
|
|
62075
|
+
layoutTopStartOrMiddleItems(startItems, layout, limitWidth, false);
|
|
62076
|
+
}
|
|
62077
|
+
if (middleItems.length) {
|
|
62078
|
+
layoutTopStartOrMiddleItems(middleItems, layout, limitWidth, true);
|
|
62079
|
+
}
|
|
62080
|
+
if (endItems.length) {
|
|
62081
|
+
let maxHeight = 0;
|
|
62082
|
+
let preTop = layout.topCurrent;
|
|
62083
|
+
let preRight = layout.rightCurrent;
|
|
62084
|
+
endItems.forEach(item => {
|
|
62085
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61771
62086
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61772
62087
|
item.setLayoutRect(rect);
|
|
61773
62088
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61774
62089
|
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61775
|
-
|
|
61776
|
-
|
|
61777
|
-
|
|
61778
|
-
|
|
61779
|
-
|
|
61780
|
-
|
|
61781
|
-
|
|
61782
|
-
|
|
62090
|
+
if (preRight < itemTotalWidth) {
|
|
62091
|
+
preRight = layout.rightCurrent;
|
|
62092
|
+
preTop += maxHeight;
|
|
62093
|
+
maxHeight = itemTotalHeight;
|
|
62094
|
+
item.setLayoutStartPosition({
|
|
62095
|
+
x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62096
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
62097
|
+
});
|
|
62098
|
+
}
|
|
62099
|
+
else {
|
|
62100
|
+
item.setLayoutStartPosition({
|
|
62101
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62102
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
62103
|
+
});
|
|
62104
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
62105
|
+
preRight -= itemTotalWidth;
|
|
62106
|
+
}
|
|
62107
|
+
});
|
|
62108
|
+
layout.topCurrent = preTop + maxHeight;
|
|
62109
|
+
}
|
|
62110
|
+
}
|
|
62111
|
+
function layoutBottomInlineItems(items, layout, limitWidth) {
|
|
62112
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62113
|
+
if (startItems.length) {
|
|
62114
|
+
layoutBottomStartOrMiddleItems(startItems, layout, limitWidth, false);
|
|
62115
|
+
}
|
|
62116
|
+
if (middleItems.length) {
|
|
62117
|
+
layoutBottomStartOrMiddleItems(middleItems, layout, limitWidth, true);
|
|
62118
|
+
}
|
|
62119
|
+
if (endItems.length) {
|
|
62120
|
+
let maxHeight = 0;
|
|
62121
|
+
let preBottom = layout.bottomCurrent;
|
|
62122
|
+
let preRight = layout.rightCurrent;
|
|
62123
|
+
endItems.forEach(item => {
|
|
62124
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62125
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62126
|
+
item.setLayoutRect(rect);
|
|
62127
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62128
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62129
|
+
if (preRight < itemTotalWidth) {
|
|
62130
|
+
preRight = layout.rightCurrent;
|
|
61783
62131
|
preBottom -= maxHeight;
|
|
61784
62132
|
maxHeight = itemTotalHeight;
|
|
61785
62133
|
item.setLayoutStartPosition({
|
|
61786
|
-
x:
|
|
62134
|
+
x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61787
62135
|
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61788
62136
|
});
|
|
61789
62137
|
}
|
|
62138
|
+
else {
|
|
62139
|
+
item.setLayoutStartPosition({
|
|
62140
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62141
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62142
|
+
});
|
|
62143
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
62144
|
+
preRight -= itemTotalWidth;
|
|
62145
|
+
}
|
|
61790
62146
|
});
|
|
61791
|
-
|
|
62147
|
+
layout.bottomCurrent = preBottom - maxHeight;
|
|
62148
|
+
}
|
|
62149
|
+
}
|
|
62150
|
+
|
|
62151
|
+
class Layout {
|
|
62152
|
+
constructor(_spec, ctx) {
|
|
62153
|
+
this.leftCurrent = 0;
|
|
62154
|
+
this.topCurrent = 0;
|
|
62155
|
+
this.rightCurrent = 0;
|
|
62156
|
+
this.bottomCurrent = 0;
|
|
62157
|
+
this._onError = ctx === null || ctx === void 0 ? void 0 : ctx.onError;
|
|
62158
|
+
}
|
|
62159
|
+
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
62160
|
+
this._chartLayoutRect = chartLayoutRect;
|
|
62161
|
+
this._chartViewBox = chartViewBox;
|
|
62162
|
+
this.leftCurrent = chartLayoutRect.x;
|
|
62163
|
+
this.topCurrent = chartLayoutRect.y;
|
|
62164
|
+
this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
62165
|
+
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
62166
|
+
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
62167
|
+
this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
|
|
62168
|
+
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
62169
|
+
const layoutTemp = {
|
|
62170
|
+
leftCurrent: this.leftCurrent,
|
|
62171
|
+
topCurrent: this.topCurrent,
|
|
62172
|
+
rightCurrent: this.rightCurrent,
|
|
62173
|
+
bottomCurrent: this.bottomCurrent
|
|
62174
|
+
};
|
|
62175
|
+
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
62176
|
+
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
62177
|
+
this.layoutRegionItems(regionItems, relativeItems);
|
|
62178
|
+
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
62179
|
+
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
62180
|
+
if (top || bottom || left || right) {
|
|
62181
|
+
this.topCurrent = layoutTemp.topCurrent + top;
|
|
62182
|
+
this.bottomCurrent = layoutTemp.bottomCurrent - bottom;
|
|
62183
|
+
this.leftCurrent = layoutTemp.leftCurrent + left;
|
|
62184
|
+
this.rightCurrent = layoutTemp.rightCurrent - right;
|
|
62185
|
+
this.layoutRegionItems(regionItems, relativeItems);
|
|
62186
|
+
}
|
|
62187
|
+
}
|
|
62188
|
+
this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));
|
|
62189
|
+
}
|
|
62190
|
+
layoutNormalItems(normalItems) {
|
|
62191
|
+
normalItems.forEach(item => {
|
|
62192
|
+
const layoutRect = this.getItemComputeLayoutRect(item);
|
|
62193
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62194
|
+
item.setLayoutRect(rect);
|
|
62195
|
+
if (item.layoutOrient === 'left') {
|
|
62196
|
+
item.setLayoutStartPosition({
|
|
62197
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62198
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62199
|
+
});
|
|
62200
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62201
|
+
}
|
|
62202
|
+
else if (item.layoutOrient === 'top') {
|
|
62203
|
+
item.setLayoutStartPosition({
|
|
62204
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62205
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62206
|
+
});
|
|
62207
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62208
|
+
}
|
|
62209
|
+
else if (item.layoutOrient === 'right') {
|
|
62210
|
+
item.setLayoutStartPosition({
|
|
62211
|
+
x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62212
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62213
|
+
});
|
|
62214
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62215
|
+
}
|
|
62216
|
+
else if (item.layoutOrient === 'bottom') {
|
|
62217
|
+
item.setLayoutStartPosition({
|
|
62218
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
|
|
62219
|
+
y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62220
|
+
});
|
|
62221
|
+
this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62222
|
+
}
|
|
62223
|
+
});
|
|
62224
|
+
}
|
|
62225
|
+
layoutNormalInlineItems(normalItems) {
|
|
62226
|
+
const leftItems = normalItems.filter(item => item.layoutOrient === 'left');
|
|
62227
|
+
const rightItems = normalItems.filter(item => item.layoutOrient === 'right');
|
|
62228
|
+
const topItems = normalItems.filter(item => item.layoutOrient === 'top');
|
|
62229
|
+
const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
|
|
62230
|
+
const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
|
|
62231
|
+
const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
|
|
62232
|
+
layoutLeftInlineItems(leftItems, this, limitHeight);
|
|
62233
|
+
layoutTopInlineItems(topItems, this, limitWidth);
|
|
62234
|
+
layoutRightInlineItems(rightItems, this, limitHeight);
|
|
62235
|
+
layoutBottomInlineItems(bottomItems, this, limitWidth);
|
|
61792
62236
|
}
|
|
61793
62237
|
layoutRegionItems(regionItems, regionRelativeItems) {
|
|
61794
|
-
let regionRelativeTotalWidth = this.
|
|
61795
|
-
let regionRelativeTotalHeight = this.
|
|
62238
|
+
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
62239
|
+
let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
61796
62240
|
regionRelativeItems
|
|
61797
62241
|
.filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')
|
|
61798
62242
|
.forEach(item => {
|
|
@@ -61801,18 +62245,18 @@
|
|
|
61801
62245
|
item.setLayoutRect({ width: rect.width });
|
|
61802
62246
|
if (item.layoutOrient === 'left') {
|
|
61803
62247
|
item.setLayoutStartPosition({
|
|
61804
|
-
x: this.
|
|
62248
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61805
62249
|
});
|
|
61806
|
-
this.
|
|
62250
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61807
62251
|
}
|
|
61808
62252
|
else if (item.layoutOrient === 'right') {
|
|
61809
|
-
this.
|
|
62253
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61810
62254
|
item.setLayoutStartPosition({
|
|
61811
|
-
x: this.
|
|
62255
|
+
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61812
62256
|
});
|
|
61813
62257
|
}
|
|
61814
62258
|
});
|
|
61815
|
-
regionRelativeTotalWidth = this.
|
|
62259
|
+
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
61816
62260
|
regionRelativeItems
|
|
61817
62261
|
.filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
|
|
61818
62262
|
.forEach(item => {
|
|
@@ -61821,26 +62265,28 @@
|
|
|
61821
62265
|
item.setLayoutRect({ height: rect.height });
|
|
61822
62266
|
if (item.layoutOrient === 'top') {
|
|
61823
62267
|
item.setLayoutStartPosition({
|
|
61824
|
-
y: this.
|
|
62268
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61825
62269
|
});
|
|
61826
|
-
this.
|
|
62270
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61827
62271
|
}
|
|
61828
62272
|
else if (item.layoutOrient === 'bottom') {
|
|
61829
|
-
this.
|
|
62273
|
+
this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61830
62274
|
item.setLayoutStartPosition({
|
|
61831
|
-
y: this.
|
|
62275
|
+
y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61832
62276
|
});
|
|
61833
62277
|
}
|
|
61834
62278
|
});
|
|
61835
|
-
regionRelativeTotalHeight = this.
|
|
62279
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
62280
|
+
const regionWidth = Math.min(regionRelativeTotalWidth, ...regionItems.map(region => { var _a, _b; return (_b = (_a = region.getMaxWidth) === null || _a === void 0 ? void 0 : _a.call(region)) !== null && _b !== void 0 ? _b : Number.MAX_VALUE; }));
|
|
62281
|
+
const regionHeight = Math.min(regionRelativeTotalHeight, ...regionItems.map(region => { var _a, _b; return (_b = (_a = region.getMaxHeight) === null || _a === void 0 ? void 0 : _a.call(region)) !== null && _b !== void 0 ? _b : Number.MAX_VALUE; }));
|
|
61836
62282
|
regionItems.forEach(region => {
|
|
61837
62283
|
region.setLayoutRect({
|
|
61838
|
-
width:
|
|
61839
|
-
height:
|
|
62284
|
+
width: regionWidth,
|
|
62285
|
+
height: regionHeight
|
|
61840
62286
|
});
|
|
61841
62287
|
region.setLayoutStartPosition({
|
|
61842
|
-
x: this.
|
|
61843
|
-
y: this.
|
|
62288
|
+
x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
|
|
62289
|
+
y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
|
|
61844
62290
|
});
|
|
61845
62291
|
});
|
|
61846
62292
|
regionRelativeItems.forEach(item => {
|
|
@@ -61852,6 +62298,11 @@
|
|
|
61852
62298
|
item.setLayoutStartPosition({
|
|
61853
62299
|
y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop
|
|
61854
62300
|
});
|
|
62301
|
+
if (item.layoutOrient === 'right') {
|
|
62302
|
+
item.setLayoutStartPosition({
|
|
62303
|
+
x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth
|
|
62304
|
+
});
|
|
62305
|
+
}
|
|
61855
62306
|
}
|
|
61856
62307
|
else if (['top', 'bottom'].includes(item.layoutOrient)) {
|
|
61857
62308
|
const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);
|
|
@@ -61861,6 +62312,11 @@
|
|
|
61861
62312
|
item.setLayoutStartPosition({
|
|
61862
62313
|
x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61863
62314
|
});
|
|
62315
|
+
if (item.layoutOrient === 'bottom') {
|
|
62316
|
+
item.setLayoutStartPosition({
|
|
62317
|
+
y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight
|
|
62318
|
+
});
|
|
62319
|
+
}
|
|
61864
62320
|
}
|
|
61865
62321
|
});
|
|
61866
62322
|
}
|
|
@@ -61879,8 +62335,8 @@
|
|
|
61879
62335
|
}
|
|
61880
62336
|
getItemComputeLayoutRect(item) {
|
|
61881
62337
|
const result = {
|
|
61882
|
-
width: this.
|
|
61883
|
-
height: this.
|
|
62338
|
+
width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,
|
|
62339
|
+
height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom
|
|
61884
62340
|
};
|
|
61885
62341
|
return result;
|
|
61886
62342
|
}
|
|
@@ -61891,8 +62347,8 @@
|
|
|
61891
62347
|
bottom: 0,
|
|
61892
62348
|
right: 0
|
|
61893
62349
|
};
|
|
61894
|
-
const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this.
|
|
61895
|
-
const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this.
|
|
62350
|
+
const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this.rightCurrent;
|
|
62351
|
+
const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this.bottomCurrent;
|
|
61896
62352
|
items.forEach(i => {
|
|
61897
62353
|
if (!i.getVisible() || !i.getAutoIndent()) {
|
|
61898
62354
|
return;
|
|
@@ -61900,11 +62356,11 @@
|
|
|
61900
62356
|
const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';
|
|
61901
62357
|
const outer = i.getLastComputeOutBounds();
|
|
61902
62358
|
if (vOrH) {
|
|
61903
|
-
result.top = Math.max(result.top, outer.y1 - this.
|
|
62359
|
+
result.top = Math.max(result.top, outer.y1 - this.topCurrent);
|
|
61904
62360
|
result.bottom = Math.max(result.bottom, outer.y2 - bottomCurrent);
|
|
61905
62361
|
}
|
|
61906
62362
|
else {
|
|
61907
|
-
result.left = Math.max(result.left, outer.x1 - this.
|
|
62363
|
+
result.left = Math.max(result.left, outer.x1 - this.leftCurrent);
|
|
61908
62364
|
result.right = Math.max(result.right, outer.x2 - rightCurrent);
|
|
61909
62365
|
}
|
|
61910
62366
|
});
|
|
@@ -62224,6 +62680,9 @@
|
|
|
62224
62680
|
}
|
|
62225
62681
|
}
|
|
62226
62682
|
|
|
62683
|
+
const keptInUpdateAttribute = {
|
|
62684
|
+
defined: true
|
|
62685
|
+
};
|
|
62227
62686
|
class CompilableMark extends GrammarItem {
|
|
62228
62687
|
getSupport3d() {
|
|
62229
62688
|
return this._support3d;
|
|
@@ -62440,6 +62899,9 @@
|
|
|
62440
62899
|
dependency: [this.stateKeyToSignalName('markUpdateRank')]
|
|
62441
62900
|
};
|
|
62442
62901
|
}
|
|
62902
|
+
else if (keptInUpdateAttribute[key]) {
|
|
62903
|
+
updateStyles[key] = normalStyle[key].style;
|
|
62904
|
+
}
|
|
62443
62905
|
else {
|
|
62444
62906
|
enterStyles[key] = this.compileCommonAttributeCallback(key, 'normal');
|
|
62445
62907
|
}
|
|
@@ -62858,7 +63320,7 @@
|
|
|
62858
63320
|
computeColor = color(data, this._attributeContext, opt, markData);
|
|
62859
63321
|
}
|
|
62860
63322
|
if (isValid$1(opacity)) {
|
|
62861
|
-
computeColor = Color.SetOpacity(computeColor, opacity);
|
|
63323
|
+
computeColor = Color$1.SetOpacity(computeColor, opacity);
|
|
62862
63324
|
}
|
|
62863
63325
|
return {
|
|
62864
63326
|
offset: isFunction$1(offset) ? offset(data, this._attributeContext, opt, markData) : offset,
|
|
@@ -63003,7 +63465,7 @@
|
|
|
63003
63465
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
63004
63466
|
Factory.registerRegion('region', Region);
|
|
63005
63467
|
Factory.registerLayout('base', Layout);
|
|
63006
|
-
const version = "1.
|
|
63468
|
+
const version = "1.5.0";
|
|
63007
63469
|
Logger.getInstance(LoggerLevel.Error);
|
|
63008
63470
|
|
|
63009
63471
|
const WordCloud3dAnimation = (params) => {
|
|
@@ -64240,17 +64702,26 @@
|
|
|
64240
64702
|
});
|
|
64241
64703
|
}
|
|
64242
64704
|
encodeDefined(mark, attr) {
|
|
64243
|
-
var _a, _b;
|
|
64705
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64244
64706
|
if (!mark) {
|
|
64245
64707
|
return;
|
|
64246
64708
|
}
|
|
64247
64709
|
const statistics = (_b = (_a = this.getViewDataStatistics()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b[this.getStackValueField()];
|
|
64248
64710
|
if (this._invalidType === 'zero' || (statistics && (statistics === null || statistics === void 0 ? void 0 : statistics.allValid))) {
|
|
64711
|
+
if (((_d = (_c = mark.stateStyle.normal) === null || _c === void 0 ? void 0 : _c[attr]) === null || _d === void 0 ? void 0 : _d.style) === true) {
|
|
64712
|
+
return;
|
|
64713
|
+
}
|
|
64249
64714
|
this.setMarkStyle(mark, { [attr]: true }, 'normal', AttributeLevel.Series);
|
|
64250
64715
|
}
|
|
64251
64716
|
else {
|
|
64717
|
+
if (((_f = (_e = mark.stateStyle.normal) === null || _e === void 0 ? void 0 : _e[attr]) === null || _f === void 0 ? void 0 : _f.style) !== true) {
|
|
64718
|
+
return;
|
|
64719
|
+
}
|
|
64252
64720
|
this.setMarkStyle(mark, { [attr]: this._getInvalidDefined }, 'normal', AttributeLevel.Series);
|
|
64253
64721
|
}
|
|
64722
|
+
if (mark.getProduct()) {
|
|
64723
|
+
mark.compileEncode();
|
|
64724
|
+
}
|
|
64254
64725
|
}
|
|
64255
64726
|
}
|
|
64256
64727
|
|
|
@@ -65250,6 +65721,10 @@
|
|
|
65250
65721
|
getStack() {
|
|
65251
65722
|
return this._stack;
|
|
65252
65723
|
}
|
|
65724
|
+
getStackValue() {
|
|
65725
|
+
var _a;
|
|
65726
|
+
return (_a = this._spec.stackValue) !== null && _a !== void 0 ? _a : `${PREFIX}_series_${this.type}`;
|
|
65727
|
+
}
|
|
65253
65728
|
getPercent() {
|
|
65254
65729
|
return this._percent;
|
|
65255
65730
|
}
|
|
@@ -65343,6 +65818,9 @@
|
|
|
65343
65818
|
this._stackOffsetSilhouette = this._spec.stackOffsetSilhouette;
|
|
65344
65819
|
this._stack = this._spec.stackOffsetSilhouette || this._stack;
|
|
65345
65820
|
}
|
|
65821
|
+
if (isValid$1(this._spec.stackValue)) {
|
|
65822
|
+
this._stack = true;
|
|
65823
|
+
}
|
|
65346
65824
|
if (isValid$1(this._spec.invalidType)) {
|
|
65347
65825
|
this._invalidType = this._spec.invalidType;
|
|
65348
65826
|
}
|
|
@@ -65777,8 +66255,8 @@
|
|
|
65777
66255
|
_compareSpec(ignoreCheckKeys) {
|
|
65778
66256
|
var _a, _b;
|
|
65779
66257
|
const result = super._compareSpec();
|
|
65780
|
-
const currentKeys = Object.keys(this._originalSpec).sort();
|
|
65781
|
-
const nextKeys = Object.keys(this._spec).sort();
|
|
66258
|
+
const currentKeys = Object.keys(this._originalSpec || {}).sort();
|
|
66259
|
+
const nextKeys = Object.keys(this._spec || {}).sort();
|
|
65782
66260
|
if (!isEqual$1(currentKeys, nextKeys)) {
|
|
65783
66261
|
result.reMake = true;
|
|
65784
66262
|
return result;
|
|
@@ -67114,27 +67592,23 @@
|
|
|
67114
67592
|
class Stack {
|
|
67115
67593
|
constructor(chart) {
|
|
67116
67594
|
this.stackRegion = ({ model }) => {
|
|
67117
|
-
const
|
|
67118
|
-
|
|
67119
|
-
|
|
67120
|
-
|
|
67121
|
-
const stackData = s.getStackData();
|
|
67122
|
-
const stackValueField = s.getStackValueField();
|
|
67123
|
-
if (stackData && stackValueField) {
|
|
67124
|
-
this.stackGroup(stackData, stackCache, stackValueField);
|
|
67595
|
+
const stackValueGroup = getRegionStackGroup(model, true);
|
|
67596
|
+
for (const stackValue in stackValueGroup) {
|
|
67597
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
67598
|
+
stack(stackValueGroup[stackValue].nodes[key], model.getStackInverse());
|
|
67125
67599
|
}
|
|
67126
|
-
});
|
|
67127
|
-
for (const key in stackCache.nodes) {
|
|
67128
|
-
this.stack(stackCache.nodes[key]);
|
|
67129
67600
|
}
|
|
67130
|
-
for (const
|
|
67131
|
-
|
|
67601
|
+
for (const stackValue in stackValueGroup) {
|
|
67602
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
67603
|
+
stackOffsetSilhouette(stackValueGroup[stackValue].nodes[key]);
|
|
67604
|
+
}
|
|
67132
67605
|
}
|
|
67133
67606
|
model.getSeries().forEach(s => {
|
|
67134
67607
|
const stackData = s.getStackData();
|
|
67608
|
+
const stackValue = s.getStackValue();
|
|
67135
67609
|
const stackValueField = s.getStackValueField();
|
|
67136
67610
|
if (stackData && stackValueField) {
|
|
67137
|
-
|
|
67611
|
+
stackTotal(stackValueGroup[stackValue], stackValueField);
|
|
67138
67612
|
}
|
|
67139
67613
|
});
|
|
67140
67614
|
};
|
|
@@ -67150,81 +67624,6 @@
|
|
|
67150
67624
|
this.stackRegion({ model: r });
|
|
67151
67625
|
});
|
|
67152
67626
|
}
|
|
67153
|
-
stackTotal(stackData, valueField) {
|
|
67154
|
-
if ('values' in stackData && stackData.values.length) {
|
|
67155
|
-
const total = sum(stackData.values, valueField);
|
|
67156
|
-
const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
|
|
67157
|
-
stackData.values.forEach(v => {
|
|
67158
|
-
v[STACK_FIELD_TOTAL] = total;
|
|
67159
|
-
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
67160
|
-
delete v[STACK_FIELD_TOTAL_TOP];
|
|
67161
|
-
});
|
|
67162
|
-
const maxNode = stackData.values.reduce((max, current) => {
|
|
67163
|
-
return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
|
|
67164
|
-
});
|
|
67165
|
-
maxNode[STACK_FIELD_TOTAL_TOP] = true;
|
|
67166
|
-
return;
|
|
67167
|
-
}
|
|
67168
|
-
for (const key in stackData.nodes) {
|
|
67169
|
-
this.stackTotal(stackData.nodes[key], valueField);
|
|
67170
|
-
}
|
|
67171
|
-
}
|
|
67172
|
-
stackOffsetSilhouette(stackCache) {
|
|
67173
|
-
if (!stackCache.values.length) {
|
|
67174
|
-
return;
|
|
67175
|
-
}
|
|
67176
|
-
const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
|
|
67177
|
-
for (let j = 0; j < stackCache.values.length; j++) {
|
|
67178
|
-
stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
|
|
67179
|
-
stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
|
|
67180
|
-
}
|
|
67181
|
-
}
|
|
67182
|
-
stack(stackCache) {
|
|
67183
|
-
if (stackCache.values.length > 0) {
|
|
67184
|
-
let positiveStart = 0;
|
|
67185
|
-
let negativeStart = 0;
|
|
67186
|
-
let sign = 1;
|
|
67187
|
-
let value = 0;
|
|
67188
|
-
stackCache.values.forEach(v => {
|
|
67189
|
-
value = v[STACK_FIELD_END];
|
|
67190
|
-
if (value >= 0) {
|
|
67191
|
-
v[STACK_FIELD_START] = positiveStart;
|
|
67192
|
-
positiveStart += v[STACK_FIELD_END];
|
|
67193
|
-
v[STACK_FIELD_END] = positiveStart;
|
|
67194
|
-
}
|
|
67195
|
-
else {
|
|
67196
|
-
v[STACK_FIELD_START] = negativeStart;
|
|
67197
|
-
negativeStart += v[STACK_FIELD_END];
|
|
67198
|
-
v[STACK_FIELD_END] = negativeStart;
|
|
67199
|
-
}
|
|
67200
|
-
});
|
|
67201
|
-
stackCache.values.forEach(v => {
|
|
67202
|
-
value = v[STACK_FIELD_END];
|
|
67203
|
-
const denominator = value >= 0 ? positiveStart : negativeStart;
|
|
67204
|
-
sign = value >= 0 ? 1 : -1;
|
|
67205
|
-
v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
|
|
67206
|
-
v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
|
|
67207
|
-
});
|
|
67208
|
-
}
|
|
67209
|
-
for (const key in stackCache.nodes) {
|
|
67210
|
-
this.stack(stackCache.nodes[key]);
|
|
67211
|
-
}
|
|
67212
|
-
}
|
|
67213
|
-
stackGroup(stackData, stackCache, valueField) {
|
|
67214
|
-
if ('values' in stackData) {
|
|
67215
|
-
stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
|
|
67216
|
-
stackCache.values.push(...stackData.values);
|
|
67217
|
-
return;
|
|
67218
|
-
}
|
|
67219
|
-
for (const key in stackData.nodes) {
|
|
67220
|
-
!stackCache.nodes[key] &&
|
|
67221
|
-
(stackCache.nodes[key] = {
|
|
67222
|
-
values: [],
|
|
67223
|
-
nodes: {}
|
|
67224
|
-
});
|
|
67225
|
-
this.stackGroup(stackData.nodes[key], stackCache.nodes[key], valueField);
|
|
67226
|
-
}
|
|
67227
|
-
}
|
|
67228
67627
|
}
|
|
67229
67628
|
|
|
67230
67629
|
class BaseChart extends CompilableBase {
|
|
@@ -67413,6 +67812,9 @@
|
|
|
67413
67812
|
if (!has$2(spec, 'tooltip')) {
|
|
67414
67813
|
spec.tooltip = {};
|
|
67415
67814
|
}
|
|
67815
|
+
if (isValid$1(spec.stackInverse)) {
|
|
67816
|
+
spec.region.forEach((r) => !isValid$1(r.stackInverse) && (r.stackInverse = spec.stackInverse));
|
|
67817
|
+
}
|
|
67416
67818
|
}
|
|
67417
67819
|
init(options = {}) {
|
|
67418
67820
|
this.initRegion();
|
|
@@ -68363,6 +68765,48 @@
|
|
|
68363
68765
|
}
|
|
68364
68766
|
RectMark.type = MarkTypeEnum.rect;
|
|
68365
68767
|
|
|
68768
|
+
function stackWithMinHeight(stackCache, stackInverse, context) {
|
|
68769
|
+
if (stackCache.values.length > 0) {
|
|
68770
|
+
let seriesInfo = stackCache.series;
|
|
68771
|
+
if (stackInverse) {
|
|
68772
|
+
seriesInfo = [...seriesInfo].reverse();
|
|
68773
|
+
}
|
|
68774
|
+
let lastY;
|
|
68775
|
+
seriesInfo.forEach(({ s, values }, sIndex) => {
|
|
68776
|
+
var _a, _b;
|
|
68777
|
+
const barMinHeight = s.getSpec().barMinHeight;
|
|
68778
|
+
const seriesScale = (_b = (_a = s[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
68779
|
+
const inverse = s[context.axisHelper].isInverse();
|
|
68780
|
+
for (let index = 0; index < values.length; index++) {
|
|
68781
|
+
const obj = values[stackInverse ? values.length - 1 - index : index];
|
|
68782
|
+
const y1 = valueInScaleRange(s[context.startMethod](obj), seriesScale);
|
|
68783
|
+
let y = valueInScaleRange(s[context.endMethod](obj), seriesScale);
|
|
68784
|
+
if (index === 0 && sIndex === 0) {
|
|
68785
|
+
lastY = y1;
|
|
68786
|
+
}
|
|
68787
|
+
let height = Math.abs(y1 - y);
|
|
68788
|
+
if (height < barMinHeight) {
|
|
68789
|
+
height = barMinHeight;
|
|
68790
|
+
}
|
|
68791
|
+
let flag = 1;
|
|
68792
|
+
if (y < y1) {
|
|
68793
|
+
flag = -1;
|
|
68794
|
+
}
|
|
68795
|
+
else if (y === y1) {
|
|
68796
|
+
flag = context.isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
|
|
68797
|
+
}
|
|
68798
|
+
y = lastY + flag * height;
|
|
68799
|
+
obj[context.start] = lastY;
|
|
68800
|
+
obj[context.end] = y;
|
|
68801
|
+
lastY = y;
|
|
68802
|
+
}
|
|
68803
|
+
});
|
|
68804
|
+
}
|
|
68805
|
+
for (const key in stackCache.nodes) {
|
|
68806
|
+
stackWithMinHeight(stackCache.nodes[key], stackInverse, context);
|
|
68807
|
+
}
|
|
68808
|
+
}
|
|
68809
|
+
|
|
68366
68810
|
VChart.useMark([RectMark, TextMark]);
|
|
68367
68811
|
const DefaultBandWidth$2 = 6;
|
|
68368
68812
|
const RECT_X = `${PREFIX}_rect_x`;
|
|
@@ -68456,61 +68900,19 @@
|
|
|
68456
68900
|
endMethod = 'dataToPositionX';
|
|
68457
68901
|
axisHelper = '_xAxisHelper';
|
|
68458
68902
|
}
|
|
68459
|
-
const
|
|
68460
|
-
const
|
|
68461
|
-
|
|
68462
|
-
|
|
68463
|
-
|
|
68464
|
-
|
|
68465
|
-
|
|
68466
|
-
|
|
68467
|
-
|
|
68468
|
-
|
|
68469
|
-
|
|
68470
|
-
|
|
68471
|
-
|
|
68472
|
-
obj.seriesId = seriesId;
|
|
68473
|
-
groupedStackData[currentKey].push(obj);
|
|
68474
|
-
});
|
|
68475
|
-
}
|
|
68476
|
-
});
|
|
68477
|
-
};
|
|
68478
|
-
barSeriesArr.forEach(s => {
|
|
68479
|
-
const stackData = s.getStackData();
|
|
68480
|
-
iterateStackData(stackData, '', s.id);
|
|
68481
|
-
});
|
|
68482
|
-
Object.keys(groupedStackData).forEach(key => {
|
|
68483
|
-
const values = groupedStackData[key];
|
|
68484
|
-
values.sort((a, b) => Math.abs(a[STACK_FIELD_START]) - Math.abs(b[STACK_FIELD_START]));
|
|
68485
|
-
let lastY;
|
|
68486
|
-
values.forEach((obj, index) => {
|
|
68487
|
-
var _a, _b;
|
|
68488
|
-
const series = barSeriesArr.find(s => s.id === obj.seriesId);
|
|
68489
|
-
const barMinHeight = series.getSpec().barMinHeight;
|
|
68490
|
-
const seriesScale = (_b = (_a = series[axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
68491
|
-
const inverse = series[axisHelper].isInverse();
|
|
68492
|
-
const y1 = valueInScaleRange(series[startMethod](obj), seriesScale);
|
|
68493
|
-
let y = valueInScaleRange(series[endMethod](obj), seriesScale);
|
|
68494
|
-
if (index === 0) {
|
|
68495
|
-
lastY = y1;
|
|
68496
|
-
}
|
|
68497
|
-
let height = Math.abs(y1 - y);
|
|
68498
|
-
if (height < barMinHeight) {
|
|
68499
|
-
height = barMinHeight;
|
|
68500
|
-
}
|
|
68501
|
-
let flag = 1;
|
|
68502
|
-
if (y < y1) {
|
|
68503
|
-
flag = -1;
|
|
68504
|
-
}
|
|
68505
|
-
else if (y === y1) {
|
|
68506
|
-
flag = isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
|
|
68507
|
-
}
|
|
68508
|
-
y = lastY + flag * height;
|
|
68509
|
-
obj[start] = lastY;
|
|
68510
|
-
obj[end] = y;
|
|
68511
|
-
lastY = y;
|
|
68512
|
-
});
|
|
68513
|
-
});
|
|
68903
|
+
const stackValueGroup = getRegionStackGroup(region, false, s => s.type === SeriesTypeEnum.bar);
|
|
68904
|
+
for (const stackValue in stackValueGroup) {
|
|
68905
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
68906
|
+
stackWithMinHeight(stackValueGroup[stackValue].nodes[key], region.getStackInverse(), {
|
|
68907
|
+
isVertical,
|
|
68908
|
+
start,
|
|
68909
|
+
end,
|
|
68910
|
+
startMethod,
|
|
68911
|
+
endMethod,
|
|
68912
|
+
axisHelper
|
|
68913
|
+
});
|
|
68914
|
+
}
|
|
68915
|
+
}
|
|
68514
68916
|
}
|
|
68515
68917
|
_calculateRectPosition(datum, isVertical) {
|
|
68516
68918
|
var _a, _b;
|
|
@@ -82999,13 +83401,15 @@
|
|
|
82999
83401
|
return this._container;
|
|
83000
83402
|
}
|
|
83001
83403
|
_compareSpec() {
|
|
83404
|
+
var _a;
|
|
83002
83405
|
const result = super._compareSpec();
|
|
83003
83406
|
if (!result.reMake) {
|
|
83004
83407
|
result.reMake = ['seriesId', 'seriesIndex', 'regionId', 'regionIndex'].some(k => {
|
|
83005
|
-
|
|
83408
|
+
var _a;
|
|
83409
|
+
return isEqual$1((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a[k], this.getSpec()[k]);
|
|
83006
83410
|
});
|
|
83007
83411
|
}
|
|
83008
|
-
if (this._originalSpec.visible !== this.getSpec().visible) {
|
|
83412
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.visible) !== this.getSpec().visible) {
|
|
83009
83413
|
result.reCompile = true;
|
|
83010
83414
|
}
|
|
83011
83415
|
return result;
|
|
@@ -83016,6 +83420,16 @@
|
|
|
83016
83420
|
}
|
|
83017
83421
|
clear() {
|
|
83018
83422
|
var _a;
|
|
83423
|
+
const components = this.getVRenderComponents();
|
|
83424
|
+
if (components && components.length) {
|
|
83425
|
+
components.forEach(c => {
|
|
83426
|
+
var _a;
|
|
83427
|
+
if (c) {
|
|
83428
|
+
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
|
|
83429
|
+
c = null;
|
|
83430
|
+
}
|
|
83431
|
+
});
|
|
83432
|
+
}
|
|
83019
83433
|
this._container = null;
|
|
83020
83434
|
(_a = this.pluginService) === null || _a === void 0 ? void 0 : _a.disposeAll();
|
|
83021
83435
|
this.pluginService = null;
|
|
@@ -83124,7 +83538,7 @@
|
|
|
83124
83538
|
if (this._relatedAxisComponent && this._filterMode === IFilterMode.axis) {
|
|
83125
83539
|
const axisScale = this._relatedAxisComponent.getScale();
|
|
83126
83540
|
const axisSpec = this._relatedAxisComponent.getSpec();
|
|
83127
|
-
if (this._auto) {
|
|
83541
|
+
if (this._auto && this._getAxisBandSize(axisSpec)) {
|
|
83128
83542
|
axisScale.range((_a = this._stateScale) === null || _a === void 0 ? void 0 : _a.range(), true);
|
|
83129
83543
|
}
|
|
83130
83544
|
const newRangeFactor = axisScale.range()[0] < axisScale.range()[1] || axisSpec.inverse
|
|
@@ -83547,15 +83961,23 @@
|
|
|
83547
83961
|
var _a;
|
|
83548
83962
|
(_a = this._component) === null || _a === void 0 ? void 0 : _a.showAll();
|
|
83549
83963
|
}
|
|
83964
|
+
_getAxisBandSize(axisSpec) {
|
|
83965
|
+
const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
|
|
83966
|
+
const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
|
|
83967
|
+
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
83968
|
+
if (bandSize || minBandSize || maxBandSize) {
|
|
83969
|
+
return { bandSize, maxBandSize, minBandSize };
|
|
83970
|
+
}
|
|
83971
|
+
return undefined;
|
|
83972
|
+
}
|
|
83550
83973
|
_autoUpdate(rect) {
|
|
83551
|
-
var _a, _b, _c;
|
|
83974
|
+
var _a, _b, _c, _d;
|
|
83552
83975
|
if (!this._auto) {
|
|
83553
83976
|
return true;
|
|
83554
83977
|
}
|
|
83555
83978
|
const axisSpec = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getSpec();
|
|
83556
|
-
const
|
|
83557
|
-
const maxBandSize =
|
|
83558
|
-
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
83979
|
+
const bandSizeResult = this._getAxisBandSize(axisSpec);
|
|
83980
|
+
const { bandSize, maxBandSize, minBandSize } = bandSizeResult !== null && bandSizeResult !== void 0 ? bandSizeResult : {};
|
|
83559
83981
|
if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.height) &&
|
|
83560
83982
|
(rect === null || rect === void 0 ? void 0 : rect.width) === ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width) &&
|
|
83561
83983
|
this._fixedBandSize === bandSize) {
|
|
@@ -83566,7 +83988,7 @@
|
|
|
83566
83988
|
const scale = this._stateScale;
|
|
83567
83989
|
scale.range(this._isHorizontal ? [0, rect.width] : axisSpec.inverse ? [0, rect.height] : [rect.height, 0]);
|
|
83568
83990
|
if (isDiscrete(scale.type)) {
|
|
83569
|
-
if (
|
|
83991
|
+
if (bandSizeResult) {
|
|
83570
83992
|
if (this._start || this._end) {
|
|
83571
83993
|
scale.rangeFactor([this._start, this._end], true);
|
|
83572
83994
|
}
|
|
@@ -83579,26 +84001,26 @@
|
|
|
83579
84001
|
if (minBandSize) {
|
|
83580
84002
|
scale.minBandwidth(minBandSize, true);
|
|
83581
84003
|
}
|
|
83582
|
-
scale.rescale(
|
|
83583
|
-
|
|
83584
|
-
|
|
83585
|
-
|
|
83586
|
-
|
|
84004
|
+
scale.rescale();
|
|
84005
|
+
}
|
|
84006
|
+
let [start, end] = (_d = scale.rangeFactor()) !== null && _d !== void 0 ? _d : [];
|
|
84007
|
+
if ((!start && !end) || !scale.isBandwidthFixed()) {
|
|
84008
|
+
start = 0;
|
|
84009
|
+
end = 1;
|
|
84010
|
+
this.hide();
|
|
84011
|
+
isShown = false;
|
|
84012
|
+
}
|
|
84013
|
+
else {
|
|
84014
|
+
if (start === 0 && end === 1) {
|
|
83587
84015
|
this.hide();
|
|
83588
84016
|
isShown = false;
|
|
83589
84017
|
}
|
|
83590
84018
|
else {
|
|
83591
|
-
|
|
83592
|
-
this.hide();
|
|
83593
|
-
isShown = false;
|
|
83594
|
-
}
|
|
83595
|
-
else {
|
|
83596
|
-
this.show();
|
|
83597
|
-
}
|
|
84019
|
+
this.show();
|
|
83598
84020
|
}
|
|
83599
|
-
this._start = start;
|
|
83600
|
-
this._end = end;
|
|
83601
84021
|
}
|
|
84022
|
+
this._start = start;
|
|
84023
|
+
this._end = end;
|
|
83602
84024
|
}
|
|
83603
84025
|
this.setStartAndEnd(this._start, this._end);
|
|
83604
84026
|
this._cacheVisibility = isShown;
|
|
@@ -83723,13 +84145,8 @@
|
|
|
83723
84145
|
}
|
|
83724
84146
|
return attrs;
|
|
83725
84147
|
}
|
|
83726
|
-
|
|
83727
|
-
|
|
83728
|
-
if (this._component) {
|
|
83729
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
|
|
83730
|
-
this._component = null;
|
|
83731
|
-
}
|
|
83732
|
-
super.clear();
|
|
84148
|
+
getVRenderComponents() {
|
|
84149
|
+
return [this._component];
|
|
83733
84150
|
}
|
|
83734
84151
|
}
|
|
83735
84152
|
ScrollBar.type = ComponentTypeEnum.scrollBar;
|
|
@@ -84012,13 +84429,8 @@
|
|
|
84012
84429
|
}
|
|
84013
84430
|
};
|
|
84014
84431
|
}
|
|
84015
|
-
|
|
84016
|
-
|
|
84017
|
-
if (this._component) {
|
|
84018
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
|
|
84019
|
-
this._component = null;
|
|
84020
|
-
}
|
|
84021
|
-
super.clear();
|
|
84432
|
+
getVRenderComponents() {
|
|
84433
|
+
return [this._component];
|
|
84022
84434
|
}
|
|
84023
84435
|
}
|
|
84024
84436
|
DataZoom.type = ComponentTypeEnum.dataZoom;
|
|
@@ -84093,6 +84505,9 @@
|
|
|
84093
84505
|
}
|
|
84094
84506
|
changeRegions(regions) {
|
|
84095
84507
|
}
|
|
84508
|
+
getVRenderComponents() {
|
|
84509
|
+
return [];
|
|
84510
|
+
}
|
|
84096
84511
|
onRender(ctx) {
|
|
84097
84512
|
}
|
|
84098
84513
|
}
|
|
@@ -84115,6 +84530,7 @@
|
|
|
84115
84530
|
this._needInitOutState = true;
|
|
84116
84531
|
this._isFirstState = true;
|
|
84117
84532
|
this._cacheInteractiveRangeAttrs = [];
|
|
84533
|
+
this._needEnablePickable = true;
|
|
84118
84534
|
}
|
|
84119
84535
|
static createComponent(spec, options) {
|
|
84120
84536
|
const brushSpec = spec.brush || options.defaultSpec;
|
|
@@ -84187,9 +84603,11 @@
|
|
|
84187
84603
|
}
|
|
84188
84604
|
if (operateType === IOperateType.drawing) {
|
|
84189
84605
|
this._needInitOutState = false;
|
|
84606
|
+
this._needEnablePickable = true;
|
|
84190
84607
|
}
|
|
84191
84608
|
if (operateType === IOperateType.drawEnd) {
|
|
84192
84609
|
this._needInitOutState = true;
|
|
84610
|
+
this._needEnablePickable = false;
|
|
84193
84611
|
}
|
|
84194
84612
|
if (operateType === IOperateType.brushClear) {
|
|
84195
84613
|
this._initMarkBrushState(componentIndex, '');
|
|
@@ -84266,6 +84684,7 @@
|
|
|
84266
84684
|
this._outOfBrushElementsMap[elementKey] = el;
|
|
84267
84685
|
delete this._inBrushElementsMap[operateMask.name][elementKey];
|
|
84268
84686
|
}
|
|
84687
|
+
graphicItem.setAttribute('pickable', !this._needEnablePickable);
|
|
84269
84688
|
});
|
|
84270
84689
|
});
|
|
84271
84690
|
}
|
|
@@ -84300,6 +84719,7 @@
|
|
|
84300
84719
|
graphicItem.addState('outOfBrush');
|
|
84301
84720
|
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
84302
84721
|
}
|
|
84722
|
+
graphicItem.setAttribute('pickable', !this._needEnablePickable);
|
|
84303
84723
|
});
|
|
84304
84724
|
});
|
|
84305
84725
|
}
|
|
@@ -84320,17 +84740,38 @@
|
|
|
84320
84740
|
y: b * p.x + d * p.y + f + dy
|
|
84321
84741
|
};
|
|
84322
84742
|
});
|
|
84323
|
-
|
|
84743
|
+
brushMask.globalAABBBounds
|
|
84324
84744
|
.clone()
|
|
84325
84745
|
.set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
84326
84746
|
const x = item.globalTransMatrix.e;
|
|
84327
84747
|
const y = item.globalTransMatrix.f;
|
|
84748
|
+
let itemBounds = [];
|
|
84328
84749
|
if (item.type === 'symbol') {
|
|
84329
|
-
|
|
84750
|
+
const { size: itemSize = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
|
|
84751
|
+
const size = array(itemSize)[0];
|
|
84752
|
+
itemBounds = [
|
|
84753
|
+
{
|
|
84754
|
+
x: x - size,
|
|
84755
|
+
y: y - size
|
|
84756
|
+
},
|
|
84757
|
+
{
|
|
84758
|
+
x: x + size,
|
|
84759
|
+
y: y - size
|
|
84760
|
+
},
|
|
84761
|
+
{
|
|
84762
|
+
x: x + size,
|
|
84763
|
+
y: y + size
|
|
84764
|
+
},
|
|
84765
|
+
{
|
|
84766
|
+
x: x - size,
|
|
84767
|
+
y: y + size
|
|
84768
|
+
}
|
|
84769
|
+
];
|
|
84770
|
+
return polygonIntersectPolygon(pointsCoord, itemBounds);
|
|
84330
84771
|
}
|
|
84331
84772
|
else if (item.type === 'rect') {
|
|
84332
84773
|
const { width = 0, height = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
|
|
84333
|
-
|
|
84774
|
+
itemBounds = [
|
|
84334
84775
|
{
|
|
84335
84776
|
x: x,
|
|
84336
84777
|
y: y
|
|
@@ -84348,7 +84789,7 @@
|
|
|
84348
84789
|
y: y + height
|
|
84349
84790
|
}
|
|
84350
84791
|
];
|
|
84351
|
-
return polygonIntersectPolygon(pointsCoord,
|
|
84792
|
+
return polygonIntersectPolygon(pointsCoord, itemBounds);
|
|
84352
84793
|
}
|
|
84353
84794
|
return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
|
|
84354
84795
|
}
|
|
@@ -84428,6 +84869,9 @@
|
|
|
84428
84869
|
}
|
|
84429
84870
|
changeRegions(regions) {
|
|
84430
84871
|
}
|
|
84872
|
+
getVRenderComponents() {
|
|
84873
|
+
return this._brushComponents;
|
|
84874
|
+
}
|
|
84431
84875
|
_compareSpec() {
|
|
84432
84876
|
if (this._brushComponents) {
|
|
84433
84877
|
this._relativeRegions.forEach((region, index) => {
|
|
@@ -84980,6 +85424,9 @@
|
|
|
84980
85424
|
}
|
|
84981
85425
|
changeRegions() {
|
|
84982
85426
|
}
|
|
85427
|
+
getVRenderComponents() {
|
|
85428
|
+
return [];
|
|
85429
|
+
}
|
|
84983
85430
|
}
|
|
84984
85431
|
MapLabelComponent.type = ComponentTypeEnum.mapLabel;
|
|
84985
85432
|
MapLabelComponent.speckey = 'mapLabel';
|
|
@@ -85372,6 +85819,9 @@
|
|
|
85372
85819
|
};
|
|
85373
85820
|
this._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
85374
85821
|
}
|
|
85822
|
+
getVRenderComponents() {
|
|
85823
|
+
return [];
|
|
85824
|
+
}
|
|
85375
85825
|
created() {
|
|
85376
85826
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
85377
85827
|
super.created();
|
|
@@ -85485,9 +85935,10 @@
|
|
|
85485
85935
|
}
|
|
85486
85936
|
}
|
|
85487
85937
|
_compareSpec() {
|
|
85938
|
+
var _a, _b;
|
|
85488
85939
|
const result = super._compareSpec();
|
|
85489
85940
|
result.reRender = true;
|
|
85490
|
-
if (this._originalSpec.type !== this._spec.type) {
|
|
85941
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.type) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.type)) {
|
|
85491
85942
|
result.reMake = true;
|
|
85492
85943
|
return result;
|
|
85493
85944
|
}
|
|
@@ -86646,6 +87097,7 @@
|
|
|
86646
87097
|
this.updateFixedWholeLength();
|
|
86647
87098
|
}
|
|
86648
87099
|
updateFixedWholeLength() {
|
|
87100
|
+
var _a;
|
|
86649
87101
|
if (this._scale) {
|
|
86650
87102
|
if (this._spec.bandSize) {
|
|
86651
87103
|
this._scale.bandwidth(this._spec.bandSize);
|
|
@@ -86656,6 +87108,17 @@
|
|
|
86656
87108
|
if (this._spec.minBandSize) {
|
|
86657
87109
|
this._scale.minBandwidth(this._spec.minBandSize);
|
|
86658
87110
|
}
|
|
87111
|
+
if (this._scale.isBandwidthFixed() &&
|
|
87112
|
+
this._spec.autoRegionSize &&
|
|
87113
|
+
(this._spec.bandSize || this._spec.maxBandSize)) {
|
|
87114
|
+
const rangeSize = scaleWholeRangeSize(this._scale.domain().length, (_a = this._spec.bandSize) !== null && _a !== void 0 ? _a : this._spec.maxBandSize, this._scale.paddingInner(), this._scale.paddingOuter());
|
|
87115
|
+
if (['bottom', 'top'].includes(this._orient)) {
|
|
87116
|
+
this._regions.forEach(region => region.setMaxWidth(rangeSize));
|
|
87117
|
+
}
|
|
87118
|
+
else if (['left', 'right'].includes(this._orient)) {
|
|
87119
|
+
this._regions.forEach(region => region.setMaxHeight(rangeSize));
|
|
87120
|
+
}
|
|
87121
|
+
}
|
|
86659
87122
|
}
|
|
86660
87123
|
}
|
|
86661
87124
|
}
|
|
@@ -87476,9 +87939,10 @@
|
|
|
87476
87939
|
onRender(ctx) {
|
|
87477
87940
|
}
|
|
87478
87941
|
_compareSpec() {
|
|
87942
|
+
var _a, _b;
|
|
87479
87943
|
const result = super._compareSpec();
|
|
87480
87944
|
result.reRender = true;
|
|
87481
|
-
if (this._spec.orient !== this._originalSpec.orient) {
|
|
87945
|
+
if (((_a = this._spec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._originalSpec) === null || _b === void 0 ? void 0 : _b.orient)) {
|
|
87482
87946
|
result.reMake = true;
|
|
87483
87947
|
return result;
|
|
87484
87948
|
}
|
|
@@ -87555,31 +88019,33 @@
|
|
|
87555
88019
|
this._cacheAttrs = attrs;
|
|
87556
88020
|
const width = isFinite(this._legendComponent.AABBBounds.width()) ? this._legendComponent.AABBBounds.width() : 0;
|
|
87557
88021
|
const height = isFinite(this._legendComponent.AABBBounds.height()) ? this._legendComponent.AABBBounds.height() : 0;
|
|
87558
|
-
|
|
87559
|
-
|
|
87560
|
-
|
|
87561
|
-
|
|
87562
|
-
|
|
87563
|
-
|
|
87564
|
-
if (
|
|
87565
|
-
|
|
87566
|
-
|
|
87567
|
-
|
|
87568
|
-
|
|
87569
|
-
|
|
87570
|
-
|
|
87571
|
-
else {
|
|
87572
|
-
if (position === 'middle') {
|
|
87573
|
-
offsetY = (rectHeight - height) / 2;
|
|
88022
|
+
if (this.layoutType !== 'normal-inline') {
|
|
88023
|
+
const layout = this.layoutOrient === 'bottom' || this.layoutOrient === 'top' ? 'horizontal' : 'vertical';
|
|
88024
|
+
const position = this._position;
|
|
88025
|
+
const { width: rectWidth, height: rectHeight } = fullSpace;
|
|
88026
|
+
let offsetX = 0;
|
|
88027
|
+
let offsetY = 0;
|
|
88028
|
+
if (layout === 'horizontal') {
|
|
88029
|
+
if (position === 'middle') {
|
|
88030
|
+
offsetX = (rectWidth - width) / 2;
|
|
88031
|
+
}
|
|
88032
|
+
else if (position === 'end') {
|
|
88033
|
+
offsetX = rectWidth - width;
|
|
88034
|
+
}
|
|
87574
88035
|
}
|
|
87575
|
-
else
|
|
87576
|
-
|
|
88036
|
+
else {
|
|
88037
|
+
if (position === 'middle') {
|
|
88038
|
+
offsetY = (rectHeight - height) / 2;
|
|
88039
|
+
}
|
|
88040
|
+
else if (position === 'end') {
|
|
88041
|
+
offsetY = rectHeight - height;
|
|
88042
|
+
}
|
|
87577
88043
|
}
|
|
88044
|
+
this._legendComponent.setAttributes({
|
|
88045
|
+
dx: offsetX,
|
|
88046
|
+
dy: offsetY
|
|
88047
|
+
});
|
|
87578
88048
|
}
|
|
87579
|
-
this._legendComponent.setAttributes({
|
|
87580
|
-
dx: offsetX,
|
|
87581
|
-
dy: offsetY
|
|
87582
|
-
});
|
|
87583
88049
|
result.x2 = result.x1 + width;
|
|
87584
88050
|
result.y2 = result.y1 + height;
|
|
87585
88051
|
return result;
|
|
@@ -87600,15 +88066,13 @@
|
|
|
87600
88066
|
(_b = (_a = this.effect).onSelectedDataChange) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
87601
88067
|
this.event.emit(ChartEvent.legendSelectedDataChange, { model: this });
|
|
87602
88068
|
}
|
|
88069
|
+
getVRenderComponents() {
|
|
88070
|
+
return [this._legendComponent];
|
|
88071
|
+
}
|
|
87603
88072
|
clear() {
|
|
87604
|
-
|
|
87605
|
-
if (this._legendComponent) {
|
|
87606
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._legendComponent);
|
|
87607
|
-
this._legendComponent = null;
|
|
87608
|
-
}
|
|
88073
|
+
super.clear();
|
|
87609
88074
|
this._cacheAttrs = null;
|
|
87610
88075
|
this._preSelectedData = null;
|
|
87611
|
-
super.clear();
|
|
87612
88076
|
}
|
|
87613
88077
|
}
|
|
87614
88078
|
|
|
@@ -88222,12 +88686,10 @@
|
|
|
88222
88686
|
isRelativeModel(model) {
|
|
88223
88687
|
return eachSeries(this._regions, s => model === s) || this._regions.includes(model);
|
|
88224
88688
|
}
|
|
88689
|
+
getVRenderComponents() {
|
|
88690
|
+
return [this._indicatorComponent];
|
|
88691
|
+
}
|
|
88225
88692
|
clear() {
|
|
88226
|
-
var _a;
|
|
88227
|
-
if (this._indicatorComponent) {
|
|
88228
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._indicatorComponent);
|
|
88229
|
-
this._indicatorComponent = null;
|
|
88230
|
-
}
|
|
88231
88693
|
this._cacheAttrs = null;
|
|
88232
88694
|
super.clear();
|
|
88233
88695
|
}
|
|
@@ -88275,8 +88737,9 @@
|
|
|
88275
88737
|
onRender(ctx) {
|
|
88276
88738
|
}
|
|
88277
88739
|
_compareSpec() {
|
|
88740
|
+
var _a, _b;
|
|
88278
88741
|
const result = super._compareSpec();
|
|
88279
|
-
if (this._originalSpec.orient !== this._spec.orient) {
|
|
88742
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.orient)) {
|
|
88280
88743
|
result.reMake = true;
|
|
88281
88744
|
}
|
|
88282
88745
|
result.change = true;
|
|
@@ -88364,14 +88827,12 @@
|
|
|
88364
88827
|
this._cacheAttrs = attrs;
|
|
88365
88828
|
return this._titleComponent;
|
|
88366
88829
|
}
|
|
88830
|
+
getVRenderComponents() {
|
|
88831
|
+
return [this._titleComponent];
|
|
88832
|
+
}
|
|
88367
88833
|
clear() {
|
|
88368
|
-
var _a;
|
|
88369
|
-
if (this._titleComponent) {
|
|
88370
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._titleComponent);
|
|
88371
|
-
this._titleComponent = null;
|
|
88372
|
-
}
|
|
88373
|
-
this._cacheAttrs = null;
|
|
88374
88834
|
super.clear();
|
|
88835
|
+
this._cacheAttrs = null;
|
|
88375
88836
|
}
|
|
88376
88837
|
}
|
|
88377
88838
|
Title.type = ComponentTypeEnum.title;
|
|
@@ -88654,6 +89115,9 @@
|
|
|
88654
89115
|
}
|
|
88655
89116
|
changeRegions(regions) {
|
|
88656
89117
|
}
|
|
89118
|
+
getVRenderComponents() {
|
|
89119
|
+
return [];
|
|
89120
|
+
}
|
|
88657
89121
|
collectFeatures() {
|
|
88658
89122
|
const features = [];
|
|
88659
89123
|
this._regions.forEach(r => {
|
|
@@ -89530,22 +89994,15 @@
|
|
|
89530
89994
|
}
|
|
89531
89995
|
limitTagInBounds(label, this._getLimitBounds());
|
|
89532
89996
|
}
|
|
89533
|
-
|
|
89534
|
-
[
|
|
89997
|
+
getVRenderComponents() {
|
|
89998
|
+
return [
|
|
89535
89999
|
this._xCrosshair,
|
|
89536
90000
|
this._xTopLabel,
|
|
89537
90001
|
this._xBottomLabel,
|
|
89538
90002
|
this._yCrosshair,
|
|
89539
90003
|
this._yLeftLabel,
|
|
89540
90004
|
this._yRightLabel
|
|
89541
|
-
]
|
|
89542
|
-
var _a;
|
|
89543
|
-
if (c) {
|
|
89544
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
|
|
89545
|
-
c = null;
|
|
89546
|
-
}
|
|
89547
|
-
});
|
|
89548
|
-
super.clear();
|
|
90005
|
+
];
|
|
89549
90006
|
}
|
|
89550
90007
|
}
|
|
89551
90008
|
CartesianCrossHair.type = ComponentTypeEnum.cartesianCrosshair;
|
|
@@ -89892,15 +90349,13 @@
|
|
|
89892
90349
|
}
|
|
89893
90350
|
limitTagInBounds(label, this._getLimitBounds());
|
|
89894
90351
|
}
|
|
89895
|
-
|
|
89896
|
-
[
|
|
89897
|
-
|
|
89898
|
-
|
|
89899
|
-
|
|
89900
|
-
|
|
89901
|
-
|
|
89902
|
-
});
|
|
89903
|
-
super.clear();
|
|
90352
|
+
getVRenderComponents() {
|
|
90353
|
+
return [
|
|
90354
|
+
this._radiusCrosshair,
|
|
90355
|
+
this._radiusLabelCrosshair,
|
|
90356
|
+
this._angleCrosshair,
|
|
90357
|
+
this._angleLabelCrosshair
|
|
90358
|
+
];
|
|
89904
90359
|
}
|
|
89905
90360
|
}
|
|
89906
90361
|
PolarCrossHair.type = ComponentTypeEnum.polarCrosshair;
|
|
@@ -90124,13 +90579,8 @@
|
|
|
90124
90579
|
}
|
|
90125
90580
|
onRender(ctx) {
|
|
90126
90581
|
}
|
|
90127
|
-
|
|
90128
|
-
|
|
90129
|
-
super.clear();
|
|
90130
|
-
if (this._playerComponent) {
|
|
90131
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._playerComponent);
|
|
90132
|
-
}
|
|
90133
|
-
this._playerComponent = null;
|
|
90582
|
+
getVRenderComponents() {
|
|
90583
|
+
return [this._playerComponent];
|
|
90134
90584
|
}
|
|
90135
90585
|
_computeLayoutRect(rect, width, height) {
|
|
90136
90586
|
switch (this._orient) {
|
|
@@ -90517,13 +90967,8 @@
|
|
|
90517
90967
|
(_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('need at least one series');
|
|
90518
90968
|
return null;
|
|
90519
90969
|
}
|
|
90520
|
-
|
|
90521
|
-
|
|
90522
|
-
if (this._markerComponent) {
|
|
90523
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._markerComponent);
|
|
90524
|
-
this._markerComponent = null;
|
|
90525
|
-
}
|
|
90526
|
-
super.clear();
|
|
90970
|
+
getVRenderComponents() {
|
|
90971
|
+
return [this._markerComponent];
|
|
90527
90972
|
}
|
|
90528
90973
|
}
|
|
90529
90974
|
|
|
@@ -93391,6 +93836,9 @@
|
|
|
93391
93836
|
}
|
|
93392
93837
|
changeRegions(regions) {
|
|
93393
93838
|
}
|
|
93839
|
+
getVRenderComponents() {
|
|
93840
|
+
return [];
|
|
93841
|
+
}
|
|
93394
93842
|
_registerEvent() {
|
|
93395
93843
|
}
|
|
93396
93844
|
_releaseEvent() {
|
|
@@ -93639,6 +94087,9 @@
|
|
|
93639
94087
|
}
|
|
93640
94088
|
changeRegions(regions) {
|
|
93641
94089
|
}
|
|
94090
|
+
getVRenderComponents() {
|
|
94091
|
+
return [];
|
|
94092
|
+
}
|
|
93642
94093
|
}
|
|
93643
94094
|
BaseLabelComponent.type = ComponentTypeEnum.label;
|
|
93644
94095
|
|
|
@@ -94276,17 +94727,17 @@
|
|
|
94276
94727
|
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
94277
94728
|
this._chartLayoutRect = chartLayoutRect;
|
|
94278
94729
|
this._chartViewBox = chartViewBox;
|
|
94279
|
-
this.
|
|
94280
|
-
this.
|
|
94281
|
-
this.
|
|
94282
|
-
this.
|
|
94730
|
+
this.leftCurrent = chartLayoutRect.x;
|
|
94731
|
+
this.topCurrent = chartLayoutRect.y;
|
|
94732
|
+
this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
94733
|
+
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
94283
94734
|
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
94284
94735
|
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
94285
94736
|
const layoutTemp = {
|
|
94286
|
-
|
|
94287
|
-
_topCurrent: this.
|
|
94288
|
-
_rightCurrent: this.
|
|
94289
|
-
_bottomCurrent: this.
|
|
94737
|
+
leftCurrent: this.leftCurrent,
|
|
94738
|
+
_topCurrent: this.topCurrent,
|
|
94739
|
+
_rightCurrent: this.rightCurrent,
|
|
94740
|
+
_bottomCurrent: this.bottomCurrent
|
|
94290
94741
|
};
|
|
94291
94742
|
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
94292
94743
|
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
@@ -94299,10 +94750,10 @@
|
|
|
94299
94750
|
const layoutRect = zItems[0].getLayoutRect();
|
|
94300
94751
|
extraWH = layoutRect;
|
|
94301
94752
|
}
|
|
94302
|
-
this.
|
|
94303
|
-
this.
|
|
94304
|
-
this.
|
|
94305
|
-
this.
|
|
94753
|
+
this.leftCurrent += extraWH.width / 8;
|
|
94754
|
+
this.rightCurrent -= extraWH.width / 8;
|
|
94755
|
+
this.topCurrent += extraWH.height / 8;
|
|
94756
|
+
this.bottomCurrent -= extraWH.height / 8;
|
|
94306
94757
|
const offsetWH = {
|
|
94307
94758
|
offsetBottom: 0,
|
|
94308
94759
|
offsetTop: 0,
|
|
@@ -94313,10 +94764,10 @@
|
|
|
94313
94764
|
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
94314
94765
|
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
94315
94766
|
if (top || bottom || left || right) {
|
|
94316
|
-
this.
|
|
94317
|
-
this.
|
|
94318
|
-
this.
|
|
94319
|
-
this.
|
|
94767
|
+
this.topCurrent = layoutTemp._topCurrent + top;
|
|
94768
|
+
this.bottomCurrent = layoutTemp._bottomCurrent - bottom;
|
|
94769
|
+
this.leftCurrent = layoutTemp.leftCurrent + left;
|
|
94770
|
+
this.rightCurrent = layoutTemp._rightCurrent - right;
|
|
94320
94771
|
this.layoutRegionItems(regionItems, relativeItems);
|
|
94321
94772
|
}
|
|
94322
94773
|
}
|
|
@@ -94357,8 +94808,8 @@
|
|
|
94357
94808
|
});
|
|
94358
94809
|
}
|
|
94359
94810
|
layoutRegionItems(regionItems, regionRelativeItems, extraOffset) {
|
|
94360
|
-
let regionRelativeTotalWidth = this.
|
|
94361
|
-
let regionRelativeTotalHeight = this.
|
|
94811
|
+
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
94812
|
+
let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
94362
94813
|
if (!extraOffset) {
|
|
94363
94814
|
extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
|
|
94364
94815
|
}
|
|
@@ -94370,18 +94821,18 @@
|
|
|
94370
94821
|
item.setLayoutRect({ width: rect.width });
|
|
94371
94822
|
if (item.layoutOrient === 'left') {
|
|
94372
94823
|
item.setLayoutStartPosition({
|
|
94373
|
-
x: this.
|
|
94824
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft + extraOffset.offsetLeft
|
|
94374
94825
|
});
|
|
94375
|
-
this.
|
|
94826
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetLeft;
|
|
94376
94827
|
}
|
|
94377
94828
|
else if (item.layoutOrient === 'right') {
|
|
94378
|
-
this.
|
|
94829
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetRight;
|
|
94379
94830
|
item.setLayoutStartPosition({
|
|
94380
|
-
x: this.
|
|
94831
|
+
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
94381
94832
|
});
|
|
94382
94833
|
}
|
|
94383
94834
|
});
|
|
94384
|
-
regionRelativeTotalWidth = this.
|
|
94835
|
+
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
94385
94836
|
regionRelativeItems
|
|
94386
94837
|
.filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
|
|
94387
94838
|
.forEach(item => {
|
|
@@ -94390,27 +94841,27 @@
|
|
|
94390
94841
|
item.setLayoutRect({ height: rect.height });
|
|
94391
94842
|
if (item.layoutOrient === 'top') {
|
|
94392
94843
|
item.setLayoutStartPosition({
|
|
94393
|
-
y: this.
|
|
94844
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop + extraOffset.offsetTop
|
|
94394
94845
|
});
|
|
94395
|
-
this.
|
|
94846
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
94396
94847
|
}
|
|
94397
94848
|
else if (item.layoutOrient === 'bottom') {
|
|
94398
|
-
this.
|
|
94849
|
+
this.bottomCurrent -=
|
|
94399
94850
|
rect.height + item.layoutPaddingTop + item.layoutPaddingBottom + extraOffset.offsetBottom;
|
|
94400
94851
|
item.setLayoutStartPosition({
|
|
94401
|
-
y: this.
|
|
94852
|
+
y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
94402
94853
|
});
|
|
94403
94854
|
}
|
|
94404
94855
|
});
|
|
94405
|
-
regionRelativeTotalHeight = this.
|
|
94856
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
94406
94857
|
regionItems.forEach(region => {
|
|
94407
94858
|
region.setLayoutRect({
|
|
94408
94859
|
width: regionRelativeTotalWidth,
|
|
94409
94860
|
height: regionRelativeTotalHeight
|
|
94410
94861
|
});
|
|
94411
94862
|
region.setLayoutStartPosition({
|
|
94412
|
-
x: this.
|
|
94413
|
-
y: this.
|
|
94863
|
+
x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
|
|
94864
|
+
y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
|
|
94414
94865
|
});
|
|
94415
94866
|
});
|
|
94416
94867
|
regionRelativeItems.forEach(item => {
|
|
@@ -94439,13 +94890,13 @@
|
|
|
94439
94890
|
extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
|
|
94440
94891
|
}
|
|
94441
94892
|
const result = {
|
|
94442
|
-
width: this.
|
|
94443
|
-
this.
|
|
94893
|
+
width: this.rightCurrent -
|
|
94894
|
+
this.leftCurrent -
|
|
94444
94895
|
item.layoutPaddingLeft -
|
|
94445
94896
|
item.layoutPaddingRight -
|
|
94446
94897
|
(extraOffset.offsetLeft + extraOffset.offsetRight),
|
|
94447
|
-
height: this.
|
|
94448
|
-
this.
|
|
94898
|
+
height: this.bottomCurrent -
|
|
94899
|
+
this.topCurrent -
|
|
94449
94900
|
item.layoutPaddingTop -
|
|
94450
94901
|
item.layoutPaddingBottom -
|
|
94451
94902
|
(extraOffset.offsetTop + extraOffset.offsetBottom)
|