@visactor/vchart 1.13.9-alpha.5 → 1.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +1063 -804
- package/build/index.js +1063 -803
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +8 -1
- package/cjs/chart/base/base-chart.js +33 -20
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/index.d.ts +1 -1
- package/cjs/chart/index.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +8 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/pictogram/interface.d.ts +1 -1
- package/cjs/chart/pictogram/interface.js.map +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/cjs/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/cjs/chart/sankey/sankey.js +21 -21
- package/cjs/chart/sankey/sankey.js.map +1 -1
- package/cjs/compile/mark/compilable-mark.d.ts +1 -0
- package/cjs/compile/mark/compilable-mark.js +3 -0
- package/cjs/compile/mark/compilable-mark.js.map +1 -1
- package/cjs/component/axis/base-axis.js +7 -2
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +7 -2
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/brush/brush.d.ts +23 -24
- package/cjs/component/brush/brush.js +183 -182
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +2 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/crosshair/base.js +1 -1
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/utils/cartesian.js +9 -8
- package/cjs/component/crosshair/utils/cartesian.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/cjs/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/base-mark-area.js +27 -17
- package/cjs/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-line/base-mark-line.js +31 -20
- package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/cartesian-mark-line.js +32 -26
- package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js +3 -1
- package/cjs/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/cjs/component/marker/utils.d.ts +12 -0
- package/cjs/component/marker/utils.js +22 -7
- package/cjs/component/marker/utils.js.map +1 -1
- package/cjs/constant/event.d.ts +1 -0
- package/cjs/constant/event.js +6 -6
- package/cjs/constant/event.js.map +1 -1
- package/cjs/constant/funnel.js +2 -1
- package/cjs/constant/sunburst.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +2 -1
- package/cjs/core/vchart.js +1 -2
- package/cjs/data/transforms/pictogram.d.ts +1 -9
- package/cjs/data/transforms/pictogram.js +3 -3
- package/cjs/data/transforms/pictogram.js.map +1 -1
- package/cjs/data/transforms/pie.js +1 -1
- package/cjs/data/transforms/pie.js.map +1 -1
- package/cjs/index-harmony-simple.js.map +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -7
- package/cjs/index.js.map +1 -1
- package/cjs/model/base-model.d.ts +1 -0
- package/cjs/model/base-model.js +6 -0
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/cjs/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/gauge/gauge.js +7 -5
- package/cjs/series/gauge/gauge.js.map +1 -1
- package/cjs/series/pictogram/tooltip-helper.d.ts +2 -2
- package/cjs/series/pictogram/tooltip-helper.js.map +1 -1
- package/cjs/series/pie/pie.js +3 -3
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/polar/progress-like/interface.d.ts +1 -0
- package/cjs/series/polar/progress-like/interface.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +4 -3
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/cjs/series/progress/linear/interface.d.ts +1 -0
- package/cjs/series/progress/linear/interface.js.map +1 -1
- package/cjs/series/progress/linear/linear.js +6 -4
- package/cjs/series/progress/linear/linear.js.map +1 -1
- package/cjs/typings/visual.d.ts +1 -1
- package/cjs/typings/visual.js.map +1 -1
- package/esm/chart/base/base-chart.d.ts +8 -1
- package/esm/chart/base/base-chart.js +33 -20
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/index.d.ts +1 -1
- package/esm/chart/index.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +8 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/pictogram/interface.d.ts +1 -1
- package/esm/chart/pictogram/interface.js.map +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js +1 -1
- package/esm/chart/progress/linear/linear-progress-transformer.js.map +1 -1
- package/esm/chart/sankey/sankey.js +22 -22
- package/esm/chart/sankey/sankey.js.map +1 -1
- package/esm/compile/mark/compilable-mark.d.ts +1 -0
- package/esm/compile/mark/compilable-mark.js +3 -0
- package/esm/compile/mark/compilable-mark.js.map +1 -1
- package/esm/component/axis/base-axis.js +7 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +7 -2
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/brush/brush.d.ts +23 -24
- package/esm/component/brush/brush.js +179 -177
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +2 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/crosshair/base.js +1 -1
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/utils/cartesian.js +9 -8
- package/esm/component/crosshair/utils/cartesian.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/interface.d.ts +2 -3
- package/esm/component/data-zoom/data-zoom/interface.js.map +1 -1
- package/esm/component/marker/mark-area/base-mark-area.js +27 -16
- package/esm/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/esm/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-line/base-mark-line.js +30 -19
- package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/cartesian-mark-line.js +31 -26
- package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js +1 -1
- package/esm/component/marker/mark-point/cartesian-mark-point.js.map +1 -1
- package/esm/component/marker/utils.d.ts +12 -0
- package/esm/component/marker/utils.js +19 -4
- package/esm/component/marker/utils.js.map +1 -1
- package/esm/constant/event.d.ts +1 -0
- package/esm/constant/event.js +6 -6
- package/esm/constant/event.js.map +1 -1
- package/esm/constant/funnel.js +2 -1
- package/esm/constant/sunburst.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +2 -1
- package/esm/core/vchart.js +1 -2
- package/esm/data/transforms/pictogram.d.ts +1 -9
- package/esm/data/transforms/pictogram.js +3 -3
- package/esm/data/transforms/pictogram.js.map +1 -1
- package/esm/data/transforms/pie.js +1 -1
- package/esm/data/transforms/pie.js.map +1 -1
- package/esm/index-harmony-simple.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/esm/model/base-model.d.ts +1 -0
- package/esm/model/base-model.js +6 -0
- package/esm/model/base-model.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js +11 -7
- package/esm/plugin/components/tooltip-handler/dom-tooltip-handler.js.map +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/gauge/gauge.js +6 -4
- package/esm/series/gauge/gauge.js.map +1 -1
- package/esm/series/pictogram/tooltip-helper.d.ts +2 -2
- package/esm/series/pictogram/tooltip-helper.js.map +1 -1
- package/esm/series/pie/pie.js +4 -4
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/polar/progress-like/interface.d.ts +1 -0
- package/esm/series/polar/progress-like/interface.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.js +4 -3
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/series/progress/linear/interface.d.ts +1 -0
- package/esm/series/progress/linear/interface.js.map +1 -1
- package/esm/series/progress/linear/linear.js +6 -4
- package/esm/series/progress/linear/linear.js.map +1 -1
- package/esm/typings/visual.d.ts +1 -1
- package/esm/typings/visual.js.map +1 -1
- package/package.json +18 -18
package/build/index.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;
|
|
@@ -31442,7 +31525,9 @@
|
|
|
31442
31525
|
loadScrollbarComponent();
|
|
31443
31526
|
let ScrollBar$1 = class ScrollBar extends AbstractComponent {
|
|
31444
31527
|
constructor(attributes, options) {
|
|
31445
|
-
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 => {
|
|
31446
31531
|
const {
|
|
31447
31532
|
viewX: viewX,
|
|
31448
31533
|
viewY: viewY
|
|
@@ -31486,8 +31571,7 @@
|
|
|
31486
31571
|
const triggers = getEndTriggersOfDrag(),
|
|
31487
31572
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31488
31573
|
obj.addEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31489
|
-
capture: !0
|
|
31490
|
-
passive: !0
|
|
31574
|
+
capture: !0
|
|
31491
31575
|
}), triggers.forEach(trigger => {
|
|
31492
31576
|
obj.addEventListener(trigger, this._onSliderPointerUp);
|
|
31493
31577
|
});
|
|
@@ -31508,7 +31592,6 @@
|
|
|
31508
31592
|
} = this.getSliderRenderBounds();
|
|
31509
31593
|
return "vertical" === direction ? (currentPos = y, delta = currentPos - this._prePos, currentScrollValue = delta / height) : (currentPos = x, delta = currentPos - this._prePos, currentScrollValue = delta / width), [currentPos, currentScrollValue];
|
|
31510
31594
|
}, this._onSliderPointerMove = e => {
|
|
31511
|
-
e.preventDefault();
|
|
31512
31595
|
const {
|
|
31513
31596
|
stopSliderMovePropagation = !0
|
|
31514
31597
|
} = this.attribute;
|
|
@@ -31524,7 +31607,7 @@
|
|
|
31524
31607
|
preScrollRange = this.getScrollRange(),
|
|
31525
31608
|
[currentPos, currentScrollValue] = this._computeScrollValue(e),
|
|
31526
31609
|
range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
31527
|
-
this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31610
|
+
this._prePos = null, this._dispatchEvent(SCROLLBAR_END_EVENT$1, {
|
|
31528
31611
|
pre: preRange,
|
|
31529
31612
|
value: clampRange$1(range, limitRange[0], limitRange[1])
|
|
31530
31613
|
}), this._clearDragEvents();
|
|
@@ -31566,7 +31649,9 @@
|
|
|
31566
31649
|
delayType = "throttle",
|
|
31567
31650
|
delayTime = 0
|
|
31568
31651
|
} = this.attribute;
|
|
31569
|
-
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
|
+
});
|
|
31570
31655
|
}
|
|
31571
31656
|
render() {
|
|
31572
31657
|
this._reset();
|
|
@@ -31680,8 +31765,7 @@
|
|
|
31680
31765
|
const triggers = getEndTriggersOfDrag(),
|
|
31681
31766
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
31682
31767
|
obj.removeEventListener("pointermove", this._onSliderPointerMoveWithDelay, {
|
|
31683
|
-
capture: !0
|
|
31684
|
-
passive: !1
|
|
31768
|
+
capture: !0
|
|
31685
31769
|
}), triggers.forEach(trigger => {
|
|
31686
31770
|
obj.removeEventListener(trigger, this._onSliderPointerUp);
|
|
31687
31771
|
});
|
|
@@ -31689,6 +31773,11 @@
|
|
|
31689
31773
|
_reset() {
|
|
31690
31774
|
this._sliderRenderBounds = null, this._sliderLimitRange = null;
|
|
31691
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
|
+
}
|
|
31692
31781
|
};
|
|
31693
31782
|
ScrollBar$1.defaultAttributes = {
|
|
31694
31783
|
direction: "horizontal",
|
|
@@ -32407,6 +32496,7 @@
|
|
|
32407
32496
|
contentStyle = {},
|
|
32408
32497
|
panel: panel,
|
|
32409
32498
|
logoSymbol: logoSymbol,
|
|
32499
|
+
poptipAnchor = "position",
|
|
32410
32500
|
logoText: logoText,
|
|
32411
32501
|
logoTextStyle = {},
|
|
32412
32502
|
triangleMode = "default",
|
|
@@ -32418,7 +32508,8 @@
|
|
|
32418
32508
|
visible: visible,
|
|
32419
32509
|
state: state,
|
|
32420
32510
|
dx = 0,
|
|
32421
|
-
dy = 0
|
|
32511
|
+
dy = 0,
|
|
32512
|
+
positionBounds: positionBounds
|
|
32422
32513
|
} = this.attribute;
|
|
32423
32514
|
let {
|
|
32424
32515
|
title = "",
|
|
@@ -32504,21 +32595,28 @@
|
|
|
32504
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();
|
|
32505
32596
|
}
|
|
32506
32597
|
}
|
|
32507
|
-
const layout = "auto" === position
|
|
32598
|
+
const layout = "auto" === position || isArray$1(position),
|
|
32599
|
+
positionList = isArray$1(position) ? position : this.positionList;
|
|
32508
32600
|
let maxBBoxI,
|
|
32509
32601
|
maxBBoxSize = -1 / 0;
|
|
32510
|
-
for (let i = 0; i <
|
|
32511
|
-
const p = layout ?
|
|
32602
|
+
for (let i = 0; i < positionList.length + 1; i++) {
|
|
32603
|
+
const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
|
|
32512
32604
|
let symbolType = "arrow2Left",
|
|
32513
32605
|
offsetX = (isArray$1(symbolSize) ? symbolSize[0] : symbolSize) / 4,
|
|
32514
32606
|
offsetY = 0;
|
|
32515
|
-
"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);
|
|
32516
32608
|
const {
|
|
32517
32609
|
angle: angle,
|
|
32518
32610
|
offset: offset
|
|
32519
32611
|
} = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray$1(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
|
|
32520
|
-
|
|
32521
|
-
|
|
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), {
|
|
32522
32620
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32523
32621
|
x: offsetX,
|
|
32524
32622
|
y: offsetY,
|
|
@@ -32531,9 +32629,7 @@
|
|
|
32531
32629
|
dy: offset[1] - (null !== (_j = backgroundStyle.space) && void 0 !== _j ? _j : 0),
|
|
32532
32630
|
size: symbolSize,
|
|
32533
32631
|
zIndex: 9
|
|
32534
|
-
}), "symbol")
|
|
32535
|
-
let bgRect;
|
|
32536
|
-
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), {
|
|
32537
32633
|
visible: bgVisible && (contentVisible || titleVisible),
|
|
32538
32634
|
x: 0,
|
|
32539
32635
|
y: 0,
|
|
@@ -32550,8 +32646,8 @@
|
|
|
32550
32646
|
}), "rect"), isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel);
|
|
32551
32647
|
}
|
|
32552
32648
|
if (group.setAttributes({
|
|
32553
|
-
x: -offset[0] + dx,
|
|
32554
|
-
y: -offset[1] + dy,
|
|
32649
|
+
x: -offset[0] + dx + anchorPoint.x,
|
|
32650
|
+
y: -offset[1] + dy + anchorPoint.y,
|
|
32555
32651
|
anchor: [offsetX, offsetY]
|
|
32556
32652
|
}), logoSymbol) {
|
|
32557
32653
|
const {
|
|
@@ -32579,20 +32675,87 @@
|
|
|
32579
32675
|
zIndex: 10
|
|
32580
32676
|
}), "text");
|
|
32581
32677
|
}
|
|
32582
|
-
if (!
|
|
32678
|
+
if (!range) break;
|
|
32583
32679
|
{
|
|
32584
32680
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
32585
32681
|
const b = _tBounds,
|
|
32586
32682
|
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
32587
|
-
if (
|
|
32588
|
-
|
|
32589
|
-
|
|
32590
|
-
|
|
32591
|
-
|
|
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
|
+
}
|
|
32592
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;
|
|
32593
32703
|
}
|
|
32594
32704
|
}
|
|
32595
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
|
+
}
|
|
32596
32759
|
getAngleAndOffset(position, width, height, size, symbolType) {
|
|
32597
32760
|
const sizeH = "arrow2Left" === symbolType ? size[1] / 2 : size[1];
|
|
32598
32761
|
switch (position) {
|
|
@@ -32754,10 +32917,12 @@
|
|
|
32754
32917
|
this.poptipComponent.setAttributes(Object.assign(Object.assign({
|
|
32755
32918
|
visibleAll: !0,
|
|
32756
32919
|
pickable: !1,
|
|
32757
|
-
childrenPickable: !1
|
|
32920
|
+
childrenPickable: !1,
|
|
32921
|
+
poptipAnchor: "bounds"
|
|
32758
32922
|
}, poptip), {
|
|
32759
32923
|
x: matrix.e,
|
|
32760
|
-
y: matrix.f
|
|
32924
|
+
y: matrix.f,
|
|
32925
|
+
positionBounds: graphic.globalAABBBounds
|
|
32761
32926
|
})), drawContext.stage.tryInitInteractiveLayer();
|
|
32762
32927
|
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
32763
32928
|
interactiveLayer && interactiveLayer.add(this.poptipComponent);
|
|
@@ -33511,10 +33676,11 @@
|
|
|
33511
33676
|
}
|
|
33512
33677
|
function textIntersect(textA, textB, sep) {
|
|
33513
33678
|
var _a;
|
|
33514
|
-
|
|
33515
|
-
|
|
33516
|
-
|
|
33517
|
-
|
|
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);
|
|
33518
33684
|
}
|
|
33519
33685
|
function hasOverlap$1(items, pad) {
|
|
33520
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;
|
|
@@ -35743,7 +35909,9 @@
|
|
|
35743
35909
|
super(...arguments), this.type = ScaleEnum.Linear;
|
|
35744
35910
|
}
|
|
35745
35911
|
clone() {
|
|
35746
|
-
|
|
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;
|
|
35747
35915
|
}
|
|
35748
35916
|
tickFormat() {
|
|
35749
35917
|
return () => {};
|
|
@@ -39041,13 +39209,13 @@
|
|
|
39041
39209
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39042
39210
|
triggers = getEndTriggersOfDrag();
|
|
39043
39211
|
evtTarget.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39044
|
-
capture: !0
|
|
39045
|
-
|
|
39212
|
+
capture: !0
|
|
39213
|
+
}), this.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39214
|
+
capture: !0
|
|
39046
39215
|
}), triggers.forEach(trigger => {
|
|
39047
39216
|
evtTarget.addEventListener(trigger, this._onHandlerPointerUp);
|
|
39048
39217
|
});
|
|
39049
39218
|
}, this._pointerMove = e => {
|
|
39050
|
-
e.preventDefault();
|
|
39051
39219
|
const {
|
|
39052
39220
|
start: startAttr,
|
|
39053
39221
|
end: endAttr,
|
|
@@ -39064,7 +39232,7 @@
|
|
|
39064
39232
|
start: start,
|
|
39065
39233
|
end: end
|
|
39066
39234
|
} = this.state;
|
|
39067
|
-
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.
|
|
39235
|
+
this._activeState && (this._activeTag === DataZoomActiveTag.middleHandler ? this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis) : this._activeTag === DataZoomActiveTag.startHandler ? start + dis > end ? (start = end, end = start + dis, this._activeTag = DataZoomActiveTag.endHandler) : start += dis : this._activeTag === DataZoomActiveTag.endHandler && (end + dis < start ? (end = start, start = end + dis, this._activeTag = DataZoomActiveTag.startHandler) : end += dis), this._activeCache.lastPos = pos, brushSelect && this.renderDragMask()), start = Math.min(Math.max(start, 0), 1), end = Math.min(Math.max(end, 0), 1), startAttr === start && endAttr === end || (this.setStateAttr(start, end, !0), realTime && this._dispatchEvent("change", {
|
|
39068
39236
|
start: start,
|
|
39069
39237
|
end: end,
|
|
39070
39238
|
tag: this._activeTag
|
|
@@ -39140,10 +39308,11 @@
|
|
|
39140
39308
|
const evtTarget = "browser" === vglobal.env ? vglobal : this.stage,
|
|
39141
39309
|
triggers = getEndTriggersOfDrag();
|
|
39142
39310
|
evtTarget.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39143
|
-
capture: !0
|
|
39144
|
-
passive: !1
|
|
39311
|
+
capture: !0
|
|
39145
39312
|
}), triggers.forEach(trigger => {
|
|
39146
39313
|
evtTarget.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
39314
|
+
}), this.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
39315
|
+
capture: !0
|
|
39147
39316
|
});
|
|
39148
39317
|
}
|
|
39149
39318
|
_onHandlerPointerEnter(e) {
|
|
@@ -39863,17 +40032,26 @@
|
|
|
39863
40032
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
39864
40033
|
clipRange: 1
|
|
39865
40034
|
}, stepDuration, easing);
|
|
39866
|
-
}), 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
|
+
});
|
|
39867
40039
|
}
|
|
39868
40040
|
|
|
39869
40041
|
function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
39870
|
-
segmentFadeIn(line, delay, duration, easing),
|
|
40042
|
+
segmentFadeIn(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40043
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40044
|
+
});
|
|
39871
40045
|
}
|
|
39872
40046
|
function areaFadeIn(area, label, duration, delay, easing) {
|
|
39873
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40047
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40048
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40049
|
+
});
|
|
39874
40050
|
}
|
|
39875
40051
|
function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
39876
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
40052
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40053
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
40054
|
+
});
|
|
39877
40055
|
}
|
|
39878
40056
|
function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39879
40057
|
var _a;
|
|
@@ -39881,13 +40059,19 @@
|
|
|
39881
40059
|
}
|
|
39882
40060
|
|
|
39883
40061
|
function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
39884
|
-
segmentFadeOut(line, delay, duration, easing),
|
|
40062
|
+
segmentFadeOut(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40063
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40064
|
+
});
|
|
39885
40065
|
}
|
|
39886
40066
|
function areaFadeOut(area, label, duration, delay, easing) {
|
|
39887
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40067
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40068
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40069
|
+
});
|
|
39888
40070
|
}
|
|
39889
40071
|
function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
39890
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
40072
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
40073
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
40074
|
+
});
|
|
39891
40075
|
}
|
|
39892
40076
|
function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39893
40077
|
var _a;
|
|
@@ -40059,6 +40243,57 @@
|
|
|
40059
40243
|
delay: 0
|
|
40060
40244
|
};
|
|
40061
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
|
+
|
|
40062
40297
|
class MarkCommonLine extends Marker {
|
|
40063
40298
|
constructor() {
|
|
40064
40299
|
super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = DefaultUpdateMarkLineAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
@@ -40066,24 +40301,20 @@
|
|
|
40066
40301
|
getLine() {
|
|
40067
40302
|
return this._line;
|
|
40068
40303
|
}
|
|
40069
|
-
|
|
40070
|
-
return this._label;
|
|
40071
|
-
}
|
|
40072
|
-
setLabelPos() {
|
|
40304
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40073
40305
|
const {
|
|
40074
|
-
label = {},
|
|
40075
40306
|
limitRect: limitRect
|
|
40076
40307
|
} = this.attribute,
|
|
40077
40308
|
{
|
|
40078
40309
|
position: position,
|
|
40079
40310
|
confine: confine,
|
|
40080
40311
|
autoRotate: autoRotate
|
|
40081
|
-
} =
|
|
40082
|
-
labelPoint = this.getPointAttrByPosition(position),
|
|
40312
|
+
} = labelAttrs,
|
|
40313
|
+
labelPoint = this.getPointAttrByPosition(position, labelAttrs),
|
|
40083
40314
|
labelAngle = position.toString().toLocaleLowerCase().includes("start") ? this._line.getStartAngle() || 0 : this._line.getEndAngle() || 0;
|
|
40084
|
-
if (
|
|
40085
|
-
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0,
|
|
40086
|
-
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)
|
|
40087
40318
|
})), limitRect && confine) {
|
|
40088
40319
|
const {
|
|
40089
40320
|
x: x,
|
|
@@ -40091,7 +40322,7 @@
|
|
|
40091
40322
|
width: width,
|
|
40092
40323
|
height: height
|
|
40093
40324
|
} = limitRect;
|
|
40094
|
-
limitShapeInBounds(
|
|
40325
|
+
limitShapeInBounds(labelNode, {
|
|
40095
40326
|
x1: x,
|
|
40096
40327
|
y1: y,
|
|
40097
40328
|
x2: x + width,
|
|
@@ -40100,36 +40331,14 @@
|
|
|
40100
40331
|
}
|
|
40101
40332
|
}
|
|
40102
40333
|
initMarker(container) {
|
|
40103
|
-
const
|
|
40104
|
-
|
|
40105
|
-
state: state
|
|
40106
|
-
} = this.attribute,
|
|
40107
|
-
line = this.createSegment();
|
|
40108
|
-
line.name = "mark-common-line-line", this._line = line, container.add(line);
|
|
40109
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40110
|
-
state: {
|
|
40111
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40112
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40113
|
-
}
|
|
40114
|
-
}));
|
|
40115
|
-
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);
|
|
40116
40336
|
}
|
|
40117
40337
|
updateMarker() {
|
|
40118
|
-
|
|
40119
|
-
label: label,
|
|
40120
|
-
state: state
|
|
40121
|
-
} = this.attribute;
|
|
40122
|
-
this.setLineAttributes(), this._label && (this._label.setAttributes(Object.assign(Object.assign({
|
|
40123
|
-
dx: 0,
|
|
40124
|
-
dy: 0
|
|
40125
|
-
}, label), {
|
|
40126
|
-
state: {
|
|
40127
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40128
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40129
|
-
}
|
|
40130
|
-
})), this.setLabelPos());
|
|
40338
|
+
this.setLineAttributes(), this.updateMarkLineLabels();
|
|
40131
40339
|
}
|
|
40132
40340
|
}
|
|
40341
|
+
mixin(MarkCommonLine, MarkLabelMixin);
|
|
40133
40342
|
|
|
40134
40343
|
const FUZZY_EQUAL_DELTA = .001;
|
|
40135
40344
|
const DEFAULT_MARK_LINE_THEME = {
|
|
@@ -40318,6 +40527,7 @@
|
|
|
40318
40527
|
lineWidth: 0
|
|
40319
40528
|
},
|
|
40320
40529
|
label: {
|
|
40530
|
+
autoRotate: !0,
|
|
40321
40531
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40322
40532
|
refX: 0,
|
|
40323
40533
|
refY: 0,
|
|
@@ -40372,6 +40582,7 @@
|
|
|
40372
40582
|
const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
40373
40583
|
interactive: !0,
|
|
40374
40584
|
label: {
|
|
40585
|
+
autoRotate: !0,
|
|
40375
40586
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40376
40587
|
textStyle: {
|
|
40377
40588
|
fill: "#fff",
|
|
@@ -40627,15 +40838,12 @@
|
|
|
40627
40838
|
constructor(attributes, options) {
|
|
40628
40839
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
|
|
40629
40840
|
}
|
|
40630
|
-
getPointAttrByPosition(position) {
|
|
40841
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40631
40842
|
var _a;
|
|
40632
40843
|
const {
|
|
40633
|
-
label = {}
|
|
40634
|
-
} = this.attribute,
|
|
40635
|
-
{
|
|
40636
40844
|
refX = 0,
|
|
40637
40845
|
refY = 0
|
|
40638
|
-
} =
|
|
40846
|
+
} = labelAttrs,
|
|
40639
40847
|
points = this._line.getMainSegmentPoints(),
|
|
40640
40848
|
lineEndAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0,
|
|
40641
40849
|
labelAngle = (lineEndAngle),
|
|
@@ -40661,9 +40869,9 @@
|
|
|
40661
40869
|
angle: labelAngle
|
|
40662
40870
|
};
|
|
40663
40871
|
}
|
|
40664
|
-
getRotateByAngle(angle) {
|
|
40872
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40665
40873
|
var _a;
|
|
40666
|
-
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);
|
|
40667
40875
|
}
|
|
40668
40876
|
getTextStyle(position, labelAngle, autoRotate) {
|
|
40669
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];
|
|
@@ -40729,6 +40937,12 @@
|
|
|
40729
40937
|
});else if (!isValidNumber$1(point.x) || !isValidNumber$1(point.y)) return void (validFlag = !1);
|
|
40730
40938
|
}), validFlag;
|
|
40731
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
|
+
}
|
|
40732
40946
|
}
|
|
40733
40947
|
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
40734
40948
|
|
|
@@ -40743,9 +40957,6 @@
|
|
|
40743
40957
|
getArea() {
|
|
40744
40958
|
return this._area;
|
|
40745
40959
|
}
|
|
40746
|
-
getLabel() {
|
|
40747
|
-
return this._label;
|
|
40748
|
-
}
|
|
40749
40960
|
constructor(attributes, options) {
|
|
40750
40961
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40751
40962
|
}
|
|
@@ -40762,24 +40973,21 @@
|
|
|
40762
40973
|
};
|
|
40763
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;
|
|
40764
40975
|
}
|
|
40765
|
-
setLabelPos() {
|
|
40976
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40766
40977
|
var _a;
|
|
40767
|
-
if (this.
|
|
40768
|
-
const
|
|
40769
|
-
label = {}
|
|
40770
|
-
} = this.attribute,
|
|
40771
|
-
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",
|
|
40772
40980
|
labelPoint = this.getPointAttrByPosition(labelPosition);
|
|
40773
|
-
if (
|
|
40774
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]),
|
|
40775
|
-
})), 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) {
|
|
40776
40984
|
const {
|
|
40777
40985
|
x: x,
|
|
40778
40986
|
y: y,
|
|
40779
40987
|
width: width,
|
|
40780
40988
|
height: height
|
|
40781
40989
|
} = this.attribute.limitRect;
|
|
40782
|
-
limitShapeInBounds(
|
|
40990
|
+
limitShapeInBounds(labelNode, {
|
|
40783
40991
|
x1: x,
|
|
40784
40992
|
y1: y,
|
|
40785
40993
|
x2: x + width,
|
|
@@ -40791,40 +40999,23 @@
|
|
|
40791
40999
|
initMarker(container) {
|
|
40792
41000
|
const {
|
|
40793
41001
|
points: points,
|
|
40794
|
-
label: label,
|
|
40795
41002
|
areaStyle: areaStyle,
|
|
40796
41003
|
state: state
|
|
40797
41004
|
} = this.attribute,
|
|
40798
41005
|
area = graphicCreator.polygon(Object.assign({
|
|
40799
41006
|
points: points
|
|
40800
41007
|
}, areaStyle));
|
|
40801
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
|
|
40802
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40803
|
-
state: {
|
|
40804
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40805
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40806
|
-
}
|
|
40807
|
-
}));
|
|
40808
|
-
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);
|
|
40809
41009
|
}
|
|
40810
41010
|
updateMarker() {
|
|
40811
41011
|
const {
|
|
40812
41012
|
points: points,
|
|
40813
|
-
label: label,
|
|
40814
41013
|
areaStyle: areaStyle,
|
|
40815
41014
|
state: state
|
|
40816
41015
|
} = this.attribute;
|
|
40817
41016
|
this._area && (this._area.setAttributes(Object.assign({
|
|
40818
41017
|
points: points
|
|
40819
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
40820
|
-
dx: 0,
|
|
40821
|
-
dy: 0
|
|
40822
|
-
}, label), {
|
|
40823
|
-
state: {
|
|
40824
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40825
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40826
|
-
}
|
|
40827
|
-
})), this.setLabelPos();
|
|
41018
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArea.defaultAttributes.label);
|
|
40828
41019
|
}
|
|
40829
41020
|
isValidPoints() {
|
|
40830
41021
|
const {
|
|
@@ -40837,7 +41028,7 @@
|
|
|
40837
41028
|
}), validFlag;
|
|
40838
41029
|
}
|
|
40839
41030
|
}
|
|
40840
|
-
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
41031
|
+
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME, mixin(MarkArea, MarkLabelMixin);
|
|
40841
41032
|
|
|
40842
41033
|
loadMarkArcLineComponent();
|
|
40843
41034
|
function registerMarkArcLineAnimate() {
|
|
@@ -40848,24 +41039,19 @@
|
|
|
40848
41039
|
MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
40849
41040
|
}
|
|
40850
41041
|
constructor(attributes, options) {
|
|
40851
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes,
|
|
40852
|
-
label: {
|
|
40853
|
-
autoRotate: !0
|
|
40854
|
-
}
|
|
40855
|
-
})), this.name = "markArcLine";
|
|
41042
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes)), this.name = "markArcLine";
|
|
40856
41043
|
}
|
|
40857
|
-
getPointAttrByPosition(direction) {
|
|
41044
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
40858
41045
|
const {
|
|
40859
41046
|
center: center,
|
|
40860
41047
|
radius: radius,
|
|
40861
41048
|
startAngle: startAngle,
|
|
40862
|
-
endAngle: endAngle
|
|
40863
|
-
label: label
|
|
41049
|
+
endAngle: endAngle
|
|
40864
41050
|
} = this.attribute,
|
|
40865
41051
|
{
|
|
40866
41052
|
refX = 0,
|
|
40867
41053
|
refY = 0
|
|
40868
|
-
} =
|
|
41054
|
+
} = labelAttrs;
|
|
40869
41055
|
let angle;
|
|
40870
41056
|
switch (direction) {
|
|
40871
41057
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -40895,9 +41081,9 @@
|
|
|
40895
41081
|
getTextStyle(position) {
|
|
40896
41082
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
40897
41083
|
}
|
|
40898
|
-
getRotateByAngle(angle) {
|
|
41084
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40899
41085
|
var _a;
|
|
40900
|
-
return angle - Math.PI / 2 + (null !== (_a =
|
|
41086
|
+
return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40901
41087
|
}
|
|
40902
41088
|
createSegment() {
|
|
40903
41089
|
const {
|
|
@@ -40954,6 +41140,12 @@
|
|
|
40954
41140
|
isValidPoints() {
|
|
40955
41141
|
return !0;
|
|
40956
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
|
+
}
|
|
40957
41149
|
}
|
|
40958
41150
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
40959
41151
|
|
|
@@ -40968,29 +41160,21 @@
|
|
|
40968
41160
|
getArea() {
|
|
40969
41161
|
return this._area;
|
|
40970
41162
|
}
|
|
40971
|
-
getLabel() {
|
|
40972
|
-
return this._label;
|
|
40973
|
-
}
|
|
40974
41163
|
constructor(attributes, options) {
|
|
40975
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes,
|
|
40976
|
-
label: {
|
|
40977
|
-
autoRotate: !0
|
|
40978
|
-
}
|
|
40979
|
-
})), 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;
|
|
40980
41165
|
}
|
|
40981
|
-
getPointAttrByPosition(position) {
|
|
41166
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40982
41167
|
const {
|
|
40983
41168
|
center: center,
|
|
40984
41169
|
innerRadius: innerRadius,
|
|
40985
41170
|
outerRadius: outerRadius,
|
|
40986
41171
|
startAngle: startAngle,
|
|
40987
|
-
endAngle: endAngle
|
|
40988
|
-
label: label
|
|
41172
|
+
endAngle: endAngle
|
|
40989
41173
|
} = this.attribute,
|
|
40990
41174
|
{
|
|
40991
41175
|
refX = 0,
|
|
40992
41176
|
refY = 0
|
|
40993
|
-
} =
|
|
41177
|
+
} = labelAttrs;
|
|
40994
41178
|
let radius, angle;
|
|
40995
41179
|
switch (position) {
|
|
40996
41180
|
case IMarkCommonArcLabelPosition.center:
|
|
@@ -41025,28 +41209,25 @@
|
|
|
41025
41209
|
angle: angle
|
|
41026
41210
|
};
|
|
41027
41211
|
}
|
|
41028
|
-
setLabelPos() {
|
|
41212
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
41029
41213
|
var _a;
|
|
41030
|
-
if (this.
|
|
41214
|
+
if (this._area) {
|
|
41031
41215
|
const {
|
|
41032
|
-
label = {}
|
|
41033
|
-
} = this.attribute,
|
|
41034
|
-
{
|
|
41035
41216
|
position: labelPosition = "arcInnerMiddle",
|
|
41036
41217
|
autoRotate: autoRotate
|
|
41037
|
-
} =
|
|
41038
|
-
labelAttr = this.getPointAttrByPosition(labelPosition);
|
|
41039
|
-
if (
|
|
41040
|
-
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a =
|
|
41041
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]),
|
|
41042
|
-
})), 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) {
|
|
41043
41224
|
const {
|
|
41044
41225
|
x: x,
|
|
41045
41226
|
y: y,
|
|
41046
41227
|
width: width,
|
|
41047
41228
|
height: height
|
|
41048
41229
|
} = this.attribute.limitRect;
|
|
41049
|
-
limitShapeInBounds(
|
|
41230
|
+
limitShapeInBounds(labelNode, {
|
|
41050
41231
|
x1: x,
|
|
41051
41232
|
y1: y,
|
|
41052
41233
|
x2: x + width,
|
|
@@ -41063,7 +41244,6 @@
|
|
|
41063
41244
|
startAngle: startAngle,
|
|
41064
41245
|
endAngle: endAngle,
|
|
41065
41246
|
areaStyle: areaStyle,
|
|
41066
|
-
label: label,
|
|
41067
41247
|
state: state
|
|
41068
41248
|
} = this.attribute,
|
|
41069
41249
|
area = graphicCreator.arc(Object.assign({
|
|
@@ -41074,14 +41254,7 @@
|
|
|
41074
41254
|
startAngle: startAngle,
|
|
41075
41255
|
endAngle: endAngle
|
|
41076
41256
|
}, areaStyle));
|
|
41077
|
-
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);
|
|
41078
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
41079
|
-
state: {
|
|
41080
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41081
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41082
|
-
}
|
|
41083
|
-
}));
|
|
41084
|
-
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);
|
|
41085
41258
|
}
|
|
41086
41259
|
updateMarker() {
|
|
41087
41260
|
const {
|
|
@@ -41101,21 +41274,13 @@
|
|
|
41101
41274
|
outerRadius: outerRadius,
|
|
41102
41275
|
startAngle: startAngle,
|
|
41103
41276
|
endAngle: endAngle
|
|
41104
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
41105
|
-
dx: 0,
|
|
41106
|
-
dy: 0
|
|
41107
|
-
}, label), {
|
|
41108
|
-
state: {
|
|
41109
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41110
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41111
|
-
}
|
|
41112
|
-
})), this.setLabelPos());
|
|
41277
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
41113
41278
|
}
|
|
41114
41279
|
isValidPoints() {
|
|
41115
41280
|
return !0;
|
|
41116
41281
|
}
|
|
41117
41282
|
}
|
|
41118
|
-
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
41283
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
|
|
41119
41284
|
|
|
41120
41285
|
loadMarkPointComponent();
|
|
41121
41286
|
function registerMarkPointAnimate() {
|
|
@@ -42644,14 +42809,13 @@
|
|
|
42644
42809
|
const triggers = getEndTriggersOfDrag(),
|
|
42645
42810
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42646
42811
|
obj.addEventListener("pointermove", this._onHandlerPointerMove, {
|
|
42647
|
-
capture: !0
|
|
42648
|
-
passive: !1
|
|
42812
|
+
capture: !0
|
|
42649
42813
|
}), triggers.forEach(trigger => {
|
|
42650
42814
|
obj.addEventListener(trigger, this._onHandlerPointerUp);
|
|
42651
42815
|
});
|
|
42652
42816
|
}, this._onHandlerPointerMove = e => {
|
|
42653
42817
|
var _a, _b;
|
|
42654
|
-
|
|
42818
|
+
this._isChanging = !0;
|
|
42655
42819
|
const {
|
|
42656
42820
|
railWidth: railWidth,
|
|
42657
42821
|
railHeight: railHeight,
|
|
@@ -42685,13 +42849,12 @@
|
|
|
42685
42849
|
const triggers = getEndTriggersOfDrag(),
|
|
42686
42850
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
42687
42851
|
obj.addEventListener("pointermove", this._onTrackPointerMove, {
|
|
42688
|
-
capture: !0
|
|
42689
|
-
passive: !1
|
|
42852
|
+
capture: !0
|
|
42690
42853
|
}), triggers.forEach(trigger => {
|
|
42691
42854
|
obj.addEventListener(trigger, this._onTrackPointerUp);
|
|
42692
42855
|
});
|
|
42693
42856
|
}, this._onTrackPointerMove = e => {
|
|
42694
|
-
|
|
42857
|
+
this._isChanging = !0;
|
|
42695
42858
|
const {
|
|
42696
42859
|
railWidth: railWidth,
|
|
42697
42860
|
railHeight: railHeight,
|
|
@@ -43066,13 +43229,11 @@
|
|
|
43066
43229
|
const triggers = getEndTriggersOfDrag(),
|
|
43067
43230
|
obj = "browser" === vglobal.env ? vglobal : this.stage;
|
|
43068
43231
|
obj.removeEventListener("pointermove", this._onHandlerPointerMove, {
|
|
43069
|
-
capture: !0
|
|
43070
|
-
passive: !1
|
|
43232
|
+
capture: !0
|
|
43071
43233
|
}), triggers.forEach(trigger => {
|
|
43072
43234
|
obj.removeEventListener(trigger, this._onHandlerPointerUp);
|
|
43073
43235
|
}), obj.removeEventListener("pointermove", this._onTrackPointerMove, {
|
|
43074
|
-
capture: !0
|
|
43075
|
-
passive: !1
|
|
43236
|
+
capture: !0
|
|
43076
43237
|
}), triggers.forEach(trigger => {
|
|
43077
43238
|
obj.removeEventListener(trigger, this._onTrackPointerUp);
|
|
43078
43239
|
});
|
|
@@ -44455,13 +44616,13 @@
|
|
|
44455
44616
|
|
|
44456
44617
|
var IOperateType;
|
|
44457
44618
|
!function (IOperateType) {
|
|
44458
|
-
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";
|
|
44459
44620
|
}(IOperateType || (IOperateType = {}));
|
|
44460
44621
|
|
|
44461
44622
|
const DEFAULT_BRUSH_ATTRIBUTES = {
|
|
44462
44623
|
trigger: "pointerdown",
|
|
44463
44624
|
updateTrigger: "pointermove",
|
|
44464
|
-
endTrigger: "pointerup",
|
|
44625
|
+
endTrigger: ["pointerup", "pointerleave"],
|
|
44465
44626
|
resetTrigger: "pointerupoutside",
|
|
44466
44627
|
hasMask: !0,
|
|
44467
44628
|
brushMode: "single",
|
|
@@ -44477,10 +44638,10 @@
|
|
|
44477
44638
|
delayType: "throttle",
|
|
44478
44639
|
delayTime: 10,
|
|
44479
44640
|
interactiveRange: {
|
|
44480
|
-
|
|
44481
|
-
|
|
44482
|
-
|
|
44483
|
-
|
|
44641
|
+
minY: -1 / 0,
|
|
44642
|
+
maxY: 1 / 0,
|
|
44643
|
+
minX: -1 / 0,
|
|
44644
|
+
maxX: 1 / 0
|
|
44484
44645
|
}
|
|
44485
44646
|
};
|
|
44486
44647
|
const DEFAULT_SIZE_THRESHOLD = 5;
|
|
@@ -44496,83 +44657,36 @@
|
|
|
44496
44657
|
loadBrushComponent();
|
|
44497
44658
|
let Brush$1 = class Brush extends AbstractComponent {
|
|
44498
44659
|
constructor(attributes, options) {
|
|
44499
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, Brush.defaultAttributes, attributes)), this.name = "brush", this._activeDrawState = !1, this._cacheDrawPoints = [], this.
|
|
44500
|
-
|
|
44501
|
-
if (this._outOfInteractiveRange(e)) return void (this._isDownBeforeUpOutside = !0);
|
|
44502
|
-
e.stopPropagation();
|
|
44503
|
-
const brushMoved = null === (_a = this.attribute.brushMoved) || void 0 === _a || _a;
|
|
44504
|
-
this._activeMoveState = brushMoved && this._isPosInBrushMask(e), this._activeDrawState = !this._activeMoveState, this._activeDrawState && this._initDraw(e), this._activeMoveState && this._initMove(e);
|
|
44505
|
-
}, this._onBrushing = e => {
|
|
44506
|
-
this._outOfInteractiveRange(e) || ((this._activeDrawState || this._activeMoveState) && e.stopPropagation(), this._activeDrawState && this._drawing(e), this._activeMoveState && this._moving(e));
|
|
44507
|
-
}, this._onBrushingWithDelay = 0 === this.attribute.delayTime ? this._onBrushing : delayMap$1[this.attribute.delayType](this._onBrushing, this.attribute.delayTime), this._onBrushEnd = e => {
|
|
44508
|
-
var _a;
|
|
44509
|
-
if (!this._activeDrawState && !this._activeMoveState) return;
|
|
44510
|
-
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)));
|
|
44511
44662
|
const {
|
|
44512
|
-
|
|
44663
|
+
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44664
|
+
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44665
|
+
brushMoved = !0
|
|
44513
44666
|
} = this.attribute;
|
|
44514
|
-
|
|
44515
|
-
|
|
44516
|
-
|
|
44517
|
-
|
|
44518
|
-
|
|
44519
|
-
operateMask: this._operatingMask,
|
|
44520
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44521
|
-
event: e
|
|
44522
|
-
}), this._activeMoveState && this._dispatchEvent(IOperateType.moveEnd, {
|
|
44523
|
-
operateMask: this._operatingMask,
|
|
44524
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44525
|
-
event: e
|
|
44526
|
-
})), 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;
|
|
44527
44672
|
}, this._onBrushClear = e => {
|
|
44528
|
-
e.preventDefault();
|
|
44529
|
-
const {
|
|
44530
|
-
removeOnClick = !0
|
|
44531
|
-
} = this.attribute;
|
|
44532
|
-
this._isDownBeforeUpOutside && removeOnClick && (this._dispatchEvent(IOperateType.brushClear, {
|
|
44533
|
-
operateMask: this._operatingMask,
|
|
44534
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44535
|
-
event: e
|
|
44536
|
-
}), 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;
|
|
44537
44674
|
};
|
|
44538
44675
|
}
|
|
44539
44676
|
_bindBrushEvents() {
|
|
44540
|
-
if (this.attribute.disableTriggerEvent) return;
|
|
44677
|
+
if (this.releaseBrushEvents(), this.attribute.disableTriggerEvent) return;
|
|
44541
44678
|
const {
|
|
44542
44679
|
trigger = DEFAULT_BRUSH_ATTRIBUTES.trigger,
|
|
44543
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44544
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44545
44680
|
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44546
44681
|
} = this.attribute;
|
|
44547
|
-
array(trigger).forEach(t =>
|
|
44548
|
-
}
|
|
44549
|
-
_isPosInBrushMask(e) {
|
|
44550
|
-
const pos = this.eventPosToStagePos(e),
|
|
44551
|
-
brushMasks = this._container.getChildren();
|
|
44552
|
-
for (let i = 0; i < brushMasks.length; i++) {
|
|
44553
|
-
const {
|
|
44554
|
-
points = [],
|
|
44555
|
-
dx = 0,
|
|
44556
|
-
dy = 0
|
|
44557
|
-
} = brushMasks[i].attribute,
|
|
44558
|
-
pointsConsiderOffset = points.map(point => ({
|
|
44559
|
-
x: point.x + dx,
|
|
44560
|
-
y: point.y + dy
|
|
44561
|
-
}));
|
|
44562
|
-
if (polygonContainPoint(pointsConsiderOffset, pos.x, pos.y)) return this._operatingMask = brushMasks[i], !0;
|
|
44563
|
-
}
|
|
44564
|
-
return !1;
|
|
44682
|
+
array(trigger).forEach(t => this.stage.addEventListener(t, this._onBrushStart)), array(resetTrigger).forEach(t => this.stage.addEventListener(t, this._onBrushClear));
|
|
44565
44683
|
}
|
|
44566
44684
|
_initDraw(e) {
|
|
44567
44685
|
const {
|
|
44568
44686
|
brushMode: brushMode
|
|
44569
44687
|
} = this.attribute,
|
|
44570
44688
|
pos = this.eventPosToStagePos(e);
|
|
44571
|
-
this._cacheDrawPoints
|
|
44572
|
-
operateMask: this._operatingMask,
|
|
44573
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44574
|
-
event: e
|
|
44575
|
-
});
|
|
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);
|
|
44576
44690
|
}
|
|
44577
44691
|
_initMove(e) {
|
|
44578
44692
|
var _a, _b;
|
|
@@ -44596,17 +44710,12 @@
|
|
|
44596
44710
|
maxMoveStepX = maxX - x2,
|
|
44597
44711
|
minMoveStepY = minY - y1,
|
|
44598
44712
|
maxMoveStepY = maxY - y2;
|
|
44599
|
-
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this.
|
|
44600
|
-
operateMask: this._operatingMask,
|
|
44601
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44602
|
-
event: e
|
|
44603
|
-
});
|
|
44713
|
+
this._operatingMaskMoveRangeX = [minMoveStepX, maxMoveStepX], this._operatingMaskMoveRangeY = [minMoveStepY, maxMoveStepY], this._operatingMask.setAttribute("pickable", !0), this._dispatchBrushEvent(IOperateType.moveStart, e);
|
|
44604
44714
|
}
|
|
44605
44715
|
_drawing(e) {
|
|
44606
|
-
var _a
|
|
44716
|
+
var _a;
|
|
44607
44717
|
const pos = this.eventPosToStagePos(e),
|
|
44608
44718
|
{
|
|
44609
|
-
sizeThreshold = DEFAULT_SIZE_THRESHOLD,
|
|
44610
44719
|
brushType: brushType
|
|
44611
44720
|
} = this.attribute,
|
|
44612
44721
|
cacheLength = this._cacheDrawPoints.length;
|
|
@@ -44616,18 +44725,7 @@
|
|
|
44616
44725
|
}
|
|
44617
44726
|
"polygon" === brushType || cacheLength <= 1 ? this._cacheDrawPoints.push(pos) : this._cacheDrawPoints[cacheLength - 1] = pos;
|
|
44618
44727
|
const maskPoints = this._computeMaskPoints();
|
|
44619
|
-
this._operatingMask.setAttribute("points", maskPoints);
|
|
44620
|
-
const {
|
|
44621
|
-
x1 = 0,
|
|
44622
|
-
x2 = 0,
|
|
44623
|
-
y1 = 0,
|
|
44624
|
-
y2 = 0
|
|
44625
|
-
} = null === (_b = this._operatingMask) || void 0 === _b ? void 0 : _b._AABBBounds;
|
|
44626
|
-
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, {
|
|
44627
|
-
operateMask: this._operatingMask,
|
|
44628
|
-
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44629
|
-
event: e
|
|
44630
|
-
}));
|
|
44728
|
+
this._operatingMask.setAttribute("points", maskPoints), this._dispatchBrushEvent(IOperateType.drawing, e);
|
|
44631
44729
|
}
|
|
44632
44730
|
_moving(e) {
|
|
44633
44731
|
const startPos = this._cacheMovePoint,
|
|
@@ -44640,11 +44738,46 @@
|
|
|
44640
44738
|
this._operatingMask.setAttributes({
|
|
44641
44739
|
dx: moveX,
|
|
44642
44740
|
dy: moveY
|
|
44643
|
-
}), this._brushMaskAABBBoundsDict[this._operatingMask.name] = this._operatingMask.AABBBounds, this.
|
|
44644
|
-
|
|
44645
|
-
|
|
44646
|
-
|
|
44647
|
-
|
|
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));
|
|
44648
44781
|
}
|
|
44649
44782
|
_computeMaskPoints() {
|
|
44650
44783
|
const {
|
|
@@ -44702,6 +44835,23 @@
|
|
|
44702
44835
|
}));
|
|
44703
44836
|
brushMask.name = `brush-${Date.now()}`, this._operatingMask = brushMask, this._container.add(brushMask), this._brushMaskAABBBoundsDict[brushMask.name] = brushMask.AABBBounds;
|
|
44704
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
|
+
}
|
|
44705
44855
|
_outOfInteractiveRange(e) {
|
|
44706
44856
|
const {
|
|
44707
44857
|
interactiveRange: interactiveRange
|
|
@@ -44718,21 +44868,18 @@
|
|
|
44718
44868
|
eventPosToStagePos(e) {
|
|
44719
44869
|
return this.stage.eventPointTransform(e);
|
|
44720
44870
|
}
|
|
44721
|
-
|
|
44722
|
-
this.
|
|
44723
|
-
|
|
44724
|
-
|
|
44871
|
+
_dispatchBrushEvent(operateType, e) {
|
|
44872
|
+
this._dispatchEvent(operateType, {
|
|
44873
|
+
operateMask: this._operatingMask,
|
|
44874
|
+
operatedMaskAABBBounds: this._brushMaskAABBBoundsDict,
|
|
44875
|
+
event: e
|
|
44876
|
+
});
|
|
44725
44877
|
}
|
|
44726
|
-
|
|
44727
|
-
|
|
44728
|
-
|
|
44729
|
-
|
|
44730
|
-
|
|
44731
|
-
updateTrigger = DEFAULT_BRUSH_ATTRIBUTES.updateTrigger,
|
|
44732
|
-
endTrigger = DEFAULT_BRUSH_ATTRIBUTES.endTrigger,
|
|
44733
|
-
resetTrigger = DEFAULT_BRUSH_ATTRIBUTES.resetTrigger
|
|
44734
|
-
} = this.attribute;
|
|
44735
|
-
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());
|
|
44736
44883
|
}
|
|
44737
44884
|
};
|
|
44738
44885
|
Brush$1.defaultAttributes = DEFAULT_BRUSH_ATTRIBUTES;
|
|
@@ -56967,6 +57114,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56967
57114
|
ChartEvent["brushChange"] = "brushChange";
|
|
56968
57115
|
ChartEvent["brushEnd"] = "brushEnd";
|
|
56969
57116
|
ChartEvent["brushClear"] = "brushClear";
|
|
57117
|
+
ChartEvent["brushActive"] = "brushActive";
|
|
56970
57118
|
ChartEvent["legendSelectedDataChange"] = "legendSelectedDataChange";
|
|
56971
57119
|
ChartEvent["legendFilter"] = "legendFilter";
|
|
56972
57120
|
ChartEvent["legendItemClick"] = "legendItemClick";
|
|
@@ -59618,6 +59766,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59618
59766
|
}
|
|
59619
59767
|
beforeRelease() {
|
|
59620
59768
|
}
|
|
59769
|
+
clear() {
|
|
59770
|
+
this.getMarks().forEach(m => { var _a; return (_a = m.clear) === null || _a === void 0 ? void 0 : _a.call(m); });
|
|
59771
|
+
}
|
|
59621
59772
|
release() {
|
|
59622
59773
|
var _a;
|
|
59623
59774
|
this._releaseEvent();
|
|
@@ -61770,6 +61921,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61770
61921
|
}
|
|
61771
61922
|
return undefined;
|
|
61772
61923
|
}
|
|
61924
|
+
clear() {
|
|
61925
|
+
this._event.off(HOOK_EVENT.AFTER_DO_RENDER);
|
|
61926
|
+
}
|
|
61773
61927
|
release() {
|
|
61774
61928
|
super.release();
|
|
61775
61929
|
this.state.release();
|
|
@@ -63719,7 +63873,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63719
63873
|
};
|
|
63720
63874
|
registerVChartCore();
|
|
63721
63875
|
|
|
63722
|
-
const version = "1.13.9
|
|
63876
|
+
const version = "1.13.9";
|
|
63723
63877
|
|
|
63724
63878
|
const addVChartProperty = (data, op) => {
|
|
63725
63879
|
const context = op.beforeCall();
|
|
@@ -67866,6 +68020,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67866
68020
|
if (spec.label.state) {
|
|
67867
68021
|
axisAttrs.label.state = transformAxisLabelStateStyle(spec.label.state);
|
|
67868
68022
|
}
|
|
68023
|
+
if (isFunction$1(spec.label.dataFilter)) {
|
|
68024
|
+
axisAttrs.label.dataFilter = (data, layer) => spec.label.dataFilter(data, layer, { vchart: this._option.globalInstance });
|
|
68025
|
+
}
|
|
67869
68026
|
}
|
|
67870
68027
|
else {
|
|
67871
68028
|
axisAttrs.label = {
|
|
@@ -67878,7 +68035,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67878
68035
|
length: spec.tick.tickSize,
|
|
67879
68036
|
inside: spec.tick.inside,
|
|
67880
68037
|
alignWithLabel: spec.tick.alignWithLabel,
|
|
67881
|
-
dataFilter: spec.tick.dataFilter
|
|
68038
|
+
dataFilter: isFunction$1(spec.tick.dataFilter)
|
|
68039
|
+
? (data) => spec.tick.dataFilter(data, { vchart: this._option.globalInstance })
|
|
68040
|
+
: undefined
|
|
67882
68041
|
};
|
|
67883
68042
|
if (spec.tick.style) {
|
|
67884
68043
|
axisAttrs.tick.style = isFunction$1(spec.tick.style)
|
|
@@ -71131,58 +71290,83 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71131
71290
|
}
|
|
71132
71291
|
});
|
|
71133
71292
|
}
|
|
71134
|
-
|
|
71293
|
+
filterGraphicsByDatum(datum, opt = {}) {
|
|
71294
|
+
var _a;
|
|
71135
71295
|
datum = datum ? array(datum) : null;
|
|
71136
71296
|
const keys = !datum ? null : Object.keys(datum[0]);
|
|
71137
|
-
|
|
71138
|
-
|
|
71139
|
-
|
|
71140
|
-
|
|
71141
|
-
|
|
71142
|
-
|
|
71143
|
-
|
|
71144
|
-
|
|
71145
|
-
|
|
71146
|
-
}
|
|
71147
|
-
if (!filter || (isFunction$1(filter) && filter(s, m))) {
|
|
71148
|
-
const isCollect = m.getProduct().isCollectionMark();
|
|
71149
|
-
const elements = m.getProduct().elements;
|
|
71150
|
-
let pickElements = [];
|
|
71151
|
-
if (isCollect) {
|
|
71152
|
-
pickElements = elements.filter(e => {
|
|
71153
|
-
const elDatum = e.getDatum();
|
|
71154
|
-
datum.every((d, index) => keys.every(k => d[k] == elDatum[index][k]));
|
|
71155
|
-
});
|
|
71297
|
+
const allElements = [];
|
|
71298
|
+
const getDatumOfElement = (_a = opt.getDatum) !== null && _a !== void 0 ? _a : ((el) => el.getDatum());
|
|
71299
|
+
this.getRegionsInQuerier(opt.region).forEach(r => {
|
|
71300
|
+
const pickElements = [];
|
|
71301
|
+
datum &&
|
|
71302
|
+
r.getSeries().forEach(s => {
|
|
71303
|
+
s.getMarks().forEach(m => {
|
|
71304
|
+
if (!m.getProduct()) {
|
|
71305
|
+
return;
|
|
71156
71306
|
}
|
|
71157
|
-
|
|
71158
|
-
|
|
71159
|
-
|
|
71160
|
-
|
|
71161
|
-
|
|
71162
|
-
|
|
71163
|
-
|
|
71164
|
-
|
|
71165
|
-
|
|
71166
|
-
|
|
71167
|
-
|
|
71168
|
-
return true;
|
|
71307
|
+
if (!opt.filter || (isFunction$1(opt.filter) && opt.filter(s, m))) {
|
|
71308
|
+
const isCollect = m.getProduct().isCollectionMark();
|
|
71309
|
+
const elements = m.getProduct().elements;
|
|
71310
|
+
if (isCollect) {
|
|
71311
|
+
elements.filter(e => {
|
|
71312
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71313
|
+
const isPick = elDatum && datum.every((d, index) => keys.every(k => d[k] == elDatum[index][k]));
|
|
71314
|
+
if (isPick) {
|
|
71315
|
+
pickElements.push(e);
|
|
71316
|
+
allElements.push(e);
|
|
71317
|
+
opt.callback && opt.callback(e, m, s, r);
|
|
71169
71318
|
}
|
|
71170
|
-
return false;
|
|
71171
71319
|
});
|
|
71172
71320
|
}
|
|
71173
71321
|
else {
|
|
71174
|
-
|
|
71175
|
-
|
|
71322
|
+
if (datum.length > 1) {
|
|
71323
|
+
const datumTemp = datum.slice();
|
|
71324
|
+
elements.forEach(e => {
|
|
71325
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71326
|
+
const index = elDatum && datumTemp.findIndex(d => keys.every(k => d[k] == elDatum[k]));
|
|
71327
|
+
if (index >= 0) {
|
|
71328
|
+
datumTemp.splice(index, 1);
|
|
71329
|
+
pickElements.push(e);
|
|
71330
|
+
allElements.push(e);
|
|
71331
|
+
opt.callback && opt.callback(e, m, s, r);
|
|
71332
|
+
}
|
|
71333
|
+
});
|
|
71334
|
+
}
|
|
71335
|
+
else {
|
|
71336
|
+
const el = elements.find(e => {
|
|
71337
|
+
const elDatum = getDatumOfElement(e, m, s, r);
|
|
71338
|
+
return elDatum && keys.every(k => datum[0][k] == elDatum[k]);
|
|
71339
|
+
});
|
|
71340
|
+
if (el) {
|
|
71341
|
+
pickElements.push(el);
|
|
71342
|
+
allElements.push(el);
|
|
71343
|
+
opt.callback && opt.callback(el, m, s, r);
|
|
71344
|
+
}
|
|
71345
|
+
}
|
|
71176
71346
|
}
|
|
71177
71347
|
}
|
|
71178
|
-
|
|
71179
|
-
r.interaction.startInteraction(stateKey, element);
|
|
71180
|
-
});
|
|
71181
|
-
}
|
|
71348
|
+
});
|
|
71182
71349
|
});
|
|
71183
|
-
|
|
71184
|
-
|
|
71185
|
-
|
|
71350
|
+
opt.regionCallback && opt.regionCallback(pickElements, r);
|
|
71351
|
+
});
|
|
71352
|
+
return allElements;
|
|
71353
|
+
}
|
|
71354
|
+
_setStateInDatum(stateKey, checkReverse, datum, filter, region) {
|
|
71355
|
+
this.filterGraphicsByDatum(datum, {
|
|
71356
|
+
filter,
|
|
71357
|
+
region,
|
|
71358
|
+
regionCallback: (elements, r) => {
|
|
71359
|
+
if (!datum) {
|
|
71360
|
+
r.interaction.clearEventElement(stateKey, true);
|
|
71361
|
+
}
|
|
71362
|
+
else if (elements.length) {
|
|
71363
|
+
elements.forEach(e => {
|
|
71364
|
+
r.interaction.startInteraction(stateKey, e);
|
|
71365
|
+
});
|
|
71366
|
+
if (checkReverse) {
|
|
71367
|
+
r.interaction.reverseEventElement(stateKey);
|
|
71368
|
+
}
|
|
71369
|
+
}
|
|
71186
71370
|
}
|
|
71187
71371
|
});
|
|
71188
71372
|
}
|
|
@@ -72782,9 +72966,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72782
72966
|
else if (domainMin > 0) {
|
|
72783
72967
|
return scale.scale(domainMin);
|
|
72784
72968
|
}
|
|
72785
|
-
|
|
72786
|
-
return scale.scale(0);
|
|
72787
|
-
}
|
|
72969
|
+
return scale.scale(0);
|
|
72788
72970
|
}
|
|
72789
72971
|
}
|
|
72790
72972
|
};
|
|
@@ -76992,7 +77174,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76992
77174
|
return data;
|
|
76993
77175
|
}
|
|
76994
77176
|
if (!showAllZero && showEmptyCircle && isDataEmpty(data, angleField, supportNegative)) {
|
|
76995
|
-
return
|
|
77177
|
+
return [];
|
|
76996
77178
|
}
|
|
76997
77179
|
const appendArcInfo = (data, startAngle, angle) => {
|
|
76998
77180
|
data[asStartAngle] = startAngle;
|
|
@@ -77481,6 +77663,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77481
77663
|
}, {
|
|
77482
77664
|
dataView: false
|
|
77483
77665
|
});
|
|
77666
|
+
this._emptyArcMark.setDepend(this._pieMark);
|
|
77484
77667
|
}
|
|
77485
77668
|
}
|
|
77486
77669
|
startAngleScale(datum) {
|
|
@@ -77516,8 +77699,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77516
77699
|
const emptyPieMark = this._emptyArcMark;
|
|
77517
77700
|
if (emptyPieMark) {
|
|
77518
77701
|
this.setMarkStyle(emptyPieMark, Object.assign(Object.assign({}, initialStyle), { visible: () => {
|
|
77519
|
-
const
|
|
77520
|
-
return
|
|
77702
|
+
const data = this.getViewData().latestData;
|
|
77703
|
+
return !data || !data.length;
|
|
77521
77704
|
} }), 'normal', AttributeLevel.Series);
|
|
77522
77705
|
}
|
|
77523
77706
|
}
|
|
@@ -79726,7 +79909,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79726
79909
|
return value;
|
|
79727
79910
|
}
|
|
79728
79911
|
}
|
|
79729
|
-
|
|
79912
|
+
const angle = this.angleAxisHelper.dataToPosition([datum[this._angleField[0]]]);
|
|
79913
|
+
return this._spec.clamp ? valueInScaleRange(angle, this.angleAxisHelper.getScale(0)) : angle;
|
|
79730
79914
|
}
|
|
79731
79915
|
getDimensionField() {
|
|
79732
79916
|
return this._specRadiusField;
|
|
@@ -79759,12 +79943,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79759
79943
|
clip: true,
|
|
79760
79944
|
clipPath: () => {
|
|
79761
79945
|
const axis = this._getAngleAxis();
|
|
79946
|
+
const { x, y } = this.angleAxisHelper.center();
|
|
79947
|
+
const radius = this._computeLayoutRadius();
|
|
79762
79948
|
if (this._isTickMaskVisible(axis)) {
|
|
79763
79949
|
const { tickMask } = this._spec;
|
|
79764
79950
|
const { angle, offsetAngle, style = {} } = tickMask;
|
|
79765
79951
|
const subTickData = this._getAngleAxisSubTickData(axis);
|
|
79766
|
-
const { x, y } = this.angleAxisHelper.center();
|
|
79767
|
-
const radius = this._computeLayoutRadius();
|
|
79768
79952
|
const markStyle = style;
|
|
79769
79953
|
return subTickData.map(({ value }) => {
|
|
79770
79954
|
const pos = this.angleAxisHelper.dataToPosition([value]) + degreeToRadian(offsetAngle);
|
|
@@ -80185,7 +80369,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80185
80369
|
leftPadding);
|
|
80186
80370
|
},
|
|
80187
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)); },
|
|
80188
|
-
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
|
+
},
|
|
80189
80377
|
width: this._spec.bandWidth - leftPadding - rightPadding,
|
|
80190
80378
|
cornerRadius: this._spec.cornerRadius,
|
|
80191
80379
|
fill: this.getColorAttribute()
|
|
@@ -80204,7 +80392,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80204
80392
|
topPadding);
|
|
80205
80393
|
},
|
|
80206
80394
|
height: this._spec.bandWidth - topPadding - bottomPadding,
|
|
80207
|
-
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
|
+
},
|
|
80208
80400
|
cornerRadius: this._spec.cornerRadius,
|
|
80209
80401
|
fill: this.getColorAttribute()
|
|
80210
80402
|
}, 'normal', AttributeLevel.Series);
|
|
@@ -87640,12 +87832,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87640
87832
|
_getAngleValueStartWithoutMask(datum) {
|
|
87641
87833
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87642
87834
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87643
|
-
|
|
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;
|
|
87644
87837
|
}
|
|
87645
87838
|
_getAngleValueEndWithoutMask(datum) {
|
|
87646
87839
|
const startAngle = this._getAngleValueStartWithoutPadAngle(datum);
|
|
87647
87840
|
const endAngle = this._getAngleValueEndWithoutPadAngle(datum);
|
|
87648
|
-
|
|
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;
|
|
87649
87843
|
}
|
|
87650
87844
|
_getAngleValueStartWithoutPadAngle(datum) {
|
|
87651
87845
|
return isValid$1(datum[SEGMENT_FIELD_START])
|
|
@@ -89956,21 +90150,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89956
90150
|
return isValid$1(attr) && attr !== 'none' && !((_a = attr.includes) === null || _a === void 0 ? void 0 : _a.call(attr, 'url'));
|
|
89957
90151
|
}
|
|
89958
90152
|
const getLineWidth = (attributes) => {
|
|
89959
|
-
const strokeWidth = parseFloat(attributes
|
|
90153
|
+
const strokeWidth = parseFloat(attributes.strokeWidth);
|
|
89960
90154
|
if (!isNaN(strokeWidth)) {
|
|
89961
90155
|
return strokeWidth;
|
|
89962
90156
|
}
|
|
89963
|
-
const stroke = attributes
|
|
90157
|
+
const stroke = attributes.stroke;
|
|
89964
90158
|
return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
|
|
89965
90159
|
};
|
|
89966
90160
|
const getFill = (attributes, defaultFill) => {
|
|
89967
90161
|
var _a;
|
|
89968
|
-
const fill = (_a = attributes
|
|
90162
|
+
const fill = (_a = attributes.fill) !== null && _a !== void 0 ? _a : defaultFill;
|
|
89969
90163
|
return fill && isValidStrokeOrFill(fill) ? fill : undefined;
|
|
89970
90164
|
};
|
|
89971
90165
|
const getStroke = (attributes, defaultStroke) => {
|
|
89972
90166
|
var _a;
|
|
89973
|
-
const stroke = (_a = attributes
|
|
90167
|
+
const stroke = (_a = attributes.stroke) !== null && _a !== void 0 ? _a : defaultStroke;
|
|
89974
90168
|
return stroke && isValidStrokeOrFill(stroke) ? stroke : false;
|
|
89975
90169
|
};
|
|
89976
90170
|
const commonAttributes = (attributes) => {
|
|
@@ -89979,7 +90173,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89979
90173
|
const graphicAttributeTransform = {
|
|
89980
90174
|
group: (attributes) => {
|
|
89981
90175
|
const common = commonAttributes(attributes);
|
|
89982
|
-
return Object.assign(Object.assign({}, common), { visibleAll: common
|
|
90176
|
+
return Object.assign(Object.assign({}, common), { visibleAll: common.visible !== false });
|
|
89983
90177
|
},
|
|
89984
90178
|
rule: (attributes) => {
|
|
89985
90179
|
return Object.assign(Object.assign({}, commonAttributes(attributes)), { x: parseFloat(attributes.x1), y: parseFloat(attributes.y1), x1: parseFloat(attributes.x2), y1: parseFloat(attributes.y2) });
|
|
@@ -90030,7 +90224,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90030
90224
|
el._uniqueId = `${el.id}-${index}`;
|
|
90031
90225
|
el.data = undefined;
|
|
90032
90226
|
const { graphicType: type, transform } = el;
|
|
90033
|
-
|
|
90227
|
+
const finalAttributes = {
|
|
90034
90228
|
visible: el.attributes.visibility !== 'hidden' && el.attributes.visibility !== 'collapse'
|
|
90035
90229
|
};
|
|
90036
90230
|
if (el.graphicType === 'text') {
|
|
@@ -90065,7 +90259,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90065
90259
|
return result;
|
|
90066
90260
|
});
|
|
90067
90261
|
if (children && children.length) {
|
|
90068
|
-
|
|
90262
|
+
const startX = (_b = (_a = texts[i]._textGroupStyle) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : 0;
|
|
90069
90263
|
let curX = startX;
|
|
90070
90264
|
for (let j = 0; j < children.length; j++) {
|
|
90071
90265
|
const currentChild = children[j];
|
|
@@ -91592,7 +91786,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91592
91786
|
}
|
|
91593
91787
|
_getDefaultSeriesSpec(spec) {
|
|
91594
91788
|
var _a, _b;
|
|
91595
|
-
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track']);
|
|
91789
|
+
const series = super._getDefaultSeriesSpec(spec, ['bandWidth', 'progress', 'track', 'clamp']);
|
|
91596
91790
|
series.direction = (_a = spec.direction) !== null && _a !== void 0 ? _a : 'horizontal';
|
|
91597
91791
|
series.cornerRadius = (_b = spec.cornerRadius) !== null && _b !== void 0 ? _b : 0;
|
|
91598
91792
|
return series;
|
|
@@ -92041,49 +92235,40 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92041
92235
|
}
|
|
92042
92236
|
_setStateInDatum(stateKey, checkReverse, datum, filter, region) {
|
|
92043
92237
|
const activeDatum = isArray$1(datum) ? datum[0] : datum;
|
|
92044
|
-
const
|
|
92045
|
-
|
|
92046
|
-
|
|
92047
|
-
|
|
92048
|
-
|
|
92049
|
-
|
|
92050
|
-
|
|
92051
|
-
|
|
92052
|
-
|
|
92053
|
-
|
|
92054
|
-
|
|
92055
|
-
|
|
92056
|
-
|
|
92057
|
-
|
|
92058
|
-
|
|
92059
|
-
|
|
92060
|
-
|
|
92061
|
-
|
|
92062
|
-
}
|
|
92063
|
-
|
|
92064
|
-
|
|
92065
|
-
|
|
92066
|
-
|
|
92067
|
-
|
|
92068
|
-
|
|
92069
|
-
|
|
92070
|
-
|
|
92071
|
-
|
|
92072
|
-
|
|
92073
|
-
|
|
92074
|
-
|
|
92075
|
-
r.interaction.
|
|
92076
|
-
if (mark.id().includes('node') || mark.id().includes('link')) {
|
|
92077
|
-
activeNodeOrLink = pickElement;
|
|
92078
|
-
}
|
|
92238
|
+
const markFilter = (series, mark) => {
|
|
92239
|
+
return mark.type !== 'text' && mark.getProduct() && (!filter || filter(series, mark));
|
|
92240
|
+
};
|
|
92241
|
+
this.filterGraphicsByDatum(activeDatum, {
|
|
92242
|
+
filter: markFilter,
|
|
92243
|
+
region,
|
|
92244
|
+
getDatum: e => {
|
|
92245
|
+
var _a;
|
|
92246
|
+
let d = (_a = e.getDatum()) === null || _a === void 0 ? void 0 : _a.datum;
|
|
92247
|
+
if (isArray$1(d)) {
|
|
92248
|
+
d = d[0];
|
|
92249
|
+
}
|
|
92250
|
+
return d;
|
|
92251
|
+
},
|
|
92252
|
+
callback: (element, mark, s, r) => {
|
|
92253
|
+
var _a, _b, _c;
|
|
92254
|
+
const id = (_a = mark.getProduct()) === null || _a === void 0 ? void 0 : _a.id();
|
|
92255
|
+
if (id && (id.includes('node') || id.includes('link'))) {
|
|
92256
|
+
(_c = (_b = s)._handleEmphasisElement) === null || _c === void 0 ? void 0 : _c.call(_b, { item: element });
|
|
92257
|
+
}
|
|
92258
|
+
},
|
|
92259
|
+
regionCallback: (elements, r) => {
|
|
92260
|
+
if (!activeDatum) {
|
|
92261
|
+
r.interaction.clearEventElement(stateKey, true);
|
|
92262
|
+
return;
|
|
92263
|
+
}
|
|
92264
|
+
else if (elements.length) {
|
|
92265
|
+
elements.forEach(e => {
|
|
92266
|
+
r.interaction.startInteraction(stateKey, e);
|
|
92267
|
+
});
|
|
92268
|
+
if (checkReverse) {
|
|
92269
|
+
r.interaction.reverseEventElement(stateKey);
|
|
92079
92270
|
}
|
|
92080
|
-
});
|
|
92081
|
-
if (activeNodeOrLink) {
|
|
92082
|
-
(_b = (_a = s)._handleEmphasisElement) === null || _b === void 0 ? void 0 : _b.call(_a, { item: activeNodeOrLink });
|
|
92083
92271
|
}
|
|
92084
|
-
});
|
|
92085
|
-
if (checkReverse && hasPick) {
|
|
92086
|
-
r.interaction.reverseEventElement(stateKey);
|
|
92087
92272
|
}
|
|
92088
92273
|
});
|
|
92089
92274
|
}
|
|
@@ -94463,7 +94648,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94463
94648
|
Object.keys(this._stateByField).forEach(field => {
|
|
94464
94649
|
const fieldSpec = this._spec[field];
|
|
94465
94650
|
if (fieldSpec && fieldSpec.visible && fieldSpec.defaultSelect) {
|
|
94466
|
-
const { axisIndex, datum } = fieldSpec.defaultSelect;
|
|
94651
|
+
const { axisIndex = 0, datum } = fieldSpec.defaultSelect;
|
|
94467
94652
|
const axis = this._option.getComponentsByKey('axes').find(c => c.getSpecIndex() === axisIndex);
|
|
94468
94653
|
if (axis) {
|
|
94469
94654
|
this._stateByField[field].currentValue.clear();
|
|
@@ -95019,36 +95204,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
95019
95204
|
};
|
|
95020
95205
|
}
|
|
95021
95206
|
else if (type === 'rect') {
|
|
95022
|
-
const
|
|
95207
|
+
const [offset0, offset1] = getRectSize(attributes, bandSize, offsetSize, cacheInfo.axis);
|
|
95023
95208
|
const { coordRange } = cacheInfo;
|
|
95024
95209
|
positionAttribute = {
|
|
95025
95210
|
visible: true,
|
|
95026
95211
|
start: {
|
|
95027
|
-
[coordKey]: Math.max(coord
|
|
95212
|
+
[coordKey]: Math.max(coord + offset0, coordRange[0]),
|
|
95028
95213
|
[anotherAxisKey]: sizeRange[0]
|
|
95029
95214
|
},
|
|
95030
95215
|
end: {
|
|
95031
|
-
[coordKey]: Math.min(coord +
|
|
95216
|
+
[coordKey]: Math.min(coord + offset1, coordRange[1]),
|
|
95032
95217
|
[anotherAxisKey]: sizeRange[1]
|
|
95033
95218
|
}
|
|
95034
95219
|
};
|
|
95035
95220
|
}
|
|
95036
95221
|
return positionAttribute;
|
|
95037
95222
|
};
|
|
95038
|
-
const getRectSize = (hair, bandSize, axis) => {
|
|
95223
|
+
const getRectSize = (hair, bandSize, offsetSize, axis) => {
|
|
95039
95224
|
var _a, _b, _c;
|
|
95040
|
-
|
|
95225
|
+
const visualSize = bandSize === 0 ? offsetSize : bandSize;
|
|
95226
|
+
let size = visualSize;
|
|
95041
95227
|
if ((_a = hair.style) === null || _a === void 0 ? void 0 : _a.sizePercent) {
|
|
95042
|
-
|
|
95228
|
+
size = visualSize * hair.style.sizePercent;
|
|
95043
95229
|
}
|
|
95044
95230
|
else if (typeof ((_b = hair.style) === null || _b === void 0 ? void 0 : _b.size) === 'number') {
|
|
95045
|
-
|
|
95231
|
+
size = hair.style.size;
|
|
95046
95232
|
}
|
|
95047
95233
|
else if (typeof ((_c = hair.style) === null || _c === void 0 ? void 0 : _c.size) === 'function') {
|
|
95048
95234
|
const axisRect = axis.getLayoutRect();
|
|
95049
|
-
|
|
95235
|
+
size = hair.style.size(axisRect, axis);
|
|
95050
95236
|
}
|
|
95051
|
-
return
|
|
95237
|
+
return bandSize === 0 ? [-size / 2, size / 2] : [bandSize / 2 - size / 2, size / 2 + bandSize / 2];
|
|
95052
95238
|
};
|
|
95053
95239
|
|
|
95054
95240
|
class CartesianCrossHair extends BaseCrossHair {
|
|
@@ -97538,17 +97724,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97538
97724
|
}
|
|
97539
97725
|
return offset;
|
|
97540
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
|
+
}
|
|
97541
97741
|
function getMarkLineProcessInfo(spec) {
|
|
97542
|
-
const isXProcess
|
|
97543
|
-
const isYProcess = 'y' in spec;
|
|
97544
|
-
const isX1Process = 'x1' in spec;
|
|
97545
|
-
const isY1Process = 'y1' in spec;
|
|
97546
|
-
const isAngleProcess = 'angle' in spec;
|
|
97547
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97548
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97549
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97550
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97551
|
-
const isValidProcess = 'process' in spec;
|
|
97742
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess, isValidProcess } = getProcessInfo(spec);
|
|
97552
97743
|
return {
|
|
97553
97744
|
doXProcess: isXProcess && !isYProcess && !isY1Process,
|
|
97554
97745
|
doXYY1Process: isXProcess && isYProcess && isY1Process,
|
|
@@ -97564,15 +97755,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97564
97755
|
};
|
|
97565
97756
|
}
|
|
97566
97757
|
function getMarkAreaProcessInfo(spec) {
|
|
97567
|
-
const isXProcess
|
|
97568
|
-
const isX1Process = 'x1' in spec;
|
|
97569
|
-
const isYProcess = 'y' in spec;
|
|
97570
|
-
const isY1Process = 'y1' in spec;
|
|
97571
|
-
const isAngleProcess = 'angle' in spec;
|
|
97572
|
-
const isRadiusProcess = 'radius' in spec;
|
|
97573
|
-
const isAngle1Process = 'angle1' in spec;
|
|
97574
|
-
const isRadius1Process = 'radius1' in spec;
|
|
97575
|
-
const isCoordinatesProcess = 'coordinates' in spec;
|
|
97758
|
+
const { isXProcess, isYProcess, isX1Process, isY1Process, isAngleProcess, isRadiusProcess, isAngle1Process, isRadius1Process, isCoordinatesProcess } = getProcessInfo(spec);
|
|
97576
97759
|
return {
|
|
97577
97760
|
doXProcess: isXProcess && isX1Process && !isYProcess && !isY1Process,
|
|
97578
97761
|
doYProcess: isYProcess && isY1Process && !isXProcess && !isX1Process,
|
|
@@ -98090,13 +98273,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98090
98273
|
return 'cartesian';
|
|
98091
98274
|
}
|
|
98092
98275
|
_createMarkerComponent() {
|
|
98093
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
98094
|
-
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 : {});
|
|
98095
98279
|
const markLineAttrs = {
|
|
98096
98280
|
zIndex: this.layoutZIndex,
|
|
98097
|
-
interactive: (
|
|
98098
|
-
hover: (
|
|
98099
|
-
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,
|
|
98100
98284
|
points: [
|
|
98101
98285
|
{ x: 0, y: 0 },
|
|
98102
98286
|
{ x: 0, y: 0 }
|
|
@@ -98108,17 +98292,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98108
98292
|
radius: 0,
|
|
98109
98293
|
startAngle: 0,
|
|
98110
98294
|
endAngle: 0,
|
|
98111
|
-
lineStyle: transformStyle(transformToGraphic((
|
|
98112
|
-
clipInRange: (
|
|
98113
|
-
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
|
+
}),
|
|
98114
98300
|
state: {
|
|
98115
|
-
line: transformState((
|
|
98116
|
-
lineStartSymbol: transformState((
|
|
98117
|
-
lineEndSymbol: transformState((
|
|
98118
|
-
label:
|
|
98119
|
-
|
|
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
|
+
})
|
|
98120
98312
|
},
|
|
98121
|
-
animation: (
|
|
98313
|
+
animation: (_o = this._spec.animation) !== null && _o !== void 0 ? _o : false,
|
|
98122
98314
|
animationEnter: this._spec.animationEnter,
|
|
98123
98315
|
animationExit: this._spec.animationExit,
|
|
98124
98316
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98143,7 +98335,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98143
98335
|
return markLine;
|
|
98144
98336
|
}
|
|
98145
98337
|
_getUpdateMarkerAttrs() {
|
|
98146
|
-
var _a, _b
|
|
98338
|
+
var _a, _b;
|
|
98147
98339
|
const spec = this._spec;
|
|
98148
98340
|
const data = this._markerData;
|
|
98149
98341
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98153,7 +98345,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98153
98345
|
const seriesData = relativeSeries.getViewData().latestData;
|
|
98154
98346
|
const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
98155
98347
|
let limitRect;
|
|
98156
|
-
if (spec.clip || (
|
|
98348
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98157
98349
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98158
98350
|
startRelativeSeries.getRegion(),
|
|
98159
98351
|
endRelativeSeries.getRegion(),
|
|
@@ -98166,10 +98358,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98166
98358
|
height: maxY - minY
|
|
98167
98359
|
};
|
|
98168
98360
|
}
|
|
98169
|
-
const markerComponentAttr = (
|
|
98170
|
-
const
|
|
98171
|
-
|
|
98172
|
-
|
|
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
|
+
});
|
|
98173
98368
|
return Object.assign(Object.assign({}, pointsAttr), { label: labelAttrs, limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY });
|
|
98174
98369
|
}
|
|
98175
98370
|
_markerLayout() {
|
|
@@ -98271,7 +98466,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98271
98466
|
return { points };
|
|
98272
98467
|
}
|
|
98273
98468
|
_markerLayout() {
|
|
98274
|
-
var _a, _b, _c, _d
|
|
98469
|
+
var _a, _b, _c, _d;
|
|
98275
98470
|
const updateAttrs = this._getUpdateMarkerAttrs();
|
|
98276
98471
|
if (this._spec.type === 'type-step') {
|
|
98277
98472
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98298,34 +98493,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98298
98493
|
else {
|
|
98299
98494
|
expandDistanceValue = expandDistance;
|
|
98300
98495
|
}
|
|
98301
|
-
const { points,
|
|
98496
|
+
const { points, limitRect } = updateAttrs;
|
|
98302
98497
|
const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
|
|
98303
98498
|
let labelPositionAttrs;
|
|
98304
98499
|
if (multiSegment && isValid$1(mainSegmentIndex)) {
|
|
98305
98500
|
labelPositionAttrs = {
|
|
98306
98501
|
position: 'middle',
|
|
98307
|
-
autoRotate: false
|
|
98308
|
-
refX: 0,
|
|
98309
|
-
refY: 0
|
|
98502
|
+
autoRotate: false
|
|
98310
98503
|
};
|
|
98311
98504
|
}
|
|
98312
98505
|
else {
|
|
98313
|
-
labelPositionAttrs = Object.assign(
|
|
98314
|
-
}
|
|
98315
|
-
if (isValidNumber$1((_a = this._spec.label) === null || _a === void 0 ? void 0 : _a.refX)) {
|
|
98316
|
-
labelPositionAttrs.refX += this._spec.label.refX;
|
|
98317
|
-
}
|
|
98318
|
-
if (isValidNumber$1((_b = this._spec.label) === null || _b === void 0 ? void 0 : _b.refY)) {
|
|
98319
|
-
labelPositionAttrs.refY += this._spec.label.refY;
|
|
98320
|
-
}
|
|
98321
|
-
if (isValidNumber$1((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.dx)) {
|
|
98322
|
-
labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + this._spec.label.dx;
|
|
98506
|
+
labelPositionAttrs = Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
|
|
98323
98507
|
}
|
|
98324
|
-
|
|
98325
|
-
|
|
98326
|
-
|
|
98327
|
-
const
|
|
98328
|
-
(
|
|
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({
|
|
98329
98513
|
points: multiSegment
|
|
98330
98514
|
? [
|
|
98331
98515
|
[joinPoints[0], joinPoints[1]],
|
|
@@ -98333,7 +98517,30 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98333
98517
|
[joinPoints[2], joinPoints[3]]
|
|
98334
98518
|
]
|
|
98335
98519
|
: joinPoints,
|
|
98336
|
-
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
|
+
}),
|
|
98337
98544
|
limitRect,
|
|
98338
98545
|
multiSegment,
|
|
98339
98546
|
mainSegmentIndex,
|
|
@@ -98342,7 +98549,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98342
98549
|
});
|
|
98343
98550
|
}
|
|
98344
98551
|
else {
|
|
98345
|
-
(
|
|
98552
|
+
(_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes(updateAttrs);
|
|
98346
98553
|
}
|
|
98347
98554
|
}
|
|
98348
98555
|
_computeOptions() {
|
|
@@ -98406,15 +98613,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98406
98613
|
type: 'markerAggregation',
|
|
98407
98614
|
options
|
|
98408
98615
|
});
|
|
98409
|
-
if (spec.process &&
|
|
98616
|
+
if (spec.process && isValid$1(spec.process.x)) {
|
|
98410
98617
|
options = [this._processSpecByDims([{ dim: 'x', specValue: spec.process.x }])];
|
|
98411
98618
|
needAggr = true;
|
|
98412
98619
|
}
|
|
98413
|
-
if (spec.process &&
|
|
98620
|
+
if (spec.process && isValid$1(spec.process.y)) {
|
|
98414
98621
|
options = options = [this._processSpecByDims([{ dim: 'y', specValue: spec.process.y }])];
|
|
98415
98622
|
needAggr = true;
|
|
98416
98623
|
}
|
|
98417
|
-
if (spec.process &&
|
|
98624
|
+
if (spec.process && isValid$1(spec.process.xy)) {
|
|
98418
98625
|
const { xField, yField } = relativeSeries.getSpec();
|
|
98419
98626
|
options = {
|
|
98420
98627
|
fieldX: xField,
|
|
@@ -98696,8 +98903,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98696
98903
|
return 'cartesian';
|
|
98697
98904
|
}
|
|
98698
98905
|
_createMarkerComponent() {
|
|
98699
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
98700
|
-
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 : {});
|
|
98701
98908
|
const markAreaAttrs = {
|
|
98702
98909
|
zIndex: this.layoutZIndex,
|
|
98703
98910
|
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
@@ -98719,13 +98926,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98719
98926
|
endAngle: 0,
|
|
98720
98927
|
areaStyle: transformStyle(transformToGraphic((_e = this._spec.area) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98721
98928
|
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98722
|
-
label:
|
|
98929
|
+
label: label.map((labelItem) => {
|
|
98930
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98931
|
+
}),
|
|
98723
98932
|
state: {
|
|
98724
98933
|
area: transformState((_g = this._spec.area) === null || _g === void 0 ? void 0 : _g.state, this._markerData, this._markAttributeContext),
|
|
98725
|
-
label:
|
|
98726
|
-
|
|
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
|
+
})
|
|
98727
98941
|
},
|
|
98728
|
-
animation: (
|
|
98942
|
+
animation: (_h = this._spec.animation) !== null && _h !== void 0 ? _h : false,
|
|
98729
98943
|
animationEnter: this._spec.animationEnter,
|
|
98730
98944
|
animationExit: this._spec.animationExit,
|
|
98731
98945
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98734,7 +98948,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98734
98948
|
return markArea;
|
|
98735
98949
|
}
|
|
98736
98950
|
_markerLayout() {
|
|
98737
|
-
var _a
|
|
98951
|
+
var _a;
|
|
98738
98952
|
const spec = this._spec;
|
|
98739
98953
|
const data = this._markerData;
|
|
98740
98954
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98748,7 +98962,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98748
98962
|
: data.latestData
|
|
98749
98963
|
: seriesData;
|
|
98750
98964
|
let limitRect;
|
|
98751
|
-
if (spec.clip || (
|
|
98965
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98752
98966
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98753
98967
|
startRelativeSeries.getRegion(),
|
|
98754
98968
|
endRelativeSeries.getRegion(),
|
|
@@ -98762,10 +98976,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98762
98976
|
};
|
|
98763
98977
|
}
|
|
98764
98978
|
if (this._markerComponent) {
|
|
98765
|
-
|
|
98766
|
-
|
|
98767
|
-
|
|
98768
|
-
|
|
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 }));
|
|
98769
98988
|
}
|
|
98770
98989
|
}
|
|
98771
98990
|
_initDataView() {
|
|
@@ -99994,9 +100213,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99994
100213
|
const spec = this._spec;
|
|
99995
100214
|
const data = this._markerData;
|
|
99996
100215
|
const relativeSeries = this._relativeSeries;
|
|
99997
|
-
const isXYLayout =
|
|
99998
|
-
const isCoordinateLayout =
|
|
99999
|
-
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);
|
|
100000
100219
|
const autoRange = (_a = spec === null || spec === void 0 ? void 0 : spec.autoRange) !== null && _a !== void 0 ? _a : false;
|
|
100001
100220
|
let point;
|
|
100002
100221
|
if (isXYLayout) {
|
|
@@ -100119,7 +100338,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100119
100338
|
this._outOfBrushElementsMap = {};
|
|
100120
100339
|
this._linkedInBrushElementsMap = {};
|
|
100121
100340
|
this._linkedOutOfBrushElementsMap = {};
|
|
100122
|
-
this._needInitOutState = true;
|
|
100123
100341
|
this._cacheInteractiveRangeAttrs = [];
|
|
100124
100342
|
this._needDisablePickable = false;
|
|
100125
100343
|
this._releatedAxes = [];
|
|
@@ -100127,6 +100345,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100127
100345
|
this._axisDataZoomMap = {};
|
|
100128
100346
|
this._zoomRecord = [];
|
|
100129
100347
|
}
|
|
100348
|
+
static getSpecInfo(chartSpec) {
|
|
100349
|
+
return getSpecInfo(chartSpec, this.specKey, this.type, (s) => {
|
|
100350
|
+
return s.visible !== false;
|
|
100351
|
+
});
|
|
100352
|
+
}
|
|
100130
100353
|
init() {
|
|
100131
100354
|
const inBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.inBrush);
|
|
100132
100355
|
const outOfBrushMarkAttr = this._transformBrushedMarkAttr(this._spec.outOfBrush);
|
|
@@ -100139,9 +100362,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100139
100362
|
});
|
|
100140
100363
|
});
|
|
100141
100364
|
}
|
|
100142
|
-
|
|
100143
|
-
|
|
100144
|
-
|
|
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();
|
|
100145
100381
|
});
|
|
100146
100382
|
}
|
|
100147
100383
|
created() {
|
|
@@ -100153,41 +100389,91 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100153
100389
|
this._initAxisDataZoomMap();
|
|
100154
100390
|
this._initNeedOperatedItem();
|
|
100155
100391
|
}
|
|
100156
|
-
|
|
100157
|
-
|
|
100158
|
-
|
|
100159
|
-
|
|
100160
|
-
|
|
100161
|
-
|
|
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;
|
|
100162
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
|
+
});
|
|
100163
100449
|
}
|
|
100164
|
-
|
|
100450
|
+
const result = super._compareSpec(spec, prevSpec);
|
|
100451
|
+
if (!isEqual(prevSpec, spec)) {
|
|
100452
|
+
result.reRender = true;
|
|
100453
|
+
result.reMake = true;
|
|
100454
|
+
}
|
|
100455
|
+
return result;
|
|
100165
100456
|
}
|
|
100166
|
-
|
|
100457
|
+
onLayoutEnd(ctx) {
|
|
100167
100458
|
var _a;
|
|
100168
|
-
|
|
100169
|
-
|
|
100170
|
-
|
|
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
|
+
}
|
|
100171
100476
|
}
|
|
100172
|
-
return data;
|
|
100173
|
-
}
|
|
100174
|
-
_getBrushInteractiveAttr(region) {
|
|
100175
|
-
const regionLayoutPosition = region.getLayoutStartPoint();
|
|
100176
|
-
const regionLayoutRect = region.getLayoutRect();
|
|
100177
|
-
const seriesRegionStartX = regionLayoutPosition.x;
|
|
100178
|
-
const seriesRegionEndX = seriesRegionStartX + regionLayoutRect.width;
|
|
100179
|
-
const seriesRegionStartY = regionLayoutPosition.y;
|
|
100180
|
-
const seriesRegionEndY = seriesRegionStartY + regionLayoutRect.height;
|
|
100181
|
-
return {
|
|
100182
|
-
interactiveRange: {
|
|
100183
|
-
minY: seriesRegionStartY,
|
|
100184
|
-
maxY: seriesRegionEndY,
|
|
100185
|
-
minX: seriesRegionStartX,
|
|
100186
|
-
maxX: seriesRegionEndX
|
|
100187
|
-
},
|
|
100188
|
-
xRange: [seriesRegionStartX, seriesRegionEndX],
|
|
100189
|
-
yRange: [seriesRegionStartY, seriesRegionEndY]
|
|
100190
|
-
};
|
|
100191
100477
|
}
|
|
100192
100478
|
_updateBrushComponent(region, componentIndex) {
|
|
100193
100479
|
const interactiveAttr = this._getBrushInteractiveAttr(region);
|
|
@@ -100195,7 +100481,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100195
100481
|
brushComponent.setAttributes(interactiveAttr);
|
|
100196
100482
|
this._initMarkBrushState(componentIndex, '');
|
|
100197
100483
|
brushComponent.children[0].removeAllChild();
|
|
100198
|
-
this._needInitOutState = true;
|
|
100199
100484
|
}
|
|
100200
100485
|
_createBrushComponent(region, componentIndex) {
|
|
100201
100486
|
var _a, _b;
|
|
@@ -100203,9 +100488,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100203
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 }));
|
|
100204
100489
|
brush.id = (_b = this._spec.id) !== null && _b !== void 0 ? _b : `brush-${this.id}`;
|
|
100205
100490
|
this.getContainer().add(brush);
|
|
100206
|
-
const { brushMode = 'single' } = this._spec;
|
|
100207
100491
|
this._brushComponents.push(brush);
|
|
100208
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
|
+
});
|
|
100209
100497
|
brush.addEventListener(IOperateType.drawStart, (e) => {
|
|
100210
100498
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100211
100499
|
});
|
|
@@ -100213,41 +100501,45 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100213
100501
|
this._emitEvent(ChartEvent.brushStart, region);
|
|
100214
100502
|
});
|
|
100215
100503
|
brush.addEventListener(IOperateType.drawing, (e) => {
|
|
100216
|
-
if (this._needInitOutState && brushMode === 'single') {
|
|
100217
|
-
this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
|
|
100218
|
-
}
|
|
100219
|
-
this._needInitOutState = false;
|
|
100220
100504
|
this._needDisablePickable = true;
|
|
100221
|
-
this._handleBrushChange(
|
|
100505
|
+
this._handleBrushChange(region, e);
|
|
100222
100506
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100223
100507
|
});
|
|
100224
100508
|
brush.addEventListener(IOperateType.moving, (e) => {
|
|
100225
|
-
this._handleBrushChange(
|
|
100509
|
+
this._handleBrushChange(region, e);
|
|
100226
100510
|
this._emitEvent(ChartEvent.brushChange, region);
|
|
100227
100511
|
});
|
|
100228
100512
|
brush.addEventListener(IOperateType.brushClear, (e) => {
|
|
100229
100513
|
this._initMarkBrushState(componentIndex, '');
|
|
100230
|
-
this._needInitOutState = true;
|
|
100231
100514
|
this._needDisablePickable = false;
|
|
100232
|
-
this._handleBrushChange(ChartEvent.brushChange, region, e);
|
|
100233
|
-
this._handleBrushChange(ChartEvent.brushClear, region, e);
|
|
100234
|
-
this._emitEvent(ChartEvent.brushChange, region);
|
|
100235
100515
|
this._emitEvent(ChartEvent.brushClear, region);
|
|
100236
100516
|
});
|
|
100237
100517
|
brush.addEventListener(IOperateType.drawEnd, (e) => {
|
|
100238
|
-
|
|
100518
|
+
var _a;
|
|
100239
100519
|
this._needDisablePickable = false;
|
|
100240
100520
|
const { operateMask } = e.detail;
|
|
100241
|
-
this.
|
|
100242
|
-
|
|
100243
|
-
|
|
100244
|
-
|
|
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);
|
|
100245
100539
|
}
|
|
100246
|
-
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100247
100540
|
});
|
|
100248
100541
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
100249
100542
|
const { operateMask } = e.detail;
|
|
100250
|
-
this._handleBrushChange(ChartEvent.brushEnd, region, e);
|
|
100251
100543
|
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
100252
100544
|
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
100253
100545
|
this._setAxisAndDataZoom(operateMask, region);
|
|
@@ -100255,12 +100547,65 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100255
100547
|
this._emitEvent(ChartEvent.brushEnd, region);
|
|
100256
100548
|
});
|
|
100257
100549
|
}
|
|
100258
|
-
|
|
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) {
|
|
100259
100585
|
const { operateMask } = e.detail;
|
|
100260
100586
|
this._reconfigItem(operateMask, region);
|
|
100261
100587
|
this._reconfigLinkedItem(operateMask, region);
|
|
100262
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
|
+
}
|
|
100263
100607
|
_emitEvent(eventType, region) {
|
|
100608
|
+
var _a;
|
|
100264
100609
|
this.event.emit(eventType, {
|
|
100265
100610
|
model: this,
|
|
100266
100611
|
value: {
|
|
@@ -100275,27 +100620,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100275
100620
|
linkedInBrushElementsMap: this._linkedInBrushElementsMap,
|
|
100276
100621
|
linkedOutOfBrushElementsMap: this._linkedOutOfBrushElementsMap,
|
|
100277
100622
|
zoomRecord: this._zoomRecord
|
|
100278
|
-
}
|
|
100623
|
+
},
|
|
100624
|
+
vchart: (_a = this._option) === null || _a === void 0 ? void 0 : _a.globalInstance
|
|
100279
100625
|
});
|
|
100280
100626
|
}
|
|
100281
|
-
_transformBrushedMarkAttr(brushedStyle) {
|
|
100282
|
-
const styleResult = {};
|
|
100283
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbol) {
|
|
100284
|
-
styleResult.symbolType = brushedStyle.symbol;
|
|
100285
|
-
}
|
|
100286
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.symbolSize) {
|
|
100287
|
-
styleResult.size = brushedStyle.symbolSize;
|
|
100288
|
-
}
|
|
100289
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.color) {
|
|
100290
|
-
styleResult.fill = brushedStyle.color;
|
|
100291
|
-
}
|
|
100292
|
-
if (brushedStyle === null || brushedStyle === void 0 ? void 0 : brushedStyle.colorAlpha) {
|
|
100293
|
-
styleResult.fillOpacity = brushedStyle.colorAlpha;
|
|
100294
|
-
}
|
|
100295
|
-
return Object.assign(Object.assign({}, transformToGraphic(brushedStyle)), styleResult);
|
|
100296
|
-
}
|
|
100297
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;
|
|
100298
100641
|
this._itemMap[region.id].forEach((mark) => {
|
|
100642
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100643
|
+
return;
|
|
100644
|
+
}
|
|
100299
100645
|
const grammarMark = mark.getProduct();
|
|
100300
100646
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100301
100647
|
return;
|
|
@@ -100305,7 +100651,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100305
100651
|
var _a, _b, _c;
|
|
100306
100652
|
const graphicItem = el.getGraphicItem();
|
|
100307
100653
|
const elementKey = mark.id + '_' + el.key;
|
|
100308
|
-
|
|
100654
|
+
const isBrushContainItem = this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem);
|
|
100655
|
+
if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && isBrushContainItem) {
|
|
100309
100656
|
el.addState(IN_BRUSH_STATE);
|
|
100310
100657
|
if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100311
100658
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100313,8 +100660,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100313
100660
|
this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name][elementKey] = el;
|
|
100314
100661
|
delete this._outOfBrushElementsMap[elementKey];
|
|
100315
100662
|
}
|
|
100316
|
-
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]) &&
|
|
100317
|
-
!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) {
|
|
100318
100664
|
el.removeState(IN_BRUSH_STATE);
|
|
100319
100665
|
el.addState(OUT_BRUSH_STATE);
|
|
100320
100666
|
this._outOfBrushElementsMap[elementKey] = el;
|
|
@@ -100325,14 +100671,36 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100325
100671
|
});
|
|
100326
100672
|
}
|
|
100327
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
|
+
}
|
|
100328
100678
|
const regionLayoutPos = region.getLayoutStartPoint();
|
|
100329
100679
|
const seriesId = region.getSeries().map(s => s.id);
|
|
100330
100680
|
this._linkedSeries.forEach((s) => {
|
|
100681
|
+
var _a, _b;
|
|
100331
100682
|
if (!seriesId.includes(s.id)) {
|
|
100332
100683
|
const sRegionLayoutPos = s.getRegion().getLayoutStartPoint();
|
|
100333
100684
|
const regionOffsetX = sRegionLayoutPos.x - regionLayoutPos.x;
|
|
100334
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;
|
|
100335
100700
|
this._linkedItemMap[s.id].forEach((mark) => {
|
|
100701
|
+
if (markTypeFilter.includes(mark.type)) {
|
|
100702
|
+
return;
|
|
100703
|
+
}
|
|
100336
100704
|
const grammarMark = mark.getProduct();
|
|
100337
100705
|
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100338
100706
|
return;
|
|
@@ -100343,7 +100711,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100343
100711
|
const graphicItem = el.getGraphicItem();
|
|
100344
100712
|
const elementKey = mark.id + '_' + el.key;
|
|
100345
100713
|
if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
|
|
100346
|
-
this._isBrushContainItem(operateMask,
|
|
100714
|
+
this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100347
100715
|
el.addState(IN_BRUSH_STATE);
|
|
100348
100716
|
if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
|
|
100349
100717
|
this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
|
|
@@ -100352,7 +100720,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100352
100720
|
delete this._linkedOutOfBrushElementsMap[elementKey];
|
|
100353
100721
|
}
|
|
100354
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]) &&
|
|
100355
|
-
!this._isBrushContainItem(operateMask,
|
|
100723
|
+
!this._isBrushContainItem(operateMask.globalAABBBounds, pointsCoord, graphicItem)) {
|
|
100356
100724
|
el.removeState(IN_BRUSH_STATE);
|
|
100357
100725
|
el.addState(OUT_BRUSH_STATE);
|
|
100358
100726
|
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
@@ -100363,75 +100731,81 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100363
100731
|
}
|
|
100364
100732
|
});
|
|
100365
100733
|
}
|
|
100366
|
-
_isBrushContainItem(
|
|
100367
|
-
var _a, _b, _c;
|
|
100368
|
-
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)) {
|
|
100369
|
-
return false;
|
|
100370
|
-
}
|
|
100371
|
-
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 : [];
|
|
100372
|
-
const { a, b, c, d, e, f } = brushMask.globalTransMatrix;
|
|
100373
|
-
const dx = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dx) || 0;
|
|
100374
|
-
const dy = (linkedOffset === null || linkedOffset === void 0 ? void 0 : linkedOffset.dy) || 0;
|
|
100375
|
-
const pointsCoord = points.map((p) => {
|
|
100376
|
-
return {
|
|
100377
|
-
x: a * p.x + c * p.y + e + dx,
|
|
100378
|
-
y: b * p.x + d * p.y + f + dy
|
|
100379
|
-
};
|
|
100380
|
-
});
|
|
100381
|
-
brushMask.globalAABBBounds
|
|
100382
|
-
.clone()
|
|
100383
|
-
.set(brushMask.globalAABBBounds.x1 + dx, brushMask.globalAABBBounds.y1 + dy, brushMask.globalAABBBounds.x2 + dx, brushMask.globalAABBBounds.y2 + dy);
|
|
100384
|
-
const x = item.globalTransMatrix.e;
|
|
100385
|
-
const y = item.globalTransMatrix.f;
|
|
100734
|
+
_isBrushContainItem(brushMaskAABBBounds, brushMaskPointsCoord, item) {
|
|
100386
100735
|
let itemBounds = [];
|
|
100387
|
-
if (item.type
|
|
100388
|
-
const {
|
|
100389
|
-
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;
|
|
100390
100738
|
itemBounds = [
|
|
100391
100739
|
{
|
|
100392
|
-
x:
|
|
100393
|
-
y:
|
|
100740
|
+
x: x1,
|
|
100741
|
+
y: y1
|
|
100394
100742
|
},
|
|
100395
100743
|
{
|
|
100396
|
-
x:
|
|
100397
|
-
y:
|
|
100744
|
+
x: x2,
|
|
100745
|
+
y: y1
|
|
100398
100746
|
},
|
|
100399
100747
|
{
|
|
100400
|
-
x:
|
|
100401
|
-
y:
|
|
100748
|
+
x: x2,
|
|
100749
|
+
y: y2
|
|
100402
100750
|
},
|
|
100403
100751
|
{
|
|
100404
|
-
x:
|
|
100405
|
-
y:
|
|
100752
|
+
x: x1,
|
|
100753
|
+
y: y2
|
|
100406
100754
|
}
|
|
100407
100755
|
];
|
|
100408
|
-
return polygonIntersectPolygon(
|
|
100756
|
+
return polygonIntersectPolygon(brushMaskPointsCoord, itemBounds);
|
|
100409
100757
|
}
|
|
100410
|
-
|
|
100411
|
-
|
|
100412
|
-
|
|
100413
|
-
|
|
100414
|
-
|
|
100415
|
-
|
|
100416
|
-
|
|
100417
|
-
|
|
100418
|
-
|
|
100419
|
-
|
|
100420
|
-
|
|
100421
|
-
|
|
100422
|
-
|
|
100423
|
-
|
|
100424
|
-
|
|
100425
|
-
|
|
100426
|
-
|
|
100427
|
-
{
|
|
100428
|
-
x: x,
|
|
100429
|
-
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;
|
|
100430
100775
|
}
|
|
100431
|
-
|
|
100432
|
-
|
|
100433
|
-
|
|
100434
|
-
|
|
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
|
+
});
|
|
100435
100809
|
}
|
|
100436
100810
|
_stateClamp(state) {
|
|
100437
100811
|
return Math.min(Math.max(0, state), 1);
|
|
@@ -100497,139 +100871,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100497
100871
|
});
|
|
100498
100872
|
}
|
|
100499
100873
|
}
|
|
100500
|
-
_bindRegions() {
|
|
100501
|
-
if (isValid$1(this._spec.regionId) && isValid$1(this._spec.regionIndex)) {
|
|
100502
|
-
this._relativeRegions = this._option.getAllRegions();
|
|
100503
|
-
}
|
|
100504
|
-
this._relativeRegions = this._option.getRegionsInUserIdOrIndex(array(this._spec.regionId), array(this._spec.regionIndex));
|
|
100505
|
-
}
|
|
100506
|
-
_bindLinkedSeries() {
|
|
100507
|
-
if (isValid$1(this._spec.brushLinkSeriesId) && isValid$1(this._spec.brushLinkSeriesIndex)) {
|
|
100508
|
-
return;
|
|
100509
|
-
}
|
|
100510
|
-
this._linkedSeries = this._option.getSeriesInUserIdOrIndex(array(this._spec.brushLinkSeriesId), array(this._spec.brushLinkSeriesIndex));
|
|
100511
|
-
}
|
|
100512
|
-
_initRegionAxisMap() {
|
|
100513
|
-
if (isValid$1(this._spec.axisId)) {
|
|
100514
|
-
array(this._spec.axisId).forEach((axisId) => {
|
|
100515
|
-
this._releatedAxes.push(this._option.getComponentByUserId(axisId));
|
|
100516
|
-
});
|
|
100517
|
-
}
|
|
100518
|
-
else if (isValid$1(this._spec.axisIndex)) {
|
|
100519
|
-
array(this._spec.axisIndex).forEach((axisIndex) => {
|
|
100520
|
-
this._releatedAxes.push(this._option.getComponentByIndex('axes', axisIndex));
|
|
100521
|
-
});
|
|
100522
|
-
}
|
|
100523
|
-
else {
|
|
100524
|
-
this._releatedAxes = this._option.getComponentsByKey('axes');
|
|
100525
|
-
}
|
|
100526
|
-
this._releatedAxes.forEach((axis) => {
|
|
100527
|
-
axis === null || axis === void 0 ? void 0 : axis.getRegions().forEach((region) => {
|
|
100528
|
-
if (this._regionAxisMap['region_' + region.id]) {
|
|
100529
|
-
this._regionAxisMap['region_' + region.id].push(axis);
|
|
100530
|
-
}
|
|
100531
|
-
else {
|
|
100532
|
-
this._regionAxisMap['region_' + region.id] = [axis];
|
|
100533
|
-
}
|
|
100534
|
-
});
|
|
100535
|
-
});
|
|
100536
|
-
}
|
|
100537
|
-
_initAxisDataZoomMap() {
|
|
100538
|
-
this._option.getComponentsByKey('dataZoom').forEach((dz) => {
|
|
100539
|
-
if (dz.relatedAxisComponent) {
|
|
100540
|
-
this._axisDataZoomMap[dz.relatedAxisComponent.id] = dz;
|
|
100541
|
-
}
|
|
100542
|
-
});
|
|
100543
|
-
}
|
|
100544
|
-
_initNeedOperatedItem() {
|
|
100545
|
-
const seriesUserId = this._spec.seriesId;
|
|
100546
|
-
const seriesIndex = this._spec.seriesIndex;
|
|
100547
|
-
this._relativeRegions.forEach(r => {
|
|
100548
|
-
const allMarks = [];
|
|
100549
|
-
r.getSeries().forEach((s) => {
|
|
100550
|
-
if ((seriesUserId && array(seriesUserId).includes(s.userId.toString())) ||
|
|
100551
|
-
(seriesIndex && array(seriesIndex).includes(s.getSpecIndex())) ||
|
|
100552
|
-
(!seriesIndex && !seriesUserId)) {
|
|
100553
|
-
allMarks.push(...s.getMarksWithoutRoot());
|
|
100554
|
-
}
|
|
100555
|
-
this._itemMap[r.id] = allMarks;
|
|
100556
|
-
});
|
|
100557
|
-
});
|
|
100558
|
-
this._linkedSeries.forEach(s => {
|
|
100559
|
-
this._linkedItemMap[s.id] = s.getMarksWithoutRoot();
|
|
100560
|
-
});
|
|
100561
|
-
}
|
|
100562
|
-
_initMarkBrushState(componentIndex, stateName) {
|
|
100563
|
-
this._brushComponents.forEach((brush, index) => {
|
|
100564
|
-
if (index !== componentIndex) {
|
|
100565
|
-
brush.children[0].removeAllChild();
|
|
100566
|
-
}
|
|
100567
|
-
});
|
|
100568
|
-
this._inBrushElementsMap = {};
|
|
100569
|
-
this._outOfBrushElementsMap = {};
|
|
100570
|
-
this._linkedInBrushElementsMap = {};
|
|
100571
|
-
this._linkedOutOfBrushElementsMap = {};
|
|
100572
|
-
this._option.getAllSeries().forEach((s) => {
|
|
100573
|
-
s.getMarksWithoutRoot().forEach((mark) => {
|
|
100574
|
-
const grammarMark = mark.getProduct();
|
|
100575
|
-
if (!grammarMark || !grammarMark.elements || !grammarMark.elements.length) {
|
|
100576
|
-
return;
|
|
100577
|
-
}
|
|
100578
|
-
const elements = grammarMark.elements;
|
|
100579
|
-
elements.forEach((el) => {
|
|
100580
|
-
const elementKey = mark.id + '_' + el.key;
|
|
100581
|
-
el.removeState(IN_BRUSH_STATE);
|
|
100582
|
-
el.removeState(OUT_BRUSH_STATE);
|
|
100583
|
-
el.addState(stateName);
|
|
100584
|
-
this._outOfBrushElementsMap[elementKey] = el;
|
|
100585
|
-
this._linkedOutOfBrushElementsMap[elementKey] = el;
|
|
100586
|
-
});
|
|
100587
|
-
});
|
|
100588
|
-
});
|
|
100589
|
-
}
|
|
100590
|
-
initEvent() {
|
|
100591
|
-
}
|
|
100592
|
-
onRender(ctx) {
|
|
100593
|
-
}
|
|
100594
|
-
changeRegions(regions) {
|
|
100595
|
-
}
|
|
100596
100874
|
_getNeedClearVRenderComponents() {
|
|
100597
100875
|
return this._brushComponents;
|
|
100598
100876
|
}
|
|
100599
|
-
_compareSpec(spec, prevSpec) {
|
|
100600
|
-
if (this._brushComponents) {
|
|
100601
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100602
|
-
this._updateBrushComponent(region, index);
|
|
100603
|
-
});
|
|
100604
|
-
}
|
|
100605
|
-
const result = super._compareSpec(spec, prevSpec);
|
|
100606
|
-
if (!isEqual(prevSpec, spec)) {
|
|
100607
|
-
result.reRender = true;
|
|
100608
|
-
result.reMake = true;
|
|
100609
|
-
}
|
|
100610
|
-
return result;
|
|
100611
|
-
}
|
|
100612
|
-
onLayoutEnd(ctx) {
|
|
100613
|
-
var _a;
|
|
100614
|
-
super.onLayoutEnd(ctx);
|
|
100615
|
-
if (this._option.disableTriggerEvent) {
|
|
100616
|
-
return;
|
|
100617
|
-
}
|
|
100618
|
-
const brushVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
100619
|
-
if (brushVisible) {
|
|
100620
|
-
if (!this._brushComponents) {
|
|
100621
|
-
this._brushComponents = [];
|
|
100622
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100623
|
-
this._createBrushComponent(region, index);
|
|
100624
|
-
});
|
|
100625
|
-
}
|
|
100626
|
-
else {
|
|
100627
|
-
this._relativeRegions.forEach((region, index) => {
|
|
100628
|
-
this._updateBrushComponent(region, index);
|
|
100629
|
-
});
|
|
100630
|
-
}
|
|
100631
|
-
}
|
|
100632
|
-
}
|
|
100633
100877
|
clearGraphic() {
|
|
100634
100878
|
if (this._brushComponents) {
|
|
100635
100879
|
this._brushComponents.forEach(brush => {
|
|
@@ -100640,7 +100884,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
100640
100884
|
clear() {
|
|
100641
100885
|
if (this._brushComponents) {
|
|
100642
100886
|
const container = this.getContainer();
|
|
100643
|
-
this._brushComponents.forEach(brush => {
|
|
100887
|
+
this._brushComponents.forEach((brush, index) => {
|
|
100888
|
+
this._initMarkBrushState(index, '');
|
|
100889
|
+
this._needDisablePickable = false;
|
|
100644
100890
|
brush.removeAllChild();
|
|
100645
100891
|
brush.releaseBrushEvents();
|
|
100646
100892
|
if (container) {
|
|
@@ -102634,16 +102880,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102634
102880
|
}
|
|
102635
102881
|
}
|
|
102636
102882
|
_updateDomStyle(sizeKey = 'width') {
|
|
102637
|
-
var _a, _b, _c, _d;
|
|
102883
|
+
var _a, _b, _c, _d, _e;
|
|
102638
102884
|
const rootDom = this._rootDom;
|
|
102639
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));
|
|
102640
102887
|
if (contentDom) {
|
|
102641
102888
|
const tooltipSpec = this._component.getSpec();
|
|
102642
102889
|
const contentStyle = {};
|
|
102643
|
-
|
|
102644
|
-
|
|
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)) {
|
|
102645
102904
|
const titleHeight = titleDom && titleDom.className.includes(TOOLTIP_TITLE_CLASS_NAME)
|
|
102646
|
-
? titleDom.getBoundingClientRect().height + ((
|
|
102905
|
+
? titleDom.getBoundingClientRect().height + ((_c = tooltipSpec.style.spaceRow) !== null && _c !== void 0 ? _c : 0)
|
|
102647
102906
|
: 0;
|
|
102648
102907
|
const viewRect = this._chartOption.getChartViewRect();
|
|
102649
102908
|
const maxHeight = calcLayoutNumber(tooltipSpec.style.maxContentHeight, Math.min(viewRect.height, document.body.clientHeight) -
|
|
@@ -102661,7 +102920,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102661
102920
|
if (rows) {
|
|
102662
102921
|
for (let i = 0; i < rows.length; i++) {
|
|
102663
102922
|
const row = rows[i];
|
|
102664
|
-
const cols = (
|
|
102923
|
+
const cols = (_d = row.children) !== null && _d !== void 0 ? _d : [];
|
|
102665
102924
|
for (let j = 0; j < cols.length; j++) {
|
|
102666
102925
|
const width = cols[j].getBoundingClientRect()[sizeKey];
|
|
102667
102926
|
if (widthByCol[j] === undefined || widthByCol[j] < width) {
|
|
@@ -102671,7 +102930,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
102671
102930
|
}
|
|
102672
102931
|
for (let i = 0; i < rows.length; i++) {
|
|
102673
102932
|
const row = rows[i];
|
|
102674
|
-
const cols = (
|
|
102933
|
+
const cols = (_e = row.children) !== null && _e !== void 0 ? _e : [];
|
|
102675
102934
|
for (let j = 0; j < cols.length; j++) {
|
|
102676
102935
|
cols[j].style[sizeKey] = `${widthByCol[j]}px`;
|
|
102677
102936
|
}
|
|
@@ -103857,6 +104116,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103857
104116
|
exports.CanvasTooltipHandler = CanvasTooltipHandler;
|
|
103858
104117
|
exports.CartesianAxis = CartesianAxis;
|
|
103859
104118
|
exports.CartesianBandAxis = CartesianBandAxis;
|
|
104119
|
+
exports.CartesianChartSpecTransformer = CartesianChartSpecTransformer;
|
|
103860
104120
|
exports.CartesianCrossHair = CartesianCrossHair;
|
|
103861
104121
|
exports.CartesianLinearAxis = CartesianLinearAxis;
|
|
103862
104122
|
exports.CartesianLogAxis = CartesianLogAxis;
|