@visactor/vchart 1.4.0-beta.1 → 1.4.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 +984 -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 +16 -15
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
|
}
|
|
@@ -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;
|
|
@@ -41222,10 +41252,14 @@
|
|
|
41222
41252
|
this.from = null !== (_a = this.from) && void 0 !== _a ? _a : {}, this.to = null !== (_b = this.to) && void 0 !== _b ? _b : {};
|
|
41223
41253
|
}
|
|
41224
41254
|
onStart() {
|
|
41255
|
+
var _a;
|
|
41256
|
+
const excludedChannelMap = null !== (_a = this.target.constructor.NOWORK_ANIMATE_ATTR) && void 0 !== _a ? _a : NOWORK_ANIMATE_ATTR,
|
|
41257
|
+
excludedChannels = Object.keys(excludedChannelMap).filter(channel => 0 !== excludedChannelMap[channel]);
|
|
41258
|
+
this.subAnimate.animate.preventAttrs(excludedChannels);
|
|
41225
41259
|
const from = Object.assign({}, this.from),
|
|
41226
41260
|
to = Object.assign({}, this.to);
|
|
41227
41261
|
Object.keys(to).forEach(k => {
|
|
41228
|
-
isNil$1(from[k]) && (from[k] = this.target.getComputedAttribute(k));
|
|
41262
|
+
excludedChannels.includes(k) ? (from[k] = to[k], this.from[k] = to[k]) : isNil$1(from[k]) && (from[k] = this.target.getComputedAttribute(k));
|
|
41229
41263
|
}), this.target.setAttributes(from, !1, {
|
|
41230
41264
|
type: AttributeUpdateType.ANIMATE_UPDATE,
|
|
41231
41265
|
animationState: {
|
|
@@ -41239,6 +41273,13 @@
|
|
|
41239
41273
|
type: AttributeUpdateType.ANIMATE_END
|
|
41240
41274
|
});
|
|
41241
41275
|
}
|
|
41276
|
+
update(end, ratio, out) {
|
|
41277
|
+
0 === this.updateCount && this.onFirstRun(), this.updateCount += 1;
|
|
41278
|
+
const lastProps = this.step.getLastProps();
|
|
41279
|
+
Object.keys(lastProps).forEach(key => {
|
|
41280
|
+
this.subAnimate.animate.validAttr(key) && (out[key] = lastProps[key]);
|
|
41281
|
+
}), this.onUpdate(end, ratio, out), end && this.onEnd();
|
|
41282
|
+
}
|
|
41242
41283
|
onUpdate(end, ratio, out) {
|
|
41243
41284
|
this.target.stepInterpolate(this.subAnimate, this.subAnimate.animate, out, this.step, ratio, end, this._toAttribute, this._fromAttribute);
|
|
41244
41285
|
}
|
|
@@ -45617,10 +45658,14 @@
|
|
|
45617
45658
|
return group ? group.findAll(node => "group" !== node.type, !0) : [];
|
|
45618
45659
|
}
|
|
45619
45660
|
|
|
45620
|
-
const defaultAlternativeColors = ["#ffffff", "#000000"]
|
|
45661
|
+
const defaultAlternativeColors = ["#ffffff", "#000000"],
|
|
45662
|
+
{
|
|
45663
|
+
Color: Color
|
|
45664
|
+
} = ColorUtil;
|
|
45621
45665
|
function labelSmartInvert(foregroundColorOrigin, backgroundColorOrogin, textType, contrastRatiosThreshold, alternativeColors) {
|
|
45622
|
-
|
|
45623
|
-
|
|
45666
|
+
if ("string" != typeof foregroundColorOrigin || "string" != typeof backgroundColorOrogin) return foregroundColorOrigin;
|
|
45667
|
+
const foregroundColor = new Color(foregroundColorOrigin).toHex(),
|
|
45668
|
+
backgroundColor = new Color(backgroundColorOrogin).toHex();
|
|
45624
45669
|
return contrastAccessibilityChecker(foregroundColor, backgroundColor, textType, contrastRatiosThreshold) ? foregroundColor : improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors);
|
|
45625
45670
|
}
|
|
45626
45671
|
function improveContrastReverse(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors) {
|
|
@@ -45645,16 +45690,6 @@
|
|
|
45645
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);
|
|
45646
45691
|
return .2126 * R + .7152 * G + .0722 * B;
|
|
45647
45692
|
}
|
|
45648
|
-
function formatColorToHex(originColor) {
|
|
45649
|
-
if (null == originColor ? void 0 : originColor.includes("#")) return originColor;
|
|
45650
|
-
const c = new Color$1(originColor),
|
|
45651
|
-
{
|
|
45652
|
-
r: r,
|
|
45653
|
-
g: g,
|
|
45654
|
-
b: b
|
|
45655
|
-
} = c.color;
|
|
45656
|
-
return "#" + rgbToHex(r, g, b);
|
|
45657
|
-
}
|
|
45658
45693
|
function smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor) {
|
|
45659
45694
|
let result;
|
|
45660
45695
|
switch (fillStrategy) {
|
|
@@ -47028,7 +47063,7 @@
|
|
|
47028
47063
|
return listener;
|
|
47029
47064
|
}
|
|
47030
47065
|
_smartInvert(labels) {
|
|
47031
|
-
var _a, _b, _c, _d;
|
|
47066
|
+
var _a, _b, _c, _d, _e;
|
|
47032
47067
|
const option = this.attribute.smartInvert || {},
|
|
47033
47068
|
{
|
|
47034
47069
|
textType: textType,
|
|
@@ -47038,18 +47073,18 @@
|
|
|
47038
47073
|
fillStrategy = null !== (_a = option.fillStrategy) && void 0 !== _a ? _a : "invertBase",
|
|
47039
47074
|
strokeStrategy = null !== (_b = option.strokeStrategy) && void 0 !== _b ? _b : "base",
|
|
47040
47075
|
brightColor = null !== (_c = option.brightColor) && void 0 !== _c ? _c : "#ffffff",
|
|
47041
|
-
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;
|
|
47042
47078
|
if ("null" !== fillStrategy || "null" !== strokeStrategy) for (let i = 0; i < labels.length; i++) {
|
|
47043
47079
|
const label = labels[i];
|
|
47044
47080
|
if (!label) continue;
|
|
47045
47081
|
const baseMark = this._idToGraphic.get(label.attribute.id),
|
|
47046
|
-
isInside = this._canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds),
|
|
47047
47082
|
backgroundColor = baseMark.attribute.fill,
|
|
47048
47083
|
foregroundColor = label.attribute.fill,
|
|
47049
47084
|
baseColor = backgroundColor,
|
|
47050
47085
|
invertColor = labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors),
|
|
47051
47086
|
similarColor = contrastAccessibilityChecker(invertColor, brightColor) ? brightColor : darkColor;
|
|
47052
|
-
if (
|
|
47087
|
+
if (outsideEnable) {
|
|
47053
47088
|
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47054
47089
|
if (fill && label.setAttributes({
|
|
47055
47090
|
fill: fill
|
|
@@ -47059,21 +47094,32 @@
|
|
|
47059
47094
|
stroke: stroke
|
|
47060
47095
|
});
|
|
47061
47096
|
} else {
|
|
47062
|
-
if (0
|
|
47063
|
-
|
|
47064
|
-
label.setAttributes({
|
|
47065
|
-
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
|
|
47066
47121
|
});
|
|
47067
|
-
continue;
|
|
47068
47122
|
}
|
|
47069
|
-
const fill = smartInvertStrategy(fillStrategy, baseColor, invertColor, similarColor);
|
|
47070
|
-
fill && label.setAttributes({
|
|
47071
|
-
fill: fill
|
|
47072
|
-
});
|
|
47073
|
-
const stroke = smartInvertStrategy(strokeStrategy, baseColor, invertColor, similarColor);
|
|
47074
|
-
stroke && label.setAttributes({
|
|
47075
|
-
stroke: stroke
|
|
47076
|
-
});
|
|
47077
47123
|
}
|
|
47078
47124
|
}
|
|
47079
47125
|
}
|
|
@@ -51624,7 +51670,7 @@
|
|
|
51624
51670
|
opacity: .85
|
|
51625
51671
|
},
|
|
51626
51672
|
unSelected: {
|
|
51627
|
-
|
|
51673
|
+
opacity: .5
|
|
51628
51674
|
}
|
|
51629
51675
|
}
|
|
51630
51676
|
},
|
|
@@ -55024,13 +55070,10 @@
|
|
|
55024
55070
|
}
|
|
55025
55071
|
};
|
|
55026
55072
|
|
|
55027
|
-
const defaultExcludedChannels = ["visible", "path", "text", "lineWidth", "textBaseline", "textAlign"];
|
|
55028
55073
|
const update = (element, options, animationParameters) => {
|
|
55029
55074
|
const from = Object.assign({}, element.getPrevGraphicAttributes()),
|
|
55030
55075
|
to = Object.assign({}, element.getNextGraphicAttributes());
|
|
55031
|
-
return
|
|
55032
|
-
delete from[key], delete to[key];
|
|
55033
|
-
}), array(null == options ? void 0 : options.excludeChannels).forEach(key => {
|
|
55076
|
+
return array(null == options ? void 0 : options.excludeChannels).forEach(key => {
|
|
55034
55077
|
delete from[key], delete to[key];
|
|
55035
55078
|
}), Object.keys(to).forEach(key => {
|
|
55036
55079
|
isEqual(key, from, to) && (delete from[key], delete to[key]);
|
|
@@ -56061,11 +56104,13 @@
|
|
|
56061
56104
|
space: 6,
|
|
56062
56105
|
style: {
|
|
56063
56106
|
lineWidth: 0,
|
|
56064
|
-
fillOpacity: 1
|
|
56107
|
+
fillOpacity: 1,
|
|
56108
|
+
opacity: 1
|
|
56065
56109
|
},
|
|
56066
56110
|
state: {
|
|
56067
56111
|
unSelected: {
|
|
56068
|
-
fillOpacity: 0.
|
|
56112
|
+
fillOpacity: 0.2,
|
|
56113
|
+
opacity: 1
|
|
56069
56114
|
}
|
|
56070
56115
|
}
|
|
56071
56116
|
},
|
|
@@ -56075,11 +56120,13 @@
|
|
|
56075
56120
|
fill: { type: 'palette', key: 'secondaryFontColor', default: '#89909d' },
|
|
56076
56121
|
fontSize: THEME_CONSTANTS.l5FontSize,
|
|
56077
56122
|
lineHeight: THEME_CONSTANTS.l5LineHeight,
|
|
56078
|
-
fontFamily: THEME_CONSTANTS.defaultFontFamily
|
|
56123
|
+
fontFamily: THEME_CONSTANTS.defaultFontFamily,
|
|
56124
|
+
opacity: 1
|
|
56079
56125
|
},
|
|
56080
56126
|
state: {
|
|
56081
56127
|
unSelected: {
|
|
56082
|
-
fill: { type: 'palette', key: 'disableFontColor' }
|
|
56128
|
+
fill: { type: 'palette', key: 'disableFontColor' },
|
|
56129
|
+
opacity: 1
|
|
56083
56130
|
}
|
|
56084
56131
|
}
|
|
56085
56132
|
}
|
|
@@ -56213,21 +56260,21 @@
|
|
|
56213
56260
|
startSymbol: {
|
|
56214
56261
|
visible: false,
|
|
56215
56262
|
symbolType: 'triangle',
|
|
56263
|
+
size: 10,
|
|
56216
56264
|
style: {
|
|
56217
56265
|
stroke: null,
|
|
56218
56266
|
lineWidth: 0,
|
|
56219
|
-
fill: 'rgba(46, 47, 50)'
|
|
56220
|
-
size: 10
|
|
56267
|
+
fill: 'rgba(46, 47, 50)'
|
|
56221
56268
|
}
|
|
56222
56269
|
},
|
|
56223
56270
|
endSymbol: {
|
|
56224
56271
|
visible: true,
|
|
56225
56272
|
symbolType: 'triangle',
|
|
56273
|
+
size: 10,
|
|
56226
56274
|
style: {
|
|
56227
56275
|
stroke: null,
|
|
56228
56276
|
lineWidth: 0,
|
|
56229
|
-
fill: 'rgba(46, 47, 50)'
|
|
56230
|
-
size: 10
|
|
56277
|
+
fill: 'rgba(46, 47, 50)'
|
|
56231
56278
|
}
|
|
56232
56279
|
},
|
|
56233
56280
|
label: {
|
|
@@ -57270,6 +57317,103 @@
|
|
|
57270
57317
|
}
|
|
57271
57318
|
return (_a = fields[field].alias) !== null && _a !== void 0 ? _a : field;
|
|
57272
57319
|
}
|
|
57320
|
+
function getRegionStackGroup(region, setInitialValue, filter) {
|
|
57321
|
+
const stackValueGroup = {};
|
|
57322
|
+
region.getSeries().forEach(s => {
|
|
57323
|
+
var _a;
|
|
57324
|
+
const stackData = s.getStackData();
|
|
57325
|
+
const stackValue = s.getStackValue();
|
|
57326
|
+
const stackValueField = s.getStackValueField();
|
|
57327
|
+
const filterEnable = filter ? filter(s) : true;
|
|
57328
|
+
if (stackData && stackValueField && filterEnable) {
|
|
57329
|
+
stackValueGroup[stackValue] = (_a = stackValueGroup[stackValue]) !== null && _a !== void 0 ? _a : {
|
|
57330
|
+
nodes: {}
|
|
57331
|
+
};
|
|
57332
|
+
stackGroup(s, stackData, stackValueGroup[stackValue], stackValueField, setInitialValue);
|
|
57333
|
+
}
|
|
57334
|
+
});
|
|
57335
|
+
return stackValueGroup;
|
|
57336
|
+
}
|
|
57337
|
+
function stackTotal(stackData, valueField) {
|
|
57338
|
+
if ('values' in stackData && stackData.values.length) {
|
|
57339
|
+
const total = sum(stackData.values, valueField);
|
|
57340
|
+
const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
|
|
57341
|
+
stackData.values.forEach(v => {
|
|
57342
|
+
v[STACK_FIELD_TOTAL] = total;
|
|
57343
|
+
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
57344
|
+
delete v[STACK_FIELD_TOTAL_TOP];
|
|
57345
|
+
});
|
|
57346
|
+
const maxNode = stackData.values.reduce((max, current) => {
|
|
57347
|
+
return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
|
|
57348
|
+
});
|
|
57349
|
+
maxNode[STACK_FIELD_TOTAL_TOP] = true;
|
|
57350
|
+
return;
|
|
57351
|
+
}
|
|
57352
|
+
for (const key in stackData.nodes) {
|
|
57353
|
+
stackTotal(stackData.nodes[key], valueField);
|
|
57354
|
+
}
|
|
57355
|
+
}
|
|
57356
|
+
function stackOffsetSilhouette(stackCache) {
|
|
57357
|
+
if (!stackCache.values.length) {
|
|
57358
|
+
return;
|
|
57359
|
+
}
|
|
57360
|
+
const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
|
|
57361
|
+
for (let j = 0; j < stackCache.values.length; j++) {
|
|
57362
|
+
stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
|
|
57363
|
+
stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
|
|
57364
|
+
}
|
|
57365
|
+
}
|
|
57366
|
+
function stack(stackCache, stackInverse) {
|
|
57367
|
+
if (stackCache.values.length > 0) {
|
|
57368
|
+
let positiveStart = 0;
|
|
57369
|
+
let negativeStart = 0;
|
|
57370
|
+
let sign = 1;
|
|
57371
|
+
let value = 0;
|
|
57372
|
+
const maxLength = stackCache.values.length;
|
|
57373
|
+
for (let index = 0; index < maxLength; index++) {
|
|
57374
|
+
const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
|
|
57375
|
+
value = v[STACK_FIELD_END];
|
|
57376
|
+
if (value >= 0) {
|
|
57377
|
+
v[STACK_FIELD_START] = positiveStart;
|
|
57378
|
+
positiveStart += v[STACK_FIELD_END];
|
|
57379
|
+
v[STACK_FIELD_END] = positiveStart;
|
|
57380
|
+
}
|
|
57381
|
+
else {
|
|
57382
|
+
v[STACK_FIELD_START] = negativeStart;
|
|
57383
|
+
negativeStart += v[STACK_FIELD_END];
|
|
57384
|
+
v[STACK_FIELD_END] = negativeStart;
|
|
57385
|
+
}
|
|
57386
|
+
}
|
|
57387
|
+
for (let index = 0; index < maxLength; index++) {
|
|
57388
|
+
const v = stackCache.values[stackInverse ? maxLength - 1 - index : index];
|
|
57389
|
+
value = v[STACK_FIELD_END];
|
|
57390
|
+
const denominator = value >= 0 ? positiveStart : negativeStart;
|
|
57391
|
+
sign = value >= 0 ? 1 : -1;
|
|
57392
|
+
v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
|
|
57393
|
+
v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
|
|
57394
|
+
}
|
|
57395
|
+
}
|
|
57396
|
+
for (const key in stackCache.nodes) {
|
|
57397
|
+
stack(stackCache.nodes[key], stackInverse);
|
|
57398
|
+
}
|
|
57399
|
+
}
|
|
57400
|
+
function stackGroup(s, stackData, stackCache, valueField, setInitialValue) {
|
|
57401
|
+
if ('values' in stackData) {
|
|
57402
|
+
setInitialValue && stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
|
|
57403
|
+
stackCache.values.push(...stackData.values);
|
|
57404
|
+
stackCache.series.push({ s: s, values: stackData.values });
|
|
57405
|
+
return;
|
|
57406
|
+
}
|
|
57407
|
+
for (const key in stackData.nodes) {
|
|
57408
|
+
!stackCache.nodes[key] &&
|
|
57409
|
+
(stackCache.nodes[key] = {
|
|
57410
|
+
values: [],
|
|
57411
|
+
series: [],
|
|
57412
|
+
nodes: {}
|
|
57413
|
+
});
|
|
57414
|
+
stackGroup(s, stackData.nodes[key], stackCache.nodes[key], valueField, setInitialValue);
|
|
57415
|
+
}
|
|
57416
|
+
}
|
|
57273
57417
|
|
|
57274
57418
|
const findHierarchyNode = (hierarchyData, key, keyField = 'key', childrenField = 'children') => {
|
|
57275
57419
|
for (let i = 0; i < hierarchyData.length; i++) {
|
|
@@ -57659,6 +57803,25 @@
|
|
|
57659
57803
|
}
|
|
57660
57804
|
return inverse;
|
|
57661
57805
|
}
|
|
57806
|
+
function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
|
|
57807
|
+
if (paddingInner === 1) {
|
|
57808
|
+
paddingInner = 0;
|
|
57809
|
+
}
|
|
57810
|
+
const space = bandSpace(count, paddingInner, paddingOuter);
|
|
57811
|
+
const step = bandwidth / (1 - paddingInner);
|
|
57812
|
+
const wholeSize = space * step;
|
|
57813
|
+
return wholeSize;
|
|
57814
|
+
}
|
|
57815
|
+
function bandSpace(count, paddingInner, paddingOuter) {
|
|
57816
|
+
let space;
|
|
57817
|
+
if (count === 1) {
|
|
57818
|
+
space = count + paddingOuter * 2;
|
|
57819
|
+
}
|
|
57820
|
+
else {
|
|
57821
|
+
space = count - paddingInner + paddingOuter * 2;
|
|
57822
|
+
}
|
|
57823
|
+
return count ? (space > 0 ? space : 1) : 0;
|
|
57824
|
+
}
|
|
57662
57825
|
|
|
57663
57826
|
const getAxis$1 = (chart, type, pos) => {
|
|
57664
57827
|
const axesComponents = chart
|
|
@@ -61370,9 +61533,24 @@
|
|
|
61370
61533
|
})(IFilterMode || (IFilterMode = {}));
|
|
61371
61534
|
|
|
61372
61535
|
class Region extends BaseModel {
|
|
61536
|
+
getMaxWidth() {
|
|
61537
|
+
return this._maxRegionWidth;
|
|
61538
|
+
}
|
|
61539
|
+
setMaxWidth(value) {
|
|
61540
|
+
this._maxRegionWidth = value;
|
|
61541
|
+
}
|
|
61542
|
+
getMaxHeight() {
|
|
61543
|
+
return this._maxRegionHeight;
|
|
61544
|
+
}
|
|
61545
|
+
setMaxHeight(value) {
|
|
61546
|
+
this._maxRegionHeight = value;
|
|
61547
|
+
}
|
|
61373
61548
|
getGroupMark() {
|
|
61374
61549
|
return this._groupMark;
|
|
61375
61550
|
}
|
|
61551
|
+
getStackInverse() {
|
|
61552
|
+
return this._spec.stackInverse === true;
|
|
61553
|
+
}
|
|
61376
61554
|
constructor(spec, ctx) {
|
|
61377
61555
|
var _a;
|
|
61378
61556
|
super(spec, ctx);
|
|
@@ -61478,8 +61656,9 @@
|
|
|
61478
61656
|
}
|
|
61479
61657
|
}
|
|
61480
61658
|
_compareSpec() {
|
|
61659
|
+
var _a, _b;
|
|
61481
61660
|
const result = super._compareSpec();
|
|
61482
|
-
if (!isEqual$1(this._originalSpec.style, this._spec.style)) {
|
|
61661
|
+
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)) {
|
|
61483
61662
|
result.reMake = true;
|
|
61484
61663
|
}
|
|
61485
61664
|
return result;
|
|
@@ -61596,92 +61775,105 @@
|
|
|
61596
61775
|
}
|
|
61597
61776
|
Region.type = 'region';
|
|
61598
61777
|
|
|
61599
|
-
|
|
61600
|
-
|
|
61601
|
-
|
|
61602
|
-
|
|
61603
|
-
|
|
61604
|
-
|
|
61605
|
-
|
|
61606
|
-
}
|
|
61607
|
-
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
61608
|
-
this._chartLayoutRect = chartLayoutRect;
|
|
61609
|
-
this._chartViewBox = chartViewBox;
|
|
61610
|
-
this._leftCurrent = chartLayoutRect.x;
|
|
61611
|
-
this._topCurrent = chartLayoutRect.y;
|
|
61612
|
-
this._rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
61613
|
-
this._bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
61614
|
-
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
61615
|
-
this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
|
|
61616
|
-
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
61617
|
-
const layoutTemp = {
|
|
61618
|
-
_leftCurrent: this._leftCurrent,
|
|
61619
|
-
_topCurrent: this._topCurrent,
|
|
61620
|
-
_rightCurrent: this._rightCurrent,
|
|
61621
|
-
_bottomCurrent: this._bottomCurrent
|
|
61622
|
-
};
|
|
61623
|
-
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
61624
|
-
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
61625
|
-
this.layoutRegionItems(regionItems, relativeItems);
|
|
61626
|
-
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
61627
|
-
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
61628
|
-
if (top || bottom || left || right) {
|
|
61629
|
-
this._topCurrent = layoutTemp._topCurrent + top;
|
|
61630
|
-
this._bottomCurrent = layoutTemp._bottomCurrent - bottom;
|
|
61631
|
-
this._leftCurrent = layoutTemp._leftCurrent + left;
|
|
61632
|
-
this._rightCurrent = layoutTemp._rightCurrent - right;
|
|
61633
|
-
this.layoutRegionItems(regionItems, relativeItems);
|
|
61634
|
-
}
|
|
61778
|
+
function getPositionItems(items) {
|
|
61779
|
+
const startItems = [];
|
|
61780
|
+
const middleItems = [];
|
|
61781
|
+
const endItems = [];
|
|
61782
|
+
items.forEach(item => {
|
|
61783
|
+
if (isNil$1(item.getSpec().position) || item.getSpec().position === 'start') {
|
|
61784
|
+
startItems.push(item);
|
|
61635
61785
|
}
|
|
61636
|
-
|
|
61637
|
-
|
|
61638
|
-
|
|
61639
|
-
|
|
61640
|
-
|
|
61641
|
-
|
|
61642
|
-
|
|
61643
|
-
|
|
61786
|
+
else if (item.getSpec().position === 'middle') {
|
|
61787
|
+
middleItems.push(item);
|
|
61788
|
+
}
|
|
61789
|
+
else if (item.getSpec().position === 'end') {
|
|
61790
|
+
endItems.push(item);
|
|
61791
|
+
}
|
|
61792
|
+
});
|
|
61793
|
+
return {
|
|
61794
|
+
startItems,
|
|
61795
|
+
endItems,
|
|
61796
|
+
middleItems
|
|
61797
|
+
};
|
|
61798
|
+
}
|
|
61799
|
+
function adjustItemsToCenter(allItems, isVertical, containerLength) {
|
|
61800
|
+
if (isVertical) {
|
|
61801
|
+
allItems.forEach(items => {
|
|
61802
|
+
const lastItem = last(items);
|
|
61803
|
+
const length = lastItem.getLayoutStartPoint().y + lastItem.getLayoutRect().height - items[0].getLayoutStartPoint().y;
|
|
61804
|
+
const centerY = (containerLength - length) / 2;
|
|
61805
|
+
items.forEach(item => {
|
|
61644
61806
|
item.setLayoutStartPosition({
|
|
61645
|
-
x:
|
|
61646
|
-
y:
|
|
61807
|
+
x: item.getLayoutStartPoint().x,
|
|
61808
|
+
y: item.getLayoutStartPoint().y + centerY
|
|
61647
61809
|
});
|
|
61648
|
-
|
|
61649
|
-
|
|
61650
|
-
|
|
61810
|
+
});
|
|
61811
|
+
});
|
|
61812
|
+
}
|
|
61813
|
+
else {
|
|
61814
|
+
allItems.forEach(items => {
|
|
61815
|
+
const lastItem = last(items);
|
|
61816
|
+
const length = lastItem.getLayoutStartPoint().x + lastItem.getLayoutRect().width - items[0].getLayoutStartPoint().x;
|
|
61817
|
+
const centerX = (containerLength - length) / 2;
|
|
61818
|
+
items.forEach(item => {
|
|
61651
61819
|
item.setLayoutStartPosition({
|
|
61652
|
-
x:
|
|
61653
|
-
y:
|
|
61820
|
+
x: item.getLayoutStartPoint().x + centerX,
|
|
61821
|
+
y: item.getLayoutStartPoint().y
|
|
61654
61822
|
});
|
|
61655
|
-
|
|
61656
|
-
|
|
61657
|
-
|
|
61823
|
+
});
|
|
61824
|
+
});
|
|
61825
|
+
}
|
|
61826
|
+
}
|
|
61827
|
+
function layoutRightStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
|
|
61828
|
+
if (items.length) {
|
|
61829
|
+
let maxWidth = 0;
|
|
61830
|
+
let preRight = layout.rightCurrent;
|
|
61831
|
+
let preTop = layout.topCurrent;
|
|
61832
|
+
const allItems = [];
|
|
61833
|
+
let singleLineItems = [];
|
|
61834
|
+
items.forEach(item => {
|
|
61835
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61836
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
61837
|
+
item.setLayoutRect(rect);
|
|
61838
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61839
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61840
|
+
item.setLayoutStartPosition({
|
|
61841
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61842
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
61843
|
+
});
|
|
61844
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
61845
|
+
preTop += itemTotalHeight;
|
|
61846
|
+
if (preTop > limitHeight) {
|
|
61847
|
+
preRight -= maxWidth;
|
|
61848
|
+
maxWidth = itemTotalWidth;
|
|
61849
|
+
preTop = layout.topCurrent + itemTotalHeight;
|
|
61658
61850
|
item.setLayoutStartPosition({
|
|
61659
|
-
x:
|
|
61660
|
-
y:
|
|
61851
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61852
|
+
y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61661
61853
|
});
|
|
61662
|
-
|
|
61854
|
+
allItems.push(singleLineItems);
|
|
61855
|
+
singleLineItems = [item];
|
|
61663
61856
|
}
|
|
61664
|
-
else
|
|
61665
|
-
|
|
61666
|
-
x: this._leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
|
|
61667
|
-
y: this._bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61668
|
-
});
|
|
61669
|
-
this._bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61857
|
+
else {
|
|
61858
|
+
singleLineItems.push(item);
|
|
61670
61859
|
}
|
|
61671
61860
|
});
|
|
61861
|
+
allItems.push(singleLineItems);
|
|
61862
|
+
if (isMiddle) {
|
|
61863
|
+
adjustItemsToCenter(allItems, true, limitHeight);
|
|
61864
|
+
}
|
|
61865
|
+
layout.rightCurrent = preRight - maxWidth;
|
|
61672
61866
|
}
|
|
61673
|
-
|
|
61674
|
-
|
|
61675
|
-
|
|
61676
|
-
const topItems = normalItems.filter(item => item.layoutOrient === 'top');
|
|
61677
|
-
const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
|
|
61678
|
-
const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
|
|
61679
|
-
const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
|
|
61867
|
+
}
|
|
61868
|
+
function layoutLeftStartOrMiddleItems(items, layout, limitHeight, isMiddle) {
|
|
61869
|
+
if (items.length) {
|
|
61680
61870
|
let maxWidth = 0;
|
|
61681
|
-
let preLeft =
|
|
61682
|
-
let preTop =
|
|
61683
|
-
|
|
61684
|
-
|
|
61871
|
+
let preLeft = layout.leftCurrent;
|
|
61872
|
+
let preTop = layout.topCurrent;
|
|
61873
|
+
const allItems = [];
|
|
61874
|
+
let singleLineItems = [];
|
|
61875
|
+
items.forEach(item => {
|
|
61876
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61685
61877
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61686
61878
|
item.setLayoutRect(rect);
|
|
61687
61879
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
@@ -61695,19 +61887,34 @@
|
|
|
61695
61887
|
if (preTop > limitHeight) {
|
|
61696
61888
|
preLeft += maxWidth;
|
|
61697
61889
|
maxWidth = itemTotalWidth;
|
|
61698
|
-
preTop =
|
|
61890
|
+
preTop = layout.topCurrent + itemTotalHeight;
|
|
61699
61891
|
item.setLayoutStartPosition({
|
|
61700
61892
|
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61701
|
-
y:
|
|
61893
|
+
y: layout.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61702
61894
|
});
|
|
61895
|
+
allItems.push(singleLineItems);
|
|
61896
|
+
singleLineItems = [item];
|
|
61897
|
+
}
|
|
61898
|
+
else {
|
|
61899
|
+
singleLineItems.push(item);
|
|
61703
61900
|
}
|
|
61704
61901
|
});
|
|
61705
|
-
|
|
61902
|
+
allItems.push(singleLineItems);
|
|
61903
|
+
if (isMiddle) {
|
|
61904
|
+
adjustItemsToCenter(allItems, true, limitHeight);
|
|
61905
|
+
}
|
|
61906
|
+
layout.leftCurrent = preLeft + maxWidth;
|
|
61907
|
+
}
|
|
61908
|
+
}
|
|
61909
|
+
function layoutTopStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
|
|
61910
|
+
if (items.length) {
|
|
61706
61911
|
let maxHeight = 0;
|
|
61707
|
-
preLeft =
|
|
61708
|
-
preTop =
|
|
61709
|
-
|
|
61710
|
-
|
|
61912
|
+
let preLeft = layout.leftCurrent;
|
|
61913
|
+
let preTop = layout.topCurrent;
|
|
61914
|
+
const allItems = [];
|
|
61915
|
+
let singleLineItems = [];
|
|
61916
|
+
items.forEach(item => {
|
|
61917
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61711
61918
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61712
61919
|
item.setLayoutRect(rect);
|
|
61713
61920
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
@@ -61719,72 +61926,314 @@
|
|
|
61719
61926
|
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
61720
61927
|
preLeft += itemTotalWidth;
|
|
61721
61928
|
if (preLeft > limitWidth) {
|
|
61722
|
-
preLeft =
|
|
61929
|
+
preLeft = layout.leftCurrent + itemTotalWidth;
|
|
61723
61930
|
preTop += maxHeight;
|
|
61724
61931
|
maxHeight = itemTotalHeight;
|
|
61725
61932
|
item.setLayoutStartPosition({
|
|
61726
|
-
x:
|
|
61933
|
+
x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61727
61934
|
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
61728
61935
|
});
|
|
61936
|
+
allItems.push(singleLineItems);
|
|
61937
|
+
singleLineItems = [item];
|
|
61938
|
+
}
|
|
61939
|
+
else {
|
|
61940
|
+
singleLineItems.push(item);
|
|
61729
61941
|
}
|
|
61730
61942
|
});
|
|
61731
|
-
|
|
61732
|
-
|
|
61733
|
-
|
|
61734
|
-
|
|
61735
|
-
|
|
61736
|
-
|
|
61943
|
+
allItems.push(singleLineItems);
|
|
61944
|
+
if (isMiddle) {
|
|
61945
|
+
adjustItemsToCenter(allItems, false, limitWidth);
|
|
61946
|
+
}
|
|
61947
|
+
layout.topCurrent = preTop + maxHeight;
|
|
61948
|
+
}
|
|
61949
|
+
}
|
|
61950
|
+
function layoutBottomStartOrMiddleItems(items, layout, limitWidth, isMiddle) {
|
|
61951
|
+
if (items.length) {
|
|
61952
|
+
let maxHeight = 0;
|
|
61953
|
+
let preLeft = layout.leftCurrent;
|
|
61954
|
+
let preBottom = layout.bottomCurrent;
|
|
61955
|
+
const allItems = [];
|
|
61956
|
+
let singleLineItems = [];
|
|
61957
|
+
items.forEach(item => {
|
|
61958
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61737
61959
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61738
61960
|
item.setLayoutRect(rect);
|
|
61739
61961
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61740
61962
|
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61741
61963
|
item.setLayoutStartPosition({
|
|
61742
|
-
x:
|
|
61743
|
-
y:
|
|
61964
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61965
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61744
61966
|
});
|
|
61745
|
-
|
|
61746
|
-
|
|
61747
|
-
if (
|
|
61967
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
61968
|
+
preLeft += itemTotalWidth;
|
|
61969
|
+
if (preLeft > limitWidth) {
|
|
61970
|
+
allItems.push(singleLineItems);
|
|
61971
|
+
preLeft = layout.leftCurrent + itemTotalWidth;
|
|
61972
|
+
preBottom -= maxHeight;
|
|
61973
|
+
maxHeight = itemTotalHeight;
|
|
61974
|
+
item.setLayoutStartPosition({
|
|
61975
|
+
x: layout.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
61976
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61977
|
+
});
|
|
61978
|
+
singleLineItems = [item];
|
|
61979
|
+
}
|
|
61980
|
+
else {
|
|
61981
|
+
singleLineItems.push(item);
|
|
61982
|
+
}
|
|
61983
|
+
});
|
|
61984
|
+
allItems.push(singleLineItems);
|
|
61985
|
+
if (isMiddle) {
|
|
61986
|
+
adjustItemsToCenter(allItems, false, limitWidth);
|
|
61987
|
+
}
|
|
61988
|
+
layout.bottomCurrent = preBottom - maxHeight;
|
|
61989
|
+
}
|
|
61990
|
+
}
|
|
61991
|
+
function layoutLeftInlineItems(items, layout, limitHeight) {
|
|
61992
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
61993
|
+
if (startItems.length) {
|
|
61994
|
+
layoutLeftStartOrMiddleItems(startItems, layout, limitHeight, false);
|
|
61995
|
+
}
|
|
61996
|
+
if (middleItems.length) {
|
|
61997
|
+
layoutLeftStartOrMiddleItems(middleItems, layout, limitHeight, true);
|
|
61998
|
+
}
|
|
61999
|
+
if (endItems.length) {
|
|
62000
|
+
let maxWidth = 0;
|
|
62001
|
+
let preLeft = layout.leftCurrent;
|
|
62002
|
+
let preBottom = layout.bottomCurrent;
|
|
62003
|
+
endItems.forEach(item => {
|
|
62004
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62005
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62006
|
+
item.setLayoutRect(rect);
|
|
62007
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62008
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62009
|
+
if (preBottom < itemTotalHeight) {
|
|
62010
|
+
preLeft += maxWidth;
|
|
62011
|
+
maxWidth = itemTotalWidth;
|
|
62012
|
+
preBottom = layout.bottomCurrent;
|
|
62013
|
+
item.setLayoutStartPosition({
|
|
62014
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62015
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62016
|
+
});
|
|
62017
|
+
}
|
|
62018
|
+
else {
|
|
62019
|
+
item.setLayoutStartPosition({
|
|
62020
|
+
x: preLeft + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62021
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62022
|
+
});
|
|
62023
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
62024
|
+
preBottom -= itemTotalHeight;
|
|
62025
|
+
}
|
|
62026
|
+
});
|
|
62027
|
+
layout.leftCurrent = preLeft + maxWidth;
|
|
62028
|
+
}
|
|
62029
|
+
}
|
|
62030
|
+
function layoutRightInlineItems(items, layout, limitHeight) {
|
|
62031
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62032
|
+
if (startItems.length) {
|
|
62033
|
+
layoutRightStartOrMiddleItems(startItems, layout, limitHeight, false);
|
|
62034
|
+
}
|
|
62035
|
+
if (middleItems.length) {
|
|
62036
|
+
layoutRightStartOrMiddleItems(middleItems, layout, limitHeight, true);
|
|
62037
|
+
}
|
|
62038
|
+
if (endItems.length) {
|
|
62039
|
+
let maxWidth = 0;
|
|
62040
|
+
let preRight = layout.rightCurrent;
|
|
62041
|
+
let preBottom = layout.bottomCurrent;
|
|
62042
|
+
endItems.forEach(item => {
|
|
62043
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62044
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62045
|
+
item.setLayoutRect(rect);
|
|
62046
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62047
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62048
|
+
if (preBottom < itemTotalHeight) {
|
|
61748
62049
|
preRight -= maxWidth;
|
|
61749
62050
|
maxWidth = itemTotalWidth;
|
|
61750
|
-
|
|
62051
|
+
preBottom = layout.bottomCurrent;
|
|
61751
62052
|
item.setLayoutStartPosition({
|
|
61752
62053
|
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61753
|
-
y:
|
|
62054
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62055
|
+
});
|
|
62056
|
+
}
|
|
62057
|
+
else {
|
|
62058
|
+
item.setLayoutStartPosition({
|
|
62059
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62060
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61754
62061
|
});
|
|
62062
|
+
maxWidth = Math.max(maxWidth, itemTotalWidth);
|
|
62063
|
+
preBottom -= itemTotalHeight;
|
|
61755
62064
|
}
|
|
61756
62065
|
});
|
|
61757
|
-
|
|
61758
|
-
|
|
61759
|
-
|
|
61760
|
-
|
|
61761
|
-
|
|
61762
|
-
|
|
62066
|
+
layout.rightCurrent = preRight - maxWidth;
|
|
62067
|
+
}
|
|
62068
|
+
}
|
|
62069
|
+
function layoutTopInlineItems(items, layout, limitWidth) {
|
|
62070
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62071
|
+
if (startItems.length) {
|
|
62072
|
+
layoutTopStartOrMiddleItems(startItems, layout, limitWidth, false);
|
|
62073
|
+
}
|
|
62074
|
+
if (middleItems.length) {
|
|
62075
|
+
layoutTopStartOrMiddleItems(middleItems, layout, limitWidth, true);
|
|
62076
|
+
}
|
|
62077
|
+
if (endItems.length) {
|
|
62078
|
+
let maxHeight = 0;
|
|
62079
|
+
let preTop = layout.topCurrent;
|
|
62080
|
+
let preRight = layout.rightCurrent;
|
|
62081
|
+
endItems.forEach(item => {
|
|
62082
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
61763
62083
|
const rect = item.computeBoundsInRect(layoutRect);
|
|
61764
62084
|
item.setLayoutRect(rect);
|
|
61765
62085
|
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61766
62086
|
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61767
|
-
|
|
61768
|
-
|
|
61769
|
-
|
|
61770
|
-
|
|
61771
|
-
|
|
61772
|
-
|
|
61773
|
-
|
|
61774
|
-
|
|
62087
|
+
if (preRight < itemTotalWidth) {
|
|
62088
|
+
preRight = layout.rightCurrent;
|
|
62089
|
+
preTop += maxHeight;
|
|
62090
|
+
maxHeight = itemTotalHeight;
|
|
62091
|
+
item.setLayoutStartPosition({
|
|
62092
|
+
x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62093
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
62094
|
+
});
|
|
62095
|
+
}
|
|
62096
|
+
else {
|
|
62097
|
+
item.setLayoutStartPosition({
|
|
62098
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62099
|
+
y: preTop + item.layoutOffsetY + item.layoutPaddingTop
|
|
62100
|
+
});
|
|
62101
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
62102
|
+
preRight -= itemTotalWidth;
|
|
62103
|
+
}
|
|
62104
|
+
});
|
|
62105
|
+
layout.topCurrent = preTop + maxHeight;
|
|
62106
|
+
}
|
|
62107
|
+
}
|
|
62108
|
+
function layoutBottomInlineItems(items, layout, limitWidth) {
|
|
62109
|
+
const { startItems, middleItems, endItems } = getPositionItems(items);
|
|
62110
|
+
if (startItems.length) {
|
|
62111
|
+
layoutBottomStartOrMiddleItems(startItems, layout, limitWidth, false);
|
|
62112
|
+
}
|
|
62113
|
+
if (middleItems.length) {
|
|
62114
|
+
layoutBottomStartOrMiddleItems(middleItems, layout, limitWidth, true);
|
|
62115
|
+
}
|
|
62116
|
+
if (endItems.length) {
|
|
62117
|
+
let maxHeight = 0;
|
|
62118
|
+
let preBottom = layout.bottomCurrent;
|
|
62119
|
+
let preRight = layout.rightCurrent;
|
|
62120
|
+
endItems.forEach(item => {
|
|
62121
|
+
const layoutRect = layout.getItemComputeLayoutRect(item);
|
|
62122
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62123
|
+
item.setLayoutRect(rect);
|
|
62124
|
+
const itemTotalHeight = rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62125
|
+
const itemTotalWidth = rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62126
|
+
if (preRight < itemTotalWidth) {
|
|
62127
|
+
preRight = layout.rightCurrent;
|
|
61775
62128
|
preBottom -= maxHeight;
|
|
61776
62129
|
maxHeight = itemTotalHeight;
|
|
61777
62130
|
item.setLayoutStartPosition({
|
|
61778
|
-
x:
|
|
62131
|
+
x: layout.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
61779
62132
|
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
61780
62133
|
});
|
|
61781
62134
|
}
|
|
62135
|
+
else {
|
|
62136
|
+
item.setLayoutStartPosition({
|
|
62137
|
+
x: preRight + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62138
|
+
y: preBottom + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62139
|
+
});
|
|
62140
|
+
maxHeight = Math.max(maxHeight, itemTotalHeight);
|
|
62141
|
+
preRight -= itemTotalWidth;
|
|
62142
|
+
}
|
|
61782
62143
|
});
|
|
61783
|
-
|
|
62144
|
+
layout.bottomCurrent = preBottom - maxHeight;
|
|
62145
|
+
}
|
|
62146
|
+
}
|
|
62147
|
+
|
|
62148
|
+
class Layout {
|
|
62149
|
+
constructor(_spec, ctx) {
|
|
62150
|
+
this.leftCurrent = 0;
|
|
62151
|
+
this.topCurrent = 0;
|
|
62152
|
+
this.rightCurrent = 0;
|
|
62153
|
+
this.bottomCurrent = 0;
|
|
62154
|
+
this._onError = ctx === null || ctx === void 0 ? void 0 : ctx.onError;
|
|
62155
|
+
}
|
|
62156
|
+
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
62157
|
+
this._chartLayoutRect = chartLayoutRect;
|
|
62158
|
+
this._chartViewBox = chartViewBox;
|
|
62159
|
+
this.leftCurrent = chartLayoutRect.x;
|
|
62160
|
+
this.topCurrent = chartLayoutRect.y;
|
|
62161
|
+
this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
62162
|
+
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
62163
|
+
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
62164
|
+
this.layoutNormalInlineItems(items.filter(x => x.layoutType === 'normal-inline'));
|
|
62165
|
+
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
62166
|
+
const layoutTemp = {
|
|
62167
|
+
leftCurrent: this.leftCurrent,
|
|
62168
|
+
topCurrent: this.topCurrent,
|
|
62169
|
+
rightCurrent: this.rightCurrent,
|
|
62170
|
+
bottomCurrent: this.bottomCurrent
|
|
62171
|
+
};
|
|
62172
|
+
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
62173
|
+
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
62174
|
+
this.layoutRegionItems(regionItems, relativeItems);
|
|
62175
|
+
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
62176
|
+
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
62177
|
+
if (top || bottom || left || right) {
|
|
62178
|
+
this.topCurrent = layoutTemp.topCurrent + top;
|
|
62179
|
+
this.bottomCurrent = layoutTemp.bottomCurrent - bottom;
|
|
62180
|
+
this.leftCurrent = layoutTemp.leftCurrent + left;
|
|
62181
|
+
this.rightCurrent = layoutTemp.rightCurrent - right;
|
|
62182
|
+
this.layoutRegionItems(regionItems, relativeItems);
|
|
62183
|
+
}
|
|
62184
|
+
}
|
|
62185
|
+
this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));
|
|
62186
|
+
}
|
|
62187
|
+
layoutNormalItems(normalItems) {
|
|
62188
|
+
normalItems.forEach(item => {
|
|
62189
|
+
const layoutRect = this.getItemComputeLayoutRect(item);
|
|
62190
|
+
const rect = item.computeBoundsInRect(layoutRect);
|
|
62191
|
+
item.setLayoutRect(rect);
|
|
62192
|
+
if (item.layoutOrient === 'left') {
|
|
62193
|
+
item.setLayoutStartPosition({
|
|
62194
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62195
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62196
|
+
});
|
|
62197
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62198
|
+
}
|
|
62199
|
+
else if (item.layoutOrient === 'top') {
|
|
62200
|
+
item.setLayoutStartPosition({
|
|
62201
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,
|
|
62202
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62203
|
+
});
|
|
62204
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62205
|
+
}
|
|
62206
|
+
else if (item.layoutOrient === 'right') {
|
|
62207
|
+
item.setLayoutStartPosition({
|
|
62208
|
+
x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,
|
|
62209
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
62210
|
+
});
|
|
62211
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
62212
|
+
}
|
|
62213
|
+
else if (item.layoutOrient === 'bottom') {
|
|
62214
|
+
item.setLayoutStartPosition({
|
|
62215
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,
|
|
62216
|
+
y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom
|
|
62217
|
+
});
|
|
62218
|
+
this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
62219
|
+
}
|
|
62220
|
+
});
|
|
62221
|
+
}
|
|
62222
|
+
layoutNormalInlineItems(normalItems) {
|
|
62223
|
+
const leftItems = normalItems.filter(item => item.layoutOrient === 'left');
|
|
62224
|
+
const rightItems = normalItems.filter(item => item.layoutOrient === 'right');
|
|
62225
|
+
const topItems = normalItems.filter(item => item.layoutOrient === 'top');
|
|
62226
|
+
const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');
|
|
62227
|
+
const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;
|
|
62228
|
+
const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;
|
|
62229
|
+
layoutLeftInlineItems(leftItems, this, limitHeight);
|
|
62230
|
+
layoutTopInlineItems(topItems, this, limitWidth);
|
|
62231
|
+
layoutRightInlineItems(rightItems, this, limitHeight);
|
|
62232
|
+
layoutBottomInlineItems(bottomItems, this, limitWidth);
|
|
61784
62233
|
}
|
|
61785
62234
|
layoutRegionItems(regionItems, regionRelativeItems) {
|
|
61786
|
-
let regionRelativeTotalWidth = this.
|
|
61787
|
-
let regionRelativeTotalHeight = this.
|
|
62235
|
+
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
62236
|
+
let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
61788
62237
|
regionRelativeItems
|
|
61789
62238
|
.filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')
|
|
61790
62239
|
.forEach(item => {
|
|
@@ -61793,18 +62242,18 @@
|
|
|
61793
62242
|
item.setLayoutRect({ width: rect.width });
|
|
61794
62243
|
if (item.layoutOrient === 'left') {
|
|
61795
62244
|
item.setLayoutStartPosition({
|
|
61796
|
-
x: this.
|
|
62245
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61797
62246
|
});
|
|
61798
|
-
this.
|
|
62247
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61799
62248
|
}
|
|
61800
62249
|
else if (item.layoutOrient === 'right') {
|
|
61801
|
-
this.
|
|
62250
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;
|
|
61802
62251
|
item.setLayoutStartPosition({
|
|
61803
|
-
x: this.
|
|
62252
|
+
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61804
62253
|
});
|
|
61805
62254
|
}
|
|
61806
62255
|
});
|
|
61807
|
-
regionRelativeTotalWidth = this.
|
|
62256
|
+
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
61808
62257
|
regionRelativeItems
|
|
61809
62258
|
.filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
|
|
61810
62259
|
.forEach(item => {
|
|
@@ -61813,26 +62262,28 @@
|
|
|
61813
62262
|
item.setLayoutRect({ height: rect.height });
|
|
61814
62263
|
if (item.layoutOrient === 'top') {
|
|
61815
62264
|
item.setLayoutStartPosition({
|
|
61816
|
-
y: this.
|
|
62265
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61817
62266
|
});
|
|
61818
|
-
this.
|
|
62267
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61819
62268
|
}
|
|
61820
62269
|
else if (item.layoutOrient === 'bottom') {
|
|
61821
|
-
this.
|
|
62270
|
+
this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
61822
62271
|
item.setLayoutStartPosition({
|
|
61823
|
-
y: this.
|
|
62272
|
+
y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
61824
62273
|
});
|
|
61825
62274
|
}
|
|
61826
62275
|
});
|
|
61827
|
-
regionRelativeTotalHeight = this.
|
|
62276
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
62277
|
+
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; }));
|
|
62278
|
+
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; }));
|
|
61828
62279
|
regionItems.forEach(region => {
|
|
61829
62280
|
region.setLayoutRect({
|
|
61830
|
-
width:
|
|
61831
|
-
height:
|
|
62281
|
+
width: regionWidth,
|
|
62282
|
+
height: regionHeight
|
|
61832
62283
|
});
|
|
61833
62284
|
region.setLayoutStartPosition({
|
|
61834
|
-
x: this.
|
|
61835
|
-
y: this.
|
|
62285
|
+
x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
|
|
62286
|
+
y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
|
|
61836
62287
|
});
|
|
61837
62288
|
});
|
|
61838
62289
|
regionRelativeItems.forEach(item => {
|
|
@@ -61844,6 +62295,11 @@
|
|
|
61844
62295
|
item.setLayoutStartPosition({
|
|
61845
62296
|
y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop
|
|
61846
62297
|
});
|
|
62298
|
+
if (item.layoutOrient === 'right') {
|
|
62299
|
+
item.setLayoutStartPosition({
|
|
62300
|
+
x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth
|
|
62301
|
+
});
|
|
62302
|
+
}
|
|
61847
62303
|
}
|
|
61848
62304
|
else if (['top', 'bottom'].includes(item.layoutOrient)) {
|
|
61849
62305
|
const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);
|
|
@@ -61853,6 +62309,11 @@
|
|
|
61853
62309
|
item.setLayoutStartPosition({
|
|
61854
62310
|
x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft
|
|
61855
62311
|
});
|
|
62312
|
+
if (item.layoutOrient === 'bottom') {
|
|
62313
|
+
item.setLayoutStartPosition({
|
|
62314
|
+
y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight
|
|
62315
|
+
});
|
|
62316
|
+
}
|
|
61856
62317
|
}
|
|
61857
62318
|
});
|
|
61858
62319
|
}
|
|
@@ -61871,8 +62332,8 @@
|
|
|
61871
62332
|
}
|
|
61872
62333
|
getItemComputeLayoutRect(item) {
|
|
61873
62334
|
const result = {
|
|
61874
|
-
width: this.
|
|
61875
|
-
height: this.
|
|
62335
|
+
width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,
|
|
62336
|
+
height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom
|
|
61876
62337
|
};
|
|
61877
62338
|
return result;
|
|
61878
62339
|
}
|
|
@@ -61883,8 +62344,8 @@
|
|
|
61883
62344
|
bottom: 0,
|
|
61884
62345
|
right: 0
|
|
61885
62346
|
};
|
|
61886
|
-
const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this.
|
|
61887
|
-
const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this.
|
|
62347
|
+
const rightCurrent = this._chartViewBox.x2 - this._chartViewBox.x1 - this.rightCurrent;
|
|
62348
|
+
const bottomCurrent = this._chartViewBox.y2 - this._chartViewBox.y1 - this.bottomCurrent;
|
|
61888
62349
|
items.forEach(i => {
|
|
61889
62350
|
if (!i.getVisible() || !i.getAutoIndent()) {
|
|
61890
62351
|
return;
|
|
@@ -61892,11 +62353,11 @@
|
|
|
61892
62353
|
const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';
|
|
61893
62354
|
const outer = i.getLastComputeOutBounds();
|
|
61894
62355
|
if (vOrH) {
|
|
61895
|
-
result.top = Math.max(result.top, outer.y1 - this.
|
|
62356
|
+
result.top = Math.max(result.top, outer.y1 - this.topCurrent);
|
|
61896
62357
|
result.bottom = Math.max(result.bottom, outer.y2 - bottomCurrent);
|
|
61897
62358
|
}
|
|
61898
62359
|
else {
|
|
61899
|
-
result.left = Math.max(result.left, outer.x1 - this.
|
|
62360
|
+
result.left = Math.max(result.left, outer.x1 - this.leftCurrent);
|
|
61900
62361
|
result.right = Math.max(result.right, outer.x2 - rightCurrent);
|
|
61901
62362
|
}
|
|
61902
62363
|
});
|
|
@@ -62216,6 +62677,9 @@
|
|
|
62216
62677
|
}
|
|
62217
62678
|
}
|
|
62218
62679
|
|
|
62680
|
+
const keptInUpdateAttribute = {
|
|
62681
|
+
defined: true
|
|
62682
|
+
};
|
|
62219
62683
|
class CompilableMark extends GrammarItem {
|
|
62220
62684
|
getSupport3d() {
|
|
62221
62685
|
return this._support3d;
|
|
@@ -62432,6 +62896,9 @@
|
|
|
62432
62896
|
dependency: [this.stateKeyToSignalName('markUpdateRank')]
|
|
62433
62897
|
};
|
|
62434
62898
|
}
|
|
62899
|
+
else if (keptInUpdateAttribute[key]) {
|
|
62900
|
+
updateStyles[key] = normalStyle[key].style;
|
|
62901
|
+
}
|
|
62435
62902
|
else {
|
|
62436
62903
|
enterStyles[key] = this.compileCommonAttributeCallback(key, 'normal');
|
|
62437
62904
|
}
|
|
@@ -62850,7 +63317,7 @@
|
|
|
62850
63317
|
computeColor = color(data, this._attributeContext, opt, markData);
|
|
62851
63318
|
}
|
|
62852
63319
|
if (isValid$1(opacity)) {
|
|
62853
|
-
computeColor = Color.SetOpacity(computeColor, opacity);
|
|
63320
|
+
computeColor = Color$1.SetOpacity(computeColor, opacity);
|
|
62854
63321
|
}
|
|
62855
63322
|
return {
|
|
62856
63323
|
offset: isFunction$1(offset) ? offset(data, this._attributeContext, opt, markData) : offset,
|
|
@@ -62995,7 +63462,7 @@
|
|
|
62995
63462
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
62996
63463
|
Factory.registerRegion('region', Region);
|
|
62997
63464
|
Factory.registerLayout('base', Layout);
|
|
62998
|
-
const version = "1.4.0
|
|
63465
|
+
const version = "1.4.0";
|
|
62999
63466
|
Logger.getInstance(LoggerLevel.Error);
|
|
63000
63467
|
|
|
63001
63468
|
const WordCloud3dAnimation = (params) => {
|
|
@@ -64232,17 +64699,26 @@
|
|
|
64232
64699
|
});
|
|
64233
64700
|
}
|
|
64234
64701
|
encodeDefined(mark, attr) {
|
|
64235
|
-
var _a, _b;
|
|
64702
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64236
64703
|
if (!mark) {
|
|
64237
64704
|
return;
|
|
64238
64705
|
}
|
|
64239
64706
|
const statistics = (_b = (_a = this.getViewDataStatistics()) === null || _a === void 0 ? void 0 : _a.latestData) === null || _b === void 0 ? void 0 : _b[this.getStackValueField()];
|
|
64240
64707
|
if (this._invalidType === 'zero' || (statistics && (statistics === null || statistics === void 0 ? void 0 : statistics.allValid))) {
|
|
64708
|
+
if (((_d = (_c = mark.stateStyle.normal) === null || _c === void 0 ? void 0 : _c[attr]) === null || _d === void 0 ? void 0 : _d.style) === true) {
|
|
64709
|
+
return;
|
|
64710
|
+
}
|
|
64241
64711
|
this.setMarkStyle(mark, { [attr]: true }, 'normal', AttributeLevel.Series);
|
|
64242
64712
|
}
|
|
64243
64713
|
else {
|
|
64714
|
+
if (((_f = (_e = mark.stateStyle.normal) === null || _e === void 0 ? void 0 : _e[attr]) === null || _f === void 0 ? void 0 : _f.style) !== true) {
|
|
64715
|
+
return;
|
|
64716
|
+
}
|
|
64244
64717
|
this.setMarkStyle(mark, { [attr]: this._getInvalidDefined }, 'normal', AttributeLevel.Series);
|
|
64245
64718
|
}
|
|
64719
|
+
if (mark.getProduct()) {
|
|
64720
|
+
mark.compileEncode();
|
|
64721
|
+
}
|
|
64246
64722
|
}
|
|
64247
64723
|
}
|
|
64248
64724
|
|
|
@@ -65242,6 +65718,10 @@
|
|
|
65242
65718
|
getStack() {
|
|
65243
65719
|
return this._stack;
|
|
65244
65720
|
}
|
|
65721
|
+
getStackValue() {
|
|
65722
|
+
var _a;
|
|
65723
|
+
return (_a = this._spec.stackValue) !== null && _a !== void 0 ? _a : `${PREFIX}_series_${this.type}`;
|
|
65724
|
+
}
|
|
65245
65725
|
getPercent() {
|
|
65246
65726
|
return this._percent;
|
|
65247
65727
|
}
|
|
@@ -65335,6 +65815,9 @@
|
|
|
65335
65815
|
this._stackOffsetSilhouette = this._spec.stackOffsetSilhouette;
|
|
65336
65816
|
this._stack = this._spec.stackOffsetSilhouette || this._stack;
|
|
65337
65817
|
}
|
|
65818
|
+
if (isValid$1(this._spec.stackValue)) {
|
|
65819
|
+
this._stack = true;
|
|
65820
|
+
}
|
|
65338
65821
|
if (isValid$1(this._spec.invalidType)) {
|
|
65339
65822
|
this._invalidType = this._spec.invalidType;
|
|
65340
65823
|
}
|
|
@@ -65769,8 +66252,8 @@
|
|
|
65769
66252
|
_compareSpec(ignoreCheckKeys) {
|
|
65770
66253
|
var _a, _b;
|
|
65771
66254
|
const result = super._compareSpec();
|
|
65772
|
-
const currentKeys = Object.keys(this._originalSpec).sort();
|
|
65773
|
-
const nextKeys = Object.keys(this._spec).sort();
|
|
66255
|
+
const currentKeys = Object.keys(this._originalSpec || {}).sort();
|
|
66256
|
+
const nextKeys = Object.keys(this._spec || {}).sort();
|
|
65774
66257
|
if (!isEqual$1(currentKeys, nextKeys)) {
|
|
65775
66258
|
result.reMake = true;
|
|
65776
66259
|
return result;
|
|
@@ -67106,27 +67589,23 @@
|
|
|
67106
67589
|
class Stack {
|
|
67107
67590
|
constructor(chart) {
|
|
67108
67591
|
this.stackRegion = ({ model }) => {
|
|
67109
|
-
const
|
|
67110
|
-
|
|
67111
|
-
|
|
67112
|
-
|
|
67113
|
-
const stackData = s.getStackData();
|
|
67114
|
-
const stackValueField = s.getStackValueField();
|
|
67115
|
-
if (stackData && stackValueField) {
|
|
67116
|
-
this.stackGroup(stackData, stackCache, stackValueField);
|
|
67592
|
+
const stackValueGroup = getRegionStackGroup(model, true);
|
|
67593
|
+
for (const stackValue in stackValueGroup) {
|
|
67594
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
67595
|
+
stack(stackValueGroup[stackValue].nodes[key], model.getStackInverse());
|
|
67117
67596
|
}
|
|
67118
|
-
});
|
|
67119
|
-
for (const key in stackCache.nodes) {
|
|
67120
|
-
this.stack(stackCache.nodes[key]);
|
|
67121
67597
|
}
|
|
67122
|
-
for (const
|
|
67123
|
-
|
|
67598
|
+
for (const stackValue in stackValueGroup) {
|
|
67599
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
67600
|
+
stackOffsetSilhouette(stackValueGroup[stackValue].nodes[key]);
|
|
67601
|
+
}
|
|
67124
67602
|
}
|
|
67125
67603
|
model.getSeries().forEach(s => {
|
|
67126
67604
|
const stackData = s.getStackData();
|
|
67605
|
+
const stackValue = s.getStackValue();
|
|
67127
67606
|
const stackValueField = s.getStackValueField();
|
|
67128
67607
|
if (stackData && stackValueField) {
|
|
67129
|
-
|
|
67608
|
+
stackTotal(stackValueGroup[stackValue], stackValueField);
|
|
67130
67609
|
}
|
|
67131
67610
|
});
|
|
67132
67611
|
};
|
|
@@ -67142,81 +67621,6 @@
|
|
|
67142
67621
|
this.stackRegion({ model: r });
|
|
67143
67622
|
});
|
|
67144
67623
|
}
|
|
67145
|
-
stackTotal(stackData, valueField) {
|
|
67146
|
-
if ('values' in stackData && stackData.values.length) {
|
|
67147
|
-
const total = sum(stackData.values, valueField);
|
|
67148
|
-
const percent = max(stackData.values, STACK_FIELD_END_PERCENT);
|
|
67149
|
-
stackData.values.forEach(v => {
|
|
67150
|
-
v[STACK_FIELD_TOTAL] = total;
|
|
67151
|
-
v[STACK_FIELD_TOTAL_PERCENT] = percent;
|
|
67152
|
-
delete v[STACK_FIELD_TOTAL_TOP];
|
|
67153
|
-
});
|
|
67154
|
-
const maxNode = stackData.values.reduce((max, current) => {
|
|
67155
|
-
return current[STACK_FIELD_END] > max[STACK_FIELD_END] ? current : max;
|
|
67156
|
-
});
|
|
67157
|
-
maxNode[STACK_FIELD_TOTAL_TOP] = true;
|
|
67158
|
-
return;
|
|
67159
|
-
}
|
|
67160
|
-
for (const key in stackData.nodes) {
|
|
67161
|
-
this.stackTotal(stackData.nodes[key], valueField);
|
|
67162
|
-
}
|
|
67163
|
-
}
|
|
67164
|
-
stackOffsetSilhouette(stackCache) {
|
|
67165
|
-
if (!stackCache.values.length) {
|
|
67166
|
-
return;
|
|
67167
|
-
}
|
|
67168
|
-
const centerValue = stackCache.values[stackCache.values.length - 1][STACK_FIELD_END] / 2;
|
|
67169
|
-
for (let j = 0; j < stackCache.values.length; j++) {
|
|
67170
|
-
stackCache.values[j][STACK_FIELD_START_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_START] - centerValue;
|
|
67171
|
-
stackCache.values[j][STACK_FIELD_END_OffsetSilhouette] = stackCache.values[j][STACK_FIELD_END] - centerValue;
|
|
67172
|
-
}
|
|
67173
|
-
}
|
|
67174
|
-
stack(stackCache) {
|
|
67175
|
-
if (stackCache.values.length > 0) {
|
|
67176
|
-
let positiveStart = 0;
|
|
67177
|
-
let negativeStart = 0;
|
|
67178
|
-
let sign = 1;
|
|
67179
|
-
let value = 0;
|
|
67180
|
-
stackCache.values.forEach(v => {
|
|
67181
|
-
value = v[STACK_FIELD_END];
|
|
67182
|
-
if (value >= 0) {
|
|
67183
|
-
v[STACK_FIELD_START] = positiveStart;
|
|
67184
|
-
positiveStart += v[STACK_FIELD_END];
|
|
67185
|
-
v[STACK_FIELD_END] = positiveStart;
|
|
67186
|
-
}
|
|
67187
|
-
else {
|
|
67188
|
-
v[STACK_FIELD_START] = negativeStart;
|
|
67189
|
-
negativeStart += v[STACK_FIELD_END];
|
|
67190
|
-
v[STACK_FIELD_END] = negativeStart;
|
|
67191
|
-
}
|
|
67192
|
-
});
|
|
67193
|
-
stackCache.values.forEach(v => {
|
|
67194
|
-
value = v[STACK_FIELD_END];
|
|
67195
|
-
const denominator = value >= 0 ? positiveStart : negativeStart;
|
|
67196
|
-
sign = value >= 0 ? 1 : -1;
|
|
67197
|
-
v[STACK_FIELD_START_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_START] / denominator) * sign;
|
|
67198
|
-
v[STACK_FIELD_END_PERCENT] = denominator === 0 ? 0 : Math.min(1, v[STACK_FIELD_END] / denominator) * sign;
|
|
67199
|
-
});
|
|
67200
|
-
}
|
|
67201
|
-
for (const key in stackCache.nodes) {
|
|
67202
|
-
this.stack(stackCache.nodes[key]);
|
|
67203
|
-
}
|
|
67204
|
-
}
|
|
67205
|
-
stackGroup(stackData, stackCache, valueField) {
|
|
67206
|
-
if ('values' in stackData) {
|
|
67207
|
-
stackData.values.forEach(v => (v[STACK_FIELD_END] = toValidNumber(v[valueField])));
|
|
67208
|
-
stackCache.values.push(...stackData.values);
|
|
67209
|
-
return;
|
|
67210
|
-
}
|
|
67211
|
-
for (const key in stackData.nodes) {
|
|
67212
|
-
!stackCache.nodes[key] &&
|
|
67213
|
-
(stackCache.nodes[key] = {
|
|
67214
|
-
values: [],
|
|
67215
|
-
nodes: {}
|
|
67216
|
-
});
|
|
67217
|
-
this.stackGroup(stackData.nodes[key], stackCache.nodes[key], valueField);
|
|
67218
|
-
}
|
|
67219
|
-
}
|
|
67220
67624
|
}
|
|
67221
67625
|
|
|
67222
67626
|
class BaseChart extends CompilableBase {
|
|
@@ -67405,6 +67809,9 @@
|
|
|
67405
67809
|
if (!has$2(spec, 'tooltip')) {
|
|
67406
67810
|
spec.tooltip = {};
|
|
67407
67811
|
}
|
|
67812
|
+
if (isValid$1(spec.stackInverse)) {
|
|
67813
|
+
spec.region.forEach((r) => !isValid$1(r.stackInverse) && (r.stackInverse = spec.stackInverse));
|
|
67814
|
+
}
|
|
67408
67815
|
}
|
|
67409
67816
|
init(options = {}) {
|
|
67410
67817
|
this.initRegion();
|
|
@@ -68355,6 +68762,48 @@
|
|
|
68355
68762
|
}
|
|
68356
68763
|
RectMark.type = MarkTypeEnum.rect;
|
|
68357
68764
|
|
|
68765
|
+
function stackWithMinHeight(stackCache, stackInverse, context) {
|
|
68766
|
+
if (stackCache.values.length > 0) {
|
|
68767
|
+
let seriesInfo = stackCache.series;
|
|
68768
|
+
if (stackInverse) {
|
|
68769
|
+
seriesInfo = [...seriesInfo].reverse();
|
|
68770
|
+
}
|
|
68771
|
+
let lastY;
|
|
68772
|
+
seriesInfo.forEach(({ s, values }, sIndex) => {
|
|
68773
|
+
var _a, _b;
|
|
68774
|
+
const barMinHeight = s.getSpec().barMinHeight;
|
|
68775
|
+
const seriesScale = (_b = (_a = s[context.axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
68776
|
+
const inverse = s[context.axisHelper].isInverse();
|
|
68777
|
+
for (let index = 0; index < values.length; index++) {
|
|
68778
|
+
const obj = values[stackInverse ? values.length - 1 - index : index];
|
|
68779
|
+
const y1 = valueInScaleRange(s[context.startMethod](obj), seriesScale);
|
|
68780
|
+
let y = valueInScaleRange(s[context.endMethod](obj), seriesScale);
|
|
68781
|
+
if (index === 0 && sIndex === 0) {
|
|
68782
|
+
lastY = y1;
|
|
68783
|
+
}
|
|
68784
|
+
let height = Math.abs(y1 - y);
|
|
68785
|
+
if (height < barMinHeight) {
|
|
68786
|
+
height = barMinHeight;
|
|
68787
|
+
}
|
|
68788
|
+
let flag = 1;
|
|
68789
|
+
if (y < y1) {
|
|
68790
|
+
flag = -1;
|
|
68791
|
+
}
|
|
68792
|
+
else if (y === y1) {
|
|
68793
|
+
flag = context.isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
|
|
68794
|
+
}
|
|
68795
|
+
y = lastY + flag * height;
|
|
68796
|
+
obj[context.start] = lastY;
|
|
68797
|
+
obj[context.end] = y;
|
|
68798
|
+
lastY = y;
|
|
68799
|
+
}
|
|
68800
|
+
});
|
|
68801
|
+
}
|
|
68802
|
+
for (const key in stackCache.nodes) {
|
|
68803
|
+
stackWithMinHeight(stackCache.nodes[key], stackInverse, context);
|
|
68804
|
+
}
|
|
68805
|
+
}
|
|
68806
|
+
|
|
68358
68807
|
VChart.useMark([RectMark, TextMark]);
|
|
68359
68808
|
const DefaultBandWidth$2 = 6;
|
|
68360
68809
|
const RECT_X = `${PREFIX}_rect_x`;
|
|
@@ -68448,61 +68897,19 @@
|
|
|
68448
68897
|
endMethod = 'dataToPositionX';
|
|
68449
68898
|
axisHelper = '_xAxisHelper';
|
|
68450
68899
|
}
|
|
68451
|
-
const
|
|
68452
|
-
const
|
|
68453
|
-
|
|
68454
|
-
|
|
68455
|
-
|
|
68456
|
-
|
|
68457
|
-
|
|
68458
|
-
|
|
68459
|
-
|
|
68460
|
-
|
|
68461
|
-
|
|
68462
|
-
|
|
68463
|
-
|
|
68464
|
-
obj.seriesId = seriesId;
|
|
68465
|
-
groupedStackData[currentKey].push(obj);
|
|
68466
|
-
});
|
|
68467
|
-
}
|
|
68468
|
-
});
|
|
68469
|
-
};
|
|
68470
|
-
barSeriesArr.forEach(s => {
|
|
68471
|
-
const stackData = s.getStackData();
|
|
68472
|
-
iterateStackData(stackData, '', s.id);
|
|
68473
|
-
});
|
|
68474
|
-
Object.keys(groupedStackData).forEach(key => {
|
|
68475
|
-
const values = groupedStackData[key];
|
|
68476
|
-
values.sort((a, b) => Math.abs(a[STACK_FIELD_START]) - Math.abs(b[STACK_FIELD_START]));
|
|
68477
|
-
let lastY;
|
|
68478
|
-
values.forEach((obj, index) => {
|
|
68479
|
-
var _a, _b;
|
|
68480
|
-
const series = barSeriesArr.find(s => s.id === obj.seriesId);
|
|
68481
|
-
const barMinHeight = series.getSpec().barMinHeight;
|
|
68482
|
-
const seriesScale = (_b = (_a = series[axisHelper]).getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0);
|
|
68483
|
-
const inverse = series[axisHelper].isInverse();
|
|
68484
|
-
const y1 = valueInScaleRange(series[startMethod](obj), seriesScale);
|
|
68485
|
-
let y = valueInScaleRange(series[endMethod](obj), seriesScale);
|
|
68486
|
-
if (index === 0) {
|
|
68487
|
-
lastY = y1;
|
|
68488
|
-
}
|
|
68489
|
-
let height = Math.abs(y1 - y);
|
|
68490
|
-
if (height < barMinHeight) {
|
|
68491
|
-
height = barMinHeight;
|
|
68492
|
-
}
|
|
68493
|
-
let flag = 1;
|
|
68494
|
-
if (y < y1) {
|
|
68495
|
-
flag = -1;
|
|
68496
|
-
}
|
|
68497
|
-
else if (y === y1) {
|
|
68498
|
-
flag = isVertical ? (inverse ? 1 : -1) : inverse ? -1 : 1;
|
|
68499
|
-
}
|
|
68500
|
-
y = lastY + flag * height;
|
|
68501
|
-
obj[start] = lastY;
|
|
68502
|
-
obj[end] = y;
|
|
68503
|
-
lastY = y;
|
|
68504
|
-
});
|
|
68505
|
-
});
|
|
68900
|
+
const stackValueGroup = getRegionStackGroup(region, false, s => s.type === SeriesTypeEnum.bar);
|
|
68901
|
+
for (const stackValue in stackValueGroup) {
|
|
68902
|
+
for (const key in stackValueGroup[stackValue].nodes) {
|
|
68903
|
+
stackWithMinHeight(stackValueGroup[stackValue].nodes[key], region.getStackInverse(), {
|
|
68904
|
+
isVertical,
|
|
68905
|
+
start,
|
|
68906
|
+
end,
|
|
68907
|
+
startMethod,
|
|
68908
|
+
endMethod,
|
|
68909
|
+
axisHelper
|
|
68910
|
+
});
|
|
68911
|
+
}
|
|
68912
|
+
}
|
|
68506
68913
|
}
|
|
68507
68914
|
_calculateRectPosition(datum, isVertical) {
|
|
68508
68915
|
var _a, _b;
|
|
@@ -82991,13 +83398,15 @@
|
|
|
82991
83398
|
return this._container;
|
|
82992
83399
|
}
|
|
82993
83400
|
_compareSpec() {
|
|
83401
|
+
var _a;
|
|
82994
83402
|
const result = super._compareSpec();
|
|
82995
83403
|
if (!result.reMake) {
|
|
82996
83404
|
result.reMake = ['seriesId', 'seriesIndex', 'regionId', 'regionIndex'].some(k => {
|
|
82997
|
-
|
|
83405
|
+
var _a;
|
|
83406
|
+
return isEqual$1((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a[k], this.getSpec()[k]);
|
|
82998
83407
|
});
|
|
82999
83408
|
}
|
|
83000
|
-
if (this._originalSpec.visible !== this.getSpec().visible) {
|
|
83409
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.visible) !== this.getSpec().visible) {
|
|
83001
83410
|
result.reCompile = true;
|
|
83002
83411
|
}
|
|
83003
83412
|
return result;
|
|
@@ -83008,6 +83417,16 @@
|
|
|
83008
83417
|
}
|
|
83009
83418
|
clear() {
|
|
83010
83419
|
var _a;
|
|
83420
|
+
const components = this.getVRenderComponents();
|
|
83421
|
+
if (components && components.length) {
|
|
83422
|
+
components.forEach(c => {
|
|
83423
|
+
var _a;
|
|
83424
|
+
if (c) {
|
|
83425
|
+
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
|
|
83426
|
+
c = null;
|
|
83427
|
+
}
|
|
83428
|
+
});
|
|
83429
|
+
}
|
|
83011
83430
|
this._container = null;
|
|
83012
83431
|
(_a = this.pluginService) === null || _a === void 0 ? void 0 : _a.disposeAll();
|
|
83013
83432
|
this.pluginService = null;
|
|
@@ -83116,7 +83535,7 @@
|
|
|
83116
83535
|
if (this._relatedAxisComponent && this._filterMode === IFilterMode.axis) {
|
|
83117
83536
|
const axisScale = this._relatedAxisComponent.getScale();
|
|
83118
83537
|
const axisSpec = this._relatedAxisComponent.getSpec();
|
|
83119
|
-
if (this._auto) {
|
|
83538
|
+
if (this._auto && this._getAxisBandSize(axisSpec)) {
|
|
83120
83539
|
axisScale.range((_a = this._stateScale) === null || _a === void 0 ? void 0 : _a.range(), true);
|
|
83121
83540
|
}
|
|
83122
83541
|
const newRangeFactor = axisScale.range()[0] < axisScale.range()[1] || axisSpec.inverse
|
|
@@ -83539,15 +83958,23 @@
|
|
|
83539
83958
|
var _a;
|
|
83540
83959
|
(_a = this._component) === null || _a === void 0 ? void 0 : _a.showAll();
|
|
83541
83960
|
}
|
|
83961
|
+
_getAxisBandSize(axisSpec) {
|
|
83962
|
+
const bandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.bandSize;
|
|
83963
|
+
const maxBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.maxBandSize;
|
|
83964
|
+
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
83965
|
+
if (bandSize || minBandSize || maxBandSize) {
|
|
83966
|
+
return { bandSize, maxBandSize, minBandSize };
|
|
83967
|
+
}
|
|
83968
|
+
return undefined;
|
|
83969
|
+
}
|
|
83542
83970
|
_autoUpdate(rect) {
|
|
83543
|
-
var _a, _b, _c;
|
|
83971
|
+
var _a, _b, _c, _d;
|
|
83544
83972
|
if (!this._auto) {
|
|
83545
83973
|
return true;
|
|
83546
83974
|
}
|
|
83547
83975
|
const axisSpec = (_a = this._relatedAxisComponent) === null || _a === void 0 ? void 0 : _a.getSpec();
|
|
83548
|
-
const
|
|
83549
|
-
const maxBandSize =
|
|
83550
|
-
const minBandSize = axisSpec === null || axisSpec === void 0 ? void 0 : axisSpec.minBandSize;
|
|
83976
|
+
const bandSizeResult = this._getAxisBandSize(axisSpec);
|
|
83977
|
+
const { bandSize, maxBandSize, minBandSize } = bandSizeResult !== null && bandSizeResult !== void 0 ? bandSizeResult : {};
|
|
83551
83978
|
if ((rect === null || rect === void 0 ? void 0 : rect.height) === ((_b = this._cacheRect) === null || _b === void 0 ? void 0 : _b.height) &&
|
|
83552
83979
|
(rect === null || rect === void 0 ? void 0 : rect.width) === ((_c = this._cacheRect) === null || _c === void 0 ? void 0 : _c.width) &&
|
|
83553
83980
|
this._fixedBandSize === bandSize) {
|
|
@@ -83558,7 +83985,7 @@
|
|
|
83558
83985
|
const scale = this._stateScale;
|
|
83559
83986
|
scale.range(this._isHorizontal ? [0, rect.width] : axisSpec.inverse ? [0, rect.height] : [rect.height, 0]);
|
|
83560
83987
|
if (isDiscrete(scale.type)) {
|
|
83561
|
-
if (
|
|
83988
|
+
if (bandSizeResult) {
|
|
83562
83989
|
if (this._start || this._end) {
|
|
83563
83990
|
scale.rangeFactor([this._start, this._end], true);
|
|
83564
83991
|
}
|
|
@@ -83571,26 +83998,26 @@
|
|
|
83571
83998
|
if (minBandSize) {
|
|
83572
83999
|
scale.minBandwidth(minBandSize, true);
|
|
83573
84000
|
}
|
|
83574
|
-
scale.rescale(
|
|
83575
|
-
|
|
83576
|
-
|
|
83577
|
-
|
|
83578
|
-
|
|
84001
|
+
scale.rescale();
|
|
84002
|
+
}
|
|
84003
|
+
let [start, end] = (_d = scale.rangeFactor()) !== null && _d !== void 0 ? _d : [];
|
|
84004
|
+
if ((!start && !end) || !scale.isBandwidthFixed()) {
|
|
84005
|
+
start = 0;
|
|
84006
|
+
end = 1;
|
|
84007
|
+
this.hide();
|
|
84008
|
+
isShown = false;
|
|
84009
|
+
}
|
|
84010
|
+
else {
|
|
84011
|
+
if (start === 0 && end === 1) {
|
|
83579
84012
|
this.hide();
|
|
83580
84013
|
isShown = false;
|
|
83581
84014
|
}
|
|
83582
84015
|
else {
|
|
83583
|
-
|
|
83584
|
-
this.hide();
|
|
83585
|
-
isShown = false;
|
|
83586
|
-
}
|
|
83587
|
-
else {
|
|
83588
|
-
this.show();
|
|
83589
|
-
}
|
|
84016
|
+
this.show();
|
|
83590
84017
|
}
|
|
83591
|
-
this._start = start;
|
|
83592
|
-
this._end = end;
|
|
83593
84018
|
}
|
|
84019
|
+
this._start = start;
|
|
84020
|
+
this._end = end;
|
|
83594
84021
|
}
|
|
83595
84022
|
this.setStartAndEnd(this._start, this._end);
|
|
83596
84023
|
this._cacheVisibility = isShown;
|
|
@@ -83715,13 +84142,8 @@
|
|
|
83715
84142
|
}
|
|
83716
84143
|
return attrs;
|
|
83717
84144
|
}
|
|
83718
|
-
|
|
83719
|
-
|
|
83720
|
-
if (this._component) {
|
|
83721
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
|
|
83722
|
-
this._component = null;
|
|
83723
|
-
}
|
|
83724
|
-
super.clear();
|
|
84145
|
+
getVRenderComponents() {
|
|
84146
|
+
return [this._component];
|
|
83725
84147
|
}
|
|
83726
84148
|
}
|
|
83727
84149
|
ScrollBar.type = ComponentTypeEnum.scrollBar;
|
|
@@ -84004,13 +84426,8 @@
|
|
|
84004
84426
|
}
|
|
84005
84427
|
};
|
|
84006
84428
|
}
|
|
84007
|
-
|
|
84008
|
-
|
|
84009
|
-
if (this._component) {
|
|
84010
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._component);
|
|
84011
|
-
this._component = null;
|
|
84012
|
-
}
|
|
84013
|
-
super.clear();
|
|
84429
|
+
getVRenderComponents() {
|
|
84430
|
+
return [this._component];
|
|
84014
84431
|
}
|
|
84015
84432
|
}
|
|
84016
84433
|
DataZoom.type = ComponentTypeEnum.dataZoom;
|
|
@@ -84085,6 +84502,9 @@
|
|
|
84085
84502
|
}
|
|
84086
84503
|
changeRegions(regions) {
|
|
84087
84504
|
}
|
|
84505
|
+
getVRenderComponents() {
|
|
84506
|
+
return [];
|
|
84507
|
+
}
|
|
84088
84508
|
onRender(ctx) {
|
|
84089
84509
|
}
|
|
84090
84510
|
}
|
|
@@ -84107,6 +84527,7 @@
|
|
|
84107
84527
|
this._needInitOutState = true;
|
|
84108
84528
|
this._isFirstState = true;
|
|
84109
84529
|
this._cacheInteractiveRangeAttrs = [];
|
|
84530
|
+
this._needEnablePickable = true;
|
|
84110
84531
|
}
|
|
84111
84532
|
static createComponent(spec, options) {
|
|
84112
84533
|
const brushSpec = spec.brush || options.defaultSpec;
|
|
@@ -84179,9 +84600,11 @@
|
|
|
84179
84600
|
}
|
|
84180
84601
|
if (operateType === IOperateType.drawing) {
|
|
84181
84602
|
this._needInitOutState = false;
|
|
84603
|
+
this._needEnablePickable = true;
|
|
84182
84604
|
}
|
|
84183
84605
|
if (operateType === IOperateType.drawEnd) {
|
|
84184
84606
|
this._needInitOutState = true;
|
|
84607
|
+
this._needEnablePickable = false;
|
|
84185
84608
|
}
|
|
84186
84609
|
if (operateType === IOperateType.brushClear) {
|
|
84187
84610
|
this._initMarkBrushState(componentIndex, '');
|
|
@@ -84258,6 +84681,7 @@
|
|
|
84258
84681
|
this._outOfBrushElementsMap[elementKey] = el;
|
|
84259
84682
|
delete this._inBrushElementsMap[operateMask.name][elementKey];
|
|
84260
84683
|
}
|
|
84684
|
+
graphicItem.setAttribute('pickable', !this._needEnablePickable);
|
|
84261
84685
|
});
|
|
84262
84686
|
});
|
|
84263
84687
|
}
|
|
@@ -84292,6 +84716,7 @@
|
|
|
84292
84716
|
graphicItem.addState('outOfBrush');
|
|
84293
84717
|
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
84294
84718
|
}
|
|
84719
|
+
graphicItem.setAttribute('pickable', !this._needEnablePickable);
|
|
84295
84720
|
});
|
|
84296
84721
|
});
|
|
84297
84722
|
}
|
|
@@ -84312,17 +84737,38 @@
|
|
|
84312
84737
|
y: b * p.x + d * p.y + f + dy
|
|
84313
84738
|
};
|
|
84314
84739
|
});
|
|
84315
|
-
|
|
84740
|
+
brushMask.globalAABBBounds
|
|
84316
84741
|
.clone()
|
|
84317
84742
|
.set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
84318
84743
|
const x = item.globalTransMatrix.e;
|
|
84319
84744
|
const y = item.globalTransMatrix.f;
|
|
84745
|
+
let itemBounds = [];
|
|
84320
84746
|
if (item.type === 'symbol') {
|
|
84321
|
-
|
|
84747
|
+
const { size: itemSize = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
|
|
84748
|
+
const size = array(itemSize)[0];
|
|
84749
|
+
itemBounds = [
|
|
84750
|
+
{
|
|
84751
|
+
x: x - size,
|
|
84752
|
+
y: y - size
|
|
84753
|
+
},
|
|
84754
|
+
{
|
|
84755
|
+
x: x + size,
|
|
84756
|
+
y: y - size
|
|
84757
|
+
},
|
|
84758
|
+
{
|
|
84759
|
+
x: x + size,
|
|
84760
|
+
y: y + size
|
|
84761
|
+
},
|
|
84762
|
+
{
|
|
84763
|
+
x: x - size,
|
|
84764
|
+
y: y + size
|
|
84765
|
+
}
|
|
84766
|
+
];
|
|
84767
|
+
return polygonIntersectPolygon(pointsCoord, itemBounds);
|
|
84322
84768
|
}
|
|
84323
84769
|
else if (item.type === 'rect') {
|
|
84324
84770
|
const { width = 0, height = 0 } = item === null || item === void 0 ? void 0 : item.attribute;
|
|
84325
|
-
|
|
84771
|
+
itemBounds = [
|
|
84326
84772
|
{
|
|
84327
84773
|
x: x,
|
|
84328
84774
|
y: y
|
|
@@ -84340,7 +84786,7 @@
|
|
|
84340
84786
|
y: y + height
|
|
84341
84787
|
}
|
|
84342
84788
|
];
|
|
84343
|
-
return polygonIntersectPolygon(pointsCoord,
|
|
84789
|
+
return polygonIntersectPolygon(pointsCoord, itemBounds);
|
|
84344
84790
|
}
|
|
84345
84791
|
return brushMask.globalAABBBounds.intersects(item.globalAABBBounds);
|
|
84346
84792
|
}
|
|
@@ -84420,6 +84866,9 @@
|
|
|
84420
84866
|
}
|
|
84421
84867
|
changeRegions(regions) {
|
|
84422
84868
|
}
|
|
84869
|
+
getVRenderComponents() {
|
|
84870
|
+
return this._brushComponents;
|
|
84871
|
+
}
|
|
84423
84872
|
_compareSpec() {
|
|
84424
84873
|
if (this._brushComponents) {
|
|
84425
84874
|
this._relativeRegions.forEach((region, index) => {
|
|
@@ -84972,6 +85421,9 @@
|
|
|
84972
85421
|
}
|
|
84973
85422
|
changeRegions() {
|
|
84974
85423
|
}
|
|
85424
|
+
getVRenderComponents() {
|
|
85425
|
+
return [];
|
|
85426
|
+
}
|
|
84975
85427
|
}
|
|
84976
85428
|
MapLabelComponent.type = ComponentTypeEnum.mapLabel;
|
|
84977
85429
|
MapLabelComponent.speckey = 'mapLabel';
|
|
@@ -85364,6 +85816,9 @@
|
|
|
85364
85816
|
};
|
|
85365
85817
|
this._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
85366
85818
|
}
|
|
85819
|
+
getVRenderComponents() {
|
|
85820
|
+
return [];
|
|
85821
|
+
}
|
|
85367
85822
|
created() {
|
|
85368
85823
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
85369
85824
|
super.created();
|
|
@@ -85477,9 +85932,10 @@
|
|
|
85477
85932
|
}
|
|
85478
85933
|
}
|
|
85479
85934
|
_compareSpec() {
|
|
85935
|
+
var _a, _b;
|
|
85480
85936
|
const result = super._compareSpec();
|
|
85481
85937
|
result.reRender = true;
|
|
85482
|
-
if (this._originalSpec.type !== this._spec.type) {
|
|
85938
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.type) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.type)) {
|
|
85483
85939
|
result.reMake = true;
|
|
85484
85940
|
return result;
|
|
85485
85941
|
}
|
|
@@ -86638,6 +87094,7 @@
|
|
|
86638
87094
|
this.updateFixedWholeLength();
|
|
86639
87095
|
}
|
|
86640
87096
|
updateFixedWholeLength() {
|
|
87097
|
+
var _a;
|
|
86641
87098
|
if (this._scale) {
|
|
86642
87099
|
if (this._spec.bandSize) {
|
|
86643
87100
|
this._scale.bandwidth(this._spec.bandSize);
|
|
@@ -86648,6 +87105,17 @@
|
|
|
86648
87105
|
if (this._spec.minBandSize) {
|
|
86649
87106
|
this._scale.minBandwidth(this._spec.minBandSize);
|
|
86650
87107
|
}
|
|
87108
|
+
if (this._scale.isBandwidthFixed() &&
|
|
87109
|
+
this._spec.autoRegionSize &&
|
|
87110
|
+
(this._spec.bandSize || this._spec.maxBandSize)) {
|
|
87111
|
+
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());
|
|
87112
|
+
if (['bottom', 'top'].includes(this._orient)) {
|
|
87113
|
+
this._regions.forEach(region => region.setMaxWidth(rangeSize));
|
|
87114
|
+
}
|
|
87115
|
+
else if (['left', 'right'].includes(this._orient)) {
|
|
87116
|
+
this._regions.forEach(region => region.setMaxHeight(rangeSize));
|
|
87117
|
+
}
|
|
87118
|
+
}
|
|
86651
87119
|
}
|
|
86652
87120
|
}
|
|
86653
87121
|
}
|
|
@@ -87468,9 +87936,10 @@
|
|
|
87468
87936
|
onRender(ctx) {
|
|
87469
87937
|
}
|
|
87470
87938
|
_compareSpec() {
|
|
87939
|
+
var _a, _b;
|
|
87471
87940
|
const result = super._compareSpec();
|
|
87472
87941
|
result.reRender = true;
|
|
87473
|
-
if (this._spec.orient !== this._originalSpec.orient) {
|
|
87942
|
+
if (((_a = this._spec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._originalSpec) === null || _b === void 0 ? void 0 : _b.orient)) {
|
|
87474
87943
|
result.reMake = true;
|
|
87475
87944
|
return result;
|
|
87476
87945
|
}
|
|
@@ -87547,31 +88016,33 @@
|
|
|
87547
88016
|
this._cacheAttrs = attrs;
|
|
87548
88017
|
const width = isFinite(this._legendComponent.AABBBounds.width()) ? this._legendComponent.AABBBounds.width() : 0;
|
|
87549
88018
|
const height = isFinite(this._legendComponent.AABBBounds.height()) ? this._legendComponent.AABBBounds.height() : 0;
|
|
87550
|
-
|
|
87551
|
-
|
|
87552
|
-
|
|
87553
|
-
|
|
87554
|
-
|
|
87555
|
-
|
|
87556
|
-
if (
|
|
87557
|
-
|
|
87558
|
-
|
|
87559
|
-
|
|
87560
|
-
|
|
87561
|
-
|
|
87562
|
-
|
|
87563
|
-
else {
|
|
87564
|
-
if (position === 'middle') {
|
|
87565
|
-
offsetY = (rectHeight - height) / 2;
|
|
88019
|
+
if (this.layoutType !== 'normal-inline') {
|
|
88020
|
+
const layout = this.layoutOrient === 'bottom' || this.layoutOrient === 'top' ? 'horizontal' : 'vertical';
|
|
88021
|
+
const position = this._position;
|
|
88022
|
+
const { width: rectWidth, height: rectHeight } = fullSpace;
|
|
88023
|
+
let offsetX = 0;
|
|
88024
|
+
let offsetY = 0;
|
|
88025
|
+
if (layout === 'horizontal') {
|
|
88026
|
+
if (position === 'middle') {
|
|
88027
|
+
offsetX = (rectWidth - width) / 2;
|
|
88028
|
+
}
|
|
88029
|
+
else if (position === 'end') {
|
|
88030
|
+
offsetX = rectWidth - width;
|
|
88031
|
+
}
|
|
87566
88032
|
}
|
|
87567
|
-
else
|
|
87568
|
-
|
|
88033
|
+
else {
|
|
88034
|
+
if (position === 'middle') {
|
|
88035
|
+
offsetY = (rectHeight - height) / 2;
|
|
88036
|
+
}
|
|
88037
|
+
else if (position === 'end') {
|
|
88038
|
+
offsetY = rectHeight - height;
|
|
88039
|
+
}
|
|
87569
88040
|
}
|
|
88041
|
+
this._legendComponent.setAttributes({
|
|
88042
|
+
dx: offsetX,
|
|
88043
|
+
dy: offsetY
|
|
88044
|
+
});
|
|
87570
88045
|
}
|
|
87571
|
-
this._legendComponent.setAttributes({
|
|
87572
|
-
dx: offsetX,
|
|
87573
|
-
dy: offsetY
|
|
87574
|
-
});
|
|
87575
88046
|
result.x2 = result.x1 + width;
|
|
87576
88047
|
result.y2 = result.y1 + height;
|
|
87577
88048
|
return result;
|
|
@@ -87592,15 +88063,13 @@
|
|
|
87592
88063
|
(_b = (_a = this.effect).onSelectedDataChange) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
87593
88064
|
this.event.emit(ChartEvent.legendSelectedDataChange, { model: this });
|
|
87594
88065
|
}
|
|
88066
|
+
getVRenderComponents() {
|
|
88067
|
+
return [this._legendComponent];
|
|
88068
|
+
}
|
|
87595
88069
|
clear() {
|
|
87596
|
-
|
|
87597
|
-
if (this._legendComponent) {
|
|
87598
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._legendComponent);
|
|
87599
|
-
this._legendComponent = null;
|
|
87600
|
-
}
|
|
88070
|
+
super.clear();
|
|
87601
88071
|
this._cacheAttrs = null;
|
|
87602
88072
|
this._preSelectedData = null;
|
|
87603
|
-
super.clear();
|
|
87604
88073
|
}
|
|
87605
88074
|
}
|
|
87606
88075
|
|
|
@@ -88214,12 +88683,10 @@
|
|
|
88214
88683
|
isRelativeModel(model) {
|
|
88215
88684
|
return eachSeries(this._regions, s => model === s) || this._regions.includes(model);
|
|
88216
88685
|
}
|
|
88686
|
+
getVRenderComponents() {
|
|
88687
|
+
return [this._indicatorComponent];
|
|
88688
|
+
}
|
|
88217
88689
|
clear() {
|
|
88218
|
-
var _a;
|
|
88219
|
-
if (this._indicatorComponent) {
|
|
88220
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._indicatorComponent);
|
|
88221
|
-
this._indicatorComponent = null;
|
|
88222
|
-
}
|
|
88223
88690
|
this._cacheAttrs = null;
|
|
88224
88691
|
super.clear();
|
|
88225
88692
|
}
|
|
@@ -88267,8 +88734,9 @@
|
|
|
88267
88734
|
onRender(ctx) {
|
|
88268
88735
|
}
|
|
88269
88736
|
_compareSpec() {
|
|
88737
|
+
var _a, _b;
|
|
88270
88738
|
const result = super._compareSpec();
|
|
88271
|
-
if (this._originalSpec.orient !== this._spec.orient) {
|
|
88739
|
+
if (((_a = this._originalSpec) === null || _a === void 0 ? void 0 : _a.orient) !== ((_b = this._spec) === null || _b === void 0 ? void 0 : _b.orient)) {
|
|
88272
88740
|
result.reMake = true;
|
|
88273
88741
|
}
|
|
88274
88742
|
result.change = true;
|
|
@@ -88356,14 +88824,12 @@
|
|
|
88356
88824
|
this._cacheAttrs = attrs;
|
|
88357
88825
|
return this._titleComponent;
|
|
88358
88826
|
}
|
|
88827
|
+
getVRenderComponents() {
|
|
88828
|
+
return [this._titleComponent];
|
|
88829
|
+
}
|
|
88359
88830
|
clear() {
|
|
88360
|
-
var _a;
|
|
88361
|
-
if (this._titleComponent) {
|
|
88362
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._titleComponent);
|
|
88363
|
-
this._titleComponent = null;
|
|
88364
|
-
}
|
|
88365
|
-
this._cacheAttrs = null;
|
|
88366
88831
|
super.clear();
|
|
88832
|
+
this._cacheAttrs = null;
|
|
88367
88833
|
}
|
|
88368
88834
|
}
|
|
88369
88835
|
Title.type = ComponentTypeEnum.title;
|
|
@@ -88646,6 +89112,9 @@
|
|
|
88646
89112
|
}
|
|
88647
89113
|
changeRegions(regions) {
|
|
88648
89114
|
}
|
|
89115
|
+
getVRenderComponents() {
|
|
89116
|
+
return [];
|
|
89117
|
+
}
|
|
88649
89118
|
collectFeatures() {
|
|
88650
89119
|
const features = [];
|
|
88651
89120
|
this._regions.forEach(r => {
|
|
@@ -89522,22 +89991,15 @@
|
|
|
89522
89991
|
}
|
|
89523
89992
|
limitTagInBounds(label, this._getLimitBounds());
|
|
89524
89993
|
}
|
|
89525
|
-
|
|
89526
|
-
[
|
|
89994
|
+
getVRenderComponents() {
|
|
89995
|
+
return [
|
|
89527
89996
|
this._xCrosshair,
|
|
89528
89997
|
this._xTopLabel,
|
|
89529
89998
|
this._xBottomLabel,
|
|
89530
89999
|
this._yCrosshair,
|
|
89531
90000
|
this._yLeftLabel,
|
|
89532
90001
|
this._yRightLabel
|
|
89533
|
-
]
|
|
89534
|
-
var _a;
|
|
89535
|
-
if (c) {
|
|
89536
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(c);
|
|
89537
|
-
c = null;
|
|
89538
|
-
}
|
|
89539
|
-
});
|
|
89540
|
-
super.clear();
|
|
90002
|
+
];
|
|
89541
90003
|
}
|
|
89542
90004
|
}
|
|
89543
90005
|
CartesianCrossHair.type = ComponentTypeEnum.cartesianCrosshair;
|
|
@@ -89884,15 +90346,13 @@
|
|
|
89884
90346
|
}
|
|
89885
90347
|
limitTagInBounds(label, this._getLimitBounds());
|
|
89886
90348
|
}
|
|
89887
|
-
|
|
89888
|
-
[
|
|
89889
|
-
|
|
89890
|
-
|
|
89891
|
-
|
|
89892
|
-
|
|
89893
|
-
|
|
89894
|
-
});
|
|
89895
|
-
super.clear();
|
|
90349
|
+
getVRenderComponents() {
|
|
90350
|
+
return [
|
|
90351
|
+
this._radiusCrosshair,
|
|
90352
|
+
this._radiusLabelCrosshair,
|
|
90353
|
+
this._angleCrosshair,
|
|
90354
|
+
this._angleLabelCrosshair
|
|
90355
|
+
];
|
|
89896
90356
|
}
|
|
89897
90357
|
}
|
|
89898
90358
|
PolarCrossHair.type = ComponentTypeEnum.polarCrosshair;
|
|
@@ -90116,13 +90576,8 @@
|
|
|
90116
90576
|
}
|
|
90117
90577
|
onRender(ctx) {
|
|
90118
90578
|
}
|
|
90119
|
-
|
|
90120
|
-
|
|
90121
|
-
super.clear();
|
|
90122
|
-
if (this._playerComponent) {
|
|
90123
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._playerComponent);
|
|
90124
|
-
}
|
|
90125
|
-
this._playerComponent = null;
|
|
90579
|
+
getVRenderComponents() {
|
|
90580
|
+
return [this._playerComponent];
|
|
90126
90581
|
}
|
|
90127
90582
|
_computeLayoutRect(rect, width, height) {
|
|
90128
90583
|
switch (this._orient) {
|
|
@@ -90509,13 +90964,8 @@
|
|
|
90509
90964
|
(_a = this._option) === null || _a === void 0 ? void 0 : _a.onError('need at least one series');
|
|
90510
90965
|
return null;
|
|
90511
90966
|
}
|
|
90512
|
-
|
|
90513
|
-
|
|
90514
|
-
if (this._markerComponent) {
|
|
90515
|
-
(_a = this.getContainer()) === null || _a === void 0 ? void 0 : _a.removeChild(this._markerComponent);
|
|
90516
|
-
this._markerComponent = null;
|
|
90517
|
-
}
|
|
90518
|
-
super.clear();
|
|
90967
|
+
getVRenderComponents() {
|
|
90968
|
+
return [this._markerComponent];
|
|
90519
90969
|
}
|
|
90520
90970
|
}
|
|
90521
90971
|
|
|
@@ -93383,6 +93833,9 @@
|
|
|
93383
93833
|
}
|
|
93384
93834
|
changeRegions(regions) {
|
|
93385
93835
|
}
|
|
93836
|
+
getVRenderComponents() {
|
|
93837
|
+
return [];
|
|
93838
|
+
}
|
|
93386
93839
|
_registerEvent() {
|
|
93387
93840
|
}
|
|
93388
93841
|
_releaseEvent() {
|
|
@@ -93631,6 +94084,9 @@
|
|
|
93631
94084
|
}
|
|
93632
94085
|
changeRegions(regions) {
|
|
93633
94086
|
}
|
|
94087
|
+
getVRenderComponents() {
|
|
94088
|
+
return [];
|
|
94089
|
+
}
|
|
93634
94090
|
}
|
|
93635
94091
|
BaseLabelComponent.type = ComponentTypeEnum.label;
|
|
93636
94092
|
|
|
@@ -94268,17 +94724,17 @@
|
|
|
94268
94724
|
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
94269
94725
|
this._chartLayoutRect = chartLayoutRect;
|
|
94270
94726
|
this._chartViewBox = chartViewBox;
|
|
94271
|
-
this.
|
|
94272
|
-
this.
|
|
94273
|
-
this.
|
|
94274
|
-
this.
|
|
94727
|
+
this.leftCurrent = chartLayoutRect.x;
|
|
94728
|
+
this.topCurrent = chartLayoutRect.y;
|
|
94729
|
+
this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;
|
|
94730
|
+
this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;
|
|
94275
94731
|
items.sort((a, b) => b.layoutLevel - a.layoutLevel);
|
|
94276
94732
|
this.layoutNormalItems(items.filter(x => x.layoutType === 'normal'));
|
|
94277
94733
|
const layoutTemp = {
|
|
94278
|
-
|
|
94279
|
-
_topCurrent: this.
|
|
94280
|
-
_rightCurrent: this.
|
|
94281
|
-
_bottomCurrent: this.
|
|
94734
|
+
leftCurrent: this.leftCurrent,
|
|
94735
|
+
_topCurrent: this.topCurrent,
|
|
94736
|
+
_rightCurrent: this.rightCurrent,
|
|
94737
|
+
_bottomCurrent: this.bottomCurrent
|
|
94282
94738
|
};
|
|
94283
94739
|
const regionItems = items.filter(x => x.layoutType === 'region');
|
|
94284
94740
|
const relativeItems = items.filter(x => x.layoutType === 'region-relative');
|
|
@@ -94291,10 +94747,10 @@
|
|
|
94291
94747
|
const layoutRect = zItems[0].getLayoutRect();
|
|
94292
94748
|
extraWH = layoutRect;
|
|
94293
94749
|
}
|
|
94294
|
-
this.
|
|
94295
|
-
this.
|
|
94296
|
-
this.
|
|
94297
|
-
this.
|
|
94750
|
+
this.leftCurrent += extraWH.width / 8;
|
|
94751
|
+
this.rightCurrent -= extraWH.width / 8;
|
|
94752
|
+
this.topCurrent += extraWH.height / 8;
|
|
94753
|
+
this.bottomCurrent -= extraWH.height / 8;
|
|
94298
94754
|
const offsetWH = {
|
|
94299
94755
|
offsetBottom: 0,
|
|
94300
94756
|
offsetTop: 0,
|
|
@@ -94305,10 +94761,10 @@
|
|
|
94305
94761
|
if (relativeItems.some(i => i.getAutoIndent())) {
|
|
94306
94762
|
const { top, bottom, left, right } = this._checkAutoIndent(relativeItems);
|
|
94307
94763
|
if (top || bottom || left || right) {
|
|
94308
|
-
this.
|
|
94309
|
-
this.
|
|
94310
|
-
this.
|
|
94311
|
-
this.
|
|
94764
|
+
this.topCurrent = layoutTemp._topCurrent + top;
|
|
94765
|
+
this.bottomCurrent = layoutTemp._bottomCurrent - bottom;
|
|
94766
|
+
this.leftCurrent = layoutTemp.leftCurrent + left;
|
|
94767
|
+
this.rightCurrent = layoutTemp._rightCurrent - right;
|
|
94312
94768
|
this.layoutRegionItems(regionItems, relativeItems);
|
|
94313
94769
|
}
|
|
94314
94770
|
}
|
|
@@ -94349,8 +94805,8 @@
|
|
|
94349
94805
|
});
|
|
94350
94806
|
}
|
|
94351
94807
|
layoutRegionItems(regionItems, regionRelativeItems, extraOffset) {
|
|
94352
|
-
let regionRelativeTotalWidth = this.
|
|
94353
|
-
let regionRelativeTotalHeight = this.
|
|
94808
|
+
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
94809
|
+
let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
94354
94810
|
if (!extraOffset) {
|
|
94355
94811
|
extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
|
|
94356
94812
|
}
|
|
@@ -94362,18 +94818,18 @@
|
|
|
94362
94818
|
item.setLayoutRect({ width: rect.width });
|
|
94363
94819
|
if (item.layoutOrient === 'left') {
|
|
94364
94820
|
item.setLayoutStartPosition({
|
|
94365
|
-
x: this.
|
|
94821
|
+
x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft + extraOffset.offsetLeft
|
|
94366
94822
|
});
|
|
94367
|
-
this.
|
|
94823
|
+
this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetLeft;
|
|
94368
94824
|
}
|
|
94369
94825
|
else if (item.layoutOrient === 'right') {
|
|
94370
|
-
this.
|
|
94826
|
+
this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight + extraOffset.offsetRight;
|
|
94371
94827
|
item.setLayoutStartPosition({
|
|
94372
|
-
x: this.
|
|
94828
|
+
x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft
|
|
94373
94829
|
});
|
|
94374
94830
|
}
|
|
94375
94831
|
});
|
|
94376
|
-
regionRelativeTotalWidth = this.
|
|
94832
|
+
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;
|
|
94377
94833
|
regionRelativeItems
|
|
94378
94834
|
.filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')
|
|
94379
94835
|
.forEach(item => {
|
|
@@ -94382,27 +94838,27 @@
|
|
|
94382
94838
|
item.setLayoutRect({ height: rect.height });
|
|
94383
94839
|
if (item.layoutOrient === 'top') {
|
|
94384
94840
|
item.setLayoutStartPosition({
|
|
94385
|
-
y: this.
|
|
94841
|
+
y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop + extraOffset.offsetTop
|
|
94386
94842
|
});
|
|
94387
|
-
this.
|
|
94843
|
+
this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;
|
|
94388
94844
|
}
|
|
94389
94845
|
else if (item.layoutOrient === 'bottom') {
|
|
94390
|
-
this.
|
|
94846
|
+
this.bottomCurrent -=
|
|
94391
94847
|
rect.height + item.layoutPaddingTop + item.layoutPaddingBottom + extraOffset.offsetBottom;
|
|
94392
94848
|
item.setLayoutStartPosition({
|
|
94393
|
-
y: this.
|
|
94849
|
+
y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop
|
|
94394
94850
|
});
|
|
94395
94851
|
}
|
|
94396
94852
|
});
|
|
94397
|
-
regionRelativeTotalHeight = this.
|
|
94853
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
94398
94854
|
regionItems.forEach(region => {
|
|
94399
94855
|
region.setLayoutRect({
|
|
94400
94856
|
width: regionRelativeTotalWidth,
|
|
94401
94857
|
height: regionRelativeTotalHeight
|
|
94402
94858
|
});
|
|
94403
94859
|
region.setLayoutStartPosition({
|
|
94404
|
-
x: this.
|
|
94405
|
-
y: this.
|
|
94860
|
+
x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,
|
|
94861
|
+
y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop
|
|
94406
94862
|
});
|
|
94407
94863
|
});
|
|
94408
94864
|
regionRelativeItems.forEach(item => {
|
|
@@ -94431,13 +94887,13 @@
|
|
|
94431
94887
|
extraOffset = { offsetLeft: 0, offsetRight: 0, offsetTop: 0, offsetBottom: 0 };
|
|
94432
94888
|
}
|
|
94433
94889
|
const result = {
|
|
94434
|
-
width: this.
|
|
94435
|
-
this.
|
|
94890
|
+
width: this.rightCurrent -
|
|
94891
|
+
this.leftCurrent -
|
|
94436
94892
|
item.layoutPaddingLeft -
|
|
94437
94893
|
item.layoutPaddingRight -
|
|
94438
94894
|
(extraOffset.offsetLeft + extraOffset.offsetRight),
|
|
94439
|
-
height: this.
|
|
94440
|
-
this.
|
|
94895
|
+
height: this.bottomCurrent -
|
|
94896
|
+
this.topCurrent -
|
|
94441
94897
|
item.layoutPaddingTop -
|
|
94442
94898
|
item.layoutPaddingBottom -
|
|
94443
94899
|
(extraOffset.offsetTop + extraOffset.offsetBottom)
|