@visactor/vrender-components 0.16.14-alpha.2 → 0.16.14-alpha.4
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/data-zoom/config.d.ts +6 -0
- package/cjs/data-zoom/config.js +7 -1
- package/cjs/data-zoom/config.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +2 -3
- package/cjs/data-zoom/data-zoom.js +15 -19
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/data-zoom/type.d.ts +0 -6
- package/cjs/data-zoom/type.js +1 -6
- package/cjs/data-zoom/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 +23 -5
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.d.ts +8 -4
- 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/scrollbar/scrollbar.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 +26 -1
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/cjs/tooltip/type.d.ts +3 -1
- package/cjs/tooltip/type.js.map +1 -1
- package/dist/index.js +271 -296
- 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/data-zoom/config.d.ts +6 -0
- package/es/data-zoom/config.js +7 -0
- package/es/data-zoom/config.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +2 -3
- package/es/data-zoom/data-zoom.js +4 -10
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/data-zoom/type.d.ts +0 -6
- package/es/data-zoom/type.js +1 -6
- package/es/data-zoom/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 +23 -5
- package/es/label/base.js.map +1 -1
- package/es/label/type.d.ts +8 -4
- 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/scrollbar/scrollbar.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 +26 -1
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/tooltip/type.d.ts +3 -1
- package/es/tooltip/type.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4470,10 +4470,7 @@
|
|
|
4470
4470
|
direction: "horizontal",
|
|
4471
4471
|
wordBreak: "break-all",
|
|
4472
4472
|
ignoreBuf: !1,
|
|
4473
|
-
verticalMode: 0
|
|
4474
|
-
whiteSpace: "no-wrap",
|
|
4475
|
-
heightLimit: 1 / 0,
|
|
4476
|
-
lineClamp: 1 / 0
|
|
4473
|
+
verticalMode: 0
|
|
4477
4474
|
};
|
|
4478
4475
|
var DefaultStyle = Object.assign(Object.assign(Object.assign({
|
|
4479
4476
|
opacity: 1,
|
|
@@ -8580,8 +8577,7 @@
|
|
|
8580
8577
|
}, {
|
|
8581
8578
|
key: "addChild",
|
|
8582
8579
|
value: function addChild(node) {
|
|
8583
|
-
|
|
8584
|
-
"__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push((_this$child$push2 = {}, _defineProperty(_this$child$push2, node.tagname, node.child), _defineProperty(_this$child$push2, ":@", node[":@"]), _this$child$push2)) : this.child.push(_defineProperty({}, node.tagname, node.child));
|
|
8580
|
+
"__proto__" === node.tagname && (node.tagname = "#__proto__"), node[":@"] && Object.keys(node[":@"]).length > 0 ? this.child.push(_defineProperty(_defineProperty({}, node.tagname, node.child), ":@", node[":@"])) : this.child.push(_defineProperty({}, node.tagname, node.child));
|
|
8585
8581
|
}
|
|
8586
8582
|
}]);
|
|
8587
8583
|
return XmlNode;
|
|
@@ -9967,7 +9963,7 @@
|
|
|
9967
9963
|
return CanvasTextLayout;
|
|
9968
9964
|
}();
|
|
9969
9965
|
|
|
9970
|
-
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "
|
|
9966
|
+
var TEXT_UPDATE_TAG_KEY = ["text", "maxLineWidth", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak"].concat(_toConsumableArray(GRAPHIC_UPDATE_TAG_KEY));
|
|
9971
9967
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
9972
9968
|
_inherits(Text, _Graphic);
|
|
9973
9969
|
var _super = _createSuper(Text);
|
|
@@ -10041,118 +10037,6 @@
|
|
|
10041
10037
|
paddingArray = parsePadding(boundsPadding);
|
|
10042
10038
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
10043
10039
|
}
|
|
10044
|
-
}, {
|
|
10045
|
-
key: "updateWrapAABBBounds",
|
|
10046
|
-
value: function updateWrapAABBBounds(text) {
|
|
10047
|
-
var _a, _b, _c;
|
|
10048
|
-
var textTheme = getTheme(this).text,
|
|
10049
|
-
_this$attribute = this.attribute,
|
|
10050
|
-
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
10051
|
-
fontFamily = _this$attribute$fontF === void 0 ? textTheme.fontFamily : _this$attribute$fontF,
|
|
10052
|
-
_this$attribute$textA = _this$attribute.textAlign,
|
|
10053
|
-
textAlign = _this$attribute$textA === void 0 ? textTheme.textAlign : _this$attribute$textA,
|
|
10054
|
-
_this$attribute$textB = _this$attribute.textBaseline,
|
|
10055
|
-
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10056
|
-
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10057
|
-
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10058
|
-
_this$attribute$lineH = _this$attribute.lineHeight,
|
|
10059
|
-
lineHeight = _this$attribute$lineH === void 0 ? this.attribute.lineHeight || this.attribute.fontSize || textTheme.fontSize : _this$attribute$lineH,
|
|
10060
|
-
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10061
|
-
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10062
|
-
maxLineWidth = _this$attribute.maxLineWidth,
|
|
10063
|
-
_this$attribute$strok = _this$attribute.stroke,
|
|
10064
|
-
stroke = _this$attribute$strok === void 0 ? textTheme.stroke : _this$attribute$strok,
|
|
10065
|
-
_this$attribute$lineW = _this$attribute.lineWidth,
|
|
10066
|
-
lineWidth = _this$attribute$lineW === void 0 ? textTheme.lineWidth : _this$attribute$lineW,
|
|
10067
|
-
_this$attribute$wordB = _this$attribute.wordBreak,
|
|
10068
|
-
wordBreak = _this$attribute$wordB === void 0 ? textTheme.wordBreak : _this$attribute$wordB,
|
|
10069
|
-
_this$attribute$fontW = _this$attribute.fontWeight,
|
|
10070
|
-
fontWeight = _this$attribute$fontW === void 0 ? textTheme.fontWeight : _this$attribute$fontW,
|
|
10071
|
-
_this$attribute$ignor = _this$attribute.ignoreBuf,
|
|
10072
|
-
ignoreBuf = _this$attribute$ignor === void 0 ? textTheme.ignoreBuf : _this$attribute$ignor,
|
|
10073
|
-
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10074
|
-
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10075
|
-
lineClamp = _this$attribute.lineClamp,
|
|
10076
|
-
buf = ignoreBuf ? 0 : 2;
|
|
10077
|
-
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
10078
|
-
var _bbox = this.cache.layoutData.bbox;
|
|
10079
|
-
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10080
|
-
}
|
|
10081
|
-
var textMeasure = application.graphicUtil.textMeasure,
|
|
10082
|
-
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
10083
|
-
fontSize: fontSize,
|
|
10084
|
-
fontWeight: fontWeight,
|
|
10085
|
-
fontFamily: fontFamily
|
|
10086
|
-
}, textMeasure),
|
|
10087
|
-
lines = vutils.isArray(text) ? text.map(function (l) {
|
|
10088
|
-
return l.toString();
|
|
10089
|
-
}) : [text.toString()],
|
|
10090
|
-
linesLayout = [],
|
|
10091
|
-
bboxWH = [0, 0];
|
|
10092
|
-
var lineCountLimit = 1 / 0;
|
|
10093
|
-
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
10094
|
-
if (maxLineWidth > 0) for (var i = 0; i < lines.length; i++) {
|
|
10095
|
-
var str = lines[i];
|
|
10096
|
-
var needCut = !0;
|
|
10097
|
-
if (i === lineCountLimit - 1) {
|
|
10098
|
-
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10099
|
-
linesLayout.push({
|
|
10100
|
-
str: _clip.str,
|
|
10101
|
-
width: _clip.width
|
|
10102
|
-
});
|
|
10103
|
-
break;
|
|
10104
|
-
}
|
|
10105
|
-
var clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
10106
|
-
if ("" !== str && "" === clip.str) {
|
|
10107
|
-
if (ellipsis) {
|
|
10108
|
-
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10109
|
-
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
10110
|
-
} else clip.str = "", clip.width = 0;
|
|
10111
|
-
needCut = !1;
|
|
10112
|
-
}
|
|
10113
|
-
if (linesLayout.push({
|
|
10114
|
-
str: clip.str,
|
|
10115
|
-
width: clip.width
|
|
10116
|
-
}), clip.str.length === str.length) ;else if (needCut) {
|
|
10117
|
-
var newStr = str.substring(clip.str.length);
|
|
10118
|
-
lines.splice(i + 1, 0, newStr);
|
|
10119
|
-
}
|
|
10120
|
-
}
|
|
10121
|
-
var maxWidth = 0;
|
|
10122
|
-
linesLayout.forEach(function (layout) {
|
|
10123
|
-
maxWidth = Math.max(maxWidth, layout.width);
|
|
10124
|
-
}), bboxWH[0] = maxWidth;
|
|
10125
|
-
} else {
|
|
10126
|
-
var width,
|
|
10127
|
-
_text,
|
|
10128
|
-
_lineWidth = 0;
|
|
10129
|
-
for (var _i = 0, len = lines.length; _i < len; _i++) {
|
|
10130
|
-
if (_i === lineCountLimit - 1) {
|
|
10131
|
-
var _clip2 = layoutObj.textMeasure.clipTextWithSuffix(lines[_i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10132
|
-
linesLayout.push({
|
|
10133
|
-
str: _clip2.str,
|
|
10134
|
-
width: _clip2.width
|
|
10135
|
-
}), _lineWidth = Math.max(_lineWidth, _clip2.width);
|
|
10136
|
-
break;
|
|
10137
|
-
}
|
|
10138
|
-
_text = lines[_i], width = layoutObj.textMeasure.measureTextWidth(_text, layoutObj.textOptions, "break-word" === wordBreak), _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
10139
|
-
str: _text,
|
|
10140
|
-
width: width
|
|
10141
|
-
});
|
|
10142
|
-
}
|
|
10143
|
-
bboxWH[0] = _lineWidth;
|
|
10144
|
-
}
|
|
10145
|
-
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
10146
|
-
var bbox = {
|
|
10147
|
-
xOffset: 0,
|
|
10148
|
-
yOffset: 0,
|
|
10149
|
-
width: bboxWH[0],
|
|
10150
|
-
height: bboxWH[1]
|
|
10151
|
-
};
|
|
10152
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
10153
|
-
var layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
10154
|
-
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;
|
|
10155
|
-
}
|
|
10156
10040
|
}, {
|
|
10157
10041
|
key: "updateSingallineAABBBounds",
|
|
10158
10042
|
value: function updateSingallineAABBBounds(text) {
|
|
@@ -10199,10 +10083,7 @@
|
|
|
10199
10083
|
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
10200
10084
|
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
10201
10085
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
10202
|
-
|
|
10203
|
-
whiteSpace = _attribute$whiteSpace === void 0 ? textTheme.whiteSpace : _attribute$whiteSpace;
|
|
10204
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10205
|
-
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10086
|
+
buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10206
10087
|
_attribute$lineHeight = attribute.lineHeight,
|
|
10207
10088
|
lineHeight = _attribute$lineHeight === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight;
|
|
10208
10089
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
@@ -10351,12 +10232,11 @@
|
|
|
10351
10232
|
stroke = _attribute$stroke3 === void 0 ? textTheme.stroke : _attribute$stroke3,
|
|
10352
10233
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
10353
10234
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
10354
|
-
_attribute$
|
|
10355
|
-
|
|
10356
|
-
if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
|
|
10235
|
+
_attribute$wordBreak2 = attribute.wordBreak;
|
|
10236
|
+
_attribute$wordBreak2 === void 0 ? textTheme.wordBreak : _attribute$wordBreak2;
|
|
10357
10237
|
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
10358
|
-
var
|
|
10359
|
-
return this._AABBBounds.set(
|
|
10238
|
+
var _bbox = this.cache.layoutData.bbox;
|
|
10239
|
+
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10360
10240
|
}
|
|
10361
10241
|
var textMeasure = application.graphicUtil.textMeasure,
|
|
10362
10242
|
layoutData = new CanvasTextLayout(fontFamily, {
|
|
@@ -20972,8 +20852,8 @@
|
|
|
20972
20852
|
this.name = 'tag';
|
|
20973
20853
|
}
|
|
20974
20854
|
render() {
|
|
20975
|
-
var _a;
|
|
20976
|
-
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state } = this.attribute;
|
|
20855
|
+
var _a, _b, _c;
|
|
20856
|
+
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state, type = 'text' } = this.attribute;
|
|
20977
20857
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
20978
20858
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
20979
20859
|
let symbol;
|
|
@@ -20995,75 +20875,100 @@
|
|
|
20995
20875
|
}
|
|
20996
20876
|
tagWidth += symbolPlaceWidth;
|
|
20997
20877
|
textX += symbolPlaceWidth;
|
|
20998
|
-
|
|
20999
|
-
if (
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21008
|
-
const textHeight = textBounds.height;
|
|
21009
|
-
tagWidth += textWidth;
|
|
21010
|
-
const size = (_a = shape.size) !== null && _a !== void 0 ? _a : 10;
|
|
21011
|
-
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
21012
|
-
tagHeight += Math.max(textHeight, (shape === null || shape === void 0 ? void 0 : shape.visible) ? maxSize : 0);
|
|
21013
|
-
const { textAlign, textBaseline } = textStyle;
|
|
21014
|
-
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
21015
|
-
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
21016
|
-
tagWidth = minWidth;
|
|
21017
|
-
}
|
|
21018
|
-
if (vutils.isValid(maxWidth) && tagWidth > maxWidth) {
|
|
21019
|
-
tagWidth = maxWidth;
|
|
21020
|
-
textShape.setAttribute('maxLineWidth', maxWidth - parsedPadding[1] - parsedPadding[2]);
|
|
21021
|
-
}
|
|
21022
|
-
}
|
|
21023
|
-
let x = 0;
|
|
21024
|
-
let y = 0;
|
|
21025
|
-
if (textAlign === 'center') {
|
|
21026
|
-
x -= tagWidth / 2;
|
|
21027
|
-
if (symbol) {
|
|
21028
|
-
symbol.setAttribute('x', (symbol.attribute.x || 0) - textWidth / 2);
|
|
20878
|
+
let textShape;
|
|
20879
|
+
if (type === 'rich') {
|
|
20880
|
+
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 });
|
|
20881
|
+
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
20882
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
20883
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
20884
|
+
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');
|
|
20885
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
20886
|
+
bgRect.states = state.panel;
|
|
20887
|
+
}
|
|
21029
20888
|
}
|
|
21030
|
-
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
21031
20889
|
}
|
|
21032
|
-
else if (
|
|
21033
|
-
x
|
|
21034
|
-
|
|
21035
|
-
|
|
20890
|
+
else if (type === 'html') {
|
|
20891
|
+
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 });
|
|
20892
|
+
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
20893
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
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
|
+
}
|
|
21036
20899
|
}
|
|
21037
|
-
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
21038
|
-
}
|
|
21039
|
-
else if (textAlign === 'left' || textAlign === 'start') {
|
|
21040
|
-
group.setAttribute('x', parsedPadding[3]);
|
|
21041
20900
|
}
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
if (
|
|
21045
|
-
|
|
20901
|
+
else {
|
|
20902
|
+
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 });
|
|
20903
|
+
if (vutils.isNil(textAttrs.lineHeight)) {
|
|
20904
|
+
textAttrs.lineHeight = textStyle.fontSize;
|
|
20905
|
+
}
|
|
20906
|
+
textShape = group.createOrUpdateChild('tag-text', textAttrs, 'text');
|
|
20907
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.text)) {
|
|
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
|
+
}
|
|
21046
20926
|
}
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
symbol
|
|
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);
|
|
21052
20935
|
}
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
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);
|
|
21059
20942
|
}
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
y
|
|
21065
|
-
|
|
21066
|
-
|
|
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
|
+
}
|
|
20951
|
+
}
|
|
20952
|
+
else if (textBaseline === 'bottom') {
|
|
20953
|
+
y -= tagHeight;
|
|
20954
|
+
if (symbol) {
|
|
20955
|
+
symbol.setAttribute('y', -textHeight / 2);
|
|
20956
|
+
}
|
|
20957
|
+
group.setAttribute('y', -parsedPadding[2]);
|
|
20958
|
+
}
|
|
20959
|
+
else if (textBaseline === 'top') {
|
|
20960
|
+
group.setAttribute('y', parsedPadding[0]);
|
|
20961
|
+
if (symbol) {
|
|
20962
|
+
symbol.setAttribute('y', textHeight / 2);
|
|
20963
|
+
}
|
|
20964
|
+
}
|
|
20965
|
+
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
20966
|
+
if (visible && vutils.isBoolean(bgVisible)) {
|
|
20967
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x,
|
|
20968
|
+
y, width: tagWidth, height: tagHeight }), 'rect');
|
|
20969
|
+
if (!vutils.isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
20970
|
+
bgRect.states = state.panel;
|
|
20971
|
+
}
|
|
21067
20972
|
}
|
|
21068
20973
|
}
|
|
21069
20974
|
}
|
|
@@ -22275,6 +22180,24 @@
|
|
|
22275
22180
|
target.states = state;
|
|
22276
22181
|
}
|
|
22277
22182
|
_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
|
+
}
|
|
22278
22201
|
const text = createText(attributes);
|
|
22279
22202
|
this._bindEvent(text);
|
|
22280
22203
|
this._setStatesOfText(text);
|
|
@@ -22501,7 +22424,7 @@
|
|
|
22501
22424
|
const prevTextMap = this._graphicToText || new Map();
|
|
22502
22425
|
const texts = [];
|
|
22503
22426
|
labels.forEach((text, index) => {
|
|
22504
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
22427
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
22505
22428
|
const labelLine = this._labelLine(text);
|
|
22506
22429
|
const relatedGraphic = this.getRelatedGrphic(text.attribute);
|
|
22507
22430
|
const textId = text.attribute.id;
|
|
@@ -22544,11 +22467,11 @@
|
|
|
22544
22467
|
}), duration, easing);
|
|
22545
22468
|
}
|
|
22546
22469
|
if (animationConfig.increaseEffect !== false &&
|
|
22547
|
-
prevText.attribute.text !== text.attribute.text &&
|
|
22548
|
-
vutils.isValidNumber(Number(prevText.attribute.text) * Number(text.attribute.text))) {
|
|
22470
|
+
((_h = prevText.attribute) === null || _h === void 0 ? void 0 : _h.text) !== ((_j = text.attribute) === null || _j === void 0 ? void 0 : _j.text) &&
|
|
22471
|
+
vutils.isValidNumber(Number((_k = prevText.attribute) === null || _k === void 0 ? void 0 : _k.text) * Number((_l = text.attribute) === null || _l === void 0 ? void 0 : _l.text))) {
|
|
22549
22472
|
prevText
|
|
22550
22473
|
.animate()
|
|
22551
|
-
.play(new IncreaseCount({ text: prevText.attribute.text }, { text: text.attribute.text }, duration, easing));
|
|
22474
|
+
.play(new IncreaseCount({ text: (_m = prevText.attribute) === null || _m === void 0 ? void 0 : _m.text }, { text: (_o = text.attribute) === null || _o === void 0 ? void 0 : _o.text }, duration, easing));
|
|
22552
22475
|
}
|
|
22553
22476
|
}
|
|
22554
22477
|
});
|
|
@@ -24220,12 +24143,26 @@
|
|
|
24220
24143
|
let textAlign = 'center';
|
|
24221
24144
|
let textBaseline = 'middle';
|
|
24222
24145
|
data.forEach((item, index) => {
|
|
24223
|
-
var _a, _b;
|
|
24146
|
+
var _a, _b, _c, _d;
|
|
24224
24147
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
24225
|
-
|
|
24148
|
+
let text;
|
|
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
|
+
}
|
|
24226
24163
|
text.name = exports.AXIS_ELEMENT_NAME.label;
|
|
24227
24164
|
text.id = this._getNodeId(`layer${layer}-label-${item.id}`);
|
|
24228
|
-
if (vutils.isEmpty((
|
|
24165
|
+
if (vutils.isEmpty((_c = this.attribute.label) === null || _c === void 0 ? void 0 : _c.state)) {
|
|
24229
24166
|
text.states = DEFAULT_STATES$2;
|
|
24230
24167
|
}
|
|
24231
24168
|
else {
|
|
@@ -24238,7 +24175,7 @@
|
|
|
24238
24175
|
text.states = labelState;
|
|
24239
24176
|
}
|
|
24240
24177
|
labelGroup.add(text);
|
|
24241
|
-
const angle = (
|
|
24178
|
+
const angle = (_d = labelStyle.angle) !== null && _d !== void 0 ? _d : 0;
|
|
24242
24179
|
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width());
|
|
24243
24180
|
maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height());
|
|
24244
24181
|
if (angle) {
|
|
@@ -24387,7 +24324,7 @@
|
|
|
24387
24324
|
}
|
|
24388
24325
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
24389
24326
|
var _a, _b, _c, _d, _e, _f;
|
|
24390
|
-
const _g = this.attribute.label, { space = 4, inside = false, formatMethod } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod"]);
|
|
24327
|
+
const _g = this.attribute.label, { space = 4, inside = false, formatMethod, type = 'text', text } = _g, tagAttributes = __rest(_g, ["space", "inside", "formatMethod", "type", "text"]);
|
|
24391
24328
|
let offset = space;
|
|
24392
24329
|
let tickLength = 0;
|
|
24393
24330
|
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) {
|
|
@@ -24408,7 +24345,9 @@
|
|
|
24408
24345
|
}
|
|
24409
24346
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside);
|
|
24410
24347
|
const vector = this.getVerticalVector(offset, inside, point);
|
|
24411
|
-
const
|
|
24348
|
+
const textContent = formatMethod
|
|
24349
|
+
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
24350
|
+
: tickDatum.label;
|
|
24412
24351
|
let { style: textStyle } = tagAttributes;
|
|
24413
24352
|
textStyle = vutils.isFunction(textStyle)
|
|
24414
24353
|
? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
|
|
@@ -24423,7 +24362,7 @@
|
|
|
24423
24362
|
layer
|
|
24424
24363
|
});
|
|
24425
24364
|
}
|
|
24426
|
-
return Object.assign(Object.assign(Object.assign({}, this.getLabelPosition(point, vector,
|
|
24365
|
+
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);
|
|
24427
24366
|
}
|
|
24428
24367
|
getLabelPosition(point, vector, text, style) {
|
|
24429
24368
|
return point;
|
|
@@ -25161,7 +25100,7 @@
|
|
|
25161
25100
|
let titleSpacing = 0;
|
|
25162
25101
|
const axisLineWidth = (line === null || line === void 0 ? void 0 : line.visible) ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
25163
25102
|
const tickLength = (tick === null || tick === void 0 ? void 0 : tick.visible) ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
25164
|
-
if (title === null || title === void 0 ? void 0 : title.visible) {
|
|
25103
|
+
if ((title === null || title === void 0 ? void 0 : title.visible) && typeof title.text === 'string') {
|
|
25165
25104
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
25166
25105
|
const padding = vutils.normalizePadding(title.padding);
|
|
25167
25106
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -25956,6 +25895,13 @@
|
|
|
25956
25895
|
}
|
|
25957
25896
|
vutils.mixin(CircleAxisGrid, CircleAxisMixin);
|
|
25958
25897
|
|
|
25898
|
+
var DataZoomActiveTag;
|
|
25899
|
+
(function (DataZoomActiveTag) {
|
|
25900
|
+
DataZoomActiveTag["startHandler"] = "startHandler";
|
|
25901
|
+
DataZoomActiveTag["endHandler"] = "endHandler";
|
|
25902
|
+
DataZoomActiveTag["middleHandler"] = "middleHandler";
|
|
25903
|
+
DataZoomActiveTag["background"] = "background";
|
|
25904
|
+
})(DataZoomActiveTag || (DataZoomActiveTag = {}));
|
|
25959
25905
|
const DEFAULT_DATA_ZOOM_ATTRIBUTES = {
|
|
25960
25906
|
orient: 'bottom',
|
|
25961
25907
|
showDetail: 'auto',
|
|
@@ -26054,14 +26000,6 @@
|
|
|
26054
26000
|
}
|
|
26055
26001
|
};
|
|
26056
26002
|
|
|
26057
|
-
exports.DataZoomActiveTag = void 0;
|
|
26058
|
-
(function (DataZoomActiveTag) {
|
|
26059
|
-
DataZoomActiveTag["startHandler"] = "startHandler";
|
|
26060
|
-
DataZoomActiveTag["endHandler"] = "endHandler";
|
|
26061
|
-
DataZoomActiveTag["middleHandler"] = "middleHandler";
|
|
26062
|
-
DataZoomActiveTag["background"] = "background";
|
|
26063
|
-
})(exports.DataZoomActiveTag || (exports.DataZoomActiveTag = {}));
|
|
26064
|
-
|
|
26065
26003
|
const delayMap$1 = {
|
|
26066
26004
|
debounce: vutils.debounce,
|
|
26067
26005
|
throttle: vutils.throttle
|
|
@@ -26089,23 +26027,23 @@
|
|
|
26089
26027
|
this._onHandlerPointerDown = (e, tag) => {
|
|
26090
26028
|
e.stopPropagation();
|
|
26091
26029
|
if (tag === 'start') {
|
|
26092
|
-
this._activeTag =
|
|
26030
|
+
this._activeTag = DataZoomActiveTag.startHandler;
|
|
26093
26031
|
this._activeItem = this._startHandler;
|
|
26094
26032
|
}
|
|
26095
26033
|
else if (tag === 'end') {
|
|
26096
|
-
this._activeTag =
|
|
26034
|
+
this._activeTag = DataZoomActiveTag.endHandler;
|
|
26097
26035
|
this._activeItem = this._endHandler;
|
|
26098
26036
|
}
|
|
26099
26037
|
else if (tag === 'middleRect') {
|
|
26100
|
-
this._activeTag =
|
|
26038
|
+
this._activeTag = DataZoomActiveTag.middleHandler;
|
|
26101
26039
|
this._activeItem = this._middleHandlerRect;
|
|
26102
26040
|
}
|
|
26103
26041
|
else if (tag === 'middleSymbol') {
|
|
26104
|
-
this._activeTag =
|
|
26042
|
+
this._activeTag = DataZoomActiveTag.middleHandler;
|
|
26105
26043
|
this._activeItem = this._middleHandlerSymbol;
|
|
26106
26044
|
}
|
|
26107
26045
|
else if (tag === 'background') {
|
|
26108
|
-
this._activeTag =
|
|
26046
|
+
this._activeTag = DataZoomActiveTag.background;
|
|
26109
26047
|
this._activeItem = this._background;
|
|
26110
26048
|
}
|
|
26111
26049
|
this._activeState = true;
|
|
@@ -26113,7 +26051,6 @@
|
|
|
26113
26051
|
this._activeCache.lastPos = this.eventPosToStagePos(e);
|
|
26114
26052
|
};
|
|
26115
26053
|
this._onHandlerPointerMove = (e) => {
|
|
26116
|
-
var _a;
|
|
26117
26054
|
e.stopPropagation();
|
|
26118
26055
|
const { start: startAttr, end: endAttr, brushSelect, realTime = true } = this.attribute;
|
|
26119
26056
|
const pos = this.eventPosToStagePos(e);
|
|
@@ -26121,24 +26058,24 @@
|
|
|
26121
26058
|
const dis = (pos[attPos] - this._activeCache.lastPos[attPos]) / max;
|
|
26122
26059
|
let { start, end } = this.state;
|
|
26123
26060
|
if (this._activeState) {
|
|
26124
|
-
if (this._activeTag ===
|
|
26061
|
+
if (this._activeTag === DataZoomActiveTag.middleHandler) {
|
|
26125
26062
|
this.moveZoomWithMiddle((this.state.start + this.state.end) / 2 + dis);
|
|
26126
26063
|
}
|
|
26127
|
-
else if (this._activeTag ===
|
|
26064
|
+
else if (this._activeTag === DataZoomActiveTag.startHandler) {
|
|
26128
26065
|
if (start + dis > end) {
|
|
26129
26066
|
start = end;
|
|
26130
26067
|
end = start + dis;
|
|
26131
|
-
this._activeTag =
|
|
26068
|
+
this._activeTag = DataZoomActiveTag.endHandler;
|
|
26132
26069
|
}
|
|
26133
26070
|
else {
|
|
26134
26071
|
start = start + dis;
|
|
26135
26072
|
}
|
|
26136
26073
|
}
|
|
26137
|
-
else if (this._activeTag ===
|
|
26074
|
+
else if (this._activeTag === DataZoomActiveTag.endHandler) {
|
|
26138
26075
|
if (end + dis < start) {
|
|
26139
26076
|
end = start;
|
|
26140
26077
|
start = end + dis;
|
|
26141
|
-
this._activeTag =
|
|
26078
|
+
this._activeTag = DataZoomActiveTag.startHandler;
|
|
26142
26079
|
}
|
|
26143
26080
|
else {
|
|
26144
26081
|
end = end + dis;
|
|
@@ -26151,7 +26088,7 @@
|
|
|
26151
26088
|
end = Math.min(Math.max(end, 0), 1);
|
|
26152
26089
|
if (startAttr !== start || endAttr !== end) {
|
|
26153
26090
|
this.setStateAttr(start, end, true);
|
|
26154
|
-
realTime &&
|
|
26091
|
+
realTime && this._updateStateCallback && this._updateStateCallback(start, end);
|
|
26155
26092
|
this._dispatchChangeEvent(start, end);
|
|
26156
26093
|
}
|
|
26157
26094
|
};
|
|
@@ -26256,11 +26193,10 @@
|
|
|
26256
26193
|
};
|
|
26257
26194
|
}
|
|
26258
26195
|
_onHandlerPointerUp(e) {
|
|
26259
|
-
var _a;
|
|
26260
26196
|
e.preventDefault();
|
|
26261
26197
|
const { start, end, brushSelect, realTime = true } = this.attribute;
|
|
26262
26198
|
if (this._activeState) {
|
|
26263
|
-
if (this._activeTag ===
|
|
26199
|
+
if (this._activeTag === DataZoomActiveTag.background) {
|
|
26264
26200
|
const pos = this.eventPosToStagePos(e);
|
|
26265
26201
|
this.backgroundDragZoom(this._activeCache.startPos, pos);
|
|
26266
26202
|
}
|
|
@@ -26269,7 +26205,7 @@
|
|
|
26269
26205
|
brushSelect && this.renderDragMask();
|
|
26270
26206
|
if (!realTime || start !== this.state.start || end !== this.state.end) {
|
|
26271
26207
|
this.setStateAttr(this.state.start, this.state.end, true);
|
|
26272
|
-
|
|
26208
|
+
this._updateStateCallback && this._updateStateCallback(this.state.start, this.state.end);
|
|
26273
26209
|
this._dispatchChangeEvent(this.state.start, this.state.end);
|
|
26274
26210
|
}
|
|
26275
26211
|
}
|
|
@@ -26319,11 +26255,11 @@
|
|
|
26319
26255
|
const { dragMaskStyle } = this.attribute;
|
|
26320
26256
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
26321
26257
|
if (this._isHorizontal) {
|
|
26322
|
-
this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.x : this._activeCache.startPos.x, position.x, position.x + width), y: position.y, width: (this._activeState && this._activeTag ===
|
|
26258
|
+
this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.x : this._activeCache.startPos.x, position.x, position.x + width), y: position.y, width: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
|
|
26323
26259
|
0, height }, dragMaskStyle), 'rect');
|
|
26324
26260
|
}
|
|
26325
26261
|
else {
|
|
26326
|
-
this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.y : this._activeCache.startPos.y, position.y, position.y + height), width, height: (this._activeState && this._activeTag ===
|
|
26262
|
+
this._dragMask = this._container.createOrUpdateChild('dragMask', Object.assign({ x: position.x, y: vutils.clamp(this.dragMaskSize() < 0 ? this._activeCache.lastPos.y : this._activeCache.startPos.y, position.y, position.y + height), width, height: (this._activeState && this._activeTag === DataZoomActiveTag.background && Math.abs(this.dragMaskSize())) ||
|
|
26327
26263
|
0 }, dragMaskStyle), 'rect');
|
|
26328
26264
|
}
|
|
26329
26265
|
}
|
|
@@ -26642,14 +26578,13 @@
|
|
|
26642
26578
|
this.dispatchEvent(changeEvent);
|
|
26643
26579
|
}
|
|
26644
26580
|
setStartAndEnd(start, end) {
|
|
26645
|
-
var _a;
|
|
26646
26581
|
const { start: startAttr, end: endAttr } = this.attribute;
|
|
26647
26582
|
if (vutils.isValid(start) && vutils.isValid(end) && (start !== this.state.start || end !== this.state.end)) {
|
|
26648
26583
|
this.state.start = start;
|
|
26649
26584
|
this.state.end = end;
|
|
26650
26585
|
if (startAttr !== this.state.start || endAttr !== this.state.end) {
|
|
26651
26586
|
this.setStateAttr(start, end, true);
|
|
26652
|
-
|
|
26587
|
+
this._updateStateCallback && this._updateStateCallback(start, end);
|
|
26653
26588
|
this._dispatchChangeEvent(start, end);
|
|
26654
26589
|
}
|
|
26655
26590
|
}
|
|
@@ -29373,19 +29308,27 @@
|
|
|
29373
29308
|
this.name = 'title';
|
|
29374
29309
|
}
|
|
29375
29310
|
render() {
|
|
29376
|
-
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;
|
|
29377
|
-
const { text, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
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, _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;
|
|
29312
|
+
const { textType, text, subtextType, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
29378
29313
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
29379
29314
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
29380
29315
|
if (((_a = this.attribute) === null || _a === void 0 ? void 0 : _a.visible) !== false && (textStyle === null || textStyle === void 0 ? void 0 : textStyle.visible) !== false) {
|
|
29381
|
-
if (
|
|
29316
|
+
if (textType === 'rich') {
|
|
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)) {
|
|
29382
29325
|
const attr = {
|
|
29383
|
-
x: (
|
|
29384
|
-
y: (
|
|
29385
|
-
width: (
|
|
29386
|
-
height: (
|
|
29387
|
-
ellipsis: (
|
|
29388
|
-
wordBreak: (
|
|
29326
|
+
x: (_t = textStyle.x) !== null && _t !== void 0 ? _t : 0,
|
|
29327
|
+
y: (_u = textStyle.y) !== null && _u !== void 0 ? _u : 0,
|
|
29328
|
+
width: (_w = (_v = textStyle.width) !== null && _v !== void 0 ? _v : width) !== null && _w !== void 0 ? _w : 0,
|
|
29329
|
+
height: (_y = (_x = textStyle.height) !== null && _x !== void 0 ? _x : height) !== null && _y !== void 0 ? _y : 0,
|
|
29330
|
+
ellipsis: (_z = textStyle.ellipsis) !== null && _z !== void 0 ? _z : true,
|
|
29331
|
+
wordBreak: (_0 = textStyle.wordBreak) !== null && _0 !== void 0 ? _0 : 'break-word',
|
|
29389
29332
|
maxHeight: textStyle.maxHeight,
|
|
29390
29333
|
maxWidth: textStyle.maxWidth,
|
|
29391
29334
|
textConfig: textStyle.character
|
|
@@ -29393,20 +29336,28 @@
|
|
|
29393
29336
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29394
29337
|
}
|
|
29395
29338
|
else if (vutils.isValid(text)) {
|
|
29396
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (
|
|
29339
|
+
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');
|
|
29397
29340
|
}
|
|
29398
29341
|
}
|
|
29399
|
-
const maintextHeight = this._mainTitle ? (
|
|
29400
|
-
const maintextWidth = this._mainTitle ? (
|
|
29401
|
-
if (((
|
|
29402
|
-
if (
|
|
29342
|
+
const maintextHeight = this._mainTitle ? (_3 = this._mainTitle) === null || _3 === void 0 ? void 0 : _3.AABBBounds.height() : 0;
|
|
29343
|
+
const maintextWidth = this._mainTitle ? (_4 = this._mainTitle) === null || _4 === void 0 ? void 0 : _4.AABBBounds.width() : 0;
|
|
29344
|
+
if (((_5 = this.attribute) === null || _5 === void 0 ? void 0 : _5.visible) !== false && (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.visible) !== false) {
|
|
29345
|
+
if (subtextType === 'rich') {
|
|
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)) {
|
|
29403
29354
|
const attr = {
|
|
29404
|
-
x: (
|
|
29405
|
-
y: (
|
|
29406
|
-
width: (
|
|
29407
|
-
height: (
|
|
29408
|
-
ellipsis: (
|
|
29409
|
-
wordBreak: (
|
|
29355
|
+
x: (_22 = subtextStyle.x) !== null && _22 !== void 0 ? _22 : 0,
|
|
29356
|
+
y: (_23 = subtextStyle.y) !== null && _23 !== void 0 ? _23 : maintextHeight,
|
|
29357
|
+
width: (_25 = (_24 = subtextStyle.width) !== null && _24 !== void 0 ? _24 : width) !== null && _25 !== void 0 ? _25 : 0,
|
|
29358
|
+
height: (_27 = (_26 = subtextStyle.height) !== null && _26 !== void 0 ? _26 : height) !== null && _27 !== void 0 ? _27 : 0,
|
|
29359
|
+
ellipsis: (_28 = subtextStyle.ellipsis) !== null && _28 !== void 0 ? _28 : true,
|
|
29360
|
+
wordBreak: (_29 = subtextStyle.wordBreak) !== null && _29 !== void 0 ? _29 : 'break-word',
|
|
29410
29361
|
maxHeight: subtextStyle.maxHeight,
|
|
29411
29362
|
maxWidth: subtextStyle.maxWidth,
|
|
29412
29363
|
textConfig: subtextStyle.character
|
|
@@ -29414,17 +29365,17 @@
|
|
|
29414
29365
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29415
29366
|
}
|
|
29416
29367
|
else if (vutils.isValid(subtext)) {
|
|
29417
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (
|
|
29368
|
+
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');
|
|
29418
29369
|
}
|
|
29419
29370
|
}
|
|
29420
|
-
const subtextHeight = this._subTitle ? (
|
|
29421
|
-
const subtextWidth = this._subTitle ? (
|
|
29371
|
+
const subtextHeight = this._subTitle ? (_32 = this._subTitle) === null || _32 === void 0 ? void 0 : _32.AABBBounds.height() : 0;
|
|
29372
|
+
const subtextWidth = this._subTitle ? (_33 = this._subTitle) === null || _33 === void 0 ? void 0 : _33.AABBBounds.width() : 0;
|
|
29422
29373
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
29423
|
-
let titleHeight = maintextHeight + ((
|
|
29374
|
+
let titleHeight = maintextHeight + ((_34 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _34 !== void 0 ? _34 : subtextHeight);
|
|
29424
29375
|
if (vutils.isValid(width)) {
|
|
29425
29376
|
titleWidth = width;
|
|
29426
|
-
(
|
|
29427
|
-
(
|
|
29377
|
+
(_35 = this._mainTitle) === null || _35 === void 0 ? void 0 : _35.setAttribute('maxLineWidth', width);
|
|
29378
|
+
(_36 = this._subTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('maxLineWidth', width);
|
|
29428
29379
|
}
|
|
29429
29380
|
if (vutils.isValid(height)) {
|
|
29430
29381
|
titleHeight = height;
|
|
@@ -29433,10 +29384,10 @@
|
|
|
29433
29384
|
titleWidth = minWidth;
|
|
29434
29385
|
}
|
|
29435
29386
|
if (vutils.isValid(maxWidth)) {
|
|
29436
|
-
(
|
|
29437
|
-
(
|
|
29438
|
-
(
|
|
29439
|
-
(
|
|
29387
|
+
(_37 = this._mainTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('maxLineWidth', maxWidth);
|
|
29388
|
+
(_38 = this._subTitle) === null || _38 === void 0 ? void 0 : _38.setAttribute('maxLineWidth', maxWidth);
|
|
29389
|
+
(_39 = this._mainTitle) === null || _39 === void 0 ? void 0 : _39.setAttribute('maxWidth', maxWidth);
|
|
29390
|
+
(_40 = this._subTitle) === null || _40 === void 0 ? void 0 : _40.setAttribute('maxWidth', maxWidth);
|
|
29440
29391
|
if (titleWidth > maxWidth) {
|
|
29441
29392
|
titleWidth = maxWidth;
|
|
29442
29393
|
}
|
|
@@ -29445,8 +29396,8 @@
|
|
|
29445
29396
|
titleHeight = minHeight;
|
|
29446
29397
|
}
|
|
29447
29398
|
if (vutils.isValid(maxHeight)) {
|
|
29448
|
-
(
|
|
29449
|
-
(
|
|
29399
|
+
(_41 = this._mainTitle) === null || _41 === void 0 ? void 0 : _41.setAttribute('maxHeight', maxHeight);
|
|
29400
|
+
(_42 = this._subTitle) === null || _42 === void 0 ? void 0 : _42.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
29450
29401
|
if (titleHeight > maxHeight) {
|
|
29451
29402
|
titleHeight = maxHeight;
|
|
29452
29403
|
}
|
|
@@ -29456,67 +29407,67 @@
|
|
|
29456
29407
|
group.attribute.boundsPadding = parsedPadding;
|
|
29457
29408
|
if (vutils.isValid(align) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.align)) {
|
|
29458
29409
|
const mainTitleAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.align) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.align : align;
|
|
29459
|
-
const mainTitleWidth = (
|
|
29410
|
+
const mainTitleWidth = (_43 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _43 !== void 0 ? _43 : maintextWidth;
|
|
29460
29411
|
if (mainTitleAlign === 'left') {
|
|
29461
|
-
(
|
|
29462
|
-
(
|
|
29412
|
+
(_44 = this._mainTitle) === null || _44 === void 0 ? void 0 : _44.setAttribute('x', 0);
|
|
29413
|
+
(_45 = this._mainTitle) === null || _45 === void 0 ? void 0 : _45.setAttribute('textAlign', 'left');
|
|
29463
29414
|
}
|
|
29464
29415
|
else if (mainTitleAlign === 'center') {
|
|
29465
|
-
(
|
|
29466
|
-
(
|
|
29416
|
+
(_46 = this._mainTitle) === null || _46 === void 0 ? void 0 : _46.setAttribute('x', mainTitleWidth / 2);
|
|
29417
|
+
(_47 = this._mainTitle) === null || _47 === void 0 ? void 0 : _47.setAttribute('textAlign', 'center');
|
|
29467
29418
|
}
|
|
29468
29419
|
else if (mainTitleAlign === 'right') {
|
|
29469
|
-
(
|
|
29470
|
-
(
|
|
29420
|
+
(_48 = this._mainTitle) === null || _48 === void 0 ? void 0 : _48.setAttribute('x', mainTitleWidth);
|
|
29421
|
+
(_49 = this._mainTitle) === null || _49 === void 0 ? void 0 : _49.setAttribute('textAlign', 'right');
|
|
29471
29422
|
}
|
|
29472
29423
|
}
|
|
29473
29424
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29474
29425
|
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
29475
29426
|
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
29476
29427
|
if (mainTitleVerticalAlign === 'top') {
|
|
29477
|
-
(
|
|
29478
|
-
(
|
|
29428
|
+
(_50 = this._mainTitle) === null || _50 === void 0 ? void 0 : _50.setAttribute('y', 0);
|
|
29429
|
+
(_51 = this._mainTitle) === null || _51 === void 0 ? void 0 : _51.setAttribute('textBaseline', 'top');
|
|
29479
29430
|
}
|
|
29480
29431
|
else if (mainTitleVerticalAlign === 'middle') {
|
|
29481
|
-
(
|
|
29482
|
-
(
|
|
29432
|
+
(_52 = this._mainTitle) === null || _52 === void 0 ? void 0 : _52.setAttribute('y', mainTitleHeight / 2);
|
|
29433
|
+
(_53 = this._mainTitle) === null || _53 === void 0 ? void 0 : _53.setAttribute('textBaseline', 'middle');
|
|
29483
29434
|
}
|
|
29484
29435
|
else if (mainTitleVerticalAlign === 'bottom') {
|
|
29485
|
-
(
|
|
29486
|
-
(
|
|
29436
|
+
(_54 = this._mainTitle) === null || _54 === void 0 ? void 0 : _54.setAttribute('y', mainTitleHeight);
|
|
29437
|
+
(_55 = this._mainTitle) === null || _55 === void 0 ? void 0 : _55.setAttribute('textBaseline', 'bottom');
|
|
29487
29438
|
}
|
|
29488
29439
|
}
|
|
29489
29440
|
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
29490
29441
|
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
29491
|
-
const subTitleWidth = (
|
|
29442
|
+
const subTitleWidth = (_56 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _56 !== void 0 ? _56 : subtextWidth;
|
|
29492
29443
|
if (subTitleAlign === 'left') {
|
|
29493
|
-
(
|
|
29494
|
-
(
|
|
29444
|
+
(_57 = this._subTitle) === null || _57 === void 0 ? void 0 : _57.setAttribute('x', 0);
|
|
29445
|
+
(_58 = this._subTitle) === null || _58 === void 0 ? void 0 : _58.setAttribute('textAlign', 'left');
|
|
29495
29446
|
}
|
|
29496
29447
|
else if (subTitleAlign === 'center') {
|
|
29497
|
-
(
|
|
29498
|
-
(
|
|
29448
|
+
(_59 = this._subTitle) === null || _59 === void 0 ? void 0 : _59.setAttribute('x', subTitleWidth / 2);
|
|
29449
|
+
(_60 = this._subTitle) === null || _60 === void 0 ? void 0 : _60.setAttribute('textAlign', 'center');
|
|
29499
29450
|
}
|
|
29500
29451
|
else if (subTitleAlign === 'right') {
|
|
29501
|
-
(
|
|
29502
|
-
(
|
|
29452
|
+
(_61 = this._subTitle) === null || _61 === void 0 ? void 0 : _61.setAttribute('x', subTitleWidth);
|
|
29453
|
+
(_62 = this._subTitle) === null || _62 === void 0 ? void 0 : _62.setAttribute('textAlign', 'right');
|
|
29503
29454
|
}
|
|
29504
29455
|
}
|
|
29505
29456
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29506
29457
|
const subTitleVerticalAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign : verticalAlign;
|
|
29507
29458
|
const subTitleYStart = maintextHeight;
|
|
29508
|
-
const subTitleHeight = (
|
|
29459
|
+
const subTitleHeight = (_63 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _63 !== void 0 ? _63 : 0;
|
|
29509
29460
|
if (subTitleVerticalAlign === 'top') {
|
|
29510
|
-
(
|
|
29511
|
-
(
|
|
29461
|
+
(_64 = this._subTitle) === null || _64 === void 0 ? void 0 : _64.setAttribute('y', subTitleYStart);
|
|
29462
|
+
(_65 = this._subTitle) === null || _65 === void 0 ? void 0 : _65.setAttribute('textBaseline', 'top');
|
|
29512
29463
|
}
|
|
29513
29464
|
else if (subTitleVerticalAlign === 'middle') {
|
|
29514
|
-
(
|
|
29515
|
-
(
|
|
29465
|
+
(_66 = this._subTitle) === null || _66 === void 0 ? void 0 : _66.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
29466
|
+
(_67 = this._subTitle) === null || _67 === void 0 ? void 0 : _67.setAttribute('textBaseline', 'middle');
|
|
29516
29467
|
}
|
|
29517
29468
|
else if (subTitleVerticalAlign === 'bottom') {
|
|
29518
|
-
(
|
|
29519
|
-
(
|
|
29469
|
+
(_68 = this._subTitle) === null || _68 === void 0 ? void 0 : _68.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
29470
|
+
(_69 = this._subTitle) === null || _69 === void 0 ? void 0 : _69.setAttribute('textBaseline', 'bottom');
|
|
29520
29471
|
}
|
|
29521
29472
|
}
|
|
29522
29473
|
}
|
|
@@ -29571,7 +29522,7 @@
|
|
|
29571
29522
|
this.name = 'indicator';
|
|
29572
29523
|
}
|
|
29573
29524
|
render() {
|
|
29574
|
-
var _a;
|
|
29525
|
+
var _a, _b, _c;
|
|
29575
29526
|
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
29576
29527
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
29577
29528
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
@@ -29582,7 +29533,15 @@
|
|
|
29582
29533
|
if (vutils.isValid(title)) {
|
|
29583
29534
|
if (title.visible !== false) {
|
|
29584
29535
|
const titleStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
|
|
29585
|
-
|
|
29536
|
+
if (titleStyle.type === 'rich') {
|
|
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
|
+
}
|
|
29586
29545
|
if (title.autoFit && vutils.isValidNumber(limit)) {
|
|
29587
29546
|
this._setAutoFit(limit, this._title, title);
|
|
29588
29547
|
}
|
|
@@ -29603,9 +29562,19 @@
|
|
|
29603
29562
|
const contentComponents = [];
|
|
29604
29563
|
let lastContentHeight = 0;
|
|
29605
29564
|
contents.forEach((contentItem, i) => {
|
|
29565
|
+
var _a, _b;
|
|
29606
29566
|
if (contentItem.visible !== false) {
|
|
29607
29567
|
const contentStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);
|
|
29608
|
-
|
|
29568
|
+
let contentComponent;
|
|
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
|
+
}
|
|
29609
29578
|
if (contentItem.autoFit && vutils.isValidNumber(limit)) {
|
|
29610
29579
|
this._setAutoFit(limit, contentComponent, contentItem);
|
|
29611
29580
|
}
|
|
@@ -29623,7 +29592,7 @@
|
|
|
29623
29592
|
});
|
|
29624
29593
|
this._content = contentComponents;
|
|
29625
29594
|
}
|
|
29626
|
-
const totalHeight = (
|
|
29595
|
+
const totalHeight = (_c = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _c !== void 0 ? _c : 0;
|
|
29627
29596
|
group.setAttribute('y', size.height / 2 - totalHeight / 2);
|
|
29628
29597
|
group.setAttribute('x', size.width / 2);
|
|
29629
29598
|
}
|
|
@@ -30982,7 +30951,13 @@
|
|
|
30982
30951
|
this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, vutils.merge({ symbolType: 'circle' }, titleAttr.shape, {
|
|
30983
30952
|
visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
|
|
30984
30953
|
}), 'symbol');
|
|
30985
|
-
if (titleAttr.value.
|
|
30954
|
+
if (titleAttr.value.type === 'rich') {
|
|
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) {
|
|
30986
30961
|
this._tooltipTitle = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_VALUE_NAME_SUFFIX}`, Object.assign({ visible: isVisible(titleAttr) && isVisible(titleAttr.value) }, getRichTextAttribute(titleAttr.value)), 'richtext');
|
|
30987
30962
|
}
|
|
30988
30963
|
else {
|
|
@@ -31408,7 +31383,7 @@
|
|
|
31408
31383
|
}
|
|
31409
31384
|
};
|
|
31410
31385
|
|
|
31411
|
-
const version = "0.16.14-alpha.
|
|
31386
|
+
const version = "0.16.14-alpha.4";
|
|
31412
31387
|
|
|
31413
31388
|
exports.AbstractComponent = AbstractComponent;
|
|
31414
31389
|
exports.ArcInfo = ArcInfo;
|