@visactor/vrender-components 0.16.17-alpha.1 → 0.16.17-alpha.3
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.js +22 -11
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/line.js +1 -1
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/type.d.ts +6 -3
- package/cjs/axis/type.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/indicator/indicator.js +50 -6
- package/cjs/indicator/indicator.js.map +1 -1
- package/cjs/indicator/type.d.ts +5 -2
- package/cjs/indicator/type.js.map +1 -1
- package/cjs/label/arc.d.ts +4 -3
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.d.ts +11 -11
- package/cjs/label/base.js +18 -0
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/line.js +1 -1
- package/cjs/label/line.js.map +1 -1
- package/cjs/label/type.d.ts +8 -4
- package/cjs/label/type.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +2 -2
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/marker/point.d.ts +1 -1
- package/cjs/marker/type.js.map +1 -1
- package/cjs/tag/tag.js +90 -40
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/tag/type.d.ts +4 -3
- package/cjs/tag/type.js.map +1 -1
- package/cjs/title/title.js +111 -47
- package/cjs/title/title.js.map +1 -1
- package/cjs/title/type.d.ts +10 -5
- package/cjs/title/type.js.map +1 -1
- package/cjs/tooltip/tooltip.js +56 -11
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/cjs/tooltip/type.d.ts +7 -2
- package/cjs/tooltip/type.js.map +1 -1
- package/cjs/tooltip/util.js +9 -1
- package/cjs/tooltip/util.js.map +1 -1
- package/dist/index.js +289 -168
- package/dist/index.min.js +1 -1
- package/es/axis/base.js +23 -11
- package/es/axis/base.js.map +1 -1
- package/es/axis/line.js +1 -1
- package/es/axis/line.js.map +1 -1
- package/es/axis/type.d.ts +6 -3
- package/es/axis/type.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/indicator/indicator.js +50 -6
- package/es/indicator/indicator.js.map +1 -1
- package/es/indicator/type.d.ts +5 -2
- package/es/indicator/type.js.map +1 -1
- package/es/label/arc.d.ts +4 -3
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +11 -11
- package/es/label/base.js +19 -1
- package/es/label/base.js.map +1 -1
- package/es/label/line.js +1 -1
- package/es/label/line.js.map +1 -1
- package/es/label/type.d.ts +8 -4
- package/es/label/type.js.map +1 -1
- package/es/legend/discrete/discrete.js +2 -2
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/marker/point.d.ts +1 -1
- package/es/marker/type.js.map +1 -1
- package/es/tag/tag.js +88 -38
- package/es/tag/tag.js.map +1 -1
- package/es/tag/type.d.ts +4 -3
- package/es/tag/type.js.map +1 -1
- package/es/title/title.js +111 -45
- package/es/title/title.js.map +1 -1
- package/es/title/type.d.ts +10 -5
- package/es/title/type.js.map +1 -1
- package/es/tooltip/tooltip.js +56 -11
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/tooltip/type.d.ts +7 -2
- package/es/tooltip/type.js.map +1 -1
- package/es/tooltip/util.js +9 -1
- package/es/tooltip/util.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -7715,7 +7715,7 @@
|
|
|
7715
7715
|
|
|
7716
7716
|
var tempMatrix = new vutils.Matrix(),
|
|
7717
7717
|
tempBounds$1 = new vutils.AABBBounds();
|
|
7718
|
-
var GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor"
|
|
7718
|
+
var GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "lineCap", "lineJoin", "miterLimit", "scaleX", "scaleY", "angle", "anchor"];
|
|
7719
7719
|
var tempConstantXYKey = ["x", "y"],
|
|
7720
7720
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
7721
7721
|
tempConstantAngleKey = ["angle"],
|
|
@@ -13526,7 +13526,6 @@
|
|
|
13526
13526
|
}, {
|
|
13527
13527
|
key: "updateRectAABBBounds",
|
|
13528
13528
|
value: function updateRectAABBBounds(attribute, rectTheme, aabbBounds, graphic) {
|
|
13529
|
-
if (!this._validCheck(attribute, rectTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13530
13529
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
13531
13530
|
var _attribute$width = attribute.width,
|
|
13532
13531
|
width = _attribute$width === void 0 ? rectTheme.width : _attribute$width,
|
|
@@ -13560,14 +13559,13 @@
|
|
|
13560
13559
|
}, {
|
|
13561
13560
|
key: "updateGlyphAABBBounds",
|
|
13562
13561
|
value: function updateGlyphAABBBounds(attribute, theme, aabbBounds, graphic) {
|
|
13563
|
-
return
|
|
13562
|
+
return graphic.getSubGraphic().forEach(function (node) {
|
|
13564
13563
|
aabbBounds.union(node.AABBBounds);
|
|
13565
|
-
}), aabbBounds
|
|
13564
|
+
}), aabbBounds;
|
|
13566
13565
|
}
|
|
13567
13566
|
}, {
|
|
13568
13567
|
key: "updateRichTextAABBBounds",
|
|
13569
13568
|
value: function updateRichTextAABBBounds(attribute, richtextTheme, aabbBounds, graphic) {
|
|
13570
|
-
if (!this._validCheck(attribute, richtextTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13571
13569
|
if (!graphic) return aabbBounds;
|
|
13572
13570
|
var _attribute$width2 = attribute.width,
|
|
13573
13571
|
width = _attribute$width2 === void 0 ? richtextTheme.width : _attribute$width2,
|
|
@@ -13620,7 +13618,6 @@
|
|
|
13620
13618
|
}, {
|
|
13621
13619
|
key: "updateTextAABBBounds",
|
|
13622
13620
|
value: function updateTextAABBBounds(attribute, textTheme, aabbBounds, graphic) {
|
|
13623
|
-
if (!this._validCheck(attribute, textTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13624
13621
|
if (!graphic) return aabbBounds;
|
|
13625
13622
|
var _graphic$attribute$te = graphic.attribute.text,
|
|
13626
13623
|
text = _graphic$attribute$te === void 0 ? textTheme.text : _graphic$attribute$te;
|
|
@@ -13645,7 +13642,6 @@
|
|
|
13645
13642
|
}, {
|
|
13646
13643
|
key: "updatePathAABBBounds",
|
|
13647
13644
|
value: function updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
|
|
13648
|
-
if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13649
13645
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePathAABBBoundsImprecise(attribute, pathTheme, aabbBounds, graphic);
|
|
13650
13646
|
var tb1 = this.tempAABBBounds1,
|
|
13651
13647
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13697,7 +13693,6 @@
|
|
|
13697
13693
|
}, {
|
|
13698
13694
|
key: "updatePolygonAABBBounds",
|
|
13699
13695
|
value: function updatePolygonAABBBounds(attribute, polygonTheme, aabbBounds, graphic) {
|
|
13700
|
-
if (!this._validCheck(attribute, polygonTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13701
13696
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || this.updatePolygonAABBBoundsImprecise(attribute, polygonTheme, aabbBounds, graphic);
|
|
13702
13697
|
var tb1 = this.tempAABBBounds1,
|
|
13703
13698
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13718,7 +13713,6 @@
|
|
|
13718
13713
|
}, {
|
|
13719
13714
|
key: "updateLineAABBBounds",
|
|
13720
13715
|
value: function updateLineAABBBounds(attribute, lineTheme, aabbBounds, graphic) {
|
|
13721
|
-
if (!this._validCheck(attribute, lineTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13722
13716
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) : this.updateLineAABBBoundsByPoints(attribute, lineTheme, aabbBounds, graphic));
|
|
13723
13717
|
var tb1 = this.tempAABBBounds1,
|
|
13724
13718
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13752,7 +13746,6 @@
|
|
|
13752
13746
|
}, {
|
|
13753
13747
|
key: "updateAreaAABBBounds",
|
|
13754
13748
|
value: function updateAreaAABBBounds(attribute, areaTheme, aabbBounds, graphic) {
|
|
13755
|
-
if (!this._validCheck(attribute, areaTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13756
13749
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (attribute.segments ? this.updateAreaAABBBoundsBySegments(attribute, areaTheme, aabbBounds, graphic) : this.updateAreaAABBBoundsByPoints(attribute, areaTheme, aabbBounds, graphic));
|
|
13757
13750
|
var tb1 = this.tempAABBBounds1,
|
|
13758
13751
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13788,7 +13781,6 @@
|
|
|
13788
13781
|
}, {
|
|
13789
13782
|
key: "updateCircleAABBBounds",
|
|
13790
13783
|
value: function updateCircleAABBBounds(attribute, circleTheme, aabbBounds, full, graphic) {
|
|
13791
|
-
if (!this._validCheck(attribute, circleTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13792
13784
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds, graphic) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds, graphic));
|
|
13793
13785
|
var tb1 = this.tempAABBBounds1,
|
|
13794
13786
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13817,7 +13809,6 @@
|
|
|
13817
13809
|
}, {
|
|
13818
13810
|
key: "updateArcAABBBounds",
|
|
13819
13811
|
value: function updateArcAABBBounds(attribute, arcTheme, aabbBounds, full, graphic) {
|
|
13820
|
-
if (!this._validCheck(attribute, arcTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13821
13812
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateArcAABBBoundsImprecise(attribute, arcTheme, aabbBounds, graphic) : this.updateArcAABBBoundsAccurate(attribute, arcTheme, aabbBounds, graphic));
|
|
13822
13813
|
var tb1 = this.tempAABBBounds1,
|
|
13823
13814
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13859,7 +13850,6 @@
|
|
|
13859
13850
|
}, {
|
|
13860
13851
|
key: "updateSymbolAABBBounds",
|
|
13861
13852
|
value: function updateSymbolAABBBounds(attribute, symbolTheme, aabbBounds, full, graphic) {
|
|
13862
|
-
if (!this._validCheck(attribute, symbolTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13863
13853
|
this.updatePathProxyAABBBounds(aabbBounds, graphic) || (full ? this.updateSymbolAABBBoundsImprecise(attribute, symbolTheme, aabbBounds, graphic) : this.updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds, graphic));
|
|
13864
13854
|
var tb1 = this.tempAABBBounds1,
|
|
13865
13855
|
tb2 = this.tempAABBBounds2;
|
|
@@ -13892,7 +13882,6 @@
|
|
|
13892
13882
|
}, {
|
|
13893
13883
|
key: "updateImageAABBBounds",
|
|
13894
13884
|
value: function updateImageAABBBounds(attribute, imageTheme, aabbBounds, graphic) {
|
|
13895
|
-
if (!this._validCheck(attribute, imageTheme, aabbBounds, graphic)) return aabbBounds;
|
|
13896
13885
|
if (!this.updatePathProxyAABBBounds(aabbBounds, graphic)) {
|
|
13897
13886
|
var _attribute$width3 = attribute.width,
|
|
13898
13887
|
width = _attribute$width3 === void 0 ? imageTheme.width : _attribute$width3,
|
|
@@ -13939,15 +13928,6 @@
|
|
|
13939
13928
|
}
|
|
13940
13929
|
this.combindShadowAABBBounds(aabbBounds, graphic), vutils.transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix);
|
|
13941
13930
|
}
|
|
13942
|
-
}, {
|
|
13943
|
-
key: "_validCheck",
|
|
13944
|
-
value: function _validCheck(attribute, theme, aabbBounds, graphic) {
|
|
13945
|
-
if (!graphic) return !0;
|
|
13946
|
-
if (!graphic.valid) return aabbBounds.clear(), !1;
|
|
13947
|
-
var _attribute$visible = attribute.visible,
|
|
13948
|
-
visible = _attribute$visible === void 0 ? theme.visible : _attribute$visible;
|
|
13949
|
-
return !!visible || (aabbBounds.clear(), !1);
|
|
13950
|
-
}
|
|
13951
13931
|
}]);
|
|
13952
13932
|
return DefaultGraphicService;
|
|
13953
13933
|
}();
|
|
@@ -21006,8 +20986,8 @@
|
|
|
21006
20986
|
this.name = 'tag';
|
|
21007
20987
|
}
|
|
21008
20988
|
render() {
|
|
21009
|
-
var _a;
|
|
21010
|
-
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state } = this.attribute;
|
|
20989
|
+
var _a, _b, _c;
|
|
20990
|
+
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state, type = 'text' } = this.attribute;
|
|
21011
20991
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
21012
20992
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
21013
20993
|
let symbol;
|
|
@@ -21029,75 +21009,100 @@
|
|
|
21029
21009
|
}
|
|
21030
21010
|
tagWidth += symbolPlaceWidth;
|
|
21031
21011
|
textX += symbolPlaceWidth;
|
|
21032
|
-
|
|
21033
|
-
if (
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
const textHeight = textBounds.height;
|
|
21043
|
-
tagWidth += textWidth;
|
|
21044
|
-
const size = (_a = shape.size) !== null && _a !== void 0 ? _a : 10;
|
|
21045
|
-
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
21046
|
-
tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
|
|
21047
|
-
const { textAlign, textBaseline } = textStyle;
|
|
21048
|
-
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
21049
|
-
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
21050
|
-
tagWidth = minWidth;
|
|
21051
|
-
}
|
|
21052
|
-
if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
|
|
21053
|
-
tagWidth = maxWidth;
|
|
21054
|
-
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
21055
|
-
}
|
|
21056
|
-
}
|
|
21057
|
-
let x = 0;
|
|
21058
|
-
let y = 0;
|
|
21059
|
-
if (textAlign === 'center') {
|
|
21060
|
-
x -= tagWidth / 2;
|
|
21061
|
-
if (symbol) {
|
|
21062
|
-
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
21012
|
+
let textShape;
|
|
21013
|
+
if (type === 'rich') {
|
|
21014
|
+
const richTextAttrs = Object.assign(Object.assign({ textConfig: text, visible: vutils.isValid(text) && visible !== false }, textStyle), { x: textX, y: 0, width: (_a = textStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = textStyle.height) !== null && _b !== void 0 ? _b : 0 });
|
|
21015
|
+
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
21016
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
21017
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
21018
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1, y: textShape.AABBBounds.y1, width: textShape.AABBBounds.width(), height: textShape.AABBBounds.height() }), 'rect');
|
|
21019
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
21020
|
+
bgRect.states = state.panel;
|
|
21021
|
+
}
|
|
21063
21022
|
}
|
|
21064
|
-
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
21065
21023
|
}
|
|
21066
|
-
else if (
|
|
21067
|
-
x
|
|
21068
|
-
|
|
21069
|
-
|
|
21024
|
+
else if (type === 'html') {
|
|
21025
|
+
const richTextAttrs = Object.assign(Object.assign({ textConfig: [], visible: vutils.isValid(text) && visible !== false, html: Object.assign({ dom: text, container: '', width: 30, height: 30, style: {} }, textStyle) }, textStyle), { x: textX, y: 0 });
|
|
21026
|
+
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
21027
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
21028
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
21029
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1, y: textShape.AABBBounds.y1, width: textShape.AABBBounds.width(), height: textShape.AABBBounds.height() }), 'rect');
|
|
21030
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
21031
|
+
bgRect.states = state.panel;
|
|
21032
|
+
}
|
|
21070
21033
|
}
|
|
21071
|
-
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
21072
21034
|
}
|
|
21073
|
-
else
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
|
|
21079
|
-
|
|
21035
|
+
else {
|
|
21036
|
+
const textAttrs = Object.assign(Object.assign({ text: text, visible: vutils.isValid(text) && visible !== false, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }, textStyle), { x: textX, y: 0 });
|
|
21037
|
+
if (vutils.isNil(textAttrs.lineHeight)) {
|
|
21038
|
+
textAttrs.lineHeight = textStyle.fontSize;
|
|
21039
|
+
}
|
|
21040
|
+
textShape = group.createOrUpdateChild('tag-text', textAttrs, 'text');
|
|
21041
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.text)) {
|
|
21042
|
+
textShape.states = state.text;
|
|
21043
|
+
}
|
|
21044
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle);
|
|
21045
|
+
const textWidth = textBounds.width;
|
|
21046
|
+
const textHeight = textBounds.height;
|
|
21047
|
+
tagWidth += textWidth;
|
|
21048
|
+
const size = (_c = shape.size) !== null && _c !== void 0 ? _c : 10;
|
|
21049
|
+
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
21050
|
+
tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
|
|
21051
|
+
const { textAlign, textBaseline } = textStyle;
|
|
21052
|
+
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
21053
|
+
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
21054
|
+
tagWidth = minWidth;
|
|
21055
|
+
}
|
|
21056
|
+
if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
|
|
21057
|
+
tagWidth = maxWidth;
|
|
21058
|
+
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
21059
|
+
}
|
|
21080
21060
|
}
|
|
21081
|
-
|
|
21082
|
-
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
symbol
|
|
21061
|
+
let x = 0;
|
|
21062
|
+
let y = 0;
|
|
21063
|
+
if (textAlign === 'center') {
|
|
21064
|
+
x -= tagWidth / 2;
|
|
21065
|
+
if (symbol) {
|
|
21066
|
+
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
21067
|
+
}
|
|
21068
|
+
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
21086
21069
|
}
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21091
|
-
|
|
21092
|
-
|
|
21070
|
+
else if (textAlign === 'right' || textAlign === 'end') {
|
|
21071
|
+
x -= tagWidth;
|
|
21072
|
+
if (symbol) {
|
|
21073
|
+
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
|
|
21074
|
+
}
|
|
21075
|
+
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
21093
21076
|
}
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
y
|
|
21099
|
-
|
|
21100
|
-
|
|
21077
|
+
else if (textAlign === 'left' || textAlign === 'start') {
|
|
21078
|
+
group.setAttribute('x', parsedPadding[3]);
|
|
21079
|
+
}
|
|
21080
|
+
if (textBaseline === 'middle') {
|
|
21081
|
+
y -= tagHeight / 2;
|
|
21082
|
+
if (symbol) {
|
|
21083
|
+
symbol.setAttribute('y', 0);
|
|
21084
|
+
}
|
|
21085
|
+
}
|
|
21086
|
+
else if (textBaseline === 'bottom') {
|
|
21087
|
+
y -= tagHeight;
|
|
21088
|
+
if (symbol) {
|
|
21089
|
+
symbol.setAttribute('y', -textHeight / 2);
|
|
21090
|
+
}
|
|
21091
|
+
group.setAttribute('y', -parsedPadding[2]);
|
|
21092
|
+
}
|
|
21093
|
+
else if (textBaseline === 'top') {
|
|
21094
|
+
group.setAttribute('y', parsedPadding[0]);
|
|
21095
|
+
if (symbol) {
|
|
21096
|
+
symbol.setAttribute('y', textHeight / 2);
|
|
21097
|
+
}
|
|
21098
|
+
}
|
|
21099
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
21100
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
21101
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x,
|
|
21102
|
+
y, width: tagWidth, height: tagHeight }), 'rect');
|
|
21103
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
21104
|
+
bgRect.states = state.panel;
|
|
21105
|
+
}
|
|
21101
21106
|
}
|
|
21102
21107
|
}
|
|
21103
21108
|
}
|
|
@@ -22366,6 +22371,24 @@
|
|
|
22366
22371
|
target.states = state;
|
|
22367
22372
|
}
|
|
22368
22373
|
_createLabelText(attributes) {
|
|
22374
|
+
var _a, _b;
|
|
22375
|
+
if (attributes.textType === 'rich') {
|
|
22376
|
+
attributes.textConfig = attributes.text;
|
|
22377
|
+
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
22378
|
+
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
22379
|
+
const text = createRichText(attributes);
|
|
22380
|
+
this._bindEvent(text);
|
|
22381
|
+
this._setStatesOfText(text);
|
|
22382
|
+
return text;
|
|
22383
|
+
}
|
|
22384
|
+
else if (attributes.textType === 'html') {
|
|
22385
|
+
attributes.textConfig = [];
|
|
22386
|
+
attributes.html = Object.assign({ dom: attributes.text, container: '', width: 30, height: 30, style: {} }, attributes);
|
|
22387
|
+
const text = createRichText(attributes);
|
|
22388
|
+
this._bindEvent(text);
|
|
22389
|
+
this._setStatesOfText(text);
|
|
22390
|
+
return text;
|
|
22391
|
+
}
|
|
22369
22392
|
const text = createText(attributes);
|
|
22370
22393
|
this._bindEvent(text);
|
|
22371
22394
|
this._setStatesOfText(text);
|
|
@@ -22955,7 +22978,7 @@
|
|
|
22955
22978
|
}
|
|
22956
22979
|
getGraphicBounds(graphic, point = {}) {
|
|
22957
22980
|
var _a;
|
|
22958
|
-
if (
|
|
22981
|
+
if (graphic.type !== 'line') {
|
|
22959
22982
|
return super.getGraphicBounds(graphic, point);
|
|
22960
22983
|
}
|
|
22961
22984
|
const { position = 'end' } = this.attribute;
|
|
@@ -24328,12 +24351,26 @@
|
|
|
24328
24351
|
let textAlign = 'center';
|
|
24329
24352
|
let textBaseline = 'middle';
|
|
24330
24353
|
data.forEach((item, index) => {
|
|
24331
|
-
var _a, _b;
|
|
24354
|
+
var _a, _b, _c, _d;
|
|
24332
24355
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
24333
|
-
|
|
24356
|
+
let text;
|
|
24357
|
+
if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'rich') {
|
|
24358
|
+
labelStyle.textConfig = labelStyle.text;
|
|
24359
|
+
labelStyle.width = (_a = labelStyle.width) !== null && _a !== void 0 ? _a : 0;
|
|
24360
|
+
labelStyle.height = (_b = labelStyle.height) !== null && _b !== void 0 ? _b : 0;
|
|
24361
|
+
text = createRichText(labelStyle);
|
|
24362
|
+
}
|
|
24363
|
+
else if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'html') {
|
|
24364
|
+
labelStyle.textConfig = [];
|
|
24365
|
+
labelStyle.html = Object.assign({ dom: labelStyle.text, container: '', width: 30, height: 30, style: {} }, labelStyle);
|
|
24366
|
+
text = createRichText(labelStyle);
|
|
24367
|
+
}
|
|
24368
|
+
else {
|
|
24369
|
+
text = createText(labelStyle);
|
|
24370
|
+
}
|
|
24334
24371
|
text.name = exports.AXIS_ELEMENT_NAME.label;
|
|
24335
24372
|
text.id = this._getNodeId(`layer${layer}-label-${item.id}`);
|
|
24336
|
-
if (vutils.isEmpty((
|
|
24373
|
+
if (vutils.isEmpty((_c = this.attribute.label) === null || _c === void 0 ? void 0 : _c.state)) {
|
|
24337
24374
|
text.states = DEFAULT_STATES$2;
|
|
24338
24375
|
}
|
|
24339
24376
|
else {
|
|
@@ -24346,7 +24383,7 @@
|
|
|
24346
24383
|
text.states = labelState;
|
|
24347
24384
|
}
|
|
24348
24385
|
labelGroup.add(text);
|
|
24349
|
-
const angle = (
|
|
24386
|
+
const angle = (_d = labelStyle.angle) !== null && _d !== void 0 ? _d : 0;
|
|
24350
24387
|
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width());
|
|
24351
24388
|
maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height());
|
|
24352
24389
|
if (angle) {
|
|
@@ -24495,7 +24532,7 @@
|
|
|
24495
24532
|
}
|
|
24496
24533
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
24497
24534
|
var _a, _b, _c, _d, _e, _f;
|
|
24498
|
-
const _g = this.attribute.label, { space = 4, inside = false, formatMethod } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod"]);
|
|
24535
|
+
const _g = this.attribute.label, { space = 4, inside = false, formatMethod, type = 'text', text } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod", "type", "text"]);
|
|
24499
24536
|
let offset = space;
|
|
24500
24537
|
let tickLength = 0;
|
|
24501
24538
|
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && ((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.inside) === inside) {
|
|
@@ -24516,7 +24553,9 @@
|
|
|
24516
24553
|
}
|
|
24517
24554
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside);
|
|
24518
24555
|
const vector = this.getVerticalVector(offset, inside, point);
|
|
24519
|
-
const
|
|
24556
|
+
const textContent = formatMethod
|
|
24557
|
+
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
24558
|
+
: tickDatum.label;
|
|
24520
24559
|
let { style: textStyle } = tagAttributes;
|
|
24521
24560
|
textStyle = vutils.isFunction(textStyle)
|
|
24522
24561
|
? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
|
|
@@ -24531,7 +24570,7 @@
|
|
|
24531
24570
|
layer
|
|
24532
24571
|
});
|
|
24533
24572
|
}
|
|
24534
|
-
return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector,
|
|
24573
|
+
return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, textContent, textStyle)), { text: text !== null && text !== void 0 ? text : textContent, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize, type }), textStyle);
|
|
24535
24574
|
}
|
|
24536
24575
|
getLabelPosition(point, vector, text, style) {
|
|
24537
24576
|
return point;
|
|
@@ -25269,7 +25308,7 @@
|
|
|
25269
25308
|
let titleSpacing = 0;
|
|
25270
25309
|
const axisLineWidth = (line === null || line === void 0 ? void 0 : line.visible) ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
25271
25310
|
const tickLength = (tick === null || tick === void 0 ? void 0 : tick.visible) ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
25272
|
-
if (title === null || title === void 0 ? void 0 : title.visible) {
|
|
25311
|
+
if ((title === null || title === void 0 ? void 0 : title.visible) && typeof title.text === 'string') {
|
|
25273
25312
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
25274
25313
|
const padding = vutils.normalizePadding(title.padding);
|
|
25275
25314
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -28111,7 +28150,7 @@
|
|
|
28111
28150
|
let focusSpace = 0;
|
|
28112
28151
|
if (focus) {
|
|
28113
28152
|
const focusSize = vutils.get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);
|
|
28114
|
-
focusShape = createSymbol(Object.assign(Object.assign({ x: 0, y: -focusSize / 2 - 1, strokeBoundsBuffer: 0 }, focusIconStyle), { visible:
|
|
28153
|
+
focusShape = createSymbol(Object.assign(Object.assign({ x: 0, y: -focusSize / 2 - 1, strokeBoundsBuffer: 0 }, focusIconStyle), { visible: false, pickMode: 'imprecise', boundsPadding: parsedPadding }));
|
|
28115
28154
|
this._appendDataToShape(focusShape, exports.LEGEND_ELEMENT_NAME.focus, item, itemGroup);
|
|
28116
28155
|
focusSpace = focusSize;
|
|
28117
28156
|
}
|
|
@@ -28186,7 +28225,6 @@
|
|
|
28186
28225
|
const itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
28187
28226
|
itemGroup.attribute.width = itemGroupWidth;
|
|
28188
28227
|
itemGroup.attribute.height = itemGroupHeight;
|
|
28189
|
-
focusShape && focusShape.setAttribute('visible', false);
|
|
28190
28228
|
innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]);
|
|
28191
28229
|
return itemGroup;
|
|
28192
28230
|
}
|
|
@@ -29501,19 +29539,27 @@
|
|
|
29501
29539
|
this.name = 'title';
|
|
29502
29540
|
}
|
|
29503
29541
|
render() {
|
|
29504
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
|
|
29505
|
-
const { text, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
29542
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69;
|
|
29543
|
+
const { textType, text, subtextType, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
29506
29544
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
29507
29545
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
29508
29546
|
if (((_a = this.attribute) === null || _a === void 0 ? void 0 : _a.visible) !== false && (textStyle === null || textStyle === void 0 ? void 0 : textStyle.visible) !== false) {
|
|
29509
|
-
if (
|
|
29547
|
+
if (textType === 'rich') {
|
|
29548
|
+
const attr = Object.assign({ x: (_b = textStyle.x) !== null && _b !== void 0 ? _b : 0, y: (_c = textStyle.y) !== null && _c !== void 0 ? _c : 0, width: (_e = (_d = textStyle.width) !== null && _d !== void 0 ? _d : width) !== null && _e !== void 0 ? _e : 0, height: (_g = (_f = textStyle.height) !== null && _f !== void 0 ? _f : height) !== null && _g !== void 0 ? _g : 0, ellipsis: (_h = textStyle.ellipsis) !== null && _h !== void 0 ? _h : true, wordBreak: (_j = textStyle.wordBreak) !== null && _j !== void 0 ? _j : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: text }, textStyle);
|
|
29549
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29550
|
+
}
|
|
29551
|
+
else if (textType === 'html') {
|
|
29552
|
+
const attr = Object.assign({ html: Object.assign({ dom: text, container: '', width: 30, height: 30, style: '' }, textStyle), x: (_k = textStyle.x) !== null && _k !== void 0 ? _k : 0, y: (_l = textStyle.y) !== null && _l !== void 0 ? _l : 0, width: (_o = (_m = textStyle.width) !== null && _m !== void 0 ? _m : width) !== null && _o !== void 0 ? _o : 0, height: (_q = (_p = textStyle.height) !== null && _p !== void 0 ? _p : height) !== null && _q !== void 0 ? _q : 0, ellipsis: (_r = textStyle.ellipsis) !== null && _r !== void 0 ? _r : true, wordBreak: (_s = textStyle.wordBreak) !== null && _s !== void 0 ? _s : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: [] }, textStyle);
|
|
29553
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29554
|
+
}
|
|
29555
|
+
else if (textStyle && vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.character)) {
|
|
29510
29556
|
const attr = {
|
|
29511
|
-
x: (
|
|
29512
|
-
y: (
|
|
29513
|
-
width: (
|
|
29514
|
-
height: (
|
|
29515
|
-
ellipsis: (
|
|
29516
|
-
wordBreak: (
|
|
29557
|
+
x: (_t = textStyle.x) !== null && _t !== void 0 ? _t : 0,
|
|
29558
|
+
y: (_u = textStyle.y) !== null && _u !== void 0 ? _u : 0,
|
|
29559
|
+
width: (_w = (_v = textStyle.width) !== null && _v !== void 0 ? _v : width) !== null && _w !== void 0 ? _w : 0,
|
|
29560
|
+
height: (_y = (_x = textStyle.height) !== null && _x !== void 0 ? _x : height) !== null && _y !== void 0 ? _y : 0,
|
|
29561
|
+
ellipsis: (_z = textStyle.ellipsis) !== null && _z !== void 0 ? _z : true,
|
|
29562
|
+
wordBreak: (_0 = textStyle.wordBreak) !== null && _0 !== void 0 ? _0 : 'break-word',
|
|
29517
29563
|
maxHeight: textStyle.maxHeight,
|
|
29518
29564
|
maxWidth: textStyle.maxWidth,
|
|
29519
29565
|
textConfig: textStyle.character
|
|
@@ -29521,20 +29567,28 @@
|
|
|
29521
29567
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29522
29568
|
}
|
|
29523
29569
|
else if (vutils.isValid(text)) {
|
|
29524
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (
|
|
29570
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (_1 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.maxLineWidth) !== null && _1 !== void 0 ? _1 : width, heightLimit: textStyle === null || textStyle === void 0 ? void 0 : textStyle.heightLimit, lineClamp: textStyle === null || textStyle === void 0 ? void 0 : textStyle.lineClamp, ellipsis: (_2 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.ellipsis) !== null && _2 !== void 0 ? _2 : true, x: 0, y: 0 }), 'wrapText');
|
|
29525
29571
|
}
|
|
29526
29572
|
}
|
|
29527
|
-
const maintextHeight = this._mainTitle ? (
|
|
29528
|
-
const maintextWidth = this._mainTitle ? (
|
|
29529
|
-
if (((
|
|
29530
|
-
if (
|
|
29573
|
+
const maintextHeight = this._mainTitle ? (_3 = this._mainTitle) === null || _3 === void 0 ? void 0 : _3.AABBBounds.height() : 0;
|
|
29574
|
+
const maintextWidth = this._mainTitle ? (_4 = this._mainTitle) === null || _4 === void 0 ? void 0 : _4.AABBBounds.width() : 0;
|
|
29575
|
+
if (((_5 = this.attribute) === null || _5 === void 0 ? void 0 : _5.visible) !== false && (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.visible) !== false) {
|
|
29576
|
+
if (subtextType === 'rich') {
|
|
29577
|
+
const attr = Object.assign({ x: (_6 = subtextStyle.x) !== null && _6 !== void 0 ? _6 : 0, y: (_7 = subtextStyle.y) !== null && _7 !== void 0 ? _7 : 0, width: (_9 = (_8 = subtextStyle.width) !== null && _8 !== void 0 ? _8 : width) !== null && _9 !== void 0 ? _9 : 0, height: (_11 = (_10 = subtextStyle.height) !== null && _10 !== void 0 ? _10 : height) !== null && _11 !== void 0 ? _11 : 0, ellipsis: (_12 = subtextStyle.ellipsis) !== null && _12 !== void 0 ? _12 : true, wordBreak: (_13 = subtextStyle.wordBreak) !== null && _13 !== void 0 ? _13 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: subtext }, subtextStyle);
|
|
29578
|
+
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29579
|
+
}
|
|
29580
|
+
else if (textType === 'html') {
|
|
29581
|
+
const attr = Object.assign({ html: Object.assign({ dom: subtext, container: '', width: 30, height: 30, style: {} }, subtextStyle), x: (_14 = subtextStyle.x) !== null && _14 !== void 0 ? _14 : 0, y: (_15 = subtextStyle.y) !== null && _15 !== void 0 ? _15 : 0, width: (_17 = (_16 = subtextStyle.width) !== null && _16 !== void 0 ? _16 : width) !== null && _17 !== void 0 ? _17 : 0, height: (_19 = (_18 = subtextStyle.height) !== null && _18 !== void 0 ? _18 : height) !== null && _19 !== void 0 ? _19 : 0, ellipsis: (_20 = subtextStyle.ellipsis) !== null && _20 !== void 0 ? _20 : true, wordBreak: (_21 = subtextStyle.wordBreak) !== null && _21 !== void 0 ? _21 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: [] }, subtextStyle);
|
|
29582
|
+
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29583
|
+
}
|
|
29584
|
+
else if (subtextStyle && vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.character)) {
|
|
29531
29585
|
const attr = {
|
|
29532
|
-
x: (
|
|
29533
|
-
y: (
|
|
29534
|
-
width: (
|
|
29535
|
-
height: (
|
|
29536
|
-
ellipsis: (
|
|
29537
|
-
wordBreak: (
|
|
29586
|
+
x: (_22 = subtextStyle.x) !== null && _22 !== void 0 ? _22 : 0,
|
|
29587
|
+
y: (_23 = subtextStyle.y) !== null && _23 !== void 0 ? _23 : maintextHeight,
|
|
29588
|
+
width: (_25 = (_24 = subtextStyle.width) !== null && _24 !== void 0 ? _24 : width) !== null && _25 !== void 0 ? _25 : 0,
|
|
29589
|
+
height: (_27 = (_26 = subtextStyle.height) !== null && _26 !== void 0 ? _26 : height) !== null && _27 !== void 0 ? _27 : 0,
|
|
29590
|
+
ellipsis: (_28 = subtextStyle.ellipsis) !== null && _28 !== void 0 ? _28 : true,
|
|
29591
|
+
wordBreak: (_29 = subtextStyle.wordBreak) !== null && _29 !== void 0 ? _29 : 'break-word',
|
|
29538
29592
|
maxHeight: subtextStyle.maxHeight,
|
|
29539
29593
|
maxWidth: subtextStyle.maxWidth,
|
|
29540
29594
|
textConfig: subtextStyle.character
|
|
@@ -29542,17 +29596,17 @@
|
|
|
29542
29596
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29543
29597
|
}
|
|
29544
29598
|
else if (vutils.isValid(subtext)) {
|
|
29545
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (
|
|
29599
|
+
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (_30 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.maxLineWidth) !== null && _30 !== void 0 ? _30 : width, heightLimit: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.heightLimit, lineClamp: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.lineClamp, ellipsis: (_31 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.ellipsis) !== null && _31 !== void 0 ? _31 : true, x: 0, y: maintextHeight }), 'wrapText');
|
|
29546
29600
|
}
|
|
29547
29601
|
}
|
|
29548
|
-
const subtextHeight = this._subTitle ? (
|
|
29549
|
-
const subtextWidth = this._subTitle ? (
|
|
29602
|
+
const subtextHeight = this._subTitle ? (_32 = this._subTitle) === null || _32 === void 0 ? void 0 : _32.AABBBounds.height() : 0;
|
|
29603
|
+
const subtextWidth = this._subTitle ? (_33 = this._subTitle) === null || _33 === void 0 ? void 0 : _33.AABBBounds.width() : 0;
|
|
29550
29604
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
29551
|
-
let titleHeight = maintextHeight + ((
|
|
29605
|
+
let titleHeight = maintextHeight + ((_34 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _34 !== void 0 ? _34 : subtextHeight);
|
|
29552
29606
|
if (vutils.isValid(width)) {
|
|
29553
29607
|
titleWidth = width;
|
|
29554
|
-
(
|
|
29555
|
-
(
|
|
29608
|
+
(_35 = this._mainTitle) === null || _35 === void 0 ? void 0 : _35.setAttribute('maxLineWidth', width);
|
|
29609
|
+
(_36 = this._subTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('maxLineWidth', width);
|
|
29556
29610
|
}
|
|
29557
29611
|
if (vutils.isValid(height)) {
|
|
29558
29612
|
titleHeight = height;
|
|
@@ -29561,10 +29615,10 @@
|
|
|
29561
29615
|
titleWidth = minWidth;
|
|
29562
29616
|
}
|
|
29563
29617
|
if (vutils.isValid(maxWidth)) {
|
|
29564
|
-
(
|
|
29565
|
-
(
|
|
29566
|
-
(
|
|
29567
|
-
(
|
|
29618
|
+
(_37 = this._mainTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('maxLineWidth', maxWidth);
|
|
29619
|
+
(_38 = this._subTitle) === null || _38 === void 0 ? void 0 : _38.setAttribute('maxLineWidth', maxWidth);
|
|
29620
|
+
(_39 = this._mainTitle) === null || _39 === void 0 ? void 0 : _39.setAttribute('maxWidth', maxWidth);
|
|
29621
|
+
(_40 = this._subTitle) === null || _40 === void 0 ? void 0 : _40.setAttribute('maxWidth', maxWidth);
|
|
29568
29622
|
if (titleWidth > maxWidth) {
|
|
29569
29623
|
titleWidth = maxWidth;
|
|
29570
29624
|
}
|
|
@@ -29573,8 +29627,8 @@
|
|
|
29573
29627
|
titleHeight = minHeight;
|
|
29574
29628
|
}
|
|
29575
29629
|
if (vutils.isValid(maxHeight)) {
|
|
29576
|
-
(
|
|
29577
|
-
(
|
|
29630
|
+
(_41 = this._mainTitle) === null || _41 === void 0 ? void 0 : _41.setAttribute('maxHeight', maxHeight);
|
|
29631
|
+
(_42 = this._subTitle) === null || _42 === void 0 ? void 0 : _42.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
29578
29632
|
if (titleHeight > maxHeight) {
|
|
29579
29633
|
titleHeight = maxHeight;
|
|
29580
29634
|
}
|
|
@@ -29584,67 +29638,67 @@
|
|
|
29584
29638
|
group.attribute.boundsPadding = parsedPadding;
|
|
29585
29639
|
if (vutils.isValid(align) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.align)) {
|
|
29586
29640
|
const mainTitleAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.align) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.align : align;
|
|
29587
|
-
const mainTitleWidth = (
|
|
29641
|
+
const mainTitleWidth = (_43 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _43 !== void 0 ? _43 : maintextWidth;
|
|
29588
29642
|
if (mainTitleAlign === 'left') {
|
|
29589
|
-
(
|
|
29590
|
-
(
|
|
29643
|
+
(_44 = this._mainTitle) === null || _44 === void 0 ? void 0 : _44.setAttribute('x', 0);
|
|
29644
|
+
(_45 = this._mainTitle) === null || _45 === void 0 ? void 0 : _45.setAttribute('textAlign', 'left');
|
|
29591
29645
|
}
|
|
29592
29646
|
else if (mainTitleAlign === 'center') {
|
|
29593
|
-
(
|
|
29594
|
-
(
|
|
29647
|
+
(_46 = this._mainTitle) === null || _46 === void 0 ? void 0 : _46.setAttribute('x', mainTitleWidth / 2);
|
|
29648
|
+
(_47 = this._mainTitle) === null || _47 === void 0 ? void 0 : _47.setAttribute('textAlign', 'center');
|
|
29595
29649
|
}
|
|
29596
29650
|
else if (mainTitleAlign === 'right') {
|
|
29597
|
-
(
|
|
29598
|
-
(
|
|
29651
|
+
(_48 = this._mainTitle) === null || _48 === void 0 ? void 0 : _48.setAttribute('x', mainTitleWidth);
|
|
29652
|
+
(_49 = this._mainTitle) === null || _49 === void 0 ? void 0 : _49.setAttribute('textAlign', 'right');
|
|
29599
29653
|
}
|
|
29600
29654
|
}
|
|
29601
29655
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29602
29656
|
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
29603
29657
|
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
29604
29658
|
if (mainTitleVerticalAlign === 'top') {
|
|
29605
|
-
(
|
|
29606
|
-
(
|
|
29659
|
+
(_50 = this._mainTitle) === null || _50 === void 0 ? void 0 : _50.setAttribute('y', 0);
|
|
29660
|
+
(_51 = this._mainTitle) === null || _51 === void 0 ? void 0 : _51.setAttribute('textBaseline', 'top');
|
|
29607
29661
|
}
|
|
29608
29662
|
else if (mainTitleVerticalAlign === 'middle') {
|
|
29609
|
-
(
|
|
29610
|
-
(
|
|
29663
|
+
(_52 = this._mainTitle) === null || _52 === void 0 ? void 0 : _52.setAttribute('y', mainTitleHeight / 2);
|
|
29664
|
+
(_53 = this._mainTitle) === null || _53 === void 0 ? void 0 : _53.setAttribute('textBaseline', 'middle');
|
|
29611
29665
|
}
|
|
29612
29666
|
else if (mainTitleVerticalAlign === 'bottom') {
|
|
29613
|
-
(
|
|
29614
|
-
(
|
|
29667
|
+
(_54 = this._mainTitle) === null || _54 === void 0 ? void 0 : _54.setAttribute('y', mainTitleHeight);
|
|
29668
|
+
(_55 = this._mainTitle) === null || _55 === void 0 ? void 0 : _55.setAttribute('textBaseline', 'bottom');
|
|
29615
29669
|
}
|
|
29616
29670
|
}
|
|
29617
29671
|
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
29618
29672
|
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
29619
|
-
const subTitleWidth = (
|
|
29673
|
+
const subTitleWidth = (_56 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _56 !== void 0 ? _56 : subtextWidth;
|
|
29620
29674
|
if (subTitleAlign === 'left') {
|
|
29621
|
-
(
|
|
29622
|
-
(
|
|
29675
|
+
(_57 = this._subTitle) === null || _57 === void 0 ? void 0 : _57.setAttribute('x', 0);
|
|
29676
|
+
(_58 = this._subTitle) === null || _58 === void 0 ? void 0 : _58.setAttribute('textAlign', 'left');
|
|
29623
29677
|
}
|
|
29624
29678
|
else if (subTitleAlign === 'center') {
|
|
29625
|
-
(
|
|
29626
|
-
(
|
|
29679
|
+
(_59 = this._subTitle) === null || _59 === void 0 ? void 0 : _59.setAttribute('x', subTitleWidth / 2);
|
|
29680
|
+
(_60 = this._subTitle) === null || _60 === void 0 ? void 0 : _60.setAttribute('textAlign', 'center');
|
|
29627
29681
|
}
|
|
29628
29682
|
else if (subTitleAlign === 'right') {
|
|
29629
|
-
(
|
|
29630
|
-
(
|
|
29683
|
+
(_61 = this._subTitle) === null || _61 === void 0 ? void 0 : _61.setAttribute('x', subTitleWidth);
|
|
29684
|
+
(_62 = this._subTitle) === null || _62 === void 0 ? void 0 : _62.setAttribute('textAlign', 'right');
|
|
29631
29685
|
}
|
|
29632
29686
|
}
|
|
29633
29687
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29634
29688
|
const subTitleVerticalAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign : verticalAlign;
|
|
29635
29689
|
const subTitleYStart = maintextHeight;
|
|
29636
|
-
const subTitleHeight = (
|
|
29690
|
+
const subTitleHeight = (_63 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _63 !== void 0 ? _63 : 0;
|
|
29637
29691
|
if (subTitleVerticalAlign === 'top') {
|
|
29638
|
-
(
|
|
29639
|
-
(
|
|
29692
|
+
(_64 = this._subTitle) === null || _64 === void 0 ? void 0 : _64.setAttribute('y', subTitleYStart);
|
|
29693
|
+
(_65 = this._subTitle) === null || _65 === void 0 ? void 0 : _65.setAttribute('textBaseline', 'top');
|
|
29640
29694
|
}
|
|
29641
29695
|
else if (subTitleVerticalAlign === 'middle') {
|
|
29642
|
-
(
|
|
29643
|
-
(
|
|
29696
|
+
(_66 = this._subTitle) === null || _66 === void 0 ? void 0 : _66.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
29697
|
+
(_67 = this._subTitle) === null || _67 === void 0 ? void 0 : _67.setAttribute('textBaseline', 'middle');
|
|
29644
29698
|
}
|
|
29645
29699
|
else if (subTitleVerticalAlign === 'bottom') {
|
|
29646
|
-
(
|
|
29647
|
-
(
|
|
29700
|
+
(_68 = this._subTitle) === null || _68 === void 0 ? void 0 : _68.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
29701
|
+
(_69 = this._subTitle) === null || _69 === void 0 ? void 0 : _69.setAttribute('textBaseline', 'bottom');
|
|
29648
29702
|
}
|
|
29649
29703
|
}
|
|
29650
29704
|
}
|
|
@@ -29699,7 +29753,7 @@
|
|
|
29699
29753
|
this.name = 'indicator';
|
|
29700
29754
|
}
|
|
29701
29755
|
render() {
|
|
29702
|
-
var _a;
|
|
29756
|
+
var _a, _b, _c;
|
|
29703
29757
|
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
29704
29758
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
29705
29759
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
@@ -29710,7 +29764,15 @@
|
|
|
29710
29764
|
if (vutils.isValid(title)) {
|
|
29711
29765
|
if (title.visible !== false) {
|
|
29712
29766
|
const titleStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
|
|
29713
|
-
|
|
29767
|
+
if (titleStyle.type === 'rich') {
|
|
29768
|
+
this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({ textConfig: titleStyle.text }, titleStyle), { visible: title.visible, x: 0, y: 0, width: (_a = titleStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = titleStyle.height) !== null && _b !== void 0 ? _b : 0 }), 'richtext');
|
|
29769
|
+
}
|
|
29770
|
+
else if (titleStyle.type === 'html') {
|
|
29771
|
+
this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({ textConfig: [], html: Object.assign({ dom: titleStyle.text, container: '', width: 30, height: 30, style: {} }, titleStyle) }, titleStyle), { visible: title.visible, x: 0, y: 0 }), 'richtext');
|
|
29772
|
+
}
|
|
29773
|
+
else {
|
|
29774
|
+
this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({}, titleStyle), { lineHeight: vutils.isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize, visible: title.visible, x: 0, y: 0 }), 'text');
|
|
29775
|
+
}
|
|
29714
29776
|
if (title.autoFit && vutils.isValidNumber(limit)) {
|
|
29715
29777
|
this._setAutoFit(limit, this._title, title);
|
|
29716
29778
|
}
|
|
@@ -29731,9 +29793,19 @@
|
|
|
29731
29793
|
const contentComponents = [];
|
|
29732
29794
|
let lastContentHeight = 0;
|
|
29733
29795
|
contents.forEach((contentItem, i) => {
|
|
29796
|
+
var _a, _b;
|
|
29734
29797
|
if (contentItem.visible !== false) {
|
|
29735
29798
|
const contentStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);
|
|
29736
|
-
|
|
29799
|
+
let contentComponent;
|
|
29800
|
+
if (contentStyle.type === 'rich') {
|
|
29801
|
+
contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({ textConfig: contentStyle.text }, contentStyle), { visible: title.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight, width: (_a = contentStyle.width) !== null && _a !== void 0 ? _a : 0, height: (_b = contentStyle.height) !== null && _b !== void 0 ? _b : 0 }), 'richtext');
|
|
29802
|
+
}
|
|
29803
|
+
else if (contentStyle.type === 'html') {
|
|
29804
|
+
contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({ textConfig: [], html: Object.assign({ dom: contentStyle.text, container: '', width: 30, height: 30, style: {} }, contentStyle) }, contentStyle), { visible: title.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight }), 'richtext');
|
|
29805
|
+
}
|
|
29806
|
+
else {
|
|
29807
|
+
contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({}, contentStyle), { lineHeight: vutils.isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize, visible: contentItem.visible, x: 0, y: titleHeight + titleSpace + lastContentHeight }), 'text');
|
|
29808
|
+
}
|
|
29737
29809
|
if (contentItem.autoFit && vutils.isValidNumber(limit)) {
|
|
29738
29810
|
this._setAutoFit(limit, contentComponent, contentItem);
|
|
29739
29811
|
}
|
|
@@ -29751,7 +29823,7 @@
|
|
|
29751
29823
|
});
|
|
29752
29824
|
this._content = contentComponents;
|
|
29753
29825
|
}
|
|
29754
|
-
const totalHeight = (
|
|
29826
|
+
const totalHeight = (_c = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _c !== void 0 ? _c : 0;
|
|
29755
29827
|
group.setAttribute('y', size.height / 2 - totalHeight / 2);
|
|
29756
29828
|
group.setAttribute('x', size.width / 2);
|
|
29757
29829
|
}
|
|
@@ -30996,6 +31068,17 @@
|
|
|
30996
31068
|
};
|
|
30997
31069
|
const getRichTextAttribute = (attr) => {
|
|
30998
31070
|
const { width, height, wordBreak = 'break-word', textAlign, textBaseline, text } = attr;
|
|
31071
|
+
if (typeof text === 'object') {
|
|
31072
|
+
return {
|
|
31073
|
+
width,
|
|
31074
|
+
height,
|
|
31075
|
+
wordBreak: wordBreak,
|
|
31076
|
+
textAlign: textAlign,
|
|
31077
|
+
textBaseline: textBaseline,
|
|
31078
|
+
singleLine: false,
|
|
31079
|
+
textConfig: text.text
|
|
31080
|
+
};
|
|
31081
|
+
}
|
|
30999
31082
|
return {
|
|
31000
31083
|
width,
|
|
31001
31084
|
height,
|
|
@@ -31092,6 +31175,7 @@
|
|
|
31092
31175
|
this.name = 'tooltip';
|
|
31093
31176
|
}
|
|
31094
31177
|
render() {
|
|
31178
|
+
var _a;
|
|
31095
31179
|
const { visible, content, panel, keyWidth, valueWidth, hasContentShape, autoCalculatePosition, autoMeasure } = this.attribute;
|
|
31096
31180
|
if (!visible) {
|
|
31097
31181
|
this.hideAll();
|
|
@@ -31110,11 +31194,22 @@
|
|
|
31110
31194
|
this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, vutils.merge({ symbolType: 'circle' }, titleAttr.shape, {
|
|
31111
31195
|
visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
|
|
31112
31196
|
}), 'symbol');
|
|
31113
|
-
if (titleAttr.value.
|
|
31197
|
+
if (typeof titleAttr.value.text === 'object' &&
|
|
31198
|
+
titleAttr.value.text !== null &&
|
|
31199
|
+
(titleAttr.value.text.type === 'rich' ||
|
|
31200
|
+
titleAttr.value.text.type === 'html')) {
|
|
31201
|
+
if (titleAttr.value.text.type === 'rich') {
|
|
31202
|
+
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, getRichTextAttribute(titleAttr.value)), 'richtext');
|
|
31203
|
+
}
|
|
31204
|
+
else if (titleAttr.value.text.type === 'html') {
|
|
31205
|
+
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ html: Object.assign({ dom: titleAttr.value.text.text, container: '', width: 30, height: 30, style: {} }, titleAttr.value), visible: isVisible(titleAttr) && isVisible(titleAttr.value), width: titleAttr.value.width, height: titleAttr.value.height, wordBreak: titleAttr.value.wordBreak, textAlign: titleAttr.value.textAlign, textBaseline: titleAttr.value.textBaseline, singleLine: false, textConfig: [] }, titleAttr.value), 'richtext');
|
|
31206
|
+
}
|
|
31207
|
+
}
|
|
31208
|
+
else if (titleAttr.value.multiLine) {
|
|
31114
31209
|
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, getRichTextAttribute(titleAttr.value)), 'richtext');
|
|
31115
31210
|
}
|
|
31116
31211
|
else {
|
|
31117
|
-
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ text: '', visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, titleAttr.value), 'text');
|
|
31212
|
+
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ text: ((_a = titleAttr.value.text) !== null && _a !== void 0 ? _a : ''), visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, titleAttr.value), 'text');
|
|
31118
31213
|
}
|
|
31119
31214
|
const titlePaddingLeft = isVisible(titleAttr.shape) ? titleAttr.shape.size + titleAttr.shape.spacing : 0;
|
|
31120
31215
|
const { textAlign, textBaseline } = titleAttr.value;
|
|
@@ -31145,7 +31240,7 @@
|
|
|
31145
31240
|
this._tooltipContent.setAttribute('y', padding[0] + titleHeight);
|
|
31146
31241
|
let lastYPos = 0;
|
|
31147
31242
|
content.forEach((item, i) => {
|
|
31148
|
-
var _a;
|
|
31243
|
+
var _a, _b, _c;
|
|
31149
31244
|
const itemAttr = Tooltip.getContentAttr(this.attribute, i);
|
|
31150
31245
|
if (!isVisible(itemAttr)) {
|
|
31151
31246
|
return;
|
|
@@ -31167,8 +31262,21 @@
|
|
|
31167
31262
|
if (itemAttr.key.multiLine) {
|
|
31168
31263
|
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_KEY_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, getRichTextAttribute(itemAttr.key)), { textBaseline: 'top' }), 'richtext');
|
|
31169
31264
|
}
|
|
31265
|
+
else if (typeof itemAttr.key.text === 'object' &&
|
|
31266
|
+
itemAttr.key.text !== null &&
|
|
31267
|
+
(itemAttr.key.text.type === 'rich' ||
|
|
31268
|
+
itemAttr.key.text.type === 'html')) {
|
|
31269
|
+
if (itemAttr.key.text.type === 'rich') {
|
|
31270
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, getRichTextAttribute(itemAttr.key)), { textBaseline: 'top' }), 'richtext');
|
|
31271
|
+
}
|
|
31272
|
+
else {
|
|
31273
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, {
|
|
31274
|
+
html: Object.assign({ dom: itemAttr.key.text.text, container: '', width: 30, height: 30, style: {} }, itemAttr.key)
|
|
31275
|
+
}, 'richtext');
|
|
31276
|
+
}
|
|
31277
|
+
}
|
|
31170
31278
|
else {
|
|
31171
|
-
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_KEY_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, itemAttr.key), { textBaseline: 'top' }), 'text');
|
|
31279
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_KEY_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true, text: ((_b = itemAttr.key.text) !== null && _b !== void 0 ? _b : '') }, itemAttr.key), { textBaseline: 'top' }), 'text');
|
|
31172
31280
|
}
|
|
31173
31281
|
const { textAlign } = itemAttr.key;
|
|
31174
31282
|
if (textAlign === 'center') {
|
|
@@ -31188,8 +31296,21 @@
|
|
|
31188
31296
|
if (itemAttr.value.multiLine) {
|
|
31189
31297
|
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, getRichTextAttribute(itemAttr.value)), { textBaseline: 'top' }), 'richtext');
|
|
31190
31298
|
}
|
|
31299
|
+
else if (typeof itemAttr.value.text === 'object' &&
|
|
31300
|
+
itemAttr.value.text !== null &&
|
|
31301
|
+
(itemAttr.value.text.type === 'rich' ||
|
|
31302
|
+
itemAttr.value.text.type === 'html')) {
|
|
31303
|
+
if (itemAttr.value.text.type === 'rich') {
|
|
31304
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, getRichTextAttribute(itemAttr.value)), { textBaseline: 'top' }), 'richtext');
|
|
31305
|
+
}
|
|
31306
|
+
else {
|
|
31307
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, {
|
|
31308
|
+
html: Object.assign({ dom: itemAttr.value.text.text, container: '', width: 30, height: 30, style: {} }, itemAttr.value)
|
|
31309
|
+
}, 'richtext');
|
|
31310
|
+
}
|
|
31311
|
+
}
|
|
31191
31312
|
else {
|
|
31192
|
-
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true }, itemAttr.value), { textBaseline: 'top' }), 'text');
|
|
31313
|
+
element = itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign(Object.assign({ visible: true, text: ((_c = itemAttr.value.text) !== null && _c !== void 0 ? _c : '') }, itemAttr.value), { textBaseline: 'top' }), 'text');
|
|
31193
31314
|
}
|
|
31194
31315
|
let textAlign = 'right';
|
|
31195
31316
|
if (vutils.isValid(itemAttr.value.textAlign)) {
|
|
@@ -31281,7 +31402,7 @@
|
|
|
31281
31402
|
let titleMaxHeight = 0;
|
|
31282
31403
|
const { value: titleValue, shape: titleShape } = titleAttr;
|
|
31283
31404
|
const { visible: titleHasShape = false, symbolType: titleShapeType = '' } = titleShape !== null && titleShape !== void 0 ? titleShape : {};
|
|
31284
|
-
if (vutils.isValid(titleValue)) {
|
|
31405
|
+
if (vutils.isValid(titleValue) && typeof titleAttr.value.text !== 'object') {
|
|
31285
31406
|
const { width, height } = initTextMeasure(titleValue).quickMeasure(titleValue.text);
|
|
31286
31407
|
maxWidth = width;
|
|
31287
31408
|
titleMaxHeight = height;
|
|
@@ -31538,7 +31659,7 @@
|
|
|
31538
31659
|
}
|
|
31539
31660
|
};
|
|
31540
31661
|
|
|
31541
|
-
const version = "0.16.17-alpha.
|
|
31662
|
+
const version = "0.16.17-alpha.3";
|
|
31542
31663
|
|
|
31543
31664
|
exports.AbstractComponent = AbstractComponent;
|
|
31544
31665
|
exports.ArcInfo = ArcInfo;
|