@visactor/vchart 1.13.9-alpha.5 → 1.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +1063 -804
- package/build/index.js +1063 -803
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +8 -1
- package/cjs/chart/base/base-chart.js +33 -20
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/index.d.ts +1 -1
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +8 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/pictogram/interface.d.ts +1 -1
- package/cjs/chart/pictogram/interface.js.map +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +21 -21
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -0
- package/cjs/compile/mark/compilable-mark.js +3 -0
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/base-axis.js +7 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +7 -2
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +23 -24
- package/cjs/component/brush/brush.js +183 -182
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +2 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.js +9 -8
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/base-mark-area.js +27 -17
- package/cjs/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-line/base-mark-line.js +31 -20
- package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/cartesian-mark-line.js +32 -26
- package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js +3 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/cjs/component/marker/utils.d.ts +12 -0
- package/cjs/component/marker/utils.js +22 -7
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/constant/event.d.ts +1 -0
- package/cjs/constant/event.js +6 -6
- package/cjs/constant/event.js.map +1 -1
- package/cjs/constant/funnel.js +2 -1
- package/cjs/constant/sunburst.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +2 -1
- package/cjs/core/vchart.js +1 -2
- package/cjs/data/transforms/pictogram.d.ts +1 -9
- package/cjs/data/transforms/pictogram.js +3 -3
- package/cjs/data/transforms/pictogram.js.map +1 -1
- package/cjs/data/transforms/pie.js +1 -1
- package/cjs/data/transforms/pie.js.map +1 -1
- package/cjs/index-harmony-simple.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -7
- package/cjs/index.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -0
- package/cjs/model/base-model.js +6 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/gauge/gauge.js +7 -5
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/pictogram/tooltip-helper.d.ts +2 -2
- package/cjs/series/pictogram/tooltip-helper.js.map +1 -1
- package/cjs/series/pie/pie.js +3 -3
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/progress-like/interface.d.ts +1 -0
- package/cjs/series/polar/progress-like/interface.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +4 -3
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/cjs/series/progress/linear/interface.d.ts +1 -0
- package/cjs/series/progress/linear/interface.js.map +1 -1
- package/cjs/series/progress/linear/linear.js +6 -4
- package/cjs/series/progress/linear/linear.js.map +1 -1
- package/cjs/typings/visual.d.ts +1 -1
- package/cjs/typings/visual.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +8 -1
- package/esm/chart/base/base-chart.js +33 -20
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/index.d.ts +1 -1
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +8 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/pictogram/interface.d.ts +1 -1
- package/esm/chart/pictogram/interface.js.map +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/esm/chart/sankey/sankey.js +22 -22
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -0
- package/esm/compile/mark/compilable-mark.js +3 -0
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/base-axis.js +7 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +7 -2
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/brush/brush.d.ts +23 -24
- package/esm/component/brush/brush.js +179 -177
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +2 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.js +9 -8
- package/esm/component/crosshair/utils/cartesian.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/marker/mark-area/base-mark-area.js +27 -16
- package/esm/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/esm/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-line/base-mark-line.js +30 -19
- package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/cartesian-mark-line.js +31 -26
- package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/esm/component/marker/utils.d.ts +12 -0
- package/esm/component/marker/utils.js +19 -4
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/constant/event.d.ts +1 -0
- package/esm/constant/event.js +6 -6
- package/esm/constant/event.js.map +1 -1
- package/esm/constant/funnel.js +2 -1
- package/esm/constant/sunburst.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +2 -1
- package/esm/core/vchart.js +1 -2
- package/esm/data/transforms/pictogram.d.ts +1 -9
- package/esm/data/transforms/pictogram.js +3 -3
- package/esm/data/transforms/pictogram.js.map +1 -1
- package/esm/data/transforms/pie.js +1 -1
- package/esm/data/transforms/pie.js.map +1 -1
- package/esm/index-harmony-simple.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -0
- package/esm/model/base-model.js +6 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/gauge/gauge.js +6 -4
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/pictogram/tooltip-helper.d.ts +2 -2
- package/esm/series/pictogram/tooltip-helper.js.map +1 -1
- package/esm/series/pie/pie.js +4 -4
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/progress-like/interface.d.ts +1 -0
- package/esm/series/polar/progress-like/interface.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.js +4 -3
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/series/progress/linear/interface.d.ts +1 -0
- package/esm/series/progress/linear/interface.js.map +1 -1
- package/esm/series/progress/linear/linear.js +6 -4
- package/esm/series/progress/linear/linear.js.map +1 -1
- package/esm/typings/visual.d.ts +1 -1
- package/esm/typings/visual.js.map +1 -1
- package/package.json +18 -18
package/build/index.es.js
CHANGED
|
@@ -1753,6 +1753,37 @@ const calculateAnchorOfBounds = (bounds, anchorType) => {
|
|
|
1753
1753
|
y: anchorY
|
|
1754
1754
|
};
|
|
1755
1755
|
};
|
|
1756
|
+
const aabbSeparation = (a, b) => Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
|
|
1757
|
+
const obbSeparation = (a, b) => {
|
|
1758
|
+
const axes = [{
|
|
1759
|
+
x: Math.cos(a.angle),
|
|
1760
|
+
y: Math.sin(a.angle)
|
|
1761
|
+
}, {
|
|
1762
|
+
x: -Math.sin(a.angle),
|
|
1763
|
+
y: Math.cos(a.angle)
|
|
1764
|
+
}, {
|
|
1765
|
+
x: Math.cos(b.angle),
|
|
1766
|
+
y: Math.sin(a.angle)
|
|
1767
|
+
}, {
|
|
1768
|
+
x: -Math.sin(b.angle),
|
|
1769
|
+
y: Math.cos(a.angle)
|
|
1770
|
+
}];
|
|
1771
|
+
function getProjectionRange(obb, axisX, axisY) {
|
|
1772
|
+
const projections = obb.getRotatedCorners().map(p => p.x * axisX + p.y * axisY);
|
|
1773
|
+
return {
|
|
1774
|
+
min: Math.min(...projections),
|
|
1775
|
+
max: Math.max(...projections)
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
let maxDistance = 0;
|
|
1779
|
+
for (const axis of axes) {
|
|
1780
|
+
const rangeA = getProjectionRange(a, axis.x, axis.y),
|
|
1781
|
+
rangeB = getProjectionRange(b, axis.x, axis.y);
|
|
1782
|
+
let distance;
|
|
1783
|
+
distance = rangeA.max < rangeB.min ? rangeB.min - rangeA.max : rangeB.max < rangeA.min ? rangeA.min - rangeB.max : 0, maxDistance = Math.max(maxDistance, distance);
|
|
1784
|
+
}
|
|
1785
|
+
return maxDistance;
|
|
1786
|
+
};
|
|
1756
1787
|
|
|
1757
1788
|
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1758
1789
|
const {
|
|
@@ -1912,6 +1943,25 @@ class OBBBounds extends Bounds {
|
|
|
1912
1943
|
clone() {
|
|
1913
1944
|
return new OBBBounds(this);
|
|
1914
1945
|
}
|
|
1946
|
+
getRotatedCorners() {
|
|
1947
|
+
const originPoint = {
|
|
1948
|
+
x: (this.x1 + this.x2) / 2,
|
|
1949
|
+
y: (this.y1 + this.y2) / 2
|
|
1950
|
+
};
|
|
1951
|
+
return [rotatePoint({
|
|
1952
|
+
x: this.x1,
|
|
1953
|
+
y: this.y1
|
|
1954
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1955
|
+
x: this.x2,
|
|
1956
|
+
y: this.y1
|
|
1957
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1958
|
+
x: this.x1,
|
|
1959
|
+
y: this.y2
|
|
1960
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1961
|
+
x: this.x2,
|
|
1962
|
+
y: this.y2
|
|
1963
|
+
}, this.angle, originPoint)];
|
|
1964
|
+
}
|
|
1915
1965
|
}
|
|
1916
1966
|
|
|
1917
1967
|
class Matrix {
|
|
@@ -8912,6 +8962,11 @@ let Step$1 = class Step {
|
|
|
8912
8962
|
return this.context.tryUpdateLength();
|
|
8913
8963
|
}
|
|
8914
8964
|
};
|
|
8965
|
+
class StepClosed extends Step$1 {
|
|
8966
|
+
lineEnd() {
|
|
8967
|
+
this.context.closePath();
|
|
8968
|
+
}
|
|
8969
|
+
}
|
|
8915
8970
|
function genStepSegments(points, t) {
|
|
8916
8971
|
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8917
8972
|
const {
|
|
@@ -8925,6 +8980,16 @@ function genStepSegments(points, t) {
|
|
|
8925
8980
|
function genStepTypeSegments(path, points) {
|
|
8926
8981
|
return genCurveSegments(path, points);
|
|
8927
8982
|
}
|
|
8983
|
+
function genStepClosedSegments(points, t) {
|
|
8984
|
+
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8985
|
+
const {
|
|
8986
|
+
direction: direction,
|
|
8987
|
+
startPoint: startPoint
|
|
8988
|
+
} = params;
|
|
8989
|
+
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8990
|
+
const segContext = new SegContext("step", null != direction ? direction : abs$1(points[points.length - 1].x - points[0].x) > abs$1(points[points.length - 1].y - points[0].y) ? Direction$1.ROW : Direction$1.COLUMN);
|
|
8991
|
+
return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
|
|
8992
|
+
}
|
|
8928
8993
|
|
|
8929
8994
|
class LinearClosed extends Linear {
|
|
8930
8995
|
lineEnd() {
|
|
@@ -9154,6 +9219,8 @@ function calcLineCache(points, curveType, params) {
|
|
|
9154
9219
|
return genMonotoneYSegments(points, params);
|
|
9155
9220
|
case "step":
|
|
9156
9221
|
return genStepSegments(points, .5, params);
|
|
9222
|
+
case "stepClosed":
|
|
9223
|
+
return genStepClosedSegments(points, .5, params);
|
|
9157
9224
|
case "stepBefore":
|
|
9158
9225
|
return genStepSegments(points, 0, params);
|
|
9159
9226
|
case "stepAfter":
|
|
@@ -9588,7 +9655,8 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
|
9588
9655
|
filter: "",
|
|
9589
9656
|
cursor: null,
|
|
9590
9657
|
html: null,
|
|
9591
|
-
react: null
|
|
9658
|
+
react: null,
|
|
9659
|
+
vue: null
|
|
9592
9660
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
9593
9661
|
const DefaultConnectAttribute = {
|
|
9594
9662
|
connectedType: "none",
|
|
@@ -9696,6 +9764,12 @@ const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute
|
|
|
9696
9764
|
cornerRadius: 0,
|
|
9697
9765
|
closePath: !0
|
|
9698
9766
|
});
|
|
9767
|
+
const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
9768
|
+
width: 100,
|
|
9769
|
+
height: 100,
|
|
9770
|
+
spikes: 5,
|
|
9771
|
+
thickness: .5
|
|
9772
|
+
});
|
|
9699
9773
|
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
9700
9774
|
width: 0,
|
|
9701
9775
|
height: 0,
|
|
@@ -10021,6 +10095,7 @@ function getScaledStroke(context, width, dpr) {
|
|
|
10021
10095
|
function createColor(context, c, params) {
|
|
10022
10096
|
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
10023
10097
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
10098
|
+
var _a, _b, _c, _d;
|
|
10024
10099
|
if (!c || !0 === c) return "black";
|
|
10025
10100
|
let result, color;
|
|
10026
10101
|
if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
@@ -10034,9 +10109,10 @@ function createColor(context, c, params) {
|
|
|
10034
10109
|
if (params.attribute) {
|
|
10035
10110
|
const {
|
|
10036
10111
|
scaleX = 1,
|
|
10037
|
-
scaleY = 1
|
|
10112
|
+
scaleY = 1,
|
|
10113
|
+
angle = 0
|
|
10038
10114
|
} = params.attribute;
|
|
10039
|
-
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
|
|
10115
|
+
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = null !== (_a = params.x1WithoutTransform) && void 0 !== _a ? _a : 0, y = null !== (_b = params.y1WithoutTransform) && void 0 !== _b ? _b : 0, w = null !== (_c = params.widthWithoutTransform) && void 0 !== _c ? _c : w, h = null !== (_d = params.heightWithoutTransform) && void 0 !== _d ? _d : h);
|
|
10040
10116
|
}
|
|
10041
10117
|
"linear" === color.gradient ? result = createLinearGradient(context, color, x, y, w, h) : "conical" === color.gradient ? result = createConicGradient(context, color, x, y, w, h) : "radial" === color.gradient && (result = createRadialGradient(context, color, x, y, w, h));
|
|
10042
10118
|
}
|
|
@@ -10061,7 +10137,7 @@ function createConicGradient(context, color, x, y, w, h) {
|
|
|
10061
10137
|
const canvasGradient = context.createConicGradient(x + (null !== (_a = color.x) && void 0 !== _a ? _a : 0) * w, y + (null !== (_b = color.y) && void 0 !== _b ? _b : 0) * h, color.startAngle, color.endAngle);
|
|
10062
10138
|
return color.stops.forEach(stop => {
|
|
10063
10139
|
canvasGradient.addColorStop(stop.offset, stop.color);
|
|
10064
|
-
}), canvasGradient.GetPattern(w + x, h + y, undefined);
|
|
10140
|
+
}), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
|
|
10065
10141
|
}
|
|
10066
10142
|
|
|
10067
10143
|
const DIRECTION_KEY = {
|
|
@@ -10136,6 +10212,7 @@ function applyStrokeStyle(ctx, character) {
|
|
|
10136
10212
|
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
|
|
10137
10213
|
}
|
|
10138
10214
|
function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
|
|
10215
|
+
if (desc.length <= 1) return 0;
|
|
10139
10216
|
if (!width || width <= 0) return 0;
|
|
10140
10217
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
10141
10218
|
let index = guessIndex,
|
|
@@ -10169,6 +10246,13 @@ function testLetter2(string, index) {
|
|
|
10169
10246
|
}
|
|
10170
10247
|
function measureTextCanvas(text, character) {
|
|
10171
10248
|
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
10249
|
+
var _a;
|
|
10250
|
+
if ("" === text) return {
|
|
10251
|
+
ascent: 0,
|
|
10252
|
+
height: 0,
|
|
10253
|
+
descent: 0,
|
|
10254
|
+
width: 0
|
|
10255
|
+
};
|
|
10172
10256
|
const measurement = application.graphicUtil.textMeasure.measureText(text, character),
|
|
10173
10257
|
result = {
|
|
10174
10258
|
ascent: 0,
|
|
@@ -10178,7 +10262,9 @@ function measureTextCanvas(text, character) {
|
|
|
10178
10262
|
},
|
|
10179
10263
|
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
10180
10264
|
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
10181
|
-
|
|
10265
|
+
"number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent);
|
|
10266
|
+
const space = null !== (_a = character.space) && void 0 !== _a ? _a : 0;
|
|
10267
|
+
return result.width += space, result;
|
|
10182
10268
|
}
|
|
10183
10269
|
|
|
10184
10270
|
var __decorate$1A = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -11316,6 +11402,7 @@ const defaultThemeObj = {
|
|
|
11316
11402
|
text: DefaultTextAttribute,
|
|
11317
11403
|
rect: DefaultRectAttribute,
|
|
11318
11404
|
polygon: DefaultPolygonAttribute,
|
|
11405
|
+
star: DefaultStarAttribute,
|
|
11319
11406
|
richtext: DefaultRichTextAttribute,
|
|
11320
11407
|
richtextIcon: DefaultRichTextIconAttribute,
|
|
11321
11408
|
image: DefaultImageAttribute,
|
|
@@ -11334,6 +11421,7 @@ function newThemeObj() {
|
|
|
11334
11421
|
text: Object.assign({}, defaultThemeObj.text),
|
|
11335
11422
|
rect: Object.assign({}, defaultThemeObj.rect),
|
|
11336
11423
|
polygon: Object.assign({}, defaultThemeObj.polygon),
|
|
11424
|
+
star: Object.assign({}, defaultThemeObj.star),
|
|
11337
11425
|
richtext: Object.assign({}, defaultThemeObj.richtext),
|
|
11338
11426
|
richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
|
|
11339
11427
|
image: Object.assign({}, defaultThemeObj.image),
|
|
@@ -11813,7 +11901,7 @@ class FederatedEvent {
|
|
|
11813
11901
|
}
|
|
11814
11902
|
_composedDetailPath(params) {
|
|
11815
11903
|
if (params && params.graphic) {
|
|
11816
|
-
const g =
|
|
11904
|
+
const g = params.graphic;
|
|
11817
11905
|
if (g.stage) {
|
|
11818
11906
|
const path = g.stage.eventSystem.manager.propagationPath(g);
|
|
11819
11907
|
this.detailPath.push(path), this._composedDetailPath(params.params);
|
|
@@ -15189,7 +15277,7 @@ class RectSymbol extends BaseSymbol {
|
|
|
15189
15277
|
}
|
|
15190
15278
|
var rect = new RectSymbol();
|
|
15191
15279
|
|
|
15192
|
-
const tempBounds
|
|
15280
|
+
const tempBounds = new AABBBounds();
|
|
15193
15281
|
class CustomSymbolClass {
|
|
15194
15282
|
constructor(type, path) {
|
|
15195
15283
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -15218,7 +15306,7 @@ class CustomSymbolClass {
|
|
|
15218
15306
|
let {
|
|
15219
15307
|
path: path
|
|
15220
15308
|
} = _ref;
|
|
15221
|
-
tempBounds
|
|
15309
|
+
tempBounds.x1 = path.bounds.x1 * size, tempBounds.y1 = path.bounds.y1 * size, tempBounds.x2 = path.bounds.x2 * size, tempBounds.y2 = path.bounds.y2 * size, bounds.union(tempBounds);
|
|
15222
15310
|
});
|
|
15223
15311
|
}
|
|
15224
15312
|
this.path.bounds && (bounds.x1 = this.path.bounds.x1 * size, bounds.y1 = this.path.bounds.y1 * size, bounds.x2 = this.path.bounds.x2 * size, bounds.y2 = this.path.bounds.y2 * size);
|
|
@@ -15532,6 +15620,7 @@ const PYRAMID3D_NUMBER_TYPE = genNumberType();
|
|
|
15532
15620
|
const RECT_NUMBER_TYPE = genNumberType();
|
|
15533
15621
|
const RECT3D_NUMBER_TYPE = genNumberType();
|
|
15534
15622
|
const RICHTEXT_NUMBER_TYPE = genNumberType();
|
|
15623
|
+
genNumberType();
|
|
15535
15624
|
const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
15536
15625
|
const TEXT_NUMBER_TYPE = genNumberType();
|
|
15537
15626
|
const GraphicService = Symbol.for("GraphicService");
|
|
@@ -15550,8 +15639,8 @@ const SVG_PARSE_ATTRIBUTE_MAP = {
|
|
|
15550
15639
|
const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
|
|
15551
15640
|
|
|
15552
15641
|
const _tempBounds = new AABBBounds(),
|
|
15553
|
-
tempMatrix = new Matrix()
|
|
15554
|
-
|
|
15642
|
+
tempMatrix = new Matrix();
|
|
15643
|
+
new AABBBounds();
|
|
15555
15644
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
15556
15645
|
const tempConstantXYKey = ["x", "y"],
|
|
15557
15646
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -15786,6 +15875,9 @@ class Graphic extends Node {
|
|
|
15786
15875
|
y: y
|
|
15787
15876
|
});
|
|
15788
15877
|
}
|
|
15878
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
15879
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
15880
|
+
}
|
|
15789
15881
|
setAttributes(params) {
|
|
15790
15882
|
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
15791
15883
|
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -16067,24 +16159,12 @@ class Graphic extends Node {
|
|
|
16067
16159
|
needUpdateLayout() {
|
|
16068
16160
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
16069
16161
|
}
|
|
16070
|
-
getAnchor(anchor, params) {
|
|
16162
|
+
getAnchor(anchor, params, resetScale) {
|
|
16071
16163
|
const _anchor = [0, 0],
|
|
16072
16164
|
getBounds = () => {
|
|
16073
16165
|
if (params.b) return params.b;
|
|
16074
|
-
const
|
|
16075
|
-
|
|
16076
|
-
scaleY: scaleY,
|
|
16077
|
-
angle: angle
|
|
16078
|
-
} = this.attribute;
|
|
16079
|
-
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
16080
|
-
scaleX: 1,
|
|
16081
|
-
scaleY: 1,
|
|
16082
|
-
angle: 0
|
|
16083
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
16084
|
-
scaleX: scaleX,
|
|
16085
|
-
scaleY: scaleY,
|
|
16086
|
-
angle: angle
|
|
16087
|
-
}), params.b;
|
|
16166
|
+
const graphic = this.clone();
|
|
16167
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
16088
16168
|
};
|
|
16089
16169
|
if ("string" == typeof anchor[0]) {
|
|
16090
16170
|
const ratio = parseFloat(anchor[0]) / 100,
|
|
@@ -16111,9 +16191,9 @@ class Graphic extends Node {
|
|
|
16111
16191
|
} = this.attribute;
|
|
16112
16192
|
let _anchor = [0, 0];
|
|
16113
16193
|
const params = {};
|
|
16114
|
-
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 {
|
|
16194
|
+
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);else {
|
|
16115
16195
|
const m = this._transMatrix;
|
|
16116
|
-
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, {
|
|
16196
|
+
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, !0), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
16117
16197
|
x: _anchor[0],
|
|
16118
16198
|
y: _anchor[1]
|
|
16119
16199
|
});
|
|
@@ -17440,7 +17520,7 @@ class Circle extends Graphic {
|
|
|
17440
17520
|
tb1: tb1,
|
|
17441
17521
|
tb2: tb2
|
|
17442
17522
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
17443
|
-
return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this), aabbBounds;
|
|
17523
|
+
return updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this), aabbBounds;
|
|
17444
17524
|
}
|
|
17445
17525
|
updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
|
|
17446
17526
|
const {
|
|
@@ -17690,7 +17770,7 @@ let Text$1 = class Text extends Graphic {
|
|
|
17690
17770
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
17691
17771
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
17692
17772
|
}
|
|
17693
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
17773
|
+
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
17694
17774
|
}
|
|
17695
17775
|
updateSingallineAABBBounds(text) {
|
|
17696
17776
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -18071,7 +18151,7 @@ let Symbol$1 = class Symbol extends Graphic {
|
|
|
18071
18151
|
tb1: tb1,
|
|
18072
18152
|
tb2: tb2
|
|
18073
18153
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18074
|
-
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
18154
|
+
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, this.x1WithoutTransform = aabbBounds.x1, this.y1WithoutTransform = aabbBounds.y1;
|
|
18075
18155
|
const {
|
|
18076
18156
|
lineJoin = symbolTheme.lineJoin
|
|
18077
18157
|
} = attribute;
|
|
@@ -18143,7 +18223,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
18143
18223
|
return getTheme$1(this).line;
|
|
18144
18224
|
}
|
|
18145
18225
|
updateAABBBounds(attribute, lineTheme, aabbBounds) {
|
|
18146
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18226
|
+
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
18147
18227
|
const {
|
|
18148
18228
|
lineJoin = lineTheme.lineJoin
|
|
18149
18229
|
} = attribute;
|
|
@@ -18240,7 +18320,7 @@ class Rect extends Graphic {
|
|
|
18240
18320
|
tb1: tb1,
|
|
18241
18321
|
tb2: tb2
|
|
18242
18322
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18243
|
-
return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
|
|
18323
|
+
return updateBoundsOfCommonOuterBorder(attribute, rectTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, rectTheme, !1, this), aabbBounds;
|
|
18244
18324
|
}
|
|
18245
18325
|
needUpdateTags(keys) {
|
|
18246
18326
|
return super.needUpdateTags(keys, RECT_UPDATE_TAG_KEY);
|
|
@@ -18611,6 +18691,7 @@ function getFixedLRTB(left, right, top, bottom) {
|
|
|
18611
18691
|
}
|
|
18612
18692
|
class Paragraph {
|
|
18613
18693
|
constructor(text, newLine, character, ascentDescentMode) {
|
|
18694
|
+
var _a, _b;
|
|
18614
18695
|
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
18615
18696
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
18616
18697
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
@@ -18623,7 +18704,7 @@ class Paragraph {
|
|
|
18623
18704
|
let halfDetaHeight = 0,
|
|
18624
18705
|
deltaAscent = 0,
|
|
18625
18706
|
deltaDescent = 0;
|
|
18626
|
-
this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
|
|
18707
|
+
this.height > height && (halfDetaHeight = (this.height - height) / 2, deltaAscent = Math.ceil(halfDetaHeight), deltaDescent = Math.floor(halfDetaHeight)), "top" === this.textBaseline ? (this.ascent = halfDetaHeight, this.descent = height - halfDetaHeight) : "bottom" === this.textBaseline ? (this.ascent = height - halfDetaHeight, this.descent = halfDetaHeight) : "middle" === this.textBaseline ? (this.ascent = this.height / 2, this.descent = this.height / 2) : (this.ascent = ascent + deltaAscent, this.descent = descent + deltaDescent), this.length = text.length, this.width = width || 0, this.text = text || "", this.newLine = newLine || !1, this.character = character, this.left = 0, this.top = 0, this.ellipsis = "normal", this.ellipsisWidth = 0, this.ellipsisOtherParagraphWidth = 0, this.space = character.space, this.dx = null !== (_a = character.dx) && void 0 !== _a ? _a : 0, this.dy = null !== (_b = character.dy) && void 0 !== _b ? _b : 0, "vertical" === character.direction && (this.direction = character.direction, this.widthOrigin = this.width, this.heightOrigin = this.height, this.width = this.heightOrigin, this.height = this.widthOrigin, this.lineHeight = this.height), this.ellipsisStr = "...";
|
|
18627
18708
|
}
|
|
18628
18709
|
updateWidth() {
|
|
18629
18710
|
const {
|
|
@@ -18642,11 +18723,11 @@ class Paragraph {
|
|
|
18642
18723
|
if ("hide" === this.ellipsis) return;
|
|
18643
18724
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
18644
18725
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
18645
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
18726
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
18646
18727
|
const {
|
|
18647
18728
|
width: width
|
|
18648
18729
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
18649
|
-
|
|
18730
|
+
left -= this.ellipsisWidth - width;
|
|
18650
18731
|
}
|
|
18651
18732
|
}
|
|
18652
18733
|
}
|
|
@@ -18657,20 +18738,21 @@ class Paragraph {
|
|
|
18657
18738
|
});
|
|
18658
18739
|
}
|
|
18659
18740
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
18741
|
+
var _a;
|
|
18660
18742
|
let baseline = top + ascent,
|
|
18661
18743
|
text = this.text,
|
|
18662
|
-
left = this.left + deltaLeft;
|
|
18744
|
+
left = this.left + deltaLeft + (null !== (_a = this.space) && void 0 !== _a ? _a : 0) / 2;
|
|
18663
18745
|
baseline += this.top;
|
|
18664
18746
|
let direction = this.direction;
|
|
18665
18747
|
if (this.verticalEllipsis) text = this.ellipsisStr, direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
18666
18748
|
if ("hide" === this.ellipsis) return;
|
|
18667
18749
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
18668
18750
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
18669
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
18751
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
18670
18752
|
const {
|
|
18671
18753
|
width: width
|
|
18672
18754
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
18673
|
-
|
|
18755
|
+
left -= this.ellipsisWidth - width;
|
|
18674
18756
|
}
|
|
18675
18757
|
}
|
|
18676
18758
|
}
|
|
@@ -18685,7 +18767,7 @@ class Paragraph {
|
|
|
18685
18767
|
const {
|
|
18686
18768
|
lineWidth = 1
|
|
18687
18769
|
} = this.character;
|
|
18688
|
-
if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill) if (this.character.lineThrough || this.character.underline) {
|
|
18770
|
+
if (this.character.stroke && lineWidth && ctx.strokeText(text, left, baseline + this.dy), this.character.fill && ctx.fillText(text, left, baseline + this.dy), this.character.fill) if (this.character.lineThrough || this.character.underline) {
|
|
18689
18771
|
if (this.character.underline) {
|
|
18690
18772
|
const top = 1 + baseline,
|
|
18691
18773
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
@@ -18814,7 +18896,7 @@ class Image extends Graphic {
|
|
|
18814
18896
|
tb1: tb1,
|
|
18815
18897
|
tb2: tb2
|
|
18816
18898
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18817
|
-
return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
|
|
18899
|
+
return updateBoundsOfCommonOuterBorder(attribute, imageTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, imageTheme, !1, this), aabbBounds;
|
|
18818
18900
|
}
|
|
18819
18901
|
getDefaultAttribute(name) {
|
|
18820
18902
|
return DefaultImageAttribute[name];
|
|
@@ -19157,7 +19239,7 @@ class RichText extends Graphic {
|
|
|
19157
19239
|
maxWidth = richtextTheme.maxWidth,
|
|
19158
19240
|
maxHeight = richtextTheme.maxHeight,
|
|
19159
19241
|
textAlign = richtextTheme.textAlign,
|
|
19160
|
-
|
|
19242
|
+
textBaseline = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : "top",
|
|
19161
19243
|
editOptions: editOptions
|
|
19162
19244
|
} = attribute;
|
|
19163
19245
|
if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height);else {
|
|
@@ -19172,7 +19254,7 @@ class RichText extends Graphic {
|
|
|
19172
19254
|
}
|
|
19173
19255
|
editOptions && editOptions.keepHeightWhileEmpty && !aabbBounds.height() && !(null === (_c = attribute.textConfig) || void 0 === _c ? void 0 : _c.length) && (aabbBounds.y2 = aabbBounds.y1 + (null !== (_d = attribute.fontSize) && void 0 !== _d ? _d : 12), aabbBounds.x2 = aabbBounds.x1 + 2);
|
|
19174
19256
|
let deltaY = 0;
|
|
19175
|
-
switch (
|
|
19257
|
+
switch (textBaseline) {
|
|
19176
19258
|
case "top":
|
|
19177
19259
|
deltaY = 0;
|
|
19178
19260
|
break;
|
|
@@ -19193,7 +19275,7 @@ class RichText extends Graphic {
|
|
|
19193
19275
|
case "right":
|
|
19194
19276
|
deltaX = -aabbBounds.width();
|
|
19195
19277
|
}
|
|
19196
|
-
return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
|
|
19278
|
+
return aabbBounds.translate(deltaX, deltaY), application.graphicService.updateTempAABBBounds(aabbBounds), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, richtextTheme, aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application.graphicService.transformAABBBounds(attribute, aabbBounds, richtextTheme, !1, this), 0 === aabbBounds.width() && 0 === aabbBounds.height() && aabbBounds.clear(), aabbBounds;
|
|
19197
19279
|
}
|
|
19198
19280
|
needUpdateTags(keys) {
|
|
19199
19281
|
return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
|
|
@@ -19411,7 +19493,7 @@ class Path extends Graphic {
|
|
|
19411
19493
|
tb1: tb1,
|
|
19412
19494
|
tb2: tb2
|
|
19413
19495
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19414
|
-
updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
19496
|
+
updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
19415
19497
|
const {
|
|
19416
19498
|
lineJoin = pathTheme.lineJoin
|
|
19417
19499
|
} = attribute;
|
|
@@ -19468,7 +19550,7 @@ class Area extends Graphic {
|
|
|
19468
19550
|
return getTheme$1(this).area;
|
|
19469
19551
|
}
|
|
19470
19552
|
updateAABBBounds(attribute, areaTheme, aabbBounds) {
|
|
19471
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19553
|
+
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
19472
19554
|
const {
|
|
19473
19555
|
lineJoin = areaTheme.lineJoin
|
|
19474
19556
|
} = attribute;
|
|
@@ -19673,7 +19755,7 @@ class Arc extends Graphic {
|
|
|
19673
19755
|
tb1: tb1,
|
|
19674
19756
|
tb2: tb2
|
|
19675
19757
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19676
|
-
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
19758
|
+
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
19677
19759
|
const {
|
|
19678
19760
|
lineJoin = arcTheme.lineJoin
|
|
19679
19761
|
} = attribute;
|
|
@@ -19801,7 +19883,7 @@ class Polygon extends Graphic {
|
|
|
19801
19883
|
return getTheme$1(this).polygon;
|
|
19802
19884
|
}
|
|
19803
19885
|
updateAABBBounds(attribute, polygonTheme, aabbBounds) {
|
|
19804
|
-
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19886
|
+
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
19805
19887
|
const {
|
|
19806
19888
|
lineJoin = polygonTheme.lineJoin
|
|
19807
19889
|
} = attribute;
|
|
@@ -26866,6 +26948,7 @@ let BrowserContext2d = class {
|
|
|
26866
26948
|
return this.nativeContext.createRadialGradient(x0, y0, r0, x1, y1, r1);
|
|
26867
26949
|
}
|
|
26868
26950
|
createConicGradient(x, y, startAngle, endAngle) {
|
|
26951
|
+
if (this.nativeContext.createConicGradient && Math.abs(endAngle - startAngle - 2 * Math.PI) < .001) return this.nativeContext.createConicGradient(startAngle, x, y);
|
|
26869
26952
|
let pattern,
|
|
26870
26953
|
edit = !1;
|
|
26871
26954
|
const ctx = this;
|
|
@@ -31436,7 +31519,9 @@ const delayMap$3 = {
|
|
|
31436
31519
|
loadScrollbarComponent();
|
|
31437
31520
|
let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
31438
31521
|
constructor(attributes, options) {
|
|
31439
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this.
|
|
31522
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._handleTouchMove = e => {
|
|
31523
|
+
isValid$1(this._prePos) && e.preventDefault();
|
|
31524
|
+
}, this._onRailPointerDown = e => {
|
|
31440
31525
|
const {
|
|
31441
31526
|
viewX: viewX,
|
|
31442
31527
|
viewY: viewY
|
|
@@ -31480,8 +31565,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31480
31565
|
const triggers = getEndTriggersOfDrag(),
|
|
31481
31566
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31482
31567
|
obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31483
|
-
capture: !0
|
|
31484
|
-
passive: !0
|
|
31568
|
+
capture: !0
|
|
31485
31569
|
}), triggers.forEach(trigger => {
|
|
31486
31570
|
obj.addEventListener(trigger, this._onSliderPointerUp);
|
|
31487
31571
|
});
|
|
@@ -31502,7 +31586,6 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31502
31586
|
} = this.getSliderRenderBounds();
|
|
31503
31587
|
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
|
|
31504
31588
|
}, this._onSliderPointerMove = e => {
|
|
31505
|
-
e.preventDefault();
|
|
31506
31589
|
const {
|
|
31507
31590
|
stopSliderMovePropagation = !0
|
|
31508
31591
|
} = this.attribute;
|
|
@@ -31518,7 +31601,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31518
31601
|
preScrollRange = this.getScrollRange(),
|
|
31519
31602
|
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
31520
31603
|
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
31521
|
-
this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31604
|
+
this._prePos = null, this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31522
31605
|
pre: preRange,
|
|
31523
31606
|
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
31524
31607
|
}), this._clearDragEvents();
|
|
@@ -31560,7 +31643,9 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31560
31643
|
delayType = "throttle",
|
|
31561
31644
|
delayTime = 0
|
|
31562
31645
|
} = this.attribute;
|
|
31563
|
-
this._rail && this._rail.addEventListener("pointerdown", delayMap$3[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown)
|
|
31646
|
+
this._rail && this._rail.addEventListener("pointerdown", delayMap$3[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31647
|
+
passive: !1
|
|
31648
|
+
});
|
|
31564
31649
|
}
|
|
31565
31650
|
render() {
|
|
31566
31651
|
this._reset();
|
|
@@ -31674,8 +31759,7 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31674
31759
|
const triggers = getEndTriggersOfDrag(),
|
|
31675
31760
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31676
31761
|
obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31677
|
-
capture: !0
|
|
31678
|
-
passive: !1
|
|
31762
|
+
capture: !0
|
|
31679
31763
|
}), triggers.forEach(trigger => {
|
|
31680
31764
|
obj.removeEventListener(trigger, this._onSliderPointerUp);
|
|
31681
31765
|
});
|
|
@@ -31683,6 +31767,11 @@ let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
|
31683
31767
|
_reset() {
|
|
31684
31768
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
31685
31769
|
}
|
|
31770
|
+
release(all) {
|
|
31771
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31772
|
+
passive: !1
|
|
31773
|
+
}), this._clearDragEvents();
|
|
31774
|
+
}
|
|
31686
31775
|
};
|
|
31687
31776
|
ScrollBar$1.defaultAttributes = {
|
|
31688
31777
|
direction: "horizontal",
|
|
@@ -32401,6 +32490,7 @@ class PopTip extends AbstractComponent {
|
|
|
32401
32490
|
contentStyle = {},
|
|
32402
32491
|
panel: panel,
|
|
32403
32492
|
logoSymbol: logoSymbol,
|
|
32493
|
+
poptipAnchor = "position",
|
|
32404
32494
|
logoText: logoText,
|
|
32405
32495
|
logoTextStyle = {},
|
|
32406
32496
|
triangleMode = "default",
|
|
@@ -32412,7 +32502,8 @@ class PopTip extends AbstractComponent {
|
|
|
32412
32502
|
visible: visible,
|
|
32413
32503
|
state: state,
|
|
32414
32504
|
dx = 0,
|
|
32415
|
-
dy = 0
|
|
32505
|
+
dy = 0,
|
|
32506
|
+
positionBounds: positionBounds
|
|
32416
32507
|
} = this.attribute;
|
|
32417
32508
|
let {
|
|
32418
32509
|
title = "",
|
|
@@ -32498,21 +32589,28 @@ class PopTip extends AbstractComponent {
|
|
|
32498
32589
|
titleShape.setAttribute("maxLineWidth", maxSpace - buf), contentShape.setAttribute("maxLineWidth", maxSpace - buf), poptipHeight = parsedPadding[0] + parsedPadding[2], titleVisible && (poptipHeight += titleShape.AABBBounds.height() + space), poptipHeight += contentShape.AABBBounds.height();
|
|
32499
32590
|
}
|
|
32500
32591
|
}
|
|
32501
|
-
const layout = "auto" === position
|
|
32592
|
+
const layout = "auto" === position || isArray$1(position),
|
|
32593
|
+
positionList = isArray$1(position) ? position : this.positionList;
|
|
32502
32594
|
let maxBBoxI,
|
|
32503
32595
|
maxBBoxSize = -1 / 0;
|
|
32504
|
-
for (let i = 0; i <
|
|
32505
|
-
const p = layout ?
|
|
32596
|
+
for (let i = 0; i < positionList.length + 1; i++) {
|
|
32597
|
+
const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
|
|
32506
32598
|
let symbolType = "arrow2Left",
|
|
32507
32599
|
offsetX = (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
32508
32600
|
offsetY = 0;
|
|
32509
|
-
"top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(
|
|
32601
|
+
"top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(p) ? (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2 : -(isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 2, offsetY = ["tl", "tr", "lb", "rb"].includes(p) ? -(isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2 : (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2);
|
|
32510
32602
|
const {
|
|
32511
32603
|
angle: angle,
|
|
32512
32604
|
offset: offset
|
|
32513
32605
|
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$1(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
|
|
32514
|
-
|
|
32515
|
-
|
|
32606
|
+
let bgSymbol,
|
|
32607
|
+
anchorPoint = {
|
|
32608
|
+
x: 0,
|
|
32609
|
+
y: 0
|
|
32610
|
+
};
|
|
32611
|
+
if ("bounds" === poptipAnchor && positionBounds && (anchorPoint = this.calculateAnchorPoint(p, positionBounds)), isBoolean$1(bgVisible)) {
|
|
32612
|
+
let bgRect;
|
|
32613
|
+
bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32516
32614
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32517
32615
|
x: offsetX,
|
|
32518
32616
|
y: offsetY,
|
|
@@ -32525,9 +32623,7 @@ class PopTip extends AbstractComponent {
|
|
|
32525
32623
|
dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
|
|
32526
32624
|
size: symbolSize,
|
|
32527
32625
|
zIndex: 9
|
|
32528
|
-
}), "symbol")
|
|
32529
|
-
let bgRect;
|
|
32530
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32626
|
+
}), "symbol"), isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32531
32627
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32532
32628
|
x: 0,
|
|
32533
32629
|
y: 0,
|
|
@@ -32544,8 +32640,8 @@ class PopTip extends AbstractComponent {
|
|
|
32544
32640
|
}), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
32545
32641
|
}
|
|
32546
32642
|
if (group.setAttributes({
|
|
32547
|
-
x: -offset[0] + dx,
|
|
32548
|
-
y: -offset[1] + dy,
|
|
32643
|
+
x: -offset[0] + dx + anchorPoint.x,
|
|
32644
|
+
y: -offset[1] + dy + anchorPoint.y,
|
|
32549
32645
|
anchor: [offsetX, offsetY]
|
|
32550
32646
|
}), logoSymbol) {
|
|
32551
32647
|
const {
|
|
@@ -32573,20 +32669,87 @@ class PopTip extends AbstractComponent {
|
|
|
32573
32669
|
zIndex: 10
|
|
32574
32670
|
}), "text");
|
|
32575
32671
|
}
|
|
32576
|
-
if (!
|
|
32672
|
+
if (!range) break;
|
|
32577
32673
|
{
|
|
32578
32674
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
32579
32675
|
const b = _tBounds,
|
|
32580
32676
|
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
32581
|
-
if (
|
|
32582
|
-
|
|
32583
|
-
|
|
32584
|
-
|
|
32585
|
-
|
|
32677
|
+
if (layout) {
|
|
32678
|
+
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
32679
|
+
{
|
|
32680
|
+
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
32681
|
+
size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
|
|
32682
|
+
size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
|
|
32683
|
+
}
|
|
32586
32684
|
}
|
|
32685
|
+
if (["top", "bottom", "left", "right"].includes(p)) {
|
|
32686
|
+
const isVerticalPosition = "top" === p || "bottom" === p,
|
|
32687
|
+
isHorizontalPosition = "left" === p || "right" === p;
|
|
32688
|
+
let mainDirectionOverlap = !1;
|
|
32689
|
+
if (isVerticalPosition ? mainDirectionOverlap = "top" === p && b.y1 < 0 || "bottom" === p && b.y2 > stageBounds.y2 : isHorizontalPosition && (mainDirectionOverlap = "left" === p && b.x1 < 0 || "right" === p && b.x2 > stageBounds.x2), !mainDirectionOverlap) {
|
|
32690
|
+
let secondaryOffset = 0;
|
|
32691
|
+
const szNumber = (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2;
|
|
32692
|
+
isVerticalPosition ? (b.x1 < 0 ? secondaryOffset = -b.x1 : b.x2 > stageBounds.x2 && (secondaryOffset = stageBounds.x2 - b.x2), group.setAttribute("x", group.attribute.x + secondaryOffset), bgSymbol.setAttribute("dx", min$1(max$1(bgSymbol.attribute.dx - secondaryOffset, szNumber), b.width() - szNumber))) : isHorizontalPosition && (b.y1 < 0 ? secondaryOffset = -b.y1 : b.y2 > stageBounds.y2 && (secondaryOffset = stageBounds.y2 - b.y2), group.setAttribute("y", group.attribute.y + secondaryOffset), bgSymbol.setAttribute("dy", min$1(max$1(bgSymbol.attribute.dy - secondaryOffset, szNumber), b.height() - szNumber)));
|
|
32693
|
+
break;
|
|
32694
|
+
}
|
|
32695
|
+
}
|
|
32696
|
+
if (!layout) break;
|
|
32587
32697
|
}
|
|
32588
32698
|
}
|
|
32589
32699
|
}
|
|
32700
|
+
calculateAnchorPoint(position, positionBounds) {
|
|
32701
|
+
if (!positionBounds) return {
|
|
32702
|
+
x: 0,
|
|
32703
|
+
y: 0
|
|
32704
|
+
};
|
|
32705
|
+
const {
|
|
32706
|
+
x: x,
|
|
32707
|
+
y: y
|
|
32708
|
+
} = this.attribute,
|
|
32709
|
+
{
|
|
32710
|
+
x1: x1,
|
|
32711
|
+
y1: y1,
|
|
32712
|
+
x2: x2,
|
|
32713
|
+
y2: y2
|
|
32714
|
+
} = positionBounds,
|
|
32715
|
+
width = x2 - x1,
|
|
32716
|
+
height = y2 - y1;
|
|
32717
|
+
switch (position) {
|
|
32718
|
+
case "top":
|
|
32719
|
+
case "tl":
|
|
32720
|
+
case "tr":
|
|
32721
|
+
return {
|
|
32722
|
+
x: x1 + width / 2 - x,
|
|
32723
|
+
y: y1 - y
|
|
32724
|
+
};
|
|
32725
|
+
case "bottom":
|
|
32726
|
+
case "bl":
|
|
32727
|
+
case "br":
|
|
32728
|
+
return {
|
|
32729
|
+
x: x1 + width / 2 - x,
|
|
32730
|
+
y: y2 - y
|
|
32731
|
+
};
|
|
32732
|
+
case "left":
|
|
32733
|
+
case "lt":
|
|
32734
|
+
case "lb":
|
|
32735
|
+
return {
|
|
32736
|
+
x: x1 - x,
|
|
32737
|
+
y: y1 + height / 2 - y
|
|
32738
|
+
};
|
|
32739
|
+
case "right":
|
|
32740
|
+
case "rt":
|
|
32741
|
+
case "rb":
|
|
32742
|
+
return {
|
|
32743
|
+
x: x2 - x,
|
|
32744
|
+
y: y1 + height / 2 - y
|
|
32745
|
+
};
|
|
32746
|
+
default:
|
|
32747
|
+
return {
|
|
32748
|
+
x: 0,
|
|
32749
|
+
y: 0
|
|
32750
|
+
};
|
|
32751
|
+
}
|
|
32752
|
+
}
|
|
32590
32753
|
getAngleAndOffset(position, width, height, size, symbolType) {
|
|
32591
32754
|
const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
|
|
32592
32755
|
switch (position) {
|
|
@@ -32748,10 +32911,12 @@ let PopTipRenderContribution = class {
|
|
|
32748
32911
|
this.poptipComponent.setAttributes(Object.assign(Object.assign({
|
|
32749
32912
|
visibleAll: !0,
|
|
32750
32913
|
pickable: !1,
|
|
32751
|
-
childrenPickable: !1
|
|
32914
|
+
childrenPickable: !1,
|
|
32915
|
+
poptipAnchor: "bounds"
|
|
32752
32916
|
}, poptip), {
|
|
32753
32917
|
x: matrix.e,
|
|
32754
|
-
y: matrix.f
|
|
32918
|
+
y: matrix.f,
|
|
32919
|
+
positionBounds: graphic.globalAABBBounds
|
|
32755
32920
|
})), drawContext.stage.tryInitInteractiveLayer();
|
|
32756
32921
|
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
32757
32922
|
interactiveLayer && interactiveLayer.add(this.poptipComponent);
|
|
@@ -33505,10 +33670,11 @@ function getPolygonPath(points, closed) {
|
|
|
33505
33670
|
}
|
|
33506
33671
|
function textIntersect(textA, textB, sep) {
|
|
33507
33672
|
var _a;
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33673
|
+
const angle = null === (_a = textA.attribute) || void 0 === _a ? void 0 : _a.angle;
|
|
33674
|
+
if (isAngleHorizontal(angle, Number.EPSILON)) return sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds);
|
|
33675
|
+
const a = textA.OBBBounds,
|
|
33676
|
+
b = textB.OBBBounds;
|
|
33677
|
+
return !a || !b || a.empty() || b.empty() ? sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds) : a.intersects(b) || sep > obbSeparation(a, b);
|
|
33512
33678
|
}
|
|
33513
33679
|
function hasOverlap$1(items, pad) {
|
|
33514
33680
|
for (let b, i = 1, n = items.length, a = items[0]; i < n; a = b, ++i) if (b = items[i], textIntersect(a, b, pad)) return !0;
|
|
@@ -35737,7 +35903,9 @@ class LinearScale extends ContinuousScale {
|
|
|
35737
35903
|
super(...arguments), this.type = ScaleEnum.Linear;
|
|
35738
35904
|
}
|
|
35739
35905
|
clone() {
|
|
35740
|
-
|
|
35906
|
+
var _a;
|
|
35907
|
+
const scale = new LinearScale();
|
|
35908
|
+
return scale.domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate), this._niceType && (scale._niceType = this._niceType, scale._domainValidator = this._domainValidator, scale._niceDomain = null === (_a = this._niceDomain) || void 0 === _a ? void 0 : _a.slice()), scale;
|
|
35741
35909
|
}
|
|
35742
35910
|
tickFormat() {
|
|
35743
35911
|
return () => {};
|
|
@@ -39035,13 +39203,13 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
|
|
|
39035
39203
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39036
39204
|
triggers = getEndTriggersOfDrag();
|
|
39037
39205
|
evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39038
|
-
capture: !0
|
|
39039
|
-
|
|
39206
|
+
capture: !0
|
|
39207
|
+
}), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39208
|
+
capture: !0
|
|
39040
39209
|
}), triggers.forEach(trigger => {
|
|
39041
39210
|
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
|
|
39042
39211
|
});
|
|
39043
39212
|
}, this._pointerMove = e => {
|
|
39044
|
-
e.preventDefault();
|
|
39045
39213
|
const {
|
|
39046
39214
|
start: startAttr,
|
|
39047
39215
|
end: endAttr,
|
|
@@ -39058,7 +39226,7 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
|
|
|
39058
39226
|
start: start,
|
|
39059
39227
|
end: end
|
|
39060
39228
|
} = this.state;
|
|
39061
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.
|
|
39229
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
|
|
39062
39230
|
start: start,
|
|
39063
39231
|
end: end,
|
|
39064
39232
|
tag: this._activeTag
|
|
@@ -39134,10 +39302,11 @@ let DataZoom$1 = class DataZoom extends AbstractComponent {
|
|
|
39134
39302
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39135
39303
|
triggers = getEndTriggersOfDrag();
|
|
39136
39304
|
evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39137
|
-
capture: !0
|
|
39138
|
-
passive: !1
|
|
39305
|
+
capture: !0
|
|
39139
39306
|
}), triggers.forEach(trigger => {
|
|
39140
39307
|
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
39308
|
+
}), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39309
|
+
capture: !0
|
|
39141
39310
|
});
|
|
39142
39311
|
}
|
|
39143
39312
|
_onHandlerPointerEnter(e) {
|
|
@@ -39857,17 +40026,26 @@ function commonLineClipIn(line, label, duration, delay, easing) {
|
|
|
39857
40026
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
39858
40027
|
clipRange: 1
|
|
39859
40028
|
}, stepDuration, easing);
|
|
39860
|
-
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
|
|
40029
|
+
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing), array(label).forEach(labelNode => {
|
|
40030
|
+
const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
|
|
40031
|
+
graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
|
|
40032
|
+
});
|
|
39861
40033
|
}
|
|
39862
40034
|
|
|
39863
40035
|
function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
39864
|
-
segmentFadeIn(line, delay, duration, easing),
|
|
40036
|
+
segmentFadeIn(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40037
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40038
|
+
});
|
|
39865
40039
|
}
|
|
39866
40040
|
function areaFadeIn(area, label, duration, delay, easing) {
|
|
39867
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40041
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40042
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40043
|
+
});
|
|
39868
40044
|
}
|
|
39869
40045
|
function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
39870
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40046
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40047
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40048
|
+
});
|
|
39871
40049
|
}
|
|
39872
40050
|
function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39873
40051
|
var _a;
|
|
@@ -39875,13 +40053,19 @@ function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
|
39875
40053
|
}
|
|
39876
40054
|
|
|
39877
40055
|
function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
39878
|
-
segmentFadeOut(line, delay, duration, easing),
|
|
40056
|
+
segmentFadeOut(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40057
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40058
|
+
});
|
|
39879
40059
|
}
|
|
39880
40060
|
function areaFadeOut(area, label, duration, delay, easing) {
|
|
39881
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40061
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40062
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40063
|
+
});
|
|
39882
40064
|
}
|
|
39883
40065
|
function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
39884
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40066
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40067
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40068
|
+
});
|
|
39885
40069
|
}
|
|
39886
40070
|
function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39887
40071
|
var _a;
|
|
@@ -40053,6 +40237,57 @@ const DefaultExitMarkerAnimation = {
|
|
|
40053
40237
|
delay: 0
|
|
40054
40238
|
};
|
|
40055
40239
|
|
|
40240
|
+
class MarkLabelMixin {
|
|
40241
|
+
getLabel() {
|
|
40242
|
+
return this._label;
|
|
40243
|
+
}
|
|
40244
|
+
_addMarkLabels(container, labelName, defaultLabelAttrs) {
|
|
40245
|
+
const {
|
|
40246
|
+
label: label,
|
|
40247
|
+
state: state
|
|
40248
|
+
} = this.attribute,
|
|
40249
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40250
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground),
|
|
40251
|
+
labelShapes = array(label).map((labelAttrs, index) => {
|
|
40252
|
+
var _a, _b;
|
|
40253
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labelAttrs),
|
|
40254
|
+
markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), {
|
|
40255
|
+
state: {
|
|
40256
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40257
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40258
|
+
}
|
|
40259
|
+
}));
|
|
40260
|
+
return markLabel.name = labelName, container.add(markLabel), this.setLabelPos(markLabel, finalLabelAttrs), markLabel;
|
|
40261
|
+
});
|
|
40262
|
+
this._label = 1 === array(labelShapes).length ? labelShapes[0] : labelShapes;
|
|
40263
|
+
}
|
|
40264
|
+
_updateMarkLabels(defaultLabelAttrs) {
|
|
40265
|
+
const {
|
|
40266
|
+
label: label,
|
|
40267
|
+
state: state
|
|
40268
|
+
} = this.attribute,
|
|
40269
|
+
labelShapes = array(this._label),
|
|
40270
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40271
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground);
|
|
40272
|
+
if (labelShapes.length) {
|
|
40273
|
+
const labels = array(label);
|
|
40274
|
+
labelShapes.forEach((labelItem, index) => {
|
|
40275
|
+
var _a, _b;
|
|
40276
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labels[index]);
|
|
40277
|
+
labelItem.setAttributes(Object.assign(Object.assign({
|
|
40278
|
+
dx: 0,
|
|
40279
|
+
dy: 0
|
|
40280
|
+
}, finalLabelAttrs), {
|
|
40281
|
+
state: {
|
|
40282
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40283
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40284
|
+
}
|
|
40285
|
+
})), this.setLabelPos(labelItem, finalLabelAttrs);
|
|
40286
|
+
});
|
|
40287
|
+
}
|
|
40288
|
+
}
|
|
40289
|
+
}
|
|
40290
|
+
|
|
40056
40291
|
class MarkCommonLine extends Marker {
|
|
40057
40292
|
constructor() {
|
|
40058
40293
|
super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = DefaultUpdateMarkLineAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
@@ -40060,24 +40295,20 @@ class MarkCommonLine extends Marker {
|
|
|
40060
40295
|
getLine() {
|
|
40061
40296
|
return this._line;
|
|
40062
40297
|
}
|
|
40063
|
-
|
|
40064
|
-
return this._label;
|
|
40065
|
-
}
|
|
40066
|
-
setLabelPos() {
|
|
40298
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40067
40299
|
const {
|
|
40068
|
-
label = {},
|
|
40069
40300
|
limitRect: limitRect
|
|
40070
40301
|
} = this.attribute,
|
|
40071
40302
|
{
|
|
40072
40303
|
position: position,
|
|
40073
40304
|
confine: confine,
|
|
40074
40305
|
autoRotate: autoRotate
|
|
40075
|
-
} =
|
|
40076
|
-
labelPoint = this.getPointAttrByPosition(position),
|
|
40306
|
+
} = labelAttrs,
|
|
40307
|
+
labelPoint = this.getPointAttrByPosition(position, labelAttrs),
|
|
40077
40308
|
labelAngle = position.toString().toLocaleLowerCase().includes("start") ? this._line.getStartAngle() || 0 : this._line.getEndAngle() || 0;
|
|
40078
|
-
if (
|
|
40079
|
-
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0,
|
|
40080
|
-
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)),
|
|
40309
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
|
|
40310
|
+
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0,
|
|
40311
|
+
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle)
|
|
40081
40312
|
})), limitRect && confine) {
|
|
40082
40313
|
const {
|
|
40083
40314
|
x: x,
|
|
@@ -40085,7 +40316,7 @@ class MarkCommonLine extends Marker {
|
|
|
40085
40316
|
width: width,
|
|
40086
40317
|
height: height
|
|
40087
40318
|
} = limitRect;
|
|
40088
|
-
limitShapeInBounds(
|
|
40319
|
+
limitShapeInBounds(labelNode, {
|
|
40089
40320
|
x1: x,
|
|
40090
40321
|
y1: y,
|
|
40091
40322
|
x2: x + width,
|
|
@@ -40094,36 +40325,14 @@ class MarkCommonLine extends Marker {
|
|
|
40094
40325
|
}
|
|
40095
40326
|
}
|
|
40096
40327
|
initMarker(container) {
|
|
40097
|
-
const
|
|
40098
|
-
|
|
40099
|
-
state: state
|
|
40100
|
-
} = this.attribute,
|
|
40101
|
-
line = this.createSegment();
|
|
40102
|
-
line.name = "mark-common-line-line", this._line = line, container.add(line);
|
|
40103
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40104
|
-
state: {
|
|
40105
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40106
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40107
|
-
}
|
|
40108
|
-
}));
|
|
40109
|
-
markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
40328
|
+
const line = this.createSegment();
|
|
40329
|
+
line.name = "mark-common-line-line", this._line = line, container.add(line), this.addMarkLineLabels(container);
|
|
40110
40330
|
}
|
|
40111
40331
|
updateMarker() {
|
|
40112
|
-
|
|
40113
|
-
label: label,
|
|
40114
|
-
state: state
|
|
40115
|
-
} = this.attribute;
|
|
40116
|
-
this.setLineAttributes(), this._label && (this._label.setAttributes(Object.assign(Object.assign({
|
|
40117
|
-
dx: 0,
|
|
40118
|
-
dy: 0
|
|
40119
|
-
}, label), {
|
|
40120
|
-
state: {
|
|
40121
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40122
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40123
|
-
}
|
|
40124
|
-
})), this.setLabelPos());
|
|
40332
|
+
this.setLineAttributes(), this.updateMarkLineLabels();
|
|
40125
40333
|
}
|
|
40126
40334
|
}
|
|
40335
|
+
mixin(MarkCommonLine, MarkLabelMixin);
|
|
40127
40336
|
|
|
40128
40337
|
const FUZZY_EQUAL_DELTA = .001;
|
|
40129
40338
|
const DEFAULT_MARK_LINE_THEME = {
|
|
@@ -40312,6 +40521,7 @@ const DEFAULT_MARK_ARC_LINE_THEME = {
|
|
|
40312
40521
|
lineWidth: 0
|
|
40313
40522
|
},
|
|
40314
40523
|
label: {
|
|
40524
|
+
autoRotate: !0,
|
|
40315
40525
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40316
40526
|
refX: 0,
|
|
40317
40527
|
refY: 0,
|
|
@@ -40366,6 +40576,7 @@ const DEFAULT_MARK_AREA_THEME = {
|
|
|
40366
40576
|
const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
40367
40577
|
interactive: !0,
|
|
40368
40578
|
label: {
|
|
40579
|
+
autoRotate: !0,
|
|
40369
40580
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40370
40581
|
textStyle: {
|
|
40371
40582
|
fill: "#fff",
|
|
@@ -40621,15 +40832,12 @@ class MarkLine extends MarkCommonLine {
|
|
|
40621
40832
|
constructor(attributes, options) {
|
|
40622
40833
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
|
|
40623
40834
|
}
|
|
40624
|
-
getPointAttrByPosition(position) {
|
|
40835
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40625
40836
|
var _a;
|
|
40626
40837
|
const {
|
|
40627
|
-
label = {}
|
|
40628
|
-
} = this.attribute,
|
|
40629
|
-
{
|
|
40630
40838
|
refX = 0,
|
|
40631
40839
|
refY = 0
|
|
40632
|
-
} =
|
|
40840
|
+
} = labelAttrs,
|
|
40633
40841
|
points = this._line.getMainSegmentPoints(),
|
|
40634
40842
|
lineEndAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0,
|
|
40635
40843
|
labelAngle = (lineEndAngle),
|
|
@@ -40655,9 +40863,9 @@ class MarkLine extends MarkCommonLine {
|
|
|
40655
40863
|
angle: labelAngle
|
|
40656
40864
|
};
|
|
40657
40865
|
}
|
|
40658
|
-
getRotateByAngle(angle) {
|
|
40866
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40659
40867
|
var _a;
|
|
40660
|
-
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a =
|
|
40868
|
+
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40661
40869
|
}
|
|
40662
40870
|
getTextStyle(position, labelAngle, autoRotate) {
|
|
40663
40871
|
return fuzzyEqualNumber(Math.abs(labelAngle), Math.PI / 2, FUZZY_EQUAL_DELTA) || fuzzyEqualNumber(Math.abs(labelAngle), 3 * Math.PI / 2, FUZZY_EQUAL_DELTA) ? getTextAlignAttrOfVerticalDir(autoRotate, labelAngle, position) : isPostiveXAxis(labelAngle) ? DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.postiveXAxis[position] : DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.negativeXAxis[position];
|
|
@@ -40723,6 +40931,12 @@ class MarkLine extends MarkCommonLine {
|
|
|
40723
40931
|
});else if (!isValidNumber$1(point.x) || !isValidNumber$1(point.y)) return void (validFlag = !1);
|
|
40724
40932
|
}), validFlag;
|
|
40725
40933
|
}
|
|
40934
|
+
addMarkLineLabels(container) {
|
|
40935
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkLine.defaultAttributes.label);
|
|
40936
|
+
}
|
|
40937
|
+
updateMarkLineLabels() {
|
|
40938
|
+
this._updateMarkLabels(MarkLine.defaultAttributes.label);
|
|
40939
|
+
}
|
|
40726
40940
|
}
|
|
40727
40941
|
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
40728
40942
|
|
|
@@ -40737,9 +40951,6 @@ class MarkArea extends Marker {
|
|
|
40737
40951
|
getArea() {
|
|
40738
40952
|
return this._area;
|
|
40739
40953
|
}
|
|
40740
|
-
getLabel() {
|
|
40741
|
-
return this._label;
|
|
40742
|
-
}
|
|
40743
40954
|
constructor(attributes, options) {
|
|
40744
40955
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40745
40956
|
}
|
|
@@ -40756,24 +40967,21 @@ class MarkArea extends Marker {
|
|
|
40756
40967
|
};
|
|
40757
40968
|
return (position.includes("left") || position.includes("Left")) && (result.x = x1), (position.includes("right") || position.includes("Right")) && (result.x = x2), (position.includes("top") || position.includes("Top")) && (result.y = y1), (position.includes("bottom") || position.includes("Bottom")) && (result.y = y2), result;
|
|
40758
40969
|
}
|
|
40759
|
-
setLabelPos() {
|
|
40970
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40760
40971
|
var _a;
|
|
40761
|
-
if (this.
|
|
40762
|
-
const
|
|
40763
|
-
label = {}
|
|
40764
|
-
} = this.attribute,
|
|
40765
|
-
labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle",
|
|
40972
|
+
if (this._area) {
|
|
40973
|
+
const labelPosition = null !== (_a = labelAttrs.position) && void 0 !== _a ? _a : "middle",
|
|
40766
40974
|
labelPoint = this.getPointAttrByPosition(labelPosition);
|
|
40767
|
-
if (
|
|
40768
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]),
|
|
40769
|
-
})), this.attribute.limitRect &&
|
|
40975
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), {
|
|
40976
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
40977
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
40770
40978
|
const {
|
|
40771
40979
|
x: x,
|
|
40772
40980
|
y: y,
|
|
40773
40981
|
width: width,
|
|
40774
40982
|
height: height
|
|
40775
40983
|
} = this.attribute.limitRect;
|
|
40776
|
-
limitShapeInBounds(
|
|
40984
|
+
limitShapeInBounds(labelNode, {
|
|
40777
40985
|
x1: x,
|
|
40778
40986
|
y1: y,
|
|
40779
40987
|
x2: x + width,
|
|
@@ -40785,40 +40993,23 @@ class MarkArea extends Marker {
|
|
|
40785
40993
|
initMarker(container) {
|
|
40786
40994
|
const {
|
|
40787
40995
|
points: points,
|
|
40788
|
-
label: label,
|
|
40789
40996
|
areaStyle: areaStyle,
|
|
40790
40997
|
state: state
|
|
40791
40998
|
} = this.attribute,
|
|
40792
40999
|
area = graphicCreator.polygon(Object.assign({
|
|
40793
41000
|
points: points
|
|
40794
41001
|
}, areaStyle));
|
|
40795
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
|
|
40796
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40797
|
-
state: {
|
|
40798
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40799
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40800
|
-
}
|
|
40801
|
-
}));
|
|
40802
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
41002
|
+
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArea.defaultAttributes.label);
|
|
40803
41003
|
}
|
|
40804
41004
|
updateMarker() {
|
|
40805
41005
|
const {
|
|
40806
41006
|
points: points,
|
|
40807
|
-
label: label,
|
|
40808
41007
|
areaStyle: areaStyle,
|
|
40809
41008
|
state: state
|
|
40810
41009
|
} = this.attribute;
|
|
40811
41010
|
this._area && (this._area.setAttributes(Object.assign({
|
|
40812
41011
|
points: points
|
|
40813
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
40814
|
-
dx: 0,
|
|
40815
|
-
dy: 0
|
|
40816
|
-
}, label), {
|
|
40817
|
-
state: {
|
|
40818
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40819
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40820
|
-
}
|
|
40821
|
-
})), this.setLabelPos();
|
|
41012
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArea.defaultAttributes.label);
|
|
40822
41013
|
}
|
|
40823
41014
|
isValidPoints() {
|
|
40824
41015
|
const {
|
|
@@ -40831,7 +41022,7 @@ class MarkArea extends Marker {
|
|
|
40831
41022
|
}), validFlag;
|
|
40832
41023
|
}
|
|
40833
41024
|
}
|
|
40834
|
-
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
41025
|
+
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME, mixin(MarkArea, MarkLabelMixin);
|
|
40835
41026
|
|
|
40836
41027
|
loadMarkArcLineComponent();
|
|
40837
41028
|
function registerMarkArcLineAnimate() {
|
|
@@ -40842,24 +41033,19 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40842
41033
|
MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
40843
41034
|
}
|
|
40844
41035
|
constructor(attributes, options) {
|
|
40845
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes,
|
|
40846
|
-
label: {
|
|
40847
|
-
autoRotate: !0
|
|
40848
|
-
}
|
|
40849
|
-
})), this.name = "markArcLine";
|
|
41036
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes)), this.name = "markArcLine";
|
|
40850
41037
|
}
|
|
40851
|
-
getPointAttrByPosition(direction) {
|
|
41038
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
40852
41039
|
const {
|
|
40853
41040
|
center: center,
|
|
40854
41041
|
radius: radius,
|
|
40855
41042
|
startAngle: startAngle,
|
|
40856
|
-
endAngle: endAngle
|
|
40857
|
-
label: label
|
|
41043
|
+
endAngle: endAngle
|
|
40858
41044
|
} = this.attribute,
|
|
40859
41045
|
{
|
|
40860
41046
|
refX = 0,
|
|
40861
41047
|
refY = 0
|
|
40862
|
-
} =
|
|
41048
|
+
} = labelAttrs;
|
|
40863
41049
|
let angle;
|
|
40864
41050
|
switch (direction) {
|
|
40865
41051
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -40889,9 +41075,9 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40889
41075
|
getTextStyle(position) {
|
|
40890
41076
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
40891
41077
|
}
|
|
40892
|
-
getRotateByAngle(angle) {
|
|
41078
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40893
41079
|
var _a;
|
|
40894
|
-
return angle - Math.PI / 2 + (null !== (_a =
|
|
41080
|
+
return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40895
41081
|
}
|
|
40896
41082
|
createSegment() {
|
|
40897
41083
|
const {
|
|
@@ -40948,6 +41134,12 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40948
41134
|
isValidPoints() {
|
|
40949
41135
|
return !0;
|
|
40950
41136
|
}
|
|
41137
|
+
addMarkLineLabels(container) {
|
|
41138
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkArcLine.defaultAttributes.label);
|
|
41139
|
+
}
|
|
41140
|
+
updateMarkLineLabels() {
|
|
41141
|
+
this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
|
|
41142
|
+
}
|
|
40951
41143
|
}
|
|
40952
41144
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
40953
41145
|
|
|
@@ -40962,29 +41154,21 @@ class MarkArcArea extends Marker {
|
|
|
40962
41154
|
getArea() {
|
|
40963
41155
|
return this._area;
|
|
40964
41156
|
}
|
|
40965
|
-
getLabel() {
|
|
40966
|
-
return this._label;
|
|
40967
|
-
}
|
|
40968
41157
|
constructor(attributes, options) {
|
|
40969
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes,
|
|
40970
|
-
label: {
|
|
40971
|
-
autoRotate: !0
|
|
40972
|
-
}
|
|
40973
|
-
})), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
41158
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes)), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40974
41159
|
}
|
|
40975
|
-
getPointAttrByPosition(position) {
|
|
41160
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40976
41161
|
const {
|
|
40977
41162
|
center: center,
|
|
40978
41163
|
innerRadius: innerRadius,
|
|
40979
41164
|
outerRadius: outerRadius,
|
|
40980
41165
|
startAngle: startAngle,
|
|
40981
|
-
endAngle: endAngle
|
|
40982
|
-
label: label
|
|
41166
|
+
endAngle: endAngle
|
|
40983
41167
|
} = this.attribute,
|
|
40984
41168
|
{
|
|
40985
41169
|
refX = 0,
|
|
40986
41170
|
refY = 0
|
|
40987
|
-
} =
|
|
41171
|
+
} = labelAttrs;
|
|
40988
41172
|
let radius, angle;
|
|
40989
41173
|
switch (position) {
|
|
40990
41174
|
case IMarkCommonArcLabelPosition.center:
|
|
@@ -41019,28 +41203,25 @@ class MarkArcArea extends Marker {
|
|
|
41019
41203
|
angle: angle
|
|
41020
41204
|
};
|
|
41021
41205
|
}
|
|
41022
|
-
setLabelPos() {
|
|
41206
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
41023
41207
|
var _a;
|
|
41024
|
-
if (this.
|
|
41208
|
+
if (this._area) {
|
|
41025
41209
|
const {
|
|
41026
|
-
label = {}
|
|
41027
|
-
} = this.attribute,
|
|
41028
|
-
{
|
|
41029
41210
|
position: labelPosition = "arcInnerMiddle",
|
|
41030
41211
|
autoRotate: autoRotate
|
|
41031
|
-
} =
|
|
41032
|
-
labelAttr = this.getPointAttrByPosition(labelPosition);
|
|
41033
|
-
if (
|
|
41034
|
-
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a =
|
|
41035
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]),
|
|
41036
|
-
})), this.attribute.limitRect &&
|
|
41212
|
+
} = labelAttrs,
|
|
41213
|
+
labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
|
|
41214
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
41215
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0) : 0,
|
|
41216
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
41217
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
41037
41218
|
const {
|
|
41038
41219
|
x: x,
|
|
41039
41220
|
y: y,
|
|
41040
41221
|
width: width,
|
|
41041
41222
|
height: height
|
|
41042
41223
|
} = this.attribute.limitRect;
|
|
41043
|
-
limitShapeInBounds(
|
|
41224
|
+
limitShapeInBounds(labelNode, {
|
|
41044
41225
|
x1: x,
|
|
41045
41226
|
y1: y,
|
|
41046
41227
|
x2: x + width,
|
|
@@ -41057,7 +41238,6 @@ class MarkArcArea extends Marker {
|
|
|
41057
41238
|
startAngle: startAngle,
|
|
41058
41239
|
endAngle: endAngle,
|
|
41059
41240
|
areaStyle: areaStyle,
|
|
41060
|
-
label: label,
|
|
41061
41241
|
state: state
|
|
41062
41242
|
} = this.attribute,
|
|
41063
41243
|
area = graphicCreator.arc(Object.assign({
|
|
@@ -41068,14 +41248,7 @@ class MarkArcArea extends Marker {
|
|
|
41068
41248
|
startAngle: startAngle,
|
|
41069
41249
|
endAngle: endAngle
|
|
41070
41250
|
}, areaStyle));
|
|
41071
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area);
|
|
41072
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
41073
|
-
state: {
|
|
41074
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41075
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41076
|
-
}
|
|
41077
|
-
}));
|
|
41078
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
41251
|
+
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArcArea.defaultAttributes.label);
|
|
41079
41252
|
}
|
|
41080
41253
|
updateMarker() {
|
|
41081
41254
|
const {
|
|
@@ -41095,21 +41268,13 @@ class MarkArcArea extends Marker {
|
|
|
41095
41268
|
outerRadius: outerRadius,
|
|
41096
41269
|
startAngle: startAngle,
|
|
41097
41270
|
endAngle: endAngle
|
|
41098
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
41099
|
-
dx: 0,
|
|
41100
|
-
dy: 0
|
|
41101
|
-
}, label), {
|
|
41102
|
-
state: {
|
|
41103
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41104
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41105
|
-
}
|
|
41106
|
-
})), this.setLabelPos());
|
|
41271
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
41107
41272
|
}
|
|
41108
41273
|
isValidPoints() {
|
|
41109
41274
|
return !0;
|
|
41110
41275
|
}
|
|
41111
41276
|
}
|
|
41112
|
-
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
41277
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
|
|
41113
41278
|
|
|
41114
41279
|
loadMarkPointComponent();
|
|
41115
41280
|
function registerMarkPointAnimate() {
|
|
@@ -42638,14 +42803,13 @@ class Slider extends AbstractComponent {
|
|
|
42638
42803
|
const triggers = getEndTriggersOfDrag(),
|
|
42639
42804
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42640
42805
|
obj.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
42641
|
-
capture: !0
|
|
42642
|
-
passive: !1
|
|
42806
|
+
capture: !0
|
|
42643
42807
|
}), triggers.forEach(trigger => {
|
|
42644
42808
|
obj.addEventListener(trigger, this._onHandlerPointerUp);
|
|
42645
42809
|
});
|
|
42646
42810
|
}, this._onHandlerPointerMove = e => {
|
|
42647
42811
|
var _a, _b;
|
|
42648
|
-
|
|
42812
|
+
this._isChanging = !0;
|
|
42649
42813
|
const {
|
|
42650
42814
|
railWidth: railWidth,
|
|
42651
42815
|
railHeight: railHeight,
|
|
@@ -42679,13 +42843,12 @@ class Slider extends AbstractComponent {
|
|
|
42679
42843
|
const triggers = getEndTriggersOfDrag(),
|
|
42680
42844
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42681
42845
|
obj.addEventListener("pointermove", this._onTrackPointerMove, {
|
|
42682
|
-
capture: !0
|
|
42683
|
-
passive: !1
|
|
42846
|
+
capture: !0
|
|
42684
42847
|
}), triggers.forEach(trigger => {
|
|
42685
42848
|
obj.addEventListener(trigger, this._onTrackPointerUp);
|
|
42686
42849
|
});
|
|
42687
42850
|
}, this._onTrackPointerMove = e => {
|
|
42688
|
-
|
|
42851
|
+
this._isChanging = !0;
|
|
42689
42852
|
const {
|
|
42690
42853
|
railWidth: railWidth,
|
|
42691
42854
|
railHeight: railHeight,
|
|
@@ -43060,13 +43223,11 @@ class Slider extends AbstractComponent {
|
|
|
43060
43223
|
const triggers = getEndTriggersOfDrag(),
|
|
43061
43224
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
43062
43225
|
obj.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
43063
|
-
capture: !0
|
|
43064
|
-
passive: !1
|
|
43226
|
+
capture: !0
|
|
43065
43227
|
}), triggers.forEach(trigger => {
|
|
43066
43228
|
obj.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
43067
43229
|
}), obj.removeEventListener("pointermove", this._onTrackPointerMove, {
|
|
43068
|
-
capture: !0
|
|
43069
|
-
passive: !1
|
|
43230
|
+
capture: !0
|
|
43070
43231
|
}), triggers.forEach(trigger => {
|
|
43071
43232
|
obj.removeEventListener(trigger, this._onTrackPointerUp);
|
|
43072
43233
|
});
|
|
@@ -44449,13 +44610,13 @@ class ContinuousPlayer extends BasePlayer {
|
|
|
44449
44610
|
|
|
44450
44611
|
var IOperateType;
|
|
44451
44612
|
!function (IOperateType) {
|
|
44452
|
-
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushClear = "brushClear";
|
|
44613
|
+
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushActive = "brushActive", IOperateType.brushClear = "brushClear";
|
|
44453
44614
|
}(IOperateType || (IOperateType = {}));
|
|
44454
44615
|
|
|
44455
44616
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
44456
44617
|
trigger: "pointerdown",
|
|
44457
44618
|
updateTrigger: "pointermove",
|
|
44458
|
-
endTrigger: "pointerup",
|
|
44619
|
+
endTrigger: ["pointerup", "pointerleave"],
|
|
44459
44620
|
resetTrigger: "pointerupoutside",
|
|
44460
44621
|
hasMask: !0,
|
|
44461
44622
|
brushMode: "single",
|
|
@@ -44471,10 +44632,10 @@ const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
|
44471
44632
|
delayType: "throttle",
|
|
44472
44633
|
delayTime: 10,
|
|
44473
44634
|
interactiveRange: {
|
|
44474
|
-
|
|
44475
|
-
|
|
44476
|
-
|
|
44477
|
-
|
|
44635
|
+
minY: -1 / 0,
|
|
44636
|
+
maxY: 1 / 0,
|
|
44637
|
+
minX: -1 / 0,
|
|
44638
|
+
maxX: 1 / 0
|
|
44478
44639
|
}
|
|
44479
44640
|
};
|
|
44480
44641
|
const DEFAULT_SIZE_THRESHOLD = 5;
|
|
@@ -44490,83 +44651,36 @@ const delayMap$1 = {
|
|
|
44490
44651
|
loadBrushComponent();
|
|
44491
44652
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
44492
44653
|
constructor(attributes, options) {
|
|
44493
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this.
|
|
44494
|
-
|
|
44495
|
-
if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
|
|
44496
|
-
e.stopPropagation();
|
|
44497
|
-
const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
|
|
44498
|
-
this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
|
|
44499
|
-
}, this._onBrushing = e => {
|
|
44500
|
-
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
44501
|
-
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44502
|
-
var _a;
|
|
44503
|
-
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
44504
|
-
e.preventDefault();
|
|
44654
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this._activeMoveState = !1, this._operatingMaskMoveDx = 0, this._operatingMaskMoveDy = 0, this._operatingMaskMoveRangeX = [-1 / 0, 1 / 0], this._operatingMaskMoveRangeY = [-1 / 0, 1 / 0], this._brushMaskAABBBoundsDict = {}, this._firstUpdate = !0, this._onBrushStart = e => {
|
|
44655
|
+
if (this._outOfInteractiveRange(e)) return void (this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)));
|
|
44505
44656
|
const {
|
|
44506
|
-
|
|
44657
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44658
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44659
|
+
brushMoved = !0
|
|
44507
44660
|
} = this.attribute;
|
|
44508
|
-
|
|
44509
|
-
|
|
44510
|
-
|
|
44511
|
-
|
|
44512
|
-
|
|
44513
|
-
operateMask: this._operatingMask,
|
|
44514
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44515
|
-
event: e
|
|
44516
|
-
}), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
|
|
44517
|
-
operateMask: this._operatingMask,
|
|
44518
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44519
|
-
event: e
|
|
44520
|
-
})), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44661
|
+
array(updateTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushEnd)), e.stopPropagation(), this._firstUpdate = !0, this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._startPos = this.eventPosToStagePos(e), this._cacheDrawPoints = [this._startPos];
|
|
44662
|
+
}, this._onBrushing = e => {
|
|
44663
|
+
this._outOfInteractiveRange(e) || (e.stopPropagation(), this._firstUpdate ? (this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e), this._firstUpdate = !1) : (this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e)));
|
|
44664
|
+
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44665
|
+
this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
44521
44666
|
}, this._onBrushClear = e => {
|
|
44522
|
-
e.preventDefault();
|
|
44523
|
-
const {
|
|
44524
|
-
removeOnClick = !0
|
|
44525
|
-
} = this.attribute;
|
|
44526
|
-
this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
|
|
44527
|
-
operateMask: this._operatingMask,
|
|
44528
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44529
|
-
event: e
|
|
44530
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44667
|
+
e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
44531
44668
|
};
|
|
44532
44669
|
}
|
|
44533
44670
|
_bindBrushEvents() {
|
|
44534
|
-
if (this.attribute.disableTriggerEvent) return;
|
|
44671
|
+
if (this.releaseBrushEvents(), this.attribute.disableTriggerEvent) return;
|
|
44535
44672
|
const {
|
|
44536
44673
|
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44537
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44538
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44539
44674
|
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44540
44675
|
} = this.attribute;
|
|
44541
|
-
array(trigger).forEach(t =>
|
|
44542
|
-
}
|
|
44543
|
-
_isPosInBrushMask(e) {
|
|
44544
|
-
const pos = this.eventPosToStagePos(e),
|
|
44545
|
-
brushMasks = this._container.getChildren();
|
|
44546
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
44547
|
-
const {
|
|
44548
|
-
points = [],
|
|
44549
|
-
dx = 0,
|
|
44550
|
-
dy = 0
|
|
44551
|
-
} = brushMasks[i].attribute,
|
|
44552
|
-
pointsConsiderOffset = points.map(point => ({
|
|
44553
|
-
x: point.x + dx,
|
|
44554
|
-
y: point.y + dy
|
|
44555
|
-
}));
|
|
44556
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44557
|
-
}
|
|
44558
|
-
return !1;
|
|
44676
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
44559
44677
|
}
|
|
44560
44678
|
_initDraw(e) {
|
|
44561
44679
|
const {
|
|
44562
44680
|
brushMode: brushMode
|
|
44563
44681
|
} = this.attribute,
|
|
44564
44682
|
pos = this.eventPosToStagePos(e);
|
|
44565
|
-
this._cacheDrawPoints
|
|
44566
|
-
operateMask: this._operatingMask,
|
|
44567
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44568
|
-
event: e
|
|
44569
|
-
});
|
|
44683
|
+
this._cacheDrawPoints.push(pos), "single" === brushMode && this._clearMask(), this._addBrushMask(), this._dispatchBrushEvent(IOperateType.drawStart, e), 1 === Object.keys(this._brushMaskAABBBoundsDict).length && this._dispatchBrushEvent(IOperateType.brushActive, e);
|
|
44570
44684
|
}
|
|
44571
44685
|
_initMove(e) {
|
|
44572
44686
|
var _a, _b;
|
|
@@ -44590,17 +44704,12 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44590
44704
|
maxMoveStepX = maxX - x2,
|
|
44591
44705
|
minMoveStepY = minY - y1,
|
|
44592
44706
|
maxMoveStepY = maxY - y2;
|
|
44593
|
-
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this.
|
|
44594
|
-
operateMask: this._operatingMask,
|
|
44595
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44596
|
-
event: e
|
|
44597
|
-
});
|
|
44707
|
+
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
44598
44708
|
}
|
|
44599
44709
|
_drawing(e) {
|
|
44600
|
-
var _a
|
|
44710
|
+
var _a;
|
|
44601
44711
|
const pos = this.eventPosToStagePos(e),
|
|
44602
44712
|
{
|
|
44603
|
-
sizeThreshold = DEFAULT_SIZE_THRESHOLD,
|
|
44604
44713
|
brushType: brushType
|
|
44605
44714
|
} = this.attribute,
|
|
44606
44715
|
cacheLength = this._cacheDrawPoints.length;
|
|
@@ -44610,18 +44719,7 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44610
44719
|
}
|
|
44611
44720
|
"polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
44612
44721
|
const maskPoints = this._computeMaskPoints();
|
|
44613
|
-
this._operatingMask.setAttribute("points", maskPoints);
|
|
44614
|
-
const {
|
|
44615
|
-
x1 = 0,
|
|
44616
|
-
x2 = 0,
|
|
44617
|
-
y1 = 0,
|
|
44618
|
-
y2 = 0
|
|
44619
|
-
} = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
|
|
44620
|
-
this._isDrawedBeforeEnd = !this._operatingMask._AABBBounds.empty() && !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold), this._isDrawedBeforeEnd && (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchEvent(IOperateType.drawing, {
|
|
44621
|
-
operateMask: this._operatingMask,
|
|
44622
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44623
|
-
event: e
|
|
44624
|
-
}));
|
|
44722
|
+
this._operatingMask.setAttribute("points", maskPoints), this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
44625
44723
|
}
|
|
44626
44724
|
_moving(e) {
|
|
44627
44725
|
const startPos = this._cacheMovePoint,
|
|
@@ -44634,11 +44732,46 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44634
44732
|
this._operatingMask.setAttributes({
|
|
44635
44733
|
dx: moveX,
|
|
44636
44734
|
dy: moveY
|
|
44637
|
-
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44638
|
-
|
|
44639
|
-
|
|
44640
|
-
|
|
44641
|
-
|
|
44735
|
+
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
44736
|
+
}
|
|
44737
|
+
_drawEnd(e) {
|
|
44738
|
+
const {
|
|
44739
|
+
removeOnClick = !0,
|
|
44740
|
+
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
44741
|
+
} = this.attribute;
|
|
44742
|
+
if (this._outOfInteractiveRange(e)) this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e));else {
|
|
44743
|
+
const {
|
|
44744
|
+
x: x1,
|
|
44745
|
+
y: y1
|
|
44746
|
+
} = this._startPos,
|
|
44747
|
+
{
|
|
44748
|
+
x: x2,
|
|
44749
|
+
y: y2
|
|
44750
|
+
} = this.eventPosToStagePos(e);
|
|
44751
|
+
Math.abs(x2 - x1) <= 1 && Math.abs(y2 - y1) <= 1 && removeOnClick ? this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)) : Math.abs(x2 - x1) < sizeThreshold && Math.abs(y1 - y2) < sizeThreshold ? (delete this._brushMaskAABBBoundsDict[this._operatingMask.name], this._container.setAttributes({}), this._container.removeChild(this._operatingMask), this._isEmptyMask() && this._dispatchBrushEvent(IOperateType.brushClear, e)) : (this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.drawEnd, e));
|
|
44752
|
+
}
|
|
44753
|
+
}
|
|
44754
|
+
_moveEnd(e) {
|
|
44755
|
+
this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
44756
|
+
}
|
|
44757
|
+
render() {
|
|
44758
|
+
this._bindBrushEvents();
|
|
44759
|
+
const group = this.createOrUpdateChild("brush-container", {}, "group");
|
|
44760
|
+
this._container = group;
|
|
44761
|
+
}
|
|
44762
|
+
releaseBrushEvents() {
|
|
44763
|
+
const {
|
|
44764
|
+
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44765
|
+
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44766
|
+
} = this.attribute;
|
|
44767
|
+
array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear)), this._releaseBrushUpdateEvents();
|
|
44768
|
+
}
|
|
44769
|
+
_releaseBrushUpdateEvents() {
|
|
44770
|
+
const {
|
|
44771
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44772
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger
|
|
44773
|
+
} = this.attribute;
|
|
44774
|
+
array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd));
|
|
44642
44775
|
}
|
|
44643
44776
|
_computeMaskPoints() {
|
|
44644
44777
|
const {
|
|
@@ -44696,6 +44829,23 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44696
44829
|
}));
|
|
44697
44830
|
brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
44698
44831
|
}
|
|
44832
|
+
_isPosInBrushMask(e) {
|
|
44833
|
+
const pos = this.eventPosToStagePos(e),
|
|
44834
|
+
brushMasks = this._container.getChildren();
|
|
44835
|
+
for (let i = 0; i < brushMasks.length; i++) {
|
|
44836
|
+
const {
|
|
44837
|
+
points = [],
|
|
44838
|
+
dx = 0,
|
|
44839
|
+
dy = 0
|
|
44840
|
+
} = brushMasks[i].attribute,
|
|
44841
|
+
pointsConsiderOffset = points.map(point => ({
|
|
44842
|
+
x: point.x + dx,
|
|
44843
|
+
y: point.y + dy
|
|
44844
|
+
}));
|
|
44845
|
+
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44846
|
+
}
|
|
44847
|
+
return !1;
|
|
44848
|
+
}
|
|
44699
44849
|
_outOfInteractiveRange(e) {
|
|
44700
44850
|
const {
|
|
44701
44851
|
interactiveRange: interactiveRange
|
|
@@ -44712,21 +44862,18 @@ let Brush$1 = class Brush extends AbstractComponent {
|
|
|
44712
44862
|
eventPosToStagePos(e) {
|
|
44713
44863
|
return this.stage.eventPointTransform(e);
|
|
44714
44864
|
}
|
|
44715
|
-
|
|
44716
|
-
this.
|
|
44717
|
-
|
|
44718
|
-
|
|
44865
|
+
_dispatchBrushEvent(operateType, e) {
|
|
44866
|
+
this._dispatchEvent(operateType, {
|
|
44867
|
+
operateMask: this._operatingMask,
|
|
44868
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44869
|
+
event: e
|
|
44870
|
+
});
|
|
44719
44871
|
}
|
|
44720
|
-
|
|
44721
|
-
|
|
44722
|
-
|
|
44723
|
-
|
|
44724
|
-
|
|
44725
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44726
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44727
|
-
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44728
|
-
} = this.attribute;
|
|
44729
|
-
array(trigger).forEach(t => vglobal.removeEventListener(t, this._onBrushStart)), array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear));
|
|
44872
|
+
_clearMask() {
|
|
44873
|
+
this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild(), this._operatingMask = null;
|
|
44874
|
+
}
|
|
44875
|
+
_isEmptyMask() {
|
|
44876
|
+
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
44730
44877
|
}
|
|
44731
44878
|
};
|
|
44732
44879
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -56961,6 +57108,7 @@ var ChartEvent;
|
|
|
56961
57108
|
ChartEvent["brushChange"] = "brushChange";
|
|
56962
57109
|
ChartEvent["brushEnd"] = "brushEnd";
|
|
56963
57110
|
ChartEvent["brushClear"] = "brushClear";
|
|
57111
|
+
ChartEvent["brushActive"] = "brushActive";
|
|
56964
57112
|
ChartEvent["legendSelectedDataChange"] = "legendSelectedDataChange";
|
|
56965
57113
|
ChartEvent["legendFilter"] = "legendFilter";
|
|
56966
57114
|
ChartEvent["legendItemClick"] = "legendItemClick";
|
|
@@ -59612,6 +59760,9 @@ class BaseModel extends CompilableBase {
|
|
|
59612
59760
|
}
|
|
59613
59761
|
beforeRelease() {
|
|
59614
59762
|
}
|
|
59763
|
+
clear() {
|
|
59764
|
+
this.getMarks().forEach(m => { var _a; return (_a = m.clear) === null || _a === void 0 ? void 0 : _a.call(m); });
|
|
59765
|
+
}
|
|
59615
59766
|
release() {
|
|
59616
59767
|
var _a;
|
|
59617
59768
|
this._releaseEvent();
|
|
@@ -61764,6 +61915,9 @@ class CompilableMark extends GrammarItem {
|
|
|
61764
61915
|
}
|
|
61765
61916
|
return undefined;
|
|
61766
61917
|
}
|
|
61918
|
+
clear() {
|
|
61919
|
+
this._event.off(HOOK_EVENT.AFTER_DO_RENDER);
|
|
61920
|
+
}
|
|
61767
61921
|
release() {
|
|
61768
61922
|
super.release();
|
|
61769
61923
|
this.state.release();
|
|
@@ -63713,7 +63867,7 @@ const registerVChartCore = () => {
|
|
|
63713
63867
|
};
|
|
63714
63868
|
registerVChartCore();
|
|
63715
63869
|
|
|
63716
|
-
const version = "1.13.9
|
|
63870
|
+
const version = "1.13.9";
|
|
63717
63871
|
|
|
63718
63872
|
const addVChartProperty = (data, op) => {
|
|
63719
63873
|
const context = op.beforeCall();
|
|
@@ -67860,6 +68014,9 @@ class AxisComponent extends BaseComponent {
|
|
|
67860
68014
|
if (spec.label.state) {
|
|
67861
68015
|
axisAttrs.label.state = transformAxisLabelStateStyle(spec.label.state);
|
|
67862
68016
|
}
|
|
68017
|
+
if (isFunction$1(spec.label.dataFilter)) {
|
|
68018
|
+
axisAttrs.label.dataFilter = (data, layer) => spec.label.dataFilter(data, layer, { vchart: this._option.globalInstance });
|
|
68019
|
+
}
|
|
67863
68020
|
}
|
|
67864
68021
|
else {
|
|
67865
68022
|
axisAttrs.label = {
|
|
@@ -67872,7 +68029,9 @@ class AxisComponent extends BaseComponent {
|
|
|
67872
68029
|
length: spec.tick.tickSize,
|
|
67873
68030
|
inside: spec.tick.inside,
|
|
67874
68031
|
alignWithLabel: spec.tick.alignWithLabel,
|
|
67875
|
-
dataFilter: spec.tick.dataFilter
|
|
68032
|
+
dataFilter: isFunction$1(spec.tick.dataFilter)
|
|
68033
|
+
? (data) => spec.tick.dataFilter(data, { vchart: this._option.globalInstance })
|
|
68034
|
+
: undefined
|
|
67876
68035
|
};
|
|
67877
68036
|
if (spec.tick.style) {
|
|
67878
68037
|
axisAttrs.tick.style = isFunction$1(spec.tick.style)
|
|
@@ -71125,58 +71284,83 @@ class BaseChart extends CompilableBase {
|
|
|
71125
71284
|
}
|
|
71126
71285
|
});
|
|
71127
71286
|
}
|
|
71128
|
-
|
|
71287
|
+
filterGraphicsByDatum(datum, opt = {}) {
|
|
71288
|
+
var _a;
|
|
71129
71289
|
datum = datum ? array(datum) : null;
|
|
71130
71290
|
const keys = !datum ? null : Object.keys(datum[0]);
|
|
71131
|
-
|
|
71132
|
-
|
|
71133
|
-
|
|
71134
|
-
|
|
71135
|
-
|
|
71136
|
-
|
|
71137
|
-
|
|
71138
|
-
|
|
71139
|
-
|
|
71140
|
-
}
|
|
71141
|
-
if (!filter || (isFunction$1(filter) && filter(s, m))) {
|
|
71142
|
-
const isCollect = m.getProduct().isCollectionMark();
|
|
71143
|
-
const elements = m.getProduct().elements;
|
|
71144
|
-
let pickElements = [];
|
|
71145
|
-
if (isCollect) {
|
|
71146
|
-
pickElements = elements.filter(e => {
|
|
71147
|
-
const elDatum = e.getDatum();
|
|
71148
|
-
datum.every((d, index) => keys.every(k => d[k] == elDatum[index][k]));
|
|
71149
|
-
});
|
|
71291
|
+
const allElements = [];
|
|
71292
|
+
const getDatumOfElement = (_a = opt.getDatum) !== null && _a !== void 0 ? _a : ((el) => el.getDatum());
|
|
71293
|
+
this.getRegionsInQuerier(opt.region).forEach(r => {
|
|
71294
|
+
const pickElements = [];
|
|
71295
|
+
datum &&
|
|
71296
|
+
r.getSeries().forEach(s => {
|
|
71297
|
+
s.getMarks().forEach(m => {
|
|
71298
|
+
if (!m.getProduct()) {
|
|
71299
|
+
return;
|
|
71150
71300
|
}
|
|
71151
|
-
|
|
71152
|
-
|
|
71153
|
-
|
|
71154
|
-
|
|
71155
|
-
|
|
71156
|
-
|
|
71157
|
-
|
|
71158
|
-
|
|
71159
|
-
|
|
71160
|
-
|
|
71161
|
-
|
|
71162
|
-
return true;
|
|
71301
|
+
if (!opt.filter || (isFunction$1(opt.filter) && opt.filter(s, m))) {
|
|
71302
|
+
const isCollect = m.getProduct().isCollectionMark();
|
|
71303
|
+
const elements = m.getProduct().elements;
|
|
71304
|
+
if (isCollect) {
|
|
71305
|
+
elements.filter(e => {
|
|
71306
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71307
|
+
const isPick = elDatum && datum.every((d, index) => keys.every(k => d[k] == elDatum[index][k]));
|
|
71308
|
+
if (isPick) {
|
|
71309
|
+
pickElements.push(e);
|
|
71310
|
+
allElements.push(e);
|
|
71311
|
+
opt.callback && opt.callback(e, m, s, r);
|
|
71163
71312
|
}
|
|
71164
|
-
return false;
|
|
71165
71313
|
});
|
|
71166
71314
|
}
|
|
71167
71315
|
else {
|
|
71168
|
-
|
|
71169
|
-
|
|
71316
|
+
if (datum.length > 1) {
|
|
71317
|
+
const datumTemp = datum.slice();
|
|
71318
|
+
elements.forEach(e => {
|
|
71319
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71320
|
+
const index = elDatum && datumTemp.findIndex(d => keys.every(k => d[k] == elDatum[k]));
|
|
71321
|
+
if (index >= 0) {
|
|
71322
|
+
datumTemp.splice(index, 1);
|
|
71323
|
+
pickElements.push(e);
|
|
71324
|
+
allElements.push(e);
|
|
71325
|
+
opt.callback && opt.callback(e, m, s, r);
|
|
71326
|
+
}
|
|
71327
|
+
});
|
|
71328
|
+
}
|
|
71329
|
+
else {
|
|
71330
|
+
const el = elements.find(e => {
|
|
71331
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71332
|
+
return elDatum && keys.every(k => datum[0][k] == elDatum[k]);
|
|
71333
|
+
});
|
|
71334
|
+
if (el) {
|
|
71335
|
+
pickElements.push(el);
|
|
71336
|
+
allElements.push(el);
|
|
71337
|
+
opt.callback && opt.callback(el, m, s, r);
|
|
71338
|
+
}
|
|
71339
|
+
}
|
|
71170
71340
|
}
|
|
71171
71341
|
}
|
|
71172
|
-
|
|
71173
|
-
r.interaction.startInteraction(stateKey, element);
|
|
71174
|
-
});
|
|
71175
|
-
}
|
|
71342
|
+
});
|
|
71176
71343
|
});
|
|
71177
|
-
|
|
71178
|
-
|
|
71179
|
-
|
|
71344
|
+
opt.regionCallback && opt.regionCallback(pickElements, r);
|
|
71345
|
+
});
|
|
71346
|
+
return allElements;
|
|
71347
|
+
}
|
|
71348
|
+
_setStateInDatum(stateKey, checkReverse, datum, filter, region) {
|
|
71349
|
+
this.filterGraphicsByDatum(datum, {
|
|
71350
|
+
filter,
|
|
71351
|
+
region,
|
|
71352
|
+
regionCallback: (elements, r) => {
|
|
71353
|
+
if (!datum) {
|
|
71354
|
+
r.interaction.clearEventElement(stateKey, true);
|
|
71355
|
+
}
|
|
71356
|
+
else if (elements.length) {
|
|
71357
|
+
elements.forEach(e => {
|
|
71358
|
+
r.interaction.startInteraction(stateKey, e);
|
|
71359
|
+
});
|
|
71360
|
+
if (checkReverse) {
|
|
71361
|
+
r.interaction.reverseEventElement(stateKey);
|
|
71362
|
+
}
|
|
71363
|
+
}
|
|
71180
71364
|
}
|
|
71181
71365
|
});
|
|
71182
71366
|
}
|
|
@@ -72776,9 +72960,7 @@ class BarSeries extends CartesianSeries {
|
|
|
72776
72960
|
else if (domainMin > 0) {
|
|
72777
72961
|
return scale.scale(domainMin);
|
|
72778
72962
|
}
|
|
72779
|
-
|
|
72780
|
-
return scale.scale(0);
|
|
72781
|
-
}
|
|
72963
|
+
return scale.scale(0);
|
|
72782
72964
|
}
|
|
72783
72965
|
}
|
|
72784
72966
|
};
|
|
@@ -76986,7 +77168,7 @@ const pie = (originData, op) => {
|
|
|
76986
77168
|
return data;
|
|
76987
77169
|
}
|
|
76988
77170
|
if (!showAllZero && showEmptyCircle && isDataEmpty(data, angleField, supportNegative)) {
|
|
76989
|
-
return
|
|
77171
|
+
return [];
|
|
76990
77172
|
}
|
|
76991
77173
|
const appendArcInfo = (data, startAngle, angle) => {
|
|
76992
77174
|
data[asStartAngle] = startAngle;
|
|
@@ -77475,6 +77657,7 @@ class BasePieSeries extends PolarSeries {
|
|
|
77475
77657
|
}, {
|
|
77476
77658
|
dataView: false
|
|
77477
77659
|
});
|
|
77660
|
+
this._emptyArcMark.setDepend(this._pieMark);
|
|
77478
77661
|
}
|
|
77479
77662
|
}
|
|
77480
77663
|
startAngleScale(datum) {
|
|
@@ -77510,8 +77693,8 @@ class BasePieSeries extends PolarSeries {
|
|
|
77510
77693
|
const emptyPieMark = this._emptyArcMark;
|
|
77511
77694
|
if (emptyPieMark) {
|
|
77512
77695
|
this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => {
|
|
77513
|
-
const
|
|
77514
|
-
return
|
|
77696
|
+
const data = this.getViewData().latestData;
|
|
77697
|
+
return !data || !data.length;
|
|
77515
77698
|
} }), 'normal', AttributeLevel.Series);
|
|
77516
77699
|
}
|
|
77517
77700
|
}
|
|
@@ -79720,7 +79903,8 @@ class ProgressLikeSeries extends PolarSeries {
|
|
|
79720
79903
|
return value;
|
|
79721
79904
|
}
|
|
79722
79905
|
}
|
|
79723
|
-
|
|
79906
|
+
const angle = this.angleAxisHelper.dataToPosition([datum[this._angleField[0]]]);
|
|
79907
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
79724
79908
|
}
|
|
79725
79909
|
getDimensionField() {
|
|
79726
79910
|
return this._specRadiusField;
|
|
@@ -79753,12 +79937,12 @@ class ProgressLikeSeries extends PolarSeries {
|
|
|
79753
79937
|
clip: true,
|
|
79754
79938
|
clipPath: () => {
|
|
79755
79939
|
const axis = this._getAngleAxis();
|
|
79940
|
+
const { x, y } = this.angleAxisHelper.center();
|
|
79941
|
+
const radius = this._computeLayoutRadius();
|
|
79756
79942
|
if (this._isTickMaskVisible(axis)) {
|
|
79757
79943
|
const { tickMask } = this._spec;
|
|
79758
79944
|
const { angle, offsetAngle, style = {} } = tickMask;
|
|
79759
79945
|
const subTickData = this._getAngleAxisSubTickData(axis);
|
|
79760
|
-
const { x, y } = this.angleAxisHelper.center();
|
|
79761
|
-
const radius = this._computeLayoutRadius();
|
|
79762
79946
|
const markStyle = style;
|
|
79763
79947
|
return subTickData.map(({ value }) => {
|
|
79764
79948
|
const pos = this.angleAxisHelper.dataToPosition([value]) + degreeToRadian(offsetAngle);
|
|
@@ -80179,7 +80363,11 @@ class LinearProgressSeries extends CartesianSeries {
|
|
|
80179
80363
|
leftPadding);
|
|
80180
80364
|
},
|
|
80181
80365
|
y1: (datum) => { var _a, _b; return valueInScaleRange(this.dataToPositionY(datum), (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.getScale) === null || _b === void 0 ? void 0 : _b.call(_a, 0)); },
|
|
80182
|
-
y: () => {
|
|
80366
|
+
y: () => {
|
|
80367
|
+
var _a, _b, _c;
|
|
80368
|
+
const value = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
|
|
80369
|
+
return this._spec.clamp ? valueInScaleRange(value, (_c = (_b = this._yAxisHelper) === null || _b === void 0 ? void 0 : _b.getScale) === null || _c === void 0 ? void 0 : _c.call(_b, 0)) : value;
|
|
80370
|
+
},
|
|
80183
80371
|
width: this._spec.bandWidth - leftPadding - rightPadding,
|
|
80184
80372
|
cornerRadius: this._spec.cornerRadius,
|
|
80185
80373
|
fill: this.getColorAttribute()
|
|
@@ -80198,7 +80386,11 @@ class LinearProgressSeries extends CartesianSeries {
|
|
|
80198
80386
|
topPadding);
|
|
80199
80387
|
},
|
|
80200
80388
|
height: this._spec.bandWidth - topPadding - bottomPadding,
|
|
80201
|
-
x: () => {
|
|
80389
|
+
x: () => {
|
|
80390
|
+
var _a, _b, _c;
|
|
80391
|
+
const value = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
|
|
80392
|
+
return this._spec.clamp ? valueInScaleRange(value, (_c = (_b = this._xAxisHelper) === null || _b === void 0 ? void 0 : _b.getScale) === null || _c === void 0 ? void 0 : _c.call(_b, 0)) : value;
|
|
80393
|
+
},
|
|
80202
80394
|
cornerRadius: this._spec.cornerRadius,
|
|
80203
80395
|
fill: this.getColorAttribute()
|
|
80204
80396
|
}, 'normal', AttributeLevel.Series);
|
|
@@ -87634,12 +87826,14 @@ class GaugeSeries extends ProgressLikeSeries {
|
|
|
87634
87826
|
_getAngleValueStartWithoutMask(datum) {
|
|
87635
87827
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87636
87828
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87637
|
-
|
|
87829
|
+
const angle = clamper(startAngle, (startAngle + endAngle) / 2)(startAngle + (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
|
|
87830
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
87638
87831
|
}
|
|
87639
87832
|
_getAngleValueEndWithoutMask(datum) {
|
|
87640
87833
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87641
87834
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87642
|
-
|
|
87835
|
+
const angle = clamper(endAngle, (startAngle + endAngle) / 2)(endAngle - (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
|
|
87836
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
87643
87837
|
}
|
|
87644
87838
|
_getAngleValueStartWithoutPadAngle(datum) {
|
|
87645
87839
|
return isValid$1(datum[SEGMENT_FIELD_START])
|
|
@@ -89950,21 +90144,21 @@ function isValidStrokeOrFill(attr) {
|
|
|
89950
90144
|
return isValid$1(attr) && attr !== 'none' && !((_a = attr.includes) === null || _a === void 0 ? void 0 : _a.call(attr, 'url'));
|
|
89951
90145
|
}
|
|
89952
90146
|
const getLineWidth = (attributes) => {
|
|
89953
|
-
const strokeWidth = parseFloat(attributes
|
|
90147
|
+
const strokeWidth = parseFloat(attributes.strokeWidth);
|
|
89954
90148
|
if (!isNaN(strokeWidth)) {
|
|
89955
90149
|
return strokeWidth;
|
|
89956
90150
|
}
|
|
89957
|
-
const stroke = attributes
|
|
90151
|
+
const stroke = attributes.stroke;
|
|
89958
90152
|
return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
|
|
89959
90153
|
};
|
|
89960
90154
|
const getFill = (attributes, defaultFill) => {
|
|
89961
90155
|
var _a;
|
|
89962
|
-
const fill = (_a = attributes
|
|
90156
|
+
const fill = (_a = attributes.fill) !== null && _a !== void 0 ? _a : defaultFill;
|
|
89963
90157
|
return fill && isValidStrokeOrFill(fill) ? fill : undefined;
|
|
89964
90158
|
};
|
|
89965
90159
|
const getStroke = (attributes, defaultStroke) => {
|
|
89966
90160
|
var _a;
|
|
89967
|
-
const stroke = (_a = attributes
|
|
90161
|
+
const stroke = (_a = attributes.stroke) !== null && _a !== void 0 ? _a : defaultStroke;
|
|
89968
90162
|
return stroke && isValidStrokeOrFill(stroke) ? stroke : false;
|
|
89969
90163
|
};
|
|
89970
90164
|
const commonAttributes = (attributes) => {
|
|
@@ -89973,7 +90167,7 @@ const commonAttributes = (attributes) => {
|
|
|
89973
90167
|
const graphicAttributeTransform = {
|
|
89974
90168
|
group: (attributes) => {
|
|
89975
90169
|
const common = commonAttributes(attributes);
|
|
89976
|
-
return Object.assign(Object.assign({}, common), { visibleAll: common
|
|
90170
|
+
return Object.assign(Object.assign({}, common), { visibleAll: common.visible !== false });
|
|
89977
90171
|
},
|
|
89978
90172
|
rule: (attributes) => {
|
|
89979
90173
|
return Object.assign(Object.assign({}, commonAttributes(attributes)), { x: parseFloat(attributes.x1), y: parseFloat(attributes.y1), x1: parseFloat(attributes.x2), y1: parseFloat(attributes.y2) });
|
|
@@ -90024,7 +90218,7 @@ const pictogram = (data) => {
|
|
|
90024
90218
|
el._uniqueId = `${el.id}-${index}`;
|
|
90025
90219
|
el.data = undefined;
|
|
90026
90220
|
const { graphicType: type, transform } = el;
|
|
90027
|
-
|
|
90221
|
+
const finalAttributes = {
|
|
90028
90222
|
visible: el.attributes.visibility !== 'hidden' && el.attributes.visibility !== 'collapse'
|
|
90029
90223
|
};
|
|
90030
90224
|
if (el.graphicType === 'text') {
|
|
@@ -90059,7 +90253,7 @@ const pictogram = (data) => {
|
|
|
90059
90253
|
return result;
|
|
90060
90254
|
});
|
|
90061
90255
|
if (children && children.length) {
|
|
90062
|
-
|
|
90256
|
+
const startX = (_b = (_a = texts[i]._textGroupStyle) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
|
|
90063
90257
|
let curX = startX;
|
|
90064
90258
|
for (let j = 0; j < children.length; j++) {
|
|
90065
90259
|
const currentChild = children[j];
|
|
@@ -91586,7 +91780,7 @@ class LinearProgressChartSpecTransformer extends CartesianChartSpecTransformer {
|
|
|
91586
91780
|
}
|
|
91587
91781
|
_getDefaultSeriesSpec(spec) {
|
|
91588
91782
|
var _a, _b;
|
|
91589
|
-
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track']);
|
|
91783
|
+
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track', 'clamp']);
|
|
91590
91784
|
series.direction = (_a = spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
|
|
91591
91785
|
series.cornerRadius = (_b = spec.cornerRadius) !== null && _b !== void 0 ? _b : 0;
|
|
91592
91786
|
return series;
|
|
@@ -92035,49 +92229,40 @@ class SankeyChart extends BaseChart {
|
|
|
92035
92229
|
}
|
|
92036
92230
|
_setStateInDatum(stateKey, checkReverse, datum, filter, region) {
|
|
92037
92231
|
const activeDatum = isArray$1(datum) ? datum[0] : datum;
|
|
92038
|
-
const
|
|
92039
|
-
|
|
92040
|
-
|
|
92041
|
-
|
|
92042
|
-
|
|
92043
|
-
|
|
92044
|
-
|
|
92045
|
-
|
|
92046
|
-
|
|
92047
|
-
|
|
92048
|
-
|
|
92049
|
-
|
|
92050
|
-
|
|
92051
|
-
|
|
92052
|
-
|
|
92053
|
-
|
|
92054
|
-
|
|
92055
|
-
|
|
92056
|
-
}
|
|
92057
|
-
|
|
92058
|
-
|
|
92059
|
-
|
|
92060
|
-
|
|
92061
|
-
|
|
92062
|
-
|
|
92063
|
-
|
|
92064
|
-
|
|
92065
|
-
|
|
92066
|
-
|
|
92067
|
-
|
|
92068
|
-
|
|
92069
|
-
r.interaction.
|
|
92070
|
-
if (mark.id().includes('node') || mark.id().includes('link')) {
|
|
92071
|
-
activeNodeOrLink = pickElement;
|
|
92072
|
-
}
|
|
92232
|
+
const markFilter = (series, mark) => {
|
|
92233
|
+
return mark.type !== 'text' && mark.getProduct() && (!filter || filter(series, mark));
|
|
92234
|
+
};
|
|
92235
|
+
this.filterGraphicsByDatum(activeDatum, {
|
|
92236
|
+
filter: markFilter,
|
|
92237
|
+
region,
|
|
92238
|
+
getDatum: e => {
|
|
92239
|
+
var _a;
|
|
92240
|
+
let d = (_a = e.getDatum()) === null || _a === void 0 ? void 0 : _a.datum;
|
|
92241
|
+
if (isArray$1(d)) {
|
|
92242
|
+
d = d[0];
|
|
92243
|
+
}
|
|
92244
|
+
return d;
|
|
92245
|
+
},
|
|
92246
|
+
callback: (element, mark, s, r) => {
|
|
92247
|
+
var _a, _b, _c;
|
|
92248
|
+
const id = (_a = mark.getProduct()) === null || _a === void 0 ? void 0 : _a.id();
|
|
92249
|
+
if (id && (id.includes('node') || id.includes('link'))) {
|
|
92250
|
+
(_c = (_b = s)._handleEmphasisElement) === null || _c === void 0 ? void 0 : _c.call(_b, { item: element });
|
|
92251
|
+
}
|
|
92252
|
+
},
|
|
92253
|
+
regionCallback: (elements, r) => {
|
|
92254
|
+
if (!activeDatum) {
|
|
92255
|
+
r.interaction.clearEventElement(stateKey, true);
|
|
92256
|
+
return;
|
|
92257
|
+
}
|
|
92258
|
+
else if (elements.length) {
|
|
92259
|
+
elements.forEach(e => {
|
|
92260
|
+
r.interaction.startInteraction(stateKey, e);
|
|
92261
|
+
});
|
|
92262
|
+
if (checkReverse) {
|
|
92263
|
+
r.interaction.reverseEventElement(stateKey);
|
|
92073
92264
|
}
|
|
92074
|
-
});
|
|
92075
|
-
if (activeNodeOrLink) {
|
|
92076
|
-
(_b = (_a = s)._handleEmphasisElement) === null || _b === void 0 ? void 0 : _b.call(_a, { item: activeNodeOrLink });
|
|
92077
92265
|
}
|
|
92078
|
-
});
|
|
92079
|
-
if (checkReverse && hasPick) {
|
|
92080
|
-
r.interaction.reverseEventElement(stateKey);
|
|
92081
92266
|
}
|
|
92082
92267
|
});
|
|
92083
92268
|
}
|
|
@@ -94457,7 +94642,7 @@ class BaseCrossHair extends BaseComponent {
|
|
|
94457
94642
|
Object.keys(this._stateByField).forEach(field => {
|
|
94458
94643
|
const fieldSpec = this._spec[field];
|
|
94459
94644
|
if (fieldSpec && fieldSpec.visible && fieldSpec.defaultSelect) {
|
|
94460
|
-
const { axisIndex, datum } = fieldSpec.defaultSelect;
|
|
94645
|
+
const { axisIndex = 0, datum } = fieldSpec.defaultSelect;
|
|
94461
94646
|
const axis = this._option.getComponentsByKey('axes').find(c => c.getSpecIndex() === axisIndex);
|
|
94462
94647
|
if (axis) {
|
|
94463
94648
|
this._stateByField[field].currentValue.clear();
|
|
@@ -95013,36 +95198,37 @@ const layoutCrosshair$1 = (stateItem) => {
|
|
|
95013
95198
|
};
|
|
95014
95199
|
}
|
|
95015
95200
|
else if (type === 'rect') {
|
|
95016
|
-
const
|
|
95201
|
+
const [offset0, offset1] = getRectSize(attributes, bandSize, offsetSize, cacheInfo.axis);
|
|
95017
95202
|
const { coordRange } = cacheInfo;
|
|
95018
95203
|
positionAttribute = {
|
|
95019
95204
|
visible: true,
|
|
95020
95205
|
start: {
|
|
95021
|
-
[coordKey]: Math.max(coord
|
|
95206
|
+
[coordKey]: Math.max(coord + offset0, coordRange[0]),
|
|
95022
95207
|
[anotherAxisKey]: sizeRange[0]
|
|
95023
95208
|
},
|
|
95024
95209
|
end: {
|
|
95025
|
-
[coordKey]: Math.min(coord +
|
|
95210
|
+
[coordKey]: Math.min(coord + offset1, coordRange[1]),
|
|
95026
95211
|
[anotherAxisKey]: sizeRange[1]
|
|
95027
95212
|
}
|
|
95028
95213
|
};
|
|
95029
95214
|
}
|
|
95030
95215
|
return positionAttribute;
|
|
95031
95216
|
};
|
|
95032
|
-
const getRectSize = (hair, bandSize, axis) => {
|
|
95217
|
+
const getRectSize = (hair, bandSize, offsetSize, axis) => {
|
|
95033
95218
|
var _a, _b, _c;
|
|
95034
|
-
|
|
95219
|
+
const visualSize = bandSize === 0 ? offsetSize : bandSize;
|
|
95220
|
+
let size = visualSize;
|
|
95035
95221
|
if ((_a = hair.style) === null || _a === void 0 ? void 0 : _a.sizePercent) {
|
|
95036
|
-
|
|
95222
|
+
size = visualSize * hair.style.sizePercent;
|
|
95037
95223
|
}
|
|
95038
95224
|
else if (typeof ((_b = hair.style) === null || _b === void 0 ? void 0 : _b.size) === 'number') {
|
|
95039
|
-
|
|
95225
|
+
size = hair.style.size;
|
|
95040
95226
|
}
|
|
95041
95227
|
else if (typeof ((_c = hair.style) === null || _c === void 0 ? void 0 : _c.size) === 'function') {
|
|
95042
95228
|
const axisRect = axis.getLayoutRect();
|
|
95043
|
-
|
|
95229
|
+
size = hair.style.size(axisRect, axis);
|
|
95044
95230
|
}
|
|
95045
|
-
return
|
|
95231
|
+
return bandSize === 0 ? [-size / 2, size / 2] : [bandSize / 2 - size / 2, size / 2 + bandSize / 2];
|
|
95046
95232
|
};
|
|
95047
95233
|
|
|
95048
95234
|
class CartesianCrossHair extends BaseCrossHair {
|
|
@@ -97532,17 +97718,22 @@ function computeOffsetFromRegion(point, offset, region) {
|
|
|
97532
97718
|
}
|
|
97533
97719
|
return offset;
|
|
97534
97720
|
}
|
|
97721
|
+
function getProcessInfo(spec) {
|
|
97722
|
+
return {
|
|
97723
|
+
isXProcess: isValid$1(spec.x),
|
|
97724
|
+
isYProcess: isValid$1(spec.y),
|
|
97725
|
+
isX1Process: isValid$1(spec.x1),
|
|
97726
|
+
isY1Process: isValid$1(spec.y1),
|
|
97727
|
+
isAngleProcess: isValid$1(spec.angle),
|
|
97728
|
+
isRadiusProcess: isValid$1(spec.radius),
|
|
97729
|
+
isAngle1Process: isValid$1(spec.angle1),
|
|
97730
|
+
isRadius1Process: isValid$1(spec.radius1),
|
|
97731
|
+
isCoordinatesProcess: isValid$1(spec.coordinates),
|
|
97732
|
+
isValidProcess: isValid$1(spec.process)
|
|
97733
|
+
};
|
|
97734
|
+
}
|
|
97535
97735
|
function getMarkLineProcessInfo(spec) {
|
|
97536
|
-
const isXProcess
|
|
97537
|
-
const isYProcess = 'y' in spec;
|
|
97538
|
-
const isX1Process = 'x1' in spec;
|
|
97539
|
-
const isY1Process = 'y1' in spec;
|
|
97540
|
-
const isAngleProcess = 'angle' in spec;
|
|
97541
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97542
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97543
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97544
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97545
|
-
const isValidProcess = 'process' in spec;
|
|
97736
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess, isValidProcess } = getProcessInfo(spec);
|
|
97546
97737
|
return {
|
|
97547
97738
|
doXProcess: isXProcess && !isYProcess && !isY1Process,
|
|
97548
97739
|
doXYY1Process: isXProcess && isYProcess && isY1Process,
|
|
@@ -97558,15 +97749,7 @@ function getMarkLineProcessInfo(spec) {
|
|
|
97558
97749
|
};
|
|
97559
97750
|
}
|
|
97560
97751
|
function getMarkAreaProcessInfo(spec) {
|
|
97561
|
-
const isXProcess
|
|
97562
|
-
const isX1Process = 'x1' in spec;
|
|
97563
|
-
const isYProcess = 'y' in spec;
|
|
97564
|
-
const isY1Process = 'y1' in spec;
|
|
97565
|
-
const isAngleProcess = 'angle' in spec;
|
|
97566
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97567
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97568
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97569
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97752
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess } = getProcessInfo(spec);
|
|
97570
97753
|
return {
|
|
97571
97754
|
doXProcess: isXProcess && isX1Process && !isYProcess && !isY1Process,
|
|
97572
97755
|
doYProcess: isYProcess && isY1Process && !isXProcess && !isX1Process,
|
|
@@ -98084,13 +98267,14 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98084
98267
|
return 'cartesian';
|
|
98085
98268
|
}
|
|
98086
98269
|
_createMarkerComponent() {
|
|
98087
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
98088
|
-
const {
|
|
98270
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
98271
|
+
const { startSymbol = {}, endSymbol = {} } = this._spec;
|
|
98272
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98089
98273
|
const markLineAttrs = {
|
|
98090
98274
|
zIndex: this.layoutZIndex,
|
|
98091
|
-
interactive: (
|
|
98092
|
-
hover: (
|
|
98093
|
-
select: (
|
|
98275
|
+
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
98276
|
+
hover: (_c = this._spec.interactive) !== null && _c !== void 0 ? _c : true,
|
|
98277
|
+
select: (_d = this._spec.interactive) !== null && _d !== void 0 ? _d : true,
|
|
98094
98278
|
points: [
|
|
98095
98279
|
{ x: 0, y: 0 },
|
|
98096
98280
|
{ x: 0, y: 0 }
|
|
@@ -98102,17 +98286,25 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98102
98286
|
radius: 0,
|
|
98103
98287
|
startAngle: 0,
|
|
98104
98288
|
endAngle: 0,
|
|
98105
|
-
lineStyle: transformStyle(transformToGraphic((
|
|
98106
|
-
clipInRange: (
|
|
98107
|
-
label:
|
|
98289
|
+
lineStyle: transformStyle(transformToGraphic((_e = this._spec.line) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98290
|
+
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98291
|
+
label: label.map(labelItem => {
|
|
98292
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98293
|
+
}),
|
|
98108
98294
|
state: {
|
|
98109
|
-
line: transformState((
|
|
98110
|
-
lineStartSymbol: transformState((
|
|
98111
|
-
lineEndSymbol: transformState((
|
|
98112
|
-
label:
|
|
98113
|
-
|
|
98295
|
+
line: transformState((_h = (_g = this._spec.line) === null || _g === void 0 ? void 0 : _g.state) !== null && _h !== void 0 ? _h : {}, this._markerData, this._markAttributeContext),
|
|
98296
|
+
lineStartSymbol: transformState((_k = (_j = this._spec.startSymbol) === null || _j === void 0 ? void 0 : _j.state) !== null && _k !== void 0 ? _k : {}, this._markerData, this._markAttributeContext),
|
|
98297
|
+
lineEndSymbol: transformState((_m = (_l = this._spec.endSymbol) === null || _l === void 0 ? void 0 : _l.state) !== null && _m !== void 0 ? _m : {}, this._markerData, this._markAttributeContext),
|
|
98298
|
+
label: label.map(labelItem => {
|
|
98299
|
+
var _a;
|
|
98300
|
+
return transformState((_a = labelItem.state) !== null && _a !== void 0 ? _a : {}, this._markerData, this._markAttributeContext);
|
|
98301
|
+
}),
|
|
98302
|
+
labelBackground: label.map(labelItem => {
|
|
98303
|
+
var _a, _b;
|
|
98304
|
+
return transformState((_b = (_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : {}, this._markerData, this._markAttributeContext);
|
|
98305
|
+
})
|
|
98114
98306
|
},
|
|
98115
|
-
animation: (
|
|
98307
|
+
animation: (_o = this._spec.animation) !== null && _o !== void 0 ? _o : false,
|
|
98116
98308
|
animationEnter: this._spec.animationEnter,
|
|
98117
98309
|
animationExit: this._spec.animationExit,
|
|
98118
98310
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98137,7 +98329,7 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98137
98329
|
return markLine;
|
|
98138
98330
|
}
|
|
98139
98331
|
_getUpdateMarkerAttrs() {
|
|
98140
|
-
var _a, _b
|
|
98332
|
+
var _a, _b;
|
|
98141
98333
|
const spec = this._spec;
|
|
98142
98334
|
const data = this._markerData;
|
|
98143
98335
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98147,7 +98339,7 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98147
98339
|
const seriesData = relativeSeries.getViewData().latestData;
|
|
98148
98340
|
const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
98149
98341
|
let limitRect;
|
|
98150
|
-
if (spec.clip || (
|
|
98342
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98151
98343
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98152
98344
|
startRelativeSeries.getRegion(),
|
|
98153
98345
|
endRelativeSeries.getRegion(),
|
|
@@ -98160,10 +98352,13 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98160
98352
|
height: maxY - minY
|
|
98161
98353
|
};
|
|
98162
98354
|
}
|
|
98163
|
-
const markerComponentAttr = (
|
|
98164
|
-
const
|
|
98165
|
-
|
|
98166
|
-
|
|
98355
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98356
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98357
|
+
const specLabels = array(this._spec.label);
|
|
98358
|
+
const labelAttrs = prevLabelAttrs.map((prevLabel, index) => {
|
|
98359
|
+
const specLabel = specLabels[index] || {};
|
|
98360
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod ? specLabel.formatMethod(dataPoints, seriesData) : prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98361
|
+
});
|
|
98167
98362
|
return Object.assign(Object.assign({}, pointsAttr), { label: labelAttrs, limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY });
|
|
98168
98363
|
}
|
|
98169
98364
|
_markerLayout() {
|
|
@@ -98265,7 +98460,7 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98265
98460
|
return { points };
|
|
98266
98461
|
}
|
|
98267
98462
|
_markerLayout() {
|
|
98268
|
-
var _a, _b, _c, _d
|
|
98463
|
+
var _a, _b, _c, _d;
|
|
98269
98464
|
const updateAttrs = this._getUpdateMarkerAttrs();
|
|
98270
98465
|
if (this._spec.type === 'type-step') {
|
|
98271
98466
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98292,34 +98487,23 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98292
98487
|
else {
|
|
98293
98488
|
expandDistanceValue = expandDistance;
|
|
98294
98489
|
}
|
|
98295
|
-
const { points,
|
|
98490
|
+
const { points, limitRect } = updateAttrs;
|
|
98296
98491
|
const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
|
|
98297
98492
|
let labelPositionAttrs;
|
|
98298
98493
|
if (multiSegment && isValid$1(mainSegmentIndex)) {
|
|
98299
98494
|
labelPositionAttrs = {
|
|
98300
98495
|
position: 'middle',
|
|
98301
|
-
autoRotate: false
|
|
98302
|
-
refX: 0,
|
|
98303
|
-
refY: 0
|
|
98496
|
+
autoRotate: false
|
|
98304
98497
|
};
|
|
98305
98498
|
}
|
|
98306
98499
|
else {
|
|
98307
|
-
labelPositionAttrs = Object.assign(
|
|
98308
|
-
}
|
|
98309
|
-
if (isValidNumber$1((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.refX)) {
|
|
98310
|
-
labelPositionAttrs.refX += this._spec.label.refX;
|
|
98311
|
-
}
|
|
98312
|
-
if (isValidNumber$1((_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.refY)) {
|
|
98313
|
-
labelPositionAttrs.refY += this._spec.label.refY;
|
|
98314
|
-
}
|
|
98315
|
-
if (isValidNumber$1((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.dx)) {
|
|
98316
|
-
labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + this._spec.label.dx;
|
|
98500
|
+
labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
|
|
98317
98501
|
}
|
|
98318
|
-
|
|
98319
|
-
|
|
98320
|
-
|
|
98321
|
-
const
|
|
98322
|
-
(
|
|
98502
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98503
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98504
|
+
const updateLabels = array(updateAttrs.label);
|
|
98505
|
+
const labelsInSpec = array(this._spec.label);
|
|
98506
|
+
(_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
|
|
98323
98507
|
points: multiSegment
|
|
98324
98508
|
? [
|
|
98325
98509
|
[joinPoints[0], joinPoints[1]],
|
|
@@ -98327,7 +98511,30 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98327
98511
|
[joinPoints[2], joinPoints[3]]
|
|
98328
98512
|
]
|
|
98329
98513
|
: joinPoints,
|
|
98330
|
-
label:
|
|
98514
|
+
label: updateLabels.map((labelItem, index) => {
|
|
98515
|
+
var _a, _b, _c, _d;
|
|
98516
|
+
let refX = 0;
|
|
98517
|
+
let refY = 0;
|
|
98518
|
+
let dx = (_a = labelPositionAttrs.dx) !== null && _a !== void 0 ? _a : 0;
|
|
98519
|
+
let dy = (_b = labelPositionAttrs.dy) !== null && _b !== void 0 ? _b : 0;
|
|
98520
|
+
const labelSpec = (_c = labelsInSpec[index]) !== null && _c !== void 0 ? _c : labelsInSpec[0];
|
|
98521
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refX)) {
|
|
98522
|
+
refX += labelSpec.refX;
|
|
98523
|
+
}
|
|
98524
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refY)) {
|
|
98525
|
+
refY += labelSpec.refY;
|
|
98526
|
+
}
|
|
98527
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dx)) {
|
|
98528
|
+
dx += labelSpec.dx;
|
|
98529
|
+
}
|
|
98530
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dy)) {
|
|
98531
|
+
dy += labelSpec.dy;
|
|
98532
|
+
}
|
|
98533
|
+
return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { refX,
|
|
98534
|
+
refY,
|
|
98535
|
+
dx,
|
|
98536
|
+
dy, textStyle: Object.assign(Object.assign({}, (_d = prevLabelAttrs[index]) === null || _d === void 0 ? void 0 : _d.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
|
|
98537
|
+
}),
|
|
98331
98538
|
limitRect,
|
|
98332
98539
|
multiSegment,
|
|
98333
98540
|
mainSegmentIndex,
|
|
@@ -98336,7 +98543,7 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98336
98543
|
});
|
|
98337
98544
|
}
|
|
98338
98545
|
else {
|
|
98339
|
-
(
|
|
98546
|
+
(_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
|
|
98340
98547
|
}
|
|
98341
98548
|
}
|
|
98342
98549
|
_computeOptions() {
|
|
@@ -98400,15 +98607,15 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98400
98607
|
type: 'markerAggregation',
|
|
98401
98608
|
options
|
|
98402
98609
|
});
|
|
98403
|
-
if (spec.process &&
|
|
98610
|
+
if (spec.process && isValid$1(spec.process.x)) {
|
|
98404
98611
|
options = [this._processSpecByDims([{ dim: 'x', specValue: spec.process.x }])];
|
|
98405
98612
|
needAggr = true;
|
|
98406
98613
|
}
|
|
98407
|
-
if (spec.process &&
|
|
98614
|
+
if (spec.process && isValid$1(spec.process.y)) {
|
|
98408
98615
|
options = options = [this._processSpecByDims([{ dim: 'y', specValue: spec.process.y }])];
|
|
98409
98616
|
needAggr = true;
|
|
98410
98617
|
}
|
|
98411
|
-
if (spec.process &&
|
|
98618
|
+
if (spec.process && isValid$1(spec.process.xy)) {
|
|
98412
98619
|
const { xField, yField } = relativeSeries.getSpec();
|
|
98413
98620
|
options = {
|
|
98414
98621
|
fieldX: xField,
|
|
@@ -98690,8 +98897,8 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98690
98897
|
return 'cartesian';
|
|
98691
98898
|
}
|
|
98692
98899
|
_createMarkerComponent() {
|
|
98693
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
98694
|
-
const label = (_a = this._spec.label) !== null && _a !== void 0 ? _a : {};
|
|
98900
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
98901
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98695
98902
|
const markAreaAttrs = {
|
|
98696
98903
|
zIndex: this.layoutZIndex,
|
|
98697
98904
|
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
@@ -98713,13 +98920,20 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98713
98920
|
endAngle: 0,
|
|
98714
98921
|
areaStyle: transformStyle(transformToGraphic((_e = this._spec.area) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98715
98922
|
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98716
|
-
label:
|
|
98923
|
+
label: label.map((labelItem) => {
|
|
98924
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98925
|
+
}),
|
|
98717
98926
|
state: {
|
|
98718
98927
|
area: transformState((_g = this._spec.area) === null || _g === void 0 ? void 0 : _g.state, this._markerData, this._markAttributeContext),
|
|
98719
|
-
label:
|
|
98720
|
-
|
|
98928
|
+
label: label.map((labelItem) => {
|
|
98929
|
+
return transformState(labelItem.state, this._markerData, this._markAttributeContext);
|
|
98930
|
+
}),
|
|
98931
|
+
labelBackground: label.map((labelItem) => {
|
|
98932
|
+
var _a;
|
|
98933
|
+
return transformState((_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state, this._markerData, this._markAttributeContext);
|
|
98934
|
+
})
|
|
98721
98935
|
},
|
|
98722
|
-
animation: (
|
|
98936
|
+
animation: (_h = this._spec.animation) !== null && _h !== void 0 ? _h : false,
|
|
98723
98937
|
animationEnter: this._spec.animationEnter,
|
|
98724
98938
|
animationExit: this._spec.animationExit,
|
|
98725
98939
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98728,7 +98942,7 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98728
98942
|
return markArea;
|
|
98729
98943
|
}
|
|
98730
98944
|
_markerLayout() {
|
|
98731
|
-
var _a
|
|
98945
|
+
var _a;
|
|
98732
98946
|
const spec = this._spec;
|
|
98733
98947
|
const data = this._markerData;
|
|
98734
98948
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98742,7 +98956,7 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98742
98956
|
: data.latestData
|
|
98743
98957
|
: seriesData;
|
|
98744
98958
|
let limitRect;
|
|
98745
|
-
if (spec.clip || (
|
|
98959
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98746
98960
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98747
98961
|
startRelativeSeries.getRegion(),
|
|
98748
98962
|
endRelativeSeries.getRegion(),
|
|
@@ -98756,10 +98970,15 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98756
98970
|
};
|
|
98757
98971
|
}
|
|
98758
98972
|
if (this._markerComponent) {
|
|
98759
|
-
|
|
98760
|
-
|
|
98761
|
-
|
|
98762
|
-
|
|
98973
|
+
const prevLabelAttrs = array((_a = this._markerComponent.attribute) === null || _a === void 0 ? void 0 : _a.label);
|
|
98974
|
+
const specLabels = array(this._spec.label);
|
|
98975
|
+
this._markerComponent.setAttributes(Object.assign(Object.assign({}, pointsAttr), { label: prevLabelAttrs.map((prevLabel, index) => {
|
|
98976
|
+
const specLabel = specLabels[index] || {};
|
|
98977
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod
|
|
98978
|
+
?
|
|
98979
|
+
specLabel.formatMethod(dataPoints, seriesData)
|
|
98980
|
+
: prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98981
|
+
}), limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY }));
|
|
98763
98982
|
}
|
|
98764
98983
|
}
|
|
98765
98984
|
_initDataView() {
|
|
@@ -99988,9 +100207,9 @@ class CartesianMarkPoint extends BaseMarkPoint {
|
|
|
99988
100207
|
const spec = this._spec;
|
|
99989
100208
|
const data = this._markerData;
|
|
99990
100209
|
const relativeSeries = this._relativeSeries;
|
|
99991
|
-
const isXYLayout =
|
|
99992
|
-
const isCoordinateLayout =
|
|
99993
|
-
const isPositionLayout =
|
|
100210
|
+
const isXYLayout = isValid$1(spec.x) && isValid$1(spec.y);
|
|
100211
|
+
const isCoordinateLayout = isValid$1(spec.coordinate);
|
|
100212
|
+
const isPositionLayout = isValid$1(spec.position);
|
|
99994
100213
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
99995
100214
|
let point;
|
|
99996
100215
|
if (isXYLayout) {
|
|
@@ -100113,7 +100332,6 @@ class Brush extends BaseComponent {
|
|
|
100113
100332
|
this._outOfBrushElementsMap = {};
|
|
100114
100333
|
this._linkedInBrushElementsMap = {};
|
|
100115
100334
|
this._linkedOutOfBrushElementsMap = {};
|
|
100116
|
-
this._needInitOutState = true;
|
|
100117
100335
|
this._cacheInteractiveRangeAttrs = [];
|
|
100118
100336
|
this._needDisablePickable = false;
|
|
100119
100337
|
this._releatedAxes = [];
|
|
@@ -100121,6 +100339,11 @@ class Brush extends BaseComponent {
|
|
|
100121
100339
|
this._axisDataZoomMap = {};
|
|
100122
100340
|
this._zoomRecord = [];
|
|
100123
100341
|
}
|
|
100342
|
+
static getSpecInfo(chartSpec) {
|
|
100343
|
+
return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
|
|
100344
|
+
return s.visible !== false;
|
|
100345
|
+
});
|
|
100346
|
+
}
|
|
100124
100347
|
init() {
|
|
100125
100348
|
const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
|
|
100126
100349
|
const outOfBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.outOfBrush);
|
|
@@ -100133,9 +100356,22 @@ class Brush extends BaseComponent {
|
|
|
100133
100356
|
});
|
|
100134
100357
|
});
|
|
100135
100358
|
}
|
|
100136
|
-
|
|
100137
|
-
|
|
100138
|
-
|
|
100359
|
+
_initNeedOperatedItem() {
|
|
100360
|
+
const seriesUserId = this._spec.seriesId;
|
|
100361
|
+
const seriesIndex = this._spec.seriesIndex;
|
|
100362
|
+
this._relativeRegions.forEach(r => {
|
|
100363
|
+
const allMarks = [];
|
|
100364
|
+
r.getSeries().forEach((s) => {
|
|
100365
|
+
if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
|
|
100366
|
+
(seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
|
|
100367
|
+
(!seriesIndex && !seriesUserId)) {
|
|
100368
|
+
allMarks.push(...s.getMarksWithoutRoot());
|
|
100369
|
+
}
|
|
100370
|
+
this._itemMap[r.id] = allMarks;
|
|
100371
|
+
});
|
|
100372
|
+
});
|
|
100373
|
+
this._linkedSeries.forEach(s => {
|
|
100374
|
+
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
100139
100375
|
});
|
|
100140
100376
|
}
|
|
100141
100377
|
created() {
|
|
@@ -100147,41 +100383,91 @@ class Brush extends BaseComponent {
|
|
|
100147
100383
|
this._initAxisDataZoomMap();
|
|
100148
100384
|
this._initNeedOperatedItem();
|
|
100149
100385
|
}
|
|
100150
|
-
|
|
100151
|
-
|
|
100152
|
-
|
|
100153
|
-
|
|
100154
|
-
|
|
100155
|
-
|
|
100386
|
+
_bindRegions() {
|
|
100387
|
+
if (!isValid$1(this._spec.regionId) && !isValid$1(this._spec.regionIndex)) {
|
|
100388
|
+
this._relativeRegions = this._option.getAllRegions();
|
|
100389
|
+
}
|
|
100390
|
+
else {
|
|
100391
|
+
this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
100392
|
+
}
|
|
100393
|
+
}
|
|
100394
|
+
_bindLinkedSeries() {
|
|
100395
|
+
if (!isValid$1(this._spec.brushLinkSeriesId) && !isValid$1(this._spec.brushLinkSeriesIndex)) {
|
|
100396
|
+
return;
|
|
100397
|
+
}
|
|
100398
|
+
this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
|
|
100399
|
+
}
|
|
100400
|
+
_initRegionAxisMap() {
|
|
100401
|
+
if (isValid$1(this._spec.axisId)) {
|
|
100402
|
+
array(this._spec.axisId).forEach((axisId) => {
|
|
100403
|
+
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
100404
|
+
});
|
|
100405
|
+
}
|
|
100406
|
+
else if (isValid$1(this._spec.axisIndex)) {
|
|
100407
|
+
array(this._spec.axisIndex).forEach((axisIndex) => {
|
|
100408
|
+
this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
|
|
100409
|
+
});
|
|
100410
|
+
}
|
|
100411
|
+
else {
|
|
100412
|
+
this._releatedAxes = this._option.getComponentsByKey('axes');
|
|
100413
|
+
}
|
|
100414
|
+
this._releatedAxes.forEach((axis) => {
|
|
100415
|
+
axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
|
|
100416
|
+
if (this._regionAxisMap['region_' + region.id]) {
|
|
100417
|
+
this._regionAxisMap['region_' + region.id].push(axis);
|
|
100418
|
+
}
|
|
100419
|
+
else {
|
|
100420
|
+
this._regionAxisMap['region_' + region.id] = [axis];
|
|
100421
|
+
}
|
|
100422
|
+
});
|
|
100423
|
+
});
|
|
100424
|
+
}
|
|
100425
|
+
_initAxisDataZoomMap() {
|
|
100426
|
+
this._option.getComponentsByKey('dataZoom').forEach((dz) => {
|
|
100427
|
+
if (dz.relatedAxisComponent) {
|
|
100428
|
+
this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
|
|
100156
100429
|
}
|
|
100430
|
+
});
|
|
100431
|
+
}
|
|
100432
|
+
initEvent() {
|
|
100433
|
+
}
|
|
100434
|
+
onRender(ctx) {
|
|
100435
|
+
}
|
|
100436
|
+
changeRegions(regions) {
|
|
100437
|
+
}
|
|
100438
|
+
_compareSpec(spec, prevSpec) {
|
|
100439
|
+
if (this._brushComponents) {
|
|
100440
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100441
|
+
this._updateBrushComponent(region, index);
|
|
100442
|
+
});
|
|
100157
100443
|
}
|
|
100158
|
-
|
|
100444
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
100445
|
+
if (!isEqual(prevSpec, spec)) {
|
|
100446
|
+
result.reRender = true;
|
|
100447
|
+
result.reMake = true;
|
|
100448
|
+
}
|
|
100449
|
+
return result;
|
|
100159
100450
|
}
|
|
100160
|
-
|
|
100451
|
+
onLayoutEnd(ctx) {
|
|
100161
100452
|
var _a;
|
|
100162
|
-
|
|
100163
|
-
|
|
100164
|
-
|
|
100453
|
+
super.onLayoutEnd(ctx);
|
|
100454
|
+
if (this._option.disableTriggerEvent) {
|
|
100455
|
+
return;
|
|
100456
|
+
}
|
|
100457
|
+
const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
100458
|
+
if (brushVisible) {
|
|
100459
|
+
if (!this._brushComponents) {
|
|
100460
|
+
this._brushComponents = [];
|
|
100461
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100462
|
+
this._createBrushComponent(region, index);
|
|
100463
|
+
});
|
|
100464
|
+
}
|
|
100465
|
+
else {
|
|
100466
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100467
|
+
this._updateBrushComponent(region, index);
|
|
100468
|
+
});
|
|
100469
|
+
}
|
|
100165
100470
|
}
|
|
100166
|
-
return data;
|
|
100167
|
-
}
|
|
100168
|
-
_getBrushInteractiveAttr(region) {
|
|
100169
|
-
const regionLayoutPosition = region.getLayoutStartPoint();
|
|
100170
|
-
const regionLayoutRect = region.getLayoutRect();
|
|
100171
|
-
const seriesRegionStartX = regionLayoutPosition.x;
|
|
100172
|
-
const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
|
|
100173
|
-
const seriesRegionStartY = regionLayoutPosition.y;
|
|
100174
|
-
const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
100175
|
-
return {
|
|
100176
|
-
interactiveRange: {
|
|
100177
|
-
minY: seriesRegionStartY,
|
|
100178
|
-
maxY: seriesRegionEndY,
|
|
100179
|
-
minX: seriesRegionStartX,
|
|
100180
|
-
maxX: seriesRegionEndX
|
|
100181
|
-
},
|
|
100182
|
-
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
100183
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
100184
|
-
};
|
|
100185
100471
|
}
|
|
100186
100472
|
_updateBrushComponent(region, componentIndex) {
|
|
100187
100473
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -100189,7 +100475,6 @@ class Brush extends BaseComponent {
|
|
|
100189
100475
|
brushComponent.setAttributes(interactiveAttr);
|
|
100190
100476
|
this._initMarkBrushState(componentIndex, '');
|
|
100191
100477
|
brushComponent.children[0].removeAllChild();
|
|
100192
|
-
this._needInitOutState = true;
|
|
100193
100478
|
}
|
|
100194
100479
|
_createBrushComponent(region, componentIndex) {
|
|
100195
100480
|
var _a, _b;
|
|
@@ -100197,9 +100482,12 @@ class Brush extends BaseComponent {
|
|
|
100197
100482
|
const brush = new Brush$1(Object.assign(Object.assign(Object.assign({ zIndex: this.layoutZIndex, brushStyle: transformToGraphic((_a = this._spec) === null || _a === void 0 ? void 0 : _a.style) }, interactiveAttr), this._spec), { disableTriggerEvent: this._option.disableTriggerEvent }));
|
|
100198
100483
|
brush.id = (_b = this._spec.id) !== null && _b !== void 0 ? _b : `brush-${this.id}`;
|
|
100199
100484
|
this.getContainer().add(brush);
|
|
100200
|
-
const { brushMode = 'single' } = this._spec;
|
|
100201
100485
|
this._brushComponents.push(brush);
|
|
100202
100486
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
100487
|
+
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
100488
|
+
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
100489
|
+
this._emitEvent(ChartEvent.brushActive, region);
|
|
100490
|
+
});
|
|
100203
100491
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
100204
100492
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100205
100493
|
});
|
|
@@ -100207,41 +100495,45 @@ class Brush extends BaseComponent {
|
|
|
100207
100495
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100208
100496
|
});
|
|
100209
100497
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
100210
|
-
if (this._needInitOutState && brushMode === 'single') {
|
|
100211
|
-
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
100212
|
-
}
|
|
100213
|
-
this._needInitOutState = false;
|
|
100214
100498
|
this._needDisablePickable = true;
|
|
100215
|
-
this._handleBrushChange(
|
|
100499
|
+
this._handleBrushChange(region, e);
|
|
100216
100500
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100217
100501
|
});
|
|
100218
100502
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
100219
|
-
this._handleBrushChange(
|
|
100503
|
+
this._handleBrushChange(region, e);
|
|
100220
100504
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100221
100505
|
});
|
|
100222
100506
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
100223
100507
|
this._initMarkBrushState(componentIndex, '');
|
|
100224
|
-
this._needInitOutState = true;
|
|
100225
100508
|
this._needDisablePickable = false;
|
|
100226
|
-
this._handleBrushChange(ChartEvent.brushChange, region, e);
|
|
100227
|
-
this._handleBrushChange(ChartEvent.brushClear, region, e);
|
|
100228
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
100229
100509
|
this._emitEvent(ChartEvent.brushClear, region);
|
|
100230
100510
|
});
|
|
100231
100511
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
100232
|
-
|
|
100512
|
+
var _a;
|
|
100233
100513
|
this._needDisablePickable = false;
|
|
100234
100514
|
const { operateMask } = e.detail;
|
|
100235
|
-
this.
|
|
100236
|
-
|
|
100237
|
-
|
|
100238
|
-
|
|
100515
|
+
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
|
|
100516
|
+
if (this._spec.onBrushEnd(e) === true) {
|
|
100517
|
+
this.clearGraphic();
|
|
100518
|
+
this._initMarkBrushState(componentIndex, '');
|
|
100519
|
+
this._needDisablePickable = false;
|
|
100520
|
+
this._emitEvent(ChartEvent.brushClear, region);
|
|
100521
|
+
}
|
|
100522
|
+
else {
|
|
100523
|
+
this._spec.onBrushEnd(e);
|
|
100524
|
+
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100525
|
+
}
|
|
100526
|
+
}
|
|
100527
|
+
else {
|
|
100528
|
+
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
100529
|
+
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
100530
|
+
this._setAxisAndDataZoom(operateMask, region);
|
|
100531
|
+
}
|
|
100532
|
+
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100239
100533
|
}
|
|
100240
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100241
100534
|
});
|
|
100242
100535
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
100243
100536
|
const { operateMask } = e.detail;
|
|
100244
|
-
this._handleBrushChange(ChartEvent.brushEnd, region, e);
|
|
100245
100537
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
100246
100538
|
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
100247
100539
|
this._setAxisAndDataZoom(operateMask, region);
|
|
@@ -100249,12 +100541,65 @@ class Brush extends BaseComponent {
|
|
|
100249
100541
|
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100250
100542
|
});
|
|
100251
100543
|
}
|
|
100252
|
-
|
|
100544
|
+
_getBrushInteractiveAttr(region) {
|
|
100545
|
+
const regionLayoutPosition = region.getLayoutStartPoint();
|
|
100546
|
+
const regionLayoutRect = region.getLayoutRect();
|
|
100547
|
+
const seriesRegionStartX = regionLayoutPosition.x;
|
|
100548
|
+
const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
|
|
100549
|
+
const seriesRegionStartY = regionLayoutPosition.y;
|
|
100550
|
+
const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
100551
|
+
return {
|
|
100552
|
+
interactiveRange: {
|
|
100553
|
+
minY: seriesRegionStartY,
|
|
100554
|
+
maxY: seriesRegionEndY,
|
|
100555
|
+
minX: seriesRegionStartX,
|
|
100556
|
+
maxX: seriesRegionEndX
|
|
100557
|
+
},
|
|
100558
|
+
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
100559
|
+
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
100560
|
+
};
|
|
100561
|
+
}
|
|
100562
|
+
_transformBrushedMarkAttr(brushedStyle) {
|
|
100563
|
+
const styleResult = {};
|
|
100564
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
|
|
100565
|
+
styleResult.symbolType = brushedStyle.symbol;
|
|
100566
|
+
}
|
|
100567
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
|
|
100568
|
+
styleResult.size = brushedStyle.symbolSize;
|
|
100569
|
+
}
|
|
100570
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
|
|
100571
|
+
styleResult.fill = brushedStyle.color;
|
|
100572
|
+
}
|
|
100573
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
|
|
100574
|
+
styleResult.fillOpacity = brushedStyle.colorAlpha;
|
|
100575
|
+
}
|
|
100576
|
+
return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
|
|
100577
|
+
}
|
|
100578
|
+
_handleBrushChange(region, e) {
|
|
100253
100579
|
const { operateMask } = e.detail;
|
|
100254
100580
|
this._reconfigItem(operateMask, region);
|
|
100255
100581
|
this._reconfigLinkedItem(operateMask, region);
|
|
100256
100582
|
}
|
|
100583
|
+
_extendDataInBrush(elementsMap) {
|
|
100584
|
+
var _a, _b;
|
|
100585
|
+
const data = [];
|
|
100586
|
+
for (const brushName in elementsMap) {
|
|
100587
|
+
for (const elementKey in elementsMap[brushName]) {
|
|
100588
|
+
data.push(Object.assign({}, (_b = (_a = elementsMap[brushName][elementKey]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]));
|
|
100589
|
+
}
|
|
100590
|
+
}
|
|
100591
|
+
return data;
|
|
100592
|
+
}
|
|
100593
|
+
_extendDatumOutOfBrush(elementsMap) {
|
|
100594
|
+
var _a;
|
|
100595
|
+
const data = [];
|
|
100596
|
+
for (const elementKey in elementsMap) {
|
|
100597
|
+
data.push((_a = elementsMap[elementKey].data) === null || _a === void 0 ? void 0 : _a[0]);
|
|
100598
|
+
}
|
|
100599
|
+
return data;
|
|
100600
|
+
}
|
|
100257
100601
|
_emitEvent(eventType, region) {
|
|
100602
|
+
var _a;
|
|
100258
100603
|
this.event.emit(eventType, {
|
|
100259
100604
|
model: this,
|
|
100260
100605
|
value: {
|
|
@@ -100269,27 +100614,28 @@ class Brush extends BaseComponent {
|
|
|
100269
100614
|
linkedInBrushElementsMap: this._linkedInBrushElementsMap,
|
|
100270
100615
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
100271
100616
|
zoomRecord: this._zoomRecord
|
|
100272
|
-
}
|
|
100617
|
+
},
|
|
100618
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
100273
100619
|
});
|
|
100274
100620
|
}
|
|
100275
|
-
_transformBrushedMarkAttr(brushedStyle) {
|
|
100276
|
-
const styleResult = {};
|
|
100277
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
|
|
100278
|
-
styleResult.symbolType = brushedStyle.symbol;
|
|
100279
|
-
}
|
|
100280
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
|
|
100281
|
-
styleResult.size = brushedStyle.symbolSize;
|
|
100282
|
-
}
|
|
100283
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
|
|
100284
|
-
styleResult.fill = brushedStyle.color;
|
|
100285
|
-
}
|
|
100286
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
|
|
100287
|
-
styleResult.fillOpacity = brushedStyle.colorAlpha;
|
|
100288
|
-
}
|
|
100289
|
-
return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
|
|
100290
|
-
}
|
|
100291
100621
|
_reconfigItem(operateMask, region) {
|
|
100622
|
+
var _a, _b, _c;
|
|
100623
|
+
if (!(operateMask === null || operateMask === void 0 ? void 0 : operateMask.globalTransMatrix) || !((_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
|
|
100624
|
+
return;
|
|
100625
|
+
}
|
|
100626
|
+
const points = (_c = (_b = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _b === void 0 ? void 0 : _b.points) !== null && _c !== void 0 ? _c : [];
|
|
100627
|
+
const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
|
|
100628
|
+
const pointsCoord = points.map((p) => {
|
|
100629
|
+
return {
|
|
100630
|
+
x: a * p.x + c * p.y + e,
|
|
100631
|
+
y: b * p.x + d * p.y + f
|
|
100632
|
+
};
|
|
100633
|
+
});
|
|
100634
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100292
100635
|
this._itemMap[region.id].forEach((mark) => {
|
|
100636
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100637
|
+
return;
|
|
100638
|
+
}
|
|
100293
100639
|
const grammarMark = mark.getProduct();
|
|
100294
100640
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100295
100641
|
return;
|
|
@@ -100299,7 +100645,8 @@ class Brush extends BaseComponent {
|
|
|
100299
100645
|
var _a, _b, _c;
|
|
100300
100646
|
const graphicItem = el.getGraphicItem();
|
|
100301
100647
|
const elementKey = mark.id + '_' + el.key;
|
|
100302
|
-
|
|
100648
|
+
const isBrushContainItem = this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem);
|
|
100649
|
+
if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && isBrushContainItem) {
|
|
100303
100650
|
el.addState(IN_BRUSH_STATE);
|
|
100304
100651
|
if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100305
100652
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100307,8 +100654,7 @@ class Brush extends BaseComponent {
|
|
|
100307
100654
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name][elementKey] = el;
|
|
100308
100655
|
delete this._outOfBrushElementsMap[elementKey];
|
|
100309
100656
|
}
|
|
100310
|
-
else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
|
|
100311
|
-
!this._isBrushContainItem(operateMask, graphicItem)) {
|
|
100657
|
+
else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) && !isBrushContainItem) {
|
|
100312
100658
|
el.removeState(IN_BRUSH_STATE);
|
|
100313
100659
|
el.addState(OUT_BRUSH_STATE);
|
|
100314
100660
|
this._outOfBrushElementsMap[elementKey] = el;
|
|
@@ -100319,14 +100665,36 @@ class Brush extends BaseComponent {
|
|
|
100319
100665
|
});
|
|
100320
100666
|
}
|
|
100321
100667
|
_reconfigLinkedItem(operateMask, region) {
|
|
100668
|
+
var _a;
|
|
100669
|
+
if (!(operateMask === null || operateMask === void 0 ? void 0 : operateMask.globalTransMatrix) || !((_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
|
|
100670
|
+
return;
|
|
100671
|
+
}
|
|
100322
100672
|
const regionLayoutPos = region.getLayoutStartPoint();
|
|
100323
100673
|
const seriesId = region.getSeries().map(s => s.id);
|
|
100324
100674
|
this._linkedSeries.forEach((s) => {
|
|
100675
|
+
var _a, _b;
|
|
100325
100676
|
if (!seriesId.includes(s.id)) {
|
|
100326
100677
|
const sRegionLayoutPos = s.getRegion().getLayoutStartPoint();
|
|
100327
100678
|
const regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x;
|
|
100328
100679
|
const regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y;
|
|
100680
|
+
const points = (_b = (_a = operateMask === null || operateMask === void 0 ? void 0 : operateMask.attribute) === null || _a === void 0 ? void 0 : _a.points) !== null && _b !== void 0 ? _b : [];
|
|
100681
|
+
const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
|
|
100682
|
+
const dx = regionOffsetX || 0;
|
|
100683
|
+
const dy = regionOffsetY || 0;
|
|
100684
|
+
const pointsCoord = points.map((p) => {
|
|
100685
|
+
return {
|
|
100686
|
+
x: a * p.x + c * p.y + e + dx,
|
|
100687
|
+
y: b * p.x + d * p.y + f + dy
|
|
100688
|
+
};
|
|
100689
|
+
});
|
|
100690
|
+
operateMask.globalAABBBounds
|
|
100691
|
+
.clone()
|
|
100692
|
+
.set(operateMask.globalAABBBounds.x1 + dx, operateMask.globalAABBBounds.y1 + dy, operateMask.globalAABBBounds.x2 + dx, operateMask.globalAABBBounds.y2 + dy);
|
|
100693
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100329
100694
|
this._linkedItemMap[s.id].forEach((mark) => {
|
|
100695
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100696
|
+
return;
|
|
100697
|
+
}
|
|
100330
100698
|
const grammarMark = mark.getProduct();
|
|
100331
100699
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100332
100700
|
return;
|
|
@@ -100337,7 +100705,7 @@ class Brush extends BaseComponent {
|
|
|
100337
100705
|
const graphicItem = el.getGraphicItem();
|
|
100338
100706
|
const elementKey = mark.id + '_' + el.key;
|
|
100339
100707
|
if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
|
|
100340
|
-
this._isBrushContainItem(operateMask,
|
|
100708
|
+
this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100341
100709
|
el.addState(IN_BRUSH_STATE);
|
|
100342
100710
|
if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100343
100711
|
this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100346,7 +100714,7 @@ class Brush extends BaseComponent {
|
|
|
100346
100714
|
delete this._linkedOutOfBrushElementsMap[elementKey];
|
|
100347
100715
|
}
|
|
100348
100716
|
else if (((_c = (_b = this._linkedInBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
|
|
100349
|
-
!this._isBrushContainItem(operateMask,
|
|
100717
|
+
!this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100350
100718
|
el.removeState(IN_BRUSH_STATE);
|
|
100351
100719
|
el.addState(OUT_BRUSH_STATE);
|
|
100352
100720
|
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
@@ -100357,75 +100725,81 @@ class Brush extends BaseComponent {
|
|
|
100357
100725
|
}
|
|
100358
100726
|
});
|
|
100359
100727
|
}
|
|
100360
|
-
_isBrushContainItem(
|
|
100361
|
-
var _a, _b, _c;
|
|
100362
|
-
if (!(brushMask === null || brushMask === void 0 ? void 0 : brushMask.globalTransMatrix) || !((_a = brushMask === null || brushMask === void 0 ? void 0 : brushMask.attribute) === null || _a === void 0 ? void 0 : _a.points)) {
|
|
100363
|
-
return false;
|
|
100364
|
-
}
|
|
100365
|
-
const points = (_c = (_b = brushMask === null || brushMask === void 0 ? void 0 : brushMask.attribute) === null || _b === void 0 ? void 0 : _b.points) !== null && _c !== void 0 ? _c : [];
|
|
100366
|
-
const { a, b, c, d, e, f } = brushMask.globalTransMatrix;
|
|
100367
|
-
const dx = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dx) || 0;
|
|
100368
|
-
const dy = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dy) || 0;
|
|
100369
|
-
const pointsCoord = points.map((p) => {
|
|
100370
|
-
return {
|
|
100371
|
-
x: a * p.x + c * p.y + e + dx,
|
|
100372
|
-
y: b * p.x + d * p.y + f + dy
|
|
100373
|
-
};
|
|
100374
|
-
});
|
|
100375
|
-
brushMask.globalAABBBounds
|
|
100376
|
-
.clone()
|
|
100377
|
-
.set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
100378
|
-
const x = item.globalTransMatrix.e;
|
|
100379
|
-
const y = item.globalTransMatrix.f;
|
|
100728
|
+
_isBrushContainItem(brushMaskAABBBounds, brushMaskPointsCoord, item) {
|
|
100380
100729
|
let itemBounds = [];
|
|
100381
|
-
if (item.type
|
|
100382
|
-
const {
|
|
100383
|
-
const size = array(itemSize)[0] / 2;
|
|
100730
|
+
if (['symbol', 'rect'].includes(item.type)) {
|
|
100731
|
+
const { x1, x2, y1, y2 } = item === null || item === void 0 ? void 0 : item.globalAABBBounds;
|
|
100384
100732
|
itemBounds = [
|
|
100385
100733
|
{
|
|
100386
|
-
x:
|
|
100387
|
-
y:
|
|
100734
|
+
x: x1,
|
|
100735
|
+
y: y1
|
|
100388
100736
|
},
|
|
100389
100737
|
{
|
|
100390
|
-
x:
|
|
100391
|
-
y:
|
|
100738
|
+
x: x2,
|
|
100739
|
+
y: y1
|
|
100392
100740
|
},
|
|
100393
100741
|
{
|
|
100394
|
-
x:
|
|
100395
|
-
y:
|
|
100742
|
+
x: x2,
|
|
100743
|
+
y: y2
|
|
100396
100744
|
},
|
|
100397
100745
|
{
|
|
100398
|
-
x:
|
|
100399
|
-
y:
|
|
100746
|
+
x: x1,
|
|
100747
|
+
y: y2
|
|
100400
100748
|
}
|
|
100401
100749
|
];
|
|
100402
|
-
return polygonIntersectPolygon(
|
|
100750
|
+
return polygonIntersectPolygon(brushMaskPointsCoord, itemBounds);
|
|
100403
100751
|
}
|
|
100404
|
-
|
|
100405
|
-
|
|
100406
|
-
|
|
100407
|
-
|
|
100408
|
-
|
|
100409
|
-
|
|
100410
|
-
|
|
100411
|
-
|
|
100412
|
-
|
|
100413
|
-
|
|
100414
|
-
|
|
100415
|
-
|
|
100416
|
-
|
|
100417
|
-
|
|
100418
|
-
|
|
100419
|
-
|
|
100420
|
-
|
|
100421
|
-
{
|
|
100422
|
-
x: x,
|
|
100423
|
-
y: y + height
|
|
100752
|
+
return brushMaskAABBBounds.intersects(item.globalAABBBounds);
|
|
100753
|
+
}
|
|
100754
|
+
_initMarkBrushState(componentIndex, stateName) {
|
|
100755
|
+
this._brushComponents.forEach((brush, index) => {
|
|
100756
|
+
if (index !== componentIndex) {
|
|
100757
|
+
brush.children[0].removeAllChild();
|
|
100758
|
+
}
|
|
100759
|
+
});
|
|
100760
|
+
this._inBrushElementsMap = {};
|
|
100761
|
+
this._outOfBrushElementsMap = {};
|
|
100762
|
+
this._linkedInBrushElementsMap = {};
|
|
100763
|
+
this._linkedOutOfBrushElementsMap = {};
|
|
100764
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100765
|
+
Object.entries(this._itemMap).forEach(([regionId, marks]) => {
|
|
100766
|
+
marks.forEach((mark) => {
|
|
100767
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100768
|
+
return;
|
|
100424
100769
|
}
|
|
100425
|
-
|
|
100426
|
-
|
|
100427
|
-
|
|
100428
|
-
|
|
100770
|
+
const grammarMark = mark.getProduct();
|
|
100771
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100772
|
+
return;
|
|
100773
|
+
}
|
|
100774
|
+
const elements = grammarMark.elements;
|
|
100775
|
+
elements.forEach((el) => {
|
|
100776
|
+
const elementKey = mark.id + '_' + el.key;
|
|
100777
|
+
el.removeState(IN_BRUSH_STATE);
|
|
100778
|
+
el.removeState(OUT_BRUSH_STATE);
|
|
100779
|
+
el.addState(stateName);
|
|
100780
|
+
this._outOfBrushElementsMap[elementKey] = el;
|
|
100781
|
+
});
|
|
100782
|
+
});
|
|
100783
|
+
});
|
|
100784
|
+
Object.entries(this._linkedItemMap).forEach(([seriesId, marks]) => {
|
|
100785
|
+
marks.forEach((mark) => {
|
|
100786
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100787
|
+
return;
|
|
100788
|
+
}
|
|
100789
|
+
const grammarMark = mark.getProduct();
|
|
100790
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100791
|
+
return;
|
|
100792
|
+
}
|
|
100793
|
+
const elements = grammarMark.elements;
|
|
100794
|
+
elements.forEach((el) => {
|
|
100795
|
+
const elementKey = mark.id + '_' + el.key;
|
|
100796
|
+
el.removeState(IN_BRUSH_STATE);
|
|
100797
|
+
el.removeState(OUT_BRUSH_STATE);
|
|
100798
|
+
el.addState(stateName);
|
|
100799
|
+
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
100800
|
+
});
|
|
100801
|
+
});
|
|
100802
|
+
});
|
|
100429
100803
|
}
|
|
100430
100804
|
_stateClamp(state) {
|
|
100431
100805
|
return Math.min(Math.max(0, state), 1);
|
|
@@ -100491,139 +100865,9 @@ class Brush extends BaseComponent {
|
|
|
100491
100865
|
});
|
|
100492
100866
|
}
|
|
100493
100867
|
}
|
|
100494
|
-
_bindRegions() {
|
|
100495
|
-
if (isValid$1(this._spec.regionId) && isValid$1(this._spec.regionIndex)) {
|
|
100496
|
-
this._relativeRegions = this._option.getAllRegions();
|
|
100497
|
-
}
|
|
100498
|
-
this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
100499
|
-
}
|
|
100500
|
-
_bindLinkedSeries() {
|
|
100501
|
-
if (isValid$1(this._spec.brushLinkSeriesId) && isValid$1(this._spec.brushLinkSeriesIndex)) {
|
|
100502
|
-
return;
|
|
100503
|
-
}
|
|
100504
|
-
this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
|
|
100505
|
-
}
|
|
100506
|
-
_initRegionAxisMap() {
|
|
100507
|
-
if (isValid$1(this._spec.axisId)) {
|
|
100508
|
-
array(this._spec.axisId).forEach((axisId) => {
|
|
100509
|
-
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
100510
|
-
});
|
|
100511
|
-
}
|
|
100512
|
-
else if (isValid$1(this._spec.axisIndex)) {
|
|
100513
|
-
array(this._spec.axisIndex).forEach((axisIndex) => {
|
|
100514
|
-
this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
|
|
100515
|
-
});
|
|
100516
|
-
}
|
|
100517
|
-
else {
|
|
100518
|
-
this._releatedAxes = this._option.getComponentsByKey('axes');
|
|
100519
|
-
}
|
|
100520
|
-
this._releatedAxes.forEach((axis) => {
|
|
100521
|
-
axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
|
|
100522
|
-
if (this._regionAxisMap['region_' + region.id]) {
|
|
100523
|
-
this._regionAxisMap['region_' + region.id].push(axis);
|
|
100524
|
-
}
|
|
100525
|
-
else {
|
|
100526
|
-
this._regionAxisMap['region_' + region.id] = [axis];
|
|
100527
|
-
}
|
|
100528
|
-
});
|
|
100529
|
-
});
|
|
100530
|
-
}
|
|
100531
|
-
_initAxisDataZoomMap() {
|
|
100532
|
-
this._option.getComponentsByKey('dataZoom').forEach((dz) => {
|
|
100533
|
-
if (dz.relatedAxisComponent) {
|
|
100534
|
-
this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
|
|
100535
|
-
}
|
|
100536
|
-
});
|
|
100537
|
-
}
|
|
100538
|
-
_initNeedOperatedItem() {
|
|
100539
|
-
const seriesUserId = this._spec.seriesId;
|
|
100540
|
-
const seriesIndex = this._spec.seriesIndex;
|
|
100541
|
-
this._relativeRegions.forEach(r => {
|
|
100542
|
-
const allMarks = [];
|
|
100543
|
-
r.getSeries().forEach((s) => {
|
|
100544
|
-
if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
|
|
100545
|
-
(seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
|
|
100546
|
-
(!seriesIndex && !seriesUserId)) {
|
|
100547
|
-
allMarks.push(...s.getMarksWithoutRoot());
|
|
100548
|
-
}
|
|
100549
|
-
this._itemMap[r.id] = allMarks;
|
|
100550
|
-
});
|
|
100551
|
-
});
|
|
100552
|
-
this._linkedSeries.forEach(s => {
|
|
100553
|
-
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
100554
|
-
});
|
|
100555
|
-
}
|
|
100556
|
-
_initMarkBrushState(componentIndex, stateName) {
|
|
100557
|
-
this._brushComponents.forEach((brush, index) => {
|
|
100558
|
-
if (index !== componentIndex) {
|
|
100559
|
-
brush.children[0].removeAllChild();
|
|
100560
|
-
}
|
|
100561
|
-
});
|
|
100562
|
-
this._inBrushElementsMap = {};
|
|
100563
|
-
this._outOfBrushElementsMap = {};
|
|
100564
|
-
this._linkedInBrushElementsMap = {};
|
|
100565
|
-
this._linkedOutOfBrushElementsMap = {};
|
|
100566
|
-
this._option.getAllSeries().forEach((s) => {
|
|
100567
|
-
s.getMarksWithoutRoot().forEach((mark) => {
|
|
100568
|
-
const grammarMark = mark.getProduct();
|
|
100569
|
-
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100570
|
-
return;
|
|
100571
|
-
}
|
|
100572
|
-
const elements = grammarMark.elements;
|
|
100573
|
-
elements.forEach((el) => {
|
|
100574
|
-
const elementKey = mark.id + '_' + el.key;
|
|
100575
|
-
el.removeState(IN_BRUSH_STATE);
|
|
100576
|
-
el.removeState(OUT_BRUSH_STATE);
|
|
100577
|
-
el.addState(stateName);
|
|
100578
|
-
this._outOfBrushElementsMap[elementKey] = el;
|
|
100579
|
-
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
100580
|
-
});
|
|
100581
|
-
});
|
|
100582
|
-
});
|
|
100583
|
-
}
|
|
100584
|
-
initEvent() {
|
|
100585
|
-
}
|
|
100586
|
-
onRender(ctx) {
|
|
100587
|
-
}
|
|
100588
|
-
changeRegions(regions) {
|
|
100589
|
-
}
|
|
100590
100868
|
_getNeedClearVRenderComponents() {
|
|
100591
100869
|
return this._brushComponents;
|
|
100592
100870
|
}
|
|
100593
|
-
_compareSpec(spec, prevSpec) {
|
|
100594
|
-
if (this._brushComponents) {
|
|
100595
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100596
|
-
this._updateBrushComponent(region, index);
|
|
100597
|
-
});
|
|
100598
|
-
}
|
|
100599
|
-
const result = super._compareSpec(spec, prevSpec);
|
|
100600
|
-
if (!isEqual(prevSpec, spec)) {
|
|
100601
|
-
result.reRender = true;
|
|
100602
|
-
result.reMake = true;
|
|
100603
|
-
}
|
|
100604
|
-
return result;
|
|
100605
|
-
}
|
|
100606
|
-
onLayoutEnd(ctx) {
|
|
100607
|
-
var _a;
|
|
100608
|
-
super.onLayoutEnd(ctx);
|
|
100609
|
-
if (this._option.disableTriggerEvent) {
|
|
100610
|
-
return;
|
|
100611
|
-
}
|
|
100612
|
-
const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
100613
|
-
if (brushVisible) {
|
|
100614
|
-
if (!this._brushComponents) {
|
|
100615
|
-
this._brushComponents = [];
|
|
100616
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100617
|
-
this._createBrushComponent(region, index);
|
|
100618
|
-
});
|
|
100619
|
-
}
|
|
100620
|
-
else {
|
|
100621
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100622
|
-
this._updateBrushComponent(region, index);
|
|
100623
|
-
});
|
|
100624
|
-
}
|
|
100625
|
-
}
|
|
100626
|
-
}
|
|
100627
100871
|
clearGraphic() {
|
|
100628
100872
|
if (this._brushComponents) {
|
|
100629
100873
|
this._brushComponents.forEach(brush => {
|
|
@@ -100634,7 +100878,9 @@ class Brush extends BaseComponent {
|
|
|
100634
100878
|
clear() {
|
|
100635
100879
|
if (this._brushComponents) {
|
|
100636
100880
|
const container = this.getContainer();
|
|
100637
|
-
this._brushComponents.forEach(brush => {
|
|
100881
|
+
this._brushComponents.forEach((brush, index) => {
|
|
100882
|
+
this._initMarkBrushState(index, '');
|
|
100883
|
+
this._needDisablePickable = false;
|
|
100638
100884
|
brush.removeAllChild();
|
|
100639
100885
|
brush.releaseBrushEvents();
|
|
100640
100886
|
if (container) {
|
|
@@ -102628,16 +102874,29 @@ class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
102628
102874
|
}
|
|
102629
102875
|
}
|
|
102630
102876
|
_updateDomStyle(sizeKey = 'width') {
|
|
102631
|
-
var _a, _b, _c, _d;
|
|
102877
|
+
var _a, _b, _c, _d, _e;
|
|
102632
102878
|
const rootDom = this._rootDom;
|
|
102633
102879
|
const contentDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
102880
|
+
const titleDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));
|
|
102634
102881
|
if (contentDom) {
|
|
102635
102882
|
const tooltipSpec = this._component.getSpec();
|
|
102636
102883
|
const contentStyle = {};
|
|
102637
|
-
|
|
102638
|
-
|
|
102884
|
+
const titleLabel = (_a = tooltipSpec.style) === null || _a === void 0 ? void 0 : _a.titleLabel;
|
|
102885
|
+
const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;
|
|
102886
|
+
if (autoFixTitleWidth && titleDom) {
|
|
102887
|
+
const maxWidth = [...contentDom.children].reduce((res, col) => {
|
|
102888
|
+
return sizeKey === 'height'
|
|
102889
|
+
? res + col.getBoundingClientRect().width
|
|
102890
|
+
: Math.max(res, col.getBoundingClientRect().width);
|
|
102891
|
+
}, 0);
|
|
102892
|
+
if (maxWidth > 0) {
|
|
102893
|
+
titleDom.style.maxWidth = `${maxWidth}px`;
|
|
102894
|
+
titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;
|
|
102895
|
+
}
|
|
102896
|
+
}
|
|
102897
|
+
if (isValid$1((_b = tooltipSpec === null || tooltipSpec === void 0 ? void 0 : tooltipSpec.style) === null || _b === void 0 ? void 0 : _b.maxContentHeight)) {
|
|
102639
102898
|
const titleHeight = titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)
|
|
102640
|
-
? titleDom.getBoundingClientRect().height + ((
|
|
102899
|
+
? titleDom.getBoundingClientRect().height + ((_c = tooltipSpec.style.spaceRow) !== null && _c !== void 0 ? _c : 0)
|
|
102641
102900
|
: 0;
|
|
102642
102901
|
const viewRect = this._chartOption.getChartViewRect();
|
|
102643
102902
|
const maxHeight = calcLayoutNumber(tooltipSpec.style.maxContentHeight, Math.min(viewRect.height, document.body.clientHeight) -
|
|
@@ -102655,7 +102914,7 @@ class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
102655
102914
|
if (rows) {
|
|
102656
102915
|
for (let i = 0; i < rows.length; i++) {
|
|
102657
102916
|
const row = rows[i];
|
|
102658
|
-
const cols = (
|
|
102917
|
+
const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
|
|
102659
102918
|
for (let j = 0; j < cols.length; j++) {
|
|
102660
102919
|
const width = cols[j].getBoundingClientRect()[sizeKey];
|
|
102661
102920
|
if (widthByCol[j] === undefined || widthByCol[j] < width) {
|
|
@@ -102665,7 +102924,7 @@ class DomTooltipHandler extends BaseTooltipHandler {
|
|
|
102665
102924
|
}
|
|
102666
102925
|
for (let i = 0; i < rows.length; i++) {
|
|
102667
102926
|
const row = rows[i];
|
|
102668
|
-
const cols = (
|
|
102927
|
+
const cols = (_e = row.children) !== null && _e !== void 0 ? _e : [];
|
|
102669
102928
|
for (let j = 0; j < cols.length; j++) {
|
|
102670
102929
|
cols[j].style[sizeKey] = `${widthByCol[j]}px`;
|
|
102671
102930
|
}
|
|
@@ -103831,4 +104090,4 @@ const registerMediaQuery = () => {
|
|
|
103831
104090
|
registerChartPlugin(MediaQuery);
|
|
103832
104091
|
};
|
|
103833
104092
|
|
|
103834
|
-
export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, CommonChartSpecTransformer, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, functionTransform, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getFieldAlias, getMergedTheme, getPolarDimensionInfo, getRegionStackGroup, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, mergeFields, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, sortStackValueGroup, specTransform, spiralEffect, stack, stackGroup, stackMosaic, stackMosaicTotal, stackOffsetSilhouette, stackTotal, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };
|
|
104093
|
+
export { Arc3dMark, ArcMark, AreaChart, AreaMark, AreaSeries, AxisSyncPlugin, Bar3dChart, Bar3dSeries, BarChart, BarSeries, BaseChart, BaseChartSpecTransformer, BaseMark, BaseSeries, BoxPlotChart, BoxPlotSeries, Brush, CanvasTooltipHandler, CartesianAxis, CartesianBandAxis, CartesianChartSpecTransformer, CartesianCrossHair, CartesianLinearAxis, CartesianLogAxis, CartesianMarkArea, CartesianMarkLine, CartesianMarkPoint, CartesianSeries, CartesianSymlogAxis, CartesianTimeAxis, CirclePackingChart, CirclePackingSeries, CircularProgressChart, CircularProgressSeries, CommonChart, CommonChartSpecTransformer, ComponentMark, ComposedEventMapper, ContinuousLegend, CorrelationChart, CorrelationSeries, CustomMark, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_WIDTH, DEFAULT_DATA_INDEX, DEFAULT_DATA_KEY, DEFAULT_DATA_SERIES_FIELD, DEFAULT_MEASURE_CANVAS_ID, DEFAULT_SERIES_STYLE_NAME, DataZoom, DimensionClickEvent, DimensionEventEnum, DimensionHoverEvent, DiscreteLegend, DomTooltipHandler, DotSeries, Event$1 as Event, Factory$1 as Factory, FormatterPlugin, Funnel3dChart, Funnel3dSeries, FunnelChart, FunnelSeries, GaugeChart, GaugePointerSeries, GaugeSeries, GeoCoordinate, GeoMarkPoint, GridLayout, GroupMark, HeatmapChart, HeatmapSeries, Histogram3dChart, HistogramChart, ImageMark, Indicator, Label, Layout$1 as Layout, Layout3d, LineChart, LineMark, LineSeries, LinearProgressChart, LinearProgressSeries, LinkSeries, LiquidChart, LiquidSeries, MOSAIC_CAT_END_PERCENT, MOSAIC_CAT_START_PERCENT, MOSAIC_VALUE_END_PERCENT, MOSAIC_VALUE_START_PERCENT, MapChart, MapLabelComponent, MapSeries, MediaQuery, MosaicChart, MosaicSeries, PREFIX, PathMark, PictogramChart, PictogramSeries, Pie3dChart, Pie3dSeries, PieChart, PieSeries, Player, PolarAxis, PolarBandAxis, PolarCrossHair, PolarLinearAxis, PolarMarkArea, PolarMarkLine, PolarMarkPoint, PolarSeries, PolygonMark, ProgressLikeSeries, Pyramid3dMark, RadarChart, RadarSeries, RangeAreaChart, RangeAreaSeries, RangeColumn3dChart, RangeColumn3dSeries, RangeColumnChart, RangeColumnSeries, Rect3dMark, RectMark, RenderModeEnum, RippleMark, RoseChart, RoseLikeSeries, RoseSeries, RuleMark, SEGMENT_FIELD_END, SEGMENT_FIELD_START, STACK_FIELD_END, STACK_FIELD_END_OffsetSilhouette, STACK_FIELD_END_PERCENT, STACK_FIELD_KEY, STACK_FIELD_START, STACK_FIELD_START_OffsetSilhouette, STACK_FIELD_START_PERCENT, STACK_FIELD_TOTAL, STACK_FIELD_TOTAL_BOTTOM, STACK_FIELD_TOTAL_PERCENT, STACK_FIELD_TOTAL_TOP, SankeyChart, SankeySeries, ScatterChart, ScatterSeries, ScrollBar, SequenceChart, SeriesMarkNameEnum, SeriesTypeEnum, SeriesTypeForThemeEnum, SunburstChart, SunburstSeries, SymbolMark, TextMark, ThemeManager$1 as ThemeManager, Title, Tooltip, TooltipResult, TotalLabel, TreemapChart, TreemapSeries, VChart, VennChart, VennSeries, WaterfallChart, WaterfallSeries, WordCloud3dChart, WordCloud3dSeries, WordCloudChart, WordCloudSeries, alternatingWave, builtinThemes, centerToCorner, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeActualDataScheme, cornerToCenter, createArc, createArea, createGroup, createLine, createRect, createRichText, createSymbol, createText, darkTheme$1 as darkTheme, dataScheme, VChart as default, defaultThemeName, diagonalCenterToEdge, diagonalTopLeftToBottomRight, functionTransform, getActualColor, getCartesianDimensionInfo, getColorSchemeBySeries, getDataScheme, getFieldAlias, getMergedTheme, getPolarDimensionInfo, getRegionStackGroup, getTheme, hasThemeMerged, isColorKey, isProgressiveDataColorScheme, isTokenKey, lightTheme, mergeFields, particleEffect, pulseWave, queryColorFromColorScheme, queryToken, randomOpacity, register3DPlugin, registerAllEnv, registerAllMarks, registerAnimate, registerArc3dMark, registerArcMark, registerAreaChart, registerAreaMark, registerAreaSeries, registerBar3dChart, registerBar3dSeries, registerBarChart, registerBarSeries, registerBoxplotChart, registerBoxplotSeries, registerBrowserEnv, registerBrush, registerCanvasTooltipHandler, registerCartesianBandAxis, registerCartesianCrossHair, registerCartesianLinearAxis, registerCartesianLogAxis, registerCartesianSymlogAxis, registerCartesianTimeAxis, registerChartPlugin, registerCirclePackingChart, registerCirclePackingSeries, registerCircularProgressChart, registerCircularProgressSeries, registerCommonChart, registerComponentMark, registerContinuousLegend, registerCorrelationChart, registerCustomMark, registerDataZoom, registerDiscreteLegend, registerDomTooltipHandler, registerDotSeries, registerDragPlugin, registerFormatPlugin, registerFunnel3dChart, registerFunnel3dSeries, registerFunnelChart, registerFunnelSeries, registerGaugeChart, registerGaugePointerSeries, registerGaugeSeries, registerGeoCoordinate, registerGeoMarkPoint, registerGesturePlugin, registerGridLayout, registerGroupMark, registerHarmonyEnv, registerHeatmapChart, registerHeatmapSeries, registerHistogram3dChart, registerHistogramChart, registerHtmlAttributePlugin, registerImageMark, registerIndicator, registerLabel, registerLarkEnv, registerLayout3d, registerLineChart, registerLineMark, registerLineSeries, registerLinearProgressChart, registerLinearProgressSeries, registerLinkSeries, registerLiquidChart, registerLiquidSeries, registerLynxEnv, registerMapChart, registerMapLabel, registerMapSeries, registerMarkArea, registerMarkLine, registerMarkPoint, registerMediaQuery, registerMorph, registerMosaicChart, registerMosaicSeries, registerNodeEnv, registerPathMark, registerPictogramChart, registerPictogramSeries, registerPie3dChart, registerPie3dSeries, registerPieChart, registerPieSeries, registerPlayer, registerPolarBandAxis, registerPolarCrossHair, registerPolarLinearAxis, registerPolarMarkArea, registerPolarMarkLine, registerPolarMarkPoint, registerPolygonMark, registerPoptip, registerPyramid3dMark, registerRadarChart, registerRadarSeries, registerRangeAreaChart, registerRangeAreaSeries, registerRangeColumn3dChart, registerRangeColumn3dSeries, registerRangeColumnChart, registerRangeColumnSeries, registerReactAttributePlugin, registerRect3dMark, registerRectMark, registerRippleMark, registerRoseChart, registerRoseSeries, registerRuleMark, registerSankeyChart, registerSankeySeries, registerScatterChart, registerScatterSeries, registerScrollBar, registerSequenceChart, registerSunBurstSeries, registerSunburstChart, registerSymbolMark, registerTTEnv, registerTaroEnv, registerTextMark, registerTheme, registerTitle, registerTooltip, registerTotalLabel, registerTreemapChart, registerTreemapSeries, registerVennChart, registerVennSeries, registerWXEnv, registerWaterfallChart, registerWaterfallSeries, registerWordCloud3dChart, registerWordCloud3dSeries, registerWordCloudChart, registerWordCloudSeries, registerWordCloudShapeChart, removeTheme, rippleEffect, rotationScan, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, snakeWave, sortStackValueGroup, specTransform, spiralEffect, stack, stackGroup, stackMosaic, stackMosaicTotal, stackOffsetSilhouette, stackTotal, themeExist, themes, token, transformColorSchemeToStandardStruct, version, vglobal };
|