@visactor/vchart 1.13.8 → 1.13.9-alpha.1
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/build/es5/index.js +1 -1
- package/build/index.es.js +214 -189
- package/build/index.js +214 -189
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/marker/mark-area/base-mark-area.js +27 -17
- package/cjs/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-area/interface/theme.js.map +1 -1
- package/cjs/component/marker/mark-line/base-mark-line.js +31 -20
- package/cjs/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/cartesian-mark-line.js +20 -16
- package/cjs/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/cjs/component/marker/mark-line/interface/theme.js.map +1 -1
- package/cjs/constant/funnel.js +2 -1
- package/cjs/constant/sunburst.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/interface.js +2 -1
- package/cjs/core/vchart.js +1 -2
- package/esm/component/marker/mark-area/base-mark-area.js +27 -16
- package/esm/component/marker/mark-area/base-mark-area.js.map +1 -1
- package/esm/component/marker/mark-area/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-area/interface/theme.js.map +1 -1
- package/esm/component/marker/mark-line/base-mark-line.js +30 -19
- package/esm/component/marker/mark-line/base-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/cartesian-mark-line.js +20 -16
- package/esm/component/marker/mark-line/cartesian-mark-line.js.map +1 -1
- package/esm/component/marker/mark-line/interface/theme.d.ts +4 -3
- package/esm/component/marker/mark-line/interface/theme.js.map +1 -1
- package/esm/constant/funnel.js +2 -1
- package/esm/constant/sunburst.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/interface.js +2 -1
- package/esm/core/vchart.js +1 -2
- package/package.json +7 -7
package/build/index.es.js
CHANGED
|
@@ -39824,17 +39824,26 @@ function commonLineClipIn(line, label, duration, delay, easing) {
|
|
|
39824
39824
|
l.animate().wait(delay + startSymbolDuration + index * stepDuration).to({
|
|
39825
39825
|
clipRange: 1
|
|
39826
39826
|
}, stepDuration, easing);
|
|
39827
|
-
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
|
|
39827
|
+
}), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing), array(label).forEach(labelNode => {
|
|
39828
|
+
const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
|
|
39829
|
+
graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
|
|
39830
|
+
});
|
|
39828
39831
|
}
|
|
39829
39832
|
|
|
39830
39833
|
function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
39831
|
-
segmentFadeIn(line, delay, duration, easing),
|
|
39834
|
+
segmentFadeIn(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39835
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
39836
|
+
});
|
|
39832
39837
|
}
|
|
39833
39838
|
function areaFadeIn(area, label, duration, delay, easing) {
|
|
39834
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
39839
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39840
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
39841
|
+
});
|
|
39835
39842
|
}
|
|
39836
39843
|
function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
39837
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
39844
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39845
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
39846
|
+
});
|
|
39838
39847
|
}
|
|
39839
39848
|
function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39840
39849
|
var _a;
|
|
@@ -39842,13 +39851,19 @@ function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
|
39842
39851
|
}
|
|
39843
39852
|
|
|
39844
39853
|
function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
39845
|
-
segmentFadeOut(line, delay, duration, easing),
|
|
39854
|
+
segmentFadeOut(line, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39855
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
39856
|
+
});
|
|
39846
39857
|
}
|
|
39847
39858
|
function areaFadeOut(area, label, duration, delay, easing) {
|
|
39848
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
39859
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39860
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
39861
|
+
});
|
|
39849
39862
|
}
|
|
39850
39863
|
function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
39851
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
39864
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach(labelNode => {
|
|
39865
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
39866
|
+
});
|
|
39852
39867
|
}
|
|
39853
39868
|
function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
39854
39869
|
var _a;
|
|
@@ -40020,6 +40035,57 @@ const DefaultExitMarkerAnimation = {
|
|
|
40020
40035
|
delay: 0
|
|
40021
40036
|
};
|
|
40022
40037
|
|
|
40038
|
+
class MarkLabelMixin {
|
|
40039
|
+
getLabel() {
|
|
40040
|
+
return this._label;
|
|
40041
|
+
}
|
|
40042
|
+
_addMarkLabels(container, labelName, defaultLabelAttrs) {
|
|
40043
|
+
const {
|
|
40044
|
+
label: label,
|
|
40045
|
+
state: state
|
|
40046
|
+
} = this.attribute,
|
|
40047
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40048
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground),
|
|
40049
|
+
labelShapes = array(label).map((labelAttrs, index) => {
|
|
40050
|
+
var _a, _b;
|
|
40051
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labelAttrs),
|
|
40052
|
+
markLabel = new Tag(Object.assign(Object.assign({}, finalLabelAttrs), {
|
|
40053
|
+
state: {
|
|
40054
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40055
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40056
|
+
}
|
|
40057
|
+
}));
|
|
40058
|
+
return markLabel.name = labelName, container.add(markLabel), this.setLabelPos(markLabel, finalLabelAttrs), markLabel;
|
|
40059
|
+
});
|
|
40060
|
+
this._label = 1 === array(labelShapes).length ? labelShapes[0] : labelShapes;
|
|
40061
|
+
}
|
|
40062
|
+
_updateMarkLabels(defaultLabelAttrs) {
|
|
40063
|
+
const {
|
|
40064
|
+
label: label,
|
|
40065
|
+
state: state
|
|
40066
|
+
} = this.attribute,
|
|
40067
|
+
labelShapes = array(this._label),
|
|
40068
|
+
labelStates = array(null == state ? void 0 : state.label),
|
|
40069
|
+
labelBackgroundStates = array(null == state ? void 0 : state.labelBackground);
|
|
40070
|
+
if (labelShapes.length) {
|
|
40071
|
+
const labels = array(label);
|
|
40072
|
+
labelShapes.forEach((labelItem, index) => {
|
|
40073
|
+
var _a, _b;
|
|
40074
|
+
const finalLabelAttrs = merge$1({}, defaultLabelAttrs, labels[index]);
|
|
40075
|
+
labelItem.setAttributes(Object.assign(Object.assign({
|
|
40076
|
+
dx: 0,
|
|
40077
|
+
dy: 0
|
|
40078
|
+
}, finalLabelAttrs), {
|
|
40079
|
+
state: {
|
|
40080
|
+
panel: merge$1({}, DEFAULT_STATES$2, null !== (_a = labelBackgroundStates[index]) && void 0 !== _a ? _a : last(labelBackgroundStates)),
|
|
40081
|
+
text: merge$1({}, DEFAULT_STATES$2, null !== (_b = labelStates[index]) && void 0 !== _b ? _b : last(labelStates))
|
|
40082
|
+
}
|
|
40083
|
+
})), this.setLabelPos(labelItem, finalLabelAttrs);
|
|
40084
|
+
});
|
|
40085
|
+
}
|
|
40086
|
+
}
|
|
40087
|
+
}
|
|
40088
|
+
|
|
40023
40089
|
class MarkCommonLine extends Marker {
|
|
40024
40090
|
constructor() {
|
|
40025
40091
|
super(...arguments), this.name = "markCommonLine", this.defaultUpdateAnimation = DefaultUpdateMarkLineAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
@@ -40027,24 +40093,20 @@ class MarkCommonLine extends Marker {
|
|
|
40027
40093
|
getLine() {
|
|
40028
40094
|
return this._line;
|
|
40029
40095
|
}
|
|
40030
|
-
|
|
40031
|
-
return this._label;
|
|
40032
|
-
}
|
|
40033
|
-
setLabelPos() {
|
|
40096
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40034
40097
|
const {
|
|
40035
|
-
label = {},
|
|
40036
40098
|
limitRect: limitRect
|
|
40037
40099
|
} = this.attribute,
|
|
40038
40100
|
{
|
|
40039
40101
|
position: position,
|
|
40040
40102
|
confine: confine,
|
|
40041
40103
|
autoRotate: autoRotate
|
|
40042
|
-
} =
|
|
40043
|
-
labelPoint = this.getPointAttrByPosition(position),
|
|
40104
|
+
} = labelAttrs,
|
|
40105
|
+
labelPoint = this.getPointAttrByPosition(position, labelAttrs),
|
|
40044
40106
|
labelAngle = position.toString().toLocaleLowerCase().includes("start") ? this._line.getStartAngle() || 0 : this._line.getEndAngle() || 0;
|
|
40045
|
-
if (
|
|
40046
|
-
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle) : 0,
|
|
40047
|
-
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)),
|
|
40107
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint.position), {
|
|
40108
|
+
angle: autoRotate ? this.getRotateByAngle(labelPoint.angle, labelAttrs) : 0,
|
|
40109
|
+
textStyle: Object.assign(Object.assign({}, this.getTextStyle(position, labelAngle, autoRotate)), labelAttrs.textStyle)
|
|
40048
40110
|
})), limitRect && confine) {
|
|
40049
40111
|
const {
|
|
40050
40112
|
x: x,
|
|
@@ -40052,7 +40114,7 @@ class MarkCommonLine extends Marker {
|
|
|
40052
40114
|
width: width,
|
|
40053
40115
|
height: height
|
|
40054
40116
|
} = limitRect;
|
|
40055
|
-
limitShapeInBounds(
|
|
40117
|
+
limitShapeInBounds(labelNode, {
|
|
40056
40118
|
x1: x,
|
|
40057
40119
|
y1: y,
|
|
40058
40120
|
x2: x + width,
|
|
@@ -40061,36 +40123,14 @@ class MarkCommonLine extends Marker {
|
|
|
40061
40123
|
}
|
|
40062
40124
|
}
|
|
40063
40125
|
initMarker(container) {
|
|
40064
|
-
const
|
|
40065
|
-
|
|
40066
|
-
state: state
|
|
40067
|
-
} = this.attribute,
|
|
40068
|
-
line = this.createSegment();
|
|
40069
|
-
line.name = "mark-common-line-line", this._line = line, container.add(line);
|
|
40070
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40071
|
-
state: {
|
|
40072
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40073
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40074
|
-
}
|
|
40075
|
-
}));
|
|
40076
|
-
markLabel.name = "mark-common-line-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
40126
|
+
const line = this.createSegment();
|
|
40127
|
+
line.name = "mark-common-line-line", this._line = line, container.add(line), this.addMarkLineLabels(container);
|
|
40077
40128
|
}
|
|
40078
40129
|
updateMarker() {
|
|
40079
|
-
|
|
40080
|
-
label: label,
|
|
40081
|
-
state: state
|
|
40082
|
-
} = this.attribute;
|
|
40083
|
-
this.setLineAttributes(), this._label && (this._label.setAttributes(Object.assign(Object.assign({
|
|
40084
|
-
dx: 0,
|
|
40085
|
-
dy: 0
|
|
40086
|
-
}, label), {
|
|
40087
|
-
state: {
|
|
40088
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40089
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40090
|
-
}
|
|
40091
|
-
})), this.setLabelPos());
|
|
40130
|
+
this.setLineAttributes(), this.updateMarkLineLabels();
|
|
40092
40131
|
}
|
|
40093
40132
|
}
|
|
40133
|
+
mixin(MarkCommonLine, MarkLabelMixin);
|
|
40094
40134
|
|
|
40095
40135
|
const FUZZY_EQUAL_DELTA = .001;
|
|
40096
40136
|
const DEFAULT_MARK_LINE_THEME = {
|
|
@@ -40279,6 +40319,7 @@ const DEFAULT_MARK_ARC_LINE_THEME = {
|
|
|
40279
40319
|
lineWidth: 0
|
|
40280
40320
|
},
|
|
40281
40321
|
label: {
|
|
40322
|
+
autoRotate: !0,
|
|
40282
40323
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40283
40324
|
refX: 0,
|
|
40284
40325
|
refY: 0,
|
|
@@ -40333,6 +40374,7 @@ const DEFAULT_MARK_AREA_THEME = {
|
|
|
40333
40374
|
const DEFAULT_MARK_ARC_AREA_THEME = {
|
|
40334
40375
|
interactive: !0,
|
|
40335
40376
|
label: {
|
|
40377
|
+
autoRotate: !0,
|
|
40336
40378
|
position: IMarkCommonArcLabelPosition.arcOuterMiddle,
|
|
40337
40379
|
textStyle: {
|
|
40338
40380
|
fill: "#fff",
|
|
@@ -40588,15 +40630,12 @@ class MarkLine extends MarkCommonLine {
|
|
|
40588
40630
|
constructor(attributes, options) {
|
|
40589
40631
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkLine.defaultAttributes, attributes)), this.name = "markLine";
|
|
40590
40632
|
}
|
|
40591
|
-
getPointAttrByPosition(position) {
|
|
40633
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40592
40634
|
var _a;
|
|
40593
40635
|
const {
|
|
40594
|
-
label = {}
|
|
40595
|
-
} = this.attribute,
|
|
40596
|
-
{
|
|
40597
40636
|
refX = 0,
|
|
40598
40637
|
refY = 0
|
|
40599
|
-
} =
|
|
40638
|
+
} = labelAttrs,
|
|
40600
40639
|
points = this._line.getMainSegmentPoints(),
|
|
40601
40640
|
lineEndAngle = null !== (_a = this._line.getEndAngle()) && void 0 !== _a ? _a : 0,
|
|
40602
40641
|
labelAngle = (lineEndAngle),
|
|
@@ -40622,9 +40661,9 @@ class MarkLine extends MarkCommonLine {
|
|
|
40622
40661
|
angle: labelAngle
|
|
40623
40662
|
};
|
|
40624
40663
|
}
|
|
40625
|
-
getRotateByAngle(angle) {
|
|
40664
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40626
40665
|
var _a;
|
|
40627
|
-
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a =
|
|
40666
|
+
return (isPostiveXAxis(angle) ? angle : angle - Math.PI) + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40628
40667
|
}
|
|
40629
40668
|
getTextStyle(position, labelAngle, autoRotate) {
|
|
40630
40669
|
return fuzzyEqualNumber(Math.abs(labelAngle), Math.PI / 2, FUZZY_EQUAL_DELTA) || fuzzyEqualNumber(Math.abs(labelAngle), 3 * Math.PI / 2, FUZZY_EQUAL_DELTA) ? getTextAlignAttrOfVerticalDir(autoRotate, labelAngle, position) : isPostiveXAxis(labelAngle) ? DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.postiveXAxis[position] : DEFAULT_CARTESIAN_MARK_LINE_TEXT_STYLE_MAP.negativeXAxis[position];
|
|
@@ -40690,6 +40729,12 @@ class MarkLine extends MarkCommonLine {
|
|
|
40690
40729
|
});else if (!isValidNumber$1(point.x) || !isValidNumber$1(point.y)) return void (validFlag = !1);
|
|
40691
40730
|
}), validFlag;
|
|
40692
40731
|
}
|
|
40732
|
+
addMarkLineLabels(container) {
|
|
40733
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkLine.defaultAttributes.label);
|
|
40734
|
+
}
|
|
40735
|
+
updateMarkLineLabels() {
|
|
40736
|
+
this._updateMarkLabels(MarkLine.defaultAttributes.label);
|
|
40737
|
+
}
|
|
40693
40738
|
}
|
|
40694
40739
|
MarkLine.defaultAttributes = DEFAULT_MARK_LINE_THEME;
|
|
40695
40740
|
|
|
@@ -40704,9 +40749,6 @@ class MarkArea extends Marker {
|
|
|
40704
40749
|
getArea() {
|
|
40705
40750
|
return this._area;
|
|
40706
40751
|
}
|
|
40707
|
-
getLabel() {
|
|
40708
|
-
return this._label;
|
|
40709
|
-
}
|
|
40710
40752
|
constructor(attributes, options) {
|
|
40711
40753
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArea.defaultAttributes, attributes)), this.name = "markArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40712
40754
|
}
|
|
@@ -40723,24 +40765,21 @@ class MarkArea extends Marker {
|
|
|
40723
40765
|
};
|
|
40724
40766
|
return (position.includes("left") || position.includes("Left")) && (result.x = x1), (position.includes("right") || position.includes("Right")) && (result.x = x2), (position.includes("top") || position.includes("Top")) && (result.y = y1), (position.includes("bottom") || position.includes("Bottom")) && (result.y = y2), result;
|
|
40725
40767
|
}
|
|
40726
|
-
setLabelPos() {
|
|
40768
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40727
40769
|
var _a;
|
|
40728
|
-
if (this.
|
|
40729
|
-
const
|
|
40730
|
-
label = {}
|
|
40731
|
-
} = this.attribute,
|
|
40732
|
-
labelPosition = null !== (_a = label.position) && void 0 !== _a ? _a : "middle",
|
|
40770
|
+
if (this._area) {
|
|
40771
|
+
const labelPosition = null !== (_a = labelAttrs.position) && void 0 !== _a ? _a : "middle",
|
|
40733
40772
|
labelPoint = this.getPointAttrByPosition(labelPosition);
|
|
40734
|
-
if (
|
|
40735
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]),
|
|
40736
|
-
})), this.attribute.limitRect &&
|
|
40773
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelPoint), {
|
|
40774
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
40775
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
40737
40776
|
const {
|
|
40738
40777
|
x: x,
|
|
40739
40778
|
y: y,
|
|
40740
40779
|
width: width,
|
|
40741
40780
|
height: height
|
|
40742
40781
|
} = this.attribute.limitRect;
|
|
40743
|
-
limitShapeInBounds(
|
|
40782
|
+
limitShapeInBounds(labelNode, {
|
|
40744
40783
|
x1: x,
|
|
40745
40784
|
y1: y,
|
|
40746
40785
|
x2: x + width,
|
|
@@ -40752,40 +40791,23 @@ class MarkArea extends Marker {
|
|
|
40752
40791
|
initMarker(container) {
|
|
40753
40792
|
const {
|
|
40754
40793
|
points: points,
|
|
40755
|
-
label: label,
|
|
40756
40794
|
areaStyle: areaStyle,
|
|
40757
40795
|
state: state
|
|
40758
40796
|
} = this.attribute,
|
|
40759
40797
|
area = graphicCreator.polygon(Object.assign({
|
|
40760
40798
|
points: points
|
|
40761
40799
|
}, areaStyle));
|
|
40762
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area);
|
|
40763
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
40764
|
-
state: {
|
|
40765
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40766
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40767
|
-
}
|
|
40768
|
-
}));
|
|
40769
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
40800
|
+
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "mark-area-polygon", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArea.defaultAttributes.label);
|
|
40770
40801
|
}
|
|
40771
40802
|
updateMarker() {
|
|
40772
40803
|
const {
|
|
40773
40804
|
points: points,
|
|
40774
|
-
label: label,
|
|
40775
40805
|
areaStyle: areaStyle,
|
|
40776
40806
|
state: state
|
|
40777
40807
|
} = this.attribute;
|
|
40778
40808
|
this._area && (this._area.setAttributes(Object.assign({
|
|
40779
40809
|
points: points
|
|
40780
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
40781
|
-
dx: 0,
|
|
40782
|
-
dy: 0
|
|
40783
|
-
}, label), {
|
|
40784
|
-
state: {
|
|
40785
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
40786
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
40787
|
-
}
|
|
40788
|
-
})), this.setLabelPos();
|
|
40810
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArea.defaultAttributes.label);
|
|
40789
40811
|
}
|
|
40790
40812
|
isValidPoints() {
|
|
40791
40813
|
const {
|
|
@@ -40798,7 +40820,7 @@ class MarkArea extends Marker {
|
|
|
40798
40820
|
}), validFlag;
|
|
40799
40821
|
}
|
|
40800
40822
|
}
|
|
40801
|
-
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME;
|
|
40823
|
+
MarkArea.defaultAttributes = DEFAULT_MARK_AREA_THEME, mixin(MarkArea, MarkLabelMixin);
|
|
40802
40824
|
|
|
40803
40825
|
loadMarkArcLineComponent();
|
|
40804
40826
|
function registerMarkArcLineAnimate() {
|
|
@@ -40809,24 +40831,19 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40809
40831
|
MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
40810
40832
|
}
|
|
40811
40833
|
constructor(attributes, options) {
|
|
40812
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes,
|
|
40813
|
-
label: {
|
|
40814
|
-
autoRotate: !0
|
|
40815
|
-
}
|
|
40816
|
-
})), this.name = "markArcLine";
|
|
40834
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcLine.defaultAttributes, attributes)), this.name = "markArcLine";
|
|
40817
40835
|
}
|
|
40818
|
-
getPointAttrByPosition(direction) {
|
|
40836
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
40819
40837
|
const {
|
|
40820
40838
|
center: center,
|
|
40821
40839
|
radius: radius,
|
|
40822
40840
|
startAngle: startAngle,
|
|
40823
|
-
endAngle: endAngle
|
|
40824
|
-
label: label
|
|
40841
|
+
endAngle: endAngle
|
|
40825
40842
|
} = this.attribute,
|
|
40826
40843
|
{
|
|
40827
40844
|
refX = 0,
|
|
40828
40845
|
refY = 0
|
|
40829
|
-
} =
|
|
40846
|
+
} = labelAttrs;
|
|
40830
40847
|
let angle;
|
|
40831
40848
|
switch (direction) {
|
|
40832
40849
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -40856,9 +40873,9 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40856
40873
|
getTextStyle(position) {
|
|
40857
40874
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
40858
40875
|
}
|
|
40859
|
-
getRotateByAngle(angle) {
|
|
40876
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
40860
40877
|
var _a;
|
|
40861
|
-
return angle - Math.PI / 2 + (null !== (_a =
|
|
40878
|
+
return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
40862
40879
|
}
|
|
40863
40880
|
createSegment() {
|
|
40864
40881
|
const {
|
|
@@ -40915,6 +40932,12 @@ class MarkArcLine extends MarkCommonLine {
|
|
|
40915
40932
|
isValidPoints() {
|
|
40916
40933
|
return !0;
|
|
40917
40934
|
}
|
|
40935
|
+
addMarkLineLabels(container) {
|
|
40936
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkArcLine.defaultAttributes.label);
|
|
40937
|
+
}
|
|
40938
|
+
updateMarkLineLabels() {
|
|
40939
|
+
this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
|
|
40940
|
+
}
|
|
40918
40941
|
}
|
|
40919
40942
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
40920
40943
|
|
|
@@ -40929,29 +40952,21 @@ class MarkArcArea extends Marker {
|
|
|
40929
40952
|
getArea() {
|
|
40930
40953
|
return this._area;
|
|
40931
40954
|
}
|
|
40932
|
-
getLabel() {
|
|
40933
|
-
return this._label;
|
|
40934
|
-
}
|
|
40935
40955
|
constructor(attributes, options) {
|
|
40936
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes,
|
|
40937
|
-
label: {
|
|
40938
|
-
autoRotate: !0
|
|
40939
|
-
}
|
|
40940
|
-
})), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40956
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, MarkArcArea.defaultAttributes, attributes)), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation, this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
40941
40957
|
}
|
|
40942
|
-
getPointAttrByPosition(position) {
|
|
40958
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40943
40959
|
const {
|
|
40944
40960
|
center: center,
|
|
40945
40961
|
innerRadius: innerRadius,
|
|
40946
40962
|
outerRadius: outerRadius,
|
|
40947
40963
|
startAngle: startAngle,
|
|
40948
|
-
endAngle: endAngle
|
|
40949
|
-
label: label
|
|
40964
|
+
endAngle: endAngle
|
|
40950
40965
|
} = this.attribute,
|
|
40951
40966
|
{
|
|
40952
40967
|
refX = 0,
|
|
40953
40968
|
refY = 0
|
|
40954
|
-
} =
|
|
40969
|
+
} = labelAttrs;
|
|
40955
40970
|
let radius, angle;
|
|
40956
40971
|
switch (position) {
|
|
40957
40972
|
case IMarkCommonArcLabelPosition.center:
|
|
@@ -40986,28 +41001,25 @@ class MarkArcArea extends Marker {
|
|
|
40986
41001
|
angle: angle
|
|
40987
41002
|
};
|
|
40988
41003
|
}
|
|
40989
|
-
setLabelPos() {
|
|
41004
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
40990
41005
|
var _a;
|
|
40991
|
-
if (this.
|
|
41006
|
+
if (this._area) {
|
|
40992
41007
|
const {
|
|
40993
|
-
label = {}
|
|
40994
|
-
} = this.attribute,
|
|
40995
|
-
{
|
|
40996
41008
|
position: labelPosition = "arcInnerMiddle",
|
|
40997
41009
|
autoRotate: autoRotate
|
|
40998
|
-
} =
|
|
40999
|
-
labelAttr = this.getPointAttrByPosition(labelPosition);
|
|
41000
|
-
if (
|
|
41001
|
-
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a =
|
|
41002
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]),
|
|
41003
|
-
})), this.attribute.limitRect &&
|
|
41010
|
+
} = labelAttrs,
|
|
41011
|
+
labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
|
|
41012
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
41013
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0) : 0,
|
|
41014
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
41015
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
41004
41016
|
const {
|
|
41005
41017
|
x: x,
|
|
41006
41018
|
y: y,
|
|
41007
41019
|
width: width,
|
|
41008
41020
|
height: height
|
|
41009
41021
|
} = this.attribute.limitRect;
|
|
41010
|
-
limitShapeInBounds(
|
|
41022
|
+
limitShapeInBounds(labelNode, {
|
|
41011
41023
|
x1: x,
|
|
41012
41024
|
y1: y,
|
|
41013
41025
|
x2: x + width,
|
|
@@ -41024,7 +41036,6 @@ class MarkArcArea extends Marker {
|
|
|
41024
41036
|
startAngle: startAngle,
|
|
41025
41037
|
endAngle: endAngle,
|
|
41026
41038
|
areaStyle: areaStyle,
|
|
41027
|
-
label: label,
|
|
41028
41039
|
state: state
|
|
41029
41040
|
} = this.attribute,
|
|
41030
41041
|
area = graphicCreator.arc(Object.assign({
|
|
@@ -41035,14 +41046,7 @@ class MarkArcArea extends Marker {
|
|
|
41035
41046
|
startAngle: startAngle,
|
|
41036
41047
|
endAngle: endAngle
|
|
41037
41048
|
}, areaStyle));
|
|
41038
|
-
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area);
|
|
41039
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
41040
|
-
state: {
|
|
41041
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41042
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41043
|
-
}
|
|
41044
|
-
}));
|
|
41045
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel), this.setLabelPos();
|
|
41049
|
+
area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area), area.name = "polar-mark-area-area", this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArcArea.defaultAttributes.label);
|
|
41046
41050
|
}
|
|
41047
41051
|
updateMarker() {
|
|
41048
41052
|
const {
|
|
@@ -41062,21 +41066,13 @@ class MarkArcArea extends Marker {
|
|
|
41062
41066
|
outerRadius: outerRadius,
|
|
41063
41067
|
startAngle: startAngle,
|
|
41064
41068
|
endAngle: endAngle
|
|
41065
|
-
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this.
|
|
41066
|
-
dx: 0,
|
|
41067
|
-
dy: 0
|
|
41068
|
-
}, label), {
|
|
41069
|
-
state: {
|
|
41070
|
-
panel: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.labelBackground),
|
|
41071
|
-
text: merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.label)
|
|
41072
|
-
}
|
|
41073
|
-
})), this.setLabelPos());
|
|
41069
|
+
}, areaStyle)), this._area.states = merge$1({}, DEFAULT_STATES$2, null == state ? void 0 : state.area)), this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
41074
41070
|
}
|
|
41075
41071
|
isValidPoints() {
|
|
41076
41072
|
return !0;
|
|
41077
41073
|
}
|
|
41078
41074
|
}
|
|
41079
|
-
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
41075
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
|
|
41080
41076
|
|
|
41081
41077
|
loadMarkPointComponent();
|
|
41082
41078
|
function registerMarkPointAnimate() {
|
|
@@ -63656,7 +63652,7 @@ const registerVChartCore = () => {
|
|
|
63656
63652
|
};
|
|
63657
63653
|
registerVChartCore();
|
|
63658
63654
|
|
|
63659
|
-
const version = "1.13.
|
|
63655
|
+
const version = "1.13.9-alpha.1";
|
|
63660
63656
|
|
|
63661
63657
|
const addVChartProperty = (data, op) => {
|
|
63662
63658
|
const context = op.beforeCall();
|
|
@@ -98027,13 +98023,14 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98027
98023
|
return 'cartesian';
|
|
98028
98024
|
}
|
|
98029
98025
|
_createMarkerComponent() {
|
|
98030
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
98031
|
-
const {
|
|
98026
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
98027
|
+
const { startSymbol = {}, endSymbol = {} } = this._spec;
|
|
98028
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98032
98029
|
const markLineAttrs = {
|
|
98033
98030
|
zIndex: this.layoutZIndex,
|
|
98034
|
-
interactive: (
|
|
98035
|
-
hover: (
|
|
98036
|
-
select: (
|
|
98031
|
+
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
98032
|
+
hover: (_c = this._spec.interactive) !== null && _c !== void 0 ? _c : true,
|
|
98033
|
+
select: (_d = this._spec.interactive) !== null && _d !== void 0 ? _d : true,
|
|
98037
98034
|
points: [
|
|
98038
98035
|
{ x: 0, y: 0 },
|
|
98039
98036
|
{ x: 0, y: 0 }
|
|
@@ -98045,17 +98042,25 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98045
98042
|
radius: 0,
|
|
98046
98043
|
startAngle: 0,
|
|
98047
98044
|
endAngle: 0,
|
|
98048
|
-
lineStyle: transformStyle(transformToGraphic((
|
|
98049
|
-
clipInRange: (
|
|
98050
|
-
label:
|
|
98045
|
+
lineStyle: transformStyle(transformToGraphic((_e = this._spec.line) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98046
|
+
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98047
|
+
label: label.map(labelItem => {
|
|
98048
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98049
|
+
}),
|
|
98051
98050
|
state: {
|
|
98052
|
-
line: transformState((
|
|
98053
|
-
lineStartSymbol: transformState((
|
|
98054
|
-
lineEndSymbol: transformState((
|
|
98055
|
-
label:
|
|
98056
|
-
|
|
98051
|
+
line: transformState((_h = (_g = this._spec.line) === null || _g === void 0 ? void 0 : _g.state) !== null && _h !== void 0 ? _h : {}, this._markerData, this._markAttributeContext),
|
|
98052
|
+
lineStartSymbol: transformState((_k = (_j = this._spec.startSymbol) === null || _j === void 0 ? void 0 : _j.state) !== null && _k !== void 0 ? _k : {}, this._markerData, this._markAttributeContext),
|
|
98053
|
+
lineEndSymbol: transformState((_m = (_l = this._spec.endSymbol) === null || _l === void 0 ? void 0 : _l.state) !== null && _m !== void 0 ? _m : {}, this._markerData, this._markAttributeContext),
|
|
98054
|
+
label: label.map(labelItem => {
|
|
98055
|
+
var _a;
|
|
98056
|
+
return transformState((_a = labelItem.state) !== null && _a !== void 0 ? _a : {}, this._markerData, this._markAttributeContext);
|
|
98057
|
+
}),
|
|
98058
|
+
labelBackground: label.map(labelItem => {
|
|
98059
|
+
var _a, _b;
|
|
98060
|
+
return transformState((_b = (_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : {}, this._markerData, this._markAttributeContext);
|
|
98061
|
+
})
|
|
98057
98062
|
},
|
|
98058
|
-
animation: (
|
|
98063
|
+
animation: (_o = this._spec.animation) !== null && _o !== void 0 ? _o : false,
|
|
98059
98064
|
animationEnter: this._spec.animationEnter,
|
|
98060
98065
|
animationExit: this._spec.animationExit,
|
|
98061
98066
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98080,7 +98085,7 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98080
98085
|
return markLine;
|
|
98081
98086
|
}
|
|
98082
98087
|
_getUpdateMarkerAttrs() {
|
|
98083
|
-
var _a, _b
|
|
98088
|
+
var _a, _b;
|
|
98084
98089
|
const spec = this._spec;
|
|
98085
98090
|
const data = this._markerData;
|
|
98086
98091
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98090,7 +98095,7 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98090
98095
|
const seriesData = relativeSeries.getViewData().latestData;
|
|
98091
98096
|
const dataPoints = data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
98092
98097
|
let limitRect;
|
|
98093
|
-
if (spec.clip || (
|
|
98098
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98094
98099
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98095
98100
|
startRelativeSeries.getRegion(),
|
|
98096
98101
|
endRelativeSeries.getRegion(),
|
|
@@ -98103,10 +98108,13 @@ class BaseMarkLine extends BaseMarker {
|
|
|
98103
98108
|
height: maxY - minY
|
|
98104
98109
|
};
|
|
98105
98110
|
}
|
|
98106
|
-
const markerComponentAttr = (
|
|
98107
|
-
const
|
|
98108
|
-
|
|
98109
|
-
|
|
98111
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98112
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98113
|
+
const specLabels = array(this._spec.label);
|
|
98114
|
+
const labelAttrs = prevLabelAttrs.map((prevLabel, index) => {
|
|
98115
|
+
const specLabel = specLabels[index] || {};
|
|
98116
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod ? specLabel.formatMethod(dataPoints, seriesData) : prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98117
|
+
});
|
|
98110
98118
|
return Object.assign(Object.assign({}, pointsAttr), { label: labelAttrs, limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY });
|
|
98111
98119
|
}
|
|
98112
98120
|
_markerLayout() {
|
|
@@ -98208,7 +98216,7 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98208
98216
|
return { points };
|
|
98209
98217
|
}
|
|
98210
98218
|
_markerLayout() {
|
|
98211
|
-
var _a, _b, _c, _d, _e
|
|
98219
|
+
var _a, _b, _c, _d, _e;
|
|
98212
98220
|
const updateAttrs = this._getUpdateMarkerAttrs();
|
|
98213
98221
|
if (this._spec.type === 'type-step') {
|
|
98214
98222
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98235,7 +98243,7 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98235
98243
|
else {
|
|
98236
98244
|
expandDistanceValue = expandDistance;
|
|
98237
98245
|
}
|
|
98238
|
-
const { points,
|
|
98246
|
+
const { points, limitRect } = updateAttrs;
|
|
98239
98247
|
const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
|
|
98240
98248
|
let labelPositionAttrs;
|
|
98241
98249
|
if (multiSegment && isValid$1(mainSegmentIndex)) {
|
|
@@ -98249,20 +98257,10 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98249
98257
|
else {
|
|
98250
98258
|
labelPositionAttrs = Object.assign(Object.assign({ position: 'start', autoRotate: false }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue)), { refX: 0, refY: 0 });
|
|
98251
98259
|
}
|
|
98252
|
-
|
|
98253
|
-
|
|
98254
|
-
}
|
|
98255
|
-
|
|
98256
|
-
labelPositionAttrs.refY += this._spec.label.refY;
|
|
98257
|
-
}
|
|
98258
|
-
if (isValidNumber$1((_c = this._spec.label) === null || _c === void 0 ? void 0 : _c.dx)) {
|
|
98259
|
-
labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + this._spec.label.dx;
|
|
98260
|
-
}
|
|
98261
|
-
if (isValidNumber$1((_d = this._spec.label) === null || _d === void 0 ? void 0 : _d.dy)) {
|
|
98262
|
-
labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + this._spec.label.dy;
|
|
98263
|
-
}
|
|
98264
|
-
const markerComponentAttr = (_f = (_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.attribute) !== null && _f !== void 0 ? _f : {};
|
|
98265
|
-
(_g = this._markerComponent) === null || _g === void 0 ? void 0 : _g.setAttributes({
|
|
98260
|
+
const markerComponentAttr = (_b = (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.attribute) !== null && _b !== void 0 ? _b : {};
|
|
98261
|
+
const prevLabelAttrs = array(markerComponentAttr.label);
|
|
98262
|
+
const label = array((_c = updateAttrs.label) !== null && _c !== void 0 ? _c : {});
|
|
98263
|
+
(_d = this._markerComponent) === null || _d === void 0 ? void 0 : _d.setAttributes({
|
|
98266
98264
|
points: multiSegment
|
|
98267
98265
|
? [
|
|
98268
98266
|
[joinPoints[0], joinPoints[1]],
|
|
@@ -98270,7 +98268,22 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98270
98268
|
[joinPoints[2], joinPoints[3]]
|
|
98271
98269
|
]
|
|
98272
98270
|
: joinPoints,
|
|
98273
|
-
label:
|
|
98271
|
+
label: label.map((labelItem, index) => {
|
|
98272
|
+
var _a;
|
|
98273
|
+
if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refX)) {
|
|
98274
|
+
labelPositionAttrs.refX += labelItem.refX;
|
|
98275
|
+
}
|
|
98276
|
+
if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.refY)) {
|
|
98277
|
+
labelPositionAttrs.refY += labelItem.refY;
|
|
98278
|
+
}
|
|
98279
|
+
if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dx)) {
|
|
98280
|
+
labelPositionAttrs.dx = (labelPositionAttrs.dx || 0) + labelItem.dx;
|
|
98281
|
+
}
|
|
98282
|
+
if (isValidNumber$1(labelItem === null || labelItem === void 0 ? void 0 : labelItem.dy)) {
|
|
98283
|
+
labelPositionAttrs.dy = (labelPositionAttrs.dy || 0) + labelItem.dy;
|
|
98284
|
+
}
|
|
98285
|
+
return Object.assign(Object.assign(Object.assign({}, labelItem), labelPositionAttrs), { textStyle: Object.assign(Object.assign({}, (_a = prevLabelAttrs[index]) === null || _a === void 0 ? void 0 : _a.textStyle), { textAlign: 'center', textBaseline: 'middle' }) });
|
|
98286
|
+
}),
|
|
98274
98287
|
limitRect,
|
|
98275
98288
|
multiSegment,
|
|
98276
98289
|
mainSegmentIndex,
|
|
@@ -98279,7 +98292,7 @@ class CartesianMarkLine extends BaseMarkLine {
|
|
|
98279
98292
|
});
|
|
98280
98293
|
}
|
|
98281
98294
|
else {
|
|
98282
|
-
(
|
|
98295
|
+
(_e = this._markerComponent) === null || _e === void 0 ? void 0 : _e.setAttributes(updateAttrs);
|
|
98283
98296
|
}
|
|
98284
98297
|
}
|
|
98285
98298
|
_computeOptions() {
|
|
@@ -98633,8 +98646,8 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98633
98646
|
return 'cartesian';
|
|
98634
98647
|
}
|
|
98635
98648
|
_createMarkerComponent() {
|
|
98636
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
98637
|
-
const label = (_a = this._spec.label) !== null && _a !== void 0 ? _a : {};
|
|
98649
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
98650
|
+
const label = array((_a = this._spec.label) !== null && _a !== void 0 ? _a : {});
|
|
98638
98651
|
const markAreaAttrs = {
|
|
98639
98652
|
zIndex: this.layoutZIndex,
|
|
98640
98653
|
interactive: (_b = this._spec.interactive) !== null && _b !== void 0 ? _b : true,
|
|
@@ -98656,13 +98669,20 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98656
98669
|
endAngle: 0,
|
|
98657
98670
|
areaStyle: transformStyle(transformToGraphic((_e = this._spec.area) === null || _e === void 0 ? void 0 : _e.style), this._markerData, this._markAttributeContext),
|
|
98658
98671
|
clipInRange: (_f = this._spec.clip) !== null && _f !== void 0 ? _f : false,
|
|
98659
|
-
label:
|
|
98672
|
+
label: label.map((labelItem) => {
|
|
98673
|
+
return transformLabelAttributes(labelItem, this._markerData, this._markAttributeContext);
|
|
98674
|
+
}),
|
|
98660
98675
|
state: {
|
|
98661
98676
|
area: transformState((_g = this._spec.area) === null || _g === void 0 ? void 0 : _g.state, this._markerData, this._markAttributeContext),
|
|
98662
|
-
label:
|
|
98663
|
-
|
|
98677
|
+
label: label.map((labelItem) => {
|
|
98678
|
+
return transformState(labelItem.state, this._markerData, this._markAttributeContext);
|
|
98679
|
+
}),
|
|
98680
|
+
labelBackground: label.map((labelItem) => {
|
|
98681
|
+
var _a;
|
|
98682
|
+
return transformState((_a = labelItem.labelBackground) === null || _a === void 0 ? void 0 : _a.state, this._markerData, this._markAttributeContext);
|
|
98683
|
+
})
|
|
98664
98684
|
},
|
|
98665
|
-
animation: (
|
|
98685
|
+
animation: (_h = this._spec.animation) !== null && _h !== void 0 ? _h : false,
|
|
98666
98686
|
animationEnter: this._spec.animationEnter,
|
|
98667
98687
|
animationExit: this._spec.animationExit,
|
|
98668
98688
|
animationUpdate: this._spec.animationUpdate
|
|
@@ -98671,7 +98691,7 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98671
98691
|
return markArea;
|
|
98672
98692
|
}
|
|
98673
98693
|
_markerLayout() {
|
|
98674
|
-
var _a
|
|
98694
|
+
var _a;
|
|
98675
98695
|
const spec = this._spec;
|
|
98676
98696
|
const data = this._markerData;
|
|
98677
98697
|
const startRelativeSeries = this._startRelativeSeries;
|
|
@@ -98685,7 +98705,7 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98685
98705
|
: data.latestData
|
|
98686
98706
|
: seriesData;
|
|
98687
98707
|
let limitRect;
|
|
98688
|
-
if (spec.clip || (
|
|
98708
|
+
if (spec.clip || array(spec.label).some(labelCfg => labelCfg === null || labelCfg === void 0 ? void 0 : labelCfg.confine)) {
|
|
98689
98709
|
const { minX, maxX, minY, maxY } = computeClipRange([
|
|
98690
98710
|
startRelativeSeries.getRegion(),
|
|
98691
98711
|
endRelativeSeries.getRegion(),
|
|
@@ -98699,10 +98719,15 @@ class BaseMarkArea extends BaseMarker {
|
|
|
98699
98719
|
};
|
|
98700
98720
|
}
|
|
98701
98721
|
if (this._markerComponent) {
|
|
98702
|
-
|
|
98703
|
-
|
|
98704
|
-
|
|
98705
|
-
|
|
98722
|
+
const prevLabelAttrs = array((_a = this._markerComponent.attribute) === null || _a === void 0 ? void 0 : _a.label);
|
|
98723
|
+
const specLabels = array(this._spec.label);
|
|
98724
|
+
this._markerComponent.setAttributes(Object.assign(Object.assign({}, pointsAttr), { label: prevLabelAttrs.map((prevLabel, index) => {
|
|
98725
|
+
const specLabel = specLabels[index] || {};
|
|
98726
|
+
return Object.assign(Object.assign({}, prevLabel), { text: specLabel.formatMethod
|
|
98727
|
+
?
|
|
98728
|
+
specLabel.formatMethod(dataPoints, seriesData)
|
|
98729
|
+
: prevLabel === null || prevLabel === void 0 ? void 0 : prevLabel.text });
|
|
98730
|
+
}), limitRect, dx: this._layoutOffsetX, dy: this._layoutOffsetY }));
|
|
98706
98731
|
}
|
|
98707
98732
|
}
|
|
98708
98733
|
_initDataView() {
|