@visactor/vrender-components 0.20.4 → 0.20.5
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/base.d.ts +0 -2
- package/cjs/axis/base.js +0 -5
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.d.ts +2 -5
- package/cjs/axis/circle.js +41 -9
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/line.d.ts +1 -0
- package/cjs/axis/line.js +5 -0
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/overlap/circle-auto-limit.d.ts +16 -0
- package/cjs/axis/overlap/circle-auto-limit.js +62 -0
- package/cjs/axis/overlap/circle-auto-limit.js.map +1 -0
- package/cjs/axis/tick-data/discrete/polar-angle.js +12 -10
- package/cjs/axis/tick-data/discrete/polar-angle.js.map +1 -1
- package/cjs/axis/type.d.ts +1 -1
- package/cjs/axis/type.js.map +1 -1
- package/cjs/axis/util.d.ts +3 -3
- package/cjs/axis/util.js +6 -16
- package/cjs/axis/util.js.map +1 -1
- package/cjs/checkbox/checkbox.js +3 -1
- package/cjs/checkbox/checkbox.js.map +1 -1
- package/cjs/data-zoom/data-zoom.js +5 -4
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interface.d.ts +2 -2
- package/cjs/interface.js.map +1 -1
- package/cjs/label/arc.js +8 -7
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.js +4 -1
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.d.ts +2 -2
- package/cjs/label/type.js.map +1 -1
- package/cjs/radio/radio.js +3 -1
- package/cjs/radio/radio.js.map +1 -1
- package/cjs/tag/tag.js +24 -38
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/util/text.js +3 -3
- package/cjs/util/text.js.map +1 -1
- package/dist/index.es.js +331 -157
- package/es/axis/base.d.ts +0 -2
- package/es/axis/base.js +1 -6
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.d.ts +2 -5
- package/es/axis/circle.js +45 -10
- package/es/axis/circle.js.map +1 -1
- package/es/axis/line.d.ts +1 -0
- package/es/axis/line.js +5 -0
- package/es/axis/line.js.map +1 -1
- package/es/axis/overlap/circle-auto-limit.d.ts +16 -0
- package/es/axis/overlap/circle-auto-limit.js +54 -0
- package/es/axis/overlap/circle-auto-limit.js.map +1 -0
- package/es/axis/tick-data/discrete/polar-angle.js +13 -10
- package/es/axis/tick-data/discrete/polar-angle.js.map +1 -1
- package/es/axis/type.d.ts +1 -1
- package/es/axis/type.js.map +1 -1
- package/es/axis/util.d.ts +3 -3
- package/es/axis/util.js +5 -15
- package/es/axis/util.js.map +1 -1
- package/es/checkbox/checkbox.js +3 -1
- package/es/checkbox/checkbox.js.map +1 -1
- package/es/data-zoom/data-zoom.js +5 -4
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/interface.d.ts +2 -2
- package/es/interface.js.map +1 -1
- package/es/label/arc.js +8 -7
- package/es/label/arc.js.map +1 -1
- package/es/label/base.js +4 -1
- package/es/label/base.js.map +1 -1
- package/es/label/type.d.ts +2 -2
- package/es/label/type.js.map +1 -1
- package/es/radio/radio.js +3 -1
- package/es/radio/radio.js.map +1 -1
- package/es/tag/tag.js +24 -38
- package/es/tag/tag.js.map +1 -1
- package/es/util/text.js +4 -4
- package/es/util/text.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, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, cos, sin, pi, isArray, pointAt, isNumber, getDecimalPlaces, isNil, Color, has, normalTransform, isValidUrl, isBase64, acos, sqrt, transformBoundsWithMatrix, arrayEqual, getContextFont, clampAngleByRadian, asin, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct,
|
|
1
|
+
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, cos, sin, pi, isArray, pointAt, isNumber, getDecimalPlaces, isNil, Color, has, normalTransform, isValidUrl, isBase64, acos, sqrt, transformBoundsWithMatrix, arrayEqual, getContextFont, clampAngleByRadian, asin, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct, isValid, isEmpty, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian, array, isValidNumber, calculateAnchorOfBounds, computeQuadrant, isGreater, isLess, isNumberClose, normalizeAngle, flattenArray, cloneDeep, get, isRotateAABBIntersect, last, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, polygonContainPoint } from '@visactor/vutils';
|
|
2
2
|
import { isContinuous, isDiscrete, LinearScale } from '@visactor/vscale';
|
|
3
3
|
|
|
4
4
|
class Generator {
|
|
@@ -770,7 +770,7 @@ class BoundsContext {
|
|
|
770
770
|
this.bounds.add(cx + xmin, cy + ymin), this.bounds.add(cx + xmax, cy + ymax);
|
|
771
771
|
}
|
|
772
772
|
arcTo(x1, y1, x2, y2, radius) {
|
|
773
|
-
|
|
773
|
+
this.bounds.add(x1, y1);
|
|
774
774
|
}
|
|
775
775
|
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
776
776
|
this.bounds.add(cp1x, cp1y), this.bounds.add(cp2x, cp2y), this.bounds.add(x, y);
|
|
@@ -979,19 +979,25 @@ function drawArc(context, x, y, coords) {
|
|
|
979
979
|
}
|
|
980
980
|
const addArcToBezierPath = (bezierPath, startAngle, endAngle, cx, cy, rx, ry) => {
|
|
981
981
|
const delta = Math.abs(endAngle - startAngle),
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
982
|
+
count = delta > .5 * Math.PI ? Math.ceil(2 * delta / Math.PI) : 1,
|
|
983
|
+
stepAngle = (endAngle - startAngle) / count;
|
|
984
|
+
for (let i = 0; i < count; i++) {
|
|
985
|
+
const sa = startAngle + stepAngle * i,
|
|
986
|
+
ea = startAngle + stepAngle * (i + 1),
|
|
987
|
+
len = 4 * Math.tan(Math.abs(stepAngle) / 4) / 3,
|
|
988
|
+
dir = ea < sa ? -1 : 1,
|
|
989
|
+
c1 = Math.cos(sa),
|
|
990
|
+
s1 = Math.sin(sa),
|
|
991
|
+
c2 = Math.cos(ea),
|
|
992
|
+
s2 = Math.sin(ea),
|
|
993
|
+
x1 = c1 * rx + cx,
|
|
994
|
+
y1 = s1 * ry + cy,
|
|
995
|
+
x4 = c2 * rx + cx,
|
|
996
|
+
y4 = s2 * ry + cy,
|
|
997
|
+
hx = rx * len * dir,
|
|
998
|
+
hy = ry * len * dir;
|
|
999
|
+
bezierPath.push(x1 - hx * s1, y1 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);
|
|
1000
|
+
}
|
|
995
1001
|
};
|
|
996
1002
|
|
|
997
1003
|
const commandFuncs = [(command, context, x, y, sx, sy, z) => context.arc(command[1] * sx + x, command[2] * sy + y, command[3] * (sx + sy) / 2, command[4], command[5], command[6], z), (command, context, x, y, sx, sy, z) => context.arcTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * (sx + sy) / 2, z), (command, context, x, y, sx, sy, z) => context.bezierCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, command[5] * sx + x, command[6] * sy + y, z), (command, context, x, y) => context.closePath(), (command, context, x, y, sx, sy) => context.ellipse(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, command[5], command[6], command[7], command[8]), (command, context, x, y, sx, sy, z) => context.lineTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.moveTo(command[1] * sx + x, command[2] * sy + y, z), (command, context, x, y, sx, sy, z) => context.quadraticCurveTo(command[1] * sx + x, command[2] * sy + y, command[3] * sx + x, command[4] * sy + y, z), (command, context, x, y, sx, sy, z) => context.rect(command[1] * sx + x, command[2] * sy + y, command[3] * sx, command[4] * sy, z)];
|
|
@@ -6322,6 +6328,7 @@ let DefaultGraphicService = class {
|
|
|
6322
6328
|
validCheck(attribute, theme, aabbBounds, graphic) {
|
|
6323
6329
|
if (!graphic) return !0;
|
|
6324
6330
|
if (null != attribute.forceBoundsHeight || null != attribute.forceBoundsWidth) return !0;
|
|
6331
|
+
if (graphic.shadowRoot) return !0;
|
|
6325
6332
|
if (!graphic.valid) return aabbBounds.clear(), !1;
|
|
6326
6333
|
const {
|
|
6327
6334
|
visible = theme.visible
|
|
@@ -9448,13 +9455,23 @@ class Text extends Graphic {
|
|
|
9448
9455
|
if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
9449
9456
|
}
|
|
9450
9457
|
get cliped() {
|
|
9458
|
+
var _a, _b;
|
|
9451
9459
|
const textTheme = this.getGraphicTheme(),
|
|
9452
|
-
attribute = this.attribute
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9460
|
+
attribute = this.attribute,
|
|
9461
|
+
{
|
|
9462
|
+
maxLineWidth = textTheme.maxLineWidth,
|
|
9463
|
+
text: text,
|
|
9464
|
+
whiteSpace = textTheme.whiteSpace
|
|
9465
|
+
} = attribute;
|
|
9466
|
+
if (!Number.isFinite(maxLineWidth)) return !1;
|
|
9467
|
+
if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
|
|
9468
|
+
let mergedText = "";
|
|
9469
|
+
this.cache.layoutData.lines.forEach(item => {
|
|
9470
|
+
mergedText += item.str;
|
|
9471
|
+
});
|
|
9472
|
+
return (Array.isArray(text) ? text.join("") : text) !== mergedText;
|
|
9473
|
+
}
|
|
9474
|
+
return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map(item => item.text).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
|
|
9458
9475
|
}
|
|
9459
9476
|
get multilineLayout() {
|
|
9460
9477
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
@@ -11176,10 +11193,22 @@ class Line {
|
|
|
11176
11193
|
}
|
|
11177
11194
|
draw(ctx, lastLine, x, y, drawEllipsis, drawIcon) {
|
|
11178
11195
|
if (drawEllipsis && (lastLine || this.paragraphs.some(p => p.overflow))) {
|
|
11179
|
-
let
|
|
11196
|
+
let emptyOverflow = !0,
|
|
11197
|
+
skipEllipsis = !1;
|
|
11180
11198
|
for (let i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
11181
11199
|
const paragraph = this.paragraphs[i];
|
|
11182
|
-
if (paragraph.overflow)
|
|
11200
|
+
if (paragraph.overflow) emptyOverflow = emptyOverflow && "" === paragraph.text;else if (emptyOverflow) {
|
|
11201
|
+
skipEllipsis = !0;
|
|
11202
|
+
break;
|
|
11203
|
+
}
|
|
11204
|
+
}
|
|
11205
|
+
let otherParagraphWidth = 0;
|
|
11206
|
+
if (!skipEllipsis) for (let i = this.paragraphs.length - 1; i >= 0; i--) {
|
|
11207
|
+
const paragraph = this.paragraphs[i];
|
|
11208
|
+
if (paragraph.overflow) {
|
|
11209
|
+
if ("" === paragraph.text) break;
|
|
11210
|
+
continue;
|
|
11211
|
+
}
|
|
11183
11212
|
if (paragraph instanceof RichTextIcon) break;
|
|
11184
11213
|
if ("vertical" === this.direction && "vertical" !== paragraph.direction) {
|
|
11185
11214
|
paragraph.verticalEllipsis = !0;
|
|
@@ -11404,6 +11433,21 @@ class RichText extends Graphic {
|
|
|
11404
11433
|
getFrameCache() {
|
|
11405
11434
|
return this.shouldUpdateShape() && (this.doUpdateFrameCache(), this.clearUpdateShapeTag()), this._frameCache;
|
|
11406
11435
|
}
|
|
11436
|
+
get cliped() {
|
|
11437
|
+
const frameCache = this.getFrameCache();
|
|
11438
|
+
if (frameCache.actualHeight > frameCache.height) return !0;
|
|
11439
|
+
const {
|
|
11440
|
+
disableAutoWrapLine: disableAutoWrapLine
|
|
11441
|
+
} = this.attribute;
|
|
11442
|
+
if (disableAutoWrapLine) for (let i = 0; i < frameCache.lines.length; i++) {
|
|
11443
|
+
const l = frameCache.lines[i];
|
|
11444
|
+
for (let j = 0; j < l.paragraphs.length; j++) {
|
|
11445
|
+
const p = l.paragraphs[j];
|
|
11446
|
+
if (p.overflow && "" !== p.text) return !0;
|
|
11447
|
+
}
|
|
11448
|
+
}
|
|
11449
|
+
return !1;
|
|
11450
|
+
}
|
|
11407
11451
|
combinedStyleToCharacter(config) {
|
|
11408
11452
|
const {
|
|
11409
11453
|
fill: fill,
|
|
@@ -14615,9 +14659,12 @@ function getTextType(attributes, typeKey = 'type') {
|
|
|
14615
14659
|
}
|
|
14616
14660
|
function richTextAttributeTransform(attributes) {
|
|
14617
14661
|
var _a, _b;
|
|
14662
|
+
if (isValid(attributes.maxLineWidth)) {
|
|
14663
|
+
attributes.maxWidth = attributes.maxLineWidth;
|
|
14664
|
+
delete attributes.maxLineWidth;
|
|
14665
|
+
}
|
|
14618
14666
|
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
14619
14667
|
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
14620
|
-
attributes.maxWidth = attributes.maxLineWidth;
|
|
14621
14668
|
attributes.textConfig = attributes.text.text || attributes.text;
|
|
14622
14669
|
return attributes;
|
|
14623
14670
|
}
|
|
@@ -14747,6 +14794,8 @@ class Tag extends AbstractComponent {
|
|
|
14747
14794
|
const parsedPadding = normalizePadding(padding);
|
|
14748
14795
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
14749
14796
|
let symbol;
|
|
14797
|
+
let tagX = -parsedPadding[3];
|
|
14798
|
+
let tagY = -parsedPadding[0];
|
|
14750
14799
|
let tagWidth = parsedPadding[1] + parsedPadding[3];
|
|
14751
14800
|
let tagHeight = parsedPadding[0] + parsedPadding[2];
|
|
14752
14801
|
let textX = 0;
|
|
@@ -14770,20 +14819,10 @@ class Tag extends AbstractComponent {
|
|
|
14770
14819
|
if (isRich) {
|
|
14771
14820
|
const richTextAttrs = Object.assign(Object.assign(Object.assign({}, richTextAttributeTransform(Object.assign({ type, text }, textStyle))), textStyle), { visible: isValid(text) && visible !== false, x: textX, y: 0 });
|
|
14772
14821
|
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
bgRect.states = state.panel;
|
|
14778
|
-
}
|
|
14779
|
-
if (backgroundStyle.customShape) {
|
|
14780
|
-
const customShape = backgroundStyle.customShape;
|
|
14781
|
-
bgRect.pathProxy = (attrs) => {
|
|
14782
|
-
return customShape(textShape.attribute, attrs, new CustomPath2D());
|
|
14783
|
-
};
|
|
14784
|
-
}
|
|
14785
|
-
this._bgRect = bgRect;
|
|
14786
|
-
}
|
|
14822
|
+
tagWidth += textShape.AABBBounds.width();
|
|
14823
|
+
tagHeight += textShape.AABBBounds.height();
|
|
14824
|
+
tagX += textShape.AABBBounds.x1;
|
|
14825
|
+
tagY += textShape.AABBBounds.y1;
|
|
14787
14826
|
}
|
|
14788
14827
|
else {
|
|
14789
14828
|
const textAttrs = Object.assign(Object.assign({ text: isObject(text) && 'type' in text && text.type === 'text' ? text.text : text, visible: isValid(text) && visible !== false, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }, textStyle), { x: textX, y: 0 });
|
|
@@ -14811,8 +14850,8 @@ class Tag extends AbstractComponent {
|
|
|
14811
14850
|
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
14812
14851
|
}
|
|
14813
14852
|
}
|
|
14814
|
-
|
|
14815
|
-
|
|
14853
|
+
tagX = 0;
|
|
14854
|
+
tagY = 0;
|
|
14816
14855
|
let flag = 0;
|
|
14817
14856
|
if (textAlign === 'left' || textAlign === 'start') {
|
|
14818
14857
|
flag = 1;
|
|
@@ -14824,14 +14863,14 @@ class Tag extends AbstractComponent {
|
|
|
14824
14863
|
flag = 0;
|
|
14825
14864
|
}
|
|
14826
14865
|
if (!flag) {
|
|
14827
|
-
|
|
14866
|
+
tagX -= tagWidth / 2;
|
|
14828
14867
|
if (symbol) {
|
|
14829
14868
|
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
14830
14869
|
}
|
|
14831
14870
|
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
14832
14871
|
}
|
|
14833
14872
|
else if (flag < 0) {
|
|
14834
|
-
|
|
14873
|
+
tagX -= tagWidth;
|
|
14835
14874
|
if (symbol) {
|
|
14836
14875
|
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
|
|
14837
14876
|
}
|
|
@@ -14892,13 +14931,13 @@ class Tag extends AbstractComponent {
|
|
|
14892
14931
|
}
|
|
14893
14932
|
}
|
|
14894
14933
|
if (textBaseline === 'middle') {
|
|
14895
|
-
|
|
14934
|
+
tagY -= tagHeight / 2;
|
|
14896
14935
|
if (symbol) {
|
|
14897
14936
|
symbol.setAttribute('y', 0);
|
|
14898
14937
|
}
|
|
14899
14938
|
}
|
|
14900
14939
|
else if (textBaseline === 'bottom') {
|
|
14901
|
-
|
|
14940
|
+
tagY -= tagHeight;
|
|
14902
14941
|
if (symbol) {
|
|
14903
14942
|
symbol.setAttribute('y', -textHeight / 2);
|
|
14904
14943
|
}
|
|
@@ -14910,21 +14949,20 @@ class Tag extends AbstractComponent {
|
|
|
14910
14949
|
symbol.setAttribute('y', textHeight / 2);
|
|
14911
14950
|
}
|
|
14912
14951
|
}
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14923
|
-
|
|
14924
|
-
|
|
14925
|
-
}
|
|
14926
|
-
this._bgRect = bgRect;
|
|
14952
|
+
}
|
|
14953
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
14954
|
+
if (visible && isBoolean(bgVisible)) {
|
|
14955
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, width: tagWidth, height: tagHeight, x: tagX, y: tagY }), 'rect');
|
|
14956
|
+
if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
14957
|
+
bgRect.states = state.panel;
|
|
14958
|
+
}
|
|
14959
|
+
if (backgroundStyle.customShape) {
|
|
14960
|
+
const customShape = backgroundStyle.customShape;
|
|
14961
|
+
bgRect.pathProxy = (attrs) => {
|
|
14962
|
+
return customShape(this, attrs, new CustomPath2D());
|
|
14963
|
+
};
|
|
14927
14964
|
}
|
|
14965
|
+
this._bgRect = bgRect;
|
|
14928
14966
|
}
|
|
14929
14967
|
this._textShape = textShape;
|
|
14930
14968
|
this._symbol = symbol;
|
|
@@ -16212,7 +16250,10 @@ class LabelBase extends AbstractComponent {
|
|
|
16212
16250
|
if (line.customShape) {
|
|
16213
16251
|
const customShape = line.customShape;
|
|
16214
16252
|
lineGraphic.pathProxy = (attrs) => {
|
|
16215
|
-
return customShape(
|
|
16253
|
+
return customShape({
|
|
16254
|
+
text,
|
|
16255
|
+
baseMark: baseMark
|
|
16256
|
+
}, attrs, new CustomPath2D());
|
|
16216
16257
|
};
|
|
16217
16258
|
}
|
|
16218
16259
|
if (baseMark && baseMark.attribute.fill) {
|
|
@@ -16974,7 +17015,6 @@ class ArcInfo {
|
|
|
16974
17015
|
this.outerRadius = outerRadius;
|
|
16975
17016
|
this.circleCenter = circleCenter;
|
|
16976
17017
|
this.labelVisible = true;
|
|
16977
|
-
this.labelLimit = 0;
|
|
16978
17018
|
}
|
|
16979
17019
|
getLabelBounds() {
|
|
16980
17020
|
if (!this.labelPosition || !this.labelSize) {
|
|
@@ -17009,12 +17049,14 @@ class ArcLabel extends LabelBase {
|
|
|
17009
17049
|
return { x: 0, y: 0 };
|
|
17010
17050
|
}
|
|
17011
17051
|
_layout(texts) {
|
|
17012
|
-
var _a;
|
|
17052
|
+
var _a, _b, _c;
|
|
17013
17053
|
if (!texts || !texts.length) {
|
|
17014
17054
|
return;
|
|
17015
17055
|
}
|
|
17016
17056
|
const labels = super._layout(texts);
|
|
17017
|
-
const textBoundsArray = labels.map(label =>
|
|
17057
|
+
const textBoundsArray = labels.map(label => {
|
|
17058
|
+
return this.getGraphicBounds(label);
|
|
17059
|
+
});
|
|
17018
17060
|
const ellipsisLabelAttribute = Object.assign(Object.assign({}, this.attribute.textStyle), { text: '…' });
|
|
17019
17061
|
let ellipsisWidth = Infinity;
|
|
17020
17062
|
if (ellipsisLabelAttribute.ellipsis !== false) {
|
|
@@ -17041,14 +17083,18 @@ class ArcLabel extends LabelBase {
|
|
|
17041
17083
|
x: basedArc.labelPosition.x,
|
|
17042
17084
|
y: basedArc.labelPosition.y,
|
|
17043
17085
|
angle: basedArc.angle,
|
|
17044
|
-
maxLineWidth: basedArc.labelLimit,
|
|
17045
17086
|
points: basedArc.pointA && basedArc.pointB && basedArc.pointC
|
|
17046
17087
|
? [basedArc.pointA, basedArc.pointB, basedArc.pointC]
|
|
17047
17088
|
: undefined,
|
|
17048
17089
|
line: basedArc.labelLine
|
|
17049
17090
|
};
|
|
17050
17091
|
if (labels[i].type === 'richtext') {
|
|
17051
|
-
labelAttribute.width =
|
|
17092
|
+
labelAttribute.width =
|
|
17093
|
+
(_b = basedArc.labelLimit) !== null && _b !== void 0 ? _b : labels[i].attribute.width;
|
|
17094
|
+
}
|
|
17095
|
+
else {
|
|
17096
|
+
labelAttribute.maxLineWidth =
|
|
17097
|
+
(_c = basedArc.labelLimit) !== null && _c !== void 0 ? _c : labels[i].attribute.maxLineWidth;
|
|
17052
17098
|
}
|
|
17053
17099
|
labels[i].setAttributes(labelAttribute);
|
|
17054
17100
|
}
|
|
@@ -17289,10 +17335,16 @@ class ArcLabel extends LabelBase {
|
|
|
17289
17335
|
break;
|
|
17290
17336
|
}
|
|
17291
17337
|
labelWidth = Math.max(this._ellipsisWidth, labelWidth);
|
|
17292
|
-
arc.
|
|
17338
|
+
const needAdjustLimit = labelWidth < arc.labelSize.width - 1;
|
|
17339
|
+
if (needAdjustLimit) {
|
|
17340
|
+
arc.labelLimit = labelWidth;
|
|
17341
|
+
}
|
|
17342
|
+
else {
|
|
17343
|
+
arc.labelLimit = null;
|
|
17344
|
+
}
|
|
17293
17345
|
arc.pointC = { x: cx, y: labelPosition.y };
|
|
17294
17346
|
const align = this._computeAlign(arc, attribute);
|
|
17295
|
-
const targetCenterOffset = getAlignOffset(align) * (
|
|
17347
|
+
const targetCenterOffset = getAlignOffset(align) * (needAdjustLimit ? labelWidth : arc.labelSize.width);
|
|
17296
17348
|
if (labelLayoutAlign === 'edge') {
|
|
17297
17349
|
labelPosition.x =
|
|
17298
17350
|
(flag > 0 ? plotLayout.x2 : plotLayout.x1) - flag * targetCenterOffset + flag * this._alignOffset;
|
|
@@ -18210,45 +18262,11 @@ const clampRadian = (angle = 0) => {
|
|
|
18210
18262
|
function isInRange(a, min, max) {
|
|
18211
18263
|
return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
|
|
18212
18264
|
}
|
|
18213
|
-
function getCircleLabelPosition(tickPosition, tickVector
|
|
18214
|
-
|
|
18215
|
-
|
|
18216
|
-
|
|
18217
|
-
|
|
18218
|
-
const PI_3_4 = (Math.PI * 3) / 4;
|
|
18219
|
-
const PI_1_4 = Math.PI / 4;
|
|
18220
|
-
const PI_1_2 = Math.PI / 2;
|
|
18221
|
-
const baseX = tickPosition.x;
|
|
18222
|
-
let dx = 0;
|
|
18223
|
-
if (isInRange(angle, -PI_3_4, -PI_1_4)) {
|
|
18224
|
-
dx = ((angle + PI_3_4) / PI_1_2 - 0.5) * width;
|
|
18225
|
-
}
|
|
18226
|
-
else if (isInRange(angle, PI_1_4, PI_3_4)) {
|
|
18227
|
-
dx = (0.5 - (angle - PI_1_4) / PI_1_2) * width;
|
|
18228
|
-
}
|
|
18229
|
-
else if (Math.cos(angle) >= 0) {
|
|
18230
|
-
dx = width * 0.5;
|
|
18231
|
-
}
|
|
18232
|
-
else {
|
|
18233
|
-
dx = -width * 0.5;
|
|
18234
|
-
}
|
|
18235
|
-
const x = baseX - dx;
|
|
18236
|
-
const baseY = tickPosition.y;
|
|
18237
|
-
let dy = 0;
|
|
18238
|
-
if (isInRange(angle, -PI_3_4, -PI_1_4)) {
|
|
18239
|
-
dy = -height * 0.5;
|
|
18240
|
-
}
|
|
18241
|
-
else if (isInRange(angle, PI_1_4, PI_3_4)) {
|
|
18242
|
-
dy = height * 0.5;
|
|
18243
|
-
}
|
|
18244
|
-
else if (Math.cos(angle) >= 0) {
|
|
18245
|
-
dy = (0.5 - (PI_1_4 - angle) / PI_1_2) * height;
|
|
18246
|
-
}
|
|
18247
|
-
else {
|
|
18248
|
-
dy = (0.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
|
|
18249
|
-
}
|
|
18250
|
-
const y = baseY - dy;
|
|
18251
|
-
return { x, y };
|
|
18265
|
+
function getCircleLabelPosition(tickPosition, tickVector) {
|
|
18266
|
+
return {
|
|
18267
|
+
x: tickPosition.x + tickVector[0],
|
|
18268
|
+
y: tickPosition.y + tickVector[1]
|
|
18269
|
+
};
|
|
18252
18270
|
}
|
|
18253
18271
|
function getAxisBreakSymbolAttrs(props = {}) {
|
|
18254
18272
|
var _a, _b;
|
|
@@ -18300,11 +18318,11 @@ function angleLabelOrientAttribute(angle) {
|
|
|
18300
18318
|
}
|
|
18301
18319
|
return { align, baseline };
|
|
18302
18320
|
}
|
|
18303
|
-
function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside
|
|
18321
|
+
function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside) {
|
|
18304
18322
|
const point = polarToCartesian({ x: 0, y: 0 }, radius, angle);
|
|
18305
18323
|
const labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside));
|
|
18306
18324
|
const vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside);
|
|
18307
|
-
return getCircleLabelPosition(labelPoint, vector
|
|
18325
|
+
return getCircleLabelPosition(labelPoint, vector);
|
|
18308
18326
|
}
|
|
18309
18327
|
function getCirclePoints(center, count, radius, startAngle, endAngle) {
|
|
18310
18328
|
const points = [];
|
|
@@ -18602,29 +18620,6 @@ class AxisBase extends AbstractComponent {
|
|
|
18602
18620
|
getVerticalCoord(point, offset, inside) {
|
|
18603
18621
|
return getVerticalCoord(point, this.getVerticalVector(offset, inside, point));
|
|
18604
18622
|
}
|
|
18605
|
-
getTextAlign(vector) {
|
|
18606
|
-
let align = 'center';
|
|
18607
|
-
if (isNumberClose(vector[0], 0)) {
|
|
18608
|
-
if (isNumberClose(vector[1], 0)) {
|
|
18609
|
-
if (Object.is(vector[1], -0)) {
|
|
18610
|
-
align = 'start';
|
|
18611
|
-
}
|
|
18612
|
-
else if (Object.is(vector[0], -0)) {
|
|
18613
|
-
align = 'end';
|
|
18614
|
-
}
|
|
18615
|
-
}
|
|
18616
|
-
else {
|
|
18617
|
-
align = 'center';
|
|
18618
|
-
}
|
|
18619
|
-
}
|
|
18620
|
-
else if (vector[0] > 0) {
|
|
18621
|
-
align = 'start';
|
|
18622
|
-
}
|
|
18623
|
-
else if (vector[0] < 0) {
|
|
18624
|
-
align = 'end';
|
|
18625
|
-
}
|
|
18626
|
-
return align;
|
|
18627
|
-
}
|
|
18628
18623
|
getTickLineItems() {
|
|
18629
18624
|
const { tick } = this.attribute;
|
|
18630
18625
|
const data = this.data;
|
|
@@ -19361,6 +19356,29 @@ class LineAxis extends AxisBase {
|
|
|
19361
19356
|
axisLineGroup.id = this._getNodeId('line');
|
|
19362
19357
|
container.add(axisLineGroup);
|
|
19363
19358
|
}
|
|
19359
|
+
getTextAlign(vector) {
|
|
19360
|
+
let align = 'center';
|
|
19361
|
+
if (isNumberClose(vector[0], 0)) {
|
|
19362
|
+
if (isNumberClose(vector[1], 0)) {
|
|
19363
|
+
if (Object.is(vector[1], -0)) {
|
|
19364
|
+
align = 'start';
|
|
19365
|
+
}
|
|
19366
|
+
else if (Object.is(vector[0], -0)) {
|
|
19367
|
+
align = 'end';
|
|
19368
|
+
}
|
|
19369
|
+
}
|
|
19370
|
+
else {
|
|
19371
|
+
align = 'center';
|
|
19372
|
+
}
|
|
19373
|
+
}
|
|
19374
|
+
else if (vector[0] > 0) {
|
|
19375
|
+
align = 'start';
|
|
19376
|
+
}
|
|
19377
|
+
else if (vector[0] < 0) {
|
|
19378
|
+
align = 'end';
|
|
19379
|
+
}
|
|
19380
|
+
return align;
|
|
19381
|
+
}
|
|
19364
19382
|
getTitleAttribute() {
|
|
19365
19383
|
var _a, _b, _c;
|
|
19366
19384
|
const _d = this.attribute.title, { position = 'middle', space = 4, textStyle = {}, autoRotate = true, shape, background, state = {}, maxWidth } = _d, restAttrs = __rest(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
|
|
@@ -19773,6 +19791,82 @@ class CircleAxisMixin {
|
|
|
19773
19791
|
}
|
|
19774
19792
|
}
|
|
19775
19793
|
|
|
19794
|
+
function findSiblingLabels(labels, selfIndex) {
|
|
19795
|
+
const len = labels.length;
|
|
19796
|
+
const prevLabel = selfIndex >= 1 ? labels[selfIndex - 1] : labels[len - 1];
|
|
19797
|
+
const nextLabel = selfIndex < len - 1 ? labels[selfIndex + 1] : labels[0];
|
|
19798
|
+
return { prevLabel, nextLabel };
|
|
19799
|
+
}
|
|
19800
|
+
function adjustMaxLineWidth(label, maxLineWidth, ellipsis) {
|
|
19801
|
+
var _a;
|
|
19802
|
+
label.setAttributes({
|
|
19803
|
+
maxLineWidth,
|
|
19804
|
+
ellipsis: (_a = label.attribute.ellipsis) !== null && _a !== void 0 ? _a : ellipsis
|
|
19805
|
+
});
|
|
19806
|
+
}
|
|
19807
|
+
function adjustMaxHeight(labels, selfIndex, bounds) {
|
|
19808
|
+
const siblings = [];
|
|
19809
|
+
if (labels.length >= 3) {
|
|
19810
|
+
const { prevLabel, nextLabel } = findSiblingLabels(labels, selfIndex);
|
|
19811
|
+
siblings.push(prevLabel, nextLabel);
|
|
19812
|
+
}
|
|
19813
|
+
else if (labels.length === 2) {
|
|
19814
|
+
siblings.push(labels[selfIndex === 0 ? 1 : 0]);
|
|
19815
|
+
}
|
|
19816
|
+
const label = labels[selfIndex];
|
|
19817
|
+
let heightLimit = Math.min(Math.abs(label.attribute.y - bounds.y1), Math.abs(label.attribute.y - bounds.y2));
|
|
19818
|
+
siblings.forEach(sibling => {
|
|
19819
|
+
heightLimit = Math.min(heightLimit, Math.abs(sibling.attribute.y - label.attribute.y));
|
|
19820
|
+
});
|
|
19821
|
+
if (heightLimit > 0) {
|
|
19822
|
+
label.setAttributes({ whiteSpace: 'normal', heightLimit });
|
|
19823
|
+
}
|
|
19824
|
+
}
|
|
19825
|
+
function circleAutoLimit(labels, config) {
|
|
19826
|
+
const { ellipsis, inside, bounds, autoWrap, center } = config;
|
|
19827
|
+
if (!inside) {
|
|
19828
|
+
labels.forEach((label, index) => {
|
|
19829
|
+
const { x, y } = label.attribute;
|
|
19830
|
+
const b = label.AABBBounds;
|
|
19831
|
+
if (isNumberClose(x, center.x)) {
|
|
19832
|
+
if (y > bounds.y2 || y < bounds.y1) {
|
|
19833
|
+
adjustMaxLineWidth(label, 0, ellipsis);
|
|
19834
|
+
return;
|
|
19835
|
+
}
|
|
19836
|
+
const boxWidth = bounds.x2 - bounds.x1;
|
|
19837
|
+
if (labels.length >= 3) {
|
|
19838
|
+
const { prevLabel, nextLabel } = findSiblingLabels(labels, index);
|
|
19839
|
+
let leftX = prevLabel.attribute.x;
|
|
19840
|
+
let rightX = nextLabel.attribute.x;
|
|
19841
|
+
if (leftX > rightX) {
|
|
19842
|
+
leftX = nextLabel.attribute.x;
|
|
19843
|
+
rightX = prevLabel.attribute.x;
|
|
19844
|
+
}
|
|
19845
|
+
const maxWidth = leftX === rightX
|
|
19846
|
+
? boxWidth
|
|
19847
|
+
: x >= leftX && x <= rightX
|
|
19848
|
+
? rightX - leftX
|
|
19849
|
+
: Math.min(Math.abs(leftX - x), Math.abs(rightX - x));
|
|
19850
|
+
if (label.AABBBounds.width() > maxWidth) {
|
|
19851
|
+
adjustMaxLineWidth(label, maxWidth, ellipsis);
|
|
19852
|
+
}
|
|
19853
|
+
}
|
|
19854
|
+
else if (label.AABBBounds.width() > boxWidth) {
|
|
19855
|
+
adjustMaxLineWidth(label, boxWidth, ellipsis);
|
|
19856
|
+
}
|
|
19857
|
+
}
|
|
19858
|
+
else if (x > center.x && b.x2 > bounds.x2) {
|
|
19859
|
+
adjustMaxLineWidth(label, bounds.x2 - x, ellipsis);
|
|
19860
|
+
autoWrap && adjustMaxHeight(labels, index, bounds);
|
|
19861
|
+
}
|
|
19862
|
+
else if (x < center.x && b.x1 < bounds.x1) {
|
|
19863
|
+
adjustMaxLineWidth(label, x - bounds.x1, ellipsis);
|
|
19864
|
+
autoWrap && adjustMaxHeight(labels, index, bounds);
|
|
19865
|
+
}
|
|
19866
|
+
});
|
|
19867
|
+
}
|
|
19868
|
+
}
|
|
19869
|
+
|
|
19776
19870
|
loadCircleAxisComponent();
|
|
19777
19871
|
class CircleAxis extends AxisBase {
|
|
19778
19872
|
constructor(attributes, options) {
|
|
@@ -19885,36 +19979,85 @@ class CircleAxis extends AxisBase {
|
|
|
19885
19979
|
}
|
|
19886
19980
|
return subTickLineItems;
|
|
19887
19981
|
}
|
|
19888
|
-
getTextBaseline(vector) {
|
|
19889
|
-
let base = 'middle';
|
|
19890
|
-
if (isNumberClose(vector[1], 0)) {
|
|
19891
|
-
base = 'middle';
|
|
19892
|
-
}
|
|
19893
|
-
else if (vector[1] > 0 && vector[1] > Math.abs(vector[0])) {
|
|
19894
|
-
base = 'top';
|
|
19895
|
-
}
|
|
19896
|
-
else if (vector[1] < 0 && Math.abs(vector[1]) > Math.abs(vector[0])) {
|
|
19897
|
-
base = 'bottom';
|
|
19898
|
-
}
|
|
19899
|
-
return base;
|
|
19900
|
-
}
|
|
19901
19982
|
beforeLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
19902
19983
|
return;
|
|
19903
19984
|
}
|
|
19904
19985
|
handleLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
19905
|
-
|
|
19986
|
+
if (isEmpty(labelShapes)) {
|
|
19987
|
+
return;
|
|
19988
|
+
}
|
|
19989
|
+
const { inside, radius, center, width, height, label, orient } = this.attribute;
|
|
19990
|
+
const bounds = width && height
|
|
19991
|
+
? {
|
|
19992
|
+
x1: 0,
|
|
19993
|
+
y1: 0,
|
|
19994
|
+
x2: width,
|
|
19995
|
+
y2: height
|
|
19996
|
+
}
|
|
19997
|
+
: {
|
|
19998
|
+
x1: center.x - radius,
|
|
19999
|
+
y1: center.y - radius,
|
|
20000
|
+
x2: center.x + radius,
|
|
20001
|
+
y2: center.y + radius
|
|
20002
|
+
};
|
|
20003
|
+
const { layoutFunc, autoLimit, limitEllipsis, autoHide: autoHide$1, autoHideMethod, autoHideSeparation, autoWrap } = label;
|
|
20004
|
+
if (isFunction(layoutFunc)) {
|
|
20005
|
+
layoutFunc(labelShapes, labelData, layer, this);
|
|
20006
|
+
}
|
|
20007
|
+
else {
|
|
20008
|
+
if (autoLimit || autoWrap) {
|
|
20009
|
+
circleAutoLimit(labelShapes, { inside, autoWrap, bounds, ellipsis: limitEllipsis, center });
|
|
20010
|
+
}
|
|
20011
|
+
if (autoHide$1) {
|
|
20012
|
+
autoHide(labelShapes, {
|
|
20013
|
+
orient,
|
|
20014
|
+
method: autoHideMethod,
|
|
20015
|
+
separation: autoHideSeparation
|
|
20016
|
+
});
|
|
20017
|
+
}
|
|
20018
|
+
}
|
|
19906
20019
|
}
|
|
19907
20020
|
afterLabelsOverlap(labelShapes, labelData, labelContainer, layer, layerCount) {
|
|
19908
20021
|
return;
|
|
19909
20022
|
}
|
|
20023
|
+
getTextBaseline(vector) {
|
|
20024
|
+
if (Math.abs(vector[1] / vector[0]) < 0.3) {
|
|
20025
|
+
return 'middle';
|
|
20026
|
+
}
|
|
20027
|
+
else if (vector[1] < 0) {
|
|
20028
|
+
return 'bottom';
|
|
20029
|
+
}
|
|
20030
|
+
else if (vector[1] > 0) {
|
|
20031
|
+
return 'top';
|
|
20032
|
+
}
|
|
20033
|
+
return 'middle';
|
|
20034
|
+
}
|
|
19910
20035
|
getLabelAlign(vector, inside, angle) {
|
|
20036
|
+
if (isNumberClose(vector[0], 0)) {
|
|
20037
|
+
return {
|
|
20038
|
+
textAlign: 'center',
|
|
20039
|
+
textBaseline: vector[1] > 0 ? 'top' : 'bottom'
|
|
20040
|
+
};
|
|
20041
|
+
}
|
|
20042
|
+
else if (vector[0] < 0) {
|
|
20043
|
+
return {
|
|
20044
|
+
textAlign: 'right',
|
|
20045
|
+
textBaseline: this.getTextBaseline(vector)
|
|
20046
|
+
};
|
|
20047
|
+
}
|
|
20048
|
+
else if (vector[0] > 0) {
|
|
20049
|
+
return {
|
|
20050
|
+
textAlign: 'left',
|
|
20051
|
+
textBaseline: this.getTextBaseline(vector)
|
|
20052
|
+
};
|
|
20053
|
+
}
|
|
19911
20054
|
return {
|
|
19912
20055
|
textAlign: 'center',
|
|
19913
20056
|
textBaseline: 'middle'
|
|
19914
20057
|
};
|
|
19915
20058
|
}
|
|
19916
20059
|
getLabelPosition(point, vector, text, style) {
|
|
19917
|
-
return
|
|
20060
|
+
return point;
|
|
19918
20061
|
}
|
|
19919
20062
|
}
|
|
19920
20063
|
CircleAxis.defaultAttributes = DEFAULT_AXIS_THEME;
|
|
@@ -20410,21 +20553,39 @@ const getPolarAngleLabelBounds = (scale, domain, op) => {
|
|
|
20410
20553
|
const labelAngle = (_a = labelStyle.angle) !== null && _a !== void 0 ? _a : 0;
|
|
20411
20554
|
const textMeasure = initTextMeasure(labelStyle);
|
|
20412
20555
|
const labelBoundsList = domain.map((v) => {
|
|
20413
|
-
var _a, _b;
|
|
20414
20556
|
const str = labelFormatter ? labelFormatter(v) : `${v}`;
|
|
20415
20557
|
const { width, height } = textMeasure.quickMeasure(str);
|
|
20416
20558
|
const textWidth = Math.max(width, MIN_TICK_GAP);
|
|
20417
20559
|
const textHeight = Math.max(height, MIN_TICK_GAP);
|
|
20418
20560
|
const angle = scale.scale(v);
|
|
20561
|
+
const center = { x: 0, y: 0 };
|
|
20419
20562
|
let textX = 0;
|
|
20420
20563
|
let textY = 0;
|
|
20421
20564
|
const orient = {
|
|
20422
|
-
align:
|
|
20423
|
-
baseline:
|
|
20565
|
+
align: labelStyle.textAlign,
|
|
20566
|
+
baseline: labelStyle.textBaseline
|
|
20424
20567
|
};
|
|
20425
|
-
const { x, y } = getPolarAngleLabelPosition(angle,
|
|
20426
|
-
|
|
20427
|
-
|
|
20568
|
+
const { x, y } = getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside);
|
|
20569
|
+
if (!orient.align) {
|
|
20570
|
+
if (isNumberClose(x, center.x)) {
|
|
20571
|
+
if (!orient.baseline) {
|
|
20572
|
+
if (y > center.y) {
|
|
20573
|
+
orient.baseline = 'top';
|
|
20574
|
+
}
|
|
20575
|
+
else {
|
|
20576
|
+
orient.baseline = 'bottom';
|
|
20577
|
+
}
|
|
20578
|
+
}
|
|
20579
|
+
}
|
|
20580
|
+
else if (x > center.x) {
|
|
20581
|
+
orient.align = 'left';
|
|
20582
|
+
}
|
|
20583
|
+
else if (x < center.x) {
|
|
20584
|
+
orient.align = 'right';
|
|
20585
|
+
}
|
|
20586
|
+
}
|
|
20587
|
+
textX = x + (orient.align === 'right' ? -textWidth : orient.align === 'left' ? 0 : -textWidth / 2);
|
|
20588
|
+
textY = y + (orient.baseline === 'bottom' ? -textHeight : orient.baseline === 'top' ? 0 : -textHeight / 2);
|
|
20428
20589
|
const bounds = new AABBBounds()
|
|
20429
20590
|
.set(textX, textY, textX + textWidth, textY + textHeight)
|
|
20430
20591
|
.rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
|
|
@@ -20448,7 +20609,9 @@ const polarAngleAxisDiscreteTicks = (scale, op) => {
|
|
|
20448
20609
|
else if (isValid(tickCount)) {
|
|
20449
20610
|
const range = scale.range();
|
|
20450
20611
|
const rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
20451
|
-
const count = isFunction(tickCount)
|
|
20612
|
+
const count = isFunction(tickCount)
|
|
20613
|
+
? tickCount({ axisLength: rangeSize, labelStyle })
|
|
20614
|
+
: tickCount;
|
|
20452
20615
|
scaleTicks = scale.ticks(count);
|
|
20453
20616
|
}
|
|
20454
20617
|
else if (op.sampling) {
|
|
@@ -21368,6 +21531,7 @@ class DataZoom extends AbstractComponent {
|
|
|
21368
21531
|
return false;
|
|
21369
21532
|
}
|
|
21370
21533
|
setTextAttr(startTextBounds, endTextBounds) {
|
|
21534
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
21371
21535
|
const { startTextStyle, endTextStyle } = this.attribute;
|
|
21372
21536
|
const { formatMethod: startTextFormat } = startTextStyle, restStartTextStyle = __rest(startTextStyle, ["formatMethod"]);
|
|
21373
21537
|
const { formatMethod: endTextFormat } = endTextStyle, restEndTextStyle = __rest(endTextStyle, ["formatMethod"]);
|
|
@@ -21398,11 +21562,11 @@ class DataZoom extends AbstractComponent {
|
|
|
21398
21562
|
};
|
|
21399
21563
|
startTextAlignStyle = {
|
|
21400
21564
|
textAlign: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'left' : 'right',
|
|
21401
|
-
textBaseline: 'middle'
|
|
21565
|
+
textBaseline: (_b = (_a = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _a === void 0 ? void 0 : _a.textBaseline) !== null && _b !== void 0 ? _b : 'middle'
|
|
21402
21566
|
};
|
|
21403
21567
|
endTextAlignStyle = {
|
|
21404
21568
|
textAlign: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'right' : 'left',
|
|
21405
|
-
textBaseline: 'middle'
|
|
21569
|
+
textBaseline: (_d = (_c = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _c === void 0 ? void 0 : _c.textBaseline) !== null && _d !== void 0 ? _d : 'middle'
|
|
21406
21570
|
};
|
|
21407
21571
|
}
|
|
21408
21572
|
else {
|
|
@@ -21415,11 +21579,11 @@ class DataZoom extends AbstractComponent {
|
|
|
21415
21579
|
y: position.y + end * height
|
|
21416
21580
|
};
|
|
21417
21581
|
startTextAlignStyle = {
|
|
21418
|
-
textAlign: 'center',
|
|
21582
|
+
textAlign: (_f = (_e = restStartTextStyle === null || restStartTextStyle === void 0 ? void 0 : restStartTextStyle.textStyle) === null || _e === void 0 ? void 0 : _e.textAlign) !== null && _f !== void 0 ? _f : 'center',
|
|
21419
21583
|
textBaseline: this.isTextOverflow(componentBoundsLike, startTextBounds, 'start') ? 'top' : 'bottom'
|
|
21420
21584
|
};
|
|
21421
21585
|
endTextAlignStyle = {
|
|
21422
|
-
textAlign: 'center',
|
|
21586
|
+
textAlign: (_h = (_g = restEndTextStyle === null || restEndTextStyle === void 0 ? void 0 : restEndTextStyle.textStyle) === null || _g === void 0 ? void 0 : _g.textAlign) !== null && _h !== void 0 ? _h : 'center',
|
|
21423
21587
|
textBaseline: this.isTextOverflow(componentBoundsLike, endTextBounds, 'end') ? 'bottom' : 'top'
|
|
21424
21588
|
};
|
|
21425
21589
|
}
|
|
@@ -28530,6 +28694,11 @@ class CheckBox extends AbstractComponent {
|
|
|
28530
28694
|
stroke: this.attribute.box.checkedStroke
|
|
28531
28695
|
});
|
|
28532
28696
|
}
|
|
28697
|
+
else if (this.attribute.disabled) {
|
|
28698
|
+
this._box.setAttributes({
|
|
28699
|
+
fill: this.attribute.box.disableFill
|
|
28700
|
+
});
|
|
28701
|
+
}
|
|
28533
28702
|
this.appendChild(this._box);
|
|
28534
28703
|
}
|
|
28535
28704
|
renderIcon() {
|
|
@@ -28698,6 +28867,11 @@ class Radio extends AbstractComponent {
|
|
|
28698
28867
|
stroke: this.attribute.circle.checkedStroke
|
|
28699
28868
|
});
|
|
28700
28869
|
}
|
|
28870
|
+
else if (this.attribute.disabled) {
|
|
28871
|
+
this._circle.setAttributes({
|
|
28872
|
+
fill: this.attribute.circle.disableFill
|
|
28873
|
+
});
|
|
28874
|
+
}
|
|
28701
28875
|
this.appendChild(this._circle);
|
|
28702
28876
|
}
|
|
28703
28877
|
renderText() {
|
|
@@ -28828,6 +29002,6 @@ EmptyTip.defaultAttributes = {
|
|
|
28828
29002
|
}
|
|
28829
29003
|
};
|
|
28830
29004
|
|
|
28831
|
-
const version = "0.20.
|
|
29005
|
+
const version = "0.20.5";
|
|
28832
29006
|
|
|
28833
29007
|
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, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, 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, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|