@visactor/vrender-components 0.20.2 → 0.20.3-alpha.0
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/config.d.ts +6 -0
- package/cjs/axis/config.js +7 -1
- package/cjs/axis/config.js.map +1 -1
- package/cjs/axis/constant.d.ts +4 -1
- package/cjs/axis/constant.js +4 -3
- package/cjs/axis/constant.js.map +1 -1
- package/cjs/axis/line.d.ts +2 -0
- package/cjs/axis/line.js +60 -7
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/overlap/auto-limit.js +4 -3
- package/cjs/axis/overlap/auto-limit.js.map +1 -1
- package/cjs/axis/overlap/auto-wrap.d.ts +9 -0
- package/cjs/axis/overlap/auto-wrap.js +38 -0
- package/cjs/axis/overlap/auto-wrap.js.map +1 -0
- package/cjs/axis/overlap/util.d.ts +2 -0
- package/cjs/axis/overlap/util.js +15 -1
- package/cjs/axis/overlap/util.js.map +1 -1
- package/cjs/axis/tick-data/continuous.js +35 -11
- package/cjs/axis/tick-data/continuous.js.map +1 -1
- package/cjs/axis/type.d.ts +24 -4
- package/cjs/axis/type.js.map +1 -1
- package/cjs/axis/util.d.ts +2 -0
- package/cjs/axis/util.js +14 -3
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/brush.js +1 -2
- package/cjs/brush/type.js +2 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/animate/animate.d.ts +5 -5
- package/cjs/label/animate/animate.js +4 -4
- package/cjs/label/animate/animate.js.map +1 -1
- package/cjs/label/base.d.ts +6 -5
- package/cjs/label/base.js +60 -58
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.d.ts +3 -3
- package/cjs/label/type.js.map +1 -1
- package/cjs/tag/tag.js +4 -4
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/title/title.js +95 -96
- package/cjs/title/title.js.map +1 -1
- package/dist/index.es.js +321 -127
- package/es/axis/config.d.ts +6 -0
- package/es/axis/config.js +7 -0
- package/es/axis/config.js.map +1 -1
- package/es/axis/constant.d.ts +4 -1
- package/es/axis/constant.js +4 -1
- package/es/axis/constant.js.map +1 -1
- package/es/axis/line.d.ts +2 -0
- package/es/axis/line.js +64 -7
- package/es/axis/line.js.map +1 -1
- package/es/axis/overlap/auto-limit.js +4 -2
- package/es/axis/overlap/auto-limit.js.map +1 -1
- package/es/axis/overlap/auto-wrap.d.ts +9 -0
- package/es/axis/overlap/auto-wrap.js +31 -0
- package/es/axis/overlap/auto-wrap.js.map +1 -0
- package/es/axis/overlap/util.d.ts +2 -0
- package/es/axis/overlap/util.js +13 -1
- package/es/axis/overlap/util.js.map +1 -1
- package/es/axis/tick-data/continuous.js +34 -11
- package/es/axis/tick-data/continuous.js.map +1 -1
- package/es/axis/type.d.ts +24 -4
- package/es/axis/type.js.map +1 -1
- package/es/axis/util.d.ts +2 -0
- package/es/axis/util.js +12 -1
- package/es/axis/util.js.map +1 -1
- package/es/brush/brush.js +1 -2
- package/es/brush/type.js +2 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/animate/animate.d.ts +5 -5
- package/es/label/animate/animate.js +4 -4
- package/es/label/animate/animate.js.map +1 -1
- package/es/label/base.d.ts +6 -5
- package/es/label/base.js +57 -57
- package/es/label/base.js.map +1 -1
- package/es/label/type.d.ts +3 -3
- package/es/label/type.js.map +1 -1
- package/es/tag/tag.js +4 -4
- package/es/tag/tag.js.map +1 -1
- package/es/title/title.js +95 -94
- package/es/title/title.js.map +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
|
@@ -14774,7 +14774,7 @@ class Tag extends AbstractComponent {
|
|
|
14774
14774
|
textShape = group.createOrUpdateChild('tag-text', richTextAttrs, 'richtext');
|
|
14775
14775
|
const { visible: bgVisible } = panel, backgroundStyle = __rest(panel, ["visible"]);
|
|
14776
14776
|
if (visible && isBoolean(bgVisible)) {
|
|
14777
|
-
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1, y: textShape.AABBBounds.y1, width: textShape.AABBBounds.width(), height: textShape.AABBBounds.height() }), 'rect');
|
|
14777
|
+
const bgRect = this.createOrUpdateChild('tag-panel', Object.assign(Object.assign({}, backgroundStyle), { visible: bgVisible && !!text, x: textShape.AABBBounds.x1 - parsedPadding[1], y: textShape.AABBBounds.y1 - parsedPadding[0], width: textShape.AABBBounds.width() + (parsedPadding[1] + parsedPadding[3]), height: textShape.AABBBounds.height() + (parsedPadding[0] + parsedPadding[2]) }), 'rect');
|
|
14778
14778
|
if (!isEmpty(state === null || state === void 0 ? void 0 : state.panel)) {
|
|
14779
14779
|
bgRect.states = state.panel;
|
|
14780
14780
|
}
|
|
@@ -15876,16 +15876,18 @@ function updateAnimation(prev, next, animationConfig) {
|
|
|
15876
15876
|
if (!isArray(animationConfig)) {
|
|
15877
15877
|
const { duration, easing, increaseEffect = true } = animationConfig;
|
|
15878
15878
|
prev.animate().to(next.attribute, duration, easing);
|
|
15879
|
-
increaseEffect &&
|
|
15879
|
+
if (increaseEffect && prev.type === 'text' && next.type === 'text') {
|
|
15880
|
+
playIncreaseCount(prev, next, duration, easing);
|
|
15881
|
+
}
|
|
15880
15882
|
return;
|
|
15881
15883
|
}
|
|
15882
|
-
animationConfig.forEach(
|
|
15884
|
+
animationConfig.forEach(cfg => {
|
|
15883
15885
|
const { duration, easing, increaseEffect = true, channel } = cfg;
|
|
15884
|
-
const {
|
|
15886
|
+
const { to } = update(prev, next, channel, cfg.options);
|
|
15885
15887
|
if (!isEmpty(to)) {
|
|
15886
15888
|
prev.animate().to(to, duration, easing);
|
|
15887
15889
|
}
|
|
15888
|
-
if (
|
|
15890
|
+
if (increaseEffect && prev.type === 'text' && next.type === 'text') {
|
|
15889
15891
|
playIncreaseCount(prev, next, duration, easing);
|
|
15890
15892
|
}
|
|
15891
15893
|
});
|
|
@@ -16297,7 +16299,7 @@ class LabelBase extends AbstractComponent {
|
|
|
16297
16299
|
return createTextGraphicByType(textAttrs, 'textType');
|
|
16298
16300
|
}
|
|
16299
16301
|
_prepare() {
|
|
16300
|
-
var _a, _b
|
|
16302
|
+
var _a, _b;
|
|
16301
16303
|
const currentBaseMarks = [];
|
|
16302
16304
|
let baseMarks;
|
|
16303
16305
|
if (isFunction(this.attribute.getBaseMarks)) {
|
|
@@ -16361,13 +16363,23 @@ class LabelBase extends AbstractComponent {
|
|
|
16361
16363
|
}
|
|
16362
16364
|
}
|
|
16363
16365
|
if (this.attribute.animation !== false) {
|
|
16364
|
-
const animation
|
|
16366
|
+
const { animation, animationEnter, animationExit, animationUpdate } = this.attribute;
|
|
16367
|
+
const animationCfg = isObject(animation) ? animation : {};
|
|
16365
16368
|
this._animationConfig = {
|
|
16366
|
-
enter: merge({}, DefaultLabelAnimation,
|
|
16367
|
-
exit: merge({}, DefaultLabelAnimation,
|
|
16368
|
-
update:
|
|
16369
|
-
?
|
|
16370
|
-
|
|
16369
|
+
enter: animationEnter !== false ? merge({}, DefaultLabelAnimation, animationCfg, animationEnter !== null && animationEnter !== void 0 ? animationEnter : {}) : false,
|
|
16370
|
+
exit: animationExit !== false ? merge({}, DefaultLabelAnimation, animationCfg, animationExit !== null && animationExit !== void 0 ? animationExit : {}) : false,
|
|
16371
|
+
update: animationUpdate !== false
|
|
16372
|
+
? isArray(animationUpdate)
|
|
16373
|
+
? animationUpdate
|
|
16374
|
+
: merge({}, DefaultLabelAnimation, animationCfg, animationUpdate !== null && animationUpdate !== void 0 ? animationUpdate : {})
|
|
16375
|
+
: false
|
|
16376
|
+
};
|
|
16377
|
+
}
|
|
16378
|
+
else {
|
|
16379
|
+
this._animationConfig = {
|
|
16380
|
+
enter: false,
|
|
16381
|
+
exit: false,
|
|
16382
|
+
update: false
|
|
16371
16383
|
};
|
|
16372
16384
|
}
|
|
16373
16385
|
}
|
|
@@ -16535,15 +16547,6 @@ class LabelBase extends AbstractComponent {
|
|
|
16535
16547
|
return { x1: x, x2: x, y1: y, y2: y };
|
|
16536
16548
|
}
|
|
16537
16549
|
_renderLabels(labels) {
|
|
16538
|
-
const disableAnimation = this._enableAnimation === false || this.attribute.animation === false;
|
|
16539
|
-
if (disableAnimation) {
|
|
16540
|
-
this._renderWithOutAnimation(labels);
|
|
16541
|
-
}
|
|
16542
|
-
else {
|
|
16543
|
-
this._renderWithAnimation(labels);
|
|
16544
|
-
}
|
|
16545
|
-
}
|
|
16546
|
-
_renderWithAnimation(labels) {
|
|
16547
16550
|
var _a;
|
|
16548
16551
|
const { syncState } = this.attribute;
|
|
16549
16552
|
const currentTextMap = new Map();
|
|
@@ -16555,8 +16558,7 @@ class LabelBase extends AbstractComponent {
|
|
|
16555
16558
|
labels.forEach((text, index) => {
|
|
16556
16559
|
var _a;
|
|
16557
16560
|
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
16558
|
-
const
|
|
16559
|
-
const textKey = this._isCollectionBase ? textId : relatedGraphic;
|
|
16561
|
+
const textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
16560
16562
|
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(textKey)) ? 'update' : 'enter';
|
|
16561
16563
|
let labelLine;
|
|
16562
16564
|
if (showLabelLine) {
|
|
@@ -16568,90 +16570,88 @@ class LabelBase extends AbstractComponent {
|
|
|
16568
16570
|
if (state === 'enter') {
|
|
16569
16571
|
texts.push(text);
|
|
16570
16572
|
currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });
|
|
16571
|
-
|
|
16572
|
-
const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');
|
|
16573
|
-
this.add(text);
|
|
16574
|
-
if (labelLine) {
|
|
16575
|
-
labelLines.push(labelLine);
|
|
16576
|
-
this.add(labelLine);
|
|
16577
|
-
}
|
|
16578
|
-
this._syncStateWithRelatedGraphic(relatedGraphic);
|
|
16579
|
-
this._animationConfig.enter.duration > 0 &&
|
|
16580
|
-
relatedGraphic.once('animate-bind', a => {
|
|
16581
|
-
text.setAttributes(from);
|
|
16582
|
-
labelLine && labelLine.setAttributes(from);
|
|
16583
|
-
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
16584
|
-
relatedGraphic.on('afterAttributeUpdate', listener);
|
|
16585
|
-
});
|
|
16586
|
-
}
|
|
16573
|
+
this._addLabel({ text, labelLine }, texts, labelLines, index);
|
|
16587
16574
|
}
|
|
16588
16575
|
else if (state === 'update') {
|
|
16589
16576
|
const prevLabel = prevTextMap.get(textKey);
|
|
16590
16577
|
prevTextMap.delete(textKey);
|
|
16591
16578
|
currentTextMap.set(textKey, prevLabel);
|
|
16592
|
-
|
|
16593
|
-
const { duration, easing } = this._animationConfig.update;
|
|
16594
|
-
updateAnimation(prevText, text, this._animationConfig.update);
|
|
16595
|
-
if (prevLabel.labelLine && labelLine) {
|
|
16596
|
-
prevLabel.labelLine.animate().to(labelLine.attribute, duration, easing);
|
|
16597
|
-
}
|
|
16579
|
+
this._updateLabel(prevLabel, { text, labelLine });
|
|
16598
16580
|
}
|
|
16599
16581
|
});
|
|
16600
|
-
|
|
16601
|
-
var _a;
|
|
16602
|
-
(_a = label.text) === null || _a === void 0 ? void 0 : _a.animate().to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, this._animationConfig.exit.duration, this._animationConfig.exit.easing).onEnd(() => {
|
|
16603
|
-
this.removeChild(label.text);
|
|
16604
|
-
if (label.labelLine) {
|
|
16605
|
-
this.removeChild(label.labelLine);
|
|
16606
|
-
}
|
|
16607
|
-
});
|
|
16608
|
-
});
|
|
16582
|
+
this._removeLabel(prevTextMap);
|
|
16609
16583
|
this._graphicToText = currentTextMap;
|
|
16610
16584
|
}
|
|
16611
|
-
|
|
16612
|
-
|
|
16613
|
-
const
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
var _a;
|
|
16620
|
-
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
16621
|
-
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(relatedGraphic)) ? 'update' : 'enter';
|
|
16622
|
-
const textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
16623
|
-
let labelLine;
|
|
16624
|
-
if (showLabelLine) {
|
|
16625
|
-
labelLine = this._createLabelLine(text, relatedGraphic);
|
|
16626
|
-
}
|
|
16627
|
-
if (syncState) {
|
|
16628
|
-
this.updateStatesOfLabels([labelLine ? { text, labelLine } : { text }], (_a = relatedGraphic.currentStates) !== null && _a !== void 0 ? _a : []);
|
|
16629
|
-
}
|
|
16630
|
-
if (state === 'enter') {
|
|
16631
|
-
currentTextMap.set(textKey, labelLine ? { text, labelLine } : { text });
|
|
16585
|
+
_addLabel(label, texts, labelLines, index) {
|
|
16586
|
+
const { text, labelLine } = label;
|
|
16587
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
16588
|
+
this._syncStateWithRelatedGraphic(relatedGraphic);
|
|
16589
|
+
if (this._enableAnimation !== false && this._animationConfig.enter !== false) {
|
|
16590
|
+
if (relatedGraphic) {
|
|
16591
|
+
const { from, to } = getAnimationAttributes(text.attribute, 'fadeIn');
|
|
16592
|
+
if (text) {
|
|
16632
16593
|
this.add(text);
|
|
16633
|
-
if (labelLine) {
|
|
16634
|
-
this.add(labelLine);
|
|
16635
|
-
}
|
|
16636
|
-
this._syncStateWithRelatedGraphic(relatedGraphic);
|
|
16637
16594
|
}
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
currentTextMap.set(textKey, prevLabel);
|
|
16642
|
-
prevLabel.text.setAttributes(text.attribute);
|
|
16643
|
-
if (prevLabel.labelLine && labelLine) {
|
|
16644
|
-
prevLabel.labelLine.setAttributes(labelLine.attribute);
|
|
16645
|
-
}
|
|
16595
|
+
if (labelLine) {
|
|
16596
|
+
labelLines.push(labelLine);
|
|
16597
|
+
this.add(labelLine);
|
|
16646
16598
|
}
|
|
16647
|
-
|
|
16648
|
-
|
|
16599
|
+
this._animationConfig.enter.duration > 0 &&
|
|
16600
|
+
relatedGraphic.once('animate-bind', a => {
|
|
16601
|
+
text.setAttributes(from);
|
|
16602
|
+
labelLine && labelLine.setAttributes(from);
|
|
16603
|
+
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
16604
|
+
relatedGraphic.on('afterAttributeUpdate', listener);
|
|
16605
|
+
});
|
|
16606
|
+
}
|
|
16607
|
+
}
|
|
16608
|
+
else {
|
|
16609
|
+
if (text) {
|
|
16610
|
+
this.add(text);
|
|
16611
|
+
}
|
|
16612
|
+
if (labelLine) {
|
|
16613
|
+
this.add(labelLine);
|
|
16614
|
+
}
|
|
16615
|
+
}
|
|
16616
|
+
}
|
|
16617
|
+
_updateLabel(prevLabel, currentLabel) {
|
|
16618
|
+
const { text: prevText, labelLine: prevLabelLine } = prevLabel;
|
|
16619
|
+
const { text: curText, labelLine: curLabelLine } = currentLabel;
|
|
16620
|
+
if (this._enableAnimation !== false && this._animationConfig.update !== false) {
|
|
16621
|
+
const { duration, easing } = this._animationConfig.update;
|
|
16622
|
+
updateAnimation(prevText, curText, this._animationConfig.update);
|
|
16623
|
+
if (prevLabelLine && curLabelLine) {
|
|
16624
|
+
prevLabel.labelLine.animate().to(curLabelLine.attribute, duration, easing);
|
|
16625
|
+
}
|
|
16626
|
+
}
|
|
16627
|
+
else {
|
|
16628
|
+
prevLabel.text.setAttributes(curText.attribute);
|
|
16629
|
+
if (prevLabelLine && curLabelLine) {
|
|
16630
|
+
prevLabel.labelLine.setAttributes(curLabelLine.attribute);
|
|
16631
|
+
}
|
|
16632
|
+
}
|
|
16633
|
+
}
|
|
16634
|
+
_removeLabel(textMap) {
|
|
16635
|
+
const removeLabelAndLine = (label) => {
|
|
16649
16636
|
this.removeChild(label.text);
|
|
16650
16637
|
if (label.labelLine) {
|
|
16651
16638
|
this.removeChild(label.labelLine);
|
|
16652
16639
|
}
|
|
16653
|
-
}
|
|
16654
|
-
this.
|
|
16640
|
+
};
|
|
16641
|
+
if (this._enableAnimation !== false && this._animationConfig.exit !== false) {
|
|
16642
|
+
const { duration, easing } = this._animationConfig.exit;
|
|
16643
|
+
textMap.forEach(label => {
|
|
16644
|
+
var _a;
|
|
16645
|
+
(_a = label.text) === null || _a === void 0 ? void 0 : _a.animate().to(getAnimationAttributes(label.text.attribute, 'fadeOut').to, duration, easing).onEnd(() => {
|
|
16646
|
+
removeLabelAndLine(label);
|
|
16647
|
+
});
|
|
16648
|
+
});
|
|
16649
|
+
}
|
|
16650
|
+
else {
|
|
16651
|
+
textMap.forEach(label => {
|
|
16652
|
+
removeLabelAndLine(label);
|
|
16653
|
+
});
|
|
16654
|
+
}
|
|
16655
16655
|
}
|
|
16656
16656
|
updateStatesOfLabels(labels, currentStates) {
|
|
16657
16657
|
labels.forEach(label => {
|
|
@@ -16666,7 +16666,7 @@ class LabelBase extends AbstractComponent {
|
|
|
16666
16666
|
});
|
|
16667
16667
|
}
|
|
16668
16668
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
16669
|
-
if (this.attribute.syncState) {
|
|
16669
|
+
if (this.attribute.syncState && relatedGraphic) {
|
|
16670
16670
|
relatedGraphic.on('afterAttributeUpdate', this._handleRelatedGraphicSetState);
|
|
16671
16671
|
}
|
|
16672
16672
|
}
|
|
@@ -18090,6 +18090,8 @@ var AXIS_ELEMENT_NAME;
|
|
|
18090
18090
|
AXIS_ELEMENT_NAME["line"] = "axis-line";
|
|
18091
18091
|
AXIS_ELEMENT_NAME["background"] = "axis-background";
|
|
18092
18092
|
AXIS_ELEMENT_NAME["axisLabelBackground"] = "axis-label-background";
|
|
18093
|
+
AXIS_ELEMENT_NAME["axisBreak"] = "axis-break";
|
|
18094
|
+
AXIS_ELEMENT_NAME["axisBreakSymbol"] = "axis-break-symbol";
|
|
18093
18095
|
})(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
18094
18096
|
var AxisStateValue;
|
|
18095
18097
|
(function (AxisStateValue) {
|
|
@@ -18104,6 +18106,7 @@ const DEFAULT_STATES$1 = {
|
|
|
18104
18106
|
[AxisStateValue.hover]: {},
|
|
18105
18107
|
[AxisStateValue.hoverReverse]: {}
|
|
18106
18108
|
};
|
|
18109
|
+
const TopZIndex = 999;
|
|
18107
18110
|
|
|
18108
18111
|
const DEFAULT_AXIS_THEME = {
|
|
18109
18112
|
title: {
|
|
@@ -18159,6 +18162,12 @@ const DEFAULT_AXIS_THEME = {
|
|
|
18159
18162
|
}
|
|
18160
18163
|
}
|
|
18161
18164
|
};
|
|
18165
|
+
const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {
|
|
18166
|
+
size: 8,
|
|
18167
|
+
stroke: '#000',
|
|
18168
|
+
lineWidth: 1,
|
|
18169
|
+
zIndex: 1
|
|
18170
|
+
};
|
|
18162
18171
|
|
|
18163
18172
|
const clampRadian = (angle = 0) => {
|
|
18164
18173
|
if (angle < 0) {
|
|
@@ -18216,6 +18225,13 @@ function getCircleLabelPosition(tickPosition, tickVector, text, style) {
|
|
|
18216
18225
|
const y = baseY - dy;
|
|
18217
18226
|
return { x, y };
|
|
18218
18227
|
}
|
|
18228
|
+
function getAxisBreakSymbolAttrs(props = {}) {
|
|
18229
|
+
var _a, _b;
|
|
18230
|
+
const { style = {}, angle = Math.PI * 0.5 } = props;
|
|
18231
|
+
const symbolStyle = merge({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style);
|
|
18232
|
+
const symbolSize = (_a = symbolStyle.size) !== null && _a !== void 0 ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
|
|
18233
|
+
return Object.assign(Object.assign({}, symbolStyle), { symbolType: (_b = symbolStyle.symbolType) !== null && _b !== void 0 ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`, symbolSize });
|
|
18234
|
+
}
|
|
18219
18235
|
function getElMap(g) {
|
|
18220
18236
|
const elMap = {};
|
|
18221
18237
|
traverseGroup(g, (el) => {
|
|
@@ -18778,6 +18794,17 @@ function itemIntersect(item1, item2) {
|
|
|
18778
18794
|
? isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, true)
|
|
18779
18795
|
: true));
|
|
18780
18796
|
}
|
|
18797
|
+
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
18798
|
+
function isAngleVertical(angle) {
|
|
18799
|
+
const hasAngle = !isNil(angle) && angle !== 0;
|
|
18800
|
+
const cos = hasAngle ? Math.cos(angle) : 1;
|
|
18801
|
+
return hasAngle && Math.abs(cos) <= DELTA_ANGLE;
|
|
18802
|
+
}
|
|
18803
|
+
function isAngleHorizontal(angle) {
|
|
18804
|
+
const hasAngle = !isNil(angle) && angle !== 0;
|
|
18805
|
+
const sin = hasAngle ? Math.sin(angle) : 0;
|
|
18806
|
+
return !hasAngle || Math.abs(sin) <= DELTA_ANGLE;
|
|
18807
|
+
}
|
|
18781
18808
|
|
|
18782
18809
|
const methods$1 = {
|
|
18783
18810
|
parity: function (items) {
|
|
@@ -18973,15 +19000,14 @@ function autoLimit(labels, config) {
|
|
|
18973
19000
|
if (isEmpty(labels) || !isValidNumber(limitLength)) {
|
|
18974
19001
|
return;
|
|
18975
19002
|
}
|
|
18976
|
-
const DELTA = Math.sin(Math.PI / 10);
|
|
18977
19003
|
labels.forEach(label => {
|
|
18978
19004
|
var _a;
|
|
18979
19005
|
const angle = label.attribute.angle;
|
|
18980
19006
|
const hasAngle = !isNil(angle);
|
|
18981
19007
|
const cos = hasAngle ? Math.cos(angle) : 1;
|
|
18982
19008
|
const sin = hasAngle ? Math.sin(angle) : 0;
|
|
18983
|
-
const isHorizontal =
|
|
18984
|
-
const isVertical =
|
|
19009
|
+
const isHorizontal = isAngleHorizontal(angle);
|
|
19010
|
+
const isVertical = isAngleVertical(angle);
|
|
18985
19011
|
const isX = orient === 'top' || orient === 'bottom';
|
|
18986
19012
|
if (isX) {
|
|
18987
19013
|
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) {
|
|
@@ -19042,6 +19068,65 @@ function autoLimit(labels, config) {
|
|
|
19042
19068
|
});
|
|
19043
19069
|
}
|
|
19044
19070
|
|
|
19071
|
+
function autoWrap(labels, config) {
|
|
19072
|
+
const { limitLength, axisLength, ellipsis = '...', orient } = config;
|
|
19073
|
+
if (isEmpty(labels) || !isValidNumber(limitLength)) {
|
|
19074
|
+
return;
|
|
19075
|
+
}
|
|
19076
|
+
const verticalLimitLength = axisLength / labels.length;
|
|
19077
|
+
labels.forEach(label => {
|
|
19078
|
+
var _a;
|
|
19079
|
+
const angle = label.attribute.angle;
|
|
19080
|
+
const isHorizontal = isAngleHorizontal(angle);
|
|
19081
|
+
const isVertical = isAngleVertical(angle);
|
|
19082
|
+
const isX = orient === 'top' || orient === 'bottom';
|
|
19083
|
+
if (isX) {
|
|
19084
|
+
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) {
|
|
19085
|
+
return;
|
|
19086
|
+
}
|
|
19087
|
+
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= verticalLimitLength) {
|
|
19088
|
+
return;
|
|
19089
|
+
}
|
|
19090
|
+
}
|
|
19091
|
+
else {
|
|
19092
|
+
if (isVertical && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) {
|
|
19093
|
+
return;
|
|
19094
|
+
}
|
|
19095
|
+
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) {
|
|
19096
|
+
return;
|
|
19097
|
+
}
|
|
19098
|
+
}
|
|
19099
|
+
let limitLabelLength = null;
|
|
19100
|
+
let heightLimit = null;
|
|
19101
|
+
if (isX) {
|
|
19102
|
+
if (isVertical) {
|
|
19103
|
+
limitLabelLength = limitLength;
|
|
19104
|
+
heightLimit = verticalLimitLength;
|
|
19105
|
+
}
|
|
19106
|
+
else {
|
|
19107
|
+
limitLabelLength = verticalLimitLength;
|
|
19108
|
+
heightLimit = limitLength;
|
|
19109
|
+
}
|
|
19110
|
+
}
|
|
19111
|
+
else {
|
|
19112
|
+
if (isVertical) {
|
|
19113
|
+
limitLabelLength = verticalLimitLength;
|
|
19114
|
+
heightLimit = limitLength;
|
|
19115
|
+
}
|
|
19116
|
+
else {
|
|
19117
|
+
limitLabelLength = limitLength;
|
|
19118
|
+
heightLimit = verticalLimitLength;
|
|
19119
|
+
}
|
|
19120
|
+
}
|
|
19121
|
+
label.setAttributes({
|
|
19122
|
+
maxLineWidth: limitLabelLength,
|
|
19123
|
+
ellipsis: (_a = label.attribute.ellipsis) !== null && _a !== void 0 ? _a : ellipsis,
|
|
19124
|
+
whiteSpace: 'normal',
|
|
19125
|
+
heightLimit
|
|
19126
|
+
});
|
|
19127
|
+
});
|
|
19128
|
+
}
|
|
19129
|
+
|
|
19045
19130
|
function alignAxisLabels(labels, start, containerSize, orient, align) {
|
|
19046
19131
|
if (orient === 'left' || orient === 'right') {
|
|
19047
19132
|
if (align === 'left') {
|
|
@@ -19152,7 +19237,44 @@ class LineAxis extends AxisBase {
|
|
|
19152
19237
|
}
|
|
19153
19238
|
_renderInner(container) {
|
|
19154
19239
|
var _a;
|
|
19240
|
+
this._breaks = null;
|
|
19241
|
+
if (this.attribute.breaks && this.attribute.breaks.length) {
|
|
19242
|
+
const transformedBreaks = [];
|
|
19243
|
+
for (let index = 0; index < this.attribute.breaks.length; index++) {
|
|
19244
|
+
const aBreak = this.attribute.breaks[index];
|
|
19245
|
+
const { range, breakSymbol, rawRange } = aBreak;
|
|
19246
|
+
transformedBreaks.push({
|
|
19247
|
+
startPoint: this.getTickCoord(range[0]),
|
|
19248
|
+
endPoint: this.getTickCoord(range[1]),
|
|
19249
|
+
range,
|
|
19250
|
+
breakSymbol,
|
|
19251
|
+
rawRange
|
|
19252
|
+
});
|
|
19253
|
+
}
|
|
19254
|
+
this._breaks = transformedBreaks;
|
|
19255
|
+
}
|
|
19155
19256
|
super._renderInner(container);
|
|
19257
|
+
if (this._breaks && this._breaks.length) {
|
|
19258
|
+
this._breaks.forEach((b, index) => {
|
|
19259
|
+
const { startPoint, endPoint, breakSymbol, rawRange } = b;
|
|
19260
|
+
if ((breakSymbol === null || breakSymbol === void 0 ? void 0 : breakSymbol.visible) !== false) {
|
|
19261
|
+
const axisBreakGroup = graphicCreator.group({
|
|
19262
|
+
zIndex: TopZIndex
|
|
19263
|
+
});
|
|
19264
|
+
axisBreakGroup.name = AXIS_ELEMENT_NAME.axisBreak;
|
|
19265
|
+
axisBreakGroup.id = this._getNodeId(`${AXIS_ELEMENT_NAME.axisBreak}-${index}`);
|
|
19266
|
+
axisBreakGroup.data = rawRange;
|
|
19267
|
+
const symbolStyle = getAxisBreakSymbolAttrs(breakSymbol);
|
|
19268
|
+
const shape1 = graphicCreator.symbol(Object.assign({ x: startPoint.x, y: startPoint.y }, symbolStyle));
|
|
19269
|
+
shape1.name = AXIS_ELEMENT_NAME.axisBreakSymbol;
|
|
19270
|
+
const shape2 = graphicCreator.symbol(Object.assign({ x: endPoint.x, y: endPoint.y }, symbolStyle));
|
|
19271
|
+
shape2.name = AXIS_ELEMENT_NAME.axisBreakSymbol;
|
|
19272
|
+
axisBreakGroup.add(shape1);
|
|
19273
|
+
axisBreakGroup.add(shape2);
|
|
19274
|
+
container.add(axisBreakGroup);
|
|
19275
|
+
}
|
|
19276
|
+
});
|
|
19277
|
+
}
|
|
19156
19278
|
const { panel } = this.attribute;
|
|
19157
19279
|
if (panel && panel.visible) {
|
|
19158
19280
|
const axisContainer = this.axisContainer;
|
|
@@ -19166,9 +19288,24 @@ class LineAxis extends AxisBase {
|
|
|
19166
19288
|
}
|
|
19167
19289
|
renderLine(container) {
|
|
19168
19290
|
const { start, end, line } = this.attribute;
|
|
19169
|
-
const _a = line, { startSymbol, endSymbol, style,
|
|
19170
|
-
const lineAttrs = Object.assign({
|
|
19291
|
+
const _a = line, { startSymbol, endSymbol, style, state } = _a, restLineAttrs = __rest(_a, ["startSymbol", "endSymbol", "style", "state"]);
|
|
19292
|
+
const lineAttrs = Object.assign({ startSymbol,
|
|
19171
19293
|
endSymbol, lineStyle: style }, restLineAttrs);
|
|
19294
|
+
if (this._breaks && this._breaks.length) {
|
|
19295
|
+
const linePoints = [];
|
|
19296
|
+
let lastStartPoint = start;
|
|
19297
|
+
this._breaks.forEach(b => {
|
|
19298
|
+
const { startPoint, endPoint } = b;
|
|
19299
|
+
linePoints.push([lastStartPoint, startPoint]);
|
|
19300
|
+
lastStartPoint = endPoint;
|
|
19301
|
+
});
|
|
19302
|
+
linePoints.push([lastStartPoint, end]);
|
|
19303
|
+
lineAttrs.points = linePoints;
|
|
19304
|
+
lineAttrs.multiSegment = true;
|
|
19305
|
+
}
|
|
19306
|
+
else {
|
|
19307
|
+
lineAttrs.points = [start, end];
|
|
19308
|
+
}
|
|
19172
19309
|
if (!isEmpty(state)) {
|
|
19173
19310
|
lineAttrs.state = {
|
|
19174
19311
|
line: merge({}, DEFAULT_STATES$1, state),
|
|
@@ -19441,7 +19578,7 @@ class LineAxis extends AxisBase {
|
|
|
19441
19578
|
}
|
|
19442
19579
|
const { verticalLimitSize, label, orient } = this.attribute;
|
|
19443
19580
|
const limitLength = this._getAxisLabelLimitLength(verticalLimitSize, layerCount);
|
|
19444
|
-
const { layoutFunc, autoRotate: autoRotate$1, autoRotateAngle, autoLimit: autoLimit$1, limitEllipsis, autoHide: autoHide$1, autoHideMethod, autoHideSeparation, lastVisible } = label;
|
|
19581
|
+
const { layoutFunc, autoRotate: autoRotate$1, autoRotateAngle, autoLimit: autoLimit$1, limitEllipsis, autoHide: autoHide$1, autoHideMethod, autoHideSeparation, lastVisible, autoWrap: autoWrap$1 } = label;
|
|
19445
19582
|
if (isFunction(layoutFunc)) {
|
|
19446
19583
|
layoutFunc(labelShapes, labelData, layer, this);
|
|
19447
19584
|
}
|
|
@@ -19452,7 +19589,14 @@ class LineAxis extends AxisBase {
|
|
|
19452
19589
|
orient
|
|
19453
19590
|
});
|
|
19454
19591
|
}
|
|
19455
|
-
if (
|
|
19592
|
+
else if (autoWrap$1) {
|
|
19593
|
+
const isVertical = orient === 'left' || orient === 'right';
|
|
19594
|
+
const axisLength = isVertical
|
|
19595
|
+
? Math.abs(this.attribute.start.y - this.attribute.end.y)
|
|
19596
|
+
: Math.abs(this.attribute.start.x - this.attribute.end.x);
|
|
19597
|
+
autoWrap(labelShapes, { orient, limitLength, axisLength, ellipsis: limitEllipsis });
|
|
19598
|
+
}
|
|
19599
|
+
if (!autoWrap$1 && autoLimit$1 && isValidNumber(limitLength) && limitLength > 0) {
|
|
19456
19600
|
const isVertical = orient === 'left' || orient === 'right';
|
|
19457
19601
|
const axisLength = isVertical
|
|
19458
19602
|
? Math.abs(this.attribute.start.y - this.attribute.end.y)
|
|
@@ -19554,6 +19698,10 @@ class LineAxis extends AxisBase {
|
|
|
19554
19698
|
}
|
|
19555
19699
|
return limitLength;
|
|
19556
19700
|
}
|
|
19701
|
+
release() {
|
|
19702
|
+
super.release();
|
|
19703
|
+
this._breaks = null;
|
|
19704
|
+
}
|
|
19557
19705
|
}
|
|
19558
19706
|
LineAxis.defaultAttributes = DEFAULT_AXIS_THEME;
|
|
19559
19707
|
mixin(LineAxis, LineAxisMixin);
|
|
@@ -19923,8 +20071,32 @@ const isAxisHorizontal = (axisOrientType) => {
|
|
|
19923
20071
|
return ['bottom', 'top', 'z'].includes(axisOrientType);
|
|
19924
20072
|
};
|
|
19925
20073
|
|
|
20074
|
+
function getScaleTicks(op, scale, count, getTicks) {
|
|
20075
|
+
let scaleTicks;
|
|
20076
|
+
const { breakData } = op;
|
|
20077
|
+
if (breakData && breakData()) {
|
|
20078
|
+
const { breakDomains } = breakData();
|
|
20079
|
+
const domain = scale.domain();
|
|
20080
|
+
scaleTicks = [];
|
|
20081
|
+
for (let i = 0; i < domain.length - 1; i++) {
|
|
20082
|
+
const subDomain = [domain[i], domain[i + 1]];
|
|
20083
|
+
const ticks = getTicks(count, subDomain);
|
|
20084
|
+
ticks.forEach(tick => {
|
|
20085
|
+
if (!breakDomains.some(breakDomain => tick >= breakDomain[0] && tick <= breakDomain[1])) {
|
|
20086
|
+
scaleTicks.push(tick);
|
|
20087
|
+
}
|
|
20088
|
+
});
|
|
20089
|
+
}
|
|
20090
|
+
scale.domain(domain);
|
|
20091
|
+
}
|
|
20092
|
+
else {
|
|
20093
|
+
scaleTicks = getTicks(count);
|
|
20094
|
+
}
|
|
20095
|
+
return scaleTicks;
|
|
20096
|
+
}
|
|
19926
20097
|
const DEFAULT_CONTINUOUS_TICK_COUNT = 5;
|
|
19927
20098
|
const continuousTicks = (scale, op) => {
|
|
20099
|
+
var _a, _b;
|
|
19928
20100
|
if (!isContinuous(scale.type)) {
|
|
19929
20101
|
return convertDomainToTickData(scale.domain());
|
|
19930
20102
|
}
|
|
@@ -19933,22 +20105,37 @@ const continuousTicks = (scale, op) => {
|
|
|
19933
20105
|
if (rangeSize < 2) {
|
|
19934
20106
|
return convertDomainToTickData([scale.domain()[0]]);
|
|
19935
20107
|
}
|
|
19936
|
-
const { tickCount, forceTickCount, tickStep, noDecimals = false, labelStyle } = op;
|
|
20108
|
+
const { tickCount, forceTickCount, tickStep, noDecimals = false, labelStyle, breakData } = op;
|
|
19937
20109
|
let scaleTicks;
|
|
19938
20110
|
if (isValid(tickStep)) {
|
|
19939
20111
|
scaleTicks = scale.stepTicks(tickStep);
|
|
19940
20112
|
}
|
|
19941
20113
|
else if (isValid(forceTickCount)) {
|
|
19942
|
-
scaleTicks = scale
|
|
20114
|
+
scaleTicks = getScaleTicks(op, scale, forceTickCount, (count, subDomain) => {
|
|
20115
|
+
if (subDomain && subDomain.length) {
|
|
20116
|
+
return scale.domain(subDomain, true).forceTicks(count);
|
|
20117
|
+
}
|
|
20118
|
+
return scale.forceTicks(count);
|
|
20119
|
+
});
|
|
19943
20120
|
}
|
|
19944
20121
|
else if (op.tickMode === 'd3') {
|
|
19945
|
-
const count = isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount;
|
|
19946
|
-
scaleTicks =
|
|
20122
|
+
const count = (_a = (isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount)) !== null && _a !== void 0 ? _a : DEFAULT_CONTINUOUS_TICK_COUNT;
|
|
20123
|
+
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => {
|
|
20124
|
+
if (subDomain && subDomain.length) {
|
|
20125
|
+
return scale.domain(subDomain, true).d3Ticks(count, { noDecimals });
|
|
20126
|
+
}
|
|
20127
|
+
return scale.d3Ticks(count, { noDecimals });
|
|
20128
|
+
});
|
|
19947
20129
|
}
|
|
19948
20130
|
else {
|
|
19949
|
-
const count = isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount;
|
|
20131
|
+
const count = (_b = (isFunction(tickCount) ? tickCount({ axisLength: rangeSize, labelStyle }) : tickCount)) !== null && _b !== void 0 ? _b : DEFAULT_CONTINUOUS_TICK_COUNT;
|
|
19950
20132
|
const customTicks = isFunction(op.tickMode) ? op.tickMode : undefined;
|
|
19951
|
-
scaleTicks =
|
|
20133
|
+
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => {
|
|
20134
|
+
if (subDomain && subDomain.length) {
|
|
20135
|
+
return scale.domain(subDomain, true).ticks(count, { noDecimals, customTicks });
|
|
20136
|
+
}
|
|
20137
|
+
return scale.ticks(count, { noDecimals, customTicks });
|
|
20138
|
+
});
|
|
19952
20139
|
}
|
|
19953
20140
|
if (op.sampling) {
|
|
19954
20141
|
if (op.coordinateType === 'cartesian' || (op.coordinateType === 'polar' && op.axisOrientType === 'radius')) {
|
|
@@ -19957,8 +20144,9 @@ const continuousTicks = (scale, op) => {
|
|
|
19957
20144
|
AABBBounds: bounds,
|
|
19958
20145
|
value: scaleTicks[i]
|
|
19959
20146
|
}));
|
|
20147
|
+
const samplingMethod = breakData && breakData() ? methods.greedy : methods.parity;
|
|
19960
20148
|
while (items.length >= 3 && hasOverlap(items, labelGap)) {
|
|
19961
|
-
items =
|
|
20149
|
+
items = samplingMethod(items, labelGap);
|
|
19962
20150
|
}
|
|
19963
20151
|
const ticks = items.map(item => item.value);
|
|
19964
20152
|
if (ticks.length < 3 && labelFlush) {
|
|
@@ -25945,46 +26133,58 @@ class Title extends AbstractComponent {
|
|
|
25945
26133
|
this.name = 'title';
|
|
25946
26134
|
}
|
|
25947
26135
|
render() {
|
|
25948
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
26136
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
25949
26137
|
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
25950
26138
|
const parsedPadding = normalizePadding(padding);
|
|
25951
26139
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
25952
26140
|
if (this.attribute.visible !== false && textStyle.visible !== false) {
|
|
26141
|
+
const { width: mainTitleWidth, height: mainTitleHeight, maxHeight: mainTitleMaxHeight, maxWidth: mainTitleMaxWidth, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', maxWidth, lineClamp } = textStyle;
|
|
25953
26142
|
if (textType === 'rich' || isValid(textStyle.character)) {
|
|
25954
|
-
const attr = Object.assign({ x
|
|
26143
|
+
const attr = Object.assign({ x,
|
|
26144
|
+
y, width: (_a = mainTitleWidth !== null && mainTitleWidth !== void 0 ? mainTitleWidth : width) !== null && _a !== void 0 ? _a : 0, height: (_b = mainTitleHeight !== null && mainTitleHeight !== void 0 ? mainTitleHeight : height) !== null && _b !== void 0 ? _b : 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);
|
|
25955
26145
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
25956
26146
|
}
|
|
25957
26147
|
else if (textType === 'html') {
|
|
25958
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x
|
|
26148
|
+
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x,
|
|
26149
|
+
y, width: (_d = mainTitleWidth !== null && mainTitleWidth !== void 0 ? mainTitleWidth : width) !== null && _d !== void 0 ? _d : 0, height: (_e = mainTitleHeight !== null && mainTitleHeight !== void 0 ? mainTitleHeight : height) !== null && _e !== void 0 ? _e : 0, ellipsis,
|
|
26150
|
+
wordBreak, maxHeight: mainTitleMaxHeight !== null && mainTitleMaxHeight !== void 0 ? mainTitleMaxHeight : maxHeight, maxWidth: mainTitleMaxWidth !== null && mainTitleMaxWidth !== void 0 ? mainTitleMaxWidth : maxWidth, textConfig: [] }, textStyle);
|
|
25959
26151
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
25960
26152
|
}
|
|
25961
26153
|
else if (isValid(text)) {
|
|
25962
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: isArray(text) ? text : [text],
|
|
26154
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: isArray(text) ? text : [text], whiteSpace: 'normal' }, textStyle), { maxLineWidth: (_g = (_f = textStyle.maxLineWidth) !== null && _f !== void 0 ? _f : mainTitleWidth) !== null && _g !== void 0 ? _g : width, heightLimit: mainTitleHeight !== null && mainTitleHeight !== void 0 ? mainTitleHeight : maxHeight, lineClamp,
|
|
26155
|
+
ellipsis,
|
|
26156
|
+
x,
|
|
26157
|
+
y }), 'text');
|
|
25963
26158
|
}
|
|
25964
26159
|
}
|
|
25965
26160
|
const maintextHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;
|
|
25966
26161
|
const maintextWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
25967
26162
|
if (this.attribute.visible !== false && subtextStyle.visible !== false) {
|
|
26163
|
+
const { width: subTitleWidth, height: subTitleHeight, maxWidth: subTitleMaxWidth, maxHeight: subTitleMaxHeight, x = 0, y = 0, ellipsis = true, wordBreak = 'break-word', lineClamp } = subtextStyle;
|
|
26164
|
+
const maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - maintextHeight);
|
|
25968
26165
|
if (subtextType === 'rich' || isValid(subtextStyle.character)) {
|
|
25969
|
-
const attr = Object.assign({ x
|
|
26166
|
+
const attr = Object.assign({ x,
|
|
26167
|
+
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,
|
|
26168
|
+
wordBreak, maxHeight: subTitleMaxHeight !== null && subTitleMaxHeight !== void 0 ? subTitleMaxHeight : maxSubTextHeight, maxWidth: subTitleMaxWidth !== null && subTitleMaxWidth !== void 0 ? subTitleMaxWidth : maxWidth, textConfig: (_k = subtextStyle.character) !== null && _k !== void 0 ? _k : subtext }, subtextStyle);
|
|
25970
26169
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
25971
26170
|
}
|
|
25972
26171
|
else if (subtextType === 'html') {
|
|
25973
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: subtext }, DEFAULT_HTML_TEXT_SPEC), subtextStyle), x
|
|
26172
|
+
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: subtext }, DEFAULT_HTML_TEXT_SPEC), subtextStyle), x,
|
|
26173
|
+
y, width: (_l = subTitleWidth !== null && subTitleWidth !== void 0 ? subTitleWidth : width) !== null && _l !== void 0 ? _l : 0, height: (_m = subTitleHeight !== null && subTitleHeight !== void 0 ? subTitleHeight : height) !== null && _m !== void 0 ? _m : 0, ellipsis,
|
|
26174
|
+
wordBreak, maxHeight: subTitleMaxHeight !== null && subTitleMaxHeight !== void 0 ? subTitleMaxHeight : maxSubTextHeight, maxWidth: subTitleMaxWidth !== null && subTitleMaxWidth !== void 0 ? subTitleMaxWidth : maxWidth, textConfig: [] }, subtextStyle);
|
|
25974
26175
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
25975
26176
|
}
|
|
25976
26177
|
else if (isValid(subtext)) {
|
|
25977
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: isArray(subtext) ? subtext : [subtext],
|
|
26178
|
+
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,
|
|
26179
|
+
ellipsis, x: 0, y: maintextHeight }), 'text');
|
|
25978
26180
|
}
|
|
25979
26181
|
}
|
|
25980
26182
|
const subtextHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;
|
|
25981
26183
|
const subtextWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
25982
26184
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
25983
|
-
let titleHeight = maintextHeight + ((
|
|
26185
|
+
let titleHeight = maintextHeight + ((_q = subtextStyle.height) !== null && _q !== void 0 ? _q : subtextHeight);
|
|
25984
26186
|
if (isValid(width)) {
|
|
25985
26187
|
titleWidth = width;
|
|
25986
|
-
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', width);
|
|
25987
|
-
this._subTitle && this._subTitle.setAttribute('maxLineWidth', width);
|
|
25988
26188
|
}
|
|
25989
26189
|
if (isValid(height)) {
|
|
25990
26190
|
titleHeight = height;
|
|
@@ -25993,10 +26193,6 @@ class Title extends AbstractComponent {
|
|
|
25993
26193
|
titleWidth = minWidth;
|
|
25994
26194
|
}
|
|
25995
26195
|
if (isValid(maxWidth)) {
|
|
25996
|
-
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', maxWidth);
|
|
25997
|
-
this._subTitle && this._subTitle.setAttribute('maxLineWidth', maxWidth);
|
|
25998
|
-
this._mainTitle && this._mainTitle.setAttribute('maxWidth', maxWidth);
|
|
25999
|
-
this._subTitle && this._subTitle.setAttribute('maxWidth', maxWidth);
|
|
26000
26196
|
if (titleWidth > maxWidth) {
|
|
26001
26197
|
titleWidth = maxWidth;
|
|
26002
26198
|
}
|
|
@@ -26005,8 +26201,6 @@ class Title extends AbstractComponent {
|
|
|
26005
26201
|
titleHeight = minHeight;
|
|
26006
26202
|
}
|
|
26007
26203
|
if (isValid(maxHeight)) {
|
|
26008
|
-
this._mainTitle && this._mainTitle.setAttribute('maxHeight', maxHeight);
|
|
26009
|
-
this._subTitle && this._subTitle.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
26010
26204
|
if (titleHeight > maxHeight) {
|
|
26011
26205
|
titleHeight = maxHeight;
|
|
26012
26206
|
}
|
|
@@ -26017,7 +26211,7 @@ class Title extends AbstractComponent {
|
|
|
26017
26211
|
if (this._mainTitle) {
|
|
26018
26212
|
if (isValid(align) || isValid(textStyle.align)) {
|
|
26019
26213
|
const mainTitleAlign = textStyle.align ? textStyle.align : align;
|
|
26020
|
-
const mainTitleWidth = (
|
|
26214
|
+
const mainTitleWidth = (_r = textStyle.width) !== null && _r !== void 0 ? _r : maintextWidth;
|
|
26021
26215
|
if (mainTitleAlign === 'left') {
|
|
26022
26216
|
this._mainTitle.setAttribute('x', 0);
|
|
26023
26217
|
this._mainTitle.setAttribute('textAlign', 'left');
|
|
@@ -26051,7 +26245,7 @@ class Title extends AbstractComponent {
|
|
|
26051
26245
|
if (this._subTitle) {
|
|
26052
26246
|
if (isValid(align) || isValid(subtextStyle.align)) {
|
|
26053
26247
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;
|
|
26054
|
-
const subTitleWidth = (
|
|
26248
|
+
const subTitleWidth = (_s = subtextStyle.width) !== null && _s !== void 0 ? _s : subtextWidth;
|
|
26055
26249
|
if (subTitleAlign === 'left') {
|
|
26056
26250
|
this._subTitle.setAttribute('x', 0);
|
|
26057
26251
|
this._subTitle.setAttribute('textAlign', 'left');
|
|
@@ -26068,7 +26262,7 @@ class Title extends AbstractComponent {
|
|
|
26068
26262
|
if (isValid(verticalAlign) || isValid(textStyle.verticalAlign)) {
|
|
26069
26263
|
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
|
|
26070
26264
|
const subTitleYStart = maintextHeight;
|
|
26071
|
-
const subTitleHeight = (
|
|
26265
|
+
const subTitleHeight = (_t = subtextStyle.height) !== null && _t !== void 0 ? _t : 0;
|
|
26072
26266
|
if (subTitleVerticalAlign === 'top') {
|
|
26073
26267
|
this._subTitle.setAttribute('y', subTitleYStart);
|
|
26074
26268
|
this._subTitle.setAttribute('textBaseline', 'top');
|
|
@@ -28589,6 +28783,6 @@ EmptyTip.defaultAttributes = {
|
|
|
28589
28783
|
}
|
|
28590
28784
|
};
|
|
28591
28785
|
|
|
28592
|
-
const version = "0.20.
|
|
28786
|
+
const version = "0.20.3-alpha.0";
|
|
28593
28787
|
|
|
28594
|
-
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, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|
|
28788
|
+
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, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, 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, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|