@visactor/vrender-components 0.22.7-alpha.7 → 0.22.7-alpha.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/cjs/axis/util.js +7 -6
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/type.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/marker/animate/animate.d.ts +3 -3
- package/cjs/marker/animate/animate.js.map +1 -1
- package/cjs/marker/animate/clip-in.d.ts +1 -1
- package/cjs/marker/animate/clip-in.js +6 -3
- package/cjs/marker/animate/clip-in.js.map +1 -1
- package/cjs/marker/animate/fade-in.d.ts +3 -3
- package/cjs/marker/animate/fade-in.js +10 -4
- package/cjs/marker/animate/fade-in.js.map +1 -1
- package/cjs/marker/animate/fade-out.d.ts +3 -3
- package/cjs/marker/animate/fade-out.js +10 -4
- package/cjs/marker/animate/fade-out.js.map +1 -1
- package/cjs/marker/arc-area.d.ts +8 -5
- package/cjs/marker/arc-area.js +18 -39
- package/cjs/marker/arc-area.js.map +1 -1
- package/cjs/marker/arc-line.d.ts +6 -4
- package/cjs/marker/arc-line.js +12 -9
- package/cjs/marker/arc-line.js.map +1 -1
- package/cjs/marker/area.d.ts +6 -4
- package/cjs/marker/area.js +14 -32
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.d.ts +2 -3
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/common-line.d.ts +11 -7
- package/cjs/marker/common-line.js +11 -31
- package/cjs/marker/common-line.js.map +1 -1
- package/cjs/marker/config.d.ts +2 -0
- package/cjs/marker/config.js +2 -0
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/line.d.ts +6 -4
- package/cjs/marker/line.js +10 -4
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/mixin/label.d.ts +16 -0
- package/cjs/marker/mixin/label.js +57 -0
- package/cjs/marker/mixin/label.js.map +1 -0
- package/cjs/marker/type.d.ts +19 -16
- package/cjs/marker/type.js.map +1 -1
- package/cjs/poptip/contribution.js +4 -2
- package/cjs/poptip/contribution.js.map +1 -1
- package/cjs/poptip/poptip.d.ts +5 -0
- package/cjs/poptip/poptip.js +87 -18
- package/cjs/poptip/poptip.js.map +1 -1
- package/cjs/poptip/type.d.ts +4 -1
- package/cjs/poptip/type.js.map +1 -1
- package/cjs/switch/switch.js +2 -2
- package/cjs/switch/switch.js.map +1 -1
- package/dist/index.es.js +287 -173
- package/es/axis/util.js +7 -7
- package/es/axis/util.js.map +1 -1
- package/es/brush/type.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/marker/animate/animate.d.ts +3 -3
- package/es/marker/animate/animate.js.map +1 -1
- package/es/marker/animate/clip-in.d.ts +1 -1
- package/es/marker/animate/clip-in.js +6 -2
- package/es/marker/animate/clip-in.js.map +1 -1
- package/es/marker/animate/fade-in.d.ts +3 -3
- package/es/marker/animate/fade-in.js +11 -3
- package/es/marker/animate/fade-in.js.map +1 -1
- package/es/marker/animate/fade-out.d.ts +3 -3
- package/es/marker/animate/fade-out.js +11 -3
- package/es/marker/animate/fade-out.js.map +1 -1
- package/es/marker/arc-area.d.ts +8 -5
- package/es/marker/arc-area.js +19 -41
- package/es/marker/arc-area.js.map +1 -1
- package/es/marker/arc-line.d.ts +6 -4
- package/es/marker/arc-line.js +12 -9
- package/es/marker/arc-line.js.map +1 -1
- package/es/marker/area.d.ts +6 -4
- package/es/marker/area.js +15 -34
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.d.ts +2 -3
- package/es/marker/base.js.map +1 -1
- package/es/marker/common-line.d.ts +11 -7
- package/es/marker/common-line.js +14 -34
- package/es/marker/common-line.js.map +1 -1
- package/es/marker/config.d.ts +2 -0
- package/es/marker/config.js +2 -0
- package/es/marker/config.js.map +1 -1
- package/es/marker/line.d.ts +6 -4
- package/es/marker/line.js +10 -4
- package/es/marker/line.js.map +1 -1
- package/es/marker/mixin/label.d.ts +16 -0
- package/es/marker/mixin/label.js +45 -0
- package/es/marker/mixin/label.js.map +1 -0
- package/es/marker/type.d.ts +19 -16
- package/es/marker/type.js.map +1 -1
- package/es/poptip/contribution.js +4 -2
- package/es/poptip/contribution.js.map +1 -1
- package/es/poptip/poptip.d.ts +5 -0
- package/es/poptip/poptip.js +85 -19
- package/es/poptip/poptip.js.map +1 -1
- package/es/poptip/type.d.ts +4 -1
- package/es/poptip/type.js.map +1 -1
- package/es/switch/switch.js +2 -2
- package/es/switch/switch.js.map +1 -1
- package/package.json +8 -8
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, pi, isArray, isNumberClose, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, cos, sin, isString, pointAt, isNumber, getDecimalPlaces, isNil, Color, sqrt, OBBBounds, has, normalTransform, isValidUrl, isBase64, acos, transformBoundsWithMatrix, getContextFont, rotatePoint, clampAngleByRadian, asin, arrayEqual, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct, isValid, isEmpty, array, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian, normalizeAngle, isValidNumber, flattenArray, isRotateAABBIntersect, isLess, isGreater, cloneDeep, get, last, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, pointInRect, calculateAnchorOfBounds, computeQuadrant, polygonContainPoint } from '@visactor/vutils';
|
|
1
|
+
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, pi, isArray, isNumberClose, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, cos, sin, isString, pointAt, isNumber, getDecimalPlaces, isNil, Color, sqrt, OBBBounds, has, normalTransform, isValidUrl, isBase64, acos, transformBoundsWithMatrix, getContextFont, rotatePoint, clampAngleByRadian, asin, arrayEqual, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct, isValid, isEmpty, array, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian, normalizeAngle, isValidNumber, flattenArray, isRotateAABBIntersect, isLess, isGreater, aabbSeparation, obbSeparation, cloneDeep, get, last, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, pointInRect, calculateAnchorOfBounds, computeQuadrant, polygonContainPoint } from '@visactor/vutils';
|
|
2
2
|
import { isContinuous, isDiscrete, LinearScale } from '@visactor/vscale';
|
|
3
3
|
|
|
4
4
|
class Generator {
|
|
@@ -2287,7 +2287,8 @@ const DefaultStyle = Object.assign(Object.assign(Object.assign(Object.assign({
|
|
|
2287
2287
|
filter: "",
|
|
2288
2288
|
cursor: null,
|
|
2289
2289
|
html: null,
|
|
2290
|
-
react: null
|
|
2290
|
+
react: null,
|
|
2291
|
+
vue: null
|
|
2291
2292
|
}, DefaultFillStyle), DefaultStrokeStyle), DefaultLayout), DefaultPickStyle);
|
|
2292
2293
|
const DefaultConnectAttribute = {
|
|
2293
2294
|
connectedType: "none",
|
|
@@ -2395,6 +2396,12 @@ const DefaultPolygonAttribute = Object.assign(Object.assign({}, DefaultAttribute
|
|
|
2395
2396
|
cornerRadius: 0,
|
|
2396
2397
|
closePath: !0
|
|
2397
2398
|
});
|
|
2399
|
+
const DefaultStarAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
2400
|
+
width: 100,
|
|
2401
|
+
height: 100,
|
|
2402
|
+
spikes: 5,
|
|
2403
|
+
thickness: .5
|
|
2404
|
+
});
|
|
2398
2405
|
const DefaultRectAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
2399
2406
|
width: 0,
|
|
2400
2407
|
height: 0,
|
|
@@ -2720,6 +2727,7 @@ function getScaledStroke(context, width, dpr) {
|
|
|
2720
2727
|
function createColor(context, c, params) {
|
|
2721
2728
|
let offsetX = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
2722
2729
|
let offsetY = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2730
|
+
var _a, _b;
|
|
2723
2731
|
if (!c || !0 === c) return "black";
|
|
2724
2732
|
let result, color;
|
|
2725
2733
|
if (isArray(c)) for (let i = 0; i < c.length && (color = c[i], !color); i++);else color = c;
|
|
@@ -2733,9 +2741,10 @@ function createColor(context, c, params) {
|
|
|
2733
2741
|
if (params.attribute) {
|
|
2734
2742
|
const {
|
|
2735
2743
|
scaleX = 1,
|
|
2736
|
-
scaleY = 1
|
|
2744
|
+
scaleY = 1,
|
|
2745
|
+
angle = 0
|
|
2737
2746
|
} = params.attribute;
|
|
2738
|
-
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY;
|
|
2747
|
+
w /= scaleX, h /= scaleY, x /= scaleX, y /= scaleY, (angle || 1 !== scaleX || 1 !== scaleY) && (x = 0, y = 0, w = null !== (_a = params.widthWithoutTransform) && void 0 !== _a ? _a : w, h = null !== (_b = params.heightWithoutTransform) && void 0 !== _b ? _b : h);
|
|
2739
2748
|
}
|
|
2740
2749
|
"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));
|
|
2741
2750
|
}
|
|
@@ -2835,6 +2844,7 @@ function applyStrokeStyle(ctx, character) {
|
|
|
2835
2844
|
ctx.globalAlpha = strokeOpacity * opacity, ctx.lineWidth = character && "number" == typeof character.lineWidth ? character.lineWidth : 1, ctx.strokeStyle = strokeStyle, setTextStyle(ctx, character);
|
|
2836
2845
|
}
|
|
2837
2846
|
function getStrByWithCanvas(desc, width, character, guessIndex, needTestLetter) {
|
|
2847
|
+
if (desc.length <= 1) return 0;
|
|
2838
2848
|
if (!width || width <= 0) return 0;
|
|
2839
2849
|
const textMeasure = application.graphicUtil.textMeasure;
|
|
2840
2850
|
let index = guessIndex,
|
|
@@ -2868,6 +2878,13 @@ function testLetter2(string, index) {
|
|
|
2868
2878
|
}
|
|
2869
2879
|
function measureTextCanvas(text, character) {
|
|
2870
2880
|
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
2881
|
+
var _a;
|
|
2882
|
+
if ("" === text) return {
|
|
2883
|
+
ascent: 0,
|
|
2884
|
+
height: 0,
|
|
2885
|
+
descent: 0,
|
|
2886
|
+
width: 0
|
|
2887
|
+
};
|
|
2871
2888
|
const measurement = application.graphicUtil.textMeasure.measureText(text, character),
|
|
2872
2889
|
result = {
|
|
2873
2890
|
ascent: 0,
|
|
@@ -2877,7 +2894,9 @@ function measureTextCanvas(text, character) {
|
|
|
2877
2894
|
},
|
|
2878
2895
|
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
2879
2896
|
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
2880
|
-
|
|
2897
|
+
"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);
|
|
2898
|
+
const space = null !== (_a = character.space) && void 0 !== _a ? _a : 0;
|
|
2899
|
+
return result.width += space, result;
|
|
2881
2900
|
}
|
|
2882
2901
|
|
|
2883
2902
|
var __decorate$O = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -3665,6 +3684,7 @@ const defaultThemeObj = {
|
|
|
3665
3684
|
text: DefaultTextAttribute,
|
|
3666
3685
|
rect: DefaultRectAttribute,
|
|
3667
3686
|
polygon: DefaultPolygonAttribute,
|
|
3687
|
+
star: DefaultStarAttribute,
|
|
3668
3688
|
richtext: DefaultRichTextAttribute,
|
|
3669
3689
|
richtextIcon: DefaultRichTextIconAttribute,
|
|
3670
3690
|
image: DefaultImageAttribute,
|
|
@@ -3683,6 +3703,7 @@ function newThemeObj() {
|
|
|
3683
3703
|
text: Object.assign({}, defaultThemeObj.text),
|
|
3684
3704
|
rect: Object.assign({}, defaultThemeObj.rect),
|
|
3685
3705
|
polygon: Object.assign({}, defaultThemeObj.polygon),
|
|
3706
|
+
star: Object.assign({}, defaultThemeObj.star),
|
|
3686
3707
|
richtext: Object.assign({}, defaultThemeObj.richtext),
|
|
3687
3708
|
richtextIcon: Object.assign({}, defaultThemeObj.richtextIcon),
|
|
3688
3709
|
image: Object.assign({}, defaultThemeObj.image),
|
|
@@ -4162,7 +4183,7 @@ class FederatedEvent {
|
|
|
4162
4183
|
}
|
|
4163
4184
|
_composedDetailPath(params) {
|
|
4164
4185
|
if (params && params.graphic) {
|
|
4165
|
-
const g =
|
|
4186
|
+
const g = params.graphic;
|
|
4166
4187
|
if (g.stage) {
|
|
4167
4188
|
const path = g.stage.eventSystem.manager.propagationPath(g);
|
|
4168
4189
|
this.detailPath.push(path), this._composedDetailPath(params.params);
|
|
@@ -5928,6 +5949,7 @@ genNumberType();
|
|
|
5928
5949
|
const RECT_NUMBER_TYPE = genNumberType();
|
|
5929
5950
|
genNumberType();
|
|
5930
5951
|
const RICHTEXT_NUMBER_TYPE = genNumberType();
|
|
5952
|
+
genNumberType();
|
|
5931
5953
|
const SYMBOL_NUMBER_TYPE = genNumberType();
|
|
5932
5954
|
const TEXT_NUMBER_TYPE = genNumberType();
|
|
5933
5955
|
const GraphicService = Symbol.for("GraphicService");
|
|
@@ -6182,6 +6204,9 @@ class Graphic extends Node {
|
|
|
6182
6204
|
y: y
|
|
6183
6205
|
});
|
|
6184
6206
|
}
|
|
6207
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
6208
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
6209
|
+
}
|
|
6185
6210
|
setAttributes(params) {
|
|
6186
6211
|
let forceUpdateTag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
6187
6212
|
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -6470,16 +6495,17 @@ class Graphic extends Node {
|
|
|
6470
6495
|
const {
|
|
6471
6496
|
scaleX: scaleX,
|
|
6472
6497
|
scaleY: scaleY,
|
|
6473
|
-
angle: angle
|
|
6498
|
+
angle: angle,
|
|
6499
|
+
scaleCenter: scaleCenter
|
|
6474
6500
|
} = this.attribute;
|
|
6475
6501
|
return tempBounds.copy(this._AABBBounds), this.setAttributes({
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
angle: 0
|
|
6502
|
+
angle: 0,
|
|
6503
|
+
scaleCenter: null
|
|
6479
6504
|
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
6480
6505
|
scaleX: scaleX,
|
|
6481
6506
|
scaleY: scaleY,
|
|
6482
|
-
angle: angle
|
|
6507
|
+
angle: angle,
|
|
6508
|
+
scaleCenter: scaleCenter
|
|
6483
6509
|
}), params.b;
|
|
6484
6510
|
};
|
|
6485
6511
|
if ("string" == typeof anchor[0]) {
|
|
@@ -6507,7 +6533,7 @@ class Graphic extends Node {
|
|
|
6507
6533
|
} = this.attribute;
|
|
6508
6534
|
let _anchor = [0, 0];
|
|
6509
6535
|
const params = {};
|
|
6510
|
-
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 {
|
|
6536
|
+
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 {
|
|
6511
6537
|
const m = this._transMatrix;
|
|
6512
6538
|
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, {
|
|
6513
6539
|
x: _anchor[0],
|
|
@@ -7694,7 +7720,7 @@ class Circle extends Graphic {
|
|
|
7694
7720
|
tb1: tb1,
|
|
7695
7721
|
tb2: tb2
|
|
7696
7722
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
7697
|
-
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;
|
|
7723
|
+
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;
|
|
7698
7724
|
}
|
|
7699
7725
|
updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
|
|
7700
7726
|
const {
|
|
@@ -7944,7 +7970,7 @@ class Text extends Graphic {
|
|
|
7944
7970
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
7945
7971
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
7946
7972
|
}
|
|
7947
|
-
return application.graphicService.combindShadowAABBBounds(aabbBounds, this), null == attribute.forceBoundsHeight && null == attribute.forceBoundsWidth || application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds), transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix), aabbBounds;
|
|
7973
|
+
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;
|
|
7948
7974
|
}
|
|
7949
7975
|
updateSingallineAABBBounds(text) {
|
|
7950
7976
|
this.updateMultilineAABBBounds([text]);
|
|
@@ -8469,7 +8495,7 @@ let Symbol$1 = class Symbol extends Graphic {
|
|
|
8469
8495
|
tb1: tb1,
|
|
8470
8496
|
tb2: tb2
|
|
8471
8497
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
8472
|
-
updateBoundsOfSymbolOuterBorder(attribute, symbolTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
8498
|
+
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;
|
|
8473
8499
|
const {
|
|
8474
8500
|
lineJoin = symbolTheme.lineJoin
|
|
8475
8501
|
} = attribute;
|
|
@@ -8541,7 +8567,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
8541
8567
|
return getTheme(this).line;
|
|
8542
8568
|
}
|
|
8543
8569
|
updateAABBBounds(attribute, lineTheme, aabbBounds) {
|
|
8544
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
8570
|
+
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;
|
|
8545
8571
|
const {
|
|
8546
8572
|
lineJoin = lineTheme.lineJoin
|
|
8547
8573
|
} = attribute;
|
|
@@ -8638,7 +8664,7 @@ class Rect extends Graphic {
|
|
|
8638
8664
|
tb1: tb1,
|
|
8639
8665
|
tb2: tb2
|
|
8640
8666
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
8641
|
-
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;
|
|
8667
|
+
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;
|
|
8642
8668
|
}
|
|
8643
8669
|
needUpdateTags(keys) {
|
|
8644
8670
|
return super.needUpdateTags(keys, RECT_UPDATE_TAG_KEY);
|
|
@@ -8830,6 +8856,7 @@ function getFixedLRTB(left, right, top, bottom) {
|
|
|
8830
8856
|
}
|
|
8831
8857
|
class Paragraph {
|
|
8832
8858
|
constructor(text, newLine, character, ascentDescentMode) {
|
|
8859
|
+
var _a, _b;
|
|
8833
8860
|
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
8834
8861
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
8835
8862
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
@@ -8842,7 +8869,7 @@ class Paragraph {
|
|
|
8842
8869
|
let halfDetaHeight = 0,
|
|
8843
8870
|
deltaAscent = 0,
|
|
8844
8871
|
deltaDescent = 0;
|
|
8845
|
-
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 = "...";
|
|
8872
|
+
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 = "...";
|
|
8846
8873
|
}
|
|
8847
8874
|
updateWidth() {
|
|
8848
8875
|
const {
|
|
@@ -8861,11 +8888,11 @@ class Paragraph {
|
|
|
8861
8888
|
if ("hide" === this.ellipsis) return;
|
|
8862
8889
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
8863
8890
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
8864
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8891
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
8865
8892
|
const {
|
|
8866
8893
|
width: width
|
|
8867
8894
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8868
|
-
|
|
8895
|
+
left -= this.ellipsisWidth - width;
|
|
8869
8896
|
}
|
|
8870
8897
|
}
|
|
8871
8898
|
}
|
|
@@ -8876,20 +8903,21 @@ class Paragraph {
|
|
|
8876
8903
|
});
|
|
8877
8904
|
}
|
|
8878
8905
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
8906
|
+
var _a;
|
|
8879
8907
|
let baseline = top + ascent,
|
|
8880
8908
|
text = this.text,
|
|
8881
|
-
left = this.left + deltaLeft;
|
|
8909
|
+
left = this.left + deltaLeft + (null !== (_a = this.space) && void 0 !== _a ? _a : 0) / 2;
|
|
8882
8910
|
baseline += this.top;
|
|
8883
8911
|
let direction = this.direction;
|
|
8884
8912
|
if (this.verticalEllipsis) text = this.ellipsisStr, direction = "vertical", baseline -= this.ellipsisWidth / 2;else {
|
|
8885
8913
|
if ("hide" === this.ellipsis) return;
|
|
8886
8914
|
if ("add" === this.ellipsis) text += this.ellipsisStr, "right" !== textAlign && "end" !== textAlign || (left -= this.ellipsisWidth);else if ("replace" === this.ellipsis) {
|
|
8887
8915
|
const index = getStrByWithCanvas(text, ("vertical" === direction ? this.height : this.width) - this.ellipsisWidth + this.ellipsisOtherParagraphWidth, this.character, text.length - 1);
|
|
8888
|
-
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8916
|
+
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) if ("vertical" === direction) ;else {
|
|
8889
8917
|
const {
|
|
8890
8918
|
width: width
|
|
8891
8919
|
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8892
|
-
|
|
8920
|
+
left -= this.ellipsisWidth - width;
|
|
8893
8921
|
}
|
|
8894
8922
|
}
|
|
8895
8923
|
}
|
|
@@ -8904,7 +8932,7 @@ class Paragraph {
|
|
|
8904
8932
|
const {
|
|
8905
8933
|
lineWidth = 1
|
|
8906
8934
|
} = this.character;
|
|
8907
|
-
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) {
|
|
8935
|
+
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) {
|
|
8908
8936
|
if (this.character.underline) {
|
|
8909
8937
|
const top = 1 + baseline,
|
|
8910
8938
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
@@ -9033,7 +9061,7 @@ class Image extends Graphic {
|
|
|
9033
9061
|
tb1: tb1,
|
|
9034
9062
|
tb2: tb2
|
|
9035
9063
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9036
|
-
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;
|
|
9064
|
+
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;
|
|
9037
9065
|
}
|
|
9038
9066
|
getDefaultAttribute(name) {
|
|
9039
9067
|
return DefaultImageAttribute[name];
|
|
@@ -9376,7 +9404,7 @@ class RichText extends Graphic {
|
|
|
9376
9404
|
maxWidth = richtextTheme.maxWidth,
|
|
9377
9405
|
maxHeight = richtextTheme.maxHeight,
|
|
9378
9406
|
textAlign = richtextTheme.textAlign,
|
|
9379
|
-
|
|
9407
|
+
textBaseline = null !== (_b = null !== (_a = attribute.textBaseline) && void 0 !== _a ? _a : richtextTheme.textBaseline) && void 0 !== _b ? _b : "top",
|
|
9380
9408
|
editOptions: editOptions
|
|
9381
9409
|
} = attribute;
|
|
9382
9410
|
if (width > 0 && height > 0) aabbBounds.set(0, 0, width, height);else {
|
|
@@ -9391,7 +9419,7 @@ class RichText extends Graphic {
|
|
|
9391
9419
|
}
|
|
9392
9420
|
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);
|
|
9393
9421
|
let deltaY = 0;
|
|
9394
|
-
switch (
|
|
9422
|
+
switch (textBaseline) {
|
|
9395
9423
|
case "top":
|
|
9396
9424
|
deltaY = 0;
|
|
9397
9425
|
break;
|
|
@@ -9412,7 +9440,7 @@ class RichText extends Graphic {
|
|
|
9412
9440
|
case "right":
|
|
9413
9441
|
deltaX = -aabbBounds.width();
|
|
9414
9442
|
}
|
|
9415
|
-
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;
|
|
9443
|
+
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;
|
|
9416
9444
|
}
|
|
9417
9445
|
needUpdateTags(keys) {
|
|
9418
9446
|
return super.needUpdateTags(keys, RICHTEXT_UPDATE_TAG_KEY);
|
|
@@ -9630,7 +9658,7 @@ class Path extends Graphic {
|
|
|
9630
9658
|
tb1: tb1,
|
|
9631
9659
|
tb2: tb2
|
|
9632
9660
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9633
|
-
updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
9661
|
+
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;
|
|
9634
9662
|
const {
|
|
9635
9663
|
lineJoin = pathTheme.lineJoin
|
|
9636
9664
|
} = attribute;
|
|
@@ -9687,7 +9715,7 @@ class Area extends Graphic {
|
|
|
9687
9715
|
return getTheme(this).area;
|
|
9688
9716
|
}
|
|
9689
9717
|
updateAABBBounds(attribute, areaTheme, aabbBounds) {
|
|
9690
|
-
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9718
|
+
this.updatePathProxyAABBBounds(aabbBounds) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds)), application.graphicService.updateTempAABBBounds(aabbBounds), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
9691
9719
|
const {
|
|
9692
9720
|
lineJoin = areaTheme.lineJoin
|
|
9693
9721
|
} = attribute;
|
|
@@ -9892,7 +9920,7 @@ class Arc extends Graphic {
|
|
|
9892
9920
|
tb1: tb1,
|
|
9893
9921
|
tb2: tb2
|
|
9894
9922
|
} = application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
9895
|
-
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);
|
|
9923
|
+
updateBoundsOfCommonOuterBorder(attribute, arcTheme, tb1), aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.setWidthHeightWithoutTransform(aabbBounds);
|
|
9896
9924
|
const {
|
|
9897
9925
|
lineJoin = arcTheme.lineJoin
|
|
9898
9926
|
} = attribute;
|
|
@@ -9995,7 +10023,7 @@ class Polygon extends Graphic {
|
|
|
9995
10023
|
return getTheme(this).polygon;
|
|
9996
10024
|
}
|
|
9997
10025
|
updateAABBBounds(attribute, polygonTheme, aabbBounds) {
|
|
9998
|
-
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds);
|
|
10026
|
+
this.updatePathProxyAABBBounds(aabbBounds) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds), application.graphicService.updateTempAABBBounds(aabbBounds), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
9999
10027
|
const {
|
|
10000
10028
|
lineJoin = polygonTheme.lineJoin
|
|
10001
10029
|
} = attribute;
|
|
@@ -16232,7 +16260,7 @@ class PopTip extends AbstractComponent {
|
|
|
16232
16260
|
}
|
|
16233
16261
|
render() {
|
|
16234
16262
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16235
|
-
const { titleStyle = {}, position, contentStyle = {}, panel, logoSymbol, logoText, logoTextStyle = {}, triangleMode = 'default', space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0 } = this.attribute;
|
|
16263
|
+
const { titleStyle = {}, position, contentStyle = {}, panel, logoSymbol, poptipAnchor = 'position', logoText, logoTextStyle = {}, triangleMode = 'default', space = 4, minWidth = 0, maxWidth = Infinity, padding = 4, maxWidthPercent, visible, state, dx = 0, dy = 0, positionBounds } = this.attribute;
|
|
16236
16264
|
let { title = '', content = '' } = this.attribute;
|
|
16237
16265
|
title = this.attribute.titleFormatMethod ? this.attribute.titleFormatMethod(title) : title;
|
|
16238
16266
|
content = this.attribute.contentFormatMethod ? this.attribute.contentFormatMethod(content) : content;
|
|
@@ -16314,11 +16342,12 @@ class PopTip extends AbstractComponent {
|
|
|
16314
16342
|
poptipHeight += contentShape.AABBBounds.height();
|
|
16315
16343
|
}
|
|
16316
16344
|
}
|
|
16317
|
-
const layout = position === 'auto';
|
|
16345
|
+
const layout = position === 'auto' || isArray(position);
|
|
16346
|
+
const positionList = isArray(position) ? position : this.positionList;
|
|
16318
16347
|
let maxBBoxI;
|
|
16319
16348
|
let maxBBoxSize = -Infinity;
|
|
16320
|
-
for (let i = 0; i <
|
|
16321
|
-
const p = layout ?
|
|
16349
|
+
for (let i = 0; i < positionList.length + 1; i++) {
|
|
16350
|
+
const p = layout ? positionList[i === positionList.length ? maxBBoxI : i] : position;
|
|
16322
16351
|
let symbolType = 'arrow2Left';
|
|
16323
16352
|
let offsetX = (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 4;
|
|
16324
16353
|
let offsetY = 0;
|
|
@@ -16327,16 +16356,21 @@ class PopTip extends AbstractComponent {
|
|
|
16327
16356
|
}
|
|
16328
16357
|
else if (triangleMode === 'concise') {
|
|
16329
16358
|
symbolType = conciseSymbolMap[p];
|
|
16330
|
-
offsetX = ['tl', 'bl', 'rt', 'rb'].includes(
|
|
16359
|
+
offsetX = ['tl', 'bl', 'rt', 'rb'].includes(p)
|
|
16331
16360
|
? (isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2
|
|
16332
16361
|
: -(isArray(symbolSize) ? symbolSize[0] : symbolSize) / 2;
|
|
16333
|
-
offsetY = ['tl', 'tr', 'lb', 'rb'].includes(
|
|
16362
|
+
offsetY = ['tl', 'tr', 'lb', 'rb'].includes(p)
|
|
16334
16363
|
? -(isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2
|
|
16335
16364
|
: (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;
|
|
16336
16365
|
}
|
|
16337
16366
|
const { angle, offset } = this.getAngleAndOffset(p, popTipWidth, poptipHeight, isArray(spaceSize) ? spaceSize : [spaceSize, spaceSize - lineWidth], symbolType);
|
|
16367
|
+
let anchorPoint = { x: 0, y: 0 };
|
|
16368
|
+
if (poptipAnchor === 'bounds' && positionBounds) {
|
|
16369
|
+
anchorPoint = this.calculateAnchorPoint(p, positionBounds);
|
|
16370
|
+
}
|
|
16371
|
+
let bgSymbol;
|
|
16338
16372
|
if (isBoolean(bgVisible)) {
|
|
16339
|
-
|
|
16373
|
+
bgSymbol = group.createOrUpdateChild('poptip-symbol-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && (contentVisible || titleVisible), x: offsetX, y: offsetY, strokeBoundsBuffer: -1, boundsPadding: -2, anchor: [0, 0], symbolType, angle: angle, dx: offset[0], dy: offset[1] - ((_j = backgroundStyle.space) !== null && _j !== void 0 ? _j : 0), size: symbolSize, zIndex: 9 }), 'symbol');
|
|
16340
16374
|
if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
16341
16375
|
bgSymbol.states = state.panel;
|
|
16342
16376
|
}
|
|
@@ -16352,8 +16386,8 @@ class PopTip extends AbstractComponent {
|
|
|
16352
16386
|
}
|
|
16353
16387
|
}
|
|
16354
16388
|
group.setAttributes({
|
|
16355
|
-
x: -offset[0] + dx,
|
|
16356
|
-
y: -offset[1] + dy,
|
|
16389
|
+
x: -offset[0] + dx + anchorPoint.x,
|
|
16390
|
+
y: -offset[1] + dy + anchorPoint.y,
|
|
16357
16391
|
anchor: [offsetX, offsetY]
|
|
16358
16392
|
});
|
|
16359
16393
|
if (logoSymbol) {
|
|
@@ -16375,27 +16409,97 @@ class PopTip extends AbstractComponent {
|
|
|
16375
16409
|
group.createOrUpdateChild('poptip-logo-text', Object.assign(Object.assign({}, logoTextStyle), { x: 0, y: poptipHeight / 2, visible: bgVisible && (contentVisible || titleVisible), text: logoText, textAlign: 'center', textBaseline: 'middle', zIndex: 10 }), 'text');
|
|
16376
16410
|
}
|
|
16377
16411
|
}
|
|
16378
|
-
if (
|
|
16412
|
+
if (range) {
|
|
16379
16413
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
16380
16414
|
const b = _tBounds;
|
|
16381
16415
|
const stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
16382
|
-
if (
|
|
16383
|
-
|
|
16416
|
+
if (layout) {
|
|
16417
|
+
if (rectInsideAnotherRect(b, stageBounds, false)) {
|
|
16418
|
+
break;
|
|
16419
|
+
}
|
|
16420
|
+
else {
|
|
16421
|
+
const bbox = getRectIntersect(b, stageBounds, false);
|
|
16422
|
+
const size = (bbox.x2 - bbox.x1) * (bbox.y2 - bbox.y1);
|
|
16423
|
+
if (size > maxBBoxSize) {
|
|
16424
|
+
maxBBoxSize = size;
|
|
16425
|
+
maxBBoxI = i;
|
|
16426
|
+
}
|
|
16427
|
+
}
|
|
16384
16428
|
}
|
|
16385
|
-
|
|
16386
|
-
const
|
|
16387
|
-
const
|
|
16388
|
-
|
|
16389
|
-
|
|
16390
|
-
|
|
16429
|
+
if (['top', 'bottom', 'left', 'right'].includes(p)) {
|
|
16430
|
+
const isVerticalPosition = p === 'top' || p === 'bottom';
|
|
16431
|
+
const isHorizontalPosition = p === 'left' || p === 'right';
|
|
16432
|
+
let mainDirectionOverlap = false;
|
|
16433
|
+
if (isVerticalPosition) {
|
|
16434
|
+
mainDirectionOverlap = (p === 'top' && b.y1 < 0) || (p === 'bottom' && b.y2 > stageBounds.y2);
|
|
16435
|
+
}
|
|
16436
|
+
else if (isHorizontalPosition) {
|
|
16437
|
+
mainDirectionOverlap = (p === 'left' && b.x1 < 0) || (p === 'right' && b.x2 > stageBounds.x2);
|
|
16438
|
+
}
|
|
16439
|
+
if (!mainDirectionOverlap) {
|
|
16440
|
+
let secondaryOffset = 0;
|
|
16441
|
+
const szNumber = (isArray(symbolSize) ? symbolSize[1] : symbolSize) / 2;
|
|
16442
|
+
if (isVerticalPosition) {
|
|
16443
|
+
if (b.x1 < 0) {
|
|
16444
|
+
secondaryOffset = -b.x1;
|
|
16445
|
+
}
|
|
16446
|
+
else if (b.x2 > stageBounds.x2) {
|
|
16447
|
+
secondaryOffset = stageBounds.x2 - b.x2;
|
|
16448
|
+
}
|
|
16449
|
+
group.setAttribute('x', group.attribute.x + secondaryOffset);
|
|
16450
|
+
bgSymbol.setAttribute('dx', min(max(bgSymbol.attribute.dx - secondaryOffset, szNumber), b.width() - szNumber));
|
|
16451
|
+
}
|
|
16452
|
+
else if (isHorizontalPosition) {
|
|
16453
|
+
if (b.y1 < 0) {
|
|
16454
|
+
secondaryOffset = -b.y1;
|
|
16455
|
+
}
|
|
16456
|
+
else if (b.y2 > stageBounds.y2) {
|
|
16457
|
+
secondaryOffset = stageBounds.y2 - b.y2;
|
|
16458
|
+
}
|
|
16459
|
+
group.setAttribute('y', group.attribute.y + secondaryOffset);
|
|
16460
|
+
bgSymbol.setAttribute('dy', min(max(bgSymbol.attribute.dy - secondaryOffset, szNumber), b.height() - szNumber));
|
|
16461
|
+
}
|
|
16462
|
+
break;
|
|
16391
16463
|
}
|
|
16392
16464
|
}
|
|
16465
|
+
if (!layout) {
|
|
16466
|
+
break;
|
|
16467
|
+
}
|
|
16393
16468
|
}
|
|
16394
16469
|
else {
|
|
16395
16470
|
break;
|
|
16396
16471
|
}
|
|
16397
16472
|
}
|
|
16398
16473
|
}
|
|
16474
|
+
calculateAnchorPoint(position, positionBounds) {
|
|
16475
|
+
if (!positionBounds) {
|
|
16476
|
+
return { x: 0, y: 0 };
|
|
16477
|
+
}
|
|
16478
|
+
const { x, y } = this.attribute;
|
|
16479
|
+
const { x1, y1, x2, y2 } = positionBounds;
|
|
16480
|
+
const width = x2 - x1;
|
|
16481
|
+
const height = y2 - y1;
|
|
16482
|
+
switch (position) {
|
|
16483
|
+
case 'top':
|
|
16484
|
+
case 'tl':
|
|
16485
|
+
case 'tr':
|
|
16486
|
+
return { x: x1 + width / 2 - x, y: y1 - y };
|
|
16487
|
+
case 'bottom':
|
|
16488
|
+
case 'bl':
|
|
16489
|
+
case 'br':
|
|
16490
|
+
return { x: x1 + width / 2 - x, y: y2 - y };
|
|
16491
|
+
case 'left':
|
|
16492
|
+
case 'lt':
|
|
16493
|
+
case 'lb':
|
|
16494
|
+
return { x: x1 - x, y: y1 + height / 2 - y };
|
|
16495
|
+
case 'right':
|
|
16496
|
+
case 'rt':
|
|
16497
|
+
case 'rb':
|
|
16498
|
+
return { x: x2 - x, y: y1 + height / 2 - y };
|
|
16499
|
+
default:
|
|
16500
|
+
return { x: 0, y: 0 };
|
|
16501
|
+
}
|
|
16502
|
+
}
|
|
16399
16503
|
getAngleAndOffset(position, width, height, size, symbolType) {
|
|
16400
16504
|
const sizeH = symbolType === 'arrow2Left' ? size[1] / 2 : size[1];
|
|
16401
16505
|
switch (position) {
|
|
@@ -16527,7 +16631,7 @@ let PopTipRenderContribution = class PopTipRenderContribution {
|
|
|
16527
16631
|
poptip.content = (_a = poptip.content) !== null && _a !== void 0 ? _a : graphic.attribute.text;
|
|
16528
16632
|
}
|
|
16529
16633
|
const matrix = graphic.globalTransMatrix;
|
|
16530
|
-
this.poptipComponent.setAttributes(Object.assign(Object.assign({ visibleAll: true, pickable: false, childrenPickable: false }, poptip), { x: matrix.e, y: matrix.f }));
|
|
16634
|
+
this.poptipComponent.setAttributes(Object.assign(Object.assign({ visibleAll: true, pickable: false, childrenPickable: false, poptipAnchor: 'bounds' }, poptip), { x: matrix.e, y: matrix.f, positionBounds: graphic.globalAABBBounds }));
|
|
16531
16635
|
drawContext.stage.tryInitInteractiveLayer();
|
|
16532
16636
|
const interactiveLayer = drawContext.stage.getLayer('_builtin_interactive');
|
|
16533
16637
|
if (interactiveLayer) {
|
|
@@ -17402,24 +17506,17 @@ function getPolygonPath(points, closed) {
|
|
|
17402
17506
|
}
|
|
17403
17507
|
function textIntersect(textA, textB, sep) {
|
|
17404
17508
|
var _a;
|
|
17405
|
-
let a;
|
|
17406
|
-
let b;
|
|
17407
17509
|
const angle = (_a = textA.attribute) === null || _a === void 0 ? void 0 : _a.angle;
|
|
17408
17510
|
const isHorizontal = isAngleHorizontal(angle, Number.EPSILON);
|
|
17409
|
-
const isAABBIntersects = (textA, textB, sep) => {
|
|
17410
|
-
a = textA.AABBBounds;
|
|
17411
|
-
b = textB.AABBBounds;
|
|
17412
|
-
return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
|
|
17413
|
-
};
|
|
17414
17511
|
if (isHorizontal) {
|
|
17415
|
-
return
|
|
17512
|
+
return sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds);
|
|
17416
17513
|
}
|
|
17417
|
-
a = textA.OBBBounds;
|
|
17418
|
-
b = textB.OBBBounds;
|
|
17514
|
+
const a = textA.OBBBounds;
|
|
17515
|
+
const b = textB.OBBBounds;
|
|
17419
17516
|
if (!a || !b || a.empty() || b.empty()) {
|
|
17420
|
-
return
|
|
17517
|
+
return sep > aabbSeparation(textA.AABBBounds, textB.AABBBounds);
|
|
17421
17518
|
}
|
|
17422
|
-
return a.intersects(b);
|
|
17519
|
+
return a.intersects(b) || sep > obbSeparation(a, b);
|
|
17423
17520
|
}
|
|
17424
17521
|
function hasOverlap(items, pad) {
|
|
17425
17522
|
for (let i = 1, n = items.length, a = items[0], b; i < n; a = b, ++i) {
|
|
@@ -24017,21 +24114,30 @@ function commonLineClipIn(line, label, duration, delay, easing) {
|
|
|
24017
24114
|
.to({ clipRange: 1 }, stepDuration, easing);
|
|
24018
24115
|
});
|
|
24019
24116
|
graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);
|
|
24020
|
-
|
|
24021
|
-
|
|
24117
|
+
array(label).forEach(labelNode => {
|
|
24118
|
+
const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
|
|
24119
|
+
graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing);
|
|
24120
|
+
graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
|
|
24121
|
+
});
|
|
24022
24122
|
}
|
|
24023
24123
|
|
|
24024
24124
|
function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
24025
24125
|
segmentFadeIn(line, delay, duration, easing);
|
|
24026
|
-
|
|
24126
|
+
array(label).forEach(labelNode => {
|
|
24127
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
24128
|
+
});
|
|
24027
24129
|
}
|
|
24028
24130
|
function areaFadeIn(area, label, duration, delay, easing) {
|
|
24029
24131
|
graphicFadeIn(area, delay, duration, easing);
|
|
24030
|
-
|
|
24132
|
+
array(label).forEach(labelNode => {
|
|
24133
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
24134
|
+
});
|
|
24031
24135
|
}
|
|
24032
24136
|
function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
24033
24137
|
graphicFadeIn(area, delay, duration, easing);
|
|
24034
|
-
|
|
24138
|
+
array(label).forEach(labelNode => {
|
|
24139
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
24140
|
+
});
|
|
24035
24141
|
}
|
|
24036
24142
|
function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
24037
24143
|
var _a;
|
|
@@ -24047,15 +24153,21 @@ function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
|
24047
24153
|
|
|
24048
24154
|
function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
24049
24155
|
segmentFadeOut(line, delay, duration, easing);
|
|
24050
|
-
|
|
24156
|
+
array(label).forEach(labelNode => {
|
|
24157
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
24158
|
+
});
|
|
24051
24159
|
}
|
|
24052
24160
|
function areaFadeOut(area, label, duration, delay, easing) {
|
|
24053
24161
|
graphicFadeOut(area, delay, duration, easing);
|
|
24054
|
-
|
|
24162
|
+
array(label).forEach(labelNode => {
|
|
24163
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
24164
|
+
});
|
|
24055
24165
|
}
|
|
24056
24166
|
function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
24057
24167
|
graphicFadeOut(area, delay, duration, easing);
|
|
24058
|
-
|
|
24168
|
+
array(label).forEach(labelNode => {
|
|
24169
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
24170
|
+
});
|
|
24059
24171
|
}
|
|
24060
24172
|
function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
24061
24173
|
var _a;
|
|
@@ -24209,6 +24321,48 @@ const DefaultExitMarkerAnimation = {
|
|
|
24209
24321
|
delay: 0
|
|
24210
24322
|
};
|
|
24211
24323
|
|
|
24324
|
+
class MarkLabelMixin {
|
|
24325
|
+
getLabel() {
|
|
24326
|
+
return this._label;
|
|
24327
|
+
}
|
|
24328
|
+
_addMarkLabels(container, labelName, defaultLabelAttrs) {
|
|
24329
|
+
const { label, state } = this.attribute;
|
|
24330
|
+
const labelStates = array(state === null || state === void 0 ? void 0 : state.label);
|
|
24331
|
+
const labelBackgroundStates = array(state === null || state === void 0 ? void 0 : state.labelBackground);
|
|
24332
|
+
const labelShapes = array(label).map((labelAttrs, index) => {
|
|
24333
|
+
var _a, _b;
|
|
24334
|
+
const finalLabelAttrs = merge({}, defaultLabelAttrs, labelAttrs);
|
|
24335
|
+
const markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), { state: {
|
|
24336
|
+
panel: merge({}, DEFAULT_STATES$2, (_a = labelBackgroundStates[index]) !== null && _a !== void 0 ? _a : last(labelBackgroundStates)),
|
|
24337
|
+
text: merge({}, DEFAULT_STATES$2, (_b = labelStates[index]) !== null && _b !== void 0 ? _b : last(labelStates))
|
|
24338
|
+
} }));
|
|
24339
|
+
markLabel.name = labelName;
|
|
24340
|
+
container.add(markLabel);
|
|
24341
|
+
this.setLabelPos(markLabel, finalLabelAttrs);
|
|
24342
|
+
return markLabel;
|
|
24343
|
+
});
|
|
24344
|
+
this._label = array(labelShapes).length === 1 ? labelShapes[0] : labelShapes;
|
|
24345
|
+
}
|
|
24346
|
+
_updateMarkLabels(defaultLabelAttrs) {
|
|
24347
|
+
const { label, state } = this.attribute;
|
|
24348
|
+
const labelShapes = array(this._label);
|
|
24349
|
+
const labelStates = array(state === null || state === void 0 ? void 0 : state.label);
|
|
24350
|
+
const labelBackgroundStates = array(state === null || state === void 0 ? void 0 : state.labelBackground);
|
|
24351
|
+
if (labelShapes.length) {
|
|
24352
|
+
const labels = array(label);
|
|
24353
|
+
labelShapes.forEach((labelItem, index) => {
|
|
24354
|
+
var _a, _b;
|
|
24355
|
+
const finalLabelAttrs = merge({}, defaultLabelAttrs, labels[index]);
|
|
24356
|
+
labelItem.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, finalLabelAttrs), { state: {
|
|
24357
|
+
panel: merge({}, DEFAULT_STATES$2, (_a = labelBackgroundStates[index]) !== null && _a !== void 0 ? _a : last(labelBackgroundStates)),
|
|
24358
|
+
text: merge({}, DEFAULT_STATES$2, (_b = labelStates[index]) !== null && _b !== void 0 ? _b : last(labelStates))
|
|
24359
|
+
} }));
|
|
24360
|
+
this.setLabelPos(labelItem, finalLabelAttrs);
|
|
24361
|
+
});
|
|
24362
|
+
}
|
|
24363
|
+
}
|
|
24364
|
+
}
|
|
24365
|
+
|
|
24212
24366
|
class MarkCommonLine extends Marker {
|
|
24213
24367
|
constructor() {
|
|
24214
24368
|
super(...arguments);
|
|
@@ -24219,20 +24373,17 @@ class MarkCommonLine extends Marker {
|
|
|
24219
24373
|
getLine() {
|
|
24220
24374
|
return this._line;
|
|
24221
24375
|
}
|
|
24222
|
-
|
|
24223
|
-
|
|
24224
|
-
|
|
24225
|
-
|
|
24226
|
-
const { label = {}, limitRect } = this.attribute;
|
|
24227
|
-
const { position, confine, autoRotate } = label;
|
|
24228
|
-
const labelPoint = this.getPointAttrByPosition(position);
|
|
24376
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
24377
|
+
const { limitRect } = this.attribute;
|
|
24378
|
+
const { position, confine, autoRotate } = labelAttrs;
|
|
24379
|
+
const labelPoint = this.getPointAttrByPosition(position, labelAttrs);
|
|
24229
24380
|
const labelAngle = position.toString().toLocaleLowerCase().includes('start')
|
|
24230
24381
|
? this._line.getStartAngle() || 0
|
|
24231
24382
|
: this._line.getEndAngle() || 0;
|
|
24232
|
-
|
|
24383
|
+
labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), { angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0, textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle) }));
|
|
24233
24384
|
if (limitRect && confine) {
|
|
24234
24385
|
const { x, y, width, height } = limitRect;
|
|
24235
|
-
limitShapeInBounds(
|
|
24386
|
+
limitShapeInBounds(labelNode, {
|
|
24236
24387
|
x1: x,
|
|
24237
24388
|
y1: y,
|
|
24238
24389
|
x2: x + width,
|
|
@@ -24241,32 +24392,18 @@ class MarkCommonLine extends Marker {
|
|
|
24241
24392
|
}
|
|
24242
24393
|
}
|
|
24243
24394
|
initMarker(container) {
|
|
24244
|
-
const { label, state } = this.attribute;
|
|
24245
24395
|
const line = this.createSegment();
|
|
24246
24396
|
line.name = 'mark-common-line-line';
|
|
24247
24397
|
this._line = line;
|
|
24248
24398
|
container.add(line);
|
|
24249
|
-
|
|
24250
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
24251
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
24252
|
-
} }));
|
|
24253
|
-
markLabel.name = 'mark-common-line-label';
|
|
24254
|
-
this._label = markLabel;
|
|
24255
|
-
container.add(markLabel);
|
|
24256
|
-
this.setLabelPos();
|
|
24399
|
+
this.addMarkLineLabels(container);
|
|
24257
24400
|
}
|
|
24258
24401
|
updateMarker() {
|
|
24259
|
-
const { label, state } = this.attribute;
|
|
24260
24402
|
this.setLineAttributes();
|
|
24261
|
-
|
|
24262
|
-
this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
|
|
24263
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
24264
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
24265
|
-
} }));
|
|
24266
|
-
this.setLabelPos();
|
|
24267
|
-
}
|
|
24403
|
+
this.updateMarkLineLabels();
|
|
24268
24404
|
}
|
|
24269
24405
|
}
|
|
24406
|
+
mixin(MarkCommonLine, MarkLabelMixin);
|
|
24270
24407
|
|
|
24271
24408
|
const FUZZY_EQUAL_DELTA = 0.001;
|
|
24272
24409
|
const DEFAULT_MARK_LINE_THEME = {
|
|
@@ -24455,6 +24592,7 @@ const DEFAULT_MARK_ARC_LINE_THEME = {
|
|
|
24455
24592
|
lineWidth: 0
|
|
24456
24593
|
},
|
|
24457
24594
|
label: {
|
|
24595
|
+
autoRotate: true,
|
|
24458
24596
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
24459
24597
|
refX: 0,
|
|
24460
24598
|
refY: 0,
|
|
@@ -24509,6 +24647,7 @@ const DEFAULT_MARK_AREA_THEME = {
|
|
|
24509
24647
|
const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
24510
24648
|
interactive: true,
|
|
24511
24649
|
label: {
|
|
24650
|
+
autoRotate: true,
|
|
24512
24651
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
24513
24652
|
textStyle: {
|
|
24514
24653
|
fill: '#fff',
|
|
@@ -24767,10 +24906,9 @@ class MarkLine extends MarkCommonLine {
|
|
|
24767
24906
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkLine.defaultAttributes, attributes));
|
|
24768
24907
|
this.name = 'markLine';
|
|
24769
24908
|
}
|
|
24770
|
-
getPointAttrByPosition(position) {
|
|
24909
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
24771
24910
|
var _a;
|
|
24772
|
-
const {
|
|
24773
|
-
const { refX = 0, refY = 0 } = label;
|
|
24911
|
+
const { refX = 0, refY = 0 } = labelAttrs;
|
|
24774
24912
|
const points = this._line.getMainSegmentPoints();
|
|
24775
24913
|
const lineEndAngle = (_a = this._line.getEndAngle()) !== null && _a !== void 0 ? _a : 0;
|
|
24776
24914
|
const labelAngle = isPostiveXAxis(lineEndAngle) ? lineEndAngle : lineEndAngle;
|
|
@@ -24802,10 +24940,10 @@ class MarkLine extends MarkCommonLine {
|
|
|
24802
24940
|
angle: labelAngle
|
|
24803
24941
|
};
|
|
24804
24942
|
}
|
|
24805
|
-
getRotateByAngle(angle) {
|
|
24943
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
24806
24944
|
var _a;
|
|
24807
24945
|
const itemAngle = isPostiveXAxis(angle) ? angle : angle - Math.PI;
|
|
24808
|
-
return itemAngle + ((_a =
|
|
24946
|
+
return itemAngle + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0);
|
|
24809
24947
|
}
|
|
24810
24948
|
getTextStyle(position, labelAngle, autoRotate) {
|
|
24811
24949
|
if (fuzzyEqualNumber(Math.abs(labelAngle), Math.PI / 2, FUZZY_EQUAL_DELTA) ||
|
|
@@ -24876,6 +25014,12 @@ class MarkLine extends MarkCommonLine {
|
|
|
24876
25014
|
});
|
|
24877
25015
|
return validFlag;
|
|
24878
25016
|
}
|
|
25017
|
+
addMarkLineLabels(container) {
|
|
25018
|
+
this._addMarkLabels(container, 'mark-common-line-label', MarkLine.defaultAttributes.label);
|
|
25019
|
+
}
|
|
25020
|
+
updateMarkLineLabels() {
|
|
25021
|
+
this._updateMarkLabels(MarkLine.defaultAttributes.label);
|
|
25022
|
+
}
|
|
24879
25023
|
}
|
|
24880
25024
|
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
24881
25025
|
|
|
@@ -24892,9 +25036,6 @@ class MarkArea extends Marker {
|
|
|
24892
25036
|
getArea() {
|
|
24893
25037
|
return this._area;
|
|
24894
25038
|
}
|
|
24895
|
-
getLabel() {
|
|
24896
|
-
return this._label;
|
|
24897
|
-
}
|
|
24898
25039
|
constructor(attributes, options) {
|
|
24899
25040
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArea.defaultAttributes, attributes));
|
|
24900
25041
|
this.name = 'markArea';
|
|
@@ -24921,16 +25062,15 @@ class MarkArea extends Marker {
|
|
|
24921
25062
|
}
|
|
24922
25063
|
return result;
|
|
24923
25064
|
}
|
|
24924
|
-
setLabelPos() {
|
|
25065
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
24925
25066
|
var _a;
|
|
24926
|
-
if (this.
|
|
24927
|
-
const
|
|
24928
|
-
const labelPosition = (_a = label.position) !== null && _a !== void 0 ? _a : 'middle';
|
|
25067
|
+
if (this._area) {
|
|
25068
|
+
const labelPosition = (_a = labelAttrs.position) !== null && _a !== void 0 ? _a : 'middle';
|
|
24929
25069
|
const labelPoint = this.getPointAttrByPosition(labelPosition);
|
|
24930
|
-
|
|
24931
|
-
if (this.attribute.limitRect &&
|
|
25070
|
+
labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), { textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle) }));
|
|
25071
|
+
if (this.attribute.limitRect && labelAttrs.confine) {
|
|
24932
25072
|
const { x, y, width, height } = this.attribute.limitRect;
|
|
24933
|
-
limitShapeInBounds(
|
|
25073
|
+
limitShapeInBounds(labelNode, {
|
|
24934
25074
|
x1: x,
|
|
24935
25075
|
y1: y,
|
|
24936
25076
|
x2: x + width,
|
|
@@ -24940,34 +25080,21 @@ class MarkArea extends Marker {
|
|
|
24940
25080
|
}
|
|
24941
25081
|
}
|
|
24942
25082
|
initMarker(container) {
|
|
24943
|
-
const { points,
|
|
25083
|
+
const { points, areaStyle, state } = this.attribute;
|
|
24944
25084
|
const area = graphicCreator.polygon(Object.assign({ points: points }, areaStyle));
|
|
24945
25085
|
area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
|
|
24946
25086
|
area.name = 'mark-area-polygon';
|
|
24947
25087
|
this._area = area;
|
|
24948
25088
|
container.add(area);
|
|
24949
|
-
|
|
24950
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
24951
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
24952
|
-
} }));
|
|
24953
|
-
markLabel.name = 'mark-area-label';
|
|
24954
|
-
this._label = markLabel;
|
|
24955
|
-
container.add(markLabel);
|
|
24956
|
-
this.setLabelPos();
|
|
25089
|
+
this._addMarkLabels(container, 'mark-area-label', MarkArea.defaultAttributes.label);
|
|
24957
25090
|
}
|
|
24958
25091
|
updateMarker() {
|
|
24959
|
-
const { points,
|
|
25092
|
+
const { points, areaStyle, state } = this.attribute;
|
|
24960
25093
|
if (this._area) {
|
|
24961
25094
|
this._area.setAttributes(Object.assign({ points: points }, areaStyle));
|
|
24962
25095
|
this._area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
|
|
24963
25096
|
}
|
|
24964
|
-
|
|
24965
|
-
this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
|
|
24966
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
24967
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
24968
|
-
} }));
|
|
24969
|
-
}
|
|
24970
|
-
this.setLabelPos();
|
|
25097
|
+
this._updateMarkLabels(MarkArea.defaultAttributes.label);
|
|
24971
25098
|
}
|
|
24972
25099
|
isValidPoints() {
|
|
24973
25100
|
const { points } = this.attribute;
|
|
@@ -24985,6 +25112,7 @@ class MarkArea extends Marker {
|
|
|
24985
25112
|
}
|
|
24986
25113
|
}
|
|
24987
25114
|
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
25115
|
+
mixin(MarkArea, MarkLabelMixin);
|
|
24988
25116
|
|
|
24989
25117
|
loadMarkArcLineComponent();
|
|
24990
25118
|
function registerMarkArcLineAnimate() {
|
|
@@ -24997,14 +25125,12 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
24997
25125
|
}
|
|
24998
25126
|
}
|
|
24999
25127
|
constructor(attributes, options) {
|
|
25000
|
-
super((options === null || options === void 0 ? void 0 : options.skipDefault)
|
|
25001
|
-
? attributes
|
|
25002
|
-
: merge({}, MarkArcLine.defaultAttributes, attributes, { label: { autoRotate: true } }));
|
|
25128
|
+
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes));
|
|
25003
25129
|
this.name = 'markArcLine';
|
|
25004
25130
|
}
|
|
25005
|
-
getPointAttrByPosition(direction) {
|
|
25006
|
-
const { center, radius, startAngle, endAngle
|
|
25007
|
-
const { refX = 0, refY = 0 } =
|
|
25131
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
25132
|
+
const { center, radius, startAngle, endAngle } = this.attribute;
|
|
25133
|
+
const { refX = 0, refY = 0 } = labelAttrs;
|
|
25008
25134
|
let angle;
|
|
25009
25135
|
switch (direction) {
|
|
25010
25136
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -25036,9 +25162,9 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
25036
25162
|
getTextStyle(position) {
|
|
25037
25163
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
25038
25164
|
}
|
|
25039
|
-
getRotateByAngle(angle) {
|
|
25165
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
25040
25166
|
var _a;
|
|
25041
|
-
return angle - Math.PI / 2 + ((_a =
|
|
25167
|
+
return angle - Math.PI / 2 + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0);
|
|
25042
25168
|
}
|
|
25043
25169
|
createSegment() {
|
|
25044
25170
|
const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this
|
|
@@ -25081,6 +25207,12 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
25081
25207
|
isValidPoints() {
|
|
25082
25208
|
return true;
|
|
25083
25209
|
}
|
|
25210
|
+
addMarkLineLabels(container) {
|
|
25211
|
+
this._addMarkLabels(container, 'mark-common-line-label', MarkArcLine.defaultAttributes.label);
|
|
25212
|
+
}
|
|
25213
|
+
updateMarkLineLabels() {
|
|
25214
|
+
this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
|
|
25215
|
+
}
|
|
25084
25216
|
}
|
|
25085
25217
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
25086
25218
|
|
|
@@ -25097,20 +25229,15 @@ class MarkArcArea extends Marker {
|
|
|
25097
25229
|
getArea() {
|
|
25098
25230
|
return this._area;
|
|
25099
25231
|
}
|
|
25100
|
-
getLabel() {
|
|
25101
|
-
return this._label;
|
|
25102
|
-
}
|
|
25103
25232
|
constructor(attributes, options) {
|
|
25104
|
-
super((options === null || options === void 0 ? void 0 : options.skipDefault)
|
|
25105
|
-
? attributes
|
|
25106
|
-
: merge({}, MarkArcArea.defaultAttributes, attributes, { label: { autoRotate: true } }));
|
|
25233
|
+
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes));
|
|
25107
25234
|
this.name = 'markArcArea';
|
|
25108
25235
|
this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;
|
|
25109
25236
|
this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
25110
25237
|
}
|
|
25111
|
-
getPointAttrByPosition(position) {
|
|
25112
|
-
const { center, innerRadius, outerRadius, startAngle, endAngle
|
|
25113
|
-
const { refX = 0, refY = 0 } =
|
|
25238
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
25239
|
+
const { center, innerRadius, outerRadius, startAngle, endAngle } = this.attribute;
|
|
25240
|
+
const { refX = 0, refY = 0 } = labelAttrs;
|
|
25114
25241
|
let radius;
|
|
25115
25242
|
let angle;
|
|
25116
25243
|
switch (position) {
|
|
@@ -25154,16 +25281,15 @@ class MarkArcArea extends Marker {
|
|
|
25154
25281
|
angle
|
|
25155
25282
|
};
|
|
25156
25283
|
}
|
|
25157
|
-
setLabelPos() {
|
|
25284
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
25158
25285
|
var _a;
|
|
25159
|
-
if (this.
|
|
25160
|
-
const {
|
|
25161
|
-
const
|
|
25162
|
-
|
|
25163
|
-
this.
|
|
25164
|
-
if (this.attribute.limitRect && label.confine) {
|
|
25286
|
+
if (this._area) {
|
|
25287
|
+
const { position: labelPosition = 'arcInnerMiddle', autoRotate } = labelAttrs;
|
|
25288
|
+
const labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
|
|
25289
|
+
labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), { angle: autoRotate ? labelAttr.angle - Math.PI / 2 + ((_a = labelAttrs.refAngle) !== null && _a !== void 0 ? _a : 0) : 0, textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle) }));
|
|
25290
|
+
if (this.attribute.limitRect && labelAttrs.confine) {
|
|
25165
25291
|
const { x, y, width, height } = this.attribute.limitRect;
|
|
25166
|
-
limitShapeInBounds(
|
|
25292
|
+
limitShapeInBounds(labelNode, {
|
|
25167
25293
|
x1: x,
|
|
25168
25294
|
y1: y,
|
|
25169
25295
|
x2: x + width,
|
|
@@ -25173,7 +25299,7 @@ class MarkArcArea extends Marker {
|
|
|
25173
25299
|
}
|
|
25174
25300
|
}
|
|
25175
25301
|
initMarker(container) {
|
|
25176
|
-
const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle,
|
|
25302
|
+
const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, state } = this
|
|
25177
25303
|
.attribute;
|
|
25178
25304
|
const area = graphicCreator.arc(Object.assign({ x: center.x, y: center.y, innerRadius,
|
|
25179
25305
|
outerRadius,
|
|
@@ -25183,14 +25309,7 @@ class MarkArcArea extends Marker {
|
|
|
25183
25309
|
area.name = 'polar-mark-area-area';
|
|
25184
25310
|
this._area = area;
|
|
25185
25311
|
container.add(area);
|
|
25186
|
-
|
|
25187
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
25188
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
25189
|
-
} }));
|
|
25190
|
-
markLabel.name = 'mark-area-label';
|
|
25191
|
-
this._label = markLabel;
|
|
25192
|
-
container.add(markLabel);
|
|
25193
|
-
this.setLabelPos();
|
|
25312
|
+
this._addMarkLabels(container, 'mark-area-label', MarkArcArea.defaultAttributes.label);
|
|
25194
25313
|
}
|
|
25195
25314
|
updateMarker() {
|
|
25196
25315
|
const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this
|
|
@@ -25202,19 +25321,14 @@ class MarkArcArea extends Marker {
|
|
|
25202
25321
|
endAngle }, areaStyle));
|
|
25203
25322
|
this._area.states = merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.area);
|
|
25204
25323
|
}
|
|
25205
|
-
|
|
25206
|
-
this._label.setAttributes(Object.assign(Object.assign({ dx: 0, dy: 0 }, label), { state: {
|
|
25207
|
-
panel: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.labelBackground),
|
|
25208
|
-
text: merge({}, DEFAULT_STATES$2, state === null || state === void 0 ? void 0 : state.label)
|
|
25209
|
-
} }));
|
|
25210
|
-
this.setLabelPos();
|
|
25211
|
-
}
|
|
25324
|
+
this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
25212
25325
|
}
|
|
25213
25326
|
isValidPoints() {
|
|
25214
25327
|
return true;
|
|
25215
25328
|
}
|
|
25216
25329
|
}
|
|
25217
25330
|
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
25331
|
+
mixin(MarkArcArea, MarkLabelMixin);
|
|
25218
25332
|
|
|
25219
25333
|
loadMarkPointComponent();
|
|
25220
25334
|
function registerMarkPointAnimate() {
|
|
@@ -31265,10 +31379,10 @@ class Switch extends AbstractComponent {
|
|
|
31265
31379
|
});
|
|
31266
31380
|
this._circle.setAttributes({
|
|
31267
31381
|
y: circleY,
|
|
31268
|
-
x: this.attribute.checked ? circleX : maxWidth - circleX
|
|
31382
|
+
x: !this.attribute.checked ? circleX : maxWidth - circleX
|
|
31269
31383
|
});
|
|
31270
31384
|
this._text.setAttributes({
|
|
31271
|
-
x: this.attribute.checked ? textX : maxWidth - textX - textWidth,
|
|
31385
|
+
x: !this.attribute.checked ? textX : maxWidth - textX - textWidth,
|
|
31272
31386
|
y: textY
|
|
31273
31387
|
});
|
|
31274
31388
|
}
|
|
@@ -31506,6 +31620,6 @@ StoryLabelItem.defaultAttributes = {
|
|
|
31506
31620
|
theme: 'default'
|
|
31507
31621
|
};
|
|
31508
31622
|
|
|
31509
|
-
const version = "0.22.7-alpha.
|
|
31623
|
+
const version = "0.22.7-alpha.9";
|
|
31510
31624
|
|
|
31511
31625
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|