@visactor/vchart 1.13.9-alpha.6 → 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 +1047 -747
- package/build/index.js +1047 -746
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/index.d.ts +1 -1
- package/cjs/chart/index.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/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/layout.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/index.d.ts +1 -1
- package/esm/chart/index.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/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/layout.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.js
CHANGED
|
@@ -1759,6 +1759,37 @@
|
|
|
1759
1759
|
y: anchorY
|
|
1760
1760
|
};
|
|
1761
1761
|
};
|
|
1762
|
+
const aabbSeparation = (a, b) => Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
|
|
1763
|
+
const obbSeparation = (a, b) => {
|
|
1764
|
+
const axes = [{
|
|
1765
|
+
x: Math.cos(a.angle),
|
|
1766
|
+
y: Math.sin(a.angle)
|
|
1767
|
+
}, {
|
|
1768
|
+
x: -Math.sin(a.angle),
|
|
1769
|
+
y: Math.cos(a.angle)
|
|
1770
|
+
}, {
|
|
1771
|
+
x: Math.cos(b.angle),
|
|
1772
|
+
y: Math.sin(a.angle)
|
|
1773
|
+
}, {
|
|
1774
|
+
x: -Math.sin(b.angle),
|
|
1775
|
+
y: Math.cos(a.angle)
|
|
1776
|
+
}];
|
|
1777
|
+
function getProjectionRange(obb, axisX, axisY) {
|
|
1778
|
+
const projections = obb.getRotatedCorners().map(p => p.x * axisX + p.y * axisY);
|
|
1779
|
+
return {
|
|
1780
|
+
min: Math.min(...projections),
|
|
1781
|
+
max: Math.max(...projections)
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
let maxDistance = 0;
|
|
1785
|
+
for (const axis of axes) {
|
|
1786
|
+
const rangeA = getProjectionRange(a, axis.x, axis.y),
|
|
1787
|
+
rangeB = getProjectionRange(b, axis.x, axis.y);
|
|
1788
|
+
let distance;
|
|
1789
|
+
distance = rangeA.max < rangeB.min ? rangeB.min - rangeA.max : rangeB.max < rangeA.min ? rangeA.min - rangeB.max : 0, maxDistance = Math.max(maxDistance, distance);
|
|
1790
|
+
}
|
|
1791
|
+
return maxDistance;
|
|
1792
|
+
};
|
|
1762
1793
|
|
|
1763
1794
|
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1764
1795
|
const {
|
|
@@ -1918,6 +1949,25 @@
|
|
|
1918
1949
|
clone() {
|
|
1919
1950
|
return new OBBBounds(this);
|
|
1920
1951
|
}
|
|
1952
|
+
getRotatedCorners() {
|
|
1953
|
+
const originPoint = {
|
|
1954
|
+
x: (this.x1 + this.x2) / 2,
|
|
1955
|
+
y: (this.y1 + this.y2) / 2
|
|
1956
|
+
};
|
|
1957
|
+
return [rotatePoint({
|
|
1958
|
+
x: this.x1,
|
|
1959
|
+
y: this.y1
|
|
1960
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1961
|
+
x: this.x2,
|
|
1962
|
+
y: this.y1
|
|
1963
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1964
|
+
x: this.x1,
|
|
1965
|
+
y: this.y2
|
|
1966
|
+
}, this.angle, originPoint), rotatePoint({
|
|
1967
|
+
x: this.x2,
|
|
1968
|
+
y: this.y2
|
|
1969
|
+
}, this.angle, originPoint)];
|
|
1970
|
+
}
|
|
1921
1971
|
}
|
|
1922
1972
|
|
|
1923
1973
|
class Matrix {
|
|
@@ -8918,6 +8968,11 @@
|
|
|
8918
8968
|
return this.context.tryUpdateLength();
|
|
8919
8969
|
}
|
|
8920
8970
|
};
|
|
8971
|
+
class StepClosed extends Step$1 {
|
|
8972
|
+
lineEnd() {
|
|
8973
|
+
this.context.closePath();
|
|
8974
|
+
}
|
|
8975
|
+
}
|
|
8921
8976
|
function genStepSegments(points, t) {
|
|
8922
8977
|
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8923
8978
|
const {
|
|
@@ -8931,6 +8986,16 @@
|
|
|
8931
8986
|
function genStepTypeSegments(path, points) {
|
|
8932
8987
|
return genCurveSegments(path, points);
|
|
8933
8988
|
}
|
|
8989
|
+
function genStepClosedSegments(points, t) {
|
|
8990
|
+
let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8991
|
+
const {
|
|
8992
|
+
direction: direction,
|
|
8993
|
+
startPoint: startPoint
|
|
8994
|
+
} = params;
|
|
8995
|
+
if (points.length < 2 - Number(!!startPoint)) return null;
|
|
8996
|
+
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);
|
|
8997
|
+
return genStepTypeSegments(new StepClosed(segContext, t, startPoint), points), segContext;
|
|
8998
|
+
}
|
|
8934
8999
|
|
|
8935
9000
|
class LinearClosed extends Linear {
|
|
8936
9001
|
lineEnd() {
|
|
@@ -9160,6 +9225,8 @@
|
|
|
9160
9225
|
return genMonotoneYSegments(points, params);
|
|
9161
9226
|
case "step":
|
|
9162
9227
|
return genStepSegments(points, .5, params);
|
|
9228
|
+
case "stepClosed":
|
|
9229
|
+
return genStepClosedSegments(points, .5, params);
|
|
9163
9230
|
case "stepBefore":
|
|
9164
9231
|
return genStepSegments(points, 0, params);
|
|
9165
9232
|
case "stepAfter":
|
|
@@ -9594,7 +9661,8 @@
|
|
|
9594
9661
|
filter: "",
|
|
9595
9662
|
cursor: null,
|
|
9596
9663
|
html: null,
|
|
9597
|
-
react: null
|
|
9664
|
+
react: null,
|
|
9665
|
+
vue: null
|
|
9598
9666
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
9599
9667
|
const DefaultConnectAttribute = {
|
|
9600
9668
|
connectedType: "none",
|
|
@@ -9702,6 +9770,12 @@
|
|
|
9702
9770
|
cornerRadius: 0,
|
|
9703
9771
|
closePath: !0
|
|
9704
9772
|
});
|
|
9773
|
+
const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
9774
|
+
width: 100,
|
|
9775
|
+
height: 100,
|
|
9776
|
+
spikes: 5,
|
|
9777
|
+
thickness: .5
|
|
9778
|
+
});
|
|
9705
9779
|
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
9706
9780
|
width: 0,
|
|
9707
9781
|
height: 0,
|
|
@@ -10027,6 +10101,7 @@
|
|
|
10027
10101
|
function createColor(context, c, params) {
|
|
10028
10102
|
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
10029
10103
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
10104
|
+
var _a, _b, _c, _d;
|
|
10030
10105
|
if (!c || !0 === c) return "black";
|
|
10031
10106
|
let result, color;
|
|
10032
10107
|
if (isArray$1(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
@@ -10040,9 +10115,10 @@
|
|
|
10040
10115
|
if (params.attribute) {
|
|
10041
10116
|
const {
|
|
10042
10117
|
scaleX = 1,
|
|
10043
|
-
scaleY = 1
|
|
10118
|
+
scaleY = 1,
|
|
10119
|
+
angle = 0
|
|
10044
10120
|
} = params.attribute;
|
|
10045
|
-
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
|
|
10121
|
+
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);
|
|
10046
10122
|
}
|
|
10047
10123
|
"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));
|
|
10048
10124
|
}
|
|
@@ -10067,7 +10143,7 @@
|
|
|
10067
10143
|
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);
|
|
10068
10144
|
return color.stops.forEach(stop => {
|
|
10069
10145
|
canvasGradient.addColorStop(stop.offset, stop.color);
|
|
10070
|
-
}), canvasGradient.GetPattern(w + x, h + y, undefined);
|
|
10146
|
+
}), canvasGradient.GetPattern ? canvasGradient.GetPattern(w + x, h + y, undefined) : canvasGradient;
|
|
10071
10147
|
}
|
|
10072
10148
|
|
|
10073
10149
|
const DIRECTION_KEY = {
|
|
@@ -10142,6 +10218,7 @@
|
|
|
10142
10218
|
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
|
|
10143
10219
|
}
|
|
10144
10220
|
function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
|
|
10221
|
+
if (desc.length <= 1) return 0;
|
|
10145
10222
|
if (!width || width <= 0) return 0;
|
|
10146
10223
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
10147
10224
|
let index = guessIndex,
|
|
@@ -10175,6 +10252,13 @@
|
|
|
10175
10252
|
}
|
|
10176
10253
|
function measureTextCanvas(text, character) {
|
|
10177
10254
|
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
10255
|
+
var _a;
|
|
10256
|
+
if ("" === text) return {
|
|
10257
|
+
ascent: 0,
|
|
10258
|
+
height: 0,
|
|
10259
|
+
descent: 0,
|
|
10260
|
+
width: 0
|
|
10261
|
+
};
|
|
10178
10262
|
const measurement = application.graphicUtil.textMeasure.measureText(text, character),
|
|
10179
10263
|
result = {
|
|
10180
10264
|
ascent: 0,
|
|
@@ -10184,7 +10268,9 @@
|
|
|
10184
10268
|
},
|
|
10185
10269
|
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
10186
10270
|
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
10187
|
-
|
|
10271
|
+
"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);
|
|
10272
|
+
const space = null !== (_a = character.space) && void 0 !== _a ? _a : 0;
|
|
10273
|
+
return result.width += space, result;
|
|
10188
10274
|
}
|
|
10189
10275
|
|
|
10190
10276
|
var __decorate$1A = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -11322,6 +11408,7 @@
|
|
|
11322
11408
|
text: DefaultTextAttribute,
|
|
11323
11409
|
rect: DefaultRectAttribute,
|
|
11324
11410
|
polygon: DefaultPolygonAttribute,
|
|
11411
|
+
star: DefaultStarAttribute,
|
|
11325
11412
|
richtext: DefaultRichTextAttribute,
|
|
11326
11413
|
richtextIcon: DefaultRichTextIconAttribute,
|
|
11327
11414
|
image: DefaultImageAttribute,
|
|
@@ -11340,6 +11427,7 @@
|
|
|
11340
11427
|
text: Object.assign({}, defaultThemeObj.text),
|
|
11341
11428
|
rect: Object.assign({}, defaultThemeObj.rect),
|
|
11342
11429
|
polygon: Object.assign({}, defaultThemeObj.polygon),
|
|
11430
|
+
star: Object.assign({}, defaultThemeObj.star),
|
|
11343
11431
|
richtext: Object.assign({}, defaultThemeObj.richtext),
|
|
11344
11432
|
richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
|
|
11345
11433
|
image: Object.assign({}, defaultThemeObj.image),
|
|
@@ -11819,7 +11907,7 @@
|
|
|
11819
11907
|
}
|
|
11820
11908
|
_composedDetailPath(params) {
|
|
11821
11909
|
if (params && params.graphic) {
|
|
11822
|
-
const g =
|
|
11910
|
+
const g = params.graphic;
|
|
11823
11911
|
if (g.stage) {
|
|
11824
11912
|
const path = g.stage.eventSystem.manager.propagationPath(g);
|
|
11825
11913
|
this.detailPath.push(path), this._composedDetailPath(params.params);
|
|
@@ -15195,7 +15283,7 @@
|
|
|
15195
15283
|
}
|
|
15196
15284
|
var rect = new RectSymbol();
|
|
15197
15285
|
|
|
15198
|
-
const tempBounds
|
|
15286
|
+
const tempBounds = new AABBBounds();
|
|
15199
15287
|
class CustomSymbolClass {
|
|
15200
15288
|
constructor(type, path) {
|
|
15201
15289
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -15224,7 +15312,7 @@
|
|
|
15224
15312
|
let {
|
|
15225
15313
|
path: path
|
|
15226
15314
|
} = _ref;
|
|
15227
|
-
tempBounds
|
|
15315
|
+
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);
|
|
15228
15316
|
});
|
|
15229
15317
|
}
|
|
15230
15318
|
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);
|
|
@@ -15538,6 +15626,7 @@
|
|
|
15538
15626
|
const RECT_NUMBER_TYPE = genNumberType();
|
|
15539
15627
|
const RECT3D_NUMBER_TYPE = genNumberType();
|
|
15540
15628
|
const RICHTEXT_NUMBER_TYPE = genNumberType();
|
|
15629
|
+
genNumberType();
|
|
15541
15630
|
const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
15542
15631
|
const TEXT_NUMBER_TYPE = genNumberType();
|
|
15543
15632
|
const GraphicService = Symbol.for("GraphicService");
|
|
@@ -15556,8 +15645,8 @@
|
|
|
15556
15645
|
const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);
|
|
15557
15646
|
|
|
15558
15647
|
const _tempBounds = new AABBBounds(),
|
|
15559
|
-
tempMatrix = new Matrix()
|
|
15560
|
-
|
|
15648
|
+
tempMatrix = new Matrix();
|
|
15649
|
+
new AABBBounds();
|
|
15561
15650
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
15562
15651
|
const tempConstantXYKey = ["x", "y"],
|
|
15563
15652
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -15792,6 +15881,9 @@
|
|
|
15792
15881
|
y: y
|
|
15793
15882
|
});
|
|
15794
15883
|
}
|
|
15884
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
15885
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
15886
|
+
}
|
|
15795
15887
|
setAttributes(params) {
|
|
15796
15888
|
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
15797
15889
|
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -16073,24 +16165,12 @@
|
|
|
16073
16165
|
needUpdateLayout() {
|
|
16074
16166
|
return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
|
|
16075
16167
|
}
|
|
16076
|
-
getAnchor(anchor, params) {
|
|
16168
|
+
getAnchor(anchor, params, resetScale) {
|
|
16077
16169
|
const _anchor = [0, 0],
|
|
16078
16170
|
getBounds = () => {
|
|
16079
16171
|
if (params.b) return params.b;
|
|
16080
|
-
const
|
|
16081
|
-
|
|
16082
|
-
scaleY: scaleY,
|
|
16083
|
-
angle: angle
|
|
16084
|
-
} = this.attribute;
|
|
16085
|
-
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
16086
|
-
scaleX: 1,
|
|
16087
|
-
scaleY: 1,
|
|
16088
|
-
angle: 0
|
|
16089
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
16090
|
-
scaleX: scaleX,
|
|
16091
|
-
scaleY: scaleY,
|
|
16092
|
-
angle: angle
|
|
16093
|
-
}), params.b;
|
|
16172
|
+
const graphic = this.clone();
|
|
16173
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1, graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
16094
16174
|
};
|
|
16095
16175
|
if ("string" == typeof anchor[0]) {
|
|
16096
16176
|
const ratio = parseFloat(anchor[0]) / 100,
|
|
@@ -16117,9 +16197,9 @@
|
|
|
16117
16197
|
} = this.attribute;
|
|
16118
16198
|
let _anchor = [0, 0];
|
|
16119
16199
|
const params = {};
|
|
16120
|
-
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 {
|
|
16200
|
+
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 {
|
|
16121
16201
|
const m = this._transMatrix;
|
|
16122
|
-
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, {
|
|
16202
|
+
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, {
|
|
16123
16203
|
x: _anchor[0],
|
|
16124
16204
|
y: _anchor[1]
|
|
16125
16205
|
});
|
|
@@ -17446,7 +17526,7 @@
|
|
|
17446
17526
|
tb1: tb1,
|
|
17447
17527
|
tb2: tb2
|
|
17448
17528
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
17449
|
-
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;
|
|
17529
|
+
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;
|
|
17450
17530
|
}
|
|
17451
17531
|
updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
|
|
17452
17532
|
const {
|
|
@@ -17696,7 +17776,7 @@
|
|
|
17696
17776
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
17697
17777
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
17698
17778
|
}
|
|
17699
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
17779
|
+
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;
|
|
17700
17780
|
}
|
|
17701
17781
|
updateSingallineAABBBounds(text) {
|
|
17702
17782
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -18077,7 +18157,7 @@
|
|
|
18077
18157
|
tb1: tb1,
|
|
18078
18158
|
tb2: tb2
|
|
18079
18159
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18080
|
-
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
18160
|
+
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;
|
|
18081
18161
|
const {
|
|
18082
18162
|
lineJoin = symbolTheme.lineJoin
|
|
18083
18163
|
} = attribute;
|
|
@@ -18149,7 +18229,7 @@
|
|
|
18149
18229
|
return getTheme$1(this).line;
|
|
18150
18230
|
}
|
|
18151
18231
|
updateAABBBounds(attribute, lineTheme, aabbBounds) {
|
|
18152
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18232
|
+
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;
|
|
18153
18233
|
const {
|
|
18154
18234
|
lineJoin = lineTheme.lineJoin
|
|
18155
18235
|
} = attribute;
|
|
@@ -18246,7 +18326,7 @@
|
|
|
18246
18326
|
tb1: tb1,
|
|
18247
18327
|
tb2: tb2
|
|
18248
18328
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18249
|
-
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;
|
|
18329
|
+
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;
|
|
18250
18330
|
}
|
|
18251
18331
|
needUpdateTags(keys) {
|
|
18252
18332
|
return super.needUpdateTags(keys, RECT_UPDATE_TAG_KEY);
|
|
@@ -18617,6 +18697,7 @@
|
|
|
18617
18697
|
}
|
|
18618
18698
|
class Paragraph {
|
|
18619
18699
|
constructor(text, newLine, character, ascentDescentMode) {
|
|
18700
|
+
var _a, _b;
|
|
18620
18701
|
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
18621
18702
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
18622
18703
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
@@ -18629,7 +18710,7 @@
|
|
|
18629
18710
|
let halfDetaHeight = 0,
|
|
18630
18711
|
deltaAscent = 0,
|
|
18631
18712
|
deltaDescent = 0;
|
|
18632
|
-
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 = "...";
|
|
18713
|
+
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 = "...";
|
|
18633
18714
|
}
|
|
18634
18715
|
updateWidth() {
|
|
18635
18716
|
const {
|
|
@@ -18648,11 +18729,11 @@
|
|
|
18648
18729
|
if ("hide" === this.ellipsis) return;
|
|
18649
18730
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
18650
18731
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
18651
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
18732
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
18652
18733
|
const {
|
|
18653
18734
|
width: width
|
|
18654
18735
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
18655
|
-
|
|
18736
|
+
left -= this.ellipsisWidth - width;
|
|
18656
18737
|
}
|
|
18657
18738
|
}
|
|
18658
18739
|
}
|
|
@@ -18663,20 +18744,21 @@
|
|
|
18663
18744
|
});
|
|
18664
18745
|
}
|
|
18665
18746
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
18747
|
+
var _a;
|
|
18666
18748
|
let baseline = top + ascent,
|
|
18667
18749
|
text = this.text,
|
|
18668
|
-
left = this.left + deltaLeft;
|
|
18750
|
+
left = this.left + deltaLeft + (null !== (_a = this.space) && void 0 !== _a ? _a : 0) / 2;
|
|
18669
18751
|
baseline += this.top;
|
|
18670
18752
|
let direction = this.direction;
|
|
18671
18753
|
if (this.verticalEllipsis) text = this.ellipsisStr, direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
18672
18754
|
if ("hide" === this.ellipsis) return;
|
|
18673
18755
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
18674
18756
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
18675
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
18757
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
18676
18758
|
const {
|
|
18677
18759
|
width: width
|
|
18678
18760
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
18679
|
-
|
|
18761
|
+
left -= this.ellipsisWidth - width;
|
|
18680
18762
|
}
|
|
18681
18763
|
}
|
|
18682
18764
|
}
|
|
@@ -18691,7 +18773,7 @@
|
|
|
18691
18773
|
const {
|
|
18692
18774
|
lineWidth = 1
|
|
18693
18775
|
} = this.character;
|
|
18694
|
-
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) {
|
|
18776
|
+
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) {
|
|
18695
18777
|
if (this.character.underline) {
|
|
18696
18778
|
const top = 1 + baseline,
|
|
18697
18779
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
@@ -18820,7 +18902,7 @@
|
|
|
18820
18902
|
tb1: tb1,
|
|
18821
18903
|
tb2: tb2
|
|
18822
18904
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
18823
|
-
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;
|
|
18905
|
+
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;
|
|
18824
18906
|
}
|
|
18825
18907
|
getDefaultAttribute(name) {
|
|
18826
18908
|
return DefaultImageAttribute[name];
|
|
@@ -19163,7 +19245,7 @@
|
|
|
19163
19245
|
maxWidth = richtextTheme.maxWidth,
|
|
19164
19246
|
maxHeight = richtextTheme.maxHeight,
|
|
19165
19247
|
textAlign = richtextTheme.textAlign,
|
|
19166
|
-
|
|
19248
|
+
textBaseline = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : "top",
|
|
19167
19249
|
editOptions: editOptions
|
|
19168
19250
|
} = attribute;
|
|
19169
19251
|
if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height);else {
|
|
@@ -19178,7 +19260,7 @@
|
|
|
19178
19260
|
}
|
|
19179
19261
|
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);
|
|
19180
19262
|
let deltaY = 0;
|
|
19181
|
-
switch (
|
|
19263
|
+
switch (textBaseline) {
|
|
19182
19264
|
case "top":
|
|
19183
19265
|
deltaY = 0;
|
|
19184
19266
|
break;
|
|
@@ -19199,7 +19281,7 @@
|
|
|
19199
19281
|
case "right":
|
|
19200
19282
|
deltaX = -aabbBounds.width();
|
|
19201
19283
|
}
|
|
19202
|
-
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;
|
|
19284
|
+
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;
|
|
19203
19285
|
}
|
|
19204
19286
|
needUpdateTags(keys) {
|
|
19205
19287
|
return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
|
|
@@ -19417,7 +19499,7 @@
|
|
|
19417
19499
|
tb1: tb1,
|
|
19418
19500
|
tb2: tb2
|
|
19419
19501
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19420
|
-
updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
19502
|
+
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;
|
|
19421
19503
|
const {
|
|
19422
19504
|
lineJoin = pathTheme.lineJoin
|
|
19423
19505
|
} = attribute;
|
|
@@ -19474,7 +19556,7 @@
|
|
|
19474
19556
|
return getTheme$1(this).area;
|
|
19475
19557
|
}
|
|
19476
19558
|
updateAABBBounds(attribute, areaTheme, aabbBounds) {
|
|
19477
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19559
|
+
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
19478
19560
|
const {
|
|
19479
19561
|
lineJoin = areaTheme.lineJoin
|
|
19480
19562
|
} = attribute;
|
|
@@ -19679,7 +19761,7 @@
|
|
|
19679
19761
|
tb1: tb1,
|
|
19680
19762
|
tb2: tb2
|
|
19681
19763
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19682
|
-
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
19764
|
+
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
19683
19765
|
const {
|
|
19684
19766
|
lineJoin = arcTheme.lineJoin
|
|
19685
19767
|
} = attribute;
|
|
@@ -19807,7 +19889,7 @@
|
|
|
19807
19889
|
return getTheme$1(this).polygon;
|
|
19808
19890
|
}
|
|
19809
19891
|
updateAABBBounds(attribute, polygonTheme, aabbBounds) {
|
|
19810
|
-
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
19892
|
+
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
19811
19893
|
const {
|
|
19812
19894
|
lineJoin = polygonTheme.lineJoin
|
|
19813
19895
|
} = attribute;
|
|
@@ -26872,6 +26954,7 @@
|
|
|
26872
26954
|
return this.nativeContext.createRadialGradient(x0, y0, r0, x1, y1, r1);
|
|
26873
26955
|
}
|
|
26874
26956
|
createConicGradient(x, y, startAngle, endAngle) {
|
|
26957
|
+
if (this.nativeContext.createConicGradient && Math.abs(endAngle - startAngle - 2 * Math.PI) < .001) return this.nativeContext.createConicGradient(startAngle, x, y);
|
|
26875
26958
|
let pattern,
|
|
26876
26959
|
edit = !1;
|
|
26877
26960
|
const ctx = this;
|
|
@@ -31431,6 +31514,10 @@
|
|
|
31431
31514
|
const SCROLLBAR_EVENT$1 = "scrollDrag";
|
|
31432
31515
|
const SCROLLBAR_END_EVENT$1 = "scrollUp";
|
|
31433
31516
|
|
|
31517
|
+
function getEndTriggersOfDrag() {
|
|
31518
|
+
return "browser" === vglobal.env ? ["pointerup", "pointerleave", "pointercancel"] : ["pointerup", "pointerleave", "pointerupoutside"];
|
|
31519
|
+
}
|
|
31520
|
+
|
|
31434
31521
|
const delayMap$3 = {
|
|
31435
31522
|
debounce: debounce,
|
|
31436
31523
|
throttle: throttle
|
|
@@ -31438,7 +31525,9 @@
|
|
|
31438
31525
|
loadScrollbarComponent();
|
|
31439
31526
|
let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
31440
31527
|
constructor(attributes, options) {
|
|
31441
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this.
|
|
31528
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, ScrollBar.defaultAttributes, attributes)), this.name = "scrollbar", this._handleTouchMove = e => {
|
|
31529
|
+
isValid$1(this._prePos) && e.preventDefault();
|
|
31530
|
+
}, this._onRailPointerDown = e => {
|
|
31442
31531
|
const {
|
|
31443
31532
|
viewX: viewX,
|
|
31444
31533
|
viewY: viewY
|
|
@@ -31463,6 +31552,7 @@
|
|
|
31463
31552
|
}
|
|
31464
31553
|
this.setScrollRange([currentScrollValue - (range[1] - range[0]) / 2, currentScrollValue + (range[1] - range[0]) / 2], !1), this.stage && !this.stage.autoRender && this.stage.renderNextFrame();
|
|
31465
31554
|
}, this._onSliderPointerDown = e => {
|
|
31555
|
+
this._clearDragEvents();
|
|
31466
31556
|
const {
|
|
31467
31557
|
stopSliderDownPropagation = !0
|
|
31468
31558
|
} = this.attribute;
|
|
@@ -31477,11 +31567,14 @@
|
|
|
31477
31567
|
this._prePos = "horizontal" === direction ? x : y, this._dispatchEvent(SCROLLBAR_START_EVENT, {
|
|
31478
31568
|
pos: this._prePos,
|
|
31479
31569
|
event: e
|
|
31480
|
-
})
|
|
31481
|
-
|
|
31482
|
-
|
|
31570
|
+
});
|
|
31571
|
+
const triggers = getEndTriggersOfDrag(),
|
|
31572
|
+
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31573
|
+
obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31483
31574
|
capture: !0
|
|
31484
|
-
}),
|
|
31575
|
+
}), triggers.forEach(trigger => {
|
|
31576
|
+
obj.addEventListener(trigger, this._onSliderPointerUp);
|
|
31577
|
+
});
|
|
31485
31578
|
}, this._computeScrollValue = e => {
|
|
31486
31579
|
const {
|
|
31487
31580
|
direction: direction
|
|
@@ -31507,7 +31600,6 @@
|
|
|
31507
31600
|
[currentPos, currentScrollValue] = this._computeScrollValue(e);
|
|
31508
31601
|
this.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], !0), this._prePos = currentPos;
|
|
31509
31602
|
}, this._onSliderPointerMoveWithDelay = 0 === this.attribute.delayTime ? this._onSliderPointerMove : delayMap$3[this.attribute.delayType](this._onSliderPointerMove, this.attribute.delayTime), this._onSliderPointerUp = e => {
|
|
31510
|
-
e.preventDefault();
|
|
31511
31603
|
const {
|
|
31512
31604
|
range: preRange,
|
|
31513
31605
|
limitRange = [0, 1]
|
|
@@ -31515,14 +31607,10 @@
|
|
|
31515
31607
|
preScrollRange = this.getScrollRange(),
|
|
31516
31608
|
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
31517
31609
|
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
31518
|
-
this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31610
|
+
this._prePos = null, this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31519
31611
|
pre: preRange,
|
|
31520
31612
|
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
31521
|
-
}),
|
|
31522
|
-
capture: !0
|
|
31523
|
-
}), vglobal.removeEventListener("pointerup", this._onSliderPointerUp)) : (this.stage.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31524
|
-
capture: !0
|
|
31525
|
-
}), this.stage.removeEventListener("pointerup", this._onSliderPointerUp), this.stage.removeEventListener("pointerupoutside", this._onSliderPointerUp));
|
|
31613
|
+
}), this._clearDragEvents();
|
|
31526
31614
|
};
|
|
31527
31615
|
}
|
|
31528
31616
|
setScrollRange(range) {
|
|
@@ -31561,7 +31649,9 @@
|
|
|
31561
31649
|
delayType = "throttle",
|
|
31562
31650
|
delayTime = 0
|
|
31563
31651
|
} = this.attribute;
|
|
31564
|
-
this._rail && this._rail.addEventListener("pointerdown", delayMap$3[delayType](this._onRailPointerDown, delayTime)), this._slider && this._slider.addEventListener("pointerdown", this._onSliderPointerDown)
|
|
31652
|
+
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, {
|
|
31653
|
+
passive: !1
|
|
31654
|
+
});
|
|
31565
31655
|
}
|
|
31566
31656
|
render() {
|
|
31567
31657
|
this._reset();
|
|
@@ -31671,9 +31761,23 @@
|
|
|
31671
31761
|
sliderSize = this._sliderSize;
|
|
31672
31762
|
return "horizontal" === direction ? clampRange$1([x1 + min * width, x1 + max * width], x1, width - sliderSize) : clampRange$1([y1 + min * height, y1 + max * height], y1, height - sliderSize);
|
|
31673
31763
|
}
|
|
31764
|
+
_clearDragEvents() {
|
|
31765
|
+
const triggers = getEndTriggersOfDrag(),
|
|
31766
|
+
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31767
|
+
obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31768
|
+
capture: !0
|
|
31769
|
+
}), triggers.forEach(trigger => {
|
|
31770
|
+
obj.removeEventListener(trigger, this._onSliderPointerUp);
|
|
31771
|
+
});
|
|
31772
|
+
}
|
|
31674
31773
|
_reset() {
|
|
31675
31774
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
31676
31775
|
}
|
|
31776
|
+
release(all) {
|
|
31777
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
31778
|
+
passive: !1
|
|
31779
|
+
}), this._clearDragEvents();
|
|
31780
|
+
}
|
|
31677
31781
|
};
|
|
31678
31782
|
ScrollBar$1.defaultAttributes = {
|
|
31679
31783
|
direction: "horizontal",
|
|
@@ -32392,6 +32496,7 @@
|
|
|
32392
32496
|
contentStyle = {},
|
|
32393
32497
|
panel: panel,
|
|
32394
32498
|
logoSymbol: logoSymbol,
|
|
32499
|
+
poptipAnchor = "position",
|
|
32395
32500
|
logoText: logoText,
|
|
32396
32501
|
logoTextStyle = {},
|
|
32397
32502
|
triangleMode = "default",
|
|
@@ -32403,7 +32508,8 @@
|
|
|
32403
32508
|
visible: visible,
|
|
32404
32509
|
state: state,
|
|
32405
32510
|
dx = 0,
|
|
32406
|
-
dy = 0
|
|
32511
|
+
dy = 0,
|
|
32512
|
+
positionBounds: positionBounds
|
|
32407
32513
|
} = this.attribute;
|
|
32408
32514
|
let {
|
|
32409
32515
|
title = "",
|
|
@@ -32489,21 +32595,28 @@
|
|
|
32489
32595
|
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();
|
|
32490
32596
|
}
|
|
32491
32597
|
}
|
|
32492
|
-
const layout = "auto" === position
|
|
32598
|
+
const layout = "auto" === position || isArray$1(position),
|
|
32599
|
+
positionList = isArray$1(position) ? position : this.positionList;
|
|
32493
32600
|
let maxBBoxI,
|
|
32494
32601
|
maxBBoxSize = -1 / 0;
|
|
32495
|
-
for (let i = 0; i <
|
|
32496
|
-
const p = layout ?
|
|
32602
|
+
for (let i = 0; i < positionList.length + 1; i++) {
|
|
32603
|
+
const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
|
|
32497
32604
|
let symbolType = "arrow2Left",
|
|
32498
32605
|
offsetX = (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
32499
32606
|
offsetY = 0;
|
|
32500
|
-
"top" === p || "bottom" === p || "left" === p || "right" === p ? symbolType = "arrow2Left" : "concise" === triangleMode && (symbolType = conciseSymbolMap[p], offsetX = ["tl", "bl", "rt", "rb"].includes(
|
|
32607
|
+
"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);
|
|
32501
32608
|
const {
|
|
32502
32609
|
angle: angle,
|
|
32503
32610
|
offset: offset
|
|
32504
32611
|
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$1(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
|
|
32505
|
-
|
|
32506
|
-
|
|
32612
|
+
let bgSymbol,
|
|
32613
|
+
anchorPoint = {
|
|
32614
|
+
x: 0,
|
|
32615
|
+
y: 0
|
|
32616
|
+
};
|
|
32617
|
+
if ("bounds" === poptipAnchor && positionBounds && (anchorPoint = this.calculateAnchorPoint(p, positionBounds)), isBoolean$1(bgVisible)) {
|
|
32618
|
+
let bgRect;
|
|
32619
|
+
bgSymbol = group.createOrUpdateChild("poptip-symbol-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32507
32620
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32508
32621
|
x: offsetX,
|
|
32509
32622
|
y: offsetY,
|
|
@@ -32516,9 +32629,7 @@
|
|
|
32516
32629
|
dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
|
|
32517
32630
|
size: symbolSize,
|
|
32518
32631
|
zIndex: 9
|
|
32519
|
-
}), "symbol")
|
|
32520
|
-
let bgRect;
|
|
32521
|
-
isEmpty(null == state ? void 0 : state.panel) || (bgSymbol.states = state.panel), bgRect = panel.panelSymbolType ? group.createOrUpdateChild("poptip-rect-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
32632
|
+
}), "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), {
|
|
32522
32633
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32523
32634
|
x: 0,
|
|
32524
32635
|
y: 0,
|
|
@@ -32535,8 +32646,8 @@
|
|
|
32535
32646
|
}), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
32536
32647
|
}
|
|
32537
32648
|
if (group.setAttributes({
|
|
32538
|
-
x: -offset[0] + dx,
|
|
32539
|
-
y: -offset[1] + dy,
|
|
32649
|
+
x: -offset[0] + dx + anchorPoint.x,
|
|
32650
|
+
y: -offset[1] + dy + anchorPoint.y,
|
|
32540
32651
|
anchor: [offsetX, offsetY]
|
|
32541
32652
|
}), logoSymbol) {
|
|
32542
32653
|
const {
|
|
@@ -32564,20 +32675,87 @@
|
|
|
32564
32675
|
zIndex: 10
|
|
32565
32676
|
}), "text");
|
|
32566
32677
|
}
|
|
32567
|
-
if (!
|
|
32678
|
+
if (!range) break;
|
|
32568
32679
|
{
|
|
32569
32680
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
32570
32681
|
const b = _tBounds,
|
|
32571
32682
|
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
32572
|
-
if (
|
|
32573
|
-
|
|
32574
|
-
|
|
32575
|
-
|
|
32576
|
-
|
|
32683
|
+
if (layout) {
|
|
32684
|
+
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
32685
|
+
{
|
|
32686
|
+
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
32687
|
+
size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
|
|
32688
|
+
size > maxBBoxSize && (maxBBoxSize = size, maxBBoxI = i);
|
|
32689
|
+
}
|
|
32577
32690
|
}
|
|
32691
|
+
if (["top", "bottom", "left", "right"].includes(p)) {
|
|
32692
|
+
const isVerticalPosition = "top" === p || "bottom" === p,
|
|
32693
|
+
isHorizontalPosition = "left" === p || "right" === p;
|
|
32694
|
+
let mainDirectionOverlap = !1;
|
|
32695
|
+
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) {
|
|
32696
|
+
let secondaryOffset = 0;
|
|
32697
|
+
const szNumber = (isArray$1(symbolSize) ? symbolSize[1] : symbolSize) / 2;
|
|
32698
|
+
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)));
|
|
32699
|
+
break;
|
|
32700
|
+
}
|
|
32701
|
+
}
|
|
32702
|
+
if (!layout) break;
|
|
32578
32703
|
}
|
|
32579
32704
|
}
|
|
32580
32705
|
}
|
|
32706
|
+
calculateAnchorPoint(position, positionBounds) {
|
|
32707
|
+
if (!positionBounds) return {
|
|
32708
|
+
x: 0,
|
|
32709
|
+
y: 0
|
|
32710
|
+
};
|
|
32711
|
+
const {
|
|
32712
|
+
x: x,
|
|
32713
|
+
y: y
|
|
32714
|
+
} = this.attribute,
|
|
32715
|
+
{
|
|
32716
|
+
x1: x1,
|
|
32717
|
+
y1: y1,
|
|
32718
|
+
x2: x2,
|
|
32719
|
+
y2: y2
|
|
32720
|
+
} = positionBounds,
|
|
32721
|
+
width = x2 - x1,
|
|
32722
|
+
height = y2 - y1;
|
|
32723
|
+
switch (position) {
|
|
32724
|
+
case "top":
|
|
32725
|
+
case "tl":
|
|
32726
|
+
case "tr":
|
|
32727
|
+
return {
|
|
32728
|
+
x: x1 + width / 2 - x,
|
|
32729
|
+
y: y1 - y
|
|
32730
|
+
};
|
|
32731
|
+
case "bottom":
|
|
32732
|
+
case "bl":
|
|
32733
|
+
case "br":
|
|
32734
|
+
return {
|
|
32735
|
+
x: x1 + width / 2 - x,
|
|
32736
|
+
y: y2 - y
|
|
32737
|
+
};
|
|
32738
|
+
case "left":
|
|
32739
|
+
case "lt":
|
|
32740
|
+
case "lb":
|
|
32741
|
+
return {
|
|
32742
|
+
x: x1 - x,
|
|
32743
|
+
y: y1 + height / 2 - y
|
|
32744
|
+
};
|
|
32745
|
+
case "right":
|
|
32746
|
+
case "rt":
|
|
32747
|
+
case "rb":
|
|
32748
|
+
return {
|
|
32749
|
+
x: x2 - x,
|
|
32750
|
+
y: y1 + height / 2 - y
|
|
32751
|
+
};
|
|
32752
|
+
default:
|
|
32753
|
+
return {
|
|
32754
|
+
x: 0,
|
|
32755
|
+
y: 0
|
|
32756
|
+
};
|
|
32757
|
+
}
|
|
32758
|
+
}
|
|
32581
32759
|
getAngleAndOffset(position, width, height, size, symbolType) {
|
|
32582
32760
|
const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
|
|
32583
32761
|
switch (position) {
|
|
@@ -32739,10 +32917,12 @@
|
|
|
32739
32917
|
this.poptipComponent.setAttributes(Object.assign(Object.assign({
|
|
32740
32918
|
visibleAll: !0,
|
|
32741
32919
|
pickable: !1,
|
|
32742
|
-
childrenPickable: !1
|
|
32920
|
+
childrenPickable: !1,
|
|
32921
|
+
poptipAnchor: "bounds"
|
|
32743
32922
|
}, poptip), {
|
|
32744
32923
|
x: matrix.e,
|
|
32745
|
-
y: matrix.f
|
|
32924
|
+
y: matrix.f,
|
|
32925
|
+
positionBounds: graphic.globalAABBBounds
|
|
32746
32926
|
})), drawContext.stage.tryInitInteractiveLayer();
|
|
32747
32927
|
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
32748
32928
|
interactiveLayer && interactiveLayer.add(this.poptipComponent);
|
|
@@ -33496,10 +33676,11 @@
|
|
|
33496
33676
|
}
|
|
33497
33677
|
function textIntersect(textA, textB, sep) {
|
|
33498
33678
|
var _a;
|
|
33499
|
-
|
|
33500
|
-
|
|
33501
|
-
|
|
33502
|
-
|
|
33679
|
+
const angle = null === (_a = textA.attribute) || void 0 === _a ? void 0 : _a.angle;
|
|
33680
|
+
if (isAngleHorizontal(angle, Number.EPSILON)) return sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds);
|
|
33681
|
+
const a = textA.OBBBounds,
|
|
33682
|
+
b = textB.OBBBounds;
|
|
33683
|
+
return !a || !b || a.empty() || b.empty() ? sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds) : a.intersects(b) || sep > obbSeparation(a, b);
|
|
33503
33684
|
}
|
|
33504
33685
|
function hasOverlap$1(items, pad) {
|
|
33505
33686
|
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;
|
|
@@ -35728,7 +35909,9 @@
|
|
|
35728
35909
|
super(...arguments), this.type = ScaleEnum.Linear;
|
|
35729
35910
|
}
|
|
35730
35911
|
clone() {
|
|
35731
|
-
|
|
35912
|
+
var _a;
|
|
35913
|
+
const scale = new LinearScale();
|
|
35914
|
+
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;
|
|
35732
35915
|
}
|
|
35733
35916
|
tickFormat() {
|
|
35734
35917
|
return () => {};
|
|
@@ -39019,14 +39202,20 @@
|
|
|
39019
39202
|
}, this.state = {
|
|
39020
39203
|
start: 0,
|
|
39021
39204
|
end: 1
|
|
39022
|
-
}, this._statePointToData = state => state, this.
|
|
39023
|
-
|
|
39205
|
+
}, this._statePointToData = state => state, this._handleTouchMove = e => {
|
|
39206
|
+
this._activeState && e.preventDefault();
|
|
39207
|
+
}, this._onHandlerPointerDown = (e, tag) => {
|
|
39208
|
+
this._clearDragEvents(), "start" === tag ? (this._activeTag = DataZoomActiveTag.startHandler, this._activeItem = this._startHandlerMask) : "end" === tag ? (this._activeTag = DataZoomActiveTag.endHandler, this._activeItem = this._endHandlerMask) : "middleRect" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerRect) : "middleSymbol" === tag ? (this._activeTag = DataZoomActiveTag.middleHandler, this._activeItem = this._middleHandlerSymbol) : "background" === tag && (this._activeTag = DataZoomActiveTag.background, this._activeItem = this._background), this._activeState = !0, this._activeCache.startPos = this.eventPosToStagePos(e), this._activeCache.lastPos = this.eventPosToStagePos(e);
|
|
39209
|
+
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39210
|
+
triggers = getEndTriggersOfDrag();
|
|
39211
|
+
evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39024
39212
|
capture: !0
|
|
39025
|
-
}),
|
|
39213
|
+
}), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39026
39214
|
capture: !0
|
|
39215
|
+
}), triggers.forEach(trigger => {
|
|
39216
|
+
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
|
|
39027
39217
|
});
|
|
39028
39218
|
}, this._pointerMove = e => {
|
|
39029
|
-
e.stopPropagation();
|
|
39030
39219
|
const {
|
|
39031
39220
|
start: startAttr,
|
|
39032
39221
|
end: endAttr,
|
|
@@ -39049,7 +39238,6 @@
|
|
|
39049
39238
|
tag: this._activeTag
|
|
39050
39239
|
}));
|
|
39051
39240
|
}, this._onHandlerPointerMove = 0 === this.attribute.delayTime ? this._pointerMove : delayMap$2[this.attribute.delayType](this._pointerMove, this.attribute.delayTime), this._onHandlerPointerUp = e => {
|
|
39052
|
-
e.preventDefault();
|
|
39053
39241
|
const {
|
|
39054
39242
|
start: start,
|
|
39055
39243
|
end: end,
|
|
@@ -39064,11 +39252,7 @@
|
|
|
39064
39252
|
start: this.state.start,
|
|
39065
39253
|
end: this.state.end,
|
|
39066
39254
|
tag: this._activeTag
|
|
39067
|
-
}),
|
|
39068
|
-
capture: !0
|
|
39069
|
-
}), vglobal.removeEventListener("pointerup", this._onHandlerPointerUp)), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39070
|
-
capture: !0
|
|
39071
|
-
}), this.removeEventListener("pointerup", this._onHandlerPointerUp);
|
|
39255
|
+
}), this._clearDragEvents();
|
|
39072
39256
|
};
|
|
39073
39257
|
const {
|
|
39074
39258
|
position: position,
|
|
@@ -39087,7 +39271,9 @@
|
|
|
39087
39271
|
} = this.attribute;
|
|
39088
39272
|
this._startHandlerMask && this._startHandlerMask.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "start")), this._endHandlerMask && this._endHandlerMask.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "end")), this._middleHandlerSymbol && this._middleHandlerSymbol.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleSymbol")), this._middleHandlerRect && this._middleHandlerRect.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "middleRect"));
|
|
39089
39273
|
const selectedTag = brushSelect ? "background" : "middleRect";
|
|
39090
|
-
this._selectedBackground && this._selectedBackground.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && this._background && this._background.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), brushSelect && this._previewGroup && this._previewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), this._selectedPreviewGroup && this._selectedPreviewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), this.addEventListener("
|
|
39274
|
+
this._selectedBackground && this._selectedBackground.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), brushSelect && this._background && this._background.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), brushSelect && this._previewGroup && this._previewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, "background")), this._selectedPreviewGroup && this._selectedPreviewGroup.addEventListener("pointerdown", e => this._onHandlerPointerDown(e, selectedTag)), "auto" === showDetail && (this.addEventListener("pointerenter", this._onHandlerPointerEnter), this.addEventListener("pointerleave", this._onHandlerPointerLeave)), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
39275
|
+
passive: !1
|
|
39276
|
+
});
|
|
39091
39277
|
}
|
|
39092
39278
|
dragMaskSize() {
|
|
39093
39279
|
const {
|
|
@@ -39118,11 +39304,22 @@
|
|
|
39118
39304
|
y: 0
|
|
39119
39305
|
};
|
|
39120
39306
|
}
|
|
39307
|
+
_clearDragEvents() {
|
|
39308
|
+
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39309
|
+
triggers = getEndTriggersOfDrag();
|
|
39310
|
+
evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39311
|
+
capture: !0
|
|
39312
|
+
}), triggers.forEach(trigger => {
|
|
39313
|
+
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
39314
|
+
}), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39315
|
+
capture: !0
|
|
39316
|
+
});
|
|
39317
|
+
}
|
|
39121
39318
|
_onHandlerPointerEnter(e) {
|
|
39122
|
-
|
|
39319
|
+
this._showText = !0, this.renderText();
|
|
39123
39320
|
}
|
|
39124
39321
|
_onHandlerPointerLeave(e) {
|
|
39125
|
-
|
|
39322
|
+
this._showText = !1, this.renderText();
|
|
39126
39323
|
}
|
|
39127
39324
|
backgroundDragZoom(startPos, endPos) {
|
|
39128
39325
|
const {
|
|
@@ -39661,6 +39858,11 @@
|
|
|
39661
39858
|
setStatePointToData(callback) {
|
|
39662
39859
|
isFunction$1(callback) && (this._statePointToData = callback);
|
|
39663
39860
|
}
|
|
39861
|
+
release(all) {
|
|
39862
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
39863
|
+
passive: !1
|
|
39864
|
+
}), this._clearDragEvents();
|
|
39865
|
+
}
|
|
39664
39866
|
};
|
|
39665
39867
|
DataZoom$1.defaultAttributes = DEFAULT_DATA_ZOOM_ATTRIBUTES;
|
|
39666
39868
|
|
|
@@ -39830,17 +40032,26 @@
|
|
|
39830
40032
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
39831
40033
|
clipRange: 1
|
|
39832
40034
|
}, stepDuration, easing);
|
|
39833
|
-
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
|
|
40035
|
+
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing), array(label).forEach(labelNode => {
|
|
40036
|
+
const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
|
|
40037
|
+
graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
|
|
40038
|
+
});
|
|
39834
40039
|
}
|
|
39835
40040
|
|
|
39836
40041
|
function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
39837
|
-
segmentFadeIn(line, delay, duration, easing),
|
|
40042
|
+
segmentFadeIn(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40043
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40044
|
+
});
|
|
39838
40045
|
}
|
|
39839
40046
|
function areaFadeIn(area, label, duration, delay, easing) {
|
|
39840
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40047
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40048
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40049
|
+
});
|
|
39841
40050
|
}
|
|
39842
40051
|
function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
39843
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40052
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40053
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40054
|
+
});
|
|
39844
40055
|
}
|
|
39845
40056
|
function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39846
40057
|
var _a;
|
|
@@ -39848,13 +40059,19 @@
|
|
|
39848
40059
|
}
|
|
39849
40060
|
|
|
39850
40061
|
function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
39851
|
-
segmentFadeOut(line, delay, duration, easing),
|
|
40062
|
+
segmentFadeOut(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40063
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40064
|
+
});
|
|
39852
40065
|
}
|
|
39853
40066
|
function areaFadeOut(area, label, duration, delay, easing) {
|
|
39854
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40067
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40068
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40069
|
+
});
|
|
39855
40070
|
}
|
|
39856
40071
|
function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
39857
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40072
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40073
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40074
|
+
});
|
|
39858
40075
|
}
|
|
39859
40076
|
function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39860
40077
|
var _a;
|
|
@@ -40026,6 +40243,57 @@
|
|
|
40026
40243
|
delay: 0
|
|
40027
40244
|
};
|
|
40028
40245
|
|
|
40246
|
+
class MarkLabelMixin {
|
|
40247
|
+
getLabel() {
|
|
40248
|
+
return this._label;
|
|
40249
|
+
}
|
|
40250
|
+
_addMarkLabels(container, labelName, defaultLabelAttrs) {
|
|
40251
|
+
const {
|
|
40252
|
+
label: label,
|
|
40253
|
+
state: state
|
|
40254
|
+
} = this.attribute,
|
|
40255
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40256
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground),
|
|
40257
|
+
labelShapes = array(label).map((labelAttrs, index) => {
|
|
40258
|
+
var _a, _b;
|
|
40259
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labelAttrs),
|
|
40260
|
+
markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), {
|
|
40261
|
+
state: {
|
|
40262
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40263
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40264
|
+
}
|
|
40265
|
+
}));
|
|
40266
|
+
return markLabel.name = labelName, container.add(markLabel), this.setLabelPos(markLabel, finalLabelAttrs), markLabel;
|
|
40267
|
+
});
|
|
40268
|
+
this._label = 1 === array(labelShapes).length ? labelShapes[0] : labelShapes;
|
|
40269
|
+
}
|
|
40270
|
+
_updateMarkLabels(defaultLabelAttrs) {
|
|
40271
|
+
const {
|
|
40272
|
+
label: label,
|
|
40273
|
+
state: state
|
|
40274
|
+
} = this.attribute,
|
|
40275
|
+
labelShapes = array(this._label),
|
|
40276
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40277
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground);
|
|
40278
|
+
if (labelShapes.length) {
|
|
40279
|
+
const labels = array(label);
|
|
40280
|
+
labelShapes.forEach((labelItem, index) => {
|
|
40281
|
+
var _a, _b;
|
|
40282
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labels[index]);
|
|
40283
|
+
labelItem.setAttributes(Object.assign(Object.assign({
|
|
40284
|
+
dx: 0,
|
|
40285
|
+
dy: 0
|
|
40286
|
+
}, finalLabelAttrs), {
|
|
40287
|
+
state: {
|
|
40288
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40289
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40290
|
+
}
|
|
40291
|
+
})), this.setLabelPos(labelItem, finalLabelAttrs);
|
|
40292
|
+
});
|
|
40293
|
+
}
|
|
40294
|
+
}
|
|
40295
|
+
}
|
|
40296
|
+
|
|
40029
40297
|
class MarkCommonLine extends Marker {
|
|
40030
40298
|
constructor() {
|
|
40031
40299
|
super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = DefaultUpdateMarkLineAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
@@ -40033,24 +40301,20 @@
|
|
|
40033
40301
|
getLine() {
|
|
40034
40302
|
return this._line;
|
|
40035
40303
|
}
|
|
40036
|
-
|
|
40037
|
-
return this._label;
|
|
40038
|
-
}
|
|
40039
|
-
setLabelPos() {
|
|
40304
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40040
40305
|
const {
|
|
40041
|
-
label = {},
|
|
40042
40306
|
limitRect: limitRect
|
|
40043
40307
|
} = this.attribute,
|
|
40044
40308
|
{
|
|
40045
40309
|
position: position,
|
|
40046
40310
|
confine: confine,
|
|
40047
40311
|
autoRotate: autoRotate
|
|
40048
|
-
} =
|
|
40049
|
-
labelPoint = this.getPointAttrByPosition(position),
|
|
40312
|
+
} = labelAttrs,
|
|
40313
|
+
labelPoint = this.getPointAttrByPosition(position, labelAttrs),
|
|
40050
40314
|
labelAngle = position.toString().toLocaleLowerCase().includes("start") ? this._line.getStartAngle() || 0 : this._line.getEndAngle() || 0;
|
|
40051
|
-
if (
|
|
40052
|
-
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0,
|
|
40053
|
-
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)),
|
|
40315
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
|
|
40316
|
+
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0,
|
|
40317
|
+
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle)
|
|
40054
40318
|
})), limitRect && confine) {
|
|
40055
40319
|
const {
|
|
40056
40320
|
x: x,
|
|
@@ -40058,7 +40322,7 @@
|
|
|
40058
40322
|
width: width,
|
|
40059
40323
|
height: height
|
|
40060
40324
|
} = limitRect;
|
|
40061
|
-
limitShapeInBounds(
|
|
40325
|
+
limitShapeInBounds(labelNode, {
|
|
40062
40326
|
x1: x,
|
|
40063
40327
|
y1: y,
|
|
40064
40328
|
x2: x + width,
|
|
@@ -40067,36 +40331,14 @@
|
|
|
40067
40331
|
}
|
|
40068
40332
|
}
|
|
40069
40333
|
initMarker(container) {
|
|
40070
|
-
const
|
|
40071
|
-
|
|
40072
|
-
state: state
|
|
40073
|
-
} = this.attribute,
|
|
40074
|
-
line = this.createSegment();
|
|
40075
|
-
line.name = "mark-common-line-line", this._line = line, container.add(line);
|
|
40076
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40077
|
-
state: {
|
|
40078
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40079
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40080
|
-
}
|
|
40081
|
-
}));
|
|
40082
|
-
markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
40334
|
+
const line = this.createSegment();
|
|
40335
|
+
line.name = "mark-common-line-line", this._line = line, container.add(line), this.addMarkLineLabels(container);
|
|
40083
40336
|
}
|
|
40084
40337
|
updateMarker() {
|
|
40085
|
-
|
|
40086
|
-
label: label,
|
|
40087
|
-
state: state
|
|
40088
|
-
} = this.attribute;
|
|
40089
|
-
this.setLineAttributes(), this._label && (this._label.setAttributes(Object.assign(Object.assign({
|
|
40090
|
-
dx: 0,
|
|
40091
|
-
dy: 0
|
|
40092
|
-
}, label), {
|
|
40093
|
-
state: {
|
|
40094
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40095
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40096
|
-
}
|
|
40097
|
-
})), this.setLabelPos());
|
|
40338
|
+
this.setLineAttributes(), this.updateMarkLineLabels();
|
|
40098
40339
|
}
|
|
40099
40340
|
}
|
|
40341
|
+
mixin(MarkCommonLine, MarkLabelMixin);
|
|
40100
40342
|
|
|
40101
40343
|
const FUZZY_EQUAL_DELTA = .001;
|
|
40102
40344
|
const DEFAULT_MARK_LINE_THEME = {
|
|
@@ -40285,6 +40527,7 @@
|
|
|
40285
40527
|
lineWidth: 0
|
|
40286
40528
|
},
|
|
40287
40529
|
label: {
|
|
40530
|
+
autoRotate: !0,
|
|
40288
40531
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40289
40532
|
refX: 0,
|
|
40290
40533
|
refY: 0,
|
|
@@ -40339,6 +40582,7 @@
|
|
|
40339
40582
|
const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
40340
40583
|
interactive: !0,
|
|
40341
40584
|
label: {
|
|
40585
|
+
autoRotate: !0,
|
|
40342
40586
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40343
40587
|
textStyle: {
|
|
40344
40588
|
fill: "#fff",
|
|
@@ -40594,15 +40838,12 @@
|
|
|
40594
40838
|
constructor(attributes, options) {
|
|
40595
40839
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
|
|
40596
40840
|
}
|
|
40597
|
-
getPointAttrByPosition(position) {
|
|
40841
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40598
40842
|
var _a;
|
|
40599
40843
|
const {
|
|
40600
|
-
label = {}
|
|
40601
|
-
} = this.attribute,
|
|
40602
|
-
{
|
|
40603
40844
|
refX = 0,
|
|
40604
40845
|
refY = 0
|
|
40605
|
-
} =
|
|
40846
|
+
} = labelAttrs,
|
|
40606
40847
|
points = this._line.getMainSegmentPoints(),
|
|
40607
40848
|
lineEndAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0,
|
|
40608
40849
|
labelAngle = (lineEndAngle),
|
|
@@ -40628,9 +40869,9 @@
|
|
|
40628
40869
|
angle: labelAngle
|
|
40629
40870
|
};
|
|
40630
40871
|
}
|
|
40631
|
-
getRotateByAngle(angle) {
|
|
40872
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40632
40873
|
var _a;
|
|
40633
|
-
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a =
|
|
40874
|
+
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40634
40875
|
}
|
|
40635
40876
|
getTextStyle(position, labelAngle, autoRotate) {
|
|
40636
40877
|
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];
|
|
@@ -40696,6 +40937,12 @@
|
|
|
40696
40937
|
});else if (!isValidNumber$1(point.x) || !isValidNumber$1(point.y)) return void (validFlag = !1);
|
|
40697
40938
|
}), validFlag;
|
|
40698
40939
|
}
|
|
40940
|
+
addMarkLineLabels(container) {
|
|
40941
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkLine.defaultAttributes.label);
|
|
40942
|
+
}
|
|
40943
|
+
updateMarkLineLabels() {
|
|
40944
|
+
this._updateMarkLabels(MarkLine.defaultAttributes.label);
|
|
40945
|
+
}
|
|
40699
40946
|
}
|
|
40700
40947
|
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
40701
40948
|
|
|
@@ -40710,9 +40957,6 @@
|
|
|
40710
40957
|
getArea() {
|
|
40711
40958
|
return this._area;
|
|
40712
40959
|
}
|
|
40713
|
-
getLabel() {
|
|
40714
|
-
return this._label;
|
|
40715
|
-
}
|
|
40716
40960
|
constructor(attributes, options) {
|
|
40717
40961
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40718
40962
|
}
|
|
@@ -40729,24 +40973,21 @@
|
|
|
40729
40973
|
};
|
|
40730
40974
|
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;
|
|
40731
40975
|
}
|
|
40732
|
-
setLabelPos() {
|
|
40976
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40733
40977
|
var _a;
|
|
40734
|
-
if (this.
|
|
40735
|
-
const
|
|
40736
|
-
label = {}
|
|
40737
|
-
} = this.attribute,
|
|
40738
|
-
labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle",
|
|
40978
|
+
if (this._area) {
|
|
40979
|
+
const labelPosition = null !== (_a = labelAttrs.position) && void 0 !== _a ? _a : "middle",
|
|
40739
40980
|
labelPoint = this.getPointAttrByPosition(labelPosition);
|
|
40740
|
-
if (
|
|
40741
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]),
|
|
40742
|
-
})), this.attribute.limitRect &&
|
|
40981
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), {
|
|
40982
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
40983
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
40743
40984
|
const {
|
|
40744
40985
|
x: x,
|
|
40745
40986
|
y: y,
|
|
40746
40987
|
width: width,
|
|
40747
40988
|
height: height
|
|
40748
40989
|
} = this.attribute.limitRect;
|
|
40749
|
-
limitShapeInBounds(
|
|
40990
|
+
limitShapeInBounds(labelNode, {
|
|
40750
40991
|
x1: x,
|
|
40751
40992
|
y1: y,
|
|
40752
40993
|
x2: x + width,
|
|
@@ -40758,40 +40999,23 @@
|
|
|
40758
40999
|
initMarker(container) {
|
|
40759
41000
|
const {
|
|
40760
41001
|
points: points,
|
|
40761
|
-
label: label,
|
|
40762
41002
|
areaStyle: areaStyle,
|
|
40763
41003
|
state: state
|
|
40764
41004
|
} = this.attribute,
|
|
40765
41005
|
area = graphicCreator.polygon(Object.assign({
|
|
40766
41006
|
points: points
|
|
40767
41007
|
}, areaStyle));
|
|
40768
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
|
|
40769
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40770
|
-
state: {
|
|
40771
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40772
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40773
|
-
}
|
|
40774
|
-
}));
|
|
40775
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
41008
|
+
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);
|
|
40776
41009
|
}
|
|
40777
41010
|
updateMarker() {
|
|
40778
41011
|
const {
|
|
40779
41012
|
points: points,
|
|
40780
|
-
label: label,
|
|
40781
41013
|
areaStyle: areaStyle,
|
|
40782
41014
|
state: state
|
|
40783
41015
|
} = this.attribute;
|
|
40784
41016
|
this._area && (this._area.setAttributes(Object.assign({
|
|
40785
41017
|
points: points
|
|
40786
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
40787
|
-
dx: 0,
|
|
40788
|
-
dy: 0
|
|
40789
|
-
}, label), {
|
|
40790
|
-
state: {
|
|
40791
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40792
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40793
|
-
}
|
|
40794
|
-
})), this.setLabelPos();
|
|
41018
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArea.defaultAttributes.label);
|
|
40795
41019
|
}
|
|
40796
41020
|
isValidPoints() {
|
|
40797
41021
|
const {
|
|
@@ -40804,7 +41028,7 @@
|
|
|
40804
41028
|
}), validFlag;
|
|
40805
41029
|
}
|
|
40806
41030
|
}
|
|
40807
|
-
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
41031
|
+
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME, mixin(MarkArea, MarkLabelMixin);
|
|
40808
41032
|
|
|
40809
41033
|
loadMarkArcLineComponent();
|
|
40810
41034
|
function registerMarkArcLineAnimate() {
|
|
@@ -40815,24 +41039,19 @@
|
|
|
40815
41039
|
MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
40816
41040
|
}
|
|
40817
41041
|
constructor(attributes, options) {
|
|
40818
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes,
|
|
40819
|
-
label: {
|
|
40820
|
-
autoRotate: !0
|
|
40821
|
-
}
|
|
40822
|
-
})), this.name = "markArcLine";
|
|
41042
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes)), this.name = "markArcLine";
|
|
40823
41043
|
}
|
|
40824
|
-
getPointAttrByPosition(direction) {
|
|
41044
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
40825
41045
|
const {
|
|
40826
41046
|
center: center,
|
|
40827
41047
|
radius: radius,
|
|
40828
41048
|
startAngle: startAngle,
|
|
40829
|
-
endAngle: endAngle
|
|
40830
|
-
label: label
|
|
41049
|
+
endAngle: endAngle
|
|
40831
41050
|
} = this.attribute,
|
|
40832
41051
|
{
|
|
40833
41052
|
refX = 0,
|
|
40834
41053
|
refY = 0
|
|
40835
|
-
} =
|
|
41054
|
+
} = labelAttrs;
|
|
40836
41055
|
let angle;
|
|
40837
41056
|
switch (direction) {
|
|
40838
41057
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -40862,9 +41081,9 @@
|
|
|
40862
41081
|
getTextStyle(position) {
|
|
40863
41082
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
40864
41083
|
}
|
|
40865
|
-
getRotateByAngle(angle) {
|
|
41084
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40866
41085
|
var _a;
|
|
40867
|
-
return angle - Math.PI / 2 + (null !== (_a =
|
|
41086
|
+
return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40868
41087
|
}
|
|
40869
41088
|
createSegment() {
|
|
40870
41089
|
const {
|
|
@@ -40921,6 +41140,12 @@
|
|
|
40921
41140
|
isValidPoints() {
|
|
40922
41141
|
return !0;
|
|
40923
41142
|
}
|
|
41143
|
+
addMarkLineLabels(container) {
|
|
41144
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkArcLine.defaultAttributes.label);
|
|
41145
|
+
}
|
|
41146
|
+
updateMarkLineLabels() {
|
|
41147
|
+
this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
|
|
41148
|
+
}
|
|
40924
41149
|
}
|
|
40925
41150
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
40926
41151
|
|
|
@@ -40935,29 +41160,21 @@
|
|
|
40935
41160
|
getArea() {
|
|
40936
41161
|
return this._area;
|
|
40937
41162
|
}
|
|
40938
|
-
getLabel() {
|
|
40939
|
-
return this._label;
|
|
40940
|
-
}
|
|
40941
41163
|
constructor(attributes, options) {
|
|
40942
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes,
|
|
40943
|
-
label: {
|
|
40944
|
-
autoRotate: !0
|
|
40945
|
-
}
|
|
40946
|
-
})), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
41164
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes)), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40947
41165
|
}
|
|
40948
|
-
getPointAttrByPosition(position) {
|
|
41166
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40949
41167
|
const {
|
|
40950
41168
|
center: center,
|
|
40951
41169
|
innerRadius: innerRadius,
|
|
40952
41170
|
outerRadius: outerRadius,
|
|
40953
41171
|
startAngle: startAngle,
|
|
40954
|
-
endAngle: endAngle
|
|
40955
|
-
label: label
|
|
41172
|
+
endAngle: endAngle
|
|
40956
41173
|
} = this.attribute,
|
|
40957
41174
|
{
|
|
40958
41175
|
refX = 0,
|
|
40959
41176
|
refY = 0
|
|
40960
|
-
} =
|
|
41177
|
+
} = labelAttrs;
|
|
40961
41178
|
let radius, angle;
|
|
40962
41179
|
switch (position) {
|
|
40963
41180
|
case IMarkCommonArcLabelPosition.center:
|
|
@@ -40992,28 +41209,25 @@
|
|
|
40992
41209
|
angle: angle
|
|
40993
41210
|
};
|
|
40994
41211
|
}
|
|
40995
|
-
setLabelPos() {
|
|
41212
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40996
41213
|
var _a;
|
|
40997
|
-
if (this.
|
|
41214
|
+
if (this._area) {
|
|
40998
41215
|
const {
|
|
40999
|
-
label = {}
|
|
41000
|
-
} = this.attribute,
|
|
41001
|
-
{
|
|
41002
41216
|
position: labelPosition = "arcInnerMiddle",
|
|
41003
41217
|
autoRotate: autoRotate
|
|
41004
|
-
} =
|
|
41005
|
-
labelAttr = this.getPointAttrByPosition(labelPosition);
|
|
41006
|
-
if (
|
|
41007
|
-
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a =
|
|
41008
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]),
|
|
41009
|
-
})), this.attribute.limitRect &&
|
|
41218
|
+
} = labelAttrs,
|
|
41219
|
+
labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
|
|
41220
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
41221
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0) : 0,
|
|
41222
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
41223
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
41010
41224
|
const {
|
|
41011
41225
|
x: x,
|
|
41012
41226
|
y: y,
|
|
41013
41227
|
width: width,
|
|
41014
41228
|
height: height
|
|
41015
41229
|
} = this.attribute.limitRect;
|
|
41016
|
-
limitShapeInBounds(
|
|
41230
|
+
limitShapeInBounds(labelNode, {
|
|
41017
41231
|
x1: x,
|
|
41018
41232
|
y1: y,
|
|
41019
41233
|
x2: x + width,
|
|
@@ -41030,7 +41244,6 @@
|
|
|
41030
41244
|
startAngle: startAngle,
|
|
41031
41245
|
endAngle: endAngle,
|
|
41032
41246
|
areaStyle: areaStyle,
|
|
41033
|
-
label: label,
|
|
41034
41247
|
state: state
|
|
41035
41248
|
} = this.attribute,
|
|
41036
41249
|
area = graphicCreator.arc(Object.assign({
|
|
@@ -41041,14 +41254,7 @@
|
|
|
41041
41254
|
startAngle: startAngle,
|
|
41042
41255
|
endAngle: endAngle
|
|
41043
41256
|
}, areaStyle));
|
|
41044
|
-
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);
|
|
41045
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
41046
|
-
state: {
|
|
41047
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41048
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41049
|
-
}
|
|
41050
|
-
}));
|
|
41051
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
41257
|
+
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);
|
|
41052
41258
|
}
|
|
41053
41259
|
updateMarker() {
|
|
41054
41260
|
const {
|
|
@@ -41068,21 +41274,13 @@
|
|
|
41068
41274
|
outerRadius: outerRadius,
|
|
41069
41275
|
startAngle: startAngle,
|
|
41070
41276
|
endAngle: endAngle
|
|
41071
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
41072
|
-
dx: 0,
|
|
41073
|
-
dy: 0
|
|
41074
|
-
}, label), {
|
|
41075
|
-
state: {
|
|
41076
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41077
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41078
|
-
}
|
|
41079
|
-
})), this.setLabelPos());
|
|
41277
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
41080
41278
|
}
|
|
41081
41279
|
isValidPoints() {
|
|
41082
41280
|
return !0;
|
|
41083
41281
|
}
|
|
41084
41282
|
}
|
|
41085
|
-
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
41283
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
|
|
41086
41284
|
|
|
41087
41285
|
loadMarkPointComponent();
|
|
41088
41286
|
function registerMarkPointAnimate() {
|
|
@@ -42602,19 +42800,22 @@
|
|
|
42602
42800
|
} = this.attribute;
|
|
42603
42801
|
tooltip && tooltip.alwaysShow || (this._tooltipState = null, this._tooltipShape && this._tooltipShape.setAttribute("visible", !1), this._tooltipText && this._tooltipText.setAttribute("visible", !1), this._dispatchTooltipEvent("sliderTooltipHide"));
|
|
42604
42802
|
}, this._onHandlerPointerdown = e => {
|
|
42605
|
-
|
|
42803
|
+
this._clearAllDragEvents(), this._isChanging = !0;
|
|
42606
42804
|
const {
|
|
42607
42805
|
x: x,
|
|
42608
42806
|
y: y
|
|
42609
42807
|
} = this.stage.eventPointTransform(e);
|
|
42610
|
-
this._currentHandler = e.target, this._prePos = this._isHorizontal ? x : y
|
|
42808
|
+
this._currentHandler = e.target, this._prePos = this._isHorizontal ? x : y;
|
|
42809
|
+
const triggers = getEndTriggersOfDrag(),
|
|
42810
|
+
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42811
|
+
obj.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
42611
42812
|
capture: !0
|
|
42612
|
-
}),
|
|
42613
|
-
|
|
42614
|
-
})
|
|
42813
|
+
}), triggers.forEach(trigger => {
|
|
42814
|
+
obj.addEventListener(trigger, this._onHandlerPointerUp);
|
|
42815
|
+
});
|
|
42615
42816
|
}, this._onHandlerPointerMove = e => {
|
|
42616
42817
|
var _a, _b;
|
|
42617
|
-
|
|
42818
|
+
this._isChanging = !0;
|
|
42618
42819
|
const {
|
|
42619
42820
|
railWidth: railWidth,
|
|
42620
42821
|
railHeight: railHeight,
|
|
@@ -42635,24 +42836,25 @@
|
|
|
42635
42836
|
currentValue = this.calculateValueByPos(newPos);
|
|
42636
42837
|
"text" === this._currentHandler.type ? this._updateHandlerText(this._currentHandler, newPos, currentValue) : this._updateHandler(this._currentHandler, newPos, currentValue), this._updateTrack(), this._prePos = currentPos, this._dispatchChangeEvent();
|
|
42637
42838
|
}, this._onHandlerPointerUp = e => {
|
|
42638
|
-
|
|
42639
|
-
|
|
42640
|
-
|
|
42641
|
-
capture: !0
|
|
42642
|
-
}), this.stage.removeEventListener("pointerup", this._onHandlerPointerUp), this.stage.removeEventListener("pointerupoutside", this._onHandlerPointerUp));
|
|
42839
|
+
this._isChanging = !1, this._currentHandler = null, this._clearAllDragEvents();
|
|
42840
|
+
}, this._handleTouchMove = e => {
|
|
42841
|
+
this._isChanging && e.preventDefault();
|
|
42643
42842
|
}, this._onTrackPointerdown = e => {
|
|
42644
|
-
|
|
42843
|
+
this._clearAllDragEvents(), this._isChanging = !0;
|
|
42645
42844
|
const {
|
|
42646
42845
|
x: x,
|
|
42647
42846
|
y: y
|
|
42648
42847
|
} = this.stage.eventPointTransform(e);
|
|
42649
|
-
this._prePos = this._isHorizontal ? x : y
|
|
42848
|
+
this._prePos = this._isHorizontal ? x : y;
|
|
42849
|
+
const triggers = getEndTriggersOfDrag(),
|
|
42850
|
+
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42851
|
+
obj.addEventListener("pointermove", this._onTrackPointerMove, {
|
|
42650
42852
|
capture: !0
|
|
42651
|
-
}),
|
|
42652
|
-
|
|
42653
|
-
})
|
|
42853
|
+
}), triggers.forEach(trigger => {
|
|
42854
|
+
obj.addEventListener(trigger, this._onTrackPointerUp);
|
|
42855
|
+
});
|
|
42654
42856
|
}, this._onTrackPointerMove = e => {
|
|
42655
|
-
|
|
42857
|
+
this._isChanging = !0;
|
|
42656
42858
|
const {
|
|
42657
42859
|
railWidth: railWidth,
|
|
42658
42860
|
railHeight: railHeight,
|
|
@@ -42693,13 +42895,9 @@
|
|
|
42693
42895
|
}
|
|
42694
42896
|
this._prePos = currentPos, this._dispatchChangeEvent();
|
|
42695
42897
|
}, this._onTrackPointerUp = e => {
|
|
42696
|
-
|
|
42697
|
-
capture: !0
|
|
42698
|
-
}), vglobal.removeEventListener("pointerup", this._onTrackPointerUp)) : (this.stage.removeEventListener("pointermove", this._onTrackPointerMove, {
|
|
42699
|
-
capture: !0
|
|
42700
|
-
}), this.stage.removeEventListener("pointerup", this._onTrackPointerUp), this.stage.removeEventListener("pointerupoutside", this._onTrackPointerUp));
|
|
42898
|
+
this._isChanging = !1, this._clearAllDragEvents();
|
|
42701
42899
|
}, this._onRailPointerDown = e => {
|
|
42702
|
-
|
|
42900
|
+
this._clearAllDragEvents(), this._isChanging = !0;
|
|
42703
42901
|
const {
|
|
42704
42902
|
railWidth: railWidth,
|
|
42705
42903
|
railHeight: railHeight,
|
|
@@ -43020,11 +43218,26 @@
|
|
|
43020
43218
|
slidable: slidable,
|
|
43021
43219
|
range: range
|
|
43022
43220
|
} = this.attribute;
|
|
43023
|
-
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$2(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown))
|
|
43221
|
+
slidable && (this._startHandler && this._startHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._startHandlerText && this._startHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandler && this._endHandler.addEventListener("pointerdown", this._onHandlerPointerdown), this._endHandlerText && this._endHandlerText.addEventListener("pointerdown", this._onHandlerPointerdown), isObject$2(range) && range.draggableTrack && this._track.addEventListener("pointerdown", this._onTrackPointerdown), this._railContainer.addEventListener("pointerdown", this._onRailPointerDown), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
43222
|
+
passive: !1
|
|
43223
|
+
}));
|
|
43024
43224
|
}
|
|
43025
43225
|
_bindTooltipEvents() {
|
|
43026
43226
|
this.attribute.disableTriggerEvent || (this._mainContainer.addEventListener("pointerenter", this._onTooltipShow), this._mainContainer.addEventListener("pointermove", this._onTooltipUpdate), this._mainContainer.addEventListener("pointerleave", this._onTooltipHide));
|
|
43027
43227
|
}
|
|
43228
|
+
_clearAllDragEvents() {
|
|
43229
|
+
const triggers = getEndTriggersOfDrag(),
|
|
43230
|
+
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
43231
|
+
obj.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
43232
|
+
capture: !0
|
|
43233
|
+
}), triggers.forEach(trigger => {
|
|
43234
|
+
obj.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
43235
|
+
}), obj.removeEventListener("pointermove", this._onTrackPointerMove, {
|
|
43236
|
+
capture: !0
|
|
43237
|
+
}), triggers.forEach(trigger => {
|
|
43238
|
+
obj.removeEventListener(trigger, this._onTrackPointerUp);
|
|
43239
|
+
});
|
|
43240
|
+
}
|
|
43028
43241
|
_updateTrack() {
|
|
43029
43242
|
const {
|
|
43030
43243
|
inverse: inverse,
|
|
@@ -43123,6 +43336,11 @@
|
|
|
43123
43336
|
endHandler: endHandler
|
|
43124
43337
|
};
|
|
43125
43338
|
}
|
|
43339
|
+
release(all) {
|
|
43340
|
+
super.release(all), ("browser" === vglobal.env ? vglobal : this.stage).addEventListener("touchmove", this._handleTouchMove, {
|
|
43341
|
+
passive: !1
|
|
43342
|
+
}), this._clearAllDragEvents();
|
|
43343
|
+
}
|
|
43126
43344
|
}
|
|
43127
43345
|
Slider.defaultAttributes = {
|
|
43128
43346
|
slidable: !0,
|
|
@@ -44398,13 +44616,13 @@
|
|
|
44398
44616
|
|
|
44399
44617
|
var IOperateType;
|
|
44400
44618
|
!function (IOperateType) {
|
|
44401
|
-
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushClear = "brushClear";
|
|
44619
|
+
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing", IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd", IOperateType.brushActive = "brushActive", IOperateType.brushClear = "brushClear";
|
|
44402
44620
|
}(IOperateType || (IOperateType = {}));
|
|
44403
44621
|
|
|
44404
44622
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
44405
44623
|
trigger: "pointerdown",
|
|
44406
44624
|
updateTrigger: "pointermove",
|
|
44407
|
-
endTrigger: "pointerup",
|
|
44625
|
+
endTrigger: ["pointerup", "pointerleave"],
|
|
44408
44626
|
resetTrigger: "pointerupoutside",
|
|
44409
44627
|
hasMask: !0,
|
|
44410
44628
|
brushMode: "single",
|
|
@@ -44420,10 +44638,10 @@
|
|
|
44420
44638
|
delayType: "throttle",
|
|
44421
44639
|
delayTime: 10,
|
|
44422
44640
|
interactiveRange: {
|
|
44423
|
-
|
|
44424
|
-
|
|
44425
|
-
|
|
44426
|
-
|
|
44641
|
+
minY: -1 / 0,
|
|
44642
|
+
maxY: 1 / 0,
|
|
44643
|
+
minX: -1 / 0,
|
|
44644
|
+
maxX: 1 / 0
|
|
44427
44645
|
}
|
|
44428
44646
|
};
|
|
44429
44647
|
const DEFAULT_SIZE_THRESHOLD = 5;
|
|
@@ -44439,83 +44657,36 @@
|
|
|
44439
44657
|
loadBrushComponent();
|
|
44440
44658
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
44441
44659
|
constructor(attributes, options) {
|
|
44442
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this.
|
|
44443
|
-
|
|
44444
|
-
if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
|
|
44445
|
-
e.stopPropagation();
|
|
44446
|
-
const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
|
|
44447
|
-
this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
|
|
44448
|
-
}, this._onBrushing = e => {
|
|
44449
|
-
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
44450
|
-
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44451
|
-
var _a;
|
|
44452
|
-
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
44453
|
-
e.preventDefault();
|
|
44660
|
+
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 => {
|
|
44661
|
+
if (this._outOfInteractiveRange(e)) return void (this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)));
|
|
44454
44662
|
const {
|
|
44455
|
-
|
|
44663
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44664
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44665
|
+
brushMoved = !0
|
|
44456
44666
|
} = this.attribute;
|
|
44457
|
-
|
|
44458
|
-
|
|
44459
|
-
|
|
44460
|
-
|
|
44461
|
-
|
|
44462
|
-
operateMask: this._operatingMask,
|
|
44463
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44464
|
-
event: e
|
|
44465
|
-
}), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
|
|
44466
|
-
operateMask: this._operatingMask,
|
|
44467
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44468
|
-
event: e
|
|
44469
|
-
})), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44667
|
+
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];
|
|
44668
|
+
}, this._onBrushing = e => {
|
|
44669
|
+
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)));
|
|
44670
|
+
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44671
|
+
this._releaseBrushUpdateEvents(), e.preventDefault(), this._activeDrawState && this._drawEnd(e), this._activeMoveState && this._moveEnd(e), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
44470
44672
|
}, this._onBrushClear = e => {
|
|
44471
|
-
e.preventDefault();
|
|
44472
|
-
const {
|
|
44473
|
-
removeOnClick = !0
|
|
44474
|
-
} = this.attribute;
|
|
44475
|
-
this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
|
|
44476
|
-
operateMask: this._operatingMask,
|
|
44477
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44478
|
-
event: e
|
|
44479
|
-
}), this._container.incrementalClearChild(), this._brushMaskAABBBoundsDict = {}), this._activeDrawState = !1, this._activeMoveState = !1, this._isDrawedBeforeEnd = !1, this._isDownBeforeUpOutside = !1, this._operatingMask && this._operatingMask.setAttribute("pickable", !1);
|
|
44673
|
+
e.preventDefault(), this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e)), this._activeDrawState = !1, this._activeMoveState = !1;
|
|
44480
44674
|
};
|
|
44481
44675
|
}
|
|
44482
44676
|
_bindBrushEvents() {
|
|
44483
|
-
if (this.attribute.disableTriggerEvent) return;
|
|
44677
|
+
if (this.releaseBrushEvents(), this.attribute.disableTriggerEvent) return;
|
|
44484
44678
|
const {
|
|
44485
44679
|
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44486
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44487
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44488
44680
|
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44489
44681
|
} = this.attribute;
|
|
44490
|
-
array(trigger).forEach(t =>
|
|
44491
|
-
}
|
|
44492
|
-
_isPosInBrushMask(e) {
|
|
44493
|
-
const pos = this.eventPosToStagePos(e),
|
|
44494
|
-
brushMasks = this._container.getChildren();
|
|
44495
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
44496
|
-
const {
|
|
44497
|
-
points = [],
|
|
44498
|
-
dx = 0,
|
|
44499
|
-
dy = 0
|
|
44500
|
-
} = brushMasks[i].attribute,
|
|
44501
|
-
pointsConsiderOffset = points.map(point => ({
|
|
44502
|
-
x: point.x + dx,
|
|
44503
|
-
y: point.y + dy
|
|
44504
|
-
}));
|
|
44505
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44506
|
-
}
|
|
44507
|
-
return !1;
|
|
44682
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
44508
44683
|
}
|
|
44509
44684
|
_initDraw(e) {
|
|
44510
44685
|
const {
|
|
44511
44686
|
brushMode: brushMode
|
|
44512
44687
|
} = this.attribute,
|
|
44513
44688
|
pos = this.eventPosToStagePos(e);
|
|
44514
|
-
this._cacheDrawPoints
|
|
44515
|
-
operateMask: this._operatingMask,
|
|
44516
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44517
|
-
event: e
|
|
44518
|
-
});
|
|
44689
|
+
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);
|
|
44519
44690
|
}
|
|
44520
44691
|
_initMove(e) {
|
|
44521
44692
|
var _a, _b;
|
|
@@ -44539,17 +44710,12 @@
|
|
|
44539
44710
|
maxMoveStepX = maxX - x2,
|
|
44540
44711
|
minMoveStepY = minY - y1,
|
|
44541
44712
|
maxMoveStepY = maxY - y2;
|
|
44542
|
-
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this.
|
|
44543
|
-
operateMask: this._operatingMask,
|
|
44544
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44545
|
-
event: e
|
|
44546
|
-
});
|
|
44713
|
+
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
44547
44714
|
}
|
|
44548
44715
|
_drawing(e) {
|
|
44549
|
-
var _a
|
|
44716
|
+
var _a;
|
|
44550
44717
|
const pos = this.eventPosToStagePos(e),
|
|
44551
44718
|
{
|
|
44552
|
-
sizeThreshold = DEFAULT_SIZE_THRESHOLD,
|
|
44553
44719
|
brushType: brushType
|
|
44554
44720
|
} = this.attribute,
|
|
44555
44721
|
cacheLength = this._cacheDrawPoints.length;
|
|
@@ -44559,18 +44725,7 @@
|
|
|
44559
44725
|
}
|
|
44560
44726
|
"polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
44561
44727
|
const maskPoints = this._computeMaskPoints();
|
|
44562
|
-
this._operatingMask.setAttribute("points", maskPoints);
|
|
44563
|
-
const {
|
|
44564
|
-
x1 = 0,
|
|
44565
|
-
x2 = 0,
|
|
44566
|
-
y1 = 0,
|
|
44567
|
-
y2 = 0
|
|
44568
|
-
} = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
|
|
44569
|
-
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, {
|
|
44570
|
-
operateMask: this._operatingMask,
|
|
44571
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44572
|
-
event: e
|
|
44573
|
-
}));
|
|
44728
|
+
this._operatingMask.setAttribute("points", maskPoints), this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
44574
44729
|
}
|
|
44575
44730
|
_moving(e) {
|
|
44576
44731
|
const startPos = this._cacheMovePoint,
|
|
@@ -44583,11 +44738,46 @@
|
|
|
44583
44738
|
this._operatingMask.setAttributes({
|
|
44584
44739
|
dx: moveX,
|
|
44585
44740
|
dy: moveY
|
|
44586
|
-
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44587
|
-
|
|
44588
|
-
|
|
44589
|
-
|
|
44590
|
-
|
|
44741
|
+
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this._dispatchBrushEvent(IOperateType.moving, e);
|
|
44742
|
+
}
|
|
44743
|
+
_drawEnd(e) {
|
|
44744
|
+
const {
|
|
44745
|
+
removeOnClick = !0,
|
|
44746
|
+
sizeThreshold = DEFAULT_SIZE_THRESHOLD
|
|
44747
|
+
} = this.attribute;
|
|
44748
|
+
if (this._outOfInteractiveRange(e)) this._isEmptyMask() || (this._clearMask(), this._dispatchBrushEvent(IOperateType.brushClear, e));else {
|
|
44749
|
+
const {
|
|
44750
|
+
x: x1,
|
|
44751
|
+
y: y1
|
|
44752
|
+
} = this._startPos,
|
|
44753
|
+
{
|
|
44754
|
+
x: x2,
|
|
44755
|
+
y: y2
|
|
44756
|
+
} = this.eventPosToStagePos(e);
|
|
44757
|
+
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));
|
|
44758
|
+
}
|
|
44759
|
+
}
|
|
44760
|
+
_moveEnd(e) {
|
|
44761
|
+
this._operatingMask && this._operatingMask.setAttribute("pickable", !1), this._dispatchBrushEvent(IOperateType.moveEnd, e);
|
|
44762
|
+
}
|
|
44763
|
+
render() {
|
|
44764
|
+
this._bindBrushEvents();
|
|
44765
|
+
const group = this.createOrUpdateChild("brush-container", {}, "group");
|
|
44766
|
+
this._container = group;
|
|
44767
|
+
}
|
|
44768
|
+
releaseBrushEvents() {
|
|
44769
|
+
const {
|
|
44770
|
+
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44771
|
+
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44772
|
+
} = this.attribute;
|
|
44773
|
+
array(trigger).forEach(t => this.stage.removeEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushClear)), this._releaseBrushUpdateEvents();
|
|
44774
|
+
}
|
|
44775
|
+
_releaseBrushUpdateEvents() {
|
|
44776
|
+
const {
|
|
44777
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44778
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger
|
|
44779
|
+
} = this.attribute;
|
|
44780
|
+
array(updateTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushingWithDelay)), array(endTrigger).forEach(t => this.stage.removeEventListener(t, this._onBrushEnd));
|
|
44591
44781
|
}
|
|
44592
44782
|
_computeMaskPoints() {
|
|
44593
44783
|
const {
|
|
@@ -44645,6 +44835,23 @@
|
|
|
44645
44835
|
}));
|
|
44646
44836
|
brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
44647
44837
|
}
|
|
44838
|
+
_isPosInBrushMask(e) {
|
|
44839
|
+
const pos = this.eventPosToStagePos(e),
|
|
44840
|
+
brushMasks = this._container.getChildren();
|
|
44841
|
+
for (let i = 0; i < brushMasks.length; i++) {
|
|
44842
|
+
const {
|
|
44843
|
+
points = [],
|
|
44844
|
+
dx = 0,
|
|
44845
|
+
dy = 0
|
|
44846
|
+
} = brushMasks[i].attribute,
|
|
44847
|
+
pointsConsiderOffset = points.map(point => ({
|
|
44848
|
+
x: point.x + dx,
|
|
44849
|
+
y: point.y + dy
|
|
44850
|
+
}));
|
|
44851
|
+
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44852
|
+
}
|
|
44853
|
+
return !1;
|
|
44854
|
+
}
|
|
44648
44855
|
_outOfInteractiveRange(e) {
|
|
44649
44856
|
const {
|
|
44650
44857
|
interactiveRange: interactiveRange
|
|
@@ -44661,21 +44868,18 @@
|
|
|
44661
44868
|
eventPosToStagePos(e) {
|
|
44662
44869
|
return this.stage.eventPointTransform(e);
|
|
44663
44870
|
}
|
|
44664
|
-
|
|
44665
|
-
this.
|
|
44666
|
-
|
|
44667
|
-
|
|
44871
|
+
_dispatchBrushEvent(operateType, e) {
|
|
44872
|
+
this._dispatchEvent(operateType, {
|
|
44873
|
+
operateMask: this._operatingMask,
|
|
44874
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44875
|
+
event: e
|
|
44876
|
+
});
|
|
44668
44877
|
}
|
|
44669
|
-
|
|
44670
|
-
|
|
44671
|
-
|
|
44672
|
-
|
|
44673
|
-
|
|
44674
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44675
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44676
|
-
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44677
|
-
} = this.attribute;
|
|
44678
|
-
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));
|
|
44878
|
+
_clearMask() {
|
|
44879
|
+
this._brushMaskAABBBoundsDict = {}, this._container.incrementalClearChild(), this._operatingMask = null;
|
|
44880
|
+
}
|
|
44881
|
+
_isEmptyMask() {
|
|
44882
|
+
return isEmpty(this._brushMaskAABBBoundsDict) || Object.keys(this._brushMaskAABBBoundsDict).every(key => this._brushMaskAABBBoundsDict[key].empty());
|
|
44679
44883
|
}
|
|
44680
44884
|
};
|
|
44681
44885
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -56910,6 +57114,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56910
57114
|
ChartEvent["brushChange"] = "brushChange";
|
|
56911
57115
|
ChartEvent["brushEnd"] = "brushEnd";
|
|
56912
57116
|
ChartEvent["brushClear"] = "brushClear";
|
|
57117
|
+
ChartEvent["brushActive"] = "brushActive";
|
|
56913
57118
|
ChartEvent["legendSelectedDataChange"] = "legendSelectedDataChange";
|
|
56914
57119
|
ChartEvent["legendFilter"] = "legendFilter";
|
|
56915
57120
|
ChartEvent["legendItemClick"] = "legendItemClick";
|
|
@@ -59561,6 +59766,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59561
59766
|
}
|
|
59562
59767
|
beforeRelease() {
|
|
59563
59768
|
}
|
|
59769
|
+
clear() {
|
|
59770
|
+
this.getMarks().forEach(m => { var _a; return (_a = m.clear) === null || _a === void 0 ? void 0 : _a.call(m); });
|
|
59771
|
+
}
|
|
59564
59772
|
release() {
|
|
59565
59773
|
var _a;
|
|
59566
59774
|
this._releaseEvent();
|
|
@@ -61713,6 +61921,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61713
61921
|
}
|
|
61714
61922
|
return undefined;
|
|
61715
61923
|
}
|
|
61924
|
+
clear() {
|
|
61925
|
+
this._event.off(HOOK_EVENT.AFTER_DO_RENDER);
|
|
61926
|
+
}
|
|
61716
61927
|
release() {
|
|
61717
61928
|
super.release();
|
|
61718
61929
|
this.state.release();
|
|
@@ -63662,7 +63873,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63662
63873
|
};
|
|
63663
63874
|
registerVChartCore();
|
|
63664
63875
|
|
|
63665
|
-
const version = "1.13.9
|
|
63876
|
+
const version = "1.13.9";
|
|
63666
63877
|
|
|
63667
63878
|
const addVChartProperty = (data, op) => {
|
|
63668
63879
|
const context = op.beforeCall();
|
|
@@ -67809,6 +68020,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67809
68020
|
if (spec.label.state) {
|
|
67810
68021
|
axisAttrs.label.state = transformAxisLabelStateStyle(spec.label.state);
|
|
67811
68022
|
}
|
|
68023
|
+
if (isFunction$1(spec.label.dataFilter)) {
|
|
68024
|
+
axisAttrs.label.dataFilter = (data, layer) => spec.label.dataFilter(data, layer, { vchart: this._option.globalInstance });
|
|
68025
|
+
}
|
|
67812
68026
|
}
|
|
67813
68027
|
else {
|
|
67814
68028
|
axisAttrs.label = {
|
|
@@ -67821,7 +68035,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67821
68035
|
length: spec.tick.tickSize,
|
|
67822
68036
|
inside: spec.tick.inside,
|
|
67823
68037
|
alignWithLabel: spec.tick.alignWithLabel,
|
|
67824
|
-
dataFilter: spec.tick.dataFilter
|
|
68038
|
+
dataFilter: isFunction$1(spec.tick.dataFilter)
|
|
68039
|
+
? (data) => spec.tick.dataFilter(data, { vchart: this._option.globalInstance })
|
|
68040
|
+
: undefined
|
|
67825
68041
|
};
|
|
67826
68042
|
if (spec.tick.style) {
|
|
67827
68043
|
axisAttrs.tick.style = isFunction$1(spec.tick.style)
|
|
@@ -72750,9 +72966,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72750
72966
|
else if (domainMin > 0) {
|
|
72751
72967
|
return scale.scale(domainMin);
|
|
72752
72968
|
}
|
|
72753
|
-
|
|
72754
|
-
return scale.scale(0);
|
|
72755
|
-
}
|
|
72969
|
+
return scale.scale(0);
|
|
72756
72970
|
}
|
|
72757
72971
|
}
|
|
72758
72972
|
};
|
|
@@ -76960,7 +77174,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76960
77174
|
return data;
|
|
76961
77175
|
}
|
|
76962
77176
|
if (!showAllZero && showEmptyCircle && isDataEmpty(data, angleField, supportNegative)) {
|
|
76963
|
-
return
|
|
77177
|
+
return [];
|
|
76964
77178
|
}
|
|
76965
77179
|
const appendArcInfo = (data, startAngle, angle) => {
|
|
76966
77180
|
data[asStartAngle] = startAngle;
|
|
@@ -77449,6 +77663,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77449
77663
|
}, {
|
|
77450
77664
|
dataView: false
|
|
77451
77665
|
});
|
|
77666
|
+
this._emptyArcMark.setDepend(this._pieMark);
|
|
77452
77667
|
}
|
|
77453
77668
|
}
|
|
77454
77669
|
startAngleScale(datum) {
|
|
@@ -77484,8 +77699,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77484
77699
|
const emptyPieMark = this._emptyArcMark;
|
|
77485
77700
|
if (emptyPieMark) {
|
|
77486
77701
|
this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => {
|
|
77487
|
-
const
|
|
77488
|
-
return
|
|
77702
|
+
const data = this.getViewData().latestData;
|
|
77703
|
+
return !data || !data.length;
|
|
77489
77704
|
} }), 'normal', AttributeLevel.Series);
|
|
77490
77705
|
}
|
|
77491
77706
|
}
|
|
@@ -79694,7 +79909,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79694
79909
|
return value;
|
|
79695
79910
|
}
|
|
79696
79911
|
}
|
|
79697
|
-
|
|
79912
|
+
const angle = this.angleAxisHelper.dataToPosition([datum[this._angleField[0]]]);
|
|
79913
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
79698
79914
|
}
|
|
79699
79915
|
getDimensionField() {
|
|
79700
79916
|
return this._specRadiusField;
|
|
@@ -79727,12 +79943,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79727
79943
|
clip: true,
|
|
79728
79944
|
clipPath: () => {
|
|
79729
79945
|
const axis = this._getAngleAxis();
|
|
79946
|
+
const { x, y } = this.angleAxisHelper.center();
|
|
79947
|
+
const radius = this._computeLayoutRadius();
|
|
79730
79948
|
if (this._isTickMaskVisible(axis)) {
|
|
79731
79949
|
const { tickMask } = this._spec;
|
|
79732
79950
|
const { angle, offsetAngle, style = {} } = tickMask;
|
|
79733
79951
|
const subTickData = this._getAngleAxisSubTickData(axis);
|
|
79734
|
-
const { x, y } = this.angleAxisHelper.center();
|
|
79735
|
-
const radius = this._computeLayoutRadius();
|
|
79736
79952
|
const markStyle = style;
|
|
79737
79953
|
return subTickData.map(({ value }) => {
|
|
79738
79954
|
const pos = this.angleAxisHelper.dataToPosition([value]) + degreeToRadian(offsetAngle);
|
|
@@ -80153,7 +80369,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80153
80369
|
leftPadding);
|
|
80154
80370
|
},
|
|
80155
80371
|
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)); },
|
|
80156
|
-
y: () => {
|
|
80372
|
+
y: () => {
|
|
80373
|
+
var _a, _b, _c;
|
|
80374
|
+
const value = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
|
|
80375
|
+
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;
|
|
80376
|
+
},
|
|
80157
80377
|
width: this._spec.bandWidth - leftPadding - rightPadding,
|
|
80158
80378
|
cornerRadius: this._spec.cornerRadius,
|
|
80159
80379
|
fill: this.getColorAttribute()
|
|
@@ -80172,7 +80392,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80172
80392
|
topPadding);
|
|
80173
80393
|
},
|
|
80174
80394
|
height: this._spec.bandWidth - topPadding - bottomPadding,
|
|
80175
|
-
x: () => {
|
|
80395
|
+
x: () => {
|
|
80396
|
+
var _a, _b, _c;
|
|
80397
|
+
const value = (_a = this._xAxisHelper) === null || _a === void 0 ? void 0 : _a.dataToPosition([0], { bandPosition: this._bandPosition });
|
|
80398
|
+
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;
|
|
80399
|
+
},
|
|
80176
80400
|
cornerRadius: this._spec.cornerRadius,
|
|
80177
80401
|
fill: this.getColorAttribute()
|
|
80178
80402
|
}, 'normal', AttributeLevel.Series);
|
|
@@ -87608,12 +87832,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87608
87832
|
_getAngleValueStartWithoutMask(datum) {
|
|
87609
87833
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87610
87834
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87611
|
-
|
|
87835
|
+
const angle = clamper(startAngle, (startAngle + endAngle) / 2)(startAngle + (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
|
|
87836
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
87612
87837
|
}
|
|
87613
87838
|
_getAngleValueEndWithoutMask(datum) {
|
|
87614
87839
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87615
87840
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87616
|
-
|
|
87841
|
+
const angle = clamper(endAngle, (startAngle + endAngle) / 2)(endAngle - (endAngle > startAngle ? 1 : -1) * Math.abs(this._padAngle / 2));
|
|
87842
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
87617
87843
|
}
|
|
87618
87844
|
_getAngleValueStartWithoutPadAngle(datum) {
|
|
87619
87845
|
return isValid$1(datum[SEGMENT_FIELD_START])
|
|
@@ -89924,21 +90150,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89924
90150
|
return isValid$1(attr) && attr !== 'none' && !((_a = attr.includes) === null || _a === void 0 ? void 0 : _a.call(attr, 'url'));
|
|
89925
90151
|
}
|
|
89926
90152
|
const getLineWidth = (attributes) => {
|
|
89927
|
-
const strokeWidth = parseFloat(attributes
|
|
90153
|
+
const strokeWidth = parseFloat(attributes.strokeWidth);
|
|
89928
90154
|
if (!isNaN(strokeWidth)) {
|
|
89929
90155
|
return strokeWidth;
|
|
89930
90156
|
}
|
|
89931
|
-
const stroke = attributes
|
|
90157
|
+
const stroke = attributes.stroke;
|
|
89932
90158
|
return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
|
|
89933
90159
|
};
|
|
89934
90160
|
const getFill = (attributes, defaultFill) => {
|
|
89935
90161
|
var _a;
|
|
89936
|
-
const fill = (_a = attributes
|
|
90162
|
+
const fill = (_a = attributes.fill) !== null && _a !== void 0 ? _a : defaultFill;
|
|
89937
90163
|
return fill && isValidStrokeOrFill(fill) ? fill : undefined;
|
|
89938
90164
|
};
|
|
89939
90165
|
const getStroke = (attributes, defaultStroke) => {
|
|
89940
90166
|
var _a;
|
|
89941
|
-
const stroke = (_a = attributes
|
|
90167
|
+
const stroke = (_a = attributes.stroke) !== null && _a !== void 0 ? _a : defaultStroke;
|
|
89942
90168
|
return stroke && isValidStrokeOrFill(stroke) ? stroke : false;
|
|
89943
90169
|
};
|
|
89944
90170
|
const commonAttributes = (attributes) => {
|
|
@@ -89947,7 +90173,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89947
90173
|
const graphicAttributeTransform = {
|
|
89948
90174
|
group: (attributes) => {
|
|
89949
90175
|
const common = commonAttributes(attributes);
|
|
89950
|
-
return Object.assign(Object.assign({}, common), { visibleAll: common
|
|
90176
|
+
return Object.assign(Object.assign({}, common), { visibleAll: common.visible !== false });
|
|
89951
90177
|
},
|
|
89952
90178
|
rule: (attributes) => {
|
|
89953
90179
|
return Object.assign(Object.assign({}, commonAttributes(attributes)), { x: parseFloat(attributes.x1), y: parseFloat(attributes.y1), x1: parseFloat(attributes.x2), y1: parseFloat(attributes.y2) });
|
|
@@ -89998,7 +90224,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89998
90224
|
el._uniqueId = `${el.id}-${index}`;
|
|
89999
90225
|
el.data = undefined;
|
|
90000
90226
|
const { graphicType: type, transform } = el;
|
|
90001
|
-
|
|
90227
|
+
const finalAttributes = {
|
|
90002
90228
|
visible: el.attributes.visibility !== 'hidden' && el.attributes.visibility !== 'collapse'
|
|
90003
90229
|
};
|
|
90004
90230
|
if (el.graphicType === 'text') {
|
|
@@ -90033,7 +90259,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90033
90259
|
return result;
|
|
90034
90260
|
});
|
|
90035
90261
|
if (children && children.length) {
|
|
90036
|
-
|
|
90262
|
+
const startX = (_b = (_a = texts[i]._textGroupStyle) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
|
|
90037
90263
|
let curX = startX;
|
|
90038
90264
|
for (let j = 0; j < children.length; j++) {
|
|
90039
90265
|
const currentChild = children[j];
|
|
@@ -91560,7 +91786,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91560
91786
|
}
|
|
91561
91787
|
_getDefaultSeriesSpec(spec) {
|
|
91562
91788
|
var _a, _b;
|
|
91563
|
-
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track']);
|
|
91789
|
+
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track', 'clamp']);
|
|
91564
91790
|
series.direction = (_a = spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
|
|
91565
91791
|
series.cornerRadius = (_b = spec.cornerRadius) !== null && _b !== void 0 ? _b : 0;
|
|
91566
91792
|
return series;
|
|
@@ -94422,7 +94648,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94422
94648
|
Object.keys(this._stateByField).forEach(field => {
|
|
94423
94649
|
const fieldSpec = this._spec[field];
|
|
94424
94650
|
if (fieldSpec && fieldSpec.visible && fieldSpec.defaultSelect) {
|
|
94425
|
-
const { axisIndex, datum } = fieldSpec.defaultSelect;
|
|
94651
|
+
const { axisIndex = 0, datum } = fieldSpec.defaultSelect;
|
|
94426
94652
|
const axis = this._option.getComponentsByKey('axes').find(c => c.getSpecIndex() === axisIndex);
|
|
94427
94653
|
if (axis) {
|
|
94428
94654
|
this._stateByField[field].currentValue.clear();
|
|
@@ -94978,36 +95204,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94978
95204
|
};
|
|
94979
95205
|
}
|
|
94980
95206
|
else if (type === 'rect') {
|
|
94981
|
-
const
|
|
95207
|
+
const [offset0, offset1] = getRectSize(attributes, bandSize, offsetSize, cacheInfo.axis);
|
|
94982
95208
|
const { coordRange } = cacheInfo;
|
|
94983
95209
|
positionAttribute = {
|
|
94984
95210
|
visible: true,
|
|
94985
95211
|
start: {
|
|
94986
|
-
[coordKey]: Math.max(coord
|
|
95212
|
+
[coordKey]: Math.max(coord + offset0, coordRange[0]),
|
|
94987
95213
|
[anotherAxisKey]: sizeRange[0]
|
|
94988
95214
|
},
|
|
94989
95215
|
end: {
|
|
94990
|
-
[coordKey]: Math.min(coord +
|
|
95216
|
+
[coordKey]: Math.min(coord + offset1, coordRange[1]),
|
|
94991
95217
|
[anotherAxisKey]: sizeRange[1]
|
|
94992
95218
|
}
|
|
94993
95219
|
};
|
|
94994
95220
|
}
|
|
94995
95221
|
return positionAttribute;
|
|
94996
95222
|
};
|
|
94997
|
-
const getRectSize = (hair, bandSize, axis) => {
|
|
95223
|
+
const getRectSize = (hair, bandSize, offsetSize, axis) => {
|
|
94998
95224
|
var _a, _b, _c;
|
|
94999
|
-
|
|
95225
|
+
const visualSize = bandSize === 0 ? offsetSize : bandSize;
|
|
95226
|
+
let size = visualSize;
|
|
95000
95227
|
if ((_a = hair.style) === null || _a === void 0 ? void 0 : _a.sizePercent) {
|
|
95001
|
-
|
|
95228
|
+
size = visualSize * hair.style.sizePercent;
|
|
95002
95229
|
}
|
|
95003
95230
|
else if (typeof ((_b = hair.style) === null || _b === void 0 ? void 0 : _b.size) === 'number') {
|
|
95004
|
-
|
|
95231
|
+
size = hair.style.size;
|
|
95005
95232
|
}
|
|
95006
95233
|
else if (typeof ((_c = hair.style) === null || _c === void 0 ? void 0 : _c.size) === 'function') {
|
|
95007
95234
|
const axisRect = axis.getLayoutRect();
|
|
95008
|
-
|
|
95235
|
+
size = hair.style.size(axisRect, axis);
|
|
95009
95236
|
}
|
|
95010
|
-
return
|
|
95237
|
+
return bandSize === 0 ? [-size / 2, size / 2] : [bandSize / 2 - size / 2, size / 2 + bandSize / 2];
|
|
95011
95238
|
};
|
|
95012
95239
|
|
|
95013
95240
|
class CartesianCrossHair extends BaseCrossHair {
|
|
@@ -97497,17 +97724,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97497
97724
|
}
|
|
97498
97725
|
return offset;
|
|
97499
97726
|
}
|
|
97727
|
+
function getProcessInfo(spec) {
|
|
97728
|
+
return {
|
|
97729
|
+
isXProcess: isValid$1(spec.x),
|
|
97730
|
+
isYProcess: isValid$1(spec.y),
|
|
97731
|
+
isX1Process: isValid$1(spec.x1),
|
|
97732
|
+
isY1Process: isValid$1(spec.y1),
|
|
97733
|
+
isAngleProcess: isValid$1(spec.angle),
|
|
97734
|
+
isRadiusProcess: isValid$1(spec.radius),
|
|
97735
|
+
isAngle1Process: isValid$1(spec.angle1),
|
|
97736
|
+
isRadius1Process: isValid$1(spec.radius1),
|
|
97737
|
+
isCoordinatesProcess: isValid$1(spec.coordinates),
|
|
97738
|
+
isValidProcess: isValid$1(spec.process)
|
|
97739
|
+
};
|
|
97740
|
+
}
|
|
97500
97741
|
function getMarkLineProcessInfo(spec) {
|
|
97501
|
-
const isXProcess
|
|
97502
|
-
const isYProcess = 'y' in spec;
|
|
97503
|
-
const isX1Process = 'x1' in spec;
|
|
97504
|
-
const isY1Process = 'y1' in spec;
|
|
97505
|
-
const isAngleProcess = 'angle' in spec;
|
|
97506
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97507
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97508
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97509
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97510
|
-
const isValidProcess = 'process' in spec;
|
|
97742
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess, isValidProcess } = getProcessInfo(spec);
|
|
97511
97743
|
return {
|
|
97512
97744
|
doXProcess: isXProcess && !isYProcess && !isY1Process,
|
|
97513
97745
|
doXYY1Process: isXProcess && isYProcess && isY1Process,
|
|
@@ -97523,15 +97755,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97523
97755
|
};
|
|
97524
97756
|
}
|
|
97525
97757
|
function getMarkAreaProcessInfo(spec) {
|
|
97526
|
-
const isXProcess
|
|
97527
|
-
const isX1Process = 'x1' in spec;
|
|
97528
|
-
const isYProcess = 'y' in spec;
|
|
97529
|
-
const isY1Process = 'y1' in spec;
|
|
97530
|
-
const isAngleProcess = 'angle' in spec;
|
|
97531
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97532
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97533
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97534
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97758
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess } = getProcessInfo(spec);
|
|
97535
97759
|
return {
|
|
97536
97760
|
doXProcess: isXProcess && isX1Process && !isYProcess && !isY1Process,
|
|
97537
97761
|
doYProcess: isYProcess && isY1Process && !isXProcess && !isX1Process,
|
|
@@ -98049,13 +98273,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98049
98273
|
return 'cartesian';
|
|
98050
98274
|
}
|
|
98051
98275
|
_createMarkerComponent() {
|
|
98052
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
98053
|
-
const {
|
|
98276
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
98277
|
+
const { startSymbol = {}, endSymbol = {} } = this._spec;
|
|
98278
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98054
98279
|
const markLineAttrs = {
|
|
98055
98280
|
zIndex: this.layoutZIndex,
|
|
98056
|
-
interactive: (
|
|
98057
|
-
hover: (
|
|
98058
|
-
select: (
|
|
98281
|
+
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
98282
|
+
hover: (_c = this._spec.interactive) !== null && _c !== void 0 ? _c : true,
|
|
98283
|
+
select: (_d = this._spec.interactive) !== null && _d !== void 0 ? _d : true,
|
|
98059
98284
|
points: [
|
|
98060
98285
|
{ x: 0, y: 0 },
|
|
98061
98286
|
{ x: 0, y: 0 }
|
|
@@ -98067,17 +98292,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98067
98292
|
radius: 0,
|
|
98068
98293
|
startAngle: 0,
|
|
98069
98294
|
endAngle: 0,
|
|
98070
|
-
lineStyle: transformStyle(transformToGraphic((
|
|
98071
|
-
clipInRange: (
|
|
98072
|
-
label:
|
|
98295
|
+
lineStyle: transformStyle(transformToGraphic((_e = this._spec.line) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98296
|
+
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98297
|
+
label: label.map(labelItem => {
|
|
98298
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98299
|
+
}),
|
|
98073
98300
|
state: {
|
|
98074
|
-
line: transformState((
|
|
98075
|
-
lineStartSymbol: transformState((
|
|
98076
|
-
lineEndSymbol: transformState((
|
|
98077
|
-
label:
|
|
98078
|
-
|
|
98301
|
+
line: transformState((_h = (_g = this._spec.line) === null || _g === void 0 ? void 0 : _g.state) !== null && _h !== void 0 ? _h : {}, this._markerData, this._markAttributeContext),
|
|
98302
|
+
lineStartSymbol: transformState((_k = (_j = this._spec.startSymbol) === null || _j === void 0 ? void 0 : _j.state) !== null && _k !== void 0 ? _k : {}, this._markerData, this._markAttributeContext),
|
|
98303
|
+
lineEndSymbol: transformState((_m = (_l = this._spec.endSymbol) === null || _l === void 0 ? void 0 : _l.state) !== null && _m !== void 0 ? _m : {}, this._markerData, this._markAttributeContext),
|
|
98304
|
+
label: label.map(labelItem => {
|
|
98305
|
+
var _a;
|
|
98306
|
+
return transformState((_a = labelItem.state) !== null && _a !== void 0 ? _a : {}, this._markerData, this._markAttributeContext);
|
|
98307
|
+
}),
|
|
98308
|
+
labelBackground: label.map(labelItem => {
|
|
98309
|
+
var _a, _b;
|
|
98310
|
+
return transformState((_b = (_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : {}, this._markerData, this._markAttributeContext);
|
|
98311
|
+
})
|
|
98079
98312
|
},
|
|
98080
|
-
animation: (
|
|
98313
|
+
animation: (_o = this._spec.animation) !== null && _o !== void 0 ? _o : false,
|
|
98081
98314
|
animationEnter: this._spec.animationEnter,
|
|
98082
98315
|
animationExit: this._spec.animationExit,
|
|
98083
98316
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98102,7 +98335,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98102
98335
|
return markLine;
|
|
98103
98336
|
}
|
|
98104
98337
|
_getUpdateMarkerAttrs() {
|
|
98105
|
-
var _a, _b
|
|
98338
|
+
var _a, _b;
|
|
98106
98339
|
const spec = this._spec;
|
|
98107
98340
|
const data = this._markerData;
|
|
98108
98341
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98112,7 +98345,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98112
98345
|
const seriesData = relativeSeries.getViewData().latestData;
|
|
98113
98346
|
const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
98114
98347
|
let limitRect;
|
|
98115
|
-
if (spec.clip || (
|
|
98348
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98116
98349
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98117
98350
|
startRelativeSeries.getRegion(),
|
|
98118
98351
|
endRelativeSeries.getRegion(),
|
|
@@ -98125,10 +98358,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98125
98358
|
height: maxY - minY
|
|
98126
98359
|
};
|
|
98127
98360
|
}
|
|
98128
|
-
const markerComponentAttr = (
|
|
98129
|
-
const
|
|
98130
|
-
|
|
98131
|
-
|
|
98361
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98362
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98363
|
+
const specLabels = array(this._spec.label);
|
|
98364
|
+
const labelAttrs = prevLabelAttrs.map((prevLabel, index) => {
|
|
98365
|
+
const specLabel = specLabels[index] || {};
|
|
98366
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod ? specLabel.formatMethod(dataPoints, seriesData) : prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98367
|
+
});
|
|
98132
98368
|
return Object.assign(Object.assign({}, pointsAttr), { label: labelAttrs, limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY });
|
|
98133
98369
|
}
|
|
98134
98370
|
_markerLayout() {
|
|
@@ -98230,7 +98466,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98230
98466
|
return { points };
|
|
98231
98467
|
}
|
|
98232
98468
|
_markerLayout() {
|
|
98233
|
-
var _a, _b, _c, _d
|
|
98469
|
+
var _a, _b, _c, _d;
|
|
98234
98470
|
const updateAttrs = this._getUpdateMarkerAttrs();
|
|
98235
98471
|
if (this._spec.type === 'type-step') {
|
|
98236
98472
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98257,34 +98493,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98257
98493
|
else {
|
|
98258
98494
|
expandDistanceValue = expandDistance;
|
|
98259
98495
|
}
|
|
98260
|
-
const { points,
|
|
98496
|
+
const { points, limitRect } = updateAttrs;
|
|
98261
98497
|
const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
|
|
98262
98498
|
let labelPositionAttrs;
|
|
98263
98499
|
if (multiSegment && isValid$1(mainSegmentIndex)) {
|
|
98264
98500
|
labelPositionAttrs = {
|
|
98265
98501
|
position: 'middle',
|
|
98266
|
-
autoRotate: false
|
|
98267
|
-
refX: 0,
|
|
98268
|
-
refY: 0
|
|
98502
|
+
autoRotate: false
|
|
98269
98503
|
};
|
|
98270
98504
|
}
|
|
98271
98505
|
else {
|
|
98272
|
-
labelPositionAttrs = Object.assign(
|
|
98273
|
-
}
|
|
98274
|
-
if (isValidNumber$1((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.refX)) {
|
|
98275
|
-
labelPositionAttrs.refX += this._spec.label.refX;
|
|
98276
|
-
}
|
|
98277
|
-
if (isValidNumber$1((_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.refY)) {
|
|
98278
|
-
labelPositionAttrs.refY += this._spec.label.refY;
|
|
98279
|
-
}
|
|
98280
|
-
if (isValidNumber$1((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.dx)) {
|
|
98281
|
-
labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + this._spec.label.dx;
|
|
98282
|
-
}
|
|
98283
|
-
if (isValidNumber$1((_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.dy)) {
|
|
98284
|
-
labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + this._spec.label.dy;
|
|
98506
|
+
labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
|
|
98285
98507
|
}
|
|
98286
|
-
const markerComponentAttr = (
|
|
98287
|
-
|
|
98508
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98509
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98510
|
+
const updateLabels = array(updateAttrs.label);
|
|
98511
|
+
const labelsInSpec = array(this._spec.label);
|
|
98512
|
+
(_c = this._markerComponent) === null || _c === void 0 ? void 0 : _c.setAttributes({
|
|
98288
98513
|
points: multiSegment
|
|
98289
98514
|
? [
|
|
98290
98515
|
[joinPoints[0], joinPoints[1]],
|
|
@@ -98292,7 +98517,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98292
98517
|
[joinPoints[2], joinPoints[3]]
|
|
98293
98518
|
]
|
|
98294
98519
|
: joinPoints,
|
|
98295
|
-
label:
|
|
98520
|
+
label: updateLabels.map((labelItem, index) => {
|
|
98521
|
+
var _a, _b, _c, _d;
|
|
98522
|
+
let refX = 0;
|
|
98523
|
+
let refY = 0;
|
|
98524
|
+
let dx = (_a = labelPositionAttrs.dx) !== null && _a !== void 0 ? _a : 0;
|
|
98525
|
+
let dy = (_b = labelPositionAttrs.dy) !== null && _b !== void 0 ? _b : 0;
|
|
98526
|
+
const labelSpec = (_c = labelsInSpec[index]) !== null && _c !== void 0 ? _c : labelsInSpec[0];
|
|
98527
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refX)) {
|
|
98528
|
+
refX += labelSpec.refX;
|
|
98529
|
+
}
|
|
98530
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.refY)) {
|
|
98531
|
+
refY += labelSpec.refY;
|
|
98532
|
+
}
|
|
98533
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dx)) {
|
|
98534
|
+
dx += labelSpec.dx;
|
|
98535
|
+
}
|
|
98536
|
+
if (isValidNumber$1(labelSpec === null || labelSpec === void 0 ? void 0 : labelSpec.dy)) {
|
|
98537
|
+
dy += labelSpec.dy;
|
|
98538
|
+
}
|
|
98539
|
+
return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { refX,
|
|
98540
|
+
refY,
|
|
98541
|
+
dx,
|
|
98542
|
+
dy, textStyle: Object.assign(Object.assign({}, (_d = prevLabelAttrs[index]) === null || _d === void 0 ? void 0 : _d.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
|
|
98543
|
+
}),
|
|
98296
98544
|
limitRect,
|
|
98297
98545
|
multiSegment,
|
|
98298
98546
|
mainSegmentIndex,
|
|
@@ -98301,7 +98549,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98301
98549
|
});
|
|
98302
98550
|
}
|
|
98303
98551
|
else {
|
|
98304
|
-
(
|
|
98552
|
+
(_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
|
|
98305
98553
|
}
|
|
98306
98554
|
}
|
|
98307
98555
|
_computeOptions() {
|
|
@@ -98365,15 +98613,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98365
98613
|
type: 'markerAggregation',
|
|
98366
98614
|
options
|
|
98367
98615
|
});
|
|
98368
|
-
if (spec.process &&
|
|
98616
|
+
if (spec.process && isValid$1(spec.process.x)) {
|
|
98369
98617
|
options = [this._processSpecByDims([{ dim: 'x', specValue: spec.process.x }])];
|
|
98370
98618
|
needAggr = true;
|
|
98371
98619
|
}
|
|
98372
|
-
if (spec.process &&
|
|
98620
|
+
if (spec.process && isValid$1(spec.process.y)) {
|
|
98373
98621
|
options = options = [this._processSpecByDims([{ dim: 'y', specValue: spec.process.y }])];
|
|
98374
98622
|
needAggr = true;
|
|
98375
98623
|
}
|
|
98376
|
-
if (spec.process &&
|
|
98624
|
+
if (spec.process && isValid$1(spec.process.xy)) {
|
|
98377
98625
|
const { xField, yField } = relativeSeries.getSpec();
|
|
98378
98626
|
options = {
|
|
98379
98627
|
fieldX: xField,
|
|
@@ -98655,8 +98903,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98655
98903
|
return 'cartesian';
|
|
98656
98904
|
}
|
|
98657
98905
|
_createMarkerComponent() {
|
|
98658
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
98659
|
-
const label = (_a = this._spec.label) !== null && _a !== void 0 ? _a : {};
|
|
98906
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
98907
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98660
98908
|
const markAreaAttrs = {
|
|
98661
98909
|
zIndex: this.layoutZIndex,
|
|
98662
98910
|
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
@@ -98678,13 +98926,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98678
98926
|
endAngle: 0,
|
|
98679
98927
|
areaStyle: transformStyle(transformToGraphic((_e = this._spec.area) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98680
98928
|
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98681
|
-
label:
|
|
98929
|
+
label: label.map((labelItem) => {
|
|
98930
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98931
|
+
}),
|
|
98682
98932
|
state: {
|
|
98683
98933
|
area: transformState((_g = this._spec.area) === null || _g === void 0 ? void 0 : _g.state, this._markerData, this._markAttributeContext),
|
|
98684
|
-
label:
|
|
98685
|
-
|
|
98934
|
+
label: label.map((labelItem) => {
|
|
98935
|
+
return transformState(labelItem.state, this._markerData, this._markAttributeContext);
|
|
98936
|
+
}),
|
|
98937
|
+
labelBackground: label.map((labelItem) => {
|
|
98938
|
+
var _a;
|
|
98939
|
+
return transformState((_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state, this._markerData, this._markAttributeContext);
|
|
98940
|
+
})
|
|
98686
98941
|
},
|
|
98687
|
-
animation: (
|
|
98942
|
+
animation: (_h = this._spec.animation) !== null && _h !== void 0 ? _h : false,
|
|
98688
98943
|
animationEnter: this._spec.animationEnter,
|
|
98689
98944
|
animationExit: this._spec.animationExit,
|
|
98690
98945
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98693,7 +98948,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98693
98948
|
return markArea;
|
|
98694
98949
|
}
|
|
98695
98950
|
_markerLayout() {
|
|
98696
|
-
var _a
|
|
98951
|
+
var _a;
|
|
98697
98952
|
const spec = this._spec;
|
|
98698
98953
|
const data = this._markerData;
|
|
98699
98954
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98707,7 +98962,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98707
98962
|
: data.latestData
|
|
98708
98963
|
: seriesData;
|
|
98709
98964
|
let limitRect;
|
|
98710
|
-
if (spec.clip || (
|
|
98965
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98711
98966
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98712
98967
|
startRelativeSeries.getRegion(),
|
|
98713
98968
|
endRelativeSeries.getRegion(),
|
|
@@ -98721,10 +98976,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98721
98976
|
};
|
|
98722
98977
|
}
|
|
98723
98978
|
if (this._markerComponent) {
|
|
98724
|
-
|
|
98725
|
-
|
|
98726
|
-
|
|
98727
|
-
|
|
98979
|
+
const prevLabelAttrs = array((_a = this._markerComponent.attribute) === null || _a === void 0 ? void 0 : _a.label);
|
|
98980
|
+
const specLabels = array(this._spec.label);
|
|
98981
|
+
this._markerComponent.setAttributes(Object.assign(Object.assign({}, pointsAttr), { label: prevLabelAttrs.map((prevLabel, index) => {
|
|
98982
|
+
const specLabel = specLabels[index] || {};
|
|
98983
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod
|
|
98984
|
+
?
|
|
98985
|
+
specLabel.formatMethod(dataPoints, seriesData)
|
|
98986
|
+
: prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98987
|
+
}), limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY }));
|
|
98728
98988
|
}
|
|
98729
98989
|
}
|
|
98730
98990
|
_initDataView() {
|
|
@@ -99953,9 +100213,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99953
100213
|
const spec = this._spec;
|
|
99954
100214
|
const data = this._markerData;
|
|
99955
100215
|
const relativeSeries = this._relativeSeries;
|
|
99956
|
-
const isXYLayout =
|
|
99957
|
-
const isCoordinateLayout =
|
|
99958
|
-
const isPositionLayout =
|
|
100216
|
+
const isXYLayout = isValid$1(spec.x) && isValid$1(spec.y);
|
|
100217
|
+
const isCoordinateLayout = isValid$1(spec.coordinate);
|
|
100218
|
+
const isPositionLayout = isValid$1(spec.position);
|
|
99959
100219
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
99960
100220
|
let point;
|
|
99961
100221
|
if (isXYLayout) {
|
|
@@ -100078,7 +100338,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100078
100338
|
this._outOfBrushElementsMap = {};
|
|
100079
100339
|
this._linkedInBrushElementsMap = {};
|
|
100080
100340
|
this._linkedOutOfBrushElementsMap = {};
|
|
100081
|
-
this._needInitOutState = true;
|
|
100082
100341
|
this._cacheInteractiveRangeAttrs = [];
|
|
100083
100342
|
this._needDisablePickable = false;
|
|
100084
100343
|
this._releatedAxes = [];
|
|
@@ -100086,6 +100345,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100086
100345
|
this._axisDataZoomMap = {};
|
|
100087
100346
|
this._zoomRecord = [];
|
|
100088
100347
|
}
|
|
100348
|
+
static getSpecInfo(chartSpec) {
|
|
100349
|
+
return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
|
|
100350
|
+
return s.visible !== false;
|
|
100351
|
+
});
|
|
100352
|
+
}
|
|
100089
100353
|
init() {
|
|
100090
100354
|
const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
|
|
100091
100355
|
const outOfBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.outOfBrush);
|
|
@@ -100098,9 +100362,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100098
100362
|
});
|
|
100099
100363
|
});
|
|
100100
100364
|
}
|
|
100101
|
-
|
|
100102
|
-
|
|
100103
|
-
|
|
100365
|
+
_initNeedOperatedItem() {
|
|
100366
|
+
const seriesUserId = this._spec.seriesId;
|
|
100367
|
+
const seriesIndex = this._spec.seriesIndex;
|
|
100368
|
+
this._relativeRegions.forEach(r => {
|
|
100369
|
+
const allMarks = [];
|
|
100370
|
+
r.getSeries().forEach((s) => {
|
|
100371
|
+
if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
|
|
100372
|
+
(seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
|
|
100373
|
+
(!seriesIndex && !seriesUserId)) {
|
|
100374
|
+
allMarks.push(...s.getMarksWithoutRoot());
|
|
100375
|
+
}
|
|
100376
|
+
this._itemMap[r.id] = allMarks;
|
|
100377
|
+
});
|
|
100378
|
+
});
|
|
100379
|
+
this._linkedSeries.forEach(s => {
|
|
100380
|
+
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
100104
100381
|
});
|
|
100105
100382
|
}
|
|
100106
100383
|
created() {
|
|
@@ -100112,41 +100389,91 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100112
100389
|
this._initAxisDataZoomMap();
|
|
100113
100390
|
this._initNeedOperatedItem();
|
|
100114
100391
|
}
|
|
100115
|
-
|
|
100116
|
-
|
|
100117
|
-
|
|
100118
|
-
|
|
100119
|
-
|
|
100120
|
-
|
|
100392
|
+
_bindRegions() {
|
|
100393
|
+
if (!isValid$1(this._spec.regionId) && !isValid$1(this._spec.regionIndex)) {
|
|
100394
|
+
this._relativeRegions = this._option.getAllRegions();
|
|
100395
|
+
}
|
|
100396
|
+
else {
|
|
100397
|
+
this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
100398
|
+
}
|
|
100399
|
+
}
|
|
100400
|
+
_bindLinkedSeries() {
|
|
100401
|
+
if (!isValid$1(this._spec.brushLinkSeriesId) && !isValid$1(this._spec.brushLinkSeriesIndex)) {
|
|
100402
|
+
return;
|
|
100403
|
+
}
|
|
100404
|
+
this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
|
|
100405
|
+
}
|
|
100406
|
+
_initRegionAxisMap() {
|
|
100407
|
+
if (isValid$1(this._spec.axisId)) {
|
|
100408
|
+
array(this._spec.axisId).forEach((axisId) => {
|
|
100409
|
+
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
100410
|
+
});
|
|
100411
|
+
}
|
|
100412
|
+
else if (isValid$1(this._spec.axisIndex)) {
|
|
100413
|
+
array(this._spec.axisIndex).forEach((axisIndex) => {
|
|
100414
|
+
this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
|
|
100415
|
+
});
|
|
100416
|
+
}
|
|
100417
|
+
else {
|
|
100418
|
+
this._releatedAxes = this._option.getComponentsByKey('axes');
|
|
100419
|
+
}
|
|
100420
|
+
this._releatedAxes.forEach((axis) => {
|
|
100421
|
+
axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
|
|
100422
|
+
if (this._regionAxisMap['region_' + region.id]) {
|
|
100423
|
+
this._regionAxisMap['region_' + region.id].push(axis);
|
|
100424
|
+
}
|
|
100425
|
+
else {
|
|
100426
|
+
this._regionAxisMap['region_' + region.id] = [axis];
|
|
100427
|
+
}
|
|
100428
|
+
});
|
|
100429
|
+
});
|
|
100430
|
+
}
|
|
100431
|
+
_initAxisDataZoomMap() {
|
|
100432
|
+
this._option.getComponentsByKey('dataZoom').forEach((dz) => {
|
|
100433
|
+
if (dz.relatedAxisComponent) {
|
|
100434
|
+
this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
|
|
100121
100435
|
}
|
|
100436
|
+
});
|
|
100437
|
+
}
|
|
100438
|
+
initEvent() {
|
|
100439
|
+
}
|
|
100440
|
+
onRender(ctx) {
|
|
100441
|
+
}
|
|
100442
|
+
changeRegions(regions) {
|
|
100443
|
+
}
|
|
100444
|
+
_compareSpec(spec, prevSpec) {
|
|
100445
|
+
if (this._brushComponents) {
|
|
100446
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100447
|
+
this._updateBrushComponent(region, index);
|
|
100448
|
+
});
|
|
100122
100449
|
}
|
|
100123
|
-
|
|
100450
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
100451
|
+
if (!isEqual(prevSpec, spec)) {
|
|
100452
|
+
result.reRender = true;
|
|
100453
|
+
result.reMake = true;
|
|
100454
|
+
}
|
|
100455
|
+
return result;
|
|
100124
100456
|
}
|
|
100125
|
-
|
|
100457
|
+
onLayoutEnd(ctx) {
|
|
100126
100458
|
var _a;
|
|
100127
|
-
|
|
100128
|
-
|
|
100129
|
-
|
|
100459
|
+
super.onLayoutEnd(ctx);
|
|
100460
|
+
if (this._option.disableTriggerEvent) {
|
|
100461
|
+
return;
|
|
100462
|
+
}
|
|
100463
|
+
const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
100464
|
+
if (brushVisible) {
|
|
100465
|
+
if (!this._brushComponents) {
|
|
100466
|
+
this._brushComponents = [];
|
|
100467
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100468
|
+
this._createBrushComponent(region, index);
|
|
100469
|
+
});
|
|
100470
|
+
}
|
|
100471
|
+
else {
|
|
100472
|
+
this._relativeRegions.forEach((region, index) => {
|
|
100473
|
+
this._updateBrushComponent(region, index);
|
|
100474
|
+
});
|
|
100475
|
+
}
|
|
100130
100476
|
}
|
|
100131
|
-
return data;
|
|
100132
|
-
}
|
|
100133
|
-
_getBrushInteractiveAttr(region) {
|
|
100134
|
-
const regionLayoutPosition = region.getLayoutStartPoint();
|
|
100135
|
-
const regionLayoutRect = region.getLayoutRect();
|
|
100136
|
-
const seriesRegionStartX = regionLayoutPosition.x;
|
|
100137
|
-
const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
|
|
100138
|
-
const seriesRegionStartY = regionLayoutPosition.y;
|
|
100139
|
-
const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
100140
|
-
return {
|
|
100141
|
-
interactiveRange: {
|
|
100142
|
-
minY: seriesRegionStartY,
|
|
100143
|
-
maxY: seriesRegionEndY,
|
|
100144
|
-
minX: seriesRegionStartX,
|
|
100145
|
-
maxX: seriesRegionEndX
|
|
100146
|
-
},
|
|
100147
|
-
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
100148
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
100149
|
-
};
|
|
100150
100477
|
}
|
|
100151
100478
|
_updateBrushComponent(region, componentIndex) {
|
|
100152
100479
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -100154,7 +100481,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100154
100481
|
brushComponent.setAttributes(interactiveAttr);
|
|
100155
100482
|
this._initMarkBrushState(componentIndex, '');
|
|
100156
100483
|
brushComponent.children[0].removeAllChild();
|
|
100157
|
-
this._needInitOutState = true;
|
|
100158
100484
|
}
|
|
100159
100485
|
_createBrushComponent(region, componentIndex) {
|
|
100160
100486
|
var _a, _b;
|
|
@@ -100162,9 +100488,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100162
100488
|
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 }));
|
|
100163
100489
|
brush.id = (_b = this._spec.id) !== null && _b !== void 0 ? _b : `brush-${this.id}`;
|
|
100164
100490
|
this.getContainer().add(brush);
|
|
100165
|
-
const { brushMode = 'single' } = this._spec;
|
|
100166
100491
|
this._brushComponents.push(brush);
|
|
100167
100492
|
this._cacheInteractiveRangeAttrs.push(interactiveAttr);
|
|
100493
|
+
brush.addEventListener(IOperateType.brushActive, (e) => {
|
|
100494
|
+
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
100495
|
+
this._emitEvent(ChartEvent.brushActive, region);
|
|
100496
|
+
});
|
|
100168
100497
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
100169
100498
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100170
100499
|
});
|
|
@@ -100172,41 +100501,45 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100172
100501
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100173
100502
|
});
|
|
100174
100503
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
100175
|
-
if (this._needInitOutState && brushMode === 'single') {
|
|
100176
|
-
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
100177
|
-
}
|
|
100178
|
-
this._needInitOutState = false;
|
|
100179
100504
|
this._needDisablePickable = true;
|
|
100180
|
-
this._handleBrushChange(
|
|
100505
|
+
this._handleBrushChange(region, e);
|
|
100181
100506
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100182
100507
|
});
|
|
100183
100508
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
100184
|
-
this._handleBrushChange(
|
|
100509
|
+
this._handleBrushChange(region, e);
|
|
100185
100510
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100186
100511
|
});
|
|
100187
100512
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
100188
100513
|
this._initMarkBrushState(componentIndex, '');
|
|
100189
|
-
this._needInitOutState = true;
|
|
100190
100514
|
this._needDisablePickable = false;
|
|
100191
|
-
this._handleBrushChange(ChartEvent.brushChange, region, e);
|
|
100192
|
-
this._handleBrushChange(ChartEvent.brushClear, region, e);
|
|
100193
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
100194
100515
|
this._emitEvent(ChartEvent.brushClear, region);
|
|
100195
100516
|
});
|
|
100196
100517
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
100197
|
-
|
|
100518
|
+
var _a;
|
|
100198
100519
|
this._needDisablePickable = false;
|
|
100199
100520
|
const { operateMask } = e.detail;
|
|
100200
|
-
this.
|
|
100201
|
-
|
|
100202
|
-
|
|
100203
|
-
|
|
100521
|
+
if ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.onBrushEnd) {
|
|
100522
|
+
if (this._spec.onBrushEnd(e) === true) {
|
|
100523
|
+
this.clearGraphic();
|
|
100524
|
+
this._initMarkBrushState(componentIndex, '');
|
|
100525
|
+
this._needDisablePickable = false;
|
|
100526
|
+
this._emitEvent(ChartEvent.brushClear, region);
|
|
100527
|
+
}
|
|
100528
|
+
else {
|
|
100529
|
+
this._spec.onBrushEnd(e);
|
|
100530
|
+
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100531
|
+
}
|
|
100532
|
+
}
|
|
100533
|
+
else {
|
|
100534
|
+
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
100535
|
+
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
100536
|
+
this._setAxisAndDataZoom(operateMask, region);
|
|
100537
|
+
}
|
|
100538
|
+
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100204
100539
|
}
|
|
100205
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100206
100540
|
});
|
|
100207
100541
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
100208
100542
|
const { operateMask } = e.detail;
|
|
100209
|
-
this._handleBrushChange(ChartEvent.brushEnd, region, e);
|
|
100210
100543
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
100211
100544
|
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
100212
100545
|
this._setAxisAndDataZoom(operateMask, region);
|
|
@@ -100214,12 +100547,65 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100214
100547
|
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100215
100548
|
});
|
|
100216
100549
|
}
|
|
100217
|
-
|
|
100550
|
+
_getBrushInteractiveAttr(region) {
|
|
100551
|
+
const regionLayoutPosition = region.getLayoutStartPoint();
|
|
100552
|
+
const regionLayoutRect = region.getLayoutRect();
|
|
100553
|
+
const seriesRegionStartX = regionLayoutPosition.x;
|
|
100554
|
+
const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
|
|
100555
|
+
const seriesRegionStartY = regionLayoutPosition.y;
|
|
100556
|
+
const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
100557
|
+
return {
|
|
100558
|
+
interactiveRange: {
|
|
100559
|
+
minY: seriesRegionStartY,
|
|
100560
|
+
maxY: seriesRegionEndY,
|
|
100561
|
+
minX: seriesRegionStartX,
|
|
100562
|
+
maxX: seriesRegionEndX
|
|
100563
|
+
},
|
|
100564
|
+
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
100565
|
+
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
100566
|
+
};
|
|
100567
|
+
}
|
|
100568
|
+
_transformBrushedMarkAttr(brushedStyle) {
|
|
100569
|
+
const styleResult = {};
|
|
100570
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
|
|
100571
|
+
styleResult.symbolType = brushedStyle.symbol;
|
|
100572
|
+
}
|
|
100573
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
|
|
100574
|
+
styleResult.size = brushedStyle.symbolSize;
|
|
100575
|
+
}
|
|
100576
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
|
|
100577
|
+
styleResult.fill = brushedStyle.color;
|
|
100578
|
+
}
|
|
100579
|
+
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
|
|
100580
|
+
styleResult.fillOpacity = brushedStyle.colorAlpha;
|
|
100581
|
+
}
|
|
100582
|
+
return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
|
|
100583
|
+
}
|
|
100584
|
+
_handleBrushChange(region, e) {
|
|
100218
100585
|
const { operateMask } = e.detail;
|
|
100219
100586
|
this._reconfigItem(operateMask, region);
|
|
100220
100587
|
this._reconfigLinkedItem(operateMask, region);
|
|
100221
100588
|
}
|
|
100589
|
+
_extendDataInBrush(elementsMap) {
|
|
100590
|
+
var _a, _b;
|
|
100591
|
+
const data = [];
|
|
100592
|
+
for (const brushName in elementsMap) {
|
|
100593
|
+
for (const elementKey in elementsMap[brushName]) {
|
|
100594
|
+
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]));
|
|
100595
|
+
}
|
|
100596
|
+
}
|
|
100597
|
+
return data;
|
|
100598
|
+
}
|
|
100599
|
+
_extendDatumOutOfBrush(elementsMap) {
|
|
100600
|
+
var _a;
|
|
100601
|
+
const data = [];
|
|
100602
|
+
for (const elementKey in elementsMap) {
|
|
100603
|
+
data.push((_a = elementsMap[elementKey].data) === null || _a === void 0 ? void 0 : _a[0]);
|
|
100604
|
+
}
|
|
100605
|
+
return data;
|
|
100606
|
+
}
|
|
100222
100607
|
_emitEvent(eventType, region) {
|
|
100608
|
+
var _a;
|
|
100223
100609
|
this.event.emit(eventType, {
|
|
100224
100610
|
model: this,
|
|
100225
100611
|
value: {
|
|
@@ -100234,27 +100620,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100234
100620
|
linkedInBrushElementsMap: this._linkedInBrushElementsMap,
|
|
100235
100621
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
100236
100622
|
zoomRecord: this._zoomRecord
|
|
100237
|
-
}
|
|
100623
|
+
},
|
|
100624
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
100238
100625
|
});
|
|
100239
100626
|
}
|
|
100240
|
-
_transformBrushedMarkAttr(brushedStyle) {
|
|
100241
|
-
const styleResult = {};
|
|
100242
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
|
|
100243
|
-
styleResult.symbolType = brushedStyle.symbol;
|
|
100244
|
-
}
|
|
100245
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
|
|
100246
|
-
styleResult.size = brushedStyle.symbolSize;
|
|
100247
|
-
}
|
|
100248
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
|
|
100249
|
-
styleResult.fill = brushedStyle.color;
|
|
100250
|
-
}
|
|
100251
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
|
|
100252
|
-
styleResult.fillOpacity = brushedStyle.colorAlpha;
|
|
100253
|
-
}
|
|
100254
|
-
return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
|
|
100255
|
-
}
|
|
100256
100627
|
_reconfigItem(operateMask, region) {
|
|
100628
|
+
var _a, _b, _c;
|
|
100629
|
+
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)) {
|
|
100630
|
+
return;
|
|
100631
|
+
}
|
|
100632
|
+
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 : [];
|
|
100633
|
+
const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
|
|
100634
|
+
const pointsCoord = points.map((p) => {
|
|
100635
|
+
return {
|
|
100636
|
+
x: a * p.x + c * p.y + e,
|
|
100637
|
+
y: b * p.x + d * p.y + f
|
|
100638
|
+
};
|
|
100639
|
+
});
|
|
100640
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100257
100641
|
this._itemMap[region.id].forEach((mark) => {
|
|
100642
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100643
|
+
return;
|
|
100644
|
+
}
|
|
100258
100645
|
const grammarMark = mark.getProduct();
|
|
100259
100646
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100260
100647
|
return;
|
|
@@ -100264,7 +100651,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100264
100651
|
var _a, _b, _c;
|
|
100265
100652
|
const graphicItem = el.getGraphicItem();
|
|
100266
100653
|
const elementKey = mark.id + '_' + el.key;
|
|
100267
|
-
|
|
100654
|
+
const isBrushContainItem = this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem);
|
|
100655
|
+
if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && isBrushContainItem) {
|
|
100268
100656
|
el.addState(IN_BRUSH_STATE);
|
|
100269
100657
|
if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100270
100658
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100272,8 +100660,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100272
100660
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name][elementKey] = el;
|
|
100273
100661
|
delete this._outOfBrushElementsMap[elementKey];
|
|
100274
100662
|
}
|
|
100275
|
-
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]) &&
|
|
100276
|
-
!this._isBrushContainItem(operateMask, graphicItem)) {
|
|
100663
|
+
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) {
|
|
100277
100664
|
el.removeState(IN_BRUSH_STATE);
|
|
100278
100665
|
el.addState(OUT_BRUSH_STATE);
|
|
100279
100666
|
this._outOfBrushElementsMap[elementKey] = el;
|
|
@@ -100284,14 +100671,36 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100284
100671
|
});
|
|
100285
100672
|
}
|
|
100286
100673
|
_reconfigLinkedItem(operateMask, region) {
|
|
100674
|
+
var _a;
|
|
100675
|
+
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)) {
|
|
100676
|
+
return;
|
|
100677
|
+
}
|
|
100287
100678
|
const regionLayoutPos = region.getLayoutStartPoint();
|
|
100288
100679
|
const seriesId = region.getSeries().map(s => s.id);
|
|
100289
100680
|
this._linkedSeries.forEach((s) => {
|
|
100681
|
+
var _a, _b;
|
|
100290
100682
|
if (!seriesId.includes(s.id)) {
|
|
100291
100683
|
const sRegionLayoutPos = s.getRegion().getLayoutStartPoint();
|
|
100292
100684
|
const regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x;
|
|
100293
100685
|
const regionOffsetY = sRegionLayoutPos.y - regionLayoutPos.y;
|
|
100686
|
+
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 : [];
|
|
100687
|
+
const { a, b, c, d, e, f } = operateMask.globalTransMatrix;
|
|
100688
|
+
const dx = regionOffsetX || 0;
|
|
100689
|
+
const dy = regionOffsetY || 0;
|
|
100690
|
+
const pointsCoord = points.map((p) => {
|
|
100691
|
+
return {
|
|
100692
|
+
x: a * p.x + c * p.y + e + dx,
|
|
100693
|
+
y: b * p.x + d * p.y + f + dy
|
|
100694
|
+
};
|
|
100695
|
+
});
|
|
100696
|
+
operateMask.globalAABBBounds
|
|
100697
|
+
.clone()
|
|
100698
|
+
.set(operateMask.globalAABBBounds.x1 + dx, operateMask.globalAABBBounds.y1 + dy, operateMask.globalAABBBounds.x2 + dx, operateMask.globalAABBBounds.y2 + dy);
|
|
100699
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100294
100700
|
this._linkedItemMap[s.id].forEach((mark) => {
|
|
100701
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100702
|
+
return;
|
|
100703
|
+
}
|
|
100295
100704
|
const grammarMark = mark.getProduct();
|
|
100296
100705
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100297
100706
|
return;
|
|
@@ -100302,7 +100711,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100302
100711
|
const graphicItem = el.getGraphicItem();
|
|
100303
100712
|
const elementKey = mark.id + '_' + el.key;
|
|
100304
100713
|
if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
|
|
100305
|
-
this._isBrushContainItem(operateMask,
|
|
100714
|
+
this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100306
100715
|
el.addState(IN_BRUSH_STATE);
|
|
100307
100716
|
if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100308
100717
|
this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100311,7 +100720,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100311
100720
|
delete this._linkedOutOfBrushElementsMap[elementKey];
|
|
100312
100721
|
}
|
|
100313
100722
|
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]) &&
|
|
100314
|
-
!this._isBrushContainItem(operateMask,
|
|
100723
|
+
!this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100315
100724
|
el.removeState(IN_BRUSH_STATE);
|
|
100316
100725
|
el.addState(OUT_BRUSH_STATE);
|
|
100317
100726
|
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
@@ -100322,75 +100731,81 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100322
100731
|
}
|
|
100323
100732
|
});
|
|
100324
100733
|
}
|
|
100325
|
-
_isBrushContainItem(
|
|
100326
|
-
var _a, _b, _c;
|
|
100327
|
-
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)) {
|
|
100328
|
-
return false;
|
|
100329
|
-
}
|
|
100330
|
-
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 : [];
|
|
100331
|
-
const { a, b, c, d, e, f } = brushMask.globalTransMatrix;
|
|
100332
|
-
const dx = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dx) || 0;
|
|
100333
|
-
const dy = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dy) || 0;
|
|
100334
|
-
const pointsCoord = points.map((p) => {
|
|
100335
|
-
return {
|
|
100336
|
-
x: a * p.x + c * p.y + e + dx,
|
|
100337
|
-
y: b * p.x + d * p.y + f + dy
|
|
100338
|
-
};
|
|
100339
|
-
});
|
|
100340
|
-
brushMask.globalAABBBounds
|
|
100341
|
-
.clone()
|
|
100342
|
-
.set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
100343
|
-
const x = item.globalTransMatrix.e;
|
|
100344
|
-
const y = item.globalTransMatrix.f;
|
|
100734
|
+
_isBrushContainItem(brushMaskAABBBounds, brushMaskPointsCoord, item) {
|
|
100345
100735
|
let itemBounds = [];
|
|
100346
|
-
if (item.type
|
|
100347
|
-
const {
|
|
100348
|
-
const size = array(itemSize)[0] / 2;
|
|
100736
|
+
if (['symbol', 'rect'].includes(item.type)) {
|
|
100737
|
+
const { x1, x2, y1, y2 } = item === null || item === void 0 ? void 0 : item.globalAABBBounds;
|
|
100349
100738
|
itemBounds = [
|
|
100350
100739
|
{
|
|
100351
|
-
x:
|
|
100352
|
-
y:
|
|
100740
|
+
x: x1,
|
|
100741
|
+
y: y1
|
|
100353
100742
|
},
|
|
100354
100743
|
{
|
|
100355
|
-
x:
|
|
100356
|
-
y:
|
|
100744
|
+
x: x2,
|
|
100745
|
+
y: y1
|
|
100357
100746
|
},
|
|
100358
100747
|
{
|
|
100359
|
-
x:
|
|
100360
|
-
y:
|
|
100748
|
+
x: x2,
|
|
100749
|
+
y: y2
|
|
100361
100750
|
},
|
|
100362
100751
|
{
|
|
100363
|
-
x:
|
|
100364
|
-
y:
|
|
100752
|
+
x: x1,
|
|
100753
|
+
y: y2
|
|
100365
100754
|
}
|
|
100366
100755
|
];
|
|
100367
|
-
return polygonIntersectPolygon(
|
|
100756
|
+
return polygonIntersectPolygon(brushMaskPointsCoord, itemBounds);
|
|
100368
100757
|
}
|
|
100369
|
-
|
|
100370
|
-
|
|
100371
|
-
|
|
100372
|
-
|
|
100373
|
-
|
|
100374
|
-
|
|
100375
|
-
|
|
100376
|
-
|
|
100377
|
-
|
|
100378
|
-
|
|
100379
|
-
|
|
100380
|
-
|
|
100381
|
-
|
|
100382
|
-
|
|
100383
|
-
|
|
100384
|
-
|
|
100385
|
-
|
|
100386
|
-
{
|
|
100387
|
-
x: x,
|
|
100388
|
-
y: y + height
|
|
100758
|
+
return brushMaskAABBBounds.intersects(item.globalAABBBounds);
|
|
100759
|
+
}
|
|
100760
|
+
_initMarkBrushState(componentIndex, stateName) {
|
|
100761
|
+
this._brushComponents.forEach((brush, index) => {
|
|
100762
|
+
if (index !== componentIndex) {
|
|
100763
|
+
brush.children[0].removeAllChild();
|
|
100764
|
+
}
|
|
100765
|
+
});
|
|
100766
|
+
this._inBrushElementsMap = {};
|
|
100767
|
+
this._outOfBrushElementsMap = {};
|
|
100768
|
+
this._linkedInBrushElementsMap = {};
|
|
100769
|
+
this._linkedOutOfBrushElementsMap = {};
|
|
100770
|
+
const { markTypeFilter = [] } = this._spec;
|
|
100771
|
+
Object.entries(this._itemMap).forEach(([regionId, marks]) => {
|
|
100772
|
+
marks.forEach((mark) => {
|
|
100773
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100774
|
+
return;
|
|
100389
100775
|
}
|
|
100390
|
-
|
|
100391
|
-
|
|
100392
|
-
|
|
100393
|
-
|
|
100776
|
+
const grammarMark = mark.getProduct();
|
|
100777
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100778
|
+
return;
|
|
100779
|
+
}
|
|
100780
|
+
const elements = grammarMark.elements;
|
|
100781
|
+
elements.forEach((el) => {
|
|
100782
|
+
const elementKey = mark.id + '_' + el.key;
|
|
100783
|
+
el.removeState(IN_BRUSH_STATE);
|
|
100784
|
+
el.removeState(OUT_BRUSH_STATE);
|
|
100785
|
+
el.addState(stateName);
|
|
100786
|
+
this._outOfBrushElementsMap[elementKey] = el;
|
|
100787
|
+
});
|
|
100788
|
+
});
|
|
100789
|
+
});
|
|
100790
|
+
Object.entries(this._linkedItemMap).forEach(([seriesId, marks]) => {
|
|
100791
|
+
marks.forEach((mark) => {
|
|
100792
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100793
|
+
return;
|
|
100794
|
+
}
|
|
100795
|
+
const grammarMark = mark.getProduct();
|
|
100796
|
+
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100797
|
+
return;
|
|
100798
|
+
}
|
|
100799
|
+
const elements = grammarMark.elements;
|
|
100800
|
+
elements.forEach((el) => {
|
|
100801
|
+
const elementKey = mark.id + '_' + el.key;
|
|
100802
|
+
el.removeState(IN_BRUSH_STATE);
|
|
100803
|
+
el.removeState(OUT_BRUSH_STATE);
|
|
100804
|
+
el.addState(stateName);
|
|
100805
|
+
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
100806
|
+
});
|
|
100807
|
+
});
|
|
100808
|
+
});
|
|
100394
100809
|
}
|
|
100395
100810
|
_stateClamp(state) {
|
|
100396
100811
|
return Math.min(Math.max(0, state), 1);
|
|
@@ -100456,139 +100871,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100456
100871
|
});
|
|
100457
100872
|
}
|
|
100458
100873
|
}
|
|
100459
|
-
_bindRegions() {
|
|
100460
|
-
if (isValid$1(this._spec.regionId) && isValid$1(this._spec.regionIndex)) {
|
|
100461
|
-
this._relativeRegions = this._option.getAllRegions();
|
|
100462
|
-
}
|
|
100463
|
-
this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
100464
|
-
}
|
|
100465
|
-
_bindLinkedSeries() {
|
|
100466
|
-
if (isValid$1(this._spec.brushLinkSeriesId) && isValid$1(this._spec.brushLinkSeriesIndex)) {
|
|
100467
|
-
return;
|
|
100468
|
-
}
|
|
100469
|
-
this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
|
|
100470
|
-
}
|
|
100471
|
-
_initRegionAxisMap() {
|
|
100472
|
-
if (isValid$1(this._spec.axisId)) {
|
|
100473
|
-
array(this._spec.axisId).forEach((axisId) => {
|
|
100474
|
-
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
100475
|
-
});
|
|
100476
|
-
}
|
|
100477
|
-
else if (isValid$1(this._spec.axisIndex)) {
|
|
100478
|
-
array(this._spec.axisIndex).forEach((axisIndex) => {
|
|
100479
|
-
this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
|
|
100480
|
-
});
|
|
100481
|
-
}
|
|
100482
|
-
else {
|
|
100483
|
-
this._releatedAxes = this._option.getComponentsByKey('axes');
|
|
100484
|
-
}
|
|
100485
|
-
this._releatedAxes.forEach((axis) => {
|
|
100486
|
-
axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
|
|
100487
|
-
if (this._regionAxisMap['region_' + region.id]) {
|
|
100488
|
-
this._regionAxisMap['region_' + region.id].push(axis);
|
|
100489
|
-
}
|
|
100490
|
-
else {
|
|
100491
|
-
this._regionAxisMap['region_' + region.id] = [axis];
|
|
100492
|
-
}
|
|
100493
|
-
});
|
|
100494
|
-
});
|
|
100495
|
-
}
|
|
100496
|
-
_initAxisDataZoomMap() {
|
|
100497
|
-
this._option.getComponentsByKey('dataZoom').forEach((dz) => {
|
|
100498
|
-
if (dz.relatedAxisComponent) {
|
|
100499
|
-
this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
|
|
100500
|
-
}
|
|
100501
|
-
});
|
|
100502
|
-
}
|
|
100503
|
-
_initNeedOperatedItem() {
|
|
100504
|
-
const seriesUserId = this._spec.seriesId;
|
|
100505
|
-
const seriesIndex = this._spec.seriesIndex;
|
|
100506
|
-
this._relativeRegions.forEach(r => {
|
|
100507
|
-
const allMarks = [];
|
|
100508
|
-
r.getSeries().forEach((s) => {
|
|
100509
|
-
if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
|
|
100510
|
-
(seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
|
|
100511
|
-
(!seriesIndex && !seriesUserId)) {
|
|
100512
|
-
allMarks.push(...s.getMarksWithoutRoot());
|
|
100513
|
-
}
|
|
100514
|
-
this._itemMap[r.id] = allMarks;
|
|
100515
|
-
});
|
|
100516
|
-
});
|
|
100517
|
-
this._linkedSeries.forEach(s => {
|
|
100518
|
-
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
100519
|
-
});
|
|
100520
|
-
}
|
|
100521
|
-
_initMarkBrushState(componentIndex, stateName) {
|
|
100522
|
-
this._brushComponents.forEach((brush, index) => {
|
|
100523
|
-
if (index !== componentIndex) {
|
|
100524
|
-
brush.children[0].removeAllChild();
|
|
100525
|
-
}
|
|
100526
|
-
});
|
|
100527
|
-
this._inBrushElementsMap = {};
|
|
100528
|
-
this._outOfBrushElementsMap = {};
|
|
100529
|
-
this._linkedInBrushElementsMap = {};
|
|
100530
|
-
this._linkedOutOfBrushElementsMap = {};
|
|
100531
|
-
this._option.getAllSeries().forEach((s) => {
|
|
100532
|
-
s.getMarksWithoutRoot().forEach((mark) => {
|
|
100533
|
-
const grammarMark = mark.getProduct();
|
|
100534
|
-
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100535
|
-
return;
|
|
100536
|
-
}
|
|
100537
|
-
const elements = grammarMark.elements;
|
|
100538
|
-
elements.forEach((el) => {
|
|
100539
|
-
const elementKey = mark.id + '_' + el.key;
|
|
100540
|
-
el.removeState(IN_BRUSH_STATE);
|
|
100541
|
-
el.removeState(OUT_BRUSH_STATE);
|
|
100542
|
-
el.addState(stateName);
|
|
100543
|
-
this._outOfBrushElementsMap[elementKey] = el;
|
|
100544
|
-
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
100545
|
-
});
|
|
100546
|
-
});
|
|
100547
|
-
});
|
|
100548
|
-
}
|
|
100549
|
-
initEvent() {
|
|
100550
|
-
}
|
|
100551
|
-
onRender(ctx) {
|
|
100552
|
-
}
|
|
100553
|
-
changeRegions(regions) {
|
|
100554
|
-
}
|
|
100555
100874
|
_getNeedClearVRenderComponents() {
|
|
100556
100875
|
return this._brushComponents;
|
|
100557
100876
|
}
|
|
100558
|
-
_compareSpec(spec, prevSpec) {
|
|
100559
|
-
if (this._brushComponents) {
|
|
100560
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100561
|
-
this._updateBrushComponent(region, index);
|
|
100562
|
-
});
|
|
100563
|
-
}
|
|
100564
|
-
const result = super._compareSpec(spec, prevSpec);
|
|
100565
|
-
if (!isEqual(prevSpec, spec)) {
|
|
100566
|
-
result.reRender = true;
|
|
100567
|
-
result.reMake = true;
|
|
100568
|
-
}
|
|
100569
|
-
return result;
|
|
100570
|
-
}
|
|
100571
|
-
onLayoutEnd(ctx) {
|
|
100572
|
-
var _a;
|
|
100573
|
-
super.onLayoutEnd(ctx);
|
|
100574
|
-
if (this._option.disableTriggerEvent) {
|
|
100575
|
-
return;
|
|
100576
|
-
}
|
|
100577
|
-
const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
100578
|
-
if (brushVisible) {
|
|
100579
|
-
if (!this._brushComponents) {
|
|
100580
|
-
this._brushComponents = [];
|
|
100581
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100582
|
-
this._createBrushComponent(region, index);
|
|
100583
|
-
});
|
|
100584
|
-
}
|
|
100585
|
-
else {
|
|
100586
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100587
|
-
this._updateBrushComponent(region, index);
|
|
100588
|
-
});
|
|
100589
|
-
}
|
|
100590
|
-
}
|
|
100591
|
-
}
|
|
100592
100877
|
clearGraphic() {
|
|
100593
100878
|
if (this._brushComponents) {
|
|
100594
100879
|
this._brushComponents.forEach(brush => {
|
|
@@ -100599,7 +100884,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100599
100884
|
clear() {
|
|
100600
100885
|
if (this._brushComponents) {
|
|
100601
100886
|
const container = this.getContainer();
|
|
100602
|
-
this._brushComponents.forEach(brush => {
|
|
100887
|
+
this._brushComponents.forEach((brush, index) => {
|
|
100888
|
+
this._initMarkBrushState(index, '');
|
|
100889
|
+
this._needDisablePickable = false;
|
|
100603
100890
|
brush.removeAllChild();
|
|
100604
100891
|
brush.releaseBrushEvents();
|
|
100605
100892
|
if (container) {
|
|
@@ -102593,16 +102880,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102593
102880
|
}
|
|
102594
102881
|
}
|
|
102595
102882
|
_updateDomStyle(sizeKey = 'width') {
|
|
102596
|
-
var _a, _b, _c, _d;
|
|
102883
|
+
var _a, _b, _c, _d, _e;
|
|
102597
102884
|
const rootDom = this._rootDom;
|
|
102598
102885
|
const contentDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_CONTENT_BOX_CLASS_NAME));
|
|
102886
|
+
const titleDom = [...rootDom.children].find(child => child.className.includes(TOOLTIP_TITLE_CLASS_NAME));
|
|
102599
102887
|
if (contentDom) {
|
|
102600
102888
|
const tooltipSpec = this._component.getSpec();
|
|
102601
102889
|
const contentStyle = {};
|
|
102602
|
-
|
|
102603
|
-
|
|
102890
|
+
const titleLabel = (_a = tooltipSpec.style) === null || _a === void 0 ? void 0 : _a.titleLabel;
|
|
102891
|
+
const autoFixTitleWidth = titleLabel && titleLabel.autoWidth && titleLabel.multiLine !== false;
|
|
102892
|
+
if (autoFixTitleWidth && titleDom) {
|
|
102893
|
+
const maxWidth = [...contentDom.children].reduce((res, col) => {
|
|
102894
|
+
return sizeKey === 'height'
|
|
102895
|
+
? res + col.getBoundingClientRect().width
|
|
102896
|
+
: Math.max(res, col.getBoundingClientRect().width);
|
|
102897
|
+
}, 0);
|
|
102898
|
+
if (maxWidth > 0) {
|
|
102899
|
+
titleDom.style.maxWidth = `${maxWidth}px`;
|
|
102900
|
+
titleDom.style.maxWidth = `${Math.ceil(contentDom.getBoundingClientRect().width)}px`;
|
|
102901
|
+
}
|
|
102902
|
+
}
|
|
102903
|
+
if (isValid$1((_b = tooltipSpec === null || tooltipSpec === void 0 ? void 0 : tooltipSpec.style) === null || _b === void 0 ? void 0 : _b.maxContentHeight)) {
|
|
102604
102904
|
const titleHeight = titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)
|
|
102605
|
-
? titleDom.getBoundingClientRect().height + ((
|
|
102905
|
+
? titleDom.getBoundingClientRect().height + ((_c = tooltipSpec.style.spaceRow) !== null && _c !== void 0 ? _c : 0)
|
|
102606
102906
|
: 0;
|
|
102607
102907
|
const viewRect = this._chartOption.getChartViewRect();
|
|
102608
102908
|
const maxHeight = calcLayoutNumber(tooltipSpec.style.maxContentHeight, Math.min(viewRect.height, document.body.clientHeight) -
|
|
@@ -102620,7 +102920,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102620
102920
|
if (rows) {
|
|
102621
102921
|
for (let i = 0; i < rows.length; i++) {
|
|
102622
102922
|
const row = rows[i];
|
|
102623
|
-
const cols = (
|
|
102923
|
+
const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
|
|
102624
102924
|
for (let j = 0; j < cols.length; j++) {
|
|
102625
102925
|
const width = cols[j].getBoundingClientRect()[sizeKey];
|
|
102626
102926
|
if (widthByCol[j] === undefined || widthByCol[j] < width) {
|
|
@@ -102630,7 +102930,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102630
102930
|
}
|
|
102631
102931
|
for (let i = 0; i < rows.length; i++) {
|
|
102632
102932
|
const row = rows[i];
|
|
102633
|
-
const cols = (
|
|
102933
|
+
const cols = (_e = row.children) !== null && _e !== void 0 ? _e : [];
|
|
102634
102934
|
for (let j = 0; j < cols.length; j++) {
|
|
102635
102935
|
cols[j].style[sizeKey] = `${widthByCol[j]}px`;
|
|
102636
102936
|
}
|
|
@@ -103816,6 +104116,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103816
104116
|
exports.CanvasTooltipHandler = CanvasTooltipHandler;
|
|
103817
104117
|
exports.CartesianAxis = CartesianAxis;
|
|
103818
104118
|
exports.CartesianBandAxis = CartesianBandAxis;
|
|
104119
|
+
exports.CartesianChartSpecTransformer = CartesianChartSpecTransformer;
|
|
103819
104120
|
exports.CartesianCrossHair = CartesianCrossHair;
|
|
103820
104121
|
exports.CartesianLinearAxis = CartesianLinearAxis;
|
|
103821
104122
|
exports.CartesianLogAxis = CartesianLogAxis;
|