@visactor/vrender-components 0.22.0-vstory.11 → 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/crosshair/polygon-sector.js +2 -1
- package/cjs/crosshair/type.js +1 -2
- 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 +185 -279
- package/es/axis/type.js.map +1 -1
- package/es/core/type.js.map +1 -1
- package/es/crosshair/polygon-sector.js +2 -1
- package/es/crosshair/type.js +1 -2
- 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 +3 -3
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));
|
|
@@ -5441,7 +5452,7 @@ class Graphic extends Node {
|
|
|
5441
5452
|
null != onStart && animate.onStart(onStart), null != onFrame && animate.onFrame(onFrame), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove), animate.interpolateFunc = params.interpolate;
|
|
5442
5453
|
}
|
|
5443
5454
|
return this.animates.set(animate.id, animate), animate.onRemove(() => {
|
|
5444
|
-
|
|
5455
|
+
this.animates.delete(animate.id);
|
|
5445
5456
|
}), animate;
|
|
5446
5457
|
}
|
|
5447
5458
|
onAttributeUpdate(context) {
|
|
@@ -5645,7 +5656,7 @@ class Graphic extends Node {
|
|
|
5645
5656
|
if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer), this.animates && this.animates.size) {
|
|
5646
5657
|
const timeline = stage.getTimeline();
|
|
5647
5658
|
this.animates.forEach(a => {
|
|
5648
|
-
a.
|
|
5659
|
+
a.setTimeline(timeline);
|
|
5649
5660
|
});
|
|
5650
5661
|
}
|
|
5651
5662
|
this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage);
|
|
@@ -5749,7 +5760,7 @@ class Graphic extends Node {
|
|
|
5749
5760
|
return shadowRoot && (shadowRoot.shadowHost = this), this.shadowRoot = null != shadowRoot ? shadowRoot : application.graphicService.creator.shadowRoot(this), this.addUpdateBoundTag(), this.shadowRoot.setStage(this.stage, this.layer), this.shadowRoot;
|
|
5750
5761
|
}
|
|
5751
5762
|
detachShadow() {
|
|
5752
|
-
this.shadowRoot && (this.addUpdateBoundTag(), this.shadowRoot
|
|
5763
|
+
this.shadowRoot && (this.addUpdateBoundTag(), this.shadowRoot = null);
|
|
5753
5764
|
}
|
|
5754
5765
|
toJson() {
|
|
5755
5766
|
return {
|
|
@@ -5801,7 +5812,7 @@ class Graphic extends Node {
|
|
|
5801
5812
|
});
|
|
5802
5813
|
}
|
|
5803
5814
|
release() {
|
|
5804
|
-
this.releaseStatus = "released",
|
|
5815
|
+
this.releaseStatus = "released", application.graphicService.onRelease(this);
|
|
5805
5816
|
}
|
|
5806
5817
|
_emitCustomEvent(type, context) {
|
|
5807
5818
|
var _a, _b;
|
|
@@ -6295,11 +6306,6 @@ class Group extends Graphic {
|
|
|
6295
6306
|
getNoWorkAnimateAttr() {
|
|
6296
6307
|
return Group.NOWORK_ANIMATE_ATTR;
|
|
6297
6308
|
}
|
|
6298
|
-
release(all) {
|
|
6299
|
-
all && this.forEachChildren(g => {
|
|
6300
|
-
g.release(all);
|
|
6301
|
-
}), super.release();
|
|
6302
|
-
}
|
|
6303
6309
|
}
|
|
6304
6310
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
6305
6311
|
function createGroup(attributes) {
|
|
@@ -8488,7 +8494,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
8488
8494
|
} = attribute,
|
|
8489
8495
|
b = aabbBounds;
|
|
8490
8496
|
return points.forEach(p => {
|
|
8491
|
-
!1 === p.defined && "
|
|
8497
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
8492
8498
|
}), b;
|
|
8493
8499
|
}
|
|
8494
8500
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
@@ -8499,7 +8505,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
8499
8505
|
b = aabbBounds;
|
|
8500
8506
|
return segments.forEach(s => {
|
|
8501
8507
|
s.points.forEach(p => {
|
|
8502
|
-
!1 === p.defined && "
|
|
8508
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
8503
8509
|
});
|
|
8504
8510
|
}), b;
|
|
8505
8511
|
}
|
|
@@ -8751,16 +8757,20 @@ class Frame {
|
|
|
8751
8757
|
}
|
|
8752
8758
|
|
|
8753
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);
|
|
8754
8764
|
return {
|
|
8755
|
-
left:
|
|
8756
|
-
top:
|
|
8757
|
-
right:
|
|
8758
|
-
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
|
|
8759
8769
|
};
|
|
8760
8770
|
}
|
|
8761
8771
|
class Paragraph {
|
|
8762
|
-
constructor(text, newLine, character) {
|
|
8763
|
-
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;
|
|
8764
8774
|
const lineHeight = calculateLineHeight(character.lineHeight, this.fontSize);
|
|
8765
8775
|
this.lineHeight = "number" == typeof lineHeight ? lineHeight > this.fontSize ? lineHeight : this.fontSize : Math.floor(1.2 * this.fontSize), this.height = this.lineHeight;
|
|
8766
8776
|
const {
|
|
@@ -8768,7 +8778,7 @@ class Paragraph {
|
|
|
8768
8778
|
height: height,
|
|
8769
8779
|
descent: descent,
|
|
8770
8780
|
width: width
|
|
8771
|
-
} = measureTextCanvas(text, character);
|
|
8781
|
+
} = measureTextCanvas(text, character, this.ascentDescentMode);
|
|
8772
8782
|
let halfDetaHeight = 0,
|
|
8773
8783
|
deltaAscent = 0,
|
|
8774
8784
|
deltaDescent = 0;
|
|
@@ -8777,7 +8787,7 @@ class Paragraph {
|
|
|
8777
8787
|
updateWidth() {
|
|
8778
8788
|
const {
|
|
8779
8789
|
width: width
|
|
8780
|
-
} = measureTextCanvas(this.text, this.character);
|
|
8790
|
+
} = measureTextCanvas(this.text, this.character, this.ascentDescentMode);
|
|
8781
8791
|
this.width = width, "vertical" === this.direction && (this.widthOrigin = this.width, this.width = this.heightOrigin, this.height = this.widthOrigin);
|
|
8782
8792
|
}
|
|
8783
8793
|
drawBackground(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
@@ -8794,16 +8804,24 @@ class Paragraph {
|
|
|
8794
8804
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8795
8805
|
const {
|
|
8796
8806
|
width: width
|
|
8797
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8807
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8798
8808
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
8799
8809
|
}
|
|
8800
8810
|
}
|
|
8801
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);
|
|
8802
8823
|
const lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + lineHeight);
|
|
8803
|
-
|
|
8804
|
-
fillStyle: this.character.background,
|
|
8805
|
-
globalAlpha: this.character.backgroundOpacity
|
|
8806
|
-
});
|
|
8824
|
+
ctx.fillRect(lrtb.left, lrtb.top, lrtb.right - lrtb.left, lrtb.bottom - lrtb.top), ctx.fillStyle = fillStyle, ctx.globalAlpha = globalAlpha;
|
|
8807
8825
|
}
|
|
8808
8826
|
draw(ctx, top, ascent, deltaLeft, isLineFirst, textAlign, lineHeight) {
|
|
8809
8827
|
let baseline = top + ascent,
|
|
@@ -8818,7 +8836,7 @@ class Paragraph {
|
|
|
8818
8836
|
if (text = text.slice(0, index), text += this.ellipsisStr, "right" === textAlign || "end" === textAlign) {
|
|
8819
8837
|
const {
|
|
8820
8838
|
width: width
|
|
8821
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8839
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8822
8840
|
"vertical" === direction || (left -= this.ellipsisWidth - width);
|
|
8823
8841
|
}
|
|
8824
8842
|
}
|
|
@@ -8838,21 +8856,21 @@ class Paragraph {
|
|
|
8838
8856
|
if (this.character.underline) {
|
|
8839
8857
|
const top = 1 + baseline,
|
|
8840
8858
|
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,
|
|
8859
|
+
ctx.fillRect(lrtb.left, 1 + baseline, lrtb.right - lrtb.left, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1);
|
|
8842
8860
|
}
|
|
8843
8861
|
if (this.character.lineThrough) {
|
|
8844
8862
|
const top = 1 + baseline - this.ascent / 2,
|
|
8845
8863
|
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,
|
|
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);
|
|
8847
8865
|
}
|
|
8848
8866
|
} else if ("underline" === this.character.textDecoration) {
|
|
8849
8867
|
const top = 1 + baseline,
|
|
8850
8868
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8851
|
-
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);
|
|
8852
8870
|
} else if ("line-through" === this.character.textDecoration) {
|
|
8853
8871
|
const top = 1 + baseline - this.ascent / 2,
|
|
8854
8872
|
lrtb = getFixedLRTB(left, left + (this.widthOrigin || this.width), top, top + (this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1));
|
|
8855
|
-
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);
|
|
8856
8874
|
}
|
|
8857
8875
|
"vertical" === direction && ctx.restore();
|
|
8858
8876
|
}
|
|
@@ -8866,7 +8884,7 @@ class Paragraph {
|
|
|
8866
8884
|
text = text.slice(0, index), text += this.ellipsisStr;
|
|
8867
8885
|
const {
|
|
8868
8886
|
width: measureWidth
|
|
8869
|
-
} = measureTextCanvas(this.text.slice(index), this.character);
|
|
8887
|
+
} = measureTextCanvas(this.text.slice(index), this.character, this.ascentDescentMode);
|
|
8870
8888
|
return width + this.ellipsisWidth - measureWidth;
|
|
8871
8889
|
}
|
|
8872
8890
|
return width;
|
|
@@ -8875,7 +8893,7 @@ class Paragraph {
|
|
|
8875
8893
|
function seperateParagraph(paragraph, index) {
|
|
8876
8894
|
const text1 = paragraph.text.slice(0, index),
|
|
8877
8895
|
text2 = paragraph.text.slice(index);
|
|
8878
|
-
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)];
|
|
8879
8897
|
}
|
|
8880
8898
|
|
|
8881
8899
|
const IMAGE_UPDATE_TAG_KEY = ["width", "height", "image", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
@@ -9064,7 +9082,7 @@ class Line {
|
|
|
9064
9082
|
paragraph.ellipsisStr = ellipsis;
|
|
9065
9083
|
const {
|
|
9066
9084
|
width: width
|
|
9067
|
-
} = measureTextCanvas(ellipsis, paragraph.character),
|
|
9085
|
+
} = measureTextCanvas(ellipsis, paragraph.character, paragraph.ascentDescentMode),
|
|
9068
9086
|
ellipsisWidth = width || 0;
|
|
9069
9087
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
9070
9088
|
lastLine && (paragraph.ellipsis = "add");
|
|
@@ -9077,19 +9095,8 @@ class Line {
|
|
|
9077
9095
|
paragraph.ellipsis = "hide", otherParagraphWidth += paragraph.width;
|
|
9078
9096
|
}
|
|
9079
9097
|
}
|
|
9080
|
-
let fillStyle = "",
|
|
9081
|
-
globalAlpha = -1,
|
|
9082
|
-
currBgList = [];
|
|
9083
|
-
const bgList = [currBgList];
|
|
9084
9098
|
this.paragraphs.forEach((paragraph, index) => {
|
|
9085
|
-
|
|
9086
|
-
const data = paragraph.drawBackground(ctx, y, this.ascent, x, 0 === index, this.textAlign, this.height);
|
|
9087
|
-
data && (fillStyle === data.fillStyle && globalAlpha === data.globalAlpha || (currBgList = [], bgList.push(currBgList), fillStyle = data.fillStyle, globalAlpha = data.globalAlpha), currBgList.push(data));
|
|
9088
|
-
}), bgList.forEach(bg => {
|
|
9089
|
-
if (0 === bg.length) return;
|
|
9090
|
-
const data = bg[0],
|
|
9091
|
-
end = bg[bg.length - 1];
|
|
9092
|
-
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);
|
|
9093
9100
|
}), this.paragraphs.forEach((paragraph, index) => {
|
|
9094
9101
|
if (paragraph instanceof RichTextIcon) return paragraph.setAttributes({
|
|
9095
9102
|
x: x + paragraph._x,
|
|
@@ -9111,7 +9118,7 @@ class Line {
|
|
|
9111
9118
|
if (paragraph instanceof RichTextIcon) break;
|
|
9112
9119
|
const {
|
|
9113
9120
|
width: width
|
|
9114
|
-
} = measureTextCanvas(ellipsis, paragraph.character),
|
|
9121
|
+
} = measureTextCanvas(ellipsis, paragraph.character, paragraph.ascentDescentMode),
|
|
9115
9122
|
ellipsisWidth = width || 0;
|
|
9116
9123
|
if (ellipsisWidth <= this.blankWidth + otherParagraphWidth) {
|
|
9117
9124
|
paragraph.ellipsis = "add", paragraph.ellipsisWidth = ellipsisWidth;
|
|
@@ -9252,13 +9259,7 @@ class RichText extends Graphic {
|
|
|
9252
9259
|
}
|
|
9253
9260
|
return cache.every(item => item.isComposing || !(item.text && isString(item.text) && RichText.splitText(item.text).length > 1));
|
|
9254
9261
|
}
|
|
9255
|
-
static splitEmoji(text) {
|
|
9256
|
-
return [...new Intl.Segmenter().segment(text)].map(x => x.segment);
|
|
9257
|
-
}
|
|
9258
9262
|
static splitText(text) {
|
|
9259
|
-
try {
|
|
9260
|
-
return this.splitEmoji(text);
|
|
9261
|
-
} catch (e) {}
|
|
9262
9263
|
return Array.from(text);
|
|
9263
9264
|
}
|
|
9264
9265
|
static TransformTextConfig2SingleCharacter(textConfig) {
|
|
@@ -9384,7 +9385,8 @@ class RichText extends Graphic {
|
|
|
9384
9385
|
layoutDirection: layoutDirection,
|
|
9385
9386
|
singleLine: singleLine,
|
|
9386
9387
|
disableAutoWrapLine: disableAutoWrapLine,
|
|
9387
|
-
editable: editable
|
|
9388
|
+
editable: editable,
|
|
9389
|
+
ascentDescentMode: ascentDescentMode
|
|
9388
9390
|
} = this.attribute;
|
|
9389
9391
|
let {
|
|
9390
9392
|
textConfig: _tc = []
|
|
@@ -9407,8 +9409,8 @@ class RichText extends Graphic {
|
|
|
9407
9409
|
const richTextConfig = this.combinedStyleToCharacter(textConfig[i]);
|
|
9408
9410
|
if (isNumber(richTextConfig.text) && (richTextConfig.text = `${richTextConfig.text}`), richTextConfig.text && richTextConfig.text.includes("\n")) {
|
|
9409
9411
|
const textParts = richTextConfig.text.split("\n");
|
|
9410
|
-
for (let j = 0; j < textParts.length; j++) paragraphs.push(new Paragraph(textParts[j], 0 !== j, richTextConfig));
|
|
9411
|
-
} 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));
|
|
9412
9414
|
}
|
|
9413
9415
|
const maxWidthFinite = "number" == typeof maxWidth && Number.isFinite(maxWidth) && maxWidth > 0,
|
|
9414
9416
|
maxHeightFinite = "number" == typeof maxHeight && Number.isFinite(maxHeight) && maxHeight > 0,
|
|
@@ -10681,8 +10683,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
10681
10683
|
constructor() {
|
|
10682
10684
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
10683
10685
|
}
|
|
10684
|
-
drawShape(
|
|
10685
|
-
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);
|
|
10686
10688
|
}
|
|
10687
10689
|
}
|
|
10688
10690
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -11145,7 +11147,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11145
11147
|
this._draw(line, lineAttribute, !1, drawContext, params);
|
|
11146
11148
|
}
|
|
11147
11149
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
11148
|
-
var _a
|
|
11150
|
+
var _a;
|
|
11149
11151
|
if (!cache) return;
|
|
11150
11152
|
context.beginPath();
|
|
11151
11153
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -11158,27 +11160,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11158
11160
|
x: originX = 0,
|
|
11159
11161
|
x: originY = 0
|
|
11160
11162
|
} = attribute;
|
|
11161
|
-
!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()));
|
|
11162
|
-
let {
|
|
11163
|
-
connectedType: connectedType,
|
|
11164
|
-
connectedX: connectedX,
|
|
11165
|
-
connectedY: connectedY,
|
|
11166
|
-
connectedStyle: connectedStyle
|
|
11167
|
-
} = attribute;
|
|
11168
|
-
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) {
|
|
11169
|
-
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
11170
|
-
offsetX: offsetX,
|
|
11171
|
-
offsetY: offsetY,
|
|
11172
|
-
offsetZ: z,
|
|
11173
|
-
drawConnect: !0,
|
|
11174
|
-
mode: connectedType,
|
|
11175
|
-
zeroX: connectedX,
|
|
11176
|
-
zeroY: connectedY
|
|
11177
|
-
});
|
|
11178
|
-
const da = [];
|
|
11179
|
-
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()));
|
|
11180
|
-
}
|
|
11181
|
-
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;
|
|
11182
11164
|
}
|
|
11183
11165
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
11184
11166
|
var _a;
|
|
@@ -11210,7 +11192,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11210
11192
|
segments: segments,
|
|
11211
11193
|
points: points,
|
|
11212
11194
|
closePath: closePath,
|
|
11213
|
-
curveTension = lineAttribute.curveTension
|
|
11195
|
+
curveTension = lineAttribute.curveTension,
|
|
11196
|
+
connectedType = lineAttribute.connectedType
|
|
11214
11197
|
} = line.attribute;
|
|
11215
11198
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
11216
11199
|
let {
|
|
@@ -11222,6 +11205,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11222
11205
|
clipRangeByDimension = lineAttribute.clipRangeByDimension
|
|
11223
11206
|
} = line.attribute;
|
|
11224
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
|
+
}
|
|
11225
11211
|
if (line.shouldUpdateShape()) {
|
|
11226
11212
|
const {
|
|
11227
11213
|
points: points,
|
|
@@ -11243,7 +11229,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11243
11229
|
y: lastSeg.endY,
|
|
11244
11230
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
11245
11231
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
11246
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
11232
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
11247
11233
|
startPoint: startPoint,
|
|
11248
11234
|
curveTension: curveTension
|
|
11249
11235
|
});
|
|
@@ -11262,7 +11248,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
11262
11248
|
}
|
|
11263
11249
|
} else {
|
|
11264
11250
|
if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
11265
|
-
line.cache = calcLineCache(_points, curveType, {
|
|
11251
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
|
|
11266
11252
|
curveTension: curveTension
|
|
11267
11253
|
});
|
|
11268
11254
|
}
|
|
@@ -11294,11 +11280,6 @@ DefaultCanvasLineRender = __decorate$E([injectable()], DefaultCanvasLineRender);
|
|
|
11294
11280
|
|
|
11295
11281
|
function drawAreaSegments(path, segPath, percent, params) {
|
|
11296
11282
|
var _a;
|
|
11297
|
-
const {
|
|
11298
|
-
drawConnect = !1,
|
|
11299
|
-
mode = "none"
|
|
11300
|
-
} = params || {};
|
|
11301
|
-
if (drawConnect && "none" === mode) return;
|
|
11302
11283
|
const {
|
|
11303
11284
|
top: top,
|
|
11304
11285
|
bottom: bottom
|
|
@@ -11308,34 +11289,11 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
11308
11289
|
const topList = [],
|
|
11309
11290
|
bottomList = [];
|
|
11310
11291
|
let lastDefined = !0;
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
defined0 = !0;
|
|
11315
|
-
const n = top.curves.length;
|
|
11316
|
-
top.curves.forEach((curve, i) => {
|
|
11317
|
-
const bototmCurve = bottom.curves[n - i - 1];
|
|
11318
|
-
let currentTopCurve = curve,
|
|
11319
|
-
currentBottomCurve = bototmCurve;
|
|
11320
|
-
if (curve.originP1 === curve.originP2) return lastCurve = curve, void (lastBottomCurve = bototmCurve);
|
|
11321
|
-
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 {
|
|
11322
|
-
const {
|
|
11323
|
-
originP1: originP1,
|
|
11324
|
-
originP2: originP2
|
|
11325
|
-
} = curve;
|
|
11326
|
-
let validTopCurve, validBottomCurve;
|
|
11327
|
-
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);
|
|
11328
|
-
}
|
|
11329
|
-
lastCurve = curve;
|
|
11330
|
-
}), drawAreaConnectBlock(path, topList, bottomList, params);
|
|
11331
|
-
} else {
|
|
11332
|
-
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
11333
|
-
const topCurve = top.curves[i];
|
|
11334
|
-
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]));
|
|
11335
|
-
}
|
|
11336
|
-
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]));
|
|
11337
11295
|
}
|
|
11338
|
-
return;
|
|
11296
|
+
return void drawAreaBlock(path, topList, bottomList, params);
|
|
11339
11297
|
}
|
|
11340
11298
|
if (percent <= 0) return;
|
|
11341
11299
|
let {
|
|
@@ -11353,51 +11311,17 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
11353
11311
|
lastDefined = !0;
|
|
11354
11312
|
const topList = [],
|
|
11355
11313
|
bottomList = [];
|
|
11356
|
-
let lastTopCurve,
|
|
11357
|
-
lastBottomCurve,
|
|
11358
|
-
defined0 = !0;
|
|
11359
11314
|
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
11360
11315
|
const topCurve = top.curves[i],
|
|
11361
11316
|
curCurveLength = topCurve.getLength(direction),
|
|
11362
11317
|
percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
11363
11318
|
if (percent < 0) break;
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
if (topCurve.originP1 === topCurve.originP2) {
|
|
11369
|
-
lastTopCurve = topCurve, lastBottomCurve = bototmCurve;
|
|
11370
|
-
continue;
|
|
11371
|
-
}
|
|
11372
|
-
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 {
|
|
11373
|
-
const {
|
|
11374
|
-
originP1: originP1,
|
|
11375
|
-
originP2: originP2
|
|
11376
|
-
} = topCurve;
|
|
11377
|
-
let validTopCurve, validBottomCurve;
|
|
11378
|
-
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);
|
|
11379
|
-
}
|
|
11380
|
-
lastTopCurve = topCurve;
|
|
11381
|
-
} else {
|
|
11382
|
-
let tc = null,
|
|
11383
|
-
bc = null;
|
|
11384
|
-
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;
|
|
11385
|
-
}
|
|
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;
|
|
11386
11323
|
}
|
|
11387
|
-
|
|
11388
|
-
}
|
|
11389
|
-
function drawAreaConnectBlock(path, topList, bottomList, params) {
|
|
11390
|
-
if (topList.length < 2) return;
|
|
11391
|
-
const {
|
|
11392
|
-
offsetX = 0,
|
|
11393
|
-
offsetY = 0,
|
|
11394
|
-
offsetZ = 0,
|
|
11395
|
-
mode: mode
|
|
11396
|
-
} = params || {};
|
|
11397
|
-
let curve = topList[0];
|
|
11398
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
|
|
11399
|
-
let end = curve.p3 || curve.p1;
|
|
11400
|
-
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);
|
|
11401
11325
|
}
|
|
11402
11326
|
function drawAreaBlock(path, topList, bottomList, params) {
|
|
11403
11327
|
const {
|
|
@@ -11498,7 +11422,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11498
11422
|
fillOpacity = areaAttribute.fillOpacity,
|
|
11499
11423
|
z = areaAttribute.z,
|
|
11500
11424
|
strokeOpacity = areaAttribute.strokeOpacity,
|
|
11501
|
-
curveTension = areaAttribute.curveTension
|
|
11425
|
+
curveTension = areaAttribute.curveTension,
|
|
11426
|
+
connectedType = areaAttribute.connectedType
|
|
11502
11427
|
} = area.attribute,
|
|
11503
11428
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
11504
11429
|
if (!data) return;
|
|
@@ -11515,6 +11440,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11515
11440
|
let {
|
|
11516
11441
|
curveType = areaAttribute.curveType
|
|
11517
11442
|
} = area.attribute;
|
|
11443
|
+
function parsePoint(points, connectedType) {
|
|
11444
|
+
return "connect" !== connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
11445
|
+
}
|
|
11518
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);
|
|
11519
11447
|
if (area.shouldUpdateShape()) {
|
|
11520
11448
|
if (segments && segments.length) {
|
|
@@ -11528,7 +11456,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11528
11456
|
x: lastTopSeg.endX,
|
|
11529
11457
|
y: lastTopSeg.endY
|
|
11530
11458
|
} : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
|
|
11531
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
11459
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
11532
11460
|
startPoint: startPoint,
|
|
11533
11461
|
curveTension: curveTension
|
|
11534
11462
|
});
|
|
@@ -11551,7 +11479,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11551
11479
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
11552
11480
|
});
|
|
11553
11481
|
}
|
|
11554
|
-
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, {
|
|
11555
11483
|
curveTension: curveTension
|
|
11556
11484
|
}), bottomCaches.unshift(lastBottomSeg));
|
|
11557
11485
|
}
|
|
@@ -11562,11 +11490,11 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11562
11490
|
} else {
|
|
11563
11491
|
if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
|
|
11564
11492
|
{
|
|
11565
|
-
const topPoints = points,
|
|
11493
|
+
const topPoints = parsePoint(points, connectedType),
|
|
11566
11494
|
bottomPoints = [];
|
|
11567
|
-
for (let i =
|
|
11568
|
-
x: null !== (_e =
|
|
11569
|
-
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
|
|
11570
11498
|
});
|
|
11571
11499
|
const topCache = calcLineCache(topPoints, curveType, {
|
|
11572
11500
|
curveTension: curveTension
|
|
@@ -11608,20 +11536,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11608
11536
|
this._draw(area, areaAttribute, !1, drawContext, params);
|
|
11609
11537
|
}
|
|
11610
11538
|
drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
11611
|
-
|
|
11612
|
-
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);
|
|
11613
11540
|
}
|
|
11614
|
-
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
11615
|
-
var _a, _b, _c, _d;
|
|
11541
|
+
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
11616
11542
|
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
11617
|
-
let {
|
|
11618
|
-
connectedType: connectedType,
|
|
11619
|
-
connectedX: connectedX,
|
|
11620
|
-
connectedY: connectedY,
|
|
11621
|
-
connectedStyle: connectedStyle
|
|
11622
|
-
} = attribute;
|
|
11623
|
-
const da = [];
|
|
11624
|
-
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;
|
|
11625
11543
|
context.beginPath();
|
|
11626
11544
|
const {
|
|
11627
11545
|
points: points,
|
|
@@ -11640,11 +11558,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11640
11558
|
offsetX: offsetX,
|
|
11641
11559
|
offsetY: offsetY,
|
|
11642
11560
|
offsetZ: offsetZ,
|
|
11643
|
-
direction: direction
|
|
11644
|
-
drawConnect: connect,
|
|
11645
|
-
mode: connectedType,
|
|
11646
|
-
zeroX: connectedX,
|
|
11647
|
-
zeroY: connectedY
|
|
11561
|
+
direction: direction
|
|
11648
11562
|
}), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
11649
11563
|
attribute: attribute
|
|
11650
11564
|
}), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -11652,7 +11566,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11652
11566
|
x: originX = 0,
|
|
11653
11567
|
x: originY = 0
|
|
11654
11568
|
} = attribute;
|
|
11655
|
-
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, {
|
|
11656
11570
|
attribute: attribute
|
|
11657
11571
|
}), (() => {
|
|
11658
11572
|
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
@@ -11662,12 +11576,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
11662
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", {
|
|
11663
11577
|
offsetX: offsetX,
|
|
11664
11578
|
offsetY: offsetY,
|
|
11665
|
-
offsetZ: offsetZ
|
|
11666
|
-
|
|
11667
|
-
mode: connectedType,
|
|
11668
|
-
zeroX: connectedX,
|
|
11669
|
-
zeroY: connectedY
|
|
11670
|
-
})), 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();
|
|
11671
11581
|
}
|
|
11672
11582
|
})(), !1;
|
|
11673
11583
|
}
|
|
@@ -20586,6 +20496,10 @@ class LabelBase extends AbstractComponent {
|
|
|
20586
20496
|
if (isFunction(dataFilter)) {
|
|
20587
20497
|
data = dataFilter(data);
|
|
20588
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
|
+
}
|
|
20589
20503
|
let labels = this._initText(data);
|
|
20590
20504
|
if (isFunction(customLayoutFunc)) {
|
|
20591
20505
|
labels = customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
@@ -24704,34 +24618,23 @@ class MarkArea extends Marker {
|
|
|
24704
24618
|
}
|
|
24705
24619
|
getPointAttrByPosition(position) {
|
|
24706
24620
|
const { x1, x2, y1, y2 } = this._area.AABBBounds;
|
|
24621
|
+
const result = {
|
|
24622
|
+
x: (x1 + x2) / 2,
|
|
24623
|
+
y: (y1 + y2) / 2
|
|
24624
|
+
};
|
|
24707
24625
|
if (position.includes('left') || position.includes('Left')) {
|
|
24708
|
-
|
|
24709
|
-
x: x1,
|
|
24710
|
-
y: (y1 + y2) / 2
|
|
24711
|
-
};
|
|
24626
|
+
result.x = x1;
|
|
24712
24627
|
}
|
|
24713
24628
|
if (position.includes('right') || position.includes('Right')) {
|
|
24714
|
-
|
|
24715
|
-
x: x2,
|
|
24716
|
-
y: (y1 + y2) / 2
|
|
24717
|
-
};
|
|
24629
|
+
result.x = x2;
|
|
24718
24630
|
}
|
|
24719
24631
|
if (position.includes('top') || position.includes('Top')) {
|
|
24720
|
-
|
|
24721
|
-
x: (x1 + x2) / 2,
|
|
24722
|
-
y: y1
|
|
24723
|
-
};
|
|
24632
|
+
result.y = y1;
|
|
24724
24633
|
}
|
|
24725
24634
|
if (position.includes('bottom') || position.includes('Bottom')) {
|
|
24726
|
-
|
|
24727
|
-
x: (x1 + x2) / 2,
|
|
24728
|
-
y: y2
|
|
24729
|
-
};
|
|
24635
|
+
result.y = y2;
|
|
24730
24636
|
}
|
|
24731
|
-
return
|
|
24732
|
-
x: (x1 + x2) / 2,
|
|
24733
|
-
y: (y1 + y2) / 2
|
|
24734
|
-
};
|
|
24637
|
+
return result;
|
|
24735
24638
|
}
|
|
24736
24639
|
setLabelPos() {
|
|
24737
24640
|
var _a;
|
|
@@ -28161,35 +28064,36 @@ class Title extends AbstractComponent {
|
|
|
28161
28064
|
this.name = 'title';
|
|
28162
28065
|
}
|
|
28163
28066
|
render() {
|
|
28164
|
-
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;
|
|
28165
28068
|
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
28166
28069
|
const parsedPadding = normalizePadding(padding);
|
|
28167
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;
|
|
28168
28072
|
if (this.attribute.visible !== false && textStyle.visible !== false) {
|
|
28169
|
-
const { width: mainTitleWidth,
|
|
28073
|
+
const { width: mainTitleWidth, maxHeight: mainTitleMaxHeight, maxWidth: mainTitleMaxWidth, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', maxWidth, lineClamp } = textStyle;
|
|
28170
28074
|
if (textType === 'rich' || isValid(textStyle.character)) {
|
|
28171
28075
|
const attr = Object.assign({ x,
|
|
28172
|
-
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);
|
|
28173
28077
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
28174
28078
|
}
|
|
28175
28079
|
else if (textType === 'html') {
|
|
28176
28080
|
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x,
|
|
28177
|
-
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,
|
|
28178
28082
|
wordBreak, maxHeight: mainTitleMaxHeight !== null && mainTitleMaxHeight !== void 0 ? mainTitleMaxHeight : maxHeight, maxWidth: mainTitleMaxWidth !== null && mainTitleMaxWidth !== void 0 ? mainTitleMaxWidth : maxWidth, textConfig: [] }, textStyle);
|
|
28179
28083
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
28180
28084
|
}
|
|
28181
28085
|
else if (isValid(text)) {
|
|
28182
|
-
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,
|
|
28183
28087
|
ellipsis,
|
|
28184
28088
|
x,
|
|
28185
28089
|
y }), 'text');
|
|
28186
28090
|
}
|
|
28187
28091
|
}
|
|
28188
|
-
const
|
|
28189
|
-
const
|
|
28092
|
+
const mainTextBoundsHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;
|
|
28093
|
+
const mainTextBoundsWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
28190
28094
|
if (this.attribute.visible !== false && subtextStyle.visible !== false) {
|
|
28191
28095
|
const { width: subTitleWidth, height: subTitleHeight, maxWidth: subTitleMaxWidth, maxHeight: subTitleMaxHeight, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', lineClamp } = subtextStyle;
|
|
28192
|
-
const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight -
|
|
28096
|
+
const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - mainTextBoundsHeight);
|
|
28193
28097
|
if (subtextType === 'rich' || isValid(subtextStyle.character)) {
|
|
28194
28098
|
const attr = Object.assign({ x,
|
|
28195
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,
|
|
@@ -28204,47 +28108,43 @@ class Title extends AbstractComponent {
|
|
|
28204
28108
|
}
|
|
28205
28109
|
else if (isValid(subtext)) {
|
|
28206
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,
|
|
28207
|
-
ellipsis, x: 0, y:
|
|
28111
|
+
ellipsis, x: 0, y: mainTextBoundsHeight }), 'text');
|
|
28208
28112
|
}
|
|
28209
28113
|
}
|
|
28210
|
-
const
|
|
28211
|
-
const
|
|
28212
|
-
let
|
|
28213
|
-
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);
|
|
28214
28118
|
if (isValid(width)) {
|
|
28215
|
-
|
|
28119
|
+
totalWidth = width;
|
|
28216
28120
|
}
|
|
28217
28121
|
if (isValid(height)) {
|
|
28218
|
-
|
|
28122
|
+
totalHeight = height;
|
|
28219
28123
|
}
|
|
28220
|
-
if (isValid(minWidth) &&
|
|
28221
|
-
|
|
28124
|
+
if (isValid(minWidth) && totalWidth < minWidth) {
|
|
28125
|
+
totalWidth = minWidth;
|
|
28222
28126
|
}
|
|
28223
28127
|
if (isValid(maxWidth)) {
|
|
28224
|
-
if (
|
|
28225
|
-
|
|
28128
|
+
if (totalWidth > maxWidth) {
|
|
28129
|
+
totalWidth = maxWidth;
|
|
28226
28130
|
}
|
|
28227
28131
|
}
|
|
28228
|
-
if (isValid(minHeight) &&
|
|
28229
|
-
|
|
28132
|
+
if (isValid(minHeight) && totalHeight < minHeight) {
|
|
28133
|
+
totalHeight = minHeight;
|
|
28230
28134
|
}
|
|
28231
28135
|
if (isValid(maxHeight)) {
|
|
28232
|
-
if (
|
|
28233
|
-
|
|
28136
|
+
if (totalHeight > maxHeight) {
|
|
28137
|
+
totalHeight = maxHeight;
|
|
28234
28138
|
}
|
|
28235
28139
|
}
|
|
28236
|
-
group.attribute.width =
|
|
28237
|
-
group.attribute.height =
|
|
28140
|
+
group.attribute.width = totalWidth;
|
|
28141
|
+
group.attribute.height = totalHeight;
|
|
28238
28142
|
group.attribute.boundsPadding = parsedPadding;
|
|
28239
28143
|
if (this._mainTitle) {
|
|
28240
28144
|
if (isValid(align) || isValid(textStyle.align)) {
|
|
28241
28145
|
const mainTitleAlign = textStyle.align ? textStyle.align : align;
|
|
28242
|
-
const mainTitleWidth = (_r = textStyle.width) !== null && _r !== void 0 ? _r :
|
|
28243
|
-
if (mainTitleAlign === '
|
|
28244
|
-
this._mainTitle.setAttribute('x', 0);
|
|
28245
|
-
this._mainTitle.setAttribute('textAlign', 'left');
|
|
28246
|
-
}
|
|
28247
|
-
else if (mainTitleAlign === 'center') {
|
|
28146
|
+
const mainTitleWidth = (_r = textStyle.width) !== null && _r !== void 0 ? _r : totalWidth;
|
|
28147
|
+
if (mainTitleAlign === 'center') {
|
|
28248
28148
|
this._mainTitle.setAttribute('x', mainTitleWidth / 2);
|
|
28249
28149
|
this._mainTitle.setAttribute('textAlign', 'center');
|
|
28250
28150
|
}
|
|
@@ -28252,33 +28152,31 @@ class Title extends AbstractComponent {
|
|
|
28252
28152
|
this._mainTitle.setAttribute('x', mainTitleWidth);
|
|
28253
28153
|
this._mainTitle.setAttribute('textAlign', 'right');
|
|
28254
28154
|
}
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
const mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
28259
|
-
if (mainTitleVerticalAlign === 'top') {
|
|
28260
|
-
this._mainTitle.setAttribute('y', 0);
|
|
28261
|
-
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
28262
|
-
}
|
|
28263
|
-
else if (mainTitleVerticalAlign === 'middle') {
|
|
28264
|
-
this._mainTitle.setAttribute('y', mainTitleHeight / 2);
|
|
28265
|
-
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
28266
|
-
}
|
|
28267
|
-
else if (mainTitleVerticalAlign === 'bottom') {
|
|
28268
|
-
this._mainTitle.setAttribute('y', mainTitleHeight);
|
|
28269
|
-
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
28155
|
+
else {
|
|
28156
|
+
this._mainTitle.setAttribute('x', 0);
|
|
28157
|
+
this._mainTitle.setAttribute('textAlign', 'left');
|
|
28270
28158
|
}
|
|
28271
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
|
+
}
|
|
28272
28174
|
}
|
|
28273
28175
|
if (this._subTitle) {
|
|
28274
28176
|
if (isValid(align) || isValid(subtextStyle.align)) {
|
|
28275
28177
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;
|
|
28276
|
-
const subTitleWidth = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s :
|
|
28277
|
-
if (subTitleAlign === '
|
|
28278
|
-
this._subTitle.setAttribute('x', 0);
|
|
28279
|
-
this._subTitle.setAttribute('textAlign', 'left');
|
|
28280
|
-
}
|
|
28281
|
-
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') {
|
|
28282
28180
|
this._subTitle.setAttribute('x', subTitleWidth / 2);
|
|
28283
28181
|
this._subTitle.setAttribute('textAlign', 'center');
|
|
28284
28182
|
}
|
|
@@ -28286,24 +28184,32 @@ class Title extends AbstractComponent {
|
|
|
28286
28184
|
this._subTitle.setAttribute('x', subTitleWidth);
|
|
28287
28185
|
this._subTitle.setAttribute('textAlign', 'right');
|
|
28288
28186
|
}
|
|
28289
|
-
|
|
28290
|
-
|
|
28291
|
-
|
|
28292
|
-
const subTitleYStart = maintextHeight;
|
|
28293
|
-
const subTitleHeight = (_t = subtextStyle.height) !== null && _t !== void 0 ? _t : 0;
|
|
28294
|
-
if (subTitleVerticalAlign === 'top') {
|
|
28295
|
-
this._subTitle.setAttribute('y', subTitleYStart);
|
|
28296
|
-
this._subTitle.setAttribute('textBaseline', 'top');
|
|
28297
|
-
}
|
|
28298
|
-
else if (subTitleVerticalAlign === 'middle') {
|
|
28299
|
-
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
28300
|
-
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
28301
|
-
}
|
|
28302
|
-
else if (subTitleVerticalAlign === 'bottom') {
|
|
28303
|
-
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
28304
|
-
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
28187
|
+
else {
|
|
28188
|
+
this._subTitle.setAttribute('x', 0);
|
|
28189
|
+
this._subTitle.setAttribute('textAlign', 'left');
|
|
28305
28190
|
}
|
|
28306
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
|
+
}
|
|
28307
28213
|
}
|
|
28308
28214
|
}
|
|
28309
28215
|
}
|
|
@@ -31306,6 +31212,6 @@ StoryLabelItem.defaultAttributes = {
|
|
|
31306
31212
|
theme: 'default'
|
|
31307
31213
|
};
|
|
31308
31214
|
|
|
31309
|
-
const version = "0.22.0-vstory.
|
|
31215
|
+
const version = "0.22.0-vstory.12";
|
|
31310
31216
|
|
|
31311
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 };
|