@visactor/vchart 1.12.3 → 1.12.4-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/build/es5/index.js +2 -2
- package/build/index.js +606 -235
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/axis/base-axis.d.ts +1 -1
- package/cjs/component/axis/base-axis.js +5 -3
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +3 -2
- package/cjs/component/axis/cartesian/axis.js +19 -11
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/axis/cartesian/linear-axis.d.ts +5 -1
- package/cjs/component/axis/cartesian/linear-axis.js +37 -1
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +5 -1
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +7 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js +37 -13
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/util/break-data.d.ts +4 -0
- package/cjs/component/axis/mixin/util/break-data.js +39 -0
- package/cjs/component/axis/mixin/util/break-data.js.map +1 -0
- package/cjs/component/brush/brush.js +4 -1
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/crosshair/cartesian.d.ts +1 -0
- package/cjs/component/crosshair/cartesian.js +12 -2
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.js +1 -1
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +9 -7
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/util.js +3 -2
- package/cjs/component/data-zoom/util.js.map +1 -1
- 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/plugin/components/axis-sync/tick-align-transform.js +3 -3
- package/cjs/plugin/components/axis-sync/tick-align-transform.js.map +1 -1
- package/cjs/plugin/components/axis-sync/zero-align-transform.js +5 -3
- package/cjs/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
- package/cjs/util/array.d.ts +1 -0
- package/cjs/util/array.js +11 -2
- package/cjs/util/array.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +1 -1
- package/esm/component/axis/base-axis.js +6 -2
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +3 -2
- package/esm/component/axis/cartesian/axis.js +18 -10
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/axis/cartesian/linear-axis.d.ts +5 -1
- package/esm/component/axis/cartesian/linear-axis.js +40 -1
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +5 -1
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +7 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js +37 -13
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/util/break-data.d.ts +4 -0
- package/esm/component/axis/mixin/util/break-data.js +31 -0
- package/esm/component/axis/mixin/util/break-data.js.map +1 -0
- package/esm/component/brush/brush.js +2 -2
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/crosshair/cartesian.d.ts +1 -0
- package/esm/component/crosshair/cartesian.js +12 -2
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.js +1 -1
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +6 -6
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -2
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/util.js +3 -1
- package/esm/component/data-zoom/util.js.map +1 -1
- 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/plugin/components/axis-sync/tick-align-transform.js +4 -2
- package/esm/plugin/components/axis-sync/tick-align-transform.js.map +1 -1
- package/esm/plugin/components/axis-sync/zero-align-transform.js +4 -4
- package/esm/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
- package/esm/util/array.d.ts +1 -0
- package/esm/util/array.js +9 -0
- package/esm/util/array.js.map +1 -1
- package/package.json +6 -6
package/build/index.js
CHANGED
|
@@ -24611,6 +24611,18 @@
|
|
|
24611
24611
|
Factory$2.registerPlugin("ViewTransform3dPlugin", ViewTransform3dPlugin);
|
|
24612
24612
|
};
|
|
24613
24613
|
|
|
24614
|
+
function combineArray(arr) {
|
|
24615
|
+
const result = [];
|
|
24616
|
+
for (let index = 0; index < arr.length; index++) {
|
|
24617
|
+
const element = arr[index];
|
|
24618
|
+
if (index === 0) {
|
|
24619
|
+
result.push(element[0]);
|
|
24620
|
+
}
|
|
24621
|
+
result.push(element[1]);
|
|
24622
|
+
}
|
|
24623
|
+
return result;
|
|
24624
|
+
}
|
|
24625
|
+
|
|
24614
24626
|
const warn = (msg, detail) => {
|
|
24615
24627
|
if (isFunction$1(config.warnHandler)) {
|
|
24616
24628
|
config.warnHandler.call(null, msg, detail);
|
|
@@ -30519,10 +30531,10 @@
|
|
|
30519
30531
|
if (visible && isBoolean$1(bgVisible)) {
|
|
30520
30532
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
30521
30533
|
visible: bgVisible && !!text,
|
|
30522
|
-
x: textShape.AABBBounds.x1,
|
|
30523
|
-
y: textShape.AABBBounds.y1,
|
|
30524
|
-
width: textShape.AABBBounds.width(),
|
|
30525
|
-
height: textShape.AABBBounds.height()
|
|
30534
|
+
x: textShape.AABBBounds.x1 - parsedPadding[1],
|
|
30535
|
+
y: textShape.AABBBounds.y1 - parsedPadding[0],
|
|
30536
|
+
width: textShape.AABBBounds.width() + (parsedPadding[1] + parsedPadding[3]),
|
|
30537
|
+
height: textShape.AABBBounds.height() + (parsedPadding[0] + parsedPadding[2])
|
|
30526
30538
|
}), "rect");
|
|
30527
30539
|
if (isEmpty(null == state ? void 0 : state.panel) || (bgRect.states = state.panel), backgroundStyle.customShape) {
|
|
30528
30540
|
const customShape = backgroundStyle.customShape;
|
|
@@ -31547,9 +31559,9 @@
|
|
|
31547
31559
|
easing: easing,
|
|
31548
31560
|
increaseEffect = !0
|
|
31549
31561
|
} = animationConfig;
|
|
31550
|
-
return prev.animate().to(next.attribute, duration, easing), void (increaseEffect && playIncreaseCount(prev, next, duration, easing));
|
|
31562
|
+
return prev.animate().to(next.attribute, duration, easing), void (increaseEffect && "text" === prev.type && "text" === next.type && playIncreaseCount(prev, next, duration, easing));
|
|
31551
31563
|
}
|
|
31552
|
-
animationConfig.forEach(
|
|
31564
|
+
animationConfig.forEach(cfg => {
|
|
31553
31565
|
const {
|
|
31554
31566
|
duration: duration,
|
|
31555
31567
|
easing: easing,
|
|
@@ -31557,10 +31569,9 @@
|
|
|
31557
31569
|
channel: channel
|
|
31558
31570
|
} = cfg,
|
|
31559
31571
|
{
|
|
31560
|
-
from: from,
|
|
31561
31572
|
to: to
|
|
31562
31573
|
} = update$1(prev, next, channel, cfg.options);
|
|
31563
|
-
isEmpty(to) || prev.animate().to(to, duration, easing), "text"
|
|
31574
|
+
isEmpty(to) || prev.animate().to(to, duration, easing), increaseEffect && "text" === prev.type && "text" === next.type && playIncreaseCount(prev, next, duration, easing);
|
|
31564
31575
|
});
|
|
31565
31576
|
}
|
|
31566
31577
|
const update$1 = (prev, next, channel, options) => {
|
|
@@ -31895,7 +31906,7 @@
|
|
|
31895
31906
|
return createTextGraphicByType(textAttrs, "textType");
|
|
31896
31907
|
}
|
|
31897
31908
|
_prepare() {
|
|
31898
|
-
var _a, _b
|
|
31909
|
+
var _a, _b;
|
|
31899
31910
|
const currentBaseMarks = [];
|
|
31900
31911
|
let baseMarks;
|
|
31901
31912
|
if (baseMarks = isFunction$1(this.attribute.getBaseMarks) ? this.attribute.getBaseMarks() : getMarksByName(this.getRootNode(), this.attribute.baseMarkGroupName), baseMarks.forEach(mark => {
|
|
@@ -31922,13 +31933,23 @@
|
|
|
31922
31933
|
textData && baseMark && (isValid$1(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
|
|
31923
31934
|
}
|
|
31924
31935
|
if (!1 !== this.attribute.animation) {
|
|
31925
|
-
const
|
|
31936
|
+
const {
|
|
31937
|
+
animation: animation,
|
|
31938
|
+
animationEnter: animationEnter,
|
|
31939
|
+
animationExit: animationExit,
|
|
31940
|
+
animationUpdate: animationUpdate
|
|
31941
|
+
} = this.attribute,
|
|
31942
|
+
animationCfg = isObject$2(animation) ? animation : {};
|
|
31926
31943
|
this._animationConfig = {
|
|
31927
|
-
enter: merge$2({}, DefaultLabelAnimation,
|
|
31928
|
-
exit: merge$2({}, DefaultLabelAnimation,
|
|
31929
|
-
update: isArray$1(
|
|
31944
|
+
enter: !1 !== animationEnter && merge$2({}, DefaultLabelAnimation, animationCfg, null != animationEnter ? animationEnter : {}),
|
|
31945
|
+
exit: !1 !== animationExit && merge$2({}, DefaultLabelAnimation, animationCfg, null != animationExit ? animationExit : {}),
|
|
31946
|
+
update: !1 !== animationUpdate && (isArray$1(animationUpdate) ? animationUpdate : merge$2({}, DefaultLabelAnimation, animationCfg, null != animationUpdate ? animationUpdate : {}))
|
|
31930
31947
|
};
|
|
31931
|
-
}
|
|
31948
|
+
} else this._animationConfig = {
|
|
31949
|
+
enter: !1,
|
|
31950
|
+
exit: !1,
|
|
31951
|
+
update: !1
|
|
31952
|
+
};
|
|
31932
31953
|
}
|
|
31933
31954
|
}
|
|
31934
31955
|
getRelatedGraphic(item) {
|
|
@@ -32093,9 +32114,6 @@
|
|
|
32093
32114
|
};
|
|
32094
32115
|
}
|
|
32095
32116
|
_renderLabels(labels) {
|
|
32096
|
-
!1 === this._enableAnimation || !1 === this.attribute.animation ? this._renderWithOutAnimation(labels) : this._renderWithAnimation(labels);
|
|
32097
|
-
}
|
|
32098
|
-
_renderWithAnimation(labels) {
|
|
32099
32117
|
var _a;
|
|
32100
32118
|
const {
|
|
32101
32119
|
syncState: syncState
|
|
@@ -32110,8 +32128,7 @@
|
|
|
32110
32128
|
labels && labels.forEach((text, index) => {
|
|
32111
32129
|
var _a;
|
|
32112
32130
|
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
32113
|
-
|
|
32114
|
-
textKey = this._isCollectionBase ? textId : relatedGraphic,
|
|
32131
|
+
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic,
|
|
32115
32132
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(textKey)) ? "update" : "enter";
|
|
32116
32133
|
let labelLine;
|
|
32117
32134
|
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), syncState && this.updateStatesOfLabels([labelLine ? {
|
|
@@ -32119,73 +32136,78 @@
|
|
|
32119
32136
|
labelLine: labelLine
|
|
32120
32137
|
} : {
|
|
32121
32138
|
text: text
|
|
32122
|
-
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) {
|
|
32123
|
-
if (texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
32124
|
-
text: text,
|
|
32125
|
-
labelLine: labelLine
|
|
32126
|
-
} : {
|
|
32127
|
-
text: text
|
|
32128
|
-
}), relatedGraphic) {
|
|
32129
|
-
const {
|
|
32130
|
-
from: from,
|
|
32131
|
-
to: to
|
|
32132
|
-
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
32133
|
-
this.add(text), labelLine && (labelLines.push(labelLine), this.add(labelLine)), this._syncStateWithRelatedGraphic(relatedGraphic), this._animationConfig.enter.duration > 0 && relatedGraphic.once("animate-bind", a => {
|
|
32134
|
-
text.setAttributes(from), labelLine && labelLine.setAttributes(from);
|
|
32135
|
-
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
32136
|
-
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
32137
|
-
});
|
|
32138
|
-
}
|
|
32139
|
-
} else if ("update" === state) {
|
|
32140
|
-
const prevLabel = prevTextMap.get(textKey);
|
|
32141
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel);
|
|
32142
|
-
const prevText = prevLabel.text,
|
|
32143
|
-
{
|
|
32144
|
-
duration: duration,
|
|
32145
|
-
easing: easing
|
|
32146
|
-
} = this._animationConfig.update;
|
|
32147
|
-
updateAnimation(prevText, text, this._animationConfig.update), prevLabel.labelLine && labelLine && prevLabel.labelLine.animate().to(labelLine.attribute, duration, easing);
|
|
32148
|
-
}
|
|
32149
|
-
}), prevTextMap.forEach(label => {
|
|
32150
|
-
var _a;
|
|
32151
|
-
null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, this._animationConfig.exit.duration, this._animationConfig.exit.easing).onEnd(() => {
|
|
32152
|
-
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
32153
|
-
});
|
|
32154
|
-
}), this._graphicToText = currentTextMap;
|
|
32155
|
-
}
|
|
32156
|
-
_renderWithOutAnimation(labels) {
|
|
32157
|
-
var _a;
|
|
32158
|
-
const {
|
|
32159
|
-
syncState: syncState
|
|
32160
|
-
} = this.attribute,
|
|
32161
|
-
currentTextMap = new Map(),
|
|
32162
|
-
prevTextMap = this._graphicToText || new Map(),
|
|
32163
|
-
{
|
|
32164
|
-
visible: showLabelLine
|
|
32165
|
-
} = null !== (_a = this.attribute.line) && void 0 !== _a ? _a : {};
|
|
32166
|
-
labels && labels.forEach(text => {
|
|
32167
|
-
var _a;
|
|
32168
|
-
const relatedGraphic = this.getRelatedGraphic(text.attribute),
|
|
32169
|
-
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter",
|
|
32170
|
-
textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
32171
|
-
let labelLine;
|
|
32172
|
-
if (showLabelLine && (labelLine = this._createLabelLine(text, relatedGraphic)), syncState && this.updateStatesOfLabels([labelLine ? {
|
|
32139
|
+
}], null !== (_a = relatedGraphic.currentStates) && void 0 !== _a ? _a : []), "enter" === state) texts.push(text), currentTextMap.set(textKey, labelLine ? {
|
|
32173
32140
|
text: text,
|
|
32174
32141
|
labelLine: labelLine
|
|
32175
32142
|
} : {
|
|
32176
32143
|
text: text
|
|
32177
|
-
}
|
|
32144
|
+
}), this._addLabel({
|
|
32178
32145
|
text: text,
|
|
32179
32146
|
labelLine: labelLine
|
|
32180
|
-
}
|
|
32181
|
-
text: text
|
|
32182
|
-
}), this.add(text), labelLine && this.add(labelLine), this._syncStateWithRelatedGraphic(relatedGraphic);else if ("update" === state) {
|
|
32147
|
+
}, texts, labelLines, index);else if ("update" === state) {
|
|
32183
32148
|
const prevLabel = prevTextMap.get(textKey);
|
|
32184
|
-
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel),
|
|
32149
|
+
prevTextMap.delete(textKey), currentTextMap.set(textKey, prevLabel), this._updateLabel(prevLabel, {
|
|
32150
|
+
text: text,
|
|
32151
|
+
labelLine: labelLine
|
|
32152
|
+
});
|
|
32185
32153
|
}
|
|
32186
|
-
}),
|
|
32154
|
+
}), this._removeLabel(prevTextMap), this._graphicToText = currentTextMap;
|
|
32155
|
+
}
|
|
32156
|
+
_addLabel(label, texts, labelLines, index) {
|
|
32157
|
+
const {
|
|
32158
|
+
text: text,
|
|
32159
|
+
labelLine: labelLine
|
|
32160
|
+
} = label,
|
|
32161
|
+
relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
32162
|
+
if (this._syncStateWithRelatedGraphic(relatedGraphic), !1 !== this._enableAnimation && !1 !== this._animationConfig.enter) {
|
|
32163
|
+
if (relatedGraphic) {
|
|
32164
|
+
const {
|
|
32165
|
+
from: from,
|
|
32166
|
+
to: to
|
|
32167
|
+
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
32168
|
+
text && this.add(text), labelLine && (labelLines.push(labelLine), this.add(labelLine)), this._animationConfig.enter.duration > 0 && relatedGraphic.once("animate-bind", a => {
|
|
32169
|
+
text.setAttributes(from), labelLine && labelLine.setAttributes(from);
|
|
32170
|
+
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, this._animationConfig.enter);
|
|
32171
|
+
relatedGraphic.on("afterAttributeUpdate", listener);
|
|
32172
|
+
});
|
|
32173
|
+
}
|
|
32174
|
+
} else text && this.add(text), labelLine && this.add(labelLine);
|
|
32175
|
+
}
|
|
32176
|
+
_updateLabel(prevLabel, currentLabel) {
|
|
32177
|
+
const {
|
|
32178
|
+
text: prevText,
|
|
32179
|
+
labelLine: prevLabelLine
|
|
32180
|
+
} = prevLabel,
|
|
32181
|
+
{
|
|
32182
|
+
text: curText,
|
|
32183
|
+
labelLine: curLabelLine
|
|
32184
|
+
} = currentLabel;
|
|
32185
|
+
if (!1 !== this._enableAnimation && !1 !== this._animationConfig.update) {
|
|
32186
|
+
const {
|
|
32187
|
+
duration: duration,
|
|
32188
|
+
easing: easing
|
|
32189
|
+
} = this._animationConfig.update;
|
|
32190
|
+
updateAnimation(prevText, curText, this._animationConfig.update), prevLabelLine && curLabelLine && prevLabel.labelLine.animate().to(curLabelLine.attribute, duration, easing);
|
|
32191
|
+
} else prevLabel.text.setAttributes(curText.attribute), prevLabelLine && curLabelLine && prevLabel.labelLine.setAttributes(curLabelLine.attribute);
|
|
32192
|
+
}
|
|
32193
|
+
_removeLabel(textMap) {
|
|
32194
|
+
const removeLabelAndLine = label => {
|
|
32187
32195
|
this.removeChild(label.text), label.labelLine && this.removeChild(label.labelLine);
|
|
32188
|
-
}
|
|
32196
|
+
};
|
|
32197
|
+
if (!1 !== this._enableAnimation && !1 !== this._animationConfig.exit) {
|
|
32198
|
+
const {
|
|
32199
|
+
duration: duration,
|
|
32200
|
+
easing: easing
|
|
32201
|
+
} = this._animationConfig.exit;
|
|
32202
|
+
textMap.forEach(label => {
|
|
32203
|
+
var _a;
|
|
32204
|
+
null === (_a = label.text) || void 0 === _a || _a.animate().to(getAnimationAttributes(label.text.attribute, "fadeOut").to, duration, easing).onEnd(() => {
|
|
32205
|
+
removeLabelAndLine(label);
|
|
32206
|
+
});
|
|
32207
|
+
});
|
|
32208
|
+
} else textMap.forEach(label => {
|
|
32209
|
+
removeLabelAndLine(label);
|
|
32210
|
+
});
|
|
32189
32211
|
}
|
|
32190
32212
|
updateStatesOfLabels(labels, currentStates) {
|
|
32191
32213
|
labels.forEach(label => {
|
|
@@ -32193,7 +32215,7 @@
|
|
|
32193
32215
|
});
|
|
32194
32216
|
}
|
|
32195
32217
|
_syncStateWithRelatedGraphic(relatedGraphic) {
|
|
32196
|
-
this.attribute.syncState && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
|
|
32218
|
+
this.attribute.syncState && relatedGraphic && relatedGraphic.on("afterAttributeUpdate", this._handleRelatedGraphicSetState);
|
|
32197
32219
|
}
|
|
32198
32220
|
_afterRelatedGraphicAttributeUpdate(text, texts, labelLine, labelLines, index, relatedGraphic, to, _ref) {
|
|
32199
32221
|
let {
|
|
@@ -33378,7 +33400,7 @@
|
|
|
33378
33400
|
|
|
33379
33401
|
var AXIS_ELEMENT_NAME;
|
|
33380
33402
|
!function (AXIS_ELEMENT_NAME) {
|
|
33381
|
-
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background";
|
|
33403
|
+
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background", AXIS_ELEMENT_NAME.axisBreak = "axis-break", AXIS_ELEMENT_NAME.axisBreakSymbol = "axis-break-symbol";
|
|
33382
33404
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
33383
33405
|
var AxisStateValue;
|
|
33384
33406
|
!function (AxisStateValue) {
|
|
@@ -33390,6 +33412,7 @@
|
|
|
33390
33412
|
[AxisStateValue.hover]: {},
|
|
33391
33413
|
[AxisStateValue.hoverReverse]: {}
|
|
33392
33414
|
};
|
|
33415
|
+
const TopZIndex = 999;
|
|
33393
33416
|
|
|
33394
33417
|
const DEFAULT_AXIS_THEME = {
|
|
33395
33418
|
title: {
|
|
@@ -33445,6 +33468,12 @@
|
|
|
33445
33468
|
}
|
|
33446
33469
|
}
|
|
33447
33470
|
};
|
|
33471
|
+
const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {
|
|
33472
|
+
size: 8,
|
|
33473
|
+
stroke: "#000",
|
|
33474
|
+
lineWidth: 1,
|
|
33475
|
+
zIndex: 1
|
|
33476
|
+
};
|
|
33448
33477
|
|
|
33449
33478
|
const clampRadian = function () {
|
|
33450
33479
|
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -33476,6 +33505,20 @@
|
|
|
33476
33505
|
y: baseY - dy
|
|
33477
33506
|
};
|
|
33478
33507
|
}
|
|
33508
|
+
function getAxisBreakSymbolAttrs() {
|
|
33509
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33510
|
+
var _a, _b;
|
|
33511
|
+
const {
|
|
33512
|
+
style = {},
|
|
33513
|
+
angle = .5 * Math.PI
|
|
33514
|
+
} = props,
|
|
33515
|
+
symbolStyle = merge$2({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
|
|
33516
|
+
symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
|
|
33517
|
+
return Object.assign(Object.assign({}, symbolStyle), {
|
|
33518
|
+
symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize * Math.sin(angle)} L ${symbolSize / 2} ${-symbolSize * Math.sin(angle)}`,
|
|
33519
|
+
symbolSize: symbolSize
|
|
33520
|
+
});
|
|
33521
|
+
}
|
|
33479
33522
|
function getElMap(g) {
|
|
33480
33523
|
const elMap = {};
|
|
33481
33524
|
return traverseGroup(g, el => {
|
|
@@ -33878,6 +33921,17 @@
|
|
|
33878
33921
|
function itemIntersect(item1, item2) {
|
|
33879
33922
|
return isRectIntersect(item1.AABBBounds, item2.AABBBounds, !1) && (!item1.rotatedBounds || !item2.rotatedBounds || isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, !0));
|
|
33880
33923
|
}
|
|
33924
|
+
const DELTA_ANGLE = Math.sin(Math.PI / 10);
|
|
33925
|
+
function isAngleVertical(angle) {
|
|
33926
|
+
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
33927
|
+
cos = hasAngle ? Math.cos(angle) : 1;
|
|
33928
|
+
return hasAngle && Math.abs(cos) <= DELTA_ANGLE;
|
|
33929
|
+
}
|
|
33930
|
+
function isAngleHorizontal(angle) {
|
|
33931
|
+
const hasAngle = !isNil$1(angle) && 0 !== angle,
|
|
33932
|
+
sin = hasAngle ? Math.sin(angle) : 0;
|
|
33933
|
+
return !hasAngle || Math.abs(sin) <= DELTA_ANGLE;
|
|
33934
|
+
}
|
|
33881
33935
|
|
|
33882
33936
|
const methods$2 = {
|
|
33883
33937
|
parity: function (items) {
|
|
@@ -34011,15 +34065,14 @@
|
|
|
34011
34065
|
axisLength: axisLength
|
|
34012
34066
|
} = config;
|
|
34013
34067
|
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
34014
|
-
const DELTA = Math.sin(Math.PI / 10);
|
|
34015
34068
|
labels.forEach(label => {
|
|
34016
34069
|
var _a;
|
|
34017
34070
|
const angle = label.attribute.angle,
|
|
34018
34071
|
hasAngle = !isNil$1(angle),
|
|
34019
34072
|
cos = hasAngle ? Math.cos(angle) : 1,
|
|
34020
34073
|
sin = hasAngle ? Math.sin(angle) : 0,
|
|
34021
|
-
isHorizontal =
|
|
34022
|
-
isVertical =
|
|
34074
|
+
isHorizontal = isAngleHorizontal(angle),
|
|
34075
|
+
isVertical = isAngleVertical(angle),
|
|
34023
34076
|
isX = "top" === orient || "bottom" === orient;
|
|
34024
34077
|
if (isX) {
|
|
34025
34078
|
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
@@ -34049,6 +34102,39 @@
|
|
|
34049
34102
|
});
|
|
34050
34103
|
}
|
|
34051
34104
|
|
|
34105
|
+
function autoWrap(labels, config) {
|
|
34106
|
+
const {
|
|
34107
|
+
limitLength: limitLength,
|
|
34108
|
+
axisLength: axisLength,
|
|
34109
|
+
ellipsis = "...",
|
|
34110
|
+
orient: orient
|
|
34111
|
+
} = config;
|
|
34112
|
+
if (isEmpty(labels) || !isValidNumber$1(limitLength)) return;
|
|
34113
|
+
const verticalLimitLength = axisLength / labels.length;
|
|
34114
|
+
labels.forEach(label => {
|
|
34115
|
+
var _a;
|
|
34116
|
+
const angle = label.attribute.angle,
|
|
34117
|
+
isHorizontal = isAngleHorizontal(angle),
|
|
34118
|
+
isVertical = isAngleVertical(angle),
|
|
34119
|
+
isX = "top" === orient || "bottom" === orient;
|
|
34120
|
+
if (isX) {
|
|
34121
|
+
if (isVertical && Math.floor(label.AABBBounds.height()) <= limitLength) return;
|
|
34122
|
+
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= verticalLimitLength) return;
|
|
34123
|
+
} else {
|
|
34124
|
+
if (isVertical && Math.floor(label.AABBBounds.height()) <= verticalLimitLength) return;
|
|
34125
|
+
if (isHorizontal && Math.floor(label.AABBBounds.width()) <= limitLength) return;
|
|
34126
|
+
}
|
|
34127
|
+
let limitLabelLength = null,
|
|
34128
|
+
heightLimit = null;
|
|
34129
|
+
isX ? isVertical ? (limitLabelLength = limitLength, heightLimit = verticalLimitLength) : (limitLabelLength = verticalLimitLength, heightLimit = limitLength) : isVertical ? (limitLabelLength = verticalLimitLength, heightLimit = limitLength) : (limitLabelLength = limitLength, heightLimit = verticalLimitLength), label.setAttributes({
|
|
34130
|
+
maxLineWidth: limitLabelLength,
|
|
34131
|
+
ellipsis: null !== (_a = label.attribute.ellipsis) && void 0 !== _a ? _a : ellipsis,
|
|
34132
|
+
whiteSpace: "normal",
|
|
34133
|
+
heightLimit: heightLimit
|
|
34134
|
+
});
|
|
34135
|
+
});
|
|
34136
|
+
}
|
|
34137
|
+
|
|
34052
34138
|
function alignAxisLabels(labels, start, containerSize, orient, align) {
|
|
34053
34139
|
"left" === orient || "right" === orient ? "left" === align ? labels.forEach(label => {
|
|
34054
34140
|
var _a;
|
|
@@ -34148,7 +34234,50 @@
|
|
|
34148
34234
|
}
|
|
34149
34235
|
_renderInner(container) {
|
|
34150
34236
|
var _a;
|
|
34151
|
-
|
|
34237
|
+
if (this._breaks = null, this.attribute.breaks && this.attribute.breaks.length) {
|
|
34238
|
+
const transformedBreaks = [];
|
|
34239
|
+
for (let index = 0; index < this.attribute.breaks.length; index++) {
|
|
34240
|
+
const aBreak = this.attribute.breaks[index],
|
|
34241
|
+
{
|
|
34242
|
+
range: range,
|
|
34243
|
+
breakSymbol: breakSymbol,
|
|
34244
|
+
rawRange: rawRange
|
|
34245
|
+
} = aBreak;
|
|
34246
|
+
transformedBreaks.push({
|
|
34247
|
+
startPoint: this.getTickCoord(range[0]),
|
|
34248
|
+
endPoint: this.getTickCoord(range[1]),
|
|
34249
|
+
range: range,
|
|
34250
|
+
breakSymbol: breakSymbol,
|
|
34251
|
+
rawRange: rawRange
|
|
34252
|
+
});
|
|
34253
|
+
}
|
|
34254
|
+
this._breaks = transformedBreaks;
|
|
34255
|
+
}
|
|
34256
|
+
super._renderInner(container), this._breaks && this._breaks.length && this._breaks.forEach((b, index) => {
|
|
34257
|
+
const {
|
|
34258
|
+
startPoint: startPoint,
|
|
34259
|
+
endPoint: endPoint,
|
|
34260
|
+
breakSymbol: breakSymbol,
|
|
34261
|
+
rawRange: rawRange
|
|
34262
|
+
} = b;
|
|
34263
|
+
if (!1 !== (null == breakSymbol ? void 0 : breakSymbol.visible)) {
|
|
34264
|
+
const axisBreakGroup = graphicCreator.group({
|
|
34265
|
+
zIndex: TopZIndex
|
|
34266
|
+
});
|
|
34267
|
+
axisBreakGroup.name = AXIS_ELEMENT_NAME.axisBreak, axisBreakGroup.id = this._getNodeId(`${AXIS_ELEMENT_NAME.axisBreak}-${index}`), axisBreakGroup.data = rawRange;
|
|
34268
|
+
const symbolStyle = getAxisBreakSymbolAttrs(breakSymbol),
|
|
34269
|
+
shape1 = graphicCreator.symbol(Object.assign({
|
|
34270
|
+
x: startPoint.x,
|
|
34271
|
+
y: startPoint.y
|
|
34272
|
+
}, symbolStyle));
|
|
34273
|
+
shape1.name = AXIS_ELEMENT_NAME.axisBreakSymbol;
|
|
34274
|
+
const shape2 = graphicCreator.symbol(Object.assign({
|
|
34275
|
+
x: endPoint.x,
|
|
34276
|
+
y: endPoint.y
|
|
34277
|
+
}, symbolStyle));
|
|
34278
|
+
shape2.name = AXIS_ELEMENT_NAME.axisBreakSymbol, axisBreakGroup.add(shape1), axisBreakGroup.add(shape2), container.add(axisBreakGroup);
|
|
34279
|
+
}
|
|
34280
|
+
});
|
|
34152
34281
|
const {
|
|
34153
34282
|
panel: panel
|
|
34154
34283
|
} = this.attribute;
|
|
@@ -34175,18 +34304,25 @@
|
|
|
34175
34304
|
startSymbol: startSymbol,
|
|
34176
34305
|
endSymbol: endSymbol,
|
|
34177
34306
|
style: style,
|
|
34178
|
-
breakRange: breakRange,
|
|
34179
|
-
breakShape: breakShape,
|
|
34180
|
-
breakShapeStyle: breakShapeStyle,
|
|
34181
34307
|
state: state
|
|
34182
34308
|
} = _a,
|
|
34183
|
-
restLineAttrs = __rest$5(_a, ["startSymbol", "endSymbol", "style", "
|
|
34309
|
+
restLineAttrs = __rest$5(_a, ["startSymbol", "endSymbol", "style", "state"]),
|
|
34184
34310
|
lineAttrs = Object.assign({
|
|
34185
|
-
points: [start, end],
|
|
34186
34311
|
startSymbol: startSymbol,
|
|
34187
34312
|
endSymbol: endSymbol,
|
|
34188
34313
|
lineStyle: style
|
|
34189
34314
|
}, restLineAttrs);
|
|
34315
|
+
if (this._breaks && this._breaks.length) {
|
|
34316
|
+
const linePoints = [];
|
|
34317
|
+
let lastStartPoint = start;
|
|
34318
|
+
this._breaks.forEach(b => {
|
|
34319
|
+
const {
|
|
34320
|
+
startPoint: startPoint,
|
|
34321
|
+
endPoint: endPoint
|
|
34322
|
+
} = b;
|
|
34323
|
+
linePoints.push([lastStartPoint, startPoint]), lastStartPoint = endPoint;
|
|
34324
|
+
}), linePoints.push([lastStartPoint, end]), lineAttrs.points = linePoints, lineAttrs.multiSegment = !0;
|
|
34325
|
+
} else lineAttrs.points = [start, end];
|
|
34190
34326
|
isEmpty(state) || (lineAttrs.state = {
|
|
34191
34327
|
line: merge$2({}, DEFAULT_STATES$1, state),
|
|
34192
34328
|
symbol: merge$2({}, DEFAULT_STATES$1, state)
|
|
@@ -34392,13 +34528,23 @@
|
|
|
34392
34528
|
autoHide: autoHide$1,
|
|
34393
34529
|
autoHideMethod: autoHideMethod,
|
|
34394
34530
|
autoHideSeparation: autoHideSeparation,
|
|
34395
|
-
lastVisible: lastVisible
|
|
34531
|
+
lastVisible: lastVisible,
|
|
34532
|
+
autoWrap: autoWrap$1
|
|
34396
34533
|
} = label;
|
|
34397
34534
|
if (isFunction$1(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
34398
|
-
if (autoRotate$1
|
|
34535
|
+
if (autoRotate$1) autoRotate(labelShapes, {
|
|
34399
34536
|
labelRotateAngle: autoRotateAngle,
|
|
34400
34537
|
orient: orient
|
|
34401
|
-
})
|
|
34538
|
+
});else if (autoWrap$1) {
|
|
34539
|
+
const axisLength = "left" === orient || "right" === orient ? Math.abs(this.attribute.start.y - this.attribute.end.y) : Math.abs(this.attribute.start.x - this.attribute.end.x);
|
|
34540
|
+
autoWrap(labelShapes, {
|
|
34541
|
+
orient: orient,
|
|
34542
|
+
limitLength: limitLength,
|
|
34543
|
+
axisLength: axisLength,
|
|
34544
|
+
ellipsis: limitEllipsis
|
|
34545
|
+
});
|
|
34546
|
+
}
|
|
34547
|
+
if (!autoWrap$1 && autoLimit$1 && isValidNumber$1(limitLength) && limitLength > 0) {
|
|
34402
34548
|
const isVertical = "left" === orient || "right" === orient,
|
|
34403
34549
|
axisLength = isVertical ? Math.abs(this.attribute.start.y - this.attribute.end.y) : Math.abs(this.attribute.start.x - this.attribute.end.x),
|
|
34404
34550
|
verticalLimitLength = isVertical ? axisLength / labelShapes.length : autoHide$1 || autoRotate$1 ? 1 / 0 : axisLength / labelShapes.length;
|
|
@@ -34468,6 +34614,9 @@
|
|
|
34468
34614
|
}
|
|
34469
34615
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
34470
34616
|
}
|
|
34617
|
+
release() {
|
|
34618
|
+
super.release(), this._breaks = null;
|
|
34619
|
+
}
|
|
34471
34620
|
}
|
|
34472
34621
|
LineAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(LineAxis, LineAxisMixin);
|
|
34473
34622
|
|
|
@@ -35789,7 +35938,28 @@
|
|
|
35789
35938
|
}
|
|
35790
35939
|
}
|
|
35791
35940
|
|
|
35941
|
+
function getScaleTicks(op, scale, count, getTicks) {
|
|
35942
|
+
let scaleTicks;
|
|
35943
|
+
const {
|
|
35944
|
+
breakData: breakData
|
|
35945
|
+
} = op;
|
|
35946
|
+
if (breakData && breakData()) {
|
|
35947
|
+
const {
|
|
35948
|
+
breakDomains: breakDomains
|
|
35949
|
+
} = breakData(),
|
|
35950
|
+
domain = scale.domain();
|
|
35951
|
+
scaleTicks = [];
|
|
35952
|
+
for (let i = 0; i < domain.length - 1; i++) {
|
|
35953
|
+
getTicks(count, [domain[i], domain[i + 1]]).forEach(tick => {
|
|
35954
|
+
breakDomains.some(breakDomain => tick >= breakDomain[0] && tick <= breakDomain[1]) || scaleTicks.push(tick);
|
|
35955
|
+
});
|
|
35956
|
+
}
|
|
35957
|
+
scale.domain(domain);
|
|
35958
|
+
} else scaleTicks = getTicks(count);
|
|
35959
|
+
return scaleTicks;
|
|
35960
|
+
}
|
|
35792
35961
|
const continuousTicks = (scale, op) => {
|
|
35962
|
+
var _a, _b;
|
|
35793
35963
|
if (!isContinuous(scale.type)) return convertDomainToTickData(scale.domain());
|
|
35794
35964
|
const range = scale.range(),
|
|
35795
35965
|
rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
@@ -35799,27 +35969,33 @@
|
|
|
35799
35969
|
forceTickCount: forceTickCount,
|
|
35800
35970
|
tickStep: tickStep,
|
|
35801
35971
|
noDecimals = !1,
|
|
35802
|
-
labelStyle: labelStyle
|
|
35972
|
+
labelStyle: labelStyle,
|
|
35973
|
+
breakData: breakData
|
|
35803
35974
|
} = op;
|
|
35804
35975
|
let scaleTicks;
|
|
35805
|
-
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(
|
|
35806
|
-
const count = isFunction$1(tickCount) ? tickCount({
|
|
35976
|
+
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = getScaleTicks(op, scale, forceTickCount, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).forceTicks(count) : scale.forceTicks(count));else if ("d3" === op.tickMode) {
|
|
35977
|
+
const count = null !== (_a = isFunction$1(tickCount) ? tickCount({
|
|
35807
35978
|
axisLength: rangeSize,
|
|
35808
35979
|
labelStyle: labelStyle
|
|
35809
|
-
}) : tickCount;
|
|
35810
|
-
scaleTicks =
|
|
35980
|
+
}) : tickCount) && void 0 !== _a ? _a : 5;
|
|
35981
|
+
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).d3Ticks(count, {
|
|
35811
35982
|
noDecimals: noDecimals
|
|
35812
|
-
})
|
|
35983
|
+
}) : scale.d3Ticks(count, {
|
|
35984
|
+
noDecimals: noDecimals
|
|
35985
|
+
}));
|
|
35813
35986
|
} else {
|
|
35814
|
-
const count = isFunction$1(tickCount) ? tickCount({
|
|
35987
|
+
const count = null !== (_b = isFunction$1(tickCount) ? tickCount({
|
|
35815
35988
|
axisLength: rangeSize,
|
|
35816
35989
|
labelStyle: labelStyle
|
|
35817
|
-
}) : tickCount,
|
|
35990
|
+
}) : tickCount) && void 0 !== _b ? _b : 5,
|
|
35818
35991
|
customTicks = isFunction$1(op.tickMode) ? op.tickMode : void 0;
|
|
35819
|
-
scaleTicks =
|
|
35992
|
+
scaleTicks = getScaleTicks(op, scale, count, (count, subDomain) => subDomain && subDomain.length ? scale.domain(subDomain, !0).ticks(count, {
|
|
35820
35993
|
noDecimals: noDecimals,
|
|
35821
35994
|
customTicks: customTicks
|
|
35822
|
-
})
|
|
35995
|
+
}) : scale.ticks(count, {
|
|
35996
|
+
noDecimals: noDecimals,
|
|
35997
|
+
customTicks: customTicks
|
|
35998
|
+
}));
|
|
35823
35999
|
}
|
|
35824
36000
|
if (op.sampling && ("cartesian" === op.coordinateType || "polar" === op.coordinateType && "radius" === op.axisOrientType)) {
|
|
35825
36001
|
const {
|
|
@@ -35830,7 +36006,8 @@
|
|
|
35830
36006
|
AABBBounds: bounds,
|
|
35831
36007
|
value: scaleTicks[i]
|
|
35832
36008
|
}));
|
|
35833
|
-
|
|
36009
|
+
const samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
|
|
36010
|
+
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
35834
36011
|
const ticks = items.map(item => item.value);
|
|
35835
36012
|
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
35836
36013
|
}
|
|
@@ -40920,7 +41097,7 @@
|
|
|
40920
41097
|
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Title.defaultAttributes, attributes)), this.name = "title";
|
|
40921
41098
|
}
|
|
40922
41099
|
render() {
|
|
40923
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
41100
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
40924
41101
|
const {
|
|
40925
41102
|
textType: textType,
|
|
40926
41103
|
text: text,
|
|
@@ -40944,96 +41121,124 @@
|
|
|
40944
41121
|
y: parsedPadding[0],
|
|
40945
41122
|
zIndex: 1
|
|
40946
41123
|
}, "group");
|
|
40947
|
-
if (!1 !== this.attribute.visible && !1 !== textStyle.visible)
|
|
40948
|
-
const
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
40953
|
-
|
|
40954
|
-
|
|
40955
|
-
|
|
40956
|
-
|
|
40957
|
-
|
|
40958
|
-
|
|
40959
|
-
|
|
40960
|
-
|
|
40961
|
-
|
|
40962
|
-
|
|
40963
|
-
|
|
40964
|
-
|
|
40965
|
-
|
|
40966
|
-
|
|
40967
|
-
|
|
40968
|
-
|
|
40969
|
-
|
|
40970
|
-
|
|
40971
|
-
|
|
40972
|
-
|
|
40973
|
-
|
|
40974
|
-
|
|
40975
|
-
|
|
40976
|
-
|
|
40977
|
-
|
|
40978
|
-
|
|
40979
|
-
|
|
40980
|
-
|
|
40981
|
-
|
|
40982
|
-
|
|
40983
|
-
|
|
40984
|
-
|
|
40985
|
-
|
|
40986
|
-
|
|
41124
|
+
if (!1 !== this.attribute.visible && !1 !== textStyle.visible) {
|
|
41125
|
+
const {
|
|
41126
|
+
width: mainTitleWidth,
|
|
41127
|
+
height: mainTitleHeight,
|
|
41128
|
+
maxHeight: mainTitleMaxHeight,
|
|
41129
|
+
maxWidth: mainTitleMaxWidth,
|
|
41130
|
+
x = 0,
|
|
41131
|
+
y = 0,
|
|
41132
|
+
ellipsis = !0,
|
|
41133
|
+
wordBreak = "break-word",
|
|
41134
|
+
maxWidth: maxWidth,
|
|
41135
|
+
lineClamp: lineClamp
|
|
41136
|
+
} = textStyle;
|
|
41137
|
+
if ("rich" === textType || isValid$1(textStyle.character)) {
|
|
41138
|
+
const attr = Object.assign({
|
|
41139
|
+
x: x,
|
|
41140
|
+
y: y,
|
|
41141
|
+
width: null !== (_a = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _a ? _a : 0,
|
|
41142
|
+
height: null !== (_b = null != mainTitleHeight ? mainTitleHeight : height) && void 0 !== _b ? _b : 0,
|
|
41143
|
+
ellipsis: null == ellipsis || ellipsis,
|
|
41144
|
+
wordBreak: null != wordBreak ? wordBreak : "break-word",
|
|
41145
|
+
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
41146
|
+
maxWidth: null != mainTitleMaxWidth ? mainTitleMaxWidth : maxWidth,
|
|
41147
|
+
textConfig: null !== (_c = textStyle.character) && void 0 !== _c ? _c : text
|
|
41148
|
+
}, textStyle);
|
|
41149
|
+
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
41150
|
+
} else if ("html" === textType) {
|
|
41151
|
+
const attr = Object.assign({
|
|
41152
|
+
html: Object.assign(Object.assign({
|
|
41153
|
+
dom: text
|
|
41154
|
+
}, DEFAULT_HTML_TEXT_SPEC), textStyle),
|
|
41155
|
+
x: x,
|
|
41156
|
+
y: y,
|
|
41157
|
+
width: null !== (_d = null != mainTitleWidth ? mainTitleWidth : width) && void 0 !== _d ? _d : 0,
|
|
41158
|
+
height: null !== (_e = null != mainTitleHeight ? mainTitleHeight : height) && void 0 !== _e ? _e : 0,
|
|
41159
|
+
ellipsis: ellipsis,
|
|
41160
|
+
wordBreak: wordBreak,
|
|
41161
|
+
maxHeight: null != mainTitleMaxHeight ? mainTitleMaxHeight : maxHeight,
|
|
41162
|
+
maxWidth: null != mainTitleMaxWidth ? mainTitleMaxWidth : maxWidth,
|
|
41163
|
+
textConfig: []
|
|
41164
|
+
}, textStyle);
|
|
41165
|
+
this._mainTitle = group.createOrUpdateChild("mainTitle", attr, "richtext");
|
|
41166
|
+
} else isValid$1(text) && (this._mainTitle = group.createOrUpdateChild("mainTitle", Object.assign(Object.assign({
|
|
41167
|
+
text: isArray$1(text) ? text : [text],
|
|
41168
|
+
whiteSpace: "normal"
|
|
41169
|
+
}, textStyle), {
|
|
41170
|
+
maxLineWidth: null !== (_g = null !== (_f = textStyle.maxLineWidth) && void 0 !== _f ? _f : mainTitleWidth) && void 0 !== _g ? _g : width,
|
|
41171
|
+
heightLimit: null != mainTitleHeight ? mainTitleHeight : maxHeight,
|
|
41172
|
+
lineClamp: lineClamp,
|
|
41173
|
+
ellipsis: ellipsis,
|
|
41174
|
+
x: x,
|
|
41175
|
+
y: y
|
|
41176
|
+
}), "text"));
|
|
41177
|
+
}
|
|
40987
41178
|
const maintextHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0,
|
|
40988
41179
|
maintextWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
40989
|
-
if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible)
|
|
40990
|
-
const
|
|
40991
|
-
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
40996
|
-
|
|
40997
|
-
|
|
40998
|
-
|
|
40999
|
-
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
|
|
41010
|
-
|
|
41011
|
-
|
|
41012
|
-
|
|
41013
|
-
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41017
|
-
|
|
41018
|
-
|
|
41019
|
-
|
|
41020
|
-
|
|
41021
|
-
|
|
41022
|
-
|
|
41023
|
-
|
|
41024
|
-
|
|
41025
|
-
|
|
41026
|
-
|
|
41027
|
-
|
|
41028
|
-
|
|
41180
|
+
if (!1 !== this.attribute.visible && !1 !== subtextStyle.visible) {
|
|
41181
|
+
const {
|
|
41182
|
+
width: subTitleWidth,
|
|
41183
|
+
height: subTitleHeight,
|
|
41184
|
+
maxWidth: subTitleMaxWidth,
|
|
41185
|
+
maxHeight: subTitleMaxHeight,
|
|
41186
|
+
x = 0,
|
|
41187
|
+
y = 0,
|
|
41188
|
+
ellipsis = !0,
|
|
41189
|
+
wordBreak = "break-word",
|
|
41190
|
+
lineClamp: lineClamp
|
|
41191
|
+
} = subtextStyle,
|
|
41192
|
+
maxSubTextHeight = Math.max(Number.MIN_VALUE, maxHeight - maintextHeight);
|
|
41193
|
+
if ("rich" === subtextType || isValid$1(subtextStyle.character)) {
|
|
41194
|
+
const attr = Object.assign({
|
|
41195
|
+
x: x,
|
|
41196
|
+
y: y,
|
|
41197
|
+
width: null !== (_h = null != subTitleWidth ? subTitleWidth : width) && void 0 !== _h ? _h : 0,
|
|
41198
|
+
height: null !== (_j = null != subTitleHeight ? subTitleHeight : height) && void 0 !== _j ? _j : 0,
|
|
41199
|
+
ellipsis: ellipsis,
|
|
41200
|
+
wordBreak: wordBreak,
|
|
41201
|
+
maxHeight: null != subTitleMaxHeight ? subTitleMaxHeight : maxSubTextHeight,
|
|
41202
|
+
maxWidth: null != subTitleMaxWidth ? subTitleMaxWidth : maxWidth,
|
|
41203
|
+
textConfig: null !== (_k = subtextStyle.character) && void 0 !== _k ? _k : subtext
|
|
41204
|
+
}, subtextStyle);
|
|
41205
|
+
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
41206
|
+
} else if ("html" === subtextType) {
|
|
41207
|
+
const attr = Object.assign({
|
|
41208
|
+
html: Object.assign(Object.assign({
|
|
41209
|
+
dom: subtext
|
|
41210
|
+
}, DEFAULT_HTML_TEXT_SPEC), subtextStyle),
|
|
41211
|
+
x: x,
|
|
41212
|
+
y: y,
|
|
41213
|
+
width: null !== (_l = null != subTitleWidth ? subTitleWidth : width) && void 0 !== _l ? _l : 0,
|
|
41214
|
+
height: null !== (_m = null != subTitleHeight ? subTitleHeight : height) && void 0 !== _m ? _m : 0,
|
|
41215
|
+
ellipsis: ellipsis,
|
|
41216
|
+
wordBreak: wordBreak,
|
|
41217
|
+
maxHeight: null != subTitleMaxHeight ? subTitleMaxHeight : maxSubTextHeight,
|
|
41218
|
+
maxWidth: null != subTitleMaxWidth ? subTitleMaxWidth : maxWidth,
|
|
41219
|
+
textConfig: []
|
|
41220
|
+
}, subtextStyle);
|
|
41221
|
+
this._subTitle = group.createOrUpdateChild("subTitle", attr, "richtext");
|
|
41222
|
+
} else isValid$1(subtext) && (this._subTitle = group.createOrUpdateChild("subTitle", Object.assign(Object.assign({
|
|
41223
|
+
text: isArray$1(subtext) ? subtext : [subtext],
|
|
41224
|
+
whiteSpace: "normal"
|
|
41225
|
+
}, subtextStyle), {
|
|
41226
|
+
maxLineWidth: null !== (_o = subtextStyle.maxLineWidth) && void 0 !== _o ? _o : width,
|
|
41227
|
+
heightLimit: null !== (_p = subtextStyle.heightLimit) && void 0 !== _p ? _p : maxSubTextHeight,
|
|
41228
|
+
lineClamp: lineClamp,
|
|
41229
|
+
ellipsis: ellipsis,
|
|
41230
|
+
x: 0,
|
|
41231
|
+
y: maintextHeight
|
|
41232
|
+
}), "text"));
|
|
41233
|
+
}
|
|
41029
41234
|
const subtextHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0,
|
|
41030
41235
|
subtextWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
41031
41236
|
let titleWidth = Math.max(maintextWidth, subtextWidth),
|
|
41032
|
-
titleHeight = maintextHeight + (null !== (
|
|
41033
|
-
if (isValid$1(width) && (titleWidth = width
|
|
41237
|
+
titleHeight = maintextHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subtextHeight);
|
|
41238
|
+
if (isValid$1(width) && (titleWidth = width), isValid$1(height) && (titleHeight = height), isValid$1(minWidth) && titleWidth < minWidth && (titleWidth = minWidth), isValid$1(maxWidth) && titleWidth > maxWidth && (titleWidth = maxWidth), isValid$1(minHeight) && titleHeight < minHeight && (titleHeight = minHeight), isValid$1(maxHeight) && titleHeight > maxHeight && (titleHeight = maxHeight), group.attribute.width = titleWidth, group.attribute.height = titleHeight, group.attribute.boundsPadding = parsedPadding, this._mainTitle) {
|
|
41034
41239
|
if (isValid$1(align) || isValid$1(textStyle.align)) {
|
|
41035
41240
|
const mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
41036
|
-
mainTitleWidth = null !== (
|
|
41241
|
+
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : maintextWidth;
|
|
41037
41242
|
"left" === mainTitleAlign ? (this._mainTitle.setAttribute("x", 0), this._mainTitle.setAttribute("textAlign", "left")) : "center" === mainTitleAlign ? (this._mainTitle.setAttribute("x", mainTitleWidth / 2), this._mainTitle.setAttribute("textAlign", "center")) : "right" === mainTitleAlign && (this._mainTitle.setAttribute("x", mainTitleWidth), this._mainTitle.setAttribute("textAlign", "right"));
|
|
41038
41243
|
}
|
|
41039
41244
|
if (isValid$1(verticalAlign) || isValid$1(textStyle.verticalAlign)) {
|
|
@@ -41045,13 +41250,13 @@
|
|
|
41045
41250
|
if (this._subTitle) {
|
|
41046
41251
|
if (isValid$1(align) || isValid$1(subtextStyle.align)) {
|
|
41047
41252
|
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align,
|
|
41048
|
-
subTitleWidth = null !== (
|
|
41253
|
+
subTitleWidth = null !== (_s = subtextStyle.width) && void 0 !== _s ? _s : subtextWidth;
|
|
41049
41254
|
"left" === subTitleAlign ? (this._subTitle.setAttribute("x", 0), this._subTitle.setAttribute("textAlign", "left")) : "center" === subTitleAlign ? (this._subTitle.setAttribute("x", subTitleWidth / 2), this._subTitle.setAttribute("textAlign", "center")) : "right" === subTitleAlign && (this._subTitle.setAttribute("x", subTitleWidth), this._subTitle.setAttribute("textAlign", "right"));
|
|
41050
41255
|
}
|
|
41051
41256
|
if (isValid$1(verticalAlign) || isValid$1(textStyle.verticalAlign)) {
|
|
41052
41257
|
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign,
|
|
41053
41258
|
subTitleYStart = maintextHeight,
|
|
41054
|
-
subTitleHeight = null !== (
|
|
41259
|
+
subTitleHeight = null !== (_t = subtextStyle.height) && void 0 !== _t ? _t : 0;
|
|
41055
41260
|
"top" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart), this._subTitle.setAttribute("textBaseline", "top")) : "middle" === subTitleVerticalAlign ? (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight / 2), this._subTitle.setAttribute("textBaseline", "middle")) : "bottom" === subTitleVerticalAlign && (this._subTitle.setAttribute("y", subTitleYStart + subTitleHeight), this._subTitle.setAttribute("textBaseline", "bottom"));
|
|
41056
41261
|
}
|
|
41057
41262
|
}
|
|
@@ -60891,7 +61096,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60891
61096
|
};
|
|
60892
61097
|
registerVChartCore();
|
|
60893
61098
|
|
|
60894
|
-
const version = "1.12.
|
|
61099
|
+
const version = "1.12.4-alpha.0";
|
|
60895
61100
|
|
|
60896
61101
|
const addVChartProperty = (data, op) => {
|
|
60897
61102
|
const context = op.beforeCall();
|
|
@@ -63751,13 +63956,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63751
63956
|
}
|
|
63752
63957
|
|
|
63753
63958
|
function isValidAlignDomain(domain) {
|
|
63754
|
-
return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain
|
|
63959
|
+
return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(last(domain)) && last(domain) >= domain[0];
|
|
63755
63960
|
}
|
|
63756
63961
|
function getScaleInfo(axis, domain) {
|
|
63757
|
-
const total = domain
|
|
63758
|
-
const includeZero = domain
|
|
63962
|
+
const total = last(domain) - domain[0];
|
|
63963
|
+
const includeZero = last(domain) * domain[0] < 0;
|
|
63759
63964
|
let negative = domain[0] <= 0 ? 0 - domain[0] : 0;
|
|
63760
|
-
let positive = domain
|
|
63965
|
+
let positive = last(domain) > 0 ? last(domain) - 0 : 0;
|
|
63761
63966
|
if (total === 0) {
|
|
63762
63967
|
if (domain[0] < 0) {
|
|
63763
63968
|
negative = 1;
|
|
@@ -63992,12 +64197,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63992
64197
|
return data;
|
|
63993
64198
|
}
|
|
63994
64199
|
const targetDomain = targetScale.domain();
|
|
63995
|
-
const targetRange = targetDomain
|
|
64200
|
+
const targetRange = last(targetDomain) - targetDomain[0];
|
|
63996
64201
|
if (targetRange === 0) {
|
|
63997
64202
|
return data;
|
|
63998
64203
|
}
|
|
63999
64204
|
const currentDomain = currentScale.domain();
|
|
64000
|
-
const currentRange = currentDomain
|
|
64205
|
+
const currentRange = last(currentDomain) - currentDomain[0];
|
|
64001
64206
|
if (targetRange === 0) {
|
|
64002
64207
|
return data;
|
|
64003
64208
|
}
|
|
@@ -64617,10 +64822,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64617
64822
|
}
|
|
64618
64823
|
else if (viewData && viewData.latestData && viewData.latestData.length) {
|
|
64619
64824
|
const seriesData = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s);
|
|
64825
|
+
const userSetBreaks = this.type === ComponentTypeEnum.cartesianLinearAxis && this._spec.breaks && this._spec.breaks.length;
|
|
64620
64826
|
field.forEach(f => {
|
|
64621
64827
|
var _a;
|
|
64622
64828
|
if ((_a = seriesData === null || seriesData === void 0 ? void 0 : seriesData.latestData) === null || _a === void 0 ? void 0 : _a[f]) {
|
|
64623
|
-
|
|
64829
|
+
if (userSetBreaks) {
|
|
64830
|
+
data.push(Object.assign(Object.assign({}, seriesData.latestData[f]), { values: viewData.latestData.map((obj) => obj[f]) }));
|
|
64831
|
+
}
|
|
64832
|
+
else {
|
|
64833
|
+
data.push(seriesData.latestData[f]);
|
|
64834
|
+
}
|
|
64624
64835
|
}
|
|
64625
64836
|
});
|
|
64626
64837
|
}
|
|
@@ -65091,7 +65302,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65091
65302
|
? (_a = item
|
|
65092
65303
|
.getTickData()
|
|
65093
65304
|
.getLatestData()) === null || _a === void 0 ? void 0 : _a.find((d) => d.value === 0)
|
|
65094
|
-
: item.getScale().domain()[0] <= 0 && item.getScale().domain()
|
|
65305
|
+
: item.getScale().domain()[0] <= 0 && last(item.getScale().domain()) >= 0));
|
|
65095
65306
|
};
|
|
65096
65307
|
const relativeAxes = axesComponents.filter(item => isValidAxis(item));
|
|
65097
65308
|
if (relativeAxes.length) {
|
|
@@ -65197,8 +65408,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65197
65408
|
setLayout3dBox(box3d) {
|
|
65198
65409
|
this.layout3dBox = box3d;
|
|
65199
65410
|
}
|
|
65200
|
-
|
|
65201
|
-
let isScaleChange = false;
|
|
65411
|
+
getNewScaleRange() {
|
|
65202
65412
|
const { width, height } = this.getLayoutRect();
|
|
65203
65413
|
const { left, right, top, bottom } = this._innerOffset;
|
|
65204
65414
|
let newRange = [];
|
|
@@ -65218,8 +65428,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65218
65428
|
newRange = this._inverse ? [top, height - bottom] : [height - bottom, top];
|
|
65219
65429
|
}
|
|
65220
65430
|
}
|
|
65221
|
-
|
|
65222
|
-
|
|
65431
|
+
return newRange;
|
|
65432
|
+
}
|
|
65433
|
+
updateScaleRange() {
|
|
65434
|
+
let isScaleChange = false;
|
|
65435
|
+
const newRange = this.getNewScaleRange();
|
|
65436
|
+
const range = this._scale.range();
|
|
65437
|
+
if (newRange.length === range.length && newRange.every((value, index) => value === range[index])) {
|
|
65438
|
+
isScaleChange = false;
|
|
65439
|
+
}
|
|
65440
|
+
else {
|
|
65223
65441
|
isScaleChange = true;
|
|
65224
65442
|
this._scale.range(newRange);
|
|
65225
65443
|
}
|
|
@@ -65455,7 +65673,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65455
65673
|
: clamp$1(pos, this._innerOffset.top, this.getLayoutRect().height - this._innerOffset.bottom);
|
|
65456
65674
|
}
|
|
65457
65675
|
const range = this._scale.range();
|
|
65458
|
-
if ((pos - range[0]) * (pos - range
|
|
65676
|
+
if ((pos - range[0]) * (pos - last(range)) > 0) {
|
|
65459
65677
|
return null;
|
|
65460
65678
|
}
|
|
65461
65679
|
return this._scale.invert(pos);
|
|
@@ -65594,7 +65812,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65594
65812
|
const normalizedValue = this._getNormalizedValue([obj.value], length);
|
|
65595
65813
|
return getAxisItem(obj.value, normalizedValue);
|
|
65596
65814
|
})
|
|
65597
|
-
.filter((entry) =>
|
|
65815
|
+
.filter((entry) => {
|
|
65816
|
+
const { value, rawValue } = entry;
|
|
65817
|
+
const domain = this._scale.domain();
|
|
65818
|
+
if (isContinuous(this._scale.type)) {
|
|
65819
|
+
return rawValue >= domain[0] && rawValue <= last(domain);
|
|
65820
|
+
}
|
|
65821
|
+
return domain.includes(rawValue);
|
|
65822
|
+
})
|
|
65598
65823
|
];
|
|
65599
65824
|
}
|
|
65600
65825
|
return [];
|
|
@@ -65623,17 +65848,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65623
65848
|
});
|
|
65624
65849
|
if (this._autoIndentOnce && this._hasAutoIndent) {
|
|
65625
65850
|
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
65626
|
-
this.layout.getLastComputeOutBounds()[key] =
|
|
65851
|
+
this.layout.getLastComputeOutBounds()[key] =
|
|
65852
|
+
this._layoutCache._lastComputeOutBounds[key];
|
|
65627
65853
|
});
|
|
65628
65854
|
}
|
|
65629
65855
|
else {
|
|
65630
65856
|
this._hasAutoIndent = true;
|
|
65631
65857
|
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
65632
|
-
if (this.layout.getLastComputeOutBounds()[key] <
|
|
65633
|
-
this.
|
|
65858
|
+
if (this.layout.getLastComputeOutBounds()[key] <
|
|
65859
|
+
this._layoutCache._lastComputeOutBounds[key]) {
|
|
65860
|
+
this.layout.getLastComputeOutBounds()[key] =
|
|
65861
|
+
this._layoutCache._lastComputeOutBounds[key];
|
|
65634
65862
|
}
|
|
65635
65863
|
else {
|
|
65636
|
-
this._layoutCache._lastComputeOutBounds[key] =
|
|
65864
|
+
this._layoutCache._lastComputeOutBounds[key] =
|
|
65865
|
+
this.layout.getLastComputeOutBounds()[key];
|
|
65637
65866
|
}
|
|
65638
65867
|
});
|
|
65639
65868
|
}
|
|
@@ -65703,6 +65932,60 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65703
65932
|
CartesianAxis.type = ComponentTypeEnum.cartesianAxis;
|
|
65704
65933
|
CartesianAxis.specKey = 'axes';
|
|
65705
65934
|
|
|
65935
|
+
const setDomain = (min, max, breaks) => breaks.reduce((r, b, i) => {
|
|
65936
|
+
r.push([b, breaks.length === i + 1 ? max : breaks[i + 1]]);
|
|
65937
|
+
return r;
|
|
65938
|
+
}, [[min, breaks[0]]]);
|
|
65939
|
+
function breakDomain(data, points) {
|
|
65940
|
+
const min = data[0];
|
|
65941
|
+
const max = data[data.length - 1];
|
|
65942
|
+
const breaks = points.filter(point => point > min && point < max);
|
|
65943
|
+
if (breaks.length === 0) {
|
|
65944
|
+
return [[min, max]];
|
|
65945
|
+
}
|
|
65946
|
+
return setDomain(min, max, breaks);
|
|
65947
|
+
}
|
|
65948
|
+
const sorter = (a, b) => a - b;
|
|
65949
|
+
const fillBins = (data, points) => {
|
|
65950
|
+
const bins = [0];
|
|
65951
|
+
let i = 0;
|
|
65952
|
+
let j = 0;
|
|
65953
|
+
while (i < points.length) {
|
|
65954
|
+
if (data[j] <= points[i]) {
|
|
65955
|
+
bins[i] += 1;
|
|
65956
|
+
j += 1;
|
|
65957
|
+
}
|
|
65958
|
+
else {
|
|
65959
|
+
i += 1;
|
|
65960
|
+
bins[i] = 0;
|
|
65961
|
+
}
|
|
65962
|
+
}
|
|
65963
|
+
bins[i] = data.slice(j).length;
|
|
65964
|
+
return bins;
|
|
65965
|
+
};
|
|
65966
|
+
function breakScope(data, points) {
|
|
65967
|
+
const bins = fillBins(data, points);
|
|
65968
|
+
const count = data.length;
|
|
65969
|
+
return bins
|
|
65970
|
+
.reduce((res, bin, i) => {
|
|
65971
|
+
const last = res[i - 1] ? res[i - 1][1] : 0;
|
|
65972
|
+
const next = (last * 100 + +(bin / count).toFixed(2) * 100) / 100;
|
|
65973
|
+
res.push([last, next > 1 ? 1 : next > 0.95 ? 1 : next]);
|
|
65974
|
+
return res;
|
|
65975
|
+
}, [])
|
|
65976
|
+
.filter(s => {
|
|
65977
|
+
return !(s[0] === 0 && s[1] === 0) && !(s[0] === 1 && s[1] === 1);
|
|
65978
|
+
});
|
|
65979
|
+
}
|
|
65980
|
+
function breakData(data, points) {
|
|
65981
|
+
data.sort(sorter);
|
|
65982
|
+
points.sort(sorter);
|
|
65983
|
+
return {
|
|
65984
|
+
domain: breakDomain(data, points),
|
|
65985
|
+
scope: breakScope(data, points)
|
|
65986
|
+
};
|
|
65987
|
+
}
|
|
65988
|
+
|
|
65706
65989
|
const e10 = Math.sqrt(50);
|
|
65707
65990
|
const e5 = Math.sqrt(10);
|
|
65708
65991
|
const e2 = Math.sqrt(2);
|
|
@@ -65794,13 +66077,48 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65794
66077
|
return this._scale.scale(value);
|
|
65795
66078
|
}
|
|
65796
66079
|
computeLinearDomain(data) {
|
|
65797
|
-
|
|
66080
|
+
let domain = [];
|
|
65798
66081
|
if (data.length) {
|
|
66082
|
+
const userSetBreaks = this._spec.breaks && this._spec.breaks.length;
|
|
66083
|
+
let values = [];
|
|
66084
|
+
let minDomain;
|
|
66085
|
+
let maxDomain;
|
|
65799
66086
|
data.forEach(d => {
|
|
65800
66087
|
const { min, max } = d;
|
|
65801
|
-
|
|
65802
|
-
|
|
66088
|
+
minDomain = minDomain === undefined ? min : Math.min(minDomain, min);
|
|
66089
|
+
maxDomain = maxDomain === undefined ? max : Math.max(maxDomain, max);
|
|
66090
|
+
if (userSetBreaks) {
|
|
66091
|
+
values = values.concat(d.values);
|
|
66092
|
+
}
|
|
65803
66093
|
});
|
|
66094
|
+
if (userSetBreaks) {
|
|
66095
|
+
const breakRanges = [];
|
|
66096
|
+
const breaks = [];
|
|
66097
|
+
for (let index = 0; index < this._spec.breaks.length; index++) {
|
|
66098
|
+
const { range } = this._spec.breaks[index];
|
|
66099
|
+
if (range[0] <= range[1] && (range[1] <= maxDomain || range[1] <= minDomain)) {
|
|
66100
|
+
breakRanges.push(range);
|
|
66101
|
+
breaks.push(this._spec.breaks[index]);
|
|
66102
|
+
}
|
|
66103
|
+
}
|
|
66104
|
+
breakRanges.sort((a, b) => a[0] - b[0]);
|
|
66105
|
+
if (breakRanges.length) {
|
|
66106
|
+
const { domain: breakDomains, scope: breakScopes } = breakData(values, combineArray(breakRanges));
|
|
66107
|
+
domain = combineArray(breakDomains);
|
|
66108
|
+
this._break = {
|
|
66109
|
+
domain: breakDomains,
|
|
66110
|
+
scope: breakScopes,
|
|
66111
|
+
breakDomains: breakRanges,
|
|
66112
|
+
breaks
|
|
66113
|
+
};
|
|
66114
|
+
}
|
|
66115
|
+
else {
|
|
66116
|
+
domain = [minDomain, maxDomain];
|
|
66117
|
+
}
|
|
66118
|
+
}
|
|
66119
|
+
else {
|
|
66120
|
+
domain = [minDomain, maxDomain];
|
|
66121
|
+
}
|
|
65804
66122
|
}
|
|
65805
66123
|
else {
|
|
65806
66124
|
domain[0] = 0;
|
|
@@ -65847,7 +66165,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65847
66165
|
num = Math.abs(num);
|
|
65848
66166
|
if (num < 1) {
|
|
65849
66167
|
domain[0] = 0;
|
|
65850
|
-
domain[1] = 1;
|
|
66168
|
+
domain[domain.length - 1] = 1;
|
|
65851
66169
|
}
|
|
65852
66170
|
else {
|
|
65853
66171
|
let step = num / DEFAULT_TICK_COUNT;
|
|
@@ -65855,12 +66173,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65855
66173
|
const err = step / Math.pow(10, power);
|
|
65856
66174
|
step = (err >= e10 ? 10 : err >= e5 ? 5 : err >= e2 ? 2 : 1) * Math.pow(10, power);
|
|
65857
66175
|
domain[0] = 0;
|
|
65858
|
-
domain[1] = step * 10;
|
|
66176
|
+
domain[domain.length - 1] = step * 10;
|
|
65859
66177
|
}
|
|
65860
66178
|
if (flag < 0) {
|
|
65861
66179
|
domain.reverse();
|
|
65862
66180
|
domain[0] *= -1;
|
|
65863
|
-
domain[1] *= -1;
|
|
66181
|
+
domain[domain.length - 1] *= -1;
|
|
65864
66182
|
}
|
|
65865
66183
|
}
|
|
65866
66184
|
return domain;
|
|
@@ -65910,7 +66228,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65910
66228
|
}
|
|
65911
66229
|
const { min, max } = this._domain;
|
|
65912
66230
|
isValid$1(min) && (domain[0] = min);
|
|
65913
|
-
isValid$1(max) && (domain[1] = max);
|
|
66231
|
+
isValid$1(max) && (domain[domain.length - 1] = max);
|
|
65914
66232
|
}
|
|
65915
66233
|
setSoftDomainMinMax(domain) {
|
|
65916
66234
|
const { softMin, softMax } = this._spec;
|
|
@@ -65927,10 +66245,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65927
66245
|
if (isValid$1(softMax)) {
|
|
65928
66246
|
let softMaxValue = isFunction$1(softMax) ? softMax(domain) : softMax;
|
|
65929
66247
|
if (isNil$1(softMaxValue)) {
|
|
65930
|
-
softMaxValue = domain[1];
|
|
66248
|
+
softMaxValue = domain[domain.length - 1];
|
|
65931
66249
|
}
|
|
65932
|
-
if (softMaxValue >= domain[1]) {
|
|
65933
|
-
domain[1] = softMaxValue;
|
|
66250
|
+
if (softMaxValue >= domain[domain.length - 1]) {
|
|
66251
|
+
domain[domain.length - 1] = softMaxValue;
|
|
65934
66252
|
}
|
|
65935
66253
|
this._softMaxValue = softMaxValue;
|
|
65936
66254
|
}
|
|
@@ -65969,7 +66287,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65969
66287
|
return this._domainAfterSpec;
|
|
65970
66288
|
}
|
|
65971
66289
|
_updateNiceLabelFormatter(domain) {
|
|
65972
|
-
const domainSpan = Math.abs(domain[1] - domain[0]);
|
|
66290
|
+
const domainSpan = Math.abs(domain[domain.length - 1] - domain[0]);
|
|
65973
66291
|
const n = Math.max(-Math.floor(Math.log10(domainSpan)), 0) + 2;
|
|
65974
66292
|
const unit = Math.pow(10, n);
|
|
65975
66293
|
this.niceLabelFormatter = (value) => {
|
|
@@ -66006,6 +66324,46 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66006
66324
|
}
|
|
66007
66325
|
this._scale.domain(range);
|
|
66008
66326
|
}
|
|
66327
|
+
_tickTransformOption() {
|
|
66328
|
+
var _a;
|
|
66329
|
+
return Object.assign(Object.assign({}, super._tickTransformOption()), { breakData: ((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) ? () => this._break : null });
|
|
66330
|
+
}
|
|
66331
|
+
_getUpdateAttribute(ignoreGrid) {
|
|
66332
|
+
var _a, _b;
|
|
66333
|
+
const attrs = super._getUpdateAttribute(ignoreGrid);
|
|
66334
|
+
if (!isZAxis(this._orient) && ((_b = (_a = this._break) === null || _a === void 0 ? void 0 : _a.breaks) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
66335
|
+
const { width, height } = this.getLayoutRect();
|
|
66336
|
+
const isX = isXAxis(this._orient);
|
|
66337
|
+
const axisLength = isX ? width : height;
|
|
66338
|
+
attrs.breaks = this._break.breaks.map(obj => {
|
|
66339
|
+
const { range, breakSymbol, gap = 6 } = obj;
|
|
66340
|
+
const position = this.valueToPosition((range[0] + range[1]) / 2);
|
|
66341
|
+
const ratio = position / axisLength;
|
|
66342
|
+
let gapRatio;
|
|
66343
|
+
if (isPercent(gap)) {
|
|
66344
|
+
gapRatio = Number(gap.substring(0, gap.length - 1)) / 100;
|
|
66345
|
+
}
|
|
66346
|
+
else {
|
|
66347
|
+
gapRatio = gap / axisLength;
|
|
66348
|
+
}
|
|
66349
|
+
const symbolAngle = isValidNumber$1(breakSymbol === null || breakSymbol === void 0 ? void 0 : breakSymbol.angle) ? breakSymbol.angle : isX ? 60 : 15;
|
|
66350
|
+
return {
|
|
66351
|
+
range: [ratio - gapRatio / 2, ratio + gapRatio / 2],
|
|
66352
|
+
breakSymbol: Object.assign(Object.assign({ visible: true }, breakSymbol), { angle: (symbolAngle * Math.PI) / 180 }),
|
|
66353
|
+
rawRange: range
|
|
66354
|
+
};
|
|
66355
|
+
});
|
|
66356
|
+
}
|
|
66357
|
+
return attrs;
|
|
66358
|
+
}
|
|
66359
|
+
getNewScaleRange() {
|
|
66360
|
+
var _a, _b;
|
|
66361
|
+
let newRange = super.getNewScaleRange();
|
|
66362
|
+
if (((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) && ((_b = this._break) === null || _b === void 0 ? void 0 : _b.scope)) {
|
|
66363
|
+
newRange = combineArray(this._break.scope).map(val => newRange[0] + (last(newRange) - newRange[0]) * val);
|
|
66364
|
+
}
|
|
66365
|
+
return newRange;
|
|
66366
|
+
}
|
|
66009
66367
|
computeDomain(data) {
|
|
66010
66368
|
return this.computeLinearDomain(data);
|
|
66011
66369
|
}
|
|
@@ -91461,11 +91819,24 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91461
91819
|
}
|
|
91462
91820
|
_parseFieldInfo() {
|
|
91463
91821
|
const { xField, yField } = this._spec;
|
|
91464
|
-
|
|
91465
|
-
|
|
91822
|
+
this._parseAndSetCrosshair(xField, 'x');
|
|
91823
|
+
this._parseAndSetCrosshair(yField, 'y');
|
|
91824
|
+
}
|
|
91825
|
+
_parseAndSetCrosshair(field, axis) {
|
|
91826
|
+
const hairProp = `_${axis}Hair`;
|
|
91827
|
+
const crosshairProp = `_${axis}Crosshair`;
|
|
91828
|
+
if (field && field.visible) {
|
|
91829
|
+
this[hairProp] = this._parseField(field, `${axis}Field`);
|
|
91830
|
+
if (this[crosshairProp]) {
|
|
91831
|
+
const { style, type } = this[hairProp];
|
|
91832
|
+
const styleKey = type === 'rect' ? 'rectStyle' : 'lineStyle';
|
|
91833
|
+
this[crosshairProp].setAttributes({
|
|
91834
|
+
[styleKey]: style
|
|
91835
|
+
});
|
|
91836
|
+
}
|
|
91466
91837
|
}
|
|
91467
|
-
if (
|
|
91468
|
-
this.
|
|
91838
|
+
else if (this[crosshairProp] && this[crosshairProp].parent) {
|
|
91839
|
+
this[crosshairProp].parent.removeChild(this[crosshairProp]);
|
|
91469
91840
|
}
|
|
91470
91841
|
}
|
|
91471
91842
|
_updateCrosshair(dim, type, attributes) {
|
|
@@ -92015,7 +92386,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92015
92386
|
});
|
|
92016
92387
|
let filter = null;
|
|
92017
92388
|
if (isContinuous()) {
|
|
92018
|
-
filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= newDomain
|
|
92389
|
+
filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= last(newDomain);
|
|
92019
92390
|
}
|
|
92020
92391
|
else {
|
|
92021
92392
|
filter = (d) => {
|
|
@@ -92513,15 +92884,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92513
92884
|
const domain = scale.domain();
|
|
92514
92885
|
if (isContinuous(scale.type)) {
|
|
92515
92886
|
if (this._isReverse()) {
|
|
92516
|
-
return domain[0] + (domain
|
|
92887
|
+
return domain[0] + (last(domain) - domain[0]) * (1 - state);
|
|
92517
92888
|
}
|
|
92518
|
-
return domain[0] + (domain
|
|
92889
|
+
return domain[0] + (last(domain) - domain[0]) * state;
|
|
92519
92890
|
}
|
|
92520
92891
|
let range = scale.range();
|
|
92521
92892
|
if (this._isReverse()) {
|
|
92522
92893
|
range = range.slice().reverse();
|
|
92523
92894
|
}
|
|
92524
|
-
const posInRange = range[0] + (range
|
|
92895
|
+
const posInRange = range[0] + (last(range) - range[0]) * state;
|
|
92525
92896
|
return scale.invert(posInRange);
|
|
92526
92897
|
}
|
|
92527
92898
|
dataToStatePoint(data) {
|
|
@@ -92531,7 +92902,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92531
92902
|
if (!this._isHorizontal && isContinuous(scale.type)) {
|
|
92532
92903
|
range = range.slice().reverse();
|
|
92533
92904
|
}
|
|
92534
|
-
return (pos - range[0]) / (range
|
|
92905
|
+
return (pos - range[0]) / (last(range) - range[0]);
|
|
92535
92906
|
}
|
|
92536
92907
|
_modeCheck(statePoint, mode) {
|
|
92537
92908
|
if (statePoint === 'start') {
|
|
@@ -92565,12 +92936,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92565
92936
|
this._end = end;
|
|
92566
92937
|
this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
|
|
92567
92938
|
this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
|
|
92568
|
-
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== this._stateScale.domain()
|
|
92939
|
+
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== last(this._stateScale.domain())) {
|
|
92569
92940
|
if (this._spec.minValueSpan) {
|
|
92570
|
-
this._minSpan = this._spec.minValueSpan / (this._stateScale.domain()
|
|
92941
|
+
this._minSpan = this._spec.minValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
92571
92942
|
}
|
|
92572
92943
|
if (this._spec.maxValueSpan) {
|
|
92573
|
-
this._maxSpan = this._spec.maxValueSpan / (this._stateScale.domain()
|
|
92944
|
+
this._maxSpan = this._spec.maxValueSpan / (last(this._stateScale.domain()) - this._stateScale.domain()[0]);
|
|
92574
92945
|
}
|
|
92575
92946
|
}
|
|
92576
92947
|
this._minSpan = Math.max(0, this._minSpan);
|
|
@@ -93042,7 +93413,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93042
93413
|
return false;
|
|
93043
93414
|
}
|
|
93044
93415
|
const domain = scale.domain();
|
|
93045
|
-
if (isContinuous(scale.type) && domain[0] === domain
|
|
93416
|
+
if (isContinuous(scale.type) && domain[0] === last(domain)) {
|
|
93046
93417
|
return false;
|
|
93047
93418
|
}
|
|
93048
93419
|
if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
|
|
@@ -96993,13 +97364,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96993
97364
|
else {
|
|
96994
97365
|
const range = axis.getScale().range();
|
|
96995
97366
|
const rangeFactor = (_b = axis.getScale().rangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
96996
|
-
const isAxisReverse = range
|
|
97367
|
+
const isAxisReverse = last(range) < range[0];
|
|
96997
97368
|
const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
|
|
96998
97369
|
const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
|
|
96999
97370
|
const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
|
|
97000
97371
|
const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
|
|
97001
|
-
const start = ((startPos - range[0]) / (range
|
|
97002
|
-
const end = ((endPos - range[0]) / (range
|
|
97372
|
+
const start = ((startPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
97373
|
+
const end = ((endPos - range[0]) / (last(range) - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
97003
97374
|
const newStart = this._stateClamp(start - axisRangeExpand);
|
|
97004
97375
|
const newEnd = this._stateClamp(end + axisRangeExpand);
|
|
97005
97376
|
axis.getScale().rangeFactor([newStart, newEnd]);
|
|
@@ -97314,7 +97685,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97314
97685
|
product.addEventListener(HOOK_EVENT.AFTER_ELEMENT_ENCODE, () => {
|
|
97315
97686
|
if (this._isLayout === false) {
|
|
97316
97687
|
const component = product.getGroupGraphicItem();
|
|
97317
|
-
if (component.listenerCount('*') === 0) {
|
|
97688
|
+
if ((component === null || component === void 0 ? void 0 : component.listenerCount('*')) === 0) {
|
|
97318
97689
|
component.addEventListener('*', ((event, type) => this._delegateEvent(component, event, type)));
|
|
97319
97690
|
}
|
|
97320
97691
|
}
|