@visactor/vrender-components 0.22.0-vstory.10 → 0.22.0-vstory.12
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/type.js.map +1 -1
- package/cjs/core/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/label/base.js +4 -1
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.js.map +1 -1
- package/cjs/legend/discrete/type.js.map +1 -1
- package/cjs/marker/area.js +5 -14
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/type.js.map +1 -1
- package/cjs/poptip/type.js.map +1 -1
- package/cjs/title/title.js +40 -40
- package/cjs/title/title.js.map +1 -1
- package/dist/index.es.js +181 -270
- package/es/axis/type.js.map +1 -1
- package/es/core/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/label/base.js +4 -1
- package/es/label/base.js.map +1 -1
- package/es/label/type.js.map +1 -1
- package/es/legend/discrete/type.js.map +1 -1
- package/es/marker/area.js +5 -14
- package/es/marker/area.js.map +1 -1
- package/es/marker/type.js.map +1 -1
- package/es/poptip/type.js.map +1 -1
- package/es/title/title.js +37 -38
- package/es/title/title.js.map +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -618,6 +618,12 @@ let DefaultGlobal = class {
|
|
|
618
618
|
get env() {
|
|
619
619
|
return this._env;
|
|
620
620
|
}
|
|
621
|
+
get isImageAnonymous() {
|
|
622
|
+
return this._isImageAnonymous;
|
|
623
|
+
}
|
|
624
|
+
set isImageAnonymous(isImageAnonymous) {
|
|
625
|
+
this._isImageAnonymous = isImageAnonymous;
|
|
626
|
+
}
|
|
621
627
|
get devicePixelRatio() {
|
|
622
628
|
return this._env || this.setEnv("browser"), this.envContribution.getDevicePixelRatio();
|
|
623
629
|
}
|
|
@@ -652,7 +658,7 @@ let DefaultGlobal = class {
|
|
|
652
658
|
this._env || this.setEnv("browser"), this.envContribution.applyStyles = support;
|
|
653
659
|
}
|
|
654
660
|
constructor(contributions) {
|
|
655
|
-
this.contributions = contributions, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
661
|
+
this.contributions = contributions, this._isImageAnonymous = !0, this.id = Generator.GenAutoIncrementId(), this.hooks = {
|
|
656
662
|
onSetEnv: new SyncHook(["lastEnv", "env", "global"])
|
|
657
663
|
}, this.measureTextMethod = "native", this.optimizeVisible = !1;
|
|
658
664
|
}
|
|
@@ -1593,7 +1599,7 @@ let Step$1 = class Step {
|
|
|
1593
1599
|
default:
|
|
1594
1600
|
if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
|
|
1595
1601
|
const x1 = this._x * (1 - this._t) + x * this._t;
|
|
1596
|
-
this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
1602
|
+
.5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
1597
1603
|
}
|
|
1598
1604
|
}
|
|
1599
1605
|
this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
|
|
@@ -2415,6 +2421,7 @@ const DefaultTextAttribute = Object.assign(Object.assign(Object.assign({}, Defau
|
|
|
2415
2421
|
const DefaultRichTextAttribute = Object.assign(Object.assign(Object.assign({}, DefaultAttribute), DefaultTextStyle), {
|
|
2416
2422
|
editable: !1,
|
|
2417
2423
|
editOptions: null,
|
|
2424
|
+
ascentDescentMode: "actual",
|
|
2418
2425
|
width: 300,
|
|
2419
2426
|
height: 300,
|
|
2420
2427
|
ellipsis: !0,
|
|
@@ -2852,14 +2859,17 @@ function testLetter2(string, index) {
|
|
|
2852
2859
|
return i + 1;
|
|
2853
2860
|
}
|
|
2854
2861
|
function measureTextCanvas(text, character) {
|
|
2862
|
+
let mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "actual";
|
|
2855
2863
|
const measurement = application.graphicUtil.textMeasure.measureText(text, character),
|
|
2856
2864
|
result = {
|
|
2857
2865
|
ascent: 0,
|
|
2858
2866
|
height: 0,
|
|
2859
2867
|
descent: 0,
|
|
2860
2868
|
width: 0
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2869
|
+
},
|
|
2870
|
+
ascent = "actual" === mode ? measurement.actualBoundingBoxAscent : measurement.fontBoundingBoxAscent,
|
|
2871
|
+
descent = "actual" === mode ? measurement.actualBoundingBoxDescent : measurement.fontBoundingBoxDescent;
|
|
2872
|
+
return "number" != typeof ascent || "number" != typeof descent ? (result.width = Math.floor(measurement.width), result.height = character.fontSize || 0, result.ascent = result.height, result.descent = 0) : (result.width = Math.floor(measurement.width), result.height = Math.floor(ascent + descent), result.ascent = Math.floor(ascent), result.descent = result.height - result.ascent), result;
|
|
2863
2873
|
}
|
|
2864
2874
|
|
|
2865
2875
|
var __decorate$O = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
@@ -4381,7 +4391,7 @@ class Animate {
|
|
|
4381
4391
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
4382
4392
|
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
4383
4393
|
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
4384
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
4394
|
+
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
4385
4395
|
}
|
|
4386
4396
|
setTimeline(timeline) {
|
|
4387
4397
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
@@ -4829,7 +4839,8 @@ class IncreaseCount extends ACustomAnimate {
|
|
|
4829
4839
|
}
|
|
4830
4840
|
onEnd() {}
|
|
4831
4841
|
onUpdate(end, ratio, out) {
|
|
4832
|
-
|
|
4842
|
+
var _a;
|
|
4843
|
+
!1 !== this.valid && (out.text = end ? null === (_a = this.to) || void 0 === _a ? void 0 : _a.text : (this.fromNumber + (this.toNumber - this.fromNumber) * ratio).toFixed(this.decimalLength));
|
|
4833
4844
|
}
|
|
4834
4845
|
}
|
|
4835
4846
|
var Direction;
|
|
@@ -5045,7 +5056,7 @@ class ResourceLoader {
|
|
|
5045
5056
|
}
|
|
5046
5057
|
static GetFile(url, type) {
|
|
5047
5058
|
let data = ResourceLoader.cache.get(url);
|
|
5048
|
-
return data ? "
|
|
5059
|
+
return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
|
|
5049
5060
|
type: type,
|
|
5050
5061
|
loadState: "init"
|
|
5051
5062
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
@@ -8483,7 +8494,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
8483
8494
|
} = attribute,
|
|
8484
8495
|
b = aabbBounds;
|
|
8485
8496
|
return points.forEach(p => {
|
|
8486
|
-
!1 === p.defined && "
|
|
8497
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
8487
8498
|
}), b;
|
|
8488
8499
|
}
|
|
8489
8500
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
@@ -8494,7 +8505,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
8494
8505
|
b = aabbBounds;
|
|
8495
8506
|
return segments.forEach(s => {
|
|
8496
8507
|
s.points.forEach(p => {
|
|
8497
|
-
!1 === p.defined && "
|
|
8508
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
8498
8509
|
});
|
|
8499
8510
|
}), b;
|
|
8500
8511
|
}
|
|
@@ -8746,16 +8757,20 @@ class Frame {
|
|
|
8746
8757
|
}
|
|
8747
8758
|
|
|
8748
8759
|
function getFixedLRTB(left, right, top, bottom) {
|
|
8760
|
+
const leftInt = Math.round(left),
|
|
8761
|
+
topInt = Math.round(top),
|
|
8762
|
+
rightInt = Math.round(right),
|
|
8763
|
+
bottomInt = Math.round(bottom);
|
|
8749
8764
|
return {
|
|
8750
|
-
left:
|
|
8751
|
-
top:
|
|
8752
|
-
right:
|
|
8753
|
-
bottom:
|
|
8765
|
+
left: left > leftInt ? leftInt : leftInt - .5,
|
|
8766
|
+
top: top > topInt ? topInt : topInt - .5,
|
|
8767
|
+
right: rightInt > right ? rightInt : rightInt + .5,
|
|
8768
|
+
bottom: bottomInt > bottom ? bottomInt : bottomInt + .5
|
|
8754
8769
|
};
|
|
8755
8770
|
}
|
|
8756
8771
|
class Paragraph {
|
|
8757
|
-
constructor(text, newLine, character) {
|
|
8758
|
-
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic";
|
|
8772
|
+
constructor(text, newLine, character, ascentDescentMode) {
|
|
8773
|
+
this.fontSize = character.fontSize || 16, this.textBaseline = character.textBaseline || "alphabetic", this.ascentDescentMode = ascentDescentMode;
|
|
8759
8774
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
8760
8775
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
8761
8776
|
const {
|
|
@@ -8763,7 +8778,7 @@ class Paragraph {
|
|
|
8763
8778
|
height: height,
|
|
8764
8779
|
descent: descent,
|
|
8765
8780
|
width: width
|
|
8766
|
-
} = measureTextCanvas(text, character);
|
|
8781
|
+
} = measureTextCanvas(text, character, this.ascentDescentMode);
|
|
8767
8782
|
let halfDetaHeight = 0,
|
|
8768
8783
|
deltaAscent = 0,
|
|
8769
8784
|
deltaDescent = 0;
|
|
@@ -8772,7 +8787,7 @@ class Paragraph {
|
|
|
8772
8787
|
updateWidth() {
|
|
8773
8788
|
const {
|
|
8774
8789
|
width: width
|
|
8775
|
-
} = measureTextCanvas(this.text, this.character);
|
|
8790
|
+
} = measureTextCanvas(this.text, this.character, this.ascentDescentMode);
|
|
8776
8791
|
this.width = width, "vertical" === this.direction && (this.widthOrigin = this.width, this.width = this.heightOrigin, this.height = this.widthOrigin);
|
|
8777
8792
|
}
|
|
8778
8793
|
drawBackground(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
@@ -8789,16 +8804,24 @@ class Paragraph {
|
|
|
8789
8804
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8790
8805
|
const {
|
|
8791
8806
|
width: width
|
|
8792
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8807
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8793
8808
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
8794
8809
|
}
|
|
8795
8810
|
}
|
|
8796
8811
|
}
|
|
8812
|
+
switch (this.character.script) {
|
|
8813
|
+
case "super":
|
|
8814
|
+
baseline -= this.ascent * (1 / 3);
|
|
8815
|
+
break;
|
|
8816
|
+
case "sub":
|
|
8817
|
+
baseline += this.descent / 2;
|
|
8818
|
+
}
|
|
8819
|
+
"vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0);
|
|
8820
|
+
const fillStyle = ctx.fillStyle,
|
|
8821
|
+
globalAlpha = ctx.globalAlpha;
|
|
8822
|
+
ctx.fillStyle = this.character.background, void 0 !== this.character.backgroundOpacity && (ctx.globalAlpha = this.character.backgroundOpacity);
|
|
8797
8823
|
const lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + lineHeight);
|
|
8798
|
-
|
|
8799
|
-
fillStyle: this.character.background,
|
|
8800
|
-
globalAlpha: this.character.backgroundOpacity
|
|
8801
|
-
});
|
|
8824
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top), ctx.fillStyle = fillStyle, ctx.globalAlpha = globalAlpha;
|
|
8802
8825
|
}
|
|
8803
8826
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
8804
8827
|
let baseline = top + ascent,
|
|
@@ -8813,7 +8836,7 @@ class Paragraph {
|
|
|
8813
8836
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8814
8837
|
const {
|
|
8815
8838
|
width: width
|
|
8816
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8839
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8817
8840
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
8818
8841
|
}
|
|
8819
8842
|
}
|
|
@@ -8833,21 +8856,21 @@ class Paragraph {
|
|
|
8833
8856
|
if (this.character.underline) {
|
|
8834
8857
|
const top = 1 + baseline,
|
|
8835
8858
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8836
|
-
ctx.fillRect(lrtb.left,
|
|
8859
|
+
ctx.fillRect(lrtb.left, 1 + baseline, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
8837
8860
|
}
|
|
8838
8861
|
if (this.character.lineThrough) {
|
|
8839
8862
|
const top = 1 + baseline - this.ascent / 2,
|
|
8840
8863
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8841
|
-
ctx.fillRect(lrtb.left,
|
|
8864
|
+
ctx.fillRect(lrtb.left, 1 + baseline - this.ascent / 2, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
8842
8865
|
}
|
|
8843
8866
|
} else if ("underline" === this.character.textDecoration) {
|
|
8844
8867
|
const top = 1 + baseline,
|
|
8845
8868
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8846
|
-
ctx.fillRect(lrtb.left,
|
|
8869
|
+
ctx.fillRect(lrtb.left, 1 + baseline, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
8847
8870
|
} else if ("line-through" === this.character.textDecoration) {
|
|
8848
8871
|
const top = 1 + baseline - this.ascent / 2,
|
|
8849
8872
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8850
|
-
ctx.fillRect(lrtb.left,
|
|
8873
|
+
ctx.fillRect(lrtb.left, 1 + baseline - this.ascent / 2, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
8851
8874
|
}
|
|
8852
8875
|
"vertical" === direction && ctx.restore();
|
|
8853
8876
|
}
|
|
@@ -8861,7 +8884,7 @@ class Paragraph {
|
|
|
8861
8884
|
text = text.slice(0, index), text += this.ellipsisStr;
|
|
8862
8885
|
const {
|
|
8863
8886
|
width: measureWidth
|
|
8864
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8887
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8865
8888
|
return width + this.ellipsisWidth - measureWidth;
|
|
8866
8889
|
}
|
|
8867
8890
|
return width;
|
|
@@ -8870,7 +8893,7 @@ class Paragraph {
|
|
|
8870
8893
|
function seperateParagraph(paragraph, index) {
|
|
8871
8894
|
const text1 = paragraph.text.slice(0, index),
|
|
8872
8895
|
text2 = paragraph.text.slice(index);
|
|
8873
|
-
return [new Paragraph(text1, paragraph.newLine, paragraph.character), new Paragraph(text2, !0, paragraph.character)];
|
|
8896
|
+
return [new Paragraph(text1, paragraph.newLine, paragraph.character, paragraph.ascentDescentMode), new Paragraph(text2, !0, paragraph.character, paragraph.ascentDescentMode)];
|
|
8874
8897
|
}
|
|
8875
8898
|
|
|
8876
8899
|
const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
@@ -9059,7 +9082,7 @@ class Line {
|
|
|
9059
9082
|
paragraph.ellipsisStr = ellipsis;
|
|
9060
9083
|
const {
|
|
9061
9084
|
width: width
|
|
9062
|
-
} = measureTextCanvas(ellipsis, paragraph.character),
|
|
9085
|
+
} = measureTextCanvas(ellipsis, paragraph.character, paragraph.ascentDescentMode),
|
|
9063
9086
|
ellipsisWidth = width || 0;
|
|
9064
9087
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
9065
9088
|
lastLine && (paragraph.ellipsis = "add");
|
|
@@ -9072,19 +9095,8 @@ class Line {
|
|
|
9072
9095
|
paragraph.ellipsis = "hide", otherParagraphWidth += paragraph.width;
|
|
9073
9096
|
}
|
|
9074
9097
|
}
|
|
9075
|
-
let fillStyle = "",
|
|
9076
|
-
globalAlpha = -1,
|
|
9077
|
-
currBgList = [];
|
|
9078
|
-
const bgList = [currBgList];
|
|
9079
9098
|
this.paragraphs.forEach((paragraph, index) => {
|
|
9080
|
-
|
|
9081
|
-
const data = paragraph.drawBackground(ctx, y, this.ascent, x, 0 === index, this.textAlign, this.height);
|
|
9082
|
-
data && (fillStyle === data.fillStyle && globalAlpha === data.globalAlpha || (currBgList = [], bgList.push(currBgList), fillStyle = data.fillStyle, globalAlpha = data.globalAlpha), currBgList.push(data));
|
|
9083
|
-
}), bgList.forEach(bg => {
|
|
9084
|
-
if (0 === bg.length) return;
|
|
9085
|
-
const data = bg[0],
|
|
9086
|
-
end = bg[bg.length - 1];
|
|
9087
|
-
ctx.fillStyle = data.fillStyle, ctx.globalAlpha = data.globalAlpha, ctx.fillRect(data.left, data.top, end.right - data.left, end.bottom - data.top);
|
|
9099
|
+
paragraph instanceof RichTextIcon || paragraph.drawBackground(ctx, y, this.ascent, x, 0 === index, this.textAlign, this.height);
|
|
9088
9100
|
}), this.paragraphs.forEach((paragraph, index) => {
|
|
9089
9101
|
if (paragraph instanceof RichTextIcon) return paragraph.setAttributes({
|
|
9090
9102
|
x: x + paragraph._x,
|
|
@@ -9106,7 +9118,7 @@ class Line {
|
|
|
9106
9118
|
if (paragraph instanceof RichTextIcon) break;
|
|
9107
9119
|
const {
|
|
9108
9120
|
width: width
|
|
9109
|
-
} = measureTextCanvas(ellipsis, paragraph.character),
|
|
9121
|
+
} = measureTextCanvas(ellipsis, paragraph.character, paragraph.ascentDescentMode),
|
|
9110
9122
|
ellipsisWidth = width || 0;
|
|
9111
9123
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
9112
9124
|
paragraph.ellipsis = "add", paragraph.ellipsisWidth = ellipsisWidth;
|
|
@@ -9247,13 +9259,7 @@ class RichText extends Graphic {
|
|
|
9247
9259
|
}
|
|
9248
9260
|
return cache.every(item => item.isComposing || !(item.text && isString(item.text) && RichText.splitText(item.text).length > 1));
|
|
9249
9261
|
}
|
|
9250
|
-
static splitEmoji(text) {
|
|
9251
|
-
return [...new Intl.Segmenter().segment(text)].map(x => x.segment);
|
|
9252
|
-
}
|
|
9253
9262
|
static splitText(text) {
|
|
9254
|
-
try {
|
|
9255
|
-
return this.splitEmoji(text);
|
|
9256
|
-
} catch (e) {}
|
|
9257
9263
|
return Array.from(text);
|
|
9258
9264
|
}
|
|
9259
9265
|
static TransformTextConfig2SingleCharacter(textConfig) {
|
|
@@ -9379,7 +9385,8 @@ class RichText extends Graphic {
|
|
|
9379
9385
|
layoutDirection: layoutDirection,
|
|
9380
9386
|
singleLine: singleLine,
|
|
9381
9387
|
disableAutoWrapLine: disableAutoWrapLine,
|
|
9382
|
-
editable: editable
|
|
9388
|
+
editable: editable,
|
|
9389
|
+
ascentDescentMode: ascentDescentMode
|
|
9383
9390
|
} = this.attribute;
|
|
9384
9391
|
let {
|
|
9385
9392
|
textConfig: _tc = []
|
|
@@ -9402,8 +9409,8 @@ class RichText extends Graphic {
|
|
|
9402
9409
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
9403
9410
|
if (isNumber(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
9404
9411
|
const textParts = richTextConfig.text.split("\n");
|
|
9405
|
-
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
9406
|
-
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig));
|
|
9412
|
+
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig, ascentDescentMode));
|
|
9413
|
+
} else richTextConfig.text && paragraphs.push(new Paragraph(richTextConfig.text, !1, richTextConfig, ascentDescentMode));
|
|
9407
9414
|
}
|
|
9408
9415
|
const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
9409
9416
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -10676,8 +10683,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
10676
10683
|
constructor() {
|
|
10677
10684
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
10678
10685
|
}
|
|
10679
|
-
drawShape(
|
|
10680
|
-
return super.drawShape(
|
|
10686
|
+
drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
10687
|
+
return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
10681
10688
|
}
|
|
10682
10689
|
}
|
|
10683
10690
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -11140,7 +11147,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11140
11147
|
this._draw(line, lineAttribute, !1, drawContext, params);
|
|
11141
11148
|
}
|
|
11142
11149
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
11143
|
-
var _a
|
|
11150
|
+
var _a;
|
|
11144
11151
|
if (!cache) return;
|
|
11145
11152
|
context.beginPath();
|
|
11146
11153
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -11153,27 +11160,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11153
11160
|
x: originX = 0,
|
|
11154
11161
|
x: originY = 0
|
|
11155
11162
|
} = attribute;
|
|
11156
|
-
!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
|
|
11157
|
-
let {
|
|
11158
|
-
connectedType: connectedType,
|
|
11159
|
-
connectedX: connectedX,
|
|
11160
|
-
connectedY: connectedY,
|
|
11161
|
-
connectedStyle: connectedStyle
|
|
11162
|
-
} = attribute;
|
|
11163
|
-
if (isArray(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
11164
|
-
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
11165
|
-
offsetX: offsetX,
|
|
11166
|
-
offsetY: offsetY,
|
|
11167
|
-
offsetZ: z,
|
|
11168
|
-
drawConnect: !0,
|
|
11169
|
-
mode: connectedType,
|
|
11170
|
-
zeroX: connectedX,
|
|
11171
|
-
zeroY: connectedY
|
|
11172
|
-
});
|
|
11173
|
-
const da = [];
|
|
11174
|
-
isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
11175
|
-
}
|
|
11176
|
-
return !1;
|
|
11163
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
|
|
11177
11164
|
}
|
|
11178
11165
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
11179
11166
|
var _a;
|
|
@@ -11205,7 +11192,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11205
11192
|
segments: segments,
|
|
11206
11193
|
points: points,
|
|
11207
11194
|
closePath: closePath,
|
|
11208
|
-
curveTension = lineAttribute.curveTension
|
|
11195
|
+
curveTension = lineAttribute.curveTension,
|
|
11196
|
+
connectedType = lineAttribute.connectedType
|
|
11209
11197
|
} = line.attribute;
|
|
11210
11198
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
11211
11199
|
let {
|
|
@@ -11217,6 +11205,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11217
11205
|
clipRangeByDimension = lineAttribute.clipRangeByDimension
|
|
11218
11206
|
} = line.attribute;
|
|
11219
11207
|
if (1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
11208
|
+
function parsePoint(points, connectedType) {
|
|
11209
|
+
return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
11210
|
+
}
|
|
11220
11211
|
if (line.shouldUpdateShape()) {
|
|
11221
11212
|
const {
|
|
11222
11213
|
points: points,
|
|
@@ -11238,7 +11229,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11238
11229
|
y: lastSeg.endY,
|
|
11239
11230
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
11240
11231
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
11241
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
11232
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
11242
11233
|
startPoint: startPoint,
|
|
11243
11234
|
curveTension: curveTension
|
|
11244
11235
|
});
|
|
@@ -11257,7 +11248,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11257
11248
|
}
|
|
11258
11249
|
} else {
|
|
11259
11250
|
if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
11260
|
-
line.cache = calcLineCache(_points, curveType, {
|
|
11251
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
|
|
11261
11252
|
curveTension: curveTension
|
|
11262
11253
|
});
|
|
11263
11254
|
}
|
|
@@ -11289,11 +11280,6 @@ DefaultCanvasLineRender = __decorate$E([injectable()], DefaultCanvasLineRender);
|
|
|
11289
11280
|
|
|
11290
11281
|
function drawAreaSegments(path, segPath, percent, params) {
|
|
11291
11282
|
var _a;
|
|
11292
|
-
const {
|
|
11293
|
-
drawConnect = !1,
|
|
11294
|
-
mode = "none"
|
|
11295
|
-
} = params || {};
|
|
11296
|
-
if (drawConnect && "none" === mode) return;
|
|
11297
11283
|
const {
|
|
11298
11284
|
top: top,
|
|
11299
11285
|
bottom: bottom
|
|
@@ -11303,34 +11289,11 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
11303
11289
|
const topList = [],
|
|
11304
11290
|
bottomList = [];
|
|
11305
11291
|
let lastDefined = !0;
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
defined0 = !0;
|
|
11310
|
-
const n = top.curves.length;
|
|
11311
|
-
top.curves.forEach((curve, i) => {
|
|
11312
|
-
const bototmCurve = bottom.curves[n - i - 1];
|
|
11313
|
-
let currentTopCurve = curve,
|
|
11314
|
-
currentBottomCurve = bototmCurve;
|
|
11315
|
-
if (curve.originP1 === curve.originP2) return lastCurve = curve, void (lastBottomCurve = bototmCurve);
|
|
11316
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (currentTopCurve = lastCurve, currentBottomCurve = lastBottomCurve), curve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
11317
|
-
const {
|
|
11318
|
-
originP1: originP1,
|
|
11319
|
-
originP2: originP2
|
|
11320
|
-
} = curve;
|
|
11321
|
-
let validTopCurve, validBottomCurve;
|
|
11322
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = curve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
11323
|
-
}
|
|
11324
|
-
lastCurve = curve;
|
|
11325
|
-
}), drawAreaConnectBlock(path, topList, bottomList, params);
|
|
11326
|
-
} else {
|
|
11327
|
-
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
11328
|
-
const topCurve = top.curves[i];
|
|
11329
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
11330
|
-
}
|
|
11331
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
11292
|
+
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
11293
|
+
const topCurve = top.curves[i];
|
|
11294
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
11332
11295
|
}
|
|
11333
|
-
return;
|
|
11296
|
+
return void drawAreaBlock(path, topList, bottomList, params);
|
|
11334
11297
|
}
|
|
11335
11298
|
if (percent <= 0) return;
|
|
11336
11299
|
let {
|
|
@@ -11348,51 +11311,17 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
11348
11311
|
lastDefined = !0;
|
|
11349
11312
|
const topList = [],
|
|
11350
11313
|
bottomList = [];
|
|
11351
|
-
let lastTopCurve,
|
|
11352
|
-
lastBottomCurve,
|
|
11353
|
-
defined0 = !0;
|
|
11354
11314
|
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
11355
11315
|
const topCurve = top.curves[i],
|
|
11356
11316
|
curCurveLength = topCurve.getLength(direction),
|
|
11357
11317
|
percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
11358
11318
|
if (percent < 0) break;
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
if (topCurve.originP1 === topCurve.originP2) {
|
|
11364
|
-
lastTopCurve = topCurve, lastBottomCurve = bototmCurve;
|
|
11365
|
-
continue;
|
|
11366
|
-
}
|
|
11367
|
-
if (lastTopCurve && lastTopCurve.originP1 === lastTopCurve.originP2 && (currentTopCurve = lastTopCurve, currentBottomCurve = lastBottomCurve), topCurve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
11368
|
-
const {
|
|
11369
|
-
originP1: originP1,
|
|
11370
|
-
originP2: originP2
|
|
11371
|
-
} = topCurve;
|
|
11372
|
-
let validTopCurve, validBottomCurve;
|
|
11373
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = topCurve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
11374
|
-
}
|
|
11375
|
-
lastTopCurve = topCurve;
|
|
11376
|
-
} else {
|
|
11377
|
-
let tc = null,
|
|
11378
|
-
bc = null;
|
|
11379
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
11380
|
-
}
|
|
11319
|
+
drawedLengthUntilLast += curCurveLength;
|
|
11320
|
+
let tc = null,
|
|
11321
|
+
bc = null;
|
|
11322
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
11381
11323
|
}
|
|
11382
|
-
|
|
11383
|
-
}
|
|
11384
|
-
function drawAreaConnectBlock(path, topList, bottomList, params) {
|
|
11385
|
-
if (topList.length < 2) return;
|
|
11386
|
-
const {
|
|
11387
|
-
offsetX = 0,
|
|
11388
|
-
offsetY = 0,
|
|
11389
|
-
offsetZ = 0,
|
|
11390
|
-
mode: mode
|
|
11391
|
-
} = params || {};
|
|
11392
|
-
let curve = topList[0];
|
|
11393
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
|
|
11394
|
-
let end = curve.p3 || curve.p1;
|
|
11395
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), curve = bottomList[bottomList.length - 1], path.lineTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = bottomList[0], end = curve.p3 || curve.p1, path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), path.closePath();
|
|
11324
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
11396
11325
|
}
|
|
11397
11326
|
function drawAreaBlock(path, topList, bottomList, params) {
|
|
11398
11327
|
const {
|
|
@@ -11493,7 +11422,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11493
11422
|
fillOpacity = areaAttribute.fillOpacity,
|
|
11494
11423
|
z = areaAttribute.z,
|
|
11495
11424
|
strokeOpacity = areaAttribute.strokeOpacity,
|
|
11496
|
-
curveTension = areaAttribute.curveTension
|
|
11425
|
+
curveTension = areaAttribute.curveTension,
|
|
11426
|
+
connectedType = areaAttribute.connectedType
|
|
11497
11427
|
} = area.attribute,
|
|
11498
11428
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
11499
11429
|
if (!data) return;
|
|
@@ -11510,6 +11440,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11510
11440
|
let {
|
|
11511
11441
|
curveType = areaAttribute.curveType
|
|
11512
11442
|
} = area.attribute;
|
|
11443
|
+
function parsePoint(points, connectedType) {
|
|
11444
|
+
return "connect" !== connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
11445
|
+
}
|
|
11513
11446
|
if (closePath && "linear" === curveType && (curveType = "linearClosed"), 1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearAreaHighPerformance(area, context, !!fill, doStroke, fillOpacity, strokeOpacity, x, y, areaAttribute, drawContext, params, fillCb, strokeCb);
|
|
11514
11447
|
if (area.shouldUpdateShape()) {
|
|
11515
11448
|
if (segments && segments.length) {
|
|
@@ -11523,7 +11456,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11523
11456
|
x: lastTopSeg.endX,
|
|
11524
11457
|
y: lastTopSeg.endY
|
|
11525
11458
|
} : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
|
|
11526
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
11459
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
11527
11460
|
startPoint: startPoint,
|
|
11528
11461
|
curveTension: curveTension
|
|
11529
11462
|
});
|
|
@@ -11546,7 +11479,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11546
11479
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
11547
11480
|
});
|
|
11548
11481
|
}
|
|
11549
|
-
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
11482
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(parsePoint(bottomPoints, connectedType), "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
11550
11483
|
curveTension: curveTension
|
|
11551
11484
|
}), bottomCaches.unshift(lastBottomSeg));
|
|
11552
11485
|
}
|
|
@@ -11557,11 +11490,11 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11557
11490
|
} else {
|
|
11558
11491
|
if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
|
|
11559
11492
|
{
|
|
11560
|
-
const topPoints = points,
|
|
11493
|
+
const topPoints = parsePoint(points, connectedType),
|
|
11561
11494
|
bottomPoints = [];
|
|
11562
|
-
for (let i =
|
|
11563
|
-
x: null !== (_e =
|
|
11564
|
-
y: null !== (_f =
|
|
11495
|
+
for (let i = topPoints.length - 1; i >= 0; i--) bottomPoints.push({
|
|
11496
|
+
x: null !== (_e = topPoints[i].x1) && void 0 !== _e ? _e : topPoints[i].x,
|
|
11497
|
+
y: null !== (_f = topPoints[i].y1) && void 0 !== _f ? _f : topPoints[i].y
|
|
11565
11498
|
});
|
|
11566
11499
|
const topCache = calcLineCache(topPoints, curveType, {
|
|
11567
11500
|
curveTension: curveTension
|
|
@@ -11603,20 +11536,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11603
11536
|
this._draw(area, areaAttribute, !1, drawContext, params);
|
|
11604
11537
|
}
|
|
11605
11538
|
drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
11606
|
-
|
|
11607
|
-
return ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !1, fillCb, strokeCb), ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !0, fillCb, strokeCb), ret;
|
|
11539
|
+
return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
|
|
11608
11540
|
}
|
|
11609
|
-
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
11610
|
-
var _a, _b, _c, _d;
|
|
11541
|
+
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
11611
11542
|
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
11612
|
-
let {
|
|
11613
|
-
connectedType: connectedType,
|
|
11614
|
-
connectedX: connectedX,
|
|
11615
|
-
connectedY: connectedY,
|
|
11616
|
-
connectedStyle: connectedStyle
|
|
11617
|
-
} = attribute;
|
|
11618
|
-
const da = [];
|
|
11619
|
-
if (connect && (isArray(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
11620
11543
|
context.beginPath();
|
|
11621
11544
|
const {
|
|
11622
11545
|
points: points,
|
|
@@ -11635,11 +11558,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11635
11558
|
offsetX: offsetX,
|
|
11636
11559
|
offsetY: offsetY,
|
|
11637
11560
|
offsetZ: offsetZ,
|
|
11638
|
-
direction: direction
|
|
11639
|
-
drawConnect: connect,
|
|
11640
|
-
mode: connectedType,
|
|
11641
|
-
zeroX: connectedX,
|
|
11642
|
-
zeroY: connectedY
|
|
11561
|
+
direction: direction
|
|
11643
11562
|
}), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
11644
11563
|
attribute: attribute
|
|
11645
11564
|
}), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -11647,7 +11566,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11647
11566
|
x: originX = 0,
|
|
11648
11567
|
x: originY = 0
|
|
11649
11568
|
} = attribute;
|
|
11650
|
-
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area,
|
|
11569
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
11651
11570
|
attribute: attribute
|
|
11652
11571
|
}), (() => {
|
|
11653
11572
|
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
@@ -11657,12 +11576,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11657
11576
|
isArray(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
|
|
11658
11577
|
offsetX: offsetX,
|
|
11659
11578
|
offsetY: offsetY,
|
|
11660
|
-
offsetZ: offsetZ
|
|
11661
|
-
|
|
11662
|
-
mode: connectedType,
|
|
11663
|
-
zeroX: connectedX,
|
|
11664
|
-
zeroY: connectedY
|
|
11665
|
-
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
11579
|
+
offsetZ: offsetZ
|
|
11580
|
+
})), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
|
|
11666
11581
|
}
|
|
11667
11582
|
})(), !1;
|
|
11668
11583
|
}
|
|
@@ -20581,6 +20496,10 @@ class LabelBase extends AbstractComponent {
|
|
|
20581
20496
|
if (isFunction(dataFilter)) {
|
|
20582
20497
|
data = dataFilter(data);
|
|
20583
20498
|
}
|
|
20499
|
+
if (data && data.length) {
|
|
20500
|
+
const seenIds = new Set();
|
|
20501
|
+
data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
|
|
20502
|
+
}
|
|
20584
20503
|
let labels = this._initText(data);
|
|
20585
20504
|
if (isFunction(customLayoutFunc)) {
|
|
20586
20505
|
labels = customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
@@ -24699,34 +24618,23 @@ class MarkArea extends Marker {
|
|
|
24699
24618
|
}
|
|
24700
24619
|
getPointAttrByPosition(position) {
|
|
24701
24620
|
const { x1, x2, y1, y2 } = this._area.AABBBounds;
|
|
24621
|
+
const result = {
|
|
24622
|
+
x: (x1 + x2) / 2,
|
|
24623
|
+
y: (y1 + y2) / 2
|
|
24624
|
+
};
|
|
24702
24625
|
if (position.includes('left') || position.includes('Left')) {
|
|
24703
|
-
|
|
24704
|
-
x: x1,
|
|
24705
|
-
y: (y1 + y2) / 2
|
|
24706
|
-
};
|
|
24626
|
+
result.x = x1;
|
|
24707
24627
|
}
|
|
24708
24628
|
if (position.includes('right') || position.includes('Right')) {
|
|
24709
|
-
|
|
24710
|
-
x: x2,
|
|
24711
|
-
y: (y1 + y2) / 2
|
|
24712
|
-
};
|
|
24629
|
+
result.x = x2;
|
|
24713
24630
|
}
|
|
24714
24631
|
if (position.includes('top') || position.includes('Top')) {
|
|
24715
|
-
|
|
24716
|
-
x: (x1 + x2) / 2,
|
|
24717
|
-
y: y1
|
|
24718
|
-
};
|
|
24632
|
+
result.y = y1;
|
|
24719
24633
|
}
|
|
24720
24634
|
if (position.includes('bottom') || position.includes('Bottom')) {
|
|
24721
|
-
|
|
24722
|
-
x: (x1 + x2) / 2,
|
|
24723
|
-
y: y2
|
|
24724
|
-
};
|
|
24635
|
+
result.y = y2;
|
|
24725
24636
|
}
|
|
24726
|
-
return
|
|
24727
|
-
x: (x1 + x2) / 2,
|
|
24728
|
-
y: (y1 + y2) / 2
|
|
24729
|
-
};
|
|
24637
|
+
return result;
|
|
24730
24638
|
}
|
|
24731
24639
|
setLabelPos() {
|
|
24732
24640
|
var _a;
|
|
@@ -28156,35 +28064,36 @@ class Title extends AbstractComponent {
|
|
|
28156
28064
|
this.name = 'title';
|
|
28157
28065
|
}
|
|
28158
28066
|
render() {
|
|
28159
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
28067
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
28160
28068
|
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
28161
28069
|
const parsedPadding = normalizePadding(padding);
|
|
28162
28070
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
28071
|
+
const fixedMainTitleHeight = (_a = textStyle.height) !== null && _a !== void 0 ? _a : height;
|
|
28163
28072
|
if (this.attribute.visible !== false && textStyle.visible !== false) {
|
|
28164
|
-
const { width: mainTitleWidth,
|
|
28073
|
+
const { width: mainTitleWidth, maxHeight: mainTitleMaxHeight, maxWidth: mainTitleMaxWidth, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', maxWidth, lineClamp } = textStyle;
|
|
28165
28074
|
if (textType === 'rich' || isValid(textStyle.character)) {
|
|
28166
28075
|
const attr = Object.assign({ x,
|
|
28167
|
-
y, width: (
|
|
28076
|
+
y, width: (_b = mainTitleWidth !== null && mainTitleWidth !== void 0 ? mainTitleWidth : width) !== null && _b !== void 0 ? _b : 0, height: fixedMainTitleHeight !== null && fixedMainTitleHeight !== void 0 ? fixedMainTitleHeight : 0, ellipsis: ellipsis !== null && ellipsis !== void 0 ? ellipsis : true, wordBreak: wordBreak !== null && wordBreak !== void 0 ? wordBreak : 'break-word', maxHeight: mainTitleMaxHeight !== null && mainTitleMaxHeight !== void 0 ? mainTitleMaxHeight : maxHeight, maxWidth: mainTitleMaxWidth !== null && mainTitleMaxWidth !== void 0 ? mainTitleMaxWidth : maxWidth, textConfig: (_c = textStyle.character) !== null && _c !== void 0 ? _c : text }, textStyle);
|
|
28168
28077
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
28169
28078
|
}
|
|
28170
28079
|
else if (textType === 'html') {
|
|
28171
28080
|
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x,
|
|
28172
|
-
y, width: (_d = mainTitleWidth !== null && mainTitleWidth !== void 0 ? mainTitleWidth : width) !== null && _d !== void 0 ? _d : 0, height:
|
|
28081
|
+
y, width: (_d = mainTitleWidth !== null && mainTitleWidth !== void 0 ? mainTitleWidth : width) !== null && _d !== void 0 ? _d : 0, height: fixedMainTitleHeight !== null && fixedMainTitleHeight !== void 0 ? fixedMainTitleHeight : 0, ellipsis,
|
|
28173
28082
|
wordBreak, maxHeight: mainTitleMaxHeight !== null && mainTitleMaxHeight !== void 0 ? mainTitleMaxHeight : maxHeight, maxWidth: mainTitleMaxWidth !== null && mainTitleMaxWidth !== void 0 ? mainTitleMaxWidth : maxWidth, textConfig: [] }, textStyle);
|
|
28174
28083
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
28175
28084
|
}
|
|
28176
28085
|
else if (isValid(text)) {
|
|
28177
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: isArray(text) ? text : [text], whiteSpace: 'normal' }, textStyle), { maxLineWidth: (
|
|
28086
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: isArray(text) ? text : [text], whiteSpace: 'normal' }, textStyle), { maxLineWidth: (_f = (_e = textStyle.maxLineWidth) !== null && _e !== void 0 ? _e : mainTitleWidth) !== null && _f !== void 0 ? _f : width, heightLimit: (_g = textStyle.height) !== null && _g !== void 0 ? _g : maxHeight, lineClamp,
|
|
28178
28087
|
ellipsis,
|
|
28179
28088
|
x,
|
|
28180
28089
|
y }), 'text');
|
|
28181
28090
|
}
|
|
28182
28091
|
}
|
|
28183
|
-
const
|
|
28184
|
-
const
|
|
28092
|
+
const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;
|
|
28093
|
+
const mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
28185
28094
|
if (this.attribute.visible !== false && subtextStyle.visible !== false) {
|
|
28186
28095
|
const { width: subTitleWidth, height: subTitleHeight, maxWidth: subTitleMaxWidth, maxHeight: subTitleMaxHeight, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', lineClamp } = subtextStyle;
|
|
28187
|
-
const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight -
|
|
28096
|
+
const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
28188
28097
|
if (subtextType === 'rich' || isValid(subtextStyle.character)) {
|
|
28189
28098
|
const attr = Object.assign({ x,
|
|
28190
28099
|
y, width: (_h = subTitleWidth !== null && subTitleWidth !== void 0 ? subTitleWidth : width) !== null && _h !== void 0 ? _h : 0, height: (_j = subTitleHeight !== null && subTitleHeight !== void 0 ? subTitleHeight : height) !== null && _j !== void 0 ? _j : 0, ellipsis,
|
|
@@ -28199,47 +28108,43 @@ class Title extends AbstractComponent {
|
|
|
28199
28108
|
}
|
|
28200
28109
|
else if (isValid(subtext)) {
|
|
28201
28110
|
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: isArray(subtext) ? subtext : [subtext], whiteSpace: 'normal' }, subtextStyle), { maxLineWidth: (_o = subtextStyle.maxLineWidth) !== null && _o !== void 0 ? _o : width, heightLimit: (_p = subtextStyle.heightLimit) !== null && _p !== void 0 ? _p : maxSubTextHeight, lineClamp,
|
|
28202
|
-
ellipsis, x: 0, y:
|
|
28111
|
+
ellipsis, x: 0, y: mainTextBoundsHeight }), 'text');
|
|
28203
28112
|
}
|
|
28204
28113
|
}
|
|
28205
|
-
const
|
|
28206
|
-
const
|
|
28207
|
-
let
|
|
28208
|
-
let
|
|
28114
|
+
const subTextBoundsHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;
|
|
28115
|
+
const subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
28116
|
+
let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth);
|
|
28117
|
+
let totalHeight = mainTextBoundsHeight + ((_q = subtextStyle.height) !== null && _q !== void 0 ? _q : subTextBoundsHeight);
|
|
28209
28118
|
if (isValid(width)) {
|
|
28210
|
-
|
|
28119
|
+
totalWidth = width;
|
|
28211
28120
|
}
|
|
28212
28121
|
if (isValid(height)) {
|
|
28213
|
-
|
|
28122
|
+
totalHeight = height;
|
|
28214
28123
|
}
|
|
28215
|
-
if (isValid(minWidth) &&
|
|
28216
|
-
|
|
28124
|
+
if (isValid(minWidth) && totalWidth < minWidth) {
|
|
28125
|
+
totalWidth = minWidth;
|
|
28217
28126
|
}
|
|
28218
28127
|
if (isValid(maxWidth)) {
|
|
28219
|
-
if (
|
|
28220
|
-
|
|
28128
|
+
if (totalWidth > maxWidth) {
|
|
28129
|
+
totalWidth = maxWidth;
|
|
28221
28130
|
}
|
|
28222
28131
|
}
|
|
28223
|
-
if (isValid(minHeight) &&
|
|
28224
|
-
|
|
28132
|
+
if (isValid(minHeight) && totalHeight < minHeight) {
|
|
28133
|
+
totalHeight = minHeight;
|
|
28225
28134
|
}
|
|
28226
28135
|
if (isValid(maxHeight)) {
|
|
28227
|
-
if (
|
|
28228
|
-
|
|
28136
|
+
if (totalHeight > maxHeight) {
|
|
28137
|
+
totalHeight = maxHeight;
|
|
28229
28138
|
}
|
|
28230
28139
|
}
|
|
28231
|
-
group.attribute.width =
|
|
28232
|
-
group.attribute.height =
|
|
28140
|
+
group.attribute.width = totalWidth;
|
|
28141
|
+
group.attribute.height = totalHeight;
|
|
28233
28142
|
group.attribute.boundsPadding = parsedPadding;
|
|
28234
28143
|
if (this._mainTitle) {
|
|
28235
28144
|
if (isValid(align) || isValid(textStyle.align)) {
|
|
28236
28145
|
const mainTitleAlign = textStyle.align ? textStyle.align : align;
|
|
28237
|
-
const mainTitleWidth = (_r = textStyle.width) !== null && _r !== void 0 ? _r :
|
|
28238
|
-
if (mainTitleAlign === '
|
|
28239
|
-
this._mainTitle.setAttribute('x', 0);
|
|
28240
|
-
this._mainTitle.setAttribute('textAlign', 'left');
|
|
28241
|
-
}
|
|
28242
|
-
else if (mainTitleAlign === 'center') {
|
|
28146
|
+
const mainTitleWidth = (_r = textStyle.width) !== null && _r !== void 0 ? _r : totalWidth;
|
|
28147
|
+
if (mainTitleAlign === 'center') {
|
|
28243
28148
|
this._mainTitle.setAttribute('x', mainTitleWidth / 2);
|
|
28244
28149
|
this._mainTitle.setAttribute('textAlign', 'center');
|
|
28245
28150
|
}
|
|
@@ -28247,33 +28152,31 @@ class Title extends AbstractComponent {
|
|
|
28247
28152
|
this._mainTitle.setAttribute('x', mainTitleWidth);
|
|
28248
28153
|
this._mainTitle.setAttribute('textAlign', 'right');
|
|
28249
28154
|
}
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
const mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
28254
|
-
if (mainTitleVerticalAlign === 'top') {
|
|
28255
|
-
this._mainTitle.setAttribute('y', 0);
|
|
28256
|
-
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
28257
|
-
}
|
|
28258
|
-
else if (mainTitleVerticalAlign === 'middle') {
|
|
28259
|
-
this._mainTitle.setAttribute('y', mainTitleHeight / 2);
|
|
28260
|
-
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
28261
|
-
}
|
|
28262
|
-
else if (mainTitleVerticalAlign === 'bottom') {
|
|
28263
|
-
this._mainTitle.setAttribute('y', mainTitleHeight);
|
|
28264
|
-
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
28155
|
+
else {
|
|
28156
|
+
this._mainTitle.setAttribute('x', 0);
|
|
28157
|
+
this._mainTitle.setAttribute('textAlign', 'left');
|
|
28265
28158
|
}
|
|
28266
28159
|
}
|
|
28160
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
28161
|
+
const mainTitleHeight = fixedMainTitleHeight !== null && fixedMainTitleHeight !== void 0 ? fixedMainTitleHeight : (this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height());
|
|
28162
|
+
if (mainTitleVerticalAlign === 'middle') {
|
|
28163
|
+
this._mainTitle.setAttribute('y', mainTitleHeight / 2);
|
|
28164
|
+
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
28165
|
+
}
|
|
28166
|
+
else if (mainTitleVerticalAlign === 'bottom') {
|
|
28167
|
+
this._mainTitle.setAttribute('y', mainTitleHeight);
|
|
28168
|
+
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
28169
|
+
}
|
|
28170
|
+
else {
|
|
28171
|
+
this._mainTitle.setAttribute('y', 0);
|
|
28172
|
+
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
28173
|
+
}
|
|
28267
28174
|
}
|
|
28268
28175
|
if (this._subTitle) {
|
|
28269
28176
|
if (isValid(align) || isValid(subtextStyle.align)) {
|
|
28270
28177
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;
|
|
28271
|
-
const subTitleWidth = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s :
|
|
28272
|
-
if (subTitleAlign === '
|
|
28273
|
-
this._subTitle.setAttribute('x', 0);
|
|
28274
|
-
this._subTitle.setAttribute('textAlign', 'left');
|
|
28275
|
-
}
|
|
28276
|
-
else if (subTitleAlign === 'center') {
|
|
28178
|
+
const subTitleWidth = (_t = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s : textStyle.width) !== null && _t !== void 0 ? _t : totalWidth;
|
|
28179
|
+
if (subTitleAlign === 'center') {
|
|
28277
28180
|
this._subTitle.setAttribute('x', subTitleWidth / 2);
|
|
28278
28181
|
this._subTitle.setAttribute('textAlign', 'center');
|
|
28279
28182
|
}
|
|
@@ -28281,24 +28184,32 @@ class Title extends AbstractComponent {
|
|
|
28281
28184
|
this._subTitle.setAttribute('x', subTitleWidth);
|
|
28282
28185
|
this._subTitle.setAttribute('textAlign', 'right');
|
|
28283
28186
|
}
|
|
28284
|
-
|
|
28285
|
-
|
|
28286
|
-
|
|
28287
|
-
const subTitleYStart = maintextHeight;
|
|
28288
|
-
const subTitleHeight = (_t = subtextStyle.height) !== null && _t !== void 0 ? _t : 0;
|
|
28289
|
-
if (subTitleVerticalAlign === 'top') {
|
|
28290
|
-
this._subTitle.setAttribute('y', subTitleYStart);
|
|
28291
|
-
this._subTitle.setAttribute('textBaseline', 'top');
|
|
28292
|
-
}
|
|
28293
|
-
else if (subTitleVerticalAlign === 'middle') {
|
|
28294
|
-
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
28295
|
-
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
28296
|
-
}
|
|
28297
|
-
else if (subTitleVerticalAlign === 'bottom') {
|
|
28298
|
-
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
28299
|
-
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
28187
|
+
else {
|
|
28188
|
+
this._subTitle.setAttribute('x', 0);
|
|
28189
|
+
this._subTitle.setAttribute('textAlign', 'left');
|
|
28300
28190
|
}
|
|
28301
28191
|
}
|
|
28192
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
|
|
28193
|
+
const subTitleYStart = this._mainTitle
|
|
28194
|
+
? isValid(fixedMainTitleHeight)
|
|
28195
|
+
?
|
|
28196
|
+
this._mainTitle.AABBBounds.y1 +
|
|
28197
|
+
Math.max(this._mainTitle.AABBBounds.empty() ? 0 : this._mainTitle.AABBBounds.height(), fixedMainTitleHeight)
|
|
28198
|
+
: this._mainTitle.AABBBounds.y2
|
|
28199
|
+
: 0;
|
|
28200
|
+
const subTitleHeight = (_v = (_u = subtextStyle.height) !== null && _u !== void 0 ? _u : height) !== null && _v !== void 0 ? _v : (this._subTitle.AABBBounds.empty() ? 0 : this._subTitle.AABBBounds.height());
|
|
28201
|
+
if (subTitleVerticalAlign === 'middle') {
|
|
28202
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
28203
|
+
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
28204
|
+
}
|
|
28205
|
+
else if (subTitleVerticalAlign === 'bottom') {
|
|
28206
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
28207
|
+
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
28208
|
+
}
|
|
28209
|
+
else {
|
|
28210
|
+
this._subTitle.setAttribute('y', subTitleYStart);
|
|
28211
|
+
this._subTitle.setAttribute('textBaseline', 'top');
|
|
28212
|
+
}
|
|
28302
28213
|
}
|
|
28303
28214
|
}
|
|
28304
28215
|
}
|
|
@@ -31301,6 +31212,6 @@ StoryLabelItem.defaultAttributes = {
|
|
|
31301
31212
|
theme: 'default'
|
|
31302
31213
|
};
|
|
31303
31214
|
|
|
31304
|
-
const version = "0.22.0-vstory.
|
|
31215
|
+
const version = "0.22.0-vstory.12";
|
|
31305
31216
|
|
|
31306
31217
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, StoryLabelItem, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, WeatherBox, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|