@visactor/vrender-components 0.16.14-alpha.4 → 0.16.14-alpha.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.js +11 -22
- 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 +3 -6
- 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 +6 -50
- package/cjs/indicator/indicator.js.map +1 -1
- package/cjs/indicator/type.d.ts +2 -5
- package/cjs/indicator/type.js.map +1 -1
- package/cjs/label/arc.d.ts +3 -4
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.d.ts +11 -11
- package/cjs/label/base.js +5 -23
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.d.ts +4 -8
- package/cjs/label/type.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 +40 -90
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/tag/type.d.ts +3 -4
- package/cjs/tag/type.js.map +1 -1
- package/cjs/title/title.js +47 -111
- package/cjs/title/title.js.map +1 -1
- package/cjs/title/type.d.ts +5 -10
- package/cjs/title/type.js.map +1 -1
- package/cjs/tooltip/tooltip.js +2 -27
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/cjs/tooltip/type.d.ts +1 -3
- package/cjs/tooltip/type.js.map +1 -1
- package/dist/index.js +292 -267
- package/dist/index.min.js +1 -1
- package/es/axis/base.js +11 -23
- 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 +3 -6
- 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 +6 -50
- package/es/indicator/indicator.js.map +1 -1
- package/es/indicator/type.d.ts +2 -5
- package/es/indicator/type.js.map +1 -1
- package/es/label/arc.d.ts +3 -4
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +11 -11
- package/es/label/base.js +5 -23
- package/es/label/base.js.map +1 -1
- package/es/label/type.d.ts +4 -8
- package/es/label/type.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 +38 -88
- package/es/tag/tag.js.map +1 -1
- package/es/tag/type.d.ts +3 -4
- package/es/tag/type.js.map +1 -1
- package/es/title/title.js +45 -111
- package/es/title/title.js.map +1 -1
- package/es/title/type.d.ts +5 -10
- package/es/title/type.js.map +1 -1
- package/es/tooltip/tooltip.js +3 -28
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/tooltip/type.d.ts +1 -3
- package/es/tooltip/type.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -4470,7 +4470,10 @@
|
|
|
4470
4470
|
direction: "horizontal",
|
|
4471
4471
|
wordBreak: "break-all",
|
|
4472
4472
|
ignoreBuf: !1,
|
|
4473
|
-
verticalMode: 0
|
|
4473
|
+
verticalMode: 0,
|
|
4474
|
+
whiteSpace: "no-wrap",
|
|
4475
|
+
heightLimit: 1 / 0,
|
|
4476
|
+
lineClamp: 1 / 0
|
|
4474
4477
|
};
|
|
4475
4478
|
var DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
4476
4479
|
opacity: 1,
|
|
@@ -7460,6 +7463,12 @@
|
|
|
7460
7463
|
}();
|
|
7461
7464
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7462
7465
|
new RafBasedSTO();
|
|
7466
|
+
var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
|
|
7467
|
+
if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
7468
|
+
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
7469
|
+
}
|
|
7470
|
+
return lineHeight;
|
|
7471
|
+
};
|
|
7463
7472
|
|
|
7464
7473
|
var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
|
|
7465
7474
|
_inherits(IncreaseCount, _ACustomAnimate);
|
|
@@ -9963,7 +9972,7 @@
|
|
|
9963
9972
|
return CanvasTextLayout;
|
|
9964
9973
|
}();
|
|
9965
9974
|
|
|
9966
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
9975
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
9967
9976
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
9968
9977
|
_inherits(Text, _Graphic);
|
|
9969
9978
|
var _super = _createSuper(Text);
|
|
@@ -10037,6 +10046,117 @@
|
|
|
10037
10046
|
paddingArray = parsePadding(boundsPadding);
|
|
10038
10047
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
10039
10048
|
}
|
|
10049
|
+
}, {
|
|
10050
|
+
key: "updateWrapAABBBounds",
|
|
10051
|
+
value: function updateWrapAABBBounds(text) {
|
|
10052
|
+
var _a, _b, _c, _d;
|
|
10053
|
+
var textTheme = getTheme(this).text,
|
|
10054
|
+
_this$attribute = this.attribute,
|
|
10055
|
+
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
10056
|
+
fontFamily = _this$attribute$fontF === void 0 ? textTheme.fontFamily : _this$attribute$fontF,
|
|
10057
|
+
_this$attribute$textA = _this$attribute.textAlign,
|
|
10058
|
+
textAlign = _this$attribute$textA === void 0 ? textTheme.textAlign : _this$attribute$textA,
|
|
10059
|
+
_this$attribute$textB = _this$attribute.textBaseline,
|
|
10060
|
+
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10061
|
+
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10062
|
+
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10063
|
+
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10064
|
+
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10065
|
+
maxLineWidth = _this$attribute.maxLineWidth,
|
|
10066
|
+
_this$attribute$strok = _this$attribute.stroke,
|
|
10067
|
+
stroke = _this$attribute$strok === void 0 ? textTheme.stroke : _this$attribute$strok,
|
|
10068
|
+
_this$attribute$lineW = _this$attribute.lineWidth,
|
|
10069
|
+
lineWidth = _this$attribute$lineW === void 0 ? textTheme.lineWidth : _this$attribute$lineW,
|
|
10070
|
+
_this$attribute$wordB = _this$attribute.wordBreak,
|
|
10071
|
+
wordBreak = _this$attribute$wordB === void 0 ? textTheme.wordBreak : _this$attribute$wordB,
|
|
10072
|
+
_this$attribute$fontW = _this$attribute.fontWeight,
|
|
10073
|
+
fontWeight = _this$attribute$fontW === void 0 ? textTheme.fontWeight : _this$attribute$fontW,
|
|
10074
|
+
_this$attribute$ignor = _this$attribute.ignoreBuf,
|
|
10075
|
+
ignoreBuf = _this$attribute$ignor === void 0 ? textTheme.ignoreBuf : _this$attribute$ignor,
|
|
10076
|
+
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10077
|
+
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10078
|
+
lineClamp = _this$attribute.lineClamp,
|
|
10079
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10080
|
+
buf = ignoreBuf ? 0 : 2;
|
|
10081
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10082
|
+
var _bbox = this.cache.layoutData.bbox;
|
|
10083
|
+
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10084
|
+
}
|
|
10085
|
+
var textMeasure = application.graphicUtil.textMeasure,
|
|
10086
|
+
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
10087
|
+
fontSize: fontSize,
|
|
10088
|
+
fontWeight: fontWeight,
|
|
10089
|
+
fontFamily: fontFamily
|
|
10090
|
+
}, textMeasure),
|
|
10091
|
+
lines = vutils.isArray(text) ? text.map(function (l) {
|
|
10092
|
+
return l.toString();
|
|
10093
|
+
}) : [text.toString()],
|
|
10094
|
+
linesLayout = [],
|
|
10095
|
+
bboxWH = [0, 0];
|
|
10096
|
+
var lineCountLimit = 1 / 0;
|
|
10097
|
+
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
10098
|
+
if (maxLineWidth > 0) for (var i = 0; i < lines.length; i++) {
|
|
10099
|
+
var str = lines[i];
|
|
10100
|
+
var needCut = !0;
|
|
10101
|
+
if (i === lineCountLimit - 1) {
|
|
10102
|
+
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10103
|
+
linesLayout.push({
|
|
10104
|
+
str: _clip.str,
|
|
10105
|
+
width: _clip.width
|
|
10106
|
+
});
|
|
10107
|
+
break;
|
|
10108
|
+
}
|
|
10109
|
+
var clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
10110
|
+
if ("" !== str && "" === clip.str) {
|
|
10111
|
+
if (ellipsis) {
|
|
10112
|
+
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10113
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
10114
|
+
} else clip.str = "", clip.width = 0;
|
|
10115
|
+
needCut = !1;
|
|
10116
|
+
}
|
|
10117
|
+
if (linesLayout.push({
|
|
10118
|
+
str: clip.str,
|
|
10119
|
+
width: clip.width
|
|
10120
|
+
}), clip.str.length === str.length) ;else if (needCut) {
|
|
10121
|
+
var newStr = str.substring(clip.str.length);
|
|
10122
|
+
lines.splice(i + 1, 0, newStr);
|
|
10123
|
+
}
|
|
10124
|
+
}
|
|
10125
|
+
var maxWidth = 0;
|
|
10126
|
+
linesLayout.forEach(function (layout) {
|
|
10127
|
+
maxWidth = Math.max(maxWidth, layout.width);
|
|
10128
|
+
}), bboxWH[0] = maxWidth;
|
|
10129
|
+
} else {
|
|
10130
|
+
var width,
|
|
10131
|
+
_text,
|
|
10132
|
+
_lineWidth = 0;
|
|
10133
|
+
for (var _i = 0, len = lines.length; _i < len; _i++) {
|
|
10134
|
+
if (_i === lineCountLimit - 1) {
|
|
10135
|
+
var _clip2 = layoutObj.textMeasure.clipTextWithSuffix(lines[_i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10136
|
+
linesLayout.push({
|
|
10137
|
+
str: _clip2.str,
|
|
10138
|
+
width: _clip2.width
|
|
10139
|
+
}), _lineWidth = Math.max(_lineWidth, _clip2.width);
|
|
10140
|
+
break;
|
|
10141
|
+
}
|
|
10142
|
+
_text = lines[_i], width = layoutObj.textMeasure.measureTextWidth(_text, layoutObj.textOptions, "break-word" === wordBreak), _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
10143
|
+
str: _text,
|
|
10144
|
+
width: width
|
|
10145
|
+
});
|
|
10146
|
+
}
|
|
10147
|
+
bboxWH[0] = _lineWidth;
|
|
10148
|
+
}
|
|
10149
|
+
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
10150
|
+
var bbox = {
|
|
10151
|
+
xOffset: 0,
|
|
10152
|
+
yOffset: 0,
|
|
10153
|
+
width: bboxWH[0],
|
|
10154
|
+
height: bboxWH[1]
|
|
10155
|
+
};
|
|
10156
|
+
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
10157
|
+
var layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
10158
|
+
return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10159
|
+
}
|
|
10040
10160
|
}, {
|
|
10041
10161
|
key: "updateSingallineAABBBounds",
|
|
10042
10162
|
value: function updateSingallineAABBBounds(text) {
|
|
@@ -10083,9 +10203,12 @@
|
|
|
10083
10203
|
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
10084
10204
|
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
10085
10205
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
10086
|
-
|
|
10087
|
-
_attribute$
|
|
10088
|
-
|
|
10206
|
+
_attribute$whiteSpace = attribute.whiteSpace,
|
|
10207
|
+
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace;
|
|
10208
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10209
|
+
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10210
|
+
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
10211
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
10089
10212
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
10090
10213
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
10091
10214
|
var _dx = textDrawOffsetX(textAlign, width),
|
|
@@ -10155,12 +10278,11 @@
|
|
|
10155
10278
|
fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
|
|
10156
10279
|
_attribute$stroke2 = attribute.stroke,
|
|
10157
10280
|
stroke = _attribute$stroke2 === void 0 ? textTheme.stroke : _attribute$stroke2,
|
|
10158
|
-
_attribute$lineHeight2 = attribute.lineHeight,
|
|
10159
|
-
lineHeight = _attribute$lineHeight2 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight2,
|
|
10160
10281
|
_attribute$lineWidth2 = attribute.lineWidth,
|
|
10161
10282
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
10162
10283
|
_attribute$verticalMo = attribute.verticalMode,
|
|
10163
|
-
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo
|
|
10284
|
+
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo,
|
|
10285
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10164
10286
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
10165
10287
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
10166
10288
|
_attribute$textBaseli2 = attribute.textBaseline,
|
|
@@ -10210,7 +10332,7 @@
|
|
|
10210
10332
|
}, {
|
|
10211
10333
|
key: "updateHorizontalMultilineAABBBounds",
|
|
10212
10334
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
10213
|
-
var _a;
|
|
10335
|
+
var _a, _b;
|
|
10214
10336
|
var textTheme = getTheme(this).text,
|
|
10215
10337
|
attribute = this.attribute,
|
|
10216
10338
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
@@ -10223,8 +10345,6 @@
|
|
|
10223
10345
|
fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
|
|
10224
10346
|
_attribute$fontWeight3 = attribute.fontWeight,
|
|
10225
10347
|
fontWeight = _attribute$fontWeight3 === void 0 ? textTheme.fontWeight : _attribute$fontWeight3,
|
|
10226
|
-
_attribute$lineHeight3 = attribute.lineHeight,
|
|
10227
|
-
lineHeight = _attribute$lineHeight3 === void 0 ? attribute.lineHeight || attribute.fontSize || textTheme.fontSize : _attribute$lineHeight3,
|
|
10228
10348
|
_attribute$ellipsis3 = attribute.ellipsis,
|
|
10229
10349
|
ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
|
|
10230
10350
|
maxLineWidth = attribute.maxLineWidth,
|
|
@@ -10232,11 +10352,13 @@
|
|
|
10232
10352
|
stroke = _attribute$stroke3 === void 0 ? textTheme.stroke : _attribute$stroke3,
|
|
10233
10353
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
10234
10354
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
10235
|
-
_attribute$
|
|
10236
|
-
_attribute$
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
|
|
10355
|
+
_attribute$whiteSpace2 = attribute.whiteSpace,
|
|
10356
|
+
whiteSpace = _attribute$whiteSpace2 === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace2,
|
|
10357
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
|
|
10358
|
+
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10359
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10360
|
+
var _bbox2 = this.cache.layoutData.bbox;
|
|
10361
|
+
return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10240
10362
|
}
|
|
10241
10363
|
var textMeasure = application.graphicUtil.textMeasure,
|
|
10242
10364
|
layoutData = new CanvasTextLayout(fontFamily, {
|
|
@@ -10270,12 +10392,11 @@
|
|
|
10270
10392
|
fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
|
|
10271
10393
|
_attribute$stroke4 = attribute.stroke,
|
|
10272
10394
|
stroke = _attribute$stroke4 === void 0 ? textTheme.stroke : _attribute$stroke4,
|
|
10273
|
-
_attribute$lineHeight4 = attribute.lineHeight,
|
|
10274
|
-
lineHeight = _attribute$lineHeight4 === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight4,
|
|
10275
10395
|
_attribute$lineWidth4 = attribute.lineWidth,
|
|
10276
10396
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
10277
10397
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
10278
|
-
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2
|
|
10398
|
+
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2,
|
|
10399
|
+
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10279
10400
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
10280
10401
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
10281
10402
|
_attribute$textBaseli4 = attribute.textBaseline,
|
|
@@ -10408,7 +10529,7 @@
|
|
|
10408
10529
|
}, {
|
|
10409
10530
|
key: "updateMultilineAABBBounds",
|
|
10410
10531
|
value: function updateMultilineAABBBounds(text) {
|
|
10411
|
-
var _a, _b, _c;
|
|
10532
|
+
var _a, _b, _c, _d;
|
|
10412
10533
|
var textTheme = getTheme(this).text,
|
|
10413
10534
|
_this$attribute = this.attribute,
|
|
10414
10535
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -10419,8 +10540,6 @@
|
|
|
10419
10540
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10420
10541
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10421
10542
|
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10422
|
-
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
10423
|
-
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
10424
10543
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10425
10544
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10426
10545
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -10437,8 +10556,9 @@
|
|
|
10437
10556
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10438
10557
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10439
10558
|
lineClamp = _this$attribute.lineClamp,
|
|
10559
|
+
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10440
10560
|
buf = ignoreBuf ? 0 : 2;
|
|
10441
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
10561
|
+
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10442
10562
|
var _bbox = this.cache.layoutData.bbox;
|
|
10443
10563
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10444
10564
|
}
|
|
@@ -10470,7 +10590,7 @@
|
|
|
10470
10590
|
if ("" !== str && "" === clip.str) {
|
|
10471
10591
|
if (ellipsis) {
|
|
10472
10592
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10473
|
-
clip.str = null !== (
|
|
10593
|
+
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
10474
10594
|
} else clip.str = "", clip.width = 0;
|
|
10475
10595
|
needCut = !1;
|
|
10476
10596
|
}
|
|
@@ -11810,7 +11930,9 @@
|
|
|
11810
11930
|
var Paragraph = /*#__PURE__*/function () {
|
|
11811
11931
|
function Paragraph(text, newLine, character) {
|
|
11812
11932
|
_classCallCheck(this, Paragraph);
|
|
11813
|
-
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic"
|
|
11933
|
+
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic";
|
|
11934
|
+
var lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
11935
|
+
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
11814
11936
|
var _measureTextCanvas = measureTextCanvas(text, character),
|
|
11815
11937
|
ascent = _measureTextCanvas.ascent,
|
|
11816
11938
|
height = _measureTextCanvas.height,
|
|
@@ -15341,7 +15463,7 @@
|
|
|
15341
15463
|
var t = textAlign;
|
|
15342
15464
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
15343
15465
|
}
|
|
15344
|
-
var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
15466
|
+
var lineHeight = null !== (_c = calculateLineHeight(text.attribute.lineHeight, fontSize)) && void 0 !== _c ? _c : fontSize,
|
|
15345
15467
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
15346
15468
|
if (!data) return;
|
|
15347
15469
|
var fVisible = data.fVisible,
|
|
@@ -20852,8 +20974,8 @@
|
|
|
20852
20974
|
this.name = 'tag';
|
|
20853
20975
|
}
|
|
20854
20976
|
render() {
|
|
20855
|
-
var _a
|
|
20856
|
-
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state
|
|
20977
|
+
var _a;
|
|
20978
|
+
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state } = this.attribute;
|
|
20857
20979
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
20858
20980
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
20859
20981
|
let symbol;
|
|
@@ -20875,100 +20997,75 @@
|
|
|
20875
20997
|
}
|
|
20876
20998
|
tagWidth += symbolPlaceWidth;
|
|
20877
20999
|
textX += symbolPlaceWidth;
|
|
20878
|
-
|
|
20879
|
-
if (
|
|
20880
|
-
|
|
20881
|
-
|
|
20882
|
-
|
|
20883
|
-
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
|
|
21000
|
+
const textAttrs = Object.assign(Object.assign({ text, visible: vutils.isValid(text) && visible !== false, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }, textStyle), { x: textX, y: 0 });
|
|
21001
|
+
if (vutils.isNil(textAttrs.lineHeight)) {
|
|
21002
|
+
textAttrs.lineHeight = textAttrs.fontSize;
|
|
21003
|
+
}
|
|
21004
|
+
const textShape = group.createOrUpdateChild('tag-text', textAttrs, 'text');
|
|
21005
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.text)) {
|
|
21006
|
+
textShape.states = state.text;
|
|
21007
|
+
}
|
|
21008
|
+
const textBounds = measureTextSize(textAttrs.text, textStyle);
|
|
21009
|
+
const textWidth = textBounds.width;
|
|
21010
|
+
const textHeight = textBounds.height;
|
|
21011
|
+
tagWidth += textWidth;
|
|
21012
|
+
const size = (_a = shape.size) !== null && _a !== void 0 ? _a : 10;
|
|
21013
|
+
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
21014
|
+
tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
|
|
21015
|
+
const { textAlign, textBaseline } = textStyle;
|
|
21016
|
+
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
21017
|
+
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
21018
|
+
tagWidth = minWidth;
|
|
21019
|
+
}
|
|
21020
|
+
if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
|
|
21021
|
+
tagWidth = maxWidth;
|
|
21022
|
+
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
21023
|
+
}
|
|
21024
|
+
}
|
|
21025
|
+
let x = 0;
|
|
21026
|
+
let y = 0;
|
|
21027
|
+
if (textAlign === 'center') {
|
|
21028
|
+
x -= tagWidth / 2;
|
|
21029
|
+
if (symbol) {
|
|
21030
|
+
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
20888
21031
|
}
|
|
21032
|
+
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
20889
21033
|
}
|
|
20890
|
-
else if (
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20894
|
-
if (visible && vutils.isBoolean(bgVisible)) {
|
|
20895
|
-
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');
|
|
20896
|
-
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
20897
|
-
bgRect.states = state.panel;
|
|
20898
|
-
}
|
|
21034
|
+
else if (textAlign === 'right' || textAlign === 'end') {
|
|
21035
|
+
x -= tagWidth;
|
|
21036
|
+
if (symbol) {
|
|
21037
|
+
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
|
|
20899
21038
|
}
|
|
21039
|
+
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
20900
21040
|
}
|
|
20901
|
-
else {
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
|
|
20905
|
-
|
|
20906
|
-
|
|
20907
|
-
|
|
20908
|
-
textShape.states = state.text;
|
|
20909
|
-
}
|
|
20910
|
-
const textBounds = measureTextSize(textAttrs.text, textStyle);
|
|
20911
|
-
const textWidth = textBounds.width;
|
|
20912
|
-
const textHeight = textBounds.height;
|
|
20913
|
-
tagWidth += textWidth;
|
|
20914
|
-
const size = (_c = shape.size) !== null && _c !== void 0 ? _c : 10;
|
|
20915
|
-
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
20916
|
-
tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
|
|
20917
|
-
const { textAlign, textBaseline } = textStyle;
|
|
20918
|
-
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
20919
|
-
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
20920
|
-
tagWidth = minWidth;
|
|
20921
|
-
}
|
|
20922
|
-
if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
|
|
20923
|
-
tagWidth = maxWidth;
|
|
20924
|
-
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
20925
|
-
}
|
|
20926
|
-
}
|
|
20927
|
-
let x = 0;
|
|
20928
|
-
let y = 0;
|
|
20929
|
-
if (textAlign === 'center') {
|
|
20930
|
-
x -= tagWidth / 2;
|
|
20931
|
-
if (symbol) {
|
|
20932
|
-
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
20933
|
-
}
|
|
20934
|
-
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
20935
|
-
}
|
|
20936
|
-
else if (textAlign === 'right' || textAlign === 'end') {
|
|
20937
|
-
x -= tagWidth;
|
|
20938
|
-
if (symbol) {
|
|
20939
|
-
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth);
|
|
20940
|
-
}
|
|
20941
|
-
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
20942
|
-
}
|
|
20943
|
-
else if (textAlign === 'left' || textAlign === 'start') {
|
|
20944
|
-
group.setAttribute('x', parsedPadding[3]);
|
|
20945
|
-
}
|
|
20946
|
-
if (textBaseline === 'middle') {
|
|
20947
|
-
y -= tagHeight / 2;
|
|
20948
|
-
if (symbol) {
|
|
20949
|
-
symbol.setAttribute('y', 0);
|
|
20950
|
-
}
|
|
21041
|
+
else if (textAlign === 'left' || textAlign === 'start') {
|
|
21042
|
+
group.setAttribute('x', parsedPadding[3]);
|
|
21043
|
+
}
|
|
21044
|
+
if (textBaseline === 'middle') {
|
|
21045
|
+
y -= tagHeight / 2;
|
|
21046
|
+
if (symbol) {
|
|
21047
|
+
symbol.setAttribute('y', 0);
|
|
20951
21048
|
}
|
|
20952
|
-
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
group.setAttribute('y', -parsedPadding[2]);
|
|
21049
|
+
}
|
|
21050
|
+
else if (textBaseline === 'bottom') {
|
|
21051
|
+
y -= tagHeight;
|
|
21052
|
+
if (symbol) {
|
|
21053
|
+
symbol.setAttribute('y', -textHeight / 2);
|
|
20958
21054
|
}
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
21055
|
+
group.setAttribute('y', -parsedPadding[2]);
|
|
21056
|
+
}
|
|
21057
|
+
else if (textBaseline === 'top') {
|
|
21058
|
+
group.setAttribute('y', parsedPadding[0]);
|
|
21059
|
+
if (symbol) {
|
|
21060
|
+
symbol.setAttribute('y', textHeight / 2);
|
|
20964
21061
|
}
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
21062
|
+
}
|
|
21063
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
21064
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
21065
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x,
|
|
21066
|
+
y, width: tagWidth, height: tagHeight }), 'rect');
|
|
21067
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
21068
|
+
bgRect.states = state.panel;
|
|
20972
21069
|
}
|
|
20973
21070
|
}
|
|
20974
21071
|
}
|
|
@@ -22180,24 +22277,6 @@
|
|
|
22180
22277
|
target.states = state;
|
|
22181
22278
|
}
|
|
22182
22279
|
_createLabelText(attributes) {
|
|
22183
|
-
var _a, _b;
|
|
22184
|
-
if (attributes.type === 'rich') {
|
|
22185
|
-
attributes.textConfig = attributes.text;
|
|
22186
|
-
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
22187
|
-
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
22188
|
-
const text = createRichText(attributes);
|
|
22189
|
-
this._bindEvent(text);
|
|
22190
|
-
this._setStatesOfText(text);
|
|
22191
|
-
return text;
|
|
22192
|
-
}
|
|
22193
|
-
else if (attributes.type === 'html') {
|
|
22194
|
-
attributes.textConfig = [];
|
|
22195
|
-
attributes.html = Object.assign({ dom: attributes.text, container: '', width: 30, height: 30, style: {} }, attributes);
|
|
22196
|
-
const text = createRichText(attributes);
|
|
22197
|
-
this._bindEvent(text);
|
|
22198
|
-
this._setStatesOfText(text);
|
|
22199
|
-
return text;
|
|
22200
|
-
}
|
|
22201
22280
|
const text = createText(attributes);
|
|
22202
22281
|
this._bindEvent(text);
|
|
22203
22282
|
this._setStatesOfText(text);
|
|
@@ -22424,7 +22503,7 @@
|
|
|
22424
22503
|
const prevTextMap = this._graphicToText || new Map();
|
|
22425
22504
|
const texts = [];
|
|
22426
22505
|
labels.forEach((text, index) => {
|
|
22427
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
22506
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
22428
22507
|
const labelLine = this._labelLine(text);
|
|
22429
22508
|
const relatedGraphic = this.getRelatedGrphic(text.attribute);
|
|
22430
22509
|
const textId = text.attribute.id;
|
|
@@ -22467,11 +22546,11 @@
|
|
|
22467
22546
|
}), duration, easing);
|
|
22468
22547
|
}
|
|
22469
22548
|
if (animationConfig.increaseEffect !== false &&
|
|
22470
|
-
|
|
22471
|
-
vutils.isValidNumber(Number(
|
|
22549
|
+
prevText.attribute.text !== text.attribute.text &&
|
|
22550
|
+
vutils.isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))) {
|
|
22472
22551
|
prevText
|
|
22473
22552
|
.animate()
|
|
22474
|
-
.play(new IncreaseCount({ text:
|
|
22553
|
+
.play(new IncreaseCount({ text: prevText.attribute.text }, { text: text.attribute.text }, duration, easing));
|
|
22475
22554
|
}
|
|
22476
22555
|
}
|
|
22477
22556
|
});
|
|
@@ -24143,26 +24222,12 @@
|
|
|
24143
24222
|
let textAlign = 'center';
|
|
24144
24223
|
let textBaseline = 'middle';
|
|
24145
24224
|
data.forEach((item, index) => {
|
|
24146
|
-
var _a, _b
|
|
24225
|
+
var _a, _b;
|
|
24147
24226
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
24148
|
-
|
|
24149
|
-
if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'rich') {
|
|
24150
|
-
labelStyle.textConfig = labelStyle.text;
|
|
24151
|
-
labelStyle.width = (_a = labelStyle.width) !== null && _a !== void 0 ? _a : 0;
|
|
24152
|
-
labelStyle.height = (_b = labelStyle.height) !== null && _b !== void 0 ? _b : 0;
|
|
24153
|
-
text = createRichText(labelStyle);
|
|
24154
|
-
}
|
|
24155
|
-
else if ((labelStyle === null || labelStyle === void 0 ? void 0 : labelStyle.type) === 'html') {
|
|
24156
|
-
labelStyle.textConfig = [];
|
|
24157
|
-
labelStyle.html = Object.assign({ dom: labelStyle.text, container: '', width: 30, height: 30, style: {} }, labelStyle);
|
|
24158
|
-
text = createRichText(labelStyle);
|
|
24159
|
-
}
|
|
24160
|
-
else {
|
|
24161
|
-
text = createText(labelStyle);
|
|
24162
|
-
}
|
|
24227
|
+
const text = createText(labelStyle);
|
|
24163
24228
|
text.name = exports.AXIS_ELEMENT_NAME.label;
|
|
24164
24229
|
text.id = this._getNodeId(`layer${layer}-label-${item.id}`);
|
|
24165
|
-
if (vutils.isEmpty((
|
|
24230
|
+
if (vutils.isEmpty((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.state)) {
|
|
24166
24231
|
text.states = DEFAULT_STATES$2;
|
|
24167
24232
|
}
|
|
24168
24233
|
else {
|
|
@@ -24175,7 +24240,7 @@
|
|
|
24175
24240
|
text.states = labelState;
|
|
24176
24241
|
}
|
|
24177
24242
|
labelGroup.add(text);
|
|
24178
|
-
const angle = (
|
|
24243
|
+
const angle = (_b = labelStyle.angle) !== null && _b !== void 0 ? _b : 0;
|
|
24179
24244
|
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width());
|
|
24180
24245
|
maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height());
|
|
24181
24246
|
if (angle) {
|
|
@@ -24324,7 +24389,7 @@
|
|
|
24324
24389
|
}
|
|
24325
24390
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
24326
24391
|
var _a, _b, _c, _d, _e, _f;
|
|
24327
|
-
const _g = this.attribute.label, { space = 4, inside = false, formatMethod
|
|
24392
|
+
const _g = this.attribute.label, { space = 4, inside = false, formatMethod } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod"]);
|
|
24328
24393
|
let offset = space;
|
|
24329
24394
|
let tickLength = 0;
|
|
24330
24395
|
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) {
|
|
@@ -24345,9 +24410,7 @@
|
|
|
24345
24410
|
}
|
|
24346
24411
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside);
|
|
24347
24412
|
const vector = this.getVerticalVector(offset, inside, point);
|
|
24348
|
-
const
|
|
24349
|
-
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
24350
|
-
: tickDatum.label;
|
|
24413
|
+
const text = formatMethod ? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer) : tickDatum.label;
|
|
24351
24414
|
let { style: textStyle } = tagAttributes;
|
|
24352
24415
|
textStyle = vutils.isFunction(textStyle)
|
|
24353
24416
|
? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
|
|
@@ -24362,7 +24425,7 @@
|
|
|
24362
24425
|
layer
|
|
24363
24426
|
});
|
|
24364
24427
|
}
|
|
24365
|
-
return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector,
|
|
24428
|
+
return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector, text, textStyle)), { text, lineHeight: textStyle === null || textStyle === void 0 ? void 0 : textStyle.fontSize }), textStyle);
|
|
24366
24429
|
}
|
|
24367
24430
|
getLabelPosition(point, vector, text, style) {
|
|
24368
24431
|
return point;
|
|
@@ -25100,7 +25163,7 @@
|
|
|
25100
25163
|
let titleSpacing = 0;
|
|
25101
25164
|
const axisLineWidth = (line === null || line === void 0 ? void 0 : line.visible) ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
25102
25165
|
const tickLength = (tick === null || tick === void 0 ? void 0 : tick.visible) ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
25103
|
-
if (
|
|
25166
|
+
if (title === null || title === void 0 ? void 0 : title.visible) {
|
|
25104
25167
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
25105
25168
|
const padding = vutils.normalizePadding(title.padding);
|
|
25106
25169
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -29308,27 +29371,19 @@
|
|
|
29308
29371
|
this.name = 'title';
|
|
29309
29372
|
}
|
|
29310
29373
|
render() {
|
|
29311
|
-
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
|
|
29312
|
-
const {
|
|
29374
|
+
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;
|
|
29375
|
+
const { text, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
29313
29376
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
29314
29377
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
29315
29378
|
if (((_a = this.attribute) === null || _a === void 0 ? void 0 : _a.visible) !== false && (textStyle === null || textStyle === void 0 ? void 0 : textStyle.visible) !== false) {
|
|
29316
|
-
if (
|
|
29317
|
-
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);
|
|
29318
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29319
|
-
}
|
|
29320
|
-
else if (textType === 'html') {
|
|
29321
|
-
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);
|
|
29322
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29323
|
-
}
|
|
29324
|
-
else if (textStyle && vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.character)) {
|
|
29379
|
+
if (textStyle && vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.character)) {
|
|
29325
29380
|
const attr = {
|
|
29326
|
-
x: (
|
|
29327
|
-
y: (
|
|
29328
|
-
width: (
|
|
29329
|
-
height: (
|
|
29330
|
-
ellipsis: (
|
|
29331
|
-
wordBreak: (
|
|
29381
|
+
x: (_b = textStyle.x) !== null && _b !== void 0 ? _b : 0,
|
|
29382
|
+
y: (_c = textStyle.y) !== null && _c !== void 0 ? _c : 0,
|
|
29383
|
+
width: (_e = (_d = textStyle.width) !== null && _d !== void 0 ? _d : width) !== null && _e !== void 0 ? _e : 0,
|
|
29384
|
+
height: (_g = (_f = textStyle.height) !== null && _f !== void 0 ? _f : height) !== null && _g !== void 0 ? _g : 0,
|
|
29385
|
+
ellipsis: (_h = textStyle.ellipsis) !== null && _h !== void 0 ? _h : true,
|
|
29386
|
+
wordBreak: (_j = textStyle.wordBreak) !== null && _j !== void 0 ? _j : 'break-word',
|
|
29332
29387
|
maxHeight: textStyle.maxHeight,
|
|
29333
29388
|
maxWidth: textStyle.maxWidth,
|
|
29334
29389
|
textConfig: textStyle.character
|
|
@@ -29336,28 +29391,20 @@
|
|
|
29336
29391
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29337
29392
|
}
|
|
29338
29393
|
else if (vutils.isValid(text)) {
|
|
29339
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (
|
|
29394
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (_k = textStyle === null || textStyle === void 0 ? void 0 : textStyle.maxLineWidth) !== null && _k !== void 0 ? _k : width, heightLimit: textStyle === null || textStyle === void 0 ? void 0 : textStyle.heightLimit, lineClamp: textStyle === null || textStyle === void 0 ? void 0 : textStyle.lineClamp, ellipsis: (_l = textStyle === null || textStyle === void 0 ? void 0 : textStyle.ellipsis) !== null && _l !== void 0 ? _l : true, x: 0, y: 0 }), 'wrapText');
|
|
29340
29395
|
}
|
|
29341
29396
|
}
|
|
29342
|
-
const maintextHeight = this._mainTitle ? (
|
|
29343
|
-
const maintextWidth = this._mainTitle ? (
|
|
29344
|
-
if (((
|
|
29345
|
-
if (
|
|
29346
|
-
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);
|
|
29347
|
-
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29348
|
-
}
|
|
29349
|
-
else if (textType === 'html') {
|
|
29350
|
-
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);
|
|
29351
|
-
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29352
|
-
}
|
|
29353
|
-
else if (subtextStyle && vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.character)) {
|
|
29397
|
+
const maintextHeight = this._mainTitle ? (_m = this._mainTitle) === null || _m === void 0 ? void 0 : _m.AABBBounds.height() : 0;
|
|
29398
|
+
const maintextWidth = this._mainTitle ? (_o = this._mainTitle) === null || _o === void 0 ? void 0 : _o.AABBBounds.width() : 0;
|
|
29399
|
+
if (((_p = this.attribute) === null || _p === void 0 ? void 0 : _p.visible) !== false && (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.visible) !== false) {
|
|
29400
|
+
if (subtextStyle && vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.character)) {
|
|
29354
29401
|
const attr = {
|
|
29355
|
-
x: (
|
|
29356
|
-
y: (
|
|
29357
|
-
width: (
|
|
29358
|
-
height: (
|
|
29359
|
-
ellipsis: (
|
|
29360
|
-
wordBreak: (
|
|
29402
|
+
x: (_q = subtextStyle.x) !== null && _q !== void 0 ? _q : 0,
|
|
29403
|
+
y: (_r = subtextStyle.y) !== null && _r !== void 0 ? _r : maintextHeight,
|
|
29404
|
+
width: (_t = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s : width) !== null && _t !== void 0 ? _t : 0,
|
|
29405
|
+
height: (_v = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height) !== null && _v !== void 0 ? _v : 0,
|
|
29406
|
+
ellipsis: (_w = subtextStyle.ellipsis) !== null && _w !== void 0 ? _w : true,
|
|
29407
|
+
wordBreak: (_x = subtextStyle.wordBreak) !== null && _x !== void 0 ? _x : 'break-word',
|
|
29361
29408
|
maxHeight: subtextStyle.maxHeight,
|
|
29362
29409
|
maxWidth: subtextStyle.maxWidth,
|
|
29363
29410
|
textConfig: subtextStyle.character
|
|
@@ -29365,17 +29412,17 @@
|
|
|
29365
29412
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29366
29413
|
}
|
|
29367
29414
|
else if (vutils.isValid(subtext)) {
|
|
29368
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (
|
|
29415
|
+
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (_y = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.maxLineWidth) !== null && _y !== void 0 ? _y : width, heightLimit: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.heightLimit, lineClamp: subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.lineClamp, ellipsis: (_z = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.ellipsis) !== null && _z !== void 0 ? _z : true, x: 0, y: maintextHeight }), 'wrapText');
|
|
29369
29416
|
}
|
|
29370
29417
|
}
|
|
29371
|
-
const subtextHeight = this._subTitle ? (
|
|
29372
|
-
const subtextWidth = this._subTitle ? (
|
|
29418
|
+
const subtextHeight = this._subTitle ? (_0 = this._subTitle) === null || _0 === void 0 ? void 0 : _0.AABBBounds.height() : 0;
|
|
29419
|
+
const subtextWidth = this._subTitle ? (_1 = this._subTitle) === null || _1 === void 0 ? void 0 : _1.AABBBounds.width() : 0;
|
|
29373
29420
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
29374
|
-
let titleHeight = maintextHeight + ((
|
|
29421
|
+
let titleHeight = maintextHeight + ((_2 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _2 !== void 0 ? _2 : subtextHeight);
|
|
29375
29422
|
if (vutils.isValid(width)) {
|
|
29376
29423
|
titleWidth = width;
|
|
29377
|
-
(
|
|
29378
|
-
(
|
|
29424
|
+
(_3 = this._mainTitle) === null || _3 === void 0 ? void 0 : _3.setAttribute('maxLineWidth', width);
|
|
29425
|
+
(_4 = this._subTitle) === null || _4 === void 0 ? void 0 : _4.setAttribute('maxLineWidth', width);
|
|
29379
29426
|
}
|
|
29380
29427
|
if (vutils.isValid(height)) {
|
|
29381
29428
|
titleHeight = height;
|
|
@@ -29384,10 +29431,10 @@
|
|
|
29384
29431
|
titleWidth = minWidth;
|
|
29385
29432
|
}
|
|
29386
29433
|
if (vutils.isValid(maxWidth)) {
|
|
29387
|
-
(
|
|
29388
|
-
(
|
|
29389
|
-
(
|
|
29390
|
-
(
|
|
29434
|
+
(_5 = this._mainTitle) === null || _5 === void 0 ? void 0 : _5.setAttribute('maxLineWidth', maxWidth);
|
|
29435
|
+
(_6 = this._subTitle) === null || _6 === void 0 ? void 0 : _6.setAttribute('maxLineWidth', maxWidth);
|
|
29436
|
+
(_7 = this._mainTitle) === null || _7 === void 0 ? void 0 : _7.setAttribute('maxWidth', maxWidth);
|
|
29437
|
+
(_8 = this._subTitle) === null || _8 === void 0 ? void 0 : _8.setAttribute('maxWidth', maxWidth);
|
|
29391
29438
|
if (titleWidth > maxWidth) {
|
|
29392
29439
|
titleWidth = maxWidth;
|
|
29393
29440
|
}
|
|
@@ -29396,8 +29443,8 @@
|
|
|
29396
29443
|
titleHeight = minHeight;
|
|
29397
29444
|
}
|
|
29398
29445
|
if (vutils.isValid(maxHeight)) {
|
|
29399
|
-
(
|
|
29400
|
-
(
|
|
29446
|
+
(_9 = this._mainTitle) === null || _9 === void 0 ? void 0 : _9.setAttribute('maxHeight', maxHeight);
|
|
29447
|
+
(_10 = this._subTitle) === null || _10 === void 0 ? void 0 : _10.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
29401
29448
|
if (titleHeight > maxHeight) {
|
|
29402
29449
|
titleHeight = maxHeight;
|
|
29403
29450
|
}
|
|
@@ -29407,67 +29454,67 @@
|
|
|
29407
29454
|
group.attribute.boundsPadding = parsedPadding;
|
|
29408
29455
|
if (vutils.isValid(align) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.align)) {
|
|
29409
29456
|
const mainTitleAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.align) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.align : align;
|
|
29410
|
-
const mainTitleWidth = (
|
|
29457
|
+
const mainTitleWidth = (_11 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _11 !== void 0 ? _11 : maintextWidth;
|
|
29411
29458
|
if (mainTitleAlign === 'left') {
|
|
29412
|
-
(
|
|
29413
|
-
(
|
|
29459
|
+
(_12 = this._mainTitle) === null || _12 === void 0 ? void 0 : _12.setAttribute('x', 0);
|
|
29460
|
+
(_13 = this._mainTitle) === null || _13 === void 0 ? void 0 : _13.setAttribute('textAlign', 'left');
|
|
29414
29461
|
}
|
|
29415
29462
|
else if (mainTitleAlign === 'center') {
|
|
29416
|
-
(
|
|
29417
|
-
(
|
|
29463
|
+
(_14 = this._mainTitle) === null || _14 === void 0 ? void 0 : _14.setAttribute('x', mainTitleWidth / 2);
|
|
29464
|
+
(_15 = this._mainTitle) === null || _15 === void 0 ? void 0 : _15.setAttribute('textAlign', 'center');
|
|
29418
29465
|
}
|
|
29419
29466
|
else if (mainTitleAlign === 'right') {
|
|
29420
|
-
(
|
|
29421
|
-
(
|
|
29467
|
+
(_16 = this._mainTitle) === null || _16 === void 0 ? void 0 : _16.setAttribute('x', mainTitleWidth);
|
|
29468
|
+
(_17 = this._mainTitle) === null || _17 === void 0 ? void 0 : _17.setAttribute('textAlign', 'right');
|
|
29422
29469
|
}
|
|
29423
29470
|
}
|
|
29424
29471
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29425
29472
|
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
29426
29473
|
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
29427
29474
|
if (mainTitleVerticalAlign === 'top') {
|
|
29428
|
-
(
|
|
29429
|
-
(
|
|
29475
|
+
(_18 = this._mainTitle) === null || _18 === void 0 ? void 0 : _18.setAttribute('y', 0);
|
|
29476
|
+
(_19 = this._mainTitle) === null || _19 === void 0 ? void 0 : _19.setAttribute('textBaseline', 'top');
|
|
29430
29477
|
}
|
|
29431
29478
|
else if (mainTitleVerticalAlign === 'middle') {
|
|
29432
|
-
(
|
|
29433
|
-
(
|
|
29479
|
+
(_20 = this._mainTitle) === null || _20 === void 0 ? void 0 : _20.setAttribute('y', mainTitleHeight / 2);
|
|
29480
|
+
(_21 = this._mainTitle) === null || _21 === void 0 ? void 0 : _21.setAttribute('textBaseline', 'middle');
|
|
29434
29481
|
}
|
|
29435
29482
|
else if (mainTitleVerticalAlign === 'bottom') {
|
|
29436
|
-
(
|
|
29437
|
-
(
|
|
29483
|
+
(_22 = this._mainTitle) === null || _22 === void 0 ? void 0 : _22.setAttribute('y', mainTitleHeight);
|
|
29484
|
+
(_23 = this._mainTitle) === null || _23 === void 0 ? void 0 : _23.setAttribute('textBaseline', 'bottom');
|
|
29438
29485
|
}
|
|
29439
29486
|
}
|
|
29440
29487
|
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
29441
29488
|
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
29442
|
-
const subTitleWidth = (
|
|
29489
|
+
const subTitleWidth = (_24 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _24 !== void 0 ? _24 : subtextWidth;
|
|
29443
29490
|
if (subTitleAlign === 'left') {
|
|
29444
|
-
(
|
|
29445
|
-
(
|
|
29491
|
+
(_25 = this._subTitle) === null || _25 === void 0 ? void 0 : _25.setAttribute('x', 0);
|
|
29492
|
+
(_26 = this._subTitle) === null || _26 === void 0 ? void 0 : _26.setAttribute('textAlign', 'left');
|
|
29446
29493
|
}
|
|
29447
29494
|
else if (subTitleAlign === 'center') {
|
|
29448
|
-
(
|
|
29449
|
-
(
|
|
29495
|
+
(_27 = this._subTitle) === null || _27 === void 0 ? void 0 : _27.setAttribute('x', subTitleWidth / 2);
|
|
29496
|
+
(_28 = this._subTitle) === null || _28 === void 0 ? void 0 : _28.setAttribute('textAlign', 'center');
|
|
29450
29497
|
}
|
|
29451
29498
|
else if (subTitleAlign === 'right') {
|
|
29452
|
-
(
|
|
29453
|
-
(
|
|
29499
|
+
(_29 = this._subTitle) === null || _29 === void 0 ? void 0 : _29.setAttribute('x', subTitleWidth);
|
|
29500
|
+
(_30 = this._subTitle) === null || _30 === void 0 ? void 0 : _30.setAttribute('textAlign', 'right');
|
|
29454
29501
|
}
|
|
29455
29502
|
}
|
|
29456
29503
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29457
29504
|
const subTitleVerticalAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign : verticalAlign;
|
|
29458
29505
|
const subTitleYStart = maintextHeight;
|
|
29459
|
-
const subTitleHeight = (
|
|
29506
|
+
const subTitleHeight = (_31 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _31 !== void 0 ? _31 : 0;
|
|
29460
29507
|
if (subTitleVerticalAlign === 'top') {
|
|
29461
|
-
(
|
|
29462
|
-
(
|
|
29508
|
+
(_32 = this._subTitle) === null || _32 === void 0 ? void 0 : _32.setAttribute('y', subTitleYStart);
|
|
29509
|
+
(_33 = this._subTitle) === null || _33 === void 0 ? void 0 : _33.setAttribute('textBaseline', 'top');
|
|
29463
29510
|
}
|
|
29464
29511
|
else if (subTitleVerticalAlign === 'middle') {
|
|
29465
|
-
(
|
|
29466
|
-
(
|
|
29512
|
+
(_34 = this._subTitle) === null || _34 === void 0 ? void 0 : _34.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
29513
|
+
(_35 = this._subTitle) === null || _35 === void 0 ? void 0 : _35.setAttribute('textBaseline', 'middle');
|
|
29467
29514
|
}
|
|
29468
29515
|
else if (subTitleVerticalAlign === 'bottom') {
|
|
29469
|
-
(
|
|
29470
|
-
(
|
|
29516
|
+
(_36 = this._subTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
29517
|
+
(_37 = this._subTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('textBaseline', 'bottom');
|
|
29471
29518
|
}
|
|
29472
29519
|
}
|
|
29473
29520
|
}
|
|
@@ -29522,7 +29569,7 @@
|
|
|
29522
29569
|
this.name = 'indicator';
|
|
29523
29570
|
}
|
|
29524
29571
|
render() {
|
|
29525
|
-
var _a
|
|
29572
|
+
var _a;
|
|
29526
29573
|
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
29527
29574
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
29528
29575
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
@@ -29533,15 +29580,7 @@
|
|
|
29533
29580
|
if (vutils.isValid(title)) {
|
|
29534
29581
|
if (title.visible !== false) {
|
|
29535
29582
|
const titleStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
|
|
29536
|
-
|
|
29537
|
-
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');
|
|
29538
|
-
}
|
|
29539
|
-
else if (titleStyle.type === 'html') {
|
|
29540
|
-
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');
|
|
29541
|
-
}
|
|
29542
|
-
else {
|
|
29543
|
-
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');
|
|
29544
|
-
}
|
|
29583
|
+
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');
|
|
29545
29584
|
if (title.autoFit && vutils.isValidNumber(limit)) {
|
|
29546
29585
|
this._setAutoFit(limit, this._title, title);
|
|
29547
29586
|
}
|
|
@@ -29562,19 +29601,9 @@
|
|
|
29562
29601
|
const contentComponents = [];
|
|
29563
29602
|
let lastContentHeight = 0;
|
|
29564
29603
|
contents.forEach((contentItem, i) => {
|
|
29565
|
-
var _a, _b;
|
|
29566
29604
|
if (contentItem.visible !== false) {
|
|
29567
29605
|
const contentStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);
|
|
29568
|
-
|
|
29569
|
-
if (contentStyle.type === 'rich') {
|
|
29570
|
-
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');
|
|
29571
|
-
}
|
|
29572
|
-
else if (contentStyle.type === 'html') {
|
|
29573
|
-
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');
|
|
29574
|
-
}
|
|
29575
|
-
else {
|
|
29576
|
-
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');
|
|
29577
|
-
}
|
|
29606
|
+
const 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');
|
|
29578
29607
|
if (contentItem.autoFit && vutils.isValidNumber(limit)) {
|
|
29579
29608
|
this._setAutoFit(limit, contentComponent, contentItem);
|
|
29580
29609
|
}
|
|
@@ -29592,7 +29621,7 @@
|
|
|
29592
29621
|
});
|
|
29593
29622
|
this._content = contentComponents;
|
|
29594
29623
|
}
|
|
29595
|
-
const totalHeight = (
|
|
29624
|
+
const totalHeight = (_a = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _a !== void 0 ? _a : 0;
|
|
29596
29625
|
group.setAttribute('y', size.height / 2 - totalHeight / 2);
|
|
29597
29626
|
group.setAttribute('x', size.width / 2);
|
|
29598
29627
|
}
|
|
@@ -30951,13 +30980,7 @@
|
|
|
30951
30980
|
this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, vutils.merge({ symbolType: 'circle' }, titleAttr.shape, {
|
|
30952
30981
|
visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
|
|
30953
30982
|
}), 'symbol');
|
|
30954
|
-
if (titleAttr.value.
|
|
30955
|
-
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ 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.text }, titleAttr.value), 'richtext');
|
|
30956
|
-
}
|
|
30957
|
-
else if (titleAttr.value.type === 'html') {
|
|
30958
|
-
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ html: Object.assign({ dom: titleAttr.value.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');
|
|
30959
|
-
}
|
|
30960
|
-
else if (titleAttr.value.multiLine) {
|
|
30983
|
+
if (titleAttr.value.multiLine) {
|
|
30961
30984
|
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, getRichTextAttribute(titleAttr.value)), 'richtext');
|
|
30962
30985
|
}
|
|
30963
30986
|
else {
|
|
@@ -31002,7 +31025,9 @@
|
|
|
31002
31025
|
let x = 0;
|
|
31003
31026
|
if (isVisible(itemAttr.shape)) {
|
|
31004
31027
|
itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, Object.assign({ visible: true, x: itemAttr.shape.size / 2, y: itemAttr.shape.size / 2 +
|
|
31005
|
-
(((_a = itemAttr.key.lineHeight) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
|
|
31028
|
+
(((_a = calculateLineHeight(itemAttr.key.lineHeight, itemAttr.key.fontSize)) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) -
|
|
31029
|
+
itemAttr.shape.size) /
|
|
31030
|
+
2 }, itemAttr.shape), 'symbol');
|
|
31006
31031
|
}
|
|
31007
31032
|
if (hasContentShape) {
|
|
31008
31033
|
x += itemAttr.shape.size + itemAttr.shape.spacing;
|
|
@@ -31383,7 +31408,7 @@
|
|
|
31383
31408
|
}
|
|
31384
31409
|
};
|
|
31385
31410
|
|
|
31386
|
-
const version = "0.16.14-alpha.
|
|
31411
|
+
const version = "0.16.14-alpha.5";
|
|
31387
31412
|
|
|
31388
31413
|
exports.AbstractComponent = AbstractComponent;
|
|
31389
31414
|
exports.ArcInfo = ArcInfo;
|