@visactor/vrender-components 0.16.14-alpha.3 → 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/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/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 +27 -2
- 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/cjs/util/text.d.ts +1 -3
- package/cjs/util/text.js +1 -3
- package/cjs/util/text.js.map +1 -1
- package/dist/index.js +393 -418
- package/dist/index.min.js +1 -1
- package/es/axis/base.js +23 -11
- package/es/axis/base.js.map +1 -1
- package/es/axis/line.js +1 -1
- package/es/axis/line.js.map +1 -1
- package/es/axis/type.d.ts +6 -3
- package/es/axis/type.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/indicator/indicator.js +50 -6
- package/es/indicator/indicator.js.map +1 -1
- package/es/indicator/type.d.ts +5 -2
- package/es/indicator/type.js.map +1 -1
- package/es/label/arc.d.ts +4 -3
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +11 -11
- package/es/label/base.js +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/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 +28 -3
- 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/es/util/text.d.ts +1 -3
- package/es/util/text.js +2 -4
- package/es/util/text.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,
|
|
@@ -5348,137 +5345,6 @@
|
|
|
5348
5345
|
return containPath(commands, lineWidth, !0, x, y);
|
|
5349
5346
|
}
|
|
5350
5347
|
|
|
5351
|
-
var Edge;
|
|
5352
|
-
!function (Edge) {
|
|
5353
|
-
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
5354
|
-
}(Edge || (Edge = {}));
|
|
5355
|
-
var _strokeVec4 = [!1, !1, !1, !1];
|
|
5356
|
-
var parseStroke = function parseStroke(stroke) {
|
|
5357
|
-
var _a;
|
|
5358
|
-
var isFullStroke = !0;
|
|
5359
|
-
if (vutils.isBoolean(stroke, !0)) {
|
|
5360
|
-
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
5361
|
-
isFullStroke = stroke;
|
|
5362
|
-
} else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
|
|
5363
|
-
return {
|
|
5364
|
-
isFullStroke: isFullStroke,
|
|
5365
|
-
stroke: _strokeVec4
|
|
5366
|
-
};
|
|
5367
|
-
};
|
|
5368
|
-
var _paddingVec4 = [0, 0, 0, 0];
|
|
5369
|
-
var parsePadding = function parsePadding(padding) {
|
|
5370
|
-
return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
|
|
5371
|
-
};
|
|
5372
|
-
var _coords = [{
|
|
5373
|
-
x: 0,
|
|
5374
|
-
y: 0
|
|
5375
|
-
}, {
|
|
5376
|
-
x: 0,
|
|
5377
|
-
y: 0
|
|
5378
|
-
}, {
|
|
5379
|
-
x: 0,
|
|
5380
|
-
y: 0
|
|
5381
|
-
}, {
|
|
5382
|
-
x: 0,
|
|
5383
|
-
y: 0
|
|
5384
|
-
}],
|
|
5385
|
-
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
5386
|
-
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
5387
|
-
for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
|
|
5388
|
-
for (; startAngle < 0;) startAngle += vutils.pi2;
|
|
5389
|
-
for (; startAngle > endAngle;) endAngle += vutils.pi2;
|
|
5390
|
-
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
5391
|
-
var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
|
|
5392
|
-
endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
|
|
5393
|
-
if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
|
|
5394
|
-
var match = !1;
|
|
5395
|
-
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
5396
|
-
if (match && endIdx === indexList[i]) break;
|
|
5397
|
-
if (match) {
|
|
5398
|
-
var p = _coords[indexList[i]];
|
|
5399
|
-
bounds.add(p.x, p.y);
|
|
5400
|
-
}
|
|
5401
|
-
} else {
|
|
5402
|
-
match = !0;
|
|
5403
|
-
var _p = _coords[startIdx];
|
|
5404
|
-
bounds.add(_p.x, _p.y);
|
|
5405
|
-
}
|
|
5406
|
-
}
|
|
5407
|
-
}
|
|
5408
|
-
function pointInterpolation(pointA, pointB, ratio) {
|
|
5409
|
-
var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
5410
|
-
x = _pointAt.x,
|
|
5411
|
-
y = _pointAt.y,
|
|
5412
|
-
_pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
5413
|
-
x1 = _pointAt2.x,
|
|
5414
|
-
y1 = _pointAt2.y,
|
|
5415
|
-
point = new vutils.Point(x, y, x1, y1);
|
|
5416
|
-
return point.defined = pointB.defined, point;
|
|
5417
|
-
}
|
|
5418
|
-
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
5419
|
-
if (!pointsA || !pointsB) return [];
|
|
5420
|
-
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
5421
|
-
var points = [];
|
|
5422
|
-
if (pointsA.length > pointsB.length) {
|
|
5423
|
-
points = pointsB.map(function (point) {
|
|
5424
|
-
var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
|
|
5425
|
-
return p.defined = point.defined, p;
|
|
5426
|
-
});
|
|
5427
|
-
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
5428
|
-
} else {
|
|
5429
|
-
points = pointsB.map(function (point) {
|
|
5430
|
-
var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
|
|
5431
|
-
return p.defined = point.defined, p;
|
|
5432
|
-
});
|
|
5433
|
-
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
5434
|
-
}
|
|
5435
|
-
return points;
|
|
5436
|
-
}
|
|
5437
|
-
function getAttributeFromDefaultAttrList(attr, key) {
|
|
5438
|
-
if (vutils.isArray(attr)) {
|
|
5439
|
-
var val;
|
|
5440
|
-
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
5441
|
-
return val;
|
|
5442
|
-
}
|
|
5443
|
-
return attr[key];
|
|
5444
|
-
}
|
|
5445
|
-
var RafBasedSTO = /*#__PURE__*/function () {
|
|
5446
|
-
function RafBasedSTO() {
|
|
5447
|
-
_classCallCheck(this, RafBasedSTO);
|
|
5448
|
-
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
5449
|
-
}
|
|
5450
|
-
_createClass(RafBasedSTO, [{
|
|
5451
|
-
key: "call",
|
|
5452
|
-
value: function call(cb) {
|
|
5453
|
-
var _this = this;
|
|
5454
|
-
return this.lastDate = Date.now(), setTimeout(function () {
|
|
5455
|
-
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
5456
|
-
}, this.timeout, !0);
|
|
5457
|
-
}
|
|
5458
|
-
}, {
|
|
5459
|
-
key: "clear",
|
|
5460
|
-
value: function clear(h) {
|
|
5461
|
-
clearTimeout(h);
|
|
5462
|
-
}
|
|
5463
|
-
}, {
|
|
5464
|
-
key: "appendDuration",
|
|
5465
|
-
value: function appendDuration(d) {
|
|
5466
|
-
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
5467
|
-
return a + b;
|
|
5468
|
-
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
5469
|
-
}
|
|
5470
|
-
}]);
|
|
5471
|
-
return RafBasedSTO;
|
|
5472
|
-
}();
|
|
5473
|
-
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
5474
|
-
new RafBasedSTO();
|
|
5475
|
-
var calculateLineHeight = function calculateLineHeight(lineHeight, fontSize) {
|
|
5476
|
-
if (vutils.isString(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
5477
|
-
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
5478
|
-
}
|
|
5479
|
-
return lineHeight;
|
|
5480
|
-
};
|
|
5481
|
-
|
|
5482
5348
|
var __decorate$U = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
5483
5349
|
var d,
|
|
5484
5350
|
c = arguments.length,
|
|
@@ -5555,9 +5421,7 @@
|
|
|
5555
5421
|
},
|
|
5556
5422
|
getTextBounds: void 0,
|
|
5557
5423
|
specialCharSet: "-/: .,@%'\"~" + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
5558
|
-
}, null != option ? option : {}),
|
|
5559
|
-
lineHeight: calculateLineHeight(null == textSpec ? void 0 : textSpec.lineHeight, null == textSpec ? void 0 : textSpec.fontSize)
|
|
5560
|
-
}));
|
|
5424
|
+
}, null != option ? option : {}), textSpec);
|
|
5561
5425
|
}
|
|
5562
5426
|
}]);
|
|
5563
5427
|
return DefaultGraphicUtil;
|
|
@@ -7472,6 +7336,131 @@
|
|
|
7472
7336
|
easing: "cubicOut"
|
|
7473
7337
|
};
|
|
7474
7338
|
|
|
7339
|
+
var Edge;
|
|
7340
|
+
!function (Edge) {
|
|
7341
|
+
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
7342
|
+
}(Edge || (Edge = {}));
|
|
7343
|
+
var _strokeVec4 = [!1, !1, !1, !1];
|
|
7344
|
+
var parseStroke = function parseStroke(stroke) {
|
|
7345
|
+
var _a;
|
|
7346
|
+
var isFullStroke = !0;
|
|
7347
|
+
if (vutils.isBoolean(stroke, !0)) {
|
|
7348
|
+
for (var i = 0; i < 4; i++) _strokeVec4[i] = stroke, isFullStroke && (isFullStroke = !(null !== (_a = _strokeVec4[i]) && void 0 !== _a && !_a));
|
|
7349
|
+
isFullStroke = stroke;
|
|
7350
|
+
} else if (Array.isArray(stroke)) for (var _i = 0; _i < 4; _i++) _strokeVec4[_i] = !!stroke[_i], isFullStroke && (isFullStroke = !!_strokeVec4[_i]);else _strokeVec4[0] = !1, _strokeVec4[1] = !1, _strokeVec4[2] = !1, _strokeVec4[3] = !1;
|
|
7351
|
+
return {
|
|
7352
|
+
isFullStroke: isFullStroke,
|
|
7353
|
+
stroke: _strokeVec4
|
|
7354
|
+
};
|
|
7355
|
+
};
|
|
7356
|
+
var _paddingVec4 = [0, 0, 0, 0];
|
|
7357
|
+
var parsePadding = function parsePadding(padding) {
|
|
7358
|
+
return padding ? vutils.isArray(padding) ? 0 === padding.length ? 0 : 1 === padding.length ? padding[0] : 2 === padding.length ? (_paddingVec4[0] = padding[0], _paddingVec4[2] = padding[0], _paddingVec4[1] = padding[1], _paddingVec4[3] = padding[1], _paddingVec4) : padding : padding : 0;
|
|
7359
|
+
};
|
|
7360
|
+
var _coords = [{
|
|
7361
|
+
x: 0,
|
|
7362
|
+
y: 0
|
|
7363
|
+
}, {
|
|
7364
|
+
x: 0,
|
|
7365
|
+
y: 0
|
|
7366
|
+
}, {
|
|
7367
|
+
x: 0,
|
|
7368
|
+
y: 0
|
|
7369
|
+
}, {
|
|
7370
|
+
x: 0,
|
|
7371
|
+
y: 0
|
|
7372
|
+
}],
|
|
7373
|
+
indexList = [1, 2, 3, 0, 1, 2, 3, 0];
|
|
7374
|
+
function circleBounds(startAngle, endAngle, radius, bounds) {
|
|
7375
|
+
for (; startAngle >= vutils.pi2;) startAngle -= vutils.pi2;
|
|
7376
|
+
for (; startAngle < 0;) startAngle += vutils.pi2;
|
|
7377
|
+
for (; startAngle > endAngle;) endAngle += vutils.pi2;
|
|
7378
|
+
_coords[0].x = radius, _coords[1].y = radius, _coords[2].x = -radius, _coords[3].y = -radius;
|
|
7379
|
+
var startIdx = Math.ceil(startAngle / vutils.halfPi) % 4,
|
|
7380
|
+
endIdx = Math.ceil(endAngle / vutils.halfPi) % 4;
|
|
7381
|
+
if (bounds.add(vutils.cos(startAngle) * radius, vutils.sin(startAngle) * radius), bounds.add(vutils.cos(endAngle) * radius, vutils.sin(endAngle) * radius), startIdx !== endIdx || endAngle - startAngle > vutils.pi) {
|
|
7382
|
+
var match = !1;
|
|
7383
|
+
for (var i = 0; i < indexList.length; i++) if (match || startIdx !== indexList[i]) {
|
|
7384
|
+
if (match && endIdx === indexList[i]) break;
|
|
7385
|
+
if (match) {
|
|
7386
|
+
var p = _coords[indexList[i]];
|
|
7387
|
+
bounds.add(p.x, p.y);
|
|
7388
|
+
}
|
|
7389
|
+
} else {
|
|
7390
|
+
match = !0;
|
|
7391
|
+
var _p = _coords[startIdx];
|
|
7392
|
+
bounds.add(_p.x, _p.y);
|
|
7393
|
+
}
|
|
7394
|
+
}
|
|
7395
|
+
}
|
|
7396
|
+
function pointInterpolation(pointA, pointB, ratio) {
|
|
7397
|
+
var _pointAt = vutils.pointAt(pointA.x, pointA.y, pointB.x, pointB.y, ratio),
|
|
7398
|
+
x = _pointAt.x,
|
|
7399
|
+
y = _pointAt.y,
|
|
7400
|
+
_pointAt2 = vutils.pointAt(pointA.x1, pointA.y1, pointB.x1, pointB.y1, ratio),
|
|
7401
|
+
x1 = _pointAt2.x,
|
|
7402
|
+
y1 = _pointAt2.y,
|
|
7403
|
+
point = new vutils.Point(x, y, x1, y1);
|
|
7404
|
+
return point.defined = pointB.defined, point;
|
|
7405
|
+
}
|
|
7406
|
+
function pointsInterpolation(pointsA, pointsB, ratio) {
|
|
7407
|
+
if (!pointsA || !pointsB) return [];
|
|
7408
|
+
Array.isArray(pointsA) || (pointsA = [pointsA]), Array.isArray(pointsB) || (pointsB = [pointsB]);
|
|
7409
|
+
var points = [];
|
|
7410
|
+
if (pointsA.length > pointsB.length) {
|
|
7411
|
+
points = pointsB.map(function (point) {
|
|
7412
|
+
var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
|
|
7413
|
+
return p.defined = point.defined, p;
|
|
7414
|
+
});
|
|
7415
|
+
for (var i = 0; i < pointsB.length; i++) points[i] = pointInterpolation(pointsA[i], pointsB[i], ratio);
|
|
7416
|
+
} else {
|
|
7417
|
+
points = pointsB.map(function (point) {
|
|
7418
|
+
var p = new vutils.Point(point.x, point.y, point.x1, point.y1);
|
|
7419
|
+
return p.defined = point.defined, p;
|
|
7420
|
+
});
|
|
7421
|
+
for (var _i2 = 0; _i2 < pointsA.length; _i2++) points[_i2] = pointInterpolation(pointsA[_i2], pointsB[_i2], ratio);
|
|
7422
|
+
}
|
|
7423
|
+
return points;
|
|
7424
|
+
}
|
|
7425
|
+
function getAttributeFromDefaultAttrList(attr, key) {
|
|
7426
|
+
if (vutils.isArray(attr)) {
|
|
7427
|
+
var val;
|
|
7428
|
+
for (var i = 0; i < attr.length && void 0 === val; i++) val = attr[i][key];
|
|
7429
|
+
return val;
|
|
7430
|
+
}
|
|
7431
|
+
return attr[key];
|
|
7432
|
+
}
|
|
7433
|
+
var RafBasedSTO = /*#__PURE__*/function () {
|
|
7434
|
+
function RafBasedSTO() {
|
|
7435
|
+
_classCallCheck(this, RafBasedSTO);
|
|
7436
|
+
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
7437
|
+
}
|
|
7438
|
+
_createClass(RafBasedSTO, [{
|
|
7439
|
+
key: "call",
|
|
7440
|
+
value: function call(cb) {
|
|
7441
|
+
var _this = this;
|
|
7442
|
+
return this.lastDate = Date.now(), setTimeout(function () {
|
|
7443
|
+
_this.appendDuration(Date.now() - _this.lastDate), cb(0);
|
|
7444
|
+
}, this.timeout, !0);
|
|
7445
|
+
}
|
|
7446
|
+
}, {
|
|
7447
|
+
key: "clear",
|
|
7448
|
+
value: function clear(h) {
|
|
7449
|
+
clearTimeout(h);
|
|
7450
|
+
}
|
|
7451
|
+
}, {
|
|
7452
|
+
key: "appendDuration",
|
|
7453
|
+
value: function appendDuration(d) {
|
|
7454
|
+
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.min(Math.max(this.durations.reduce(function (a, b) {
|
|
7455
|
+
return a + b;
|
|
7456
|
+
}, 0) / this.durations.length, 1e3 / 60), 1e3 / 30);
|
|
7457
|
+
}
|
|
7458
|
+
}]);
|
|
7459
|
+
return RafBasedSTO;
|
|
7460
|
+
}();
|
|
7461
|
+
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
7462
|
+
new RafBasedSTO();
|
|
7463
|
+
|
|
7475
7464
|
var IncreaseCount = /*#__PURE__*/function (_ACustomAnimate) {
|
|
7476
7465
|
_inherits(IncreaseCount, _ACustomAnimate);
|
|
7477
7466
|
var _super = _createSuper(IncreaseCount);
|
|
@@ -9974,7 +9963,7 @@
|
|
|
9974
9963
|
return CanvasTextLayout;
|
|
9975
9964
|
}();
|
|
9976
9965
|
|
|
9977
|
-
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));
|
|
9978
9967
|
var Text = /*#__PURE__*/function (_Graphic) {
|
|
9979
9968
|
_inherits(Text, _Graphic);
|
|
9980
9969
|
var _super = _createSuper(Text);
|
|
@@ -10048,117 +10037,6 @@
|
|
|
10048
10037
|
paddingArray = parsePadding(boundsPadding);
|
|
10049
10038
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
10050
10039
|
}
|
|
10051
|
-
}, {
|
|
10052
|
-
key: "updateWrapAABBBounds",
|
|
10053
|
-
value: function updateWrapAABBBounds(text) {
|
|
10054
|
-
var _a, _b, _c, _d;
|
|
10055
|
-
var textTheme = getTheme(this).text,
|
|
10056
|
-
_this$attribute = this.attribute,
|
|
10057
|
-
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
10058
|
-
fontFamily = _this$attribute$fontF === void 0 ? textTheme.fontFamily : _this$attribute$fontF,
|
|
10059
|
-
_this$attribute$textA = _this$attribute.textAlign,
|
|
10060
|
-
textAlign = _this$attribute$textA === void 0 ? textTheme.textAlign : _this$attribute$textA,
|
|
10061
|
-
_this$attribute$textB = _this$attribute.textBaseline,
|
|
10062
|
-
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10063
|
-
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10064
|
-
fontSize = _this$attribute$fontS === void 0 ? textTheme.fontSize : _this$attribute$fontS,
|
|
10065
|
-
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10066
|
-
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10067
|
-
maxLineWidth = _this$attribute.maxLineWidth,
|
|
10068
|
-
_this$attribute$strok = _this$attribute.stroke,
|
|
10069
|
-
stroke = _this$attribute$strok === void 0 ? textTheme.stroke : _this$attribute$strok,
|
|
10070
|
-
_this$attribute$lineW = _this$attribute.lineWidth,
|
|
10071
|
-
lineWidth = _this$attribute$lineW === void 0 ? textTheme.lineWidth : _this$attribute$lineW,
|
|
10072
|
-
_this$attribute$wordB = _this$attribute.wordBreak,
|
|
10073
|
-
wordBreak = _this$attribute$wordB === void 0 ? textTheme.wordBreak : _this$attribute$wordB,
|
|
10074
|
-
_this$attribute$fontW = _this$attribute.fontWeight,
|
|
10075
|
-
fontWeight = _this$attribute$fontW === void 0 ? textTheme.fontWeight : _this$attribute$fontW,
|
|
10076
|
-
_this$attribute$ignor = _this$attribute.ignoreBuf,
|
|
10077
|
-
ignoreBuf = _this$attribute$ignor === void 0 ? textTheme.ignoreBuf : _this$attribute$ignor,
|
|
10078
|
-
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10079
|
-
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10080
|
-
lineClamp = _this$attribute.lineClamp,
|
|
10081
|
-
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10082
|
-
buf = ignoreBuf ? 0 : 2;
|
|
10083
|
-
if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
|
|
10084
|
-
var _bbox = this.cache.layoutData.bbox;
|
|
10085
|
-
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10086
|
-
}
|
|
10087
|
-
var textMeasure = application.graphicUtil.textMeasure,
|
|
10088
|
-
layoutObj = new CanvasTextLayout(fontFamily, {
|
|
10089
|
-
fontSize: fontSize,
|
|
10090
|
-
fontWeight: fontWeight,
|
|
10091
|
-
fontFamily: fontFamily
|
|
10092
|
-
}, textMeasure),
|
|
10093
|
-
lines = vutils.isArray(text) ? text.map(function (l) {
|
|
10094
|
-
return l.toString();
|
|
10095
|
-
}) : [text.toString()],
|
|
10096
|
-
linesLayout = [],
|
|
10097
|
-
bboxWH = [0, 0];
|
|
10098
|
-
var lineCountLimit = 1 / 0;
|
|
10099
|
-
if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)), lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
|
|
10100
|
-
if (maxLineWidth > 0) for (var i = 0; i < lines.length; i++) {
|
|
10101
|
-
var str = lines[i];
|
|
10102
|
-
var needCut = !0;
|
|
10103
|
-
if (i === lineCountLimit - 1) {
|
|
10104
|
-
var _clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10105
|
-
linesLayout.push({
|
|
10106
|
-
str: _clip.str,
|
|
10107
|
-
width: _clip.width
|
|
10108
|
-
});
|
|
10109
|
-
break;
|
|
10110
|
-
}
|
|
10111
|
-
var clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-word" === wordBreak);
|
|
10112
|
-
if ("" !== str && "" === clip.str) {
|
|
10113
|
-
if (ellipsis) {
|
|
10114
|
-
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10115
|
-
clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
|
|
10116
|
-
} else clip.str = "", clip.width = 0;
|
|
10117
|
-
needCut = !1;
|
|
10118
|
-
}
|
|
10119
|
-
if (linesLayout.push({
|
|
10120
|
-
str: clip.str,
|
|
10121
|
-
width: clip.width
|
|
10122
|
-
}), clip.str.length === str.length) ;else if (needCut) {
|
|
10123
|
-
var newStr = str.substring(clip.str.length);
|
|
10124
|
-
lines.splice(i + 1, 0, newStr);
|
|
10125
|
-
}
|
|
10126
|
-
}
|
|
10127
|
-
var maxWidth = 0;
|
|
10128
|
-
linesLayout.forEach(function (layout) {
|
|
10129
|
-
maxWidth = Math.max(maxWidth, layout.width);
|
|
10130
|
-
}), bboxWH[0] = maxWidth;
|
|
10131
|
-
} else {
|
|
10132
|
-
var width,
|
|
10133
|
-
_text,
|
|
10134
|
-
_lineWidth = 0;
|
|
10135
|
-
for (var _i = 0, len = lines.length; _i < len; _i++) {
|
|
10136
|
-
if (_i === lineCountLimit - 1) {
|
|
10137
|
-
var _clip2 = layoutObj.textMeasure.clipTextWithSuffix(lines[_i], layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10138
|
-
linesLayout.push({
|
|
10139
|
-
str: _clip2.str,
|
|
10140
|
-
width: _clip2.width
|
|
10141
|
-
}), _lineWidth = Math.max(_lineWidth, _clip2.width);
|
|
10142
|
-
break;
|
|
10143
|
-
}
|
|
10144
|
-
_text = lines[_i], width = layoutObj.textMeasure.measureTextWidth(_text, layoutObj.textOptions, "break-word" === wordBreak), _lineWidth = Math.max(_lineWidth, width), linesLayout.push({
|
|
10145
|
-
str: _text,
|
|
10146
|
-
width: width
|
|
10147
|
-
});
|
|
10148
|
-
}
|
|
10149
|
-
bboxWH[0] = _lineWidth;
|
|
10150
|
-
}
|
|
10151
|
-
bboxWH[1] = linesLayout.length * (lineHeight + buf);
|
|
10152
|
-
var bbox = {
|
|
10153
|
-
xOffset: 0,
|
|
10154
|
-
yOffset: 0,
|
|
10155
|
-
width: bboxWH[0],
|
|
10156
|
-
height: bboxWH[1]
|
|
10157
|
-
};
|
|
10158
|
-
layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
|
|
10159
|
-
var layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
|
|
10160
|
-
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;
|
|
10161
|
-
}
|
|
10162
10040
|
}, {
|
|
10163
10041
|
key: "updateSingallineAABBBounds",
|
|
10164
10042
|
value: function updateSingallineAABBBounds(text) {
|
|
@@ -10205,12 +10083,9 @@
|
|
|
10205
10083
|
_attribute$wordBreak === void 0 ? textTheme.wordBreak : _attribute$wordBreak;
|
|
10206
10084
|
var _attribute$ignoreBuf = attribute.ignoreBuf,
|
|
10207
10085
|
ignoreBuf = _attribute$ignoreBuf === void 0 ? textTheme.ignoreBuf : _attribute$ignoreBuf,
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
var buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10212
|
-
textFontSize = attribute.fontSize || textTheme.fontSize,
|
|
10213
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
|
|
10086
|
+
buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize),
|
|
10087
|
+
_attribute$lineHeight = attribute.lineHeight,
|
|
10088
|
+
lineHeight = _attribute$lineHeight === void 0 ? null !== (_a = attribute.lineHeight) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf : _attribute$lineHeight;
|
|
10214
10089
|
if (!this.shouldUpdateShape() && this.cache) {
|
|
10215
10090
|
width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
|
|
10216
10091
|
var _dx = textDrawOffsetX(textAlign, width),
|
|
@@ -10280,11 +10155,12 @@
|
|
|
10280
10155
|
fontFamily = _attribute$fontFamily2 === void 0 ? textTheme.fontFamily : _attribute$fontFamily2,
|
|
10281
10156
|
_attribute$stroke2 = attribute.stroke,
|
|
10282
10157
|
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,
|
|
10283
10160
|
_attribute$lineWidth2 = attribute.lineWidth,
|
|
10284
10161
|
lineWidth = _attribute$lineWidth2 === void 0 ? textTheme.lineWidth : _attribute$lineWidth2,
|
|
10285
10162
|
_attribute$verticalMo = attribute.verticalMode,
|
|
10286
|
-
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo
|
|
10287
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10163
|
+
verticalMode = _attribute$verticalMo === void 0 ? textTheme.verticalMode : _attribute$verticalMo;
|
|
10288
10164
|
var _attribute$textAlign2 = attribute.textAlign,
|
|
10289
10165
|
textAlign = _attribute$textAlign2 === void 0 ? textTheme.textAlign : _attribute$textAlign2,
|
|
10290
10166
|
_attribute$textBaseli2 = attribute.textBaseline,
|
|
@@ -10334,7 +10210,7 @@
|
|
|
10334
10210
|
}, {
|
|
10335
10211
|
key: "updateHorizontalMultilineAABBBounds",
|
|
10336
10212
|
value: function updateHorizontalMultilineAABBBounds(text) {
|
|
10337
|
-
var _a
|
|
10213
|
+
var _a;
|
|
10338
10214
|
var textTheme = getTheme(this).text,
|
|
10339
10215
|
attribute = this.attribute,
|
|
10340
10216
|
_attribute$fontFamily3 = attribute.fontFamily,
|
|
@@ -10347,6 +10223,8 @@
|
|
|
10347
10223
|
fontSize = _attribute$fontSize3 === void 0 ? textTheme.fontSize : _attribute$fontSize3,
|
|
10348
10224
|
_attribute$fontWeight3 = attribute.fontWeight,
|
|
10349
10225
|
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,
|
|
10350
10228
|
_attribute$ellipsis3 = attribute.ellipsis,
|
|
10351
10229
|
ellipsis = _attribute$ellipsis3 === void 0 ? textTheme.ellipsis : _attribute$ellipsis3,
|
|
10352
10230
|
maxLineWidth = attribute.maxLineWidth,
|
|
@@ -10354,13 +10232,11 @@
|
|
|
10354
10232
|
stroke = _attribute$stroke3 === void 0 ? textTheme.stroke : _attribute$stroke3,
|
|
10355
10233
|
_attribute$lineWidth3 = attribute.lineWidth,
|
|
10356
10234
|
lineWidth = _attribute$lineWidth3 === void 0 ? textTheme.lineWidth : _attribute$lineWidth3,
|
|
10357
|
-
_attribute$
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
var _bbox2 = this.cache.layoutData.bbox;
|
|
10363
|
-
return this._AABBBounds.set(_bbox2.xOffset, _bbox2.yOffset, _bbox2.xOffset + _bbox2.width, _bbox2.yOffset + _bbox2.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10235
|
+
_attribute$wordBreak2 = attribute.wordBreak;
|
|
10236
|
+
_attribute$wordBreak2 === void 0 ? textTheme.wordBreak : _attribute$wordBreak2;
|
|
10237
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
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;
|
|
10364
10240
|
}
|
|
10365
10241
|
var textMeasure = application.graphicUtil.textMeasure,
|
|
10366
10242
|
layoutData = new CanvasTextLayout(fontFamily, {
|
|
@@ -10394,11 +10270,12 @@
|
|
|
10394
10270
|
fontWeight = _attribute$fontWeight4 === void 0 ? textTheme.fontWeight : _attribute$fontWeight4,
|
|
10395
10271
|
_attribute$stroke4 = attribute.stroke,
|
|
10396
10272
|
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,
|
|
10397
10275
|
_attribute$lineWidth4 = attribute.lineWidth,
|
|
10398
10276
|
lineWidth = _attribute$lineWidth4 === void 0 ? textTheme.lineWidth : _attribute$lineWidth4,
|
|
10399
10277
|
_attribute$verticalMo2 = attribute.verticalMode,
|
|
10400
|
-
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2
|
|
10401
|
-
lineHeight = null !== (_a = calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
|
|
10278
|
+
verticalMode = _attribute$verticalMo2 === void 0 ? textTheme.verticalMode : _attribute$verticalMo2;
|
|
10402
10279
|
var _attribute$textAlign4 = attribute.textAlign,
|
|
10403
10280
|
textAlign = _attribute$textAlign4 === void 0 ? textTheme.textAlign : _attribute$textAlign4,
|
|
10404
10281
|
_attribute$textBaseli4 = attribute.textBaseline,
|
|
@@ -10531,7 +10408,7 @@
|
|
|
10531
10408
|
}, {
|
|
10532
10409
|
key: "updateMultilineAABBBounds",
|
|
10533
10410
|
value: function updateMultilineAABBBounds(text) {
|
|
10534
|
-
var _a, _b, _c
|
|
10411
|
+
var _a, _b, _c;
|
|
10535
10412
|
var textTheme = getTheme(this).text,
|
|
10536
10413
|
_this$attribute = this.attribute,
|
|
10537
10414
|
_this$attribute$fontF = _this$attribute.fontFamily,
|
|
@@ -10542,6 +10419,8 @@
|
|
|
10542
10419
|
textBaseline = _this$attribute$textB === void 0 ? textTheme.textBaseline : _this$attribute$textB,
|
|
10543
10420
|
_this$attribute$fontS = _this$attribute.fontSize,
|
|
10544
10421
|
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,
|
|
10545
10424
|
_this$attribute$ellip = _this$attribute.ellipsis,
|
|
10546
10425
|
ellipsis = _this$attribute$ellip === void 0 ? textTheme.ellipsis : _this$attribute$ellip,
|
|
10547
10426
|
maxLineWidth = _this$attribute.maxLineWidth,
|
|
@@ -10558,9 +10437,8 @@
|
|
|
10558
10437
|
_this$attribute$heigh = _this$attribute.heightLimit,
|
|
10559
10438
|
heightLimit = _this$attribute$heigh === void 0 ? 0 : _this$attribute$heigh,
|
|
10560
10439
|
lineClamp = _this$attribute.lineClamp,
|
|
10561
|
-
lineHeight = null !== (_a = calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize,
|
|
10562
10440
|
buf = ignoreBuf ? 0 : 2;
|
|
10563
|
-
if (!this.shouldUpdateShape() && (null === (
|
|
10441
|
+
if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
|
|
10564
10442
|
var _bbox = this.cache.layoutData.bbox;
|
|
10565
10443
|
return this._AABBBounds.set(_bbox.xOffset, _bbox.yOffset, _bbox.xOffset + _bbox.width, _bbox.yOffset + _bbox.height), stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
|
|
10566
10444
|
}
|
|
@@ -10592,7 +10470,7 @@
|
|
|
10592
10470
|
if ("" !== str && "" === clip.str) {
|
|
10593
10471
|
if (ellipsis) {
|
|
10594
10472
|
var clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1);
|
|
10595
|
-
clip.str = null !== (
|
|
10473
|
+
clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
|
|
10596
10474
|
} else clip.str = "", clip.width = 0;
|
|
10597
10475
|
needCut = !1;
|
|
10598
10476
|
}
|
|
@@ -15463,7 +15341,7 @@
|
|
|
15463
15341
|
var t = textAlign;
|
|
15464
15342
|
textAlign = null !== (_a = text.getBaselineMapAlign()[textBaseline]) && void 0 !== _a ? _a : "left", textBaseline = null !== (_b = text.getAlignMapBaseline()[t]) && void 0 !== _b ? _b : "top";
|
|
15465
15343
|
}
|
|
15466
|
-
var lineHeight = null !== (_c =
|
|
15344
|
+
var lineHeight = null !== (_c = text.attribute.lineHeight) && void 0 !== _c ? _c : fontSize,
|
|
15467
15345
|
data = this.valid(text, textAttribute, fillCb, strokeCb);
|
|
15468
15346
|
if (!data) return;
|
|
15469
15347
|
var fVisible = data.fVisible,
|
|
@@ -20947,7 +20825,7 @@
|
|
|
20947
20825
|
return new vutils.TextMeasure(Object.assign({ defaultFontParams: {
|
|
20948
20826
|
fontFamily: DEFAULT_TEXT_FONT_FAMILY,
|
|
20949
20827
|
fontSize: DEFAULT_TEXT_FONT_SIZE
|
|
20950
|
-
}, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})),
|
|
20828
|
+
}, getTextBounds: useNaiveCanvas ? undefined : getTextBounds, specialCharSet: '-/: .,@%\'"~' + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase() }, (option !== null && option !== void 0 ? option : {})), textSpec);
|
|
20951
20829
|
};
|
|
20952
20830
|
function measureTextSize(text, textSpec) {
|
|
20953
20831
|
var _a;
|
|
@@ -20974,8 +20852,8 @@
|
|
|
20974
20852
|
this.name = 'tag';
|
|
20975
20853
|
}
|
|
20976
20854
|
render() {
|
|
20977
|
-
var _a;
|
|
20978
|
-
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;
|
|
20979
20857
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
20980
20858
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
20981
20859
|
let symbol;
|
|
@@ -20997,75 +20875,100 @@
|
|
|
20997
20875
|
}
|
|
20998
20876
|
tagWidth += symbolPlaceWidth;
|
|
20999
20877
|
textX += symbolPlaceWidth;
|
|
21000
|
-
|
|
21001
|
-
if (
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
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);
|
|
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
|
+
}
|
|
21031
20888
|
}
|
|
21032
|
-
group.setAttribute('x', -symbolPlaceWidth / 2);
|
|
21033
20889
|
}
|
|
21034
|
-
else if (
|
|
21035
|
-
x
|
|
21036
|
-
|
|
21037
|
-
|
|
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
|
+
}
|
|
21038
20899
|
}
|
|
21039
|
-
group.setAttribute('x', -parsedPadding[1] - symbolPlaceWidth);
|
|
21040
20900
|
}
|
|
21041
|
-
else
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
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
|
+
}
|
|
21048
20926
|
}
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
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);
|
|
21054
20935
|
}
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
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);
|
|
21061
20942
|
}
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
y
|
|
21067
|
-
|
|
21068
|
-
|
|
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
|
+
}
|
|
21069
20972
|
}
|
|
21070
20973
|
}
|
|
21071
20974
|
}
|
|
@@ -22277,6 +22180,24 @@
|
|
|
22277
22180
|
target.states = state;
|
|
22278
22181
|
}
|
|
22279
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
|
+
}
|
|
22280
22201
|
const text = createText(attributes);
|
|
22281
22202
|
this._bindEvent(text);
|
|
22282
22203
|
this._setStatesOfText(text);
|
|
@@ -22503,7 +22424,7 @@
|
|
|
22503
22424
|
const prevTextMap = this._graphicToText || new Map();
|
|
22504
22425
|
const texts = [];
|
|
22505
22426
|
labels.forEach((text, index) => {
|
|
22506
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
22427
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
22507
22428
|
const labelLine = this._labelLine(text);
|
|
22508
22429
|
const relatedGraphic = this.getRelatedGrphic(text.attribute);
|
|
22509
22430
|
const textId = text.attribute.id;
|
|
@@ -22546,11 +22467,11 @@
|
|
|
22546
22467
|
}), duration, easing);
|
|
22547
22468
|
}
|
|
22548
22469
|
if (animationConfig.increaseEffect !== false &&
|
|
22549
|
-
prevText.attribute.text !== text.attribute.text &&
|
|
22550
|
-
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))) {
|
|
22551
22472
|
prevText
|
|
22552
22473
|
.animate()
|
|
22553
|
-
.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));
|
|
22554
22475
|
}
|
|
22555
22476
|
}
|
|
22556
22477
|
});
|
|
@@ -24222,12 +24143,26 @@
|
|
|
24222
24143
|
let textAlign = 'center';
|
|
24223
24144
|
let textBaseline = 'middle';
|
|
24224
24145
|
data.forEach((item, index) => {
|
|
24225
|
-
var _a, _b;
|
|
24146
|
+
var _a, _b, _c, _d;
|
|
24226
24147
|
const labelStyle = this._getLabelAttribute(item, index, data, layer);
|
|
24227
|
-
|
|
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
|
+
}
|
|
24228
24163
|
text.name = exports.AXIS_ELEMENT_NAME.label;
|
|
24229
24164
|
text.id = this._getNodeId(`layer${layer}-label-${item.id}`);
|
|
24230
|
-
if (vutils.isEmpty((
|
|
24165
|
+
if (vutils.isEmpty((_c = this.attribute.label) === null || _c === void 0 ? void 0 : _c.state)) {
|
|
24231
24166
|
text.states = DEFAULT_STATES$2;
|
|
24232
24167
|
}
|
|
24233
24168
|
else {
|
|
@@ -24240,7 +24175,7 @@
|
|
|
24240
24175
|
text.states = labelState;
|
|
24241
24176
|
}
|
|
24242
24177
|
labelGroup.add(text);
|
|
24243
|
-
const angle = (
|
|
24178
|
+
const angle = (_d = labelStyle.angle) !== null && _d !== void 0 ? _d : 0;
|
|
24244
24179
|
maxTextWidth = Math.max(maxTextWidth, text.AABBBounds.width());
|
|
24245
24180
|
maxTextHeight = Math.max(maxTextHeight, text.AABBBounds.height());
|
|
24246
24181
|
if (angle) {
|
|
@@ -24389,7 +24324,7 @@
|
|
|
24389
24324
|
}
|
|
24390
24325
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
24391
24326
|
var _a, _b, _c, _d, _e, _f;
|
|
24392
|
-
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"]);
|
|
24393
24328
|
let offset = space;
|
|
24394
24329
|
let tickLength = 0;
|
|
24395
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) {
|
|
@@ -24410,7 +24345,9 @@
|
|
|
24410
24345
|
}
|
|
24411
24346
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside);
|
|
24412
24347
|
const vector = this.getVerticalVector(offset, inside, point);
|
|
24413
|
-
const
|
|
24348
|
+
const textContent = formatMethod
|
|
24349
|
+
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
24350
|
+
: tickDatum.label;
|
|
24414
24351
|
let { style: textStyle } = tagAttributes;
|
|
24415
24352
|
textStyle = vutils.isFunction(textStyle)
|
|
24416
24353
|
? vutils.merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer))
|
|
@@ -24425,7 +24362,7 @@
|
|
|
24425
24362
|
layer
|
|
24426
24363
|
});
|
|
24427
24364
|
}
|
|
24428
|
-
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);
|
|
24429
24366
|
}
|
|
24430
24367
|
getLabelPosition(point, vector, text, style) {
|
|
24431
24368
|
return point;
|
|
@@ -25163,7 +25100,7 @@
|
|
|
25163
25100
|
let titleSpacing = 0;
|
|
25164
25101
|
const axisLineWidth = (line === null || line === void 0 ? void 0 : line.visible) ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
25165
25102
|
const tickLength = (tick === null || tick === void 0 ? void 0 : tick.visible) ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
25166
|
-
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') {
|
|
25167
25104
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
25168
25105
|
const padding = vutils.normalizePadding(title.padding);
|
|
25169
25106
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -29371,19 +29308,27 @@
|
|
|
29371
29308
|
this.name = 'title';
|
|
29372
29309
|
}
|
|
29373
29310
|
render() {
|
|
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;
|
|
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;
|
|
29376
29313
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
29377
29314
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
29378
29315
|
if (((_a = this.attribute) === null || _a === void 0 ? void 0 : _a.visible) !== false && (textStyle === null || textStyle === void 0 ? void 0 : textStyle.visible) !== false) {
|
|
29379
|
-
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)) {
|
|
29380
29325
|
const attr = {
|
|
29381
|
-
x: (
|
|
29382
|
-
y: (
|
|
29383
|
-
width: (
|
|
29384
|
-
height: (
|
|
29385
|
-
ellipsis: (
|
|
29386
|
-
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',
|
|
29387
29332
|
maxHeight: textStyle.maxHeight,
|
|
29388
29333
|
maxWidth: textStyle.maxWidth,
|
|
29389
29334
|
textConfig: textStyle.character
|
|
@@ -29391,20 +29336,28 @@
|
|
|
29391
29336
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
29392
29337
|
}
|
|
29393
29338
|
else if (vutils.isValid(text)) {
|
|
29394
|
-
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');
|
|
29395
29340
|
}
|
|
29396
29341
|
}
|
|
29397
|
-
const maintextHeight = this._mainTitle ? (
|
|
29398
|
-
const maintextWidth = this._mainTitle ? (
|
|
29399
|
-
if (((
|
|
29400
|
-
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)) {
|
|
29401
29354
|
const attr = {
|
|
29402
|
-
x: (
|
|
29403
|
-
y: (
|
|
29404
|
-
width: (
|
|
29405
|
-
height: (
|
|
29406
|
-
ellipsis: (
|
|
29407
|
-
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',
|
|
29408
29361
|
maxHeight: subtextStyle.maxHeight,
|
|
29409
29362
|
maxWidth: subtextStyle.maxWidth,
|
|
29410
29363
|
textConfig: subtextStyle.character
|
|
@@ -29412,17 +29365,17 @@
|
|
|
29412
29365
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
29413
29366
|
}
|
|
29414
29367
|
else if (vutils.isValid(subtext)) {
|
|
29415
|
-
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');
|
|
29416
29369
|
}
|
|
29417
29370
|
}
|
|
29418
|
-
const subtextHeight = this._subTitle ? (
|
|
29419
|
-
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;
|
|
29420
29373
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
29421
|
-
let titleHeight = maintextHeight + ((
|
|
29374
|
+
let titleHeight = maintextHeight + ((_34 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _34 !== void 0 ? _34 : subtextHeight);
|
|
29422
29375
|
if (vutils.isValid(width)) {
|
|
29423
29376
|
titleWidth = width;
|
|
29424
|
-
(
|
|
29425
|
-
(
|
|
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);
|
|
29426
29379
|
}
|
|
29427
29380
|
if (vutils.isValid(height)) {
|
|
29428
29381
|
titleHeight = height;
|
|
@@ -29431,10 +29384,10 @@
|
|
|
29431
29384
|
titleWidth = minWidth;
|
|
29432
29385
|
}
|
|
29433
29386
|
if (vutils.isValid(maxWidth)) {
|
|
29434
|
-
(
|
|
29435
|
-
(
|
|
29436
|
-
(
|
|
29437
|
-
(
|
|
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);
|
|
29438
29391
|
if (titleWidth > maxWidth) {
|
|
29439
29392
|
titleWidth = maxWidth;
|
|
29440
29393
|
}
|
|
@@ -29443,8 +29396,8 @@
|
|
|
29443
29396
|
titleHeight = minHeight;
|
|
29444
29397
|
}
|
|
29445
29398
|
if (vutils.isValid(maxHeight)) {
|
|
29446
|
-
(
|
|
29447
|
-
(
|
|
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);
|
|
29448
29401
|
if (titleHeight > maxHeight) {
|
|
29449
29402
|
titleHeight = maxHeight;
|
|
29450
29403
|
}
|
|
@@ -29454,67 +29407,67 @@
|
|
|
29454
29407
|
group.attribute.boundsPadding = parsedPadding;
|
|
29455
29408
|
if (vutils.isValid(align) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.align)) {
|
|
29456
29409
|
const mainTitleAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.align) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.align : align;
|
|
29457
|
-
const mainTitleWidth = (
|
|
29410
|
+
const mainTitleWidth = (_43 = textStyle === null || textStyle === void 0 ? void 0 : textStyle.width) !== null && _43 !== void 0 ? _43 : maintextWidth;
|
|
29458
29411
|
if (mainTitleAlign === 'left') {
|
|
29459
|
-
(
|
|
29460
|
-
(
|
|
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');
|
|
29461
29414
|
}
|
|
29462
29415
|
else if (mainTitleAlign === 'center') {
|
|
29463
|
-
(
|
|
29464
|
-
(
|
|
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');
|
|
29465
29418
|
}
|
|
29466
29419
|
else if (mainTitleAlign === 'right') {
|
|
29467
|
-
(
|
|
29468
|
-
(
|
|
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');
|
|
29469
29422
|
}
|
|
29470
29423
|
}
|
|
29471
29424
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29472
29425
|
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
29473
29426
|
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
29474
29427
|
if (mainTitleVerticalAlign === 'top') {
|
|
29475
|
-
(
|
|
29476
|
-
(
|
|
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');
|
|
29477
29430
|
}
|
|
29478
29431
|
else if (mainTitleVerticalAlign === 'middle') {
|
|
29479
|
-
(
|
|
29480
|
-
(
|
|
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');
|
|
29481
29434
|
}
|
|
29482
29435
|
else if (mainTitleVerticalAlign === 'bottom') {
|
|
29483
|
-
(
|
|
29484
|
-
(
|
|
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');
|
|
29485
29438
|
}
|
|
29486
29439
|
}
|
|
29487
29440
|
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
29488
29441
|
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
29489
|
-
const subTitleWidth = (
|
|
29442
|
+
const subTitleWidth = (_56 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _56 !== void 0 ? _56 : subtextWidth;
|
|
29490
29443
|
if (subTitleAlign === 'left') {
|
|
29491
|
-
(
|
|
29492
|
-
(
|
|
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');
|
|
29493
29446
|
}
|
|
29494
29447
|
else if (subTitleAlign === 'center') {
|
|
29495
|
-
(
|
|
29496
|
-
(
|
|
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');
|
|
29497
29450
|
}
|
|
29498
29451
|
else if (subTitleAlign === 'right') {
|
|
29499
|
-
(
|
|
29500
|
-
(
|
|
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');
|
|
29501
29454
|
}
|
|
29502
29455
|
}
|
|
29503
29456
|
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
29504
29457
|
const subTitleVerticalAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.verticalAlign : verticalAlign;
|
|
29505
29458
|
const subTitleYStart = maintextHeight;
|
|
29506
|
-
const subTitleHeight = (
|
|
29459
|
+
const subTitleHeight = (_63 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.height) !== null && _63 !== void 0 ? _63 : 0;
|
|
29507
29460
|
if (subTitleVerticalAlign === 'top') {
|
|
29508
|
-
(
|
|
29509
|
-
(
|
|
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');
|
|
29510
29463
|
}
|
|
29511
29464
|
else if (subTitleVerticalAlign === 'middle') {
|
|
29512
|
-
(
|
|
29513
|
-
(
|
|
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');
|
|
29514
29467
|
}
|
|
29515
29468
|
else if (subTitleVerticalAlign === 'bottom') {
|
|
29516
|
-
(
|
|
29517
|
-
(
|
|
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');
|
|
29518
29471
|
}
|
|
29519
29472
|
}
|
|
29520
29473
|
}
|
|
@@ -29569,7 +29522,7 @@
|
|
|
29569
29522
|
this.name = 'indicator';
|
|
29570
29523
|
}
|
|
29571
29524
|
render() {
|
|
29572
|
-
var _a;
|
|
29525
|
+
var _a, _b, _c;
|
|
29573
29526
|
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
29574
29527
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
29575
29528
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
@@ -29580,7 +29533,15 @@
|
|
|
29580
29533
|
if (vutils.isValid(title)) {
|
|
29581
29534
|
if (title.visible !== false) {
|
|
29582
29535
|
const titleStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
|
|
29583
|
-
|
|
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
|
+
}
|
|
29584
29545
|
if (title.autoFit && vutils.isValidNumber(limit)) {
|
|
29585
29546
|
this._setAutoFit(limit, this._title, title);
|
|
29586
29547
|
}
|
|
@@ -29601,9 +29562,19 @@
|
|
|
29601
29562
|
const contentComponents = [];
|
|
29602
29563
|
let lastContentHeight = 0;
|
|
29603
29564
|
contents.forEach((contentItem, i) => {
|
|
29565
|
+
var _a, _b;
|
|
29604
29566
|
if (contentItem.visible !== false) {
|
|
29605
29567
|
const contentStyle = vutils.merge({}, vutils.get(DEFAULT_INDICATOR_THEME, 'content.style'), contentItem.style);
|
|
29606
|
-
|
|
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
|
+
}
|
|
29607
29578
|
if (contentItem.autoFit && vutils.isValidNumber(limit)) {
|
|
29608
29579
|
this._setAutoFit(limit, contentComponent, contentItem);
|
|
29609
29580
|
}
|
|
@@ -29621,7 +29592,7 @@
|
|
|
29621
29592
|
});
|
|
29622
29593
|
this._content = contentComponents;
|
|
29623
29594
|
}
|
|
29624
|
-
const totalHeight = (
|
|
29595
|
+
const totalHeight = (_c = group === null || group === void 0 ? void 0 : group.AABBBounds.height()) !== null && _c !== void 0 ? _c : 0;
|
|
29625
29596
|
group.setAttribute('y', size.height / 2 - totalHeight / 2);
|
|
29626
29597
|
group.setAttribute('x', size.width / 2);
|
|
29627
29598
|
}
|
|
@@ -30980,7 +30951,13 @@
|
|
|
30980
30951
|
this._tooltipTitleSymbol = this._tooltipTitleContainer.createOrUpdateChild(`${TOOLTIP_TITLE_NAME}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, vutils.merge({ symbolType: 'circle' }, titleAttr.shape, {
|
|
30981
30952
|
visible: isVisible(titleAttr) && isVisible(titleAttr.shape)
|
|
30982
30953
|
}), 'symbol');
|
|
30983
|
-
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) {
|
|
30984
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');
|
|
30985
30962
|
}
|
|
30986
30963
|
else {
|
|
@@ -31025,9 +31002,7 @@
|
|
|
31025
31002
|
let x = 0;
|
|
31026
31003
|
if (isVisible(itemAttr.shape)) {
|
|
31027
31004
|
itemGroup.createOrUpdateChild(`${itemGroupName}-${TOOLTIP_SHAPE_NAME_SUFFIX}`, Object.assign({ visible: true, x: itemAttr.shape.size / 2, y: itemAttr.shape.size / 2 +
|
|
31028
|
-
(((_a =
|
|
31029
|
-
itemAttr.shape.size) /
|
|
31030
|
-
2 }, itemAttr.shape), 'symbol');
|
|
31005
|
+
(((_a = itemAttr.key.lineHeight) !== null && _a !== void 0 ? _a : itemAttr.key.fontSize) - itemAttr.shape.size) / 2 }, itemAttr.shape), 'symbol');
|
|
31031
31006
|
}
|
|
31032
31007
|
if (hasContentShape) {
|
|
31033
31008
|
x += itemAttr.shape.size + itemAttr.shape.spacing;
|
|
@@ -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;
|