@visactor/vchart 2.0.9 → 2.0.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +269 -55
- package/build/index.js +269 -55
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/box-plot/box-plot-transformer.js +1 -1
- package/cjs/chart/box-plot/box-plot-transformer.js.map +1 -1
- package/cjs/component/custom-mark/custom-mark.js +2 -2
- package/cjs/component/custom-mark/custom-mark.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +3 -3
- package/cjs/component/tooltip/utils/show-tooltip.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/mark/base/base-mark.d.ts +1 -1
- package/cjs/mark/base/base-mark.js +3 -3
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/series/base/base-series.js +3 -3
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/box-plot/box-plot.d.ts +3 -1
- package/cjs/series/box-plot/box-plot.js +54 -29
- package/cjs/series/box-plot/box-plot.js.map +1 -1
- package/cjs/series/box-plot/interface.d.ts +7 -2
- package/cjs/series/box-plot/interface.js.map +1 -1
- package/cjs/theme/token/builtin/default.js +1 -1
- package/cjs/theme/token/builtin/default.js.map +1 -1
- package/cjs/typings/visual.d.ts +3 -3
- package/cjs/typings/visual.js.map +1 -1
- package/esm/chart/box-plot/box-plot-transformer.js +1 -1
- package/esm/chart/box-plot/box-plot-transformer.js.map +1 -1
- package/esm/component/custom-mark/custom-mark.js +2 -2
- package/esm/component/custom-mark/custom-mark.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +3 -3
- package/esm/component/tooltip/utils/show-tooltip.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/mark/base/base-mark.d.ts +1 -1
- package/esm/mark/base/base-mark.js +3 -3
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/series/base/base-series.js +3 -3
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/box-plot/box-plot.d.ts +3 -1
- package/esm/series/box-plot/box-plot.js +56 -29
- package/esm/series/box-plot/box-plot.js.map +1 -1
- package/esm/series/box-plot/interface.d.ts +7 -2
- package/esm/series/box-plot/interface.js.map +1 -1
- package/esm/theme/token/builtin/default.js +1 -1
- package/esm/theme/token/builtin/default.js.map +1 -1
- package/esm/typings/visual.d.ts +3 -3
- package/esm/typings/visual.js.map +1 -1
- package/package.json +8 -8
package/build/index.js
CHANGED
|
@@ -9506,7 +9506,7 @@
|
|
|
9506
9506
|
|
|
9507
9507
|
const EnvContribution = Symbol.for("EnvContribution");
|
|
9508
9508
|
const VGlobal = Symbol.for("VGlobal");
|
|
9509
|
-
const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui
|
|
9509
|
+
const DEFAULT_TEXT_FONT_FAMILY$1 = "PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,'-apple-system',segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";
|
|
9510
9510
|
|
|
9511
9511
|
const container = new Container();
|
|
9512
9512
|
|
|
@@ -11247,7 +11247,7 @@
|
|
|
11247
11247
|
textAlign: "left",
|
|
11248
11248
|
textBaseline: "alphabetic",
|
|
11249
11249
|
fontSize: 16,
|
|
11250
|
-
fontFamily: "PingFang SC,Microsoft Yahei,system-ui
|
|
11250
|
+
fontFamily: "PingFang SC,Microsoft Yahei,system-ui,'-apple-system',segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",
|
|
11251
11251
|
fontWeight: "",
|
|
11252
11252
|
ellipsis: "…",
|
|
11253
11253
|
fontVariant: "",
|
|
@@ -16315,7 +16315,7 @@
|
|
|
16315
16315
|
}
|
|
16316
16316
|
}]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
|
|
16317
16317
|
type: AttributeUpdateType.STATE
|
|
16318
|
-
});
|
|
16318
|
+
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
16319
16319
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
16320
16320
|
type: AttributeUpdateType.STATE
|
|
16321
16321
|
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
@@ -16341,7 +16341,7 @@
|
|
|
16341
16341
|
getNormalAttribute(key) {
|
|
16342
16342
|
var _a, _b;
|
|
16343
16343
|
const value = this.attribute[key];
|
|
16344
|
-
return this.animates ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
16344
|
+
return this.animates && this.animates.size ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
16345
16345
|
}
|
|
16346
16346
|
clearStates(hasAnimation) {
|
|
16347
16347
|
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
@@ -18048,9 +18048,10 @@
|
|
|
18048
18048
|
}
|
|
18049
18049
|
updateSymbolAABBBoundsAccurate(attribute, symbolTheme, aabbBounds) {
|
|
18050
18050
|
const {
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18051
|
+
size = symbolTheme.size
|
|
18052
|
+
} = attribute,
|
|
18053
|
+
symbolClass = this.getParsedPath();
|
|
18054
|
+
return symbolClass ? (symbolClass.bounds(size, aabbBounds), aabbBounds) : aabbBounds;
|
|
18054
18055
|
}
|
|
18055
18056
|
needUpdateTags(keys) {
|
|
18056
18057
|
return super.needUpdateTags(keys, SYMBOL_UPDATE_TAG_KEY);
|
|
@@ -18059,8 +18060,9 @@
|
|
|
18059
18060
|
return super.needUpdateTag(key, SYMBOL_UPDATE_TAG_KEY);
|
|
18060
18061
|
}
|
|
18061
18062
|
toCustomPath() {
|
|
18062
|
-
const symbolInstance = this.getParsedPath()
|
|
18063
|
-
|
|
18063
|
+
const symbolInstance = this.getParsedPath();
|
|
18064
|
+
if (!symbolInstance) return null;
|
|
18065
|
+
const size = this.attribute.size,
|
|
18064
18066
|
formattedSize = isArray$1(size) ? size : [size, size];
|
|
18065
18067
|
return symbolInstance.path ? new CustomPath2D().fromCustomPath2D(symbolInstance.path, 0, 0, formattedSize[0], formattedSize[1]) : new CustomPath2D().fromString(symbolInstance.pathStr, 0, 0, formattedSize[0], formattedSize[1]);
|
|
18066
18068
|
}
|
|
@@ -24025,7 +24027,7 @@
|
|
|
24025
24027
|
}));
|
|
24026
24028
|
}
|
|
24027
24029
|
enableAutoRefresh() {
|
|
24028
|
-
this.autoRefresh || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24030
|
+
this.autoRefresh || "node" === this.global.env || (this.autoRefresh = !0, this.pluginService.register(new AutoRefreshPlugin()));
|
|
24029
24031
|
}
|
|
24030
24032
|
disableAutoRefresh() {
|
|
24031
24033
|
this.autoRefresh && (this.autoRefresh = !1, this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(plugin => {
|
|
@@ -33189,7 +33191,7 @@
|
|
|
33189
33191
|
|
|
33190
33192
|
var AXIS_ELEMENT_NAME;
|
|
33191
33193
|
!function (AXIS_ELEMENT_NAME) {
|
|
33192
|
-
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";
|
|
33194
|
+
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.labelHoverOnAxis = "axis-label-hover-on-axis", 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";
|
|
33193
33195
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
33194
33196
|
var AxisStateValue;
|
|
33195
33197
|
!function (AxisStateValue) {
|
|
@@ -33226,6 +33228,26 @@
|
|
|
33226
33228
|
fillOpacity: 1
|
|
33227
33229
|
}
|
|
33228
33230
|
},
|
|
33231
|
+
labelHoverOnAxis: {
|
|
33232
|
+
visible: !1,
|
|
33233
|
+
space: 7,
|
|
33234
|
+
padding: 2,
|
|
33235
|
+
position: 0,
|
|
33236
|
+
autoRotate: !1,
|
|
33237
|
+
textStyle: {
|
|
33238
|
+
fontSize: 12,
|
|
33239
|
+
fill: "red",
|
|
33240
|
+
fontWeight: "normal",
|
|
33241
|
+
fillOpacity: 1
|
|
33242
|
+
},
|
|
33243
|
+
background: {
|
|
33244
|
+
visible: !0,
|
|
33245
|
+
style: {
|
|
33246
|
+
cornerRadius: 2,
|
|
33247
|
+
fill: "black"
|
|
33248
|
+
}
|
|
33249
|
+
}
|
|
33250
|
+
},
|
|
33229
33251
|
tick: {
|
|
33230
33252
|
visible: !0,
|
|
33231
33253
|
inside: !1,
|
|
@@ -40391,7 +40413,17 @@
|
|
|
40391
40413
|
loadLineAxisComponent();
|
|
40392
40414
|
class LineAxis extends AxisBase {
|
|
40393
40415
|
constructor(attributes, options) {
|
|
40394
|
-
|
|
40416
|
+
var _a;
|
|
40417
|
+
if (attributes.labelHoverOnAxis && (attributes.labelHoverOnAxis.textStyle = Object.assign({}, attributes.label.style, attributes.labelHoverOnAxis.textStyle), void 0 === attributes.labelHoverOnAxis.space)) {
|
|
40418
|
+
const {
|
|
40419
|
+
padding = 2
|
|
40420
|
+
} = attributes.labelHoverOnAxis,
|
|
40421
|
+
parsedPadding = normalizePadding(padding),
|
|
40422
|
+
toDiffPadding = "bottom" === attributes.orient ? parsedPadding[0] : "left" === attributes.orient ? parsedPadding[1] : "top" === attributes.orient ? parsedPadding[2] : parsedPadding[3],
|
|
40423
|
+
space = (null !== (_a = attributes.label.space) && void 0 !== _a ? _a : LineAxis.defaultAttributes.label.space) - toDiffPadding;
|
|
40424
|
+
attributes.labelHoverOnAxis.space = space;
|
|
40425
|
+
}
|
|
40426
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$1({}, LineAxis.defaultAttributes, attributes), options), this.labelHoverOnAxisGroup = null;
|
|
40395
40427
|
}
|
|
40396
40428
|
_renderInner(container) {
|
|
40397
40429
|
var _a;
|
|
@@ -40453,6 +40485,15 @@
|
|
|
40453
40485
|
}, panel.style));
|
|
40454
40486
|
bgRect.name = AXIS_ELEMENT_NAME.background, bgRect.id = this._getNodeId("background"), bgRect.states = merge$1({}, DEFAULT_STATES$1, null !== (_a = panel.state) && void 0 !== _a ? _a : {}), axisContainer.insertBefore(bgRect, axisContainer.firstChild);
|
|
40455
40487
|
}
|
|
40488
|
+
const {
|
|
40489
|
+
labelHoverOnAxis: labelHoverOnAxis
|
|
40490
|
+
} = this.attribute;
|
|
40491
|
+
labelHoverOnAxis && labelHoverOnAxis.visible && this.renderLabelHoverOnAxis();
|
|
40492
|
+
}
|
|
40493
|
+
renderLabelHoverOnAxis() {
|
|
40494
|
+
const hoverOnLabelAttributes = this.getLabelHoverOnAxisAttribute(),
|
|
40495
|
+
hoverOnLabel = new Tag(Object.assign({}, hoverOnLabelAttributes));
|
|
40496
|
+
hoverOnLabel.name = AXIS_ELEMENT_NAME.title, hoverOnLabel.id = this._getNodeId("hover-on-label"), this.labelHoverOnAxisGroup = hoverOnLabel, this.axisContainer.add(hoverOnLabel);
|
|
40456
40497
|
}
|
|
40457
40498
|
renderLine(container) {
|
|
40458
40499
|
const {
|
|
@@ -40593,6 +40634,66 @@
|
|
|
40593
40634
|
visible: !0
|
|
40594
40635
|
}, background.style)), attrs;
|
|
40595
40636
|
}
|
|
40637
|
+
getLabelHoverOnAxisAttribute() {
|
|
40638
|
+
var _a, _b;
|
|
40639
|
+
const {
|
|
40640
|
+
orient: orient
|
|
40641
|
+
} = this.attribute,
|
|
40642
|
+
_c = this.attribute.labelHoverOnAxis,
|
|
40643
|
+
{
|
|
40644
|
+
position = 0,
|
|
40645
|
+
space = 4,
|
|
40646
|
+
autoRotate = !0,
|
|
40647
|
+
textStyle = {},
|
|
40648
|
+
background = {},
|
|
40649
|
+
formatMethod: formatMethod,
|
|
40650
|
+
text: textContent = "",
|
|
40651
|
+
maxWidth: maxWidth
|
|
40652
|
+
} = _c,
|
|
40653
|
+
restAttrs = __rest$b(_c, ["position", "space", "autoRotate", "textStyle", "background", "formatMethod", "text", "maxWidth"]),
|
|
40654
|
+
point = this.getTickCoord(0);
|
|
40655
|
+
"bottom" === orient || "top" === orient ? point.x = position : point.y = position;
|
|
40656
|
+
let tickLength = 0;
|
|
40657
|
+
(null === (_a = this.attribute.tick) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.tick.inside && (tickLength = this.attribute.tick.length || 4), (null === (_b = this.attribute.subTick) || void 0 === _b ? void 0 : _b.visible) && !1 === this.attribute.subTick.inside && (tickLength = Math.max(tickLength, this.attribute.subTick.length || 2));
|
|
40658
|
+
const offset = tickLength + 0 + space,
|
|
40659
|
+
labelPoint = this.getVerticalCoord(point, offset, !1),
|
|
40660
|
+
vector = this.getVerticalVector(offset, !1, {
|
|
40661
|
+
x: 0,
|
|
40662
|
+
y: 0
|
|
40663
|
+
});
|
|
40664
|
+
let textBaseline,
|
|
40665
|
+
{
|
|
40666
|
+
angle: angle
|
|
40667
|
+
} = restAttrs,
|
|
40668
|
+
textAlign = "center";
|
|
40669
|
+
if (isNil$1(angle) && autoRotate) {
|
|
40670
|
+
const axisVector = this.getRelativeVector();
|
|
40671
|
+
angle = angleTo(axisVector, [1, 0], !0);
|
|
40672
|
+
const {
|
|
40673
|
+
verticalFactor = 1
|
|
40674
|
+
} = this.attribute;
|
|
40675
|
+
textBaseline = 1 === -1 * verticalFactor ? "bottom" : "top";
|
|
40676
|
+
} else {
|
|
40677
|
+
const {
|
|
40678
|
+
textAlign: textAlign2,
|
|
40679
|
+
textBaseline: textBaseline2
|
|
40680
|
+
} = this.getLabelAlign(vector, !1, textStyle.angle);
|
|
40681
|
+
textAlign = textAlign2, textBaseline = textBaseline2;
|
|
40682
|
+
}
|
|
40683
|
+
const maxTagWidth = maxWidth,
|
|
40684
|
+
text = formatMethod ? formatMethod(textContent) : textContent,
|
|
40685
|
+
attrs = Object.assign(Object.assign(Object.assign({}, labelPoint), restAttrs), {
|
|
40686
|
+
maxWidth: maxTagWidth,
|
|
40687
|
+
textStyle: Object.assign({
|
|
40688
|
+
textAlign: textAlign,
|
|
40689
|
+
textBaseline: textBaseline
|
|
40690
|
+
}, textStyle),
|
|
40691
|
+
text: text
|
|
40692
|
+
});
|
|
40693
|
+
return attrs.angle = angle, background && background.visible && (attrs.panel = Object.assign(Object.assign({
|
|
40694
|
+
visible: !0
|
|
40695
|
+
}, restAttrs.panel), background.style)), attrs;
|
|
40696
|
+
}
|
|
40596
40697
|
getTextBaseline(vector, inside) {
|
|
40597
40698
|
let base = "middle";
|
|
40598
40699
|
const {
|
|
@@ -40783,6 +40884,40 @@
|
|
|
40783
40884
|
}
|
|
40784
40885
|
return limitLength && (limitLength = (limitLength - labelSpace - titleSpacing - titleHeight - axisLineWidth - tickLength) / layerCount), limitLength;
|
|
40785
40886
|
}
|
|
40887
|
+
showLabelHoverOnAxis(position, text, adjustPosition = !0) {
|
|
40888
|
+
if (this.attribute.labelHoverOnAxis) {
|
|
40889
|
+
const preContainerBounds = this.axisContainer.AABBBounds,
|
|
40890
|
+
preWidth = preContainerBounds.width(),
|
|
40891
|
+
preHeight = preContainerBounds.height(),
|
|
40892
|
+
preX1 = preContainerBounds.x1,
|
|
40893
|
+
preY1 = preContainerBounds.y1,
|
|
40894
|
+
preX2 = preContainerBounds.x2,
|
|
40895
|
+
preY2 = preContainerBounds.y2;
|
|
40896
|
+
if (this.labelHoverOnAxisGroup) {
|
|
40897
|
+
const {
|
|
40898
|
+
formatMethod: formatMethod
|
|
40899
|
+
} = this.attribute.labelHoverOnAxis,
|
|
40900
|
+
textStr = formatMethod ? formatMethod(text) : text;
|
|
40901
|
+
this.labelHoverOnAxisGroup.setAttribute("text", textStr), this.labelHoverOnAxisGroup.setAttribute("visible", !0), this.labelHoverOnAxisGroup.setAttribute("visibleAll", !0), "left" === this.attribute.orient || "right" === this.attribute.orient ? this.labelHoverOnAxisGroup.setAttributes({
|
|
40902
|
+
y: position
|
|
40903
|
+
}) : this.labelHoverOnAxisGroup.setAttributes({
|
|
40904
|
+
x: position
|
|
40905
|
+
});
|
|
40906
|
+
} else this.attribute.labelHoverOnAxis.visible = !0, this.attribute.labelHoverOnAxis.position = position, this.attribute.labelHoverOnAxis.text = text, this.renderLabelHoverOnAxis();
|
|
40907
|
+
if (adjustPosition) {
|
|
40908
|
+
const afterContainerBounds = this.axisContainer.AABBBounds,
|
|
40909
|
+
diffWidth = afterContainerBounds.width() - preWidth,
|
|
40910
|
+
diffHeight = afterContainerBounds.height() - preHeight;
|
|
40911
|
+
diffWidth > 0 && ("top" === this.attribute.orient || "bottom" === this.attribute.orient) && (afterContainerBounds.x1 < preX1 ? this.showLabelHoverOnAxis(position + diffWidth, text, !1) : afterContainerBounds.x2 > preX2 && this.showLabelHoverOnAxis(position - diffWidth, text, !1)), diffHeight > 0 && ("left" === this.attribute.orient || "right" === this.attribute.orient) && (afterContainerBounds.y1 < preY1 ? this.showLabelHoverOnAxis(position + diffHeight, text, !1) : afterContainerBounds.y2 > preY2 && this.showLabelHoverOnAxis(position - diffHeight, text, !1));
|
|
40912
|
+
}
|
|
40913
|
+
}
|
|
40914
|
+
}
|
|
40915
|
+
hideLabelHoverOnAxis() {
|
|
40916
|
+
this.attribute.labelHoverOnAxis && this.labelHoverOnAxisGroup && this.labelHoverOnAxisGroup.setAttributes({
|
|
40917
|
+
visible: !1,
|
|
40918
|
+
visibleAll: !1
|
|
40919
|
+
});
|
|
40920
|
+
}
|
|
40786
40921
|
release() {
|
|
40787
40922
|
super.release(), this._breaks = null;
|
|
40788
40923
|
}
|
|
@@ -42404,7 +42539,7 @@
|
|
|
42404
42539
|
labelStyle: labelStyle
|
|
42405
42540
|
} = op,
|
|
42406
42541
|
radius = null == getRadius ? void 0 : getRadius();
|
|
42407
|
-
if (!radius) return convertDomainToTickData(scale.domain());
|
|
42542
|
+
if (!radius || radius <= 0) return convertDomainToTickData(scale.domain());
|
|
42408
42543
|
let scaleTicks;
|
|
42409
42544
|
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$1(tickCount)) {
|
|
42410
42545
|
const range = scale.range(),
|
|
@@ -43585,20 +43720,23 @@
|
|
|
43585
43720
|
{
|
|
43586
43721
|
enter: enter
|
|
43587
43722
|
} = this._animationConfig;
|
|
43588
|
-
[text, labelLine].filter(Boolean).forEach(item =>
|
|
43589
|
-
|
|
43590
|
-
|
|
43591
|
-
|
|
43592
|
-
|
|
43593
|
-
|
|
43594
|
-
|
|
43595
|
-
|
|
43596
|
-
|
|
43597
|
-
|
|
43598
|
-
|
|
43599
|
-
|
|
43600
|
-
|
|
43601
|
-
|
|
43723
|
+
[text, labelLine].filter(Boolean).forEach(item => {
|
|
43724
|
+
var _a;
|
|
43725
|
+
null === (_a = item.setFinalAttributes) || void 0 === _a || _a.call(item, item.attribute), item.applyAnimationState(["enter"], [{
|
|
43726
|
+
name: "enter",
|
|
43727
|
+
animation: Object.assign(Object.assign({}, enter), {
|
|
43728
|
+
type: "labelEnter",
|
|
43729
|
+
selfOnly: !0,
|
|
43730
|
+
customParameters: {
|
|
43731
|
+
relatedGraphic: relatedGraphic,
|
|
43732
|
+
relatedGraphics: this._idToGraphic,
|
|
43733
|
+
config: Object.assign(Object.assign({}, enter), {
|
|
43734
|
+
type: item === text ? enter.type : "fadeIn"
|
|
43735
|
+
})
|
|
43736
|
+
}
|
|
43737
|
+
})
|
|
43738
|
+
}]);
|
|
43739
|
+
});
|
|
43602
43740
|
}
|
|
43603
43741
|
_runUpdateAnimation(prevLabel, currentLabel) {
|
|
43604
43742
|
const {
|
|
@@ -52325,7 +52463,7 @@
|
|
|
52325
52463
|
}
|
|
52326
52464
|
|
|
52327
52465
|
const token = {
|
|
52328
|
-
fontFamily:
|
|
52466
|
+
fontFamily: `PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,'-apple-system',segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol`,
|
|
52329
52467
|
fontSize: 14,
|
|
52330
52468
|
l1FontSize: 32,
|
|
52331
52469
|
l1LineHeight: '150%',
|
|
@@ -57909,7 +58047,7 @@
|
|
|
57909
58047
|
}
|
|
57910
58048
|
}
|
|
57911
58049
|
};
|
|
57912
|
-
this._setStateOfGraphic = (g) => {
|
|
58050
|
+
this._setStateOfGraphic = (g, hasAnimation) => {
|
|
57913
58051
|
g.clearStates();
|
|
57914
58052
|
g.stateProxy = null;
|
|
57915
58053
|
if (g.context.diffState === DiffState.enter || g.context.diffState === DiffState.update) {
|
|
@@ -57917,7 +58055,7 @@
|
|
|
57917
58055
|
var _a;
|
|
57918
58056
|
return this._runEncoderOfGraphic((_a = this._encoderOfState) === null || _a === void 0 ? void 0 : _a[stateName], g);
|
|
57919
58057
|
};
|
|
57920
|
-
g.context.states && g.useStates(g.context.states);
|
|
58058
|
+
g.context.states && g.useStates(g.context.states, hasAnimation);
|
|
57921
58059
|
}
|
|
57922
58060
|
};
|
|
57923
58061
|
this.name = name;
|
|
@@ -58670,7 +58808,7 @@
|
|
|
58670
58808
|
g.setFinalAttributes(finalAttrs);
|
|
58671
58809
|
}
|
|
58672
58810
|
}
|
|
58673
|
-
this._setStateOfGraphic(g);
|
|
58811
|
+
this._setStateOfGraphic(g, hasStateAnimation);
|
|
58674
58812
|
this._setGraphicFromMarkConfig(g);
|
|
58675
58813
|
});
|
|
58676
58814
|
}
|
|
@@ -61395,7 +61533,7 @@
|
|
|
61395
61533
|
});
|
|
61396
61534
|
};
|
|
61397
61535
|
|
|
61398
|
-
const version = "2.0.
|
|
61536
|
+
const version = "2.0.10-alpha.1";
|
|
61399
61537
|
|
|
61400
61538
|
const addVChartProperty = (data, op) => {
|
|
61401
61539
|
const context = op.beforeCall();
|
|
@@ -62766,7 +62904,7 @@
|
|
|
62766
62904
|
if (isValid$1(spec.id)) {
|
|
62767
62905
|
mark.setUserId(spec.id);
|
|
62768
62906
|
}
|
|
62769
|
-
if (options.hasAnimation) {
|
|
62907
|
+
if (options.hasAnimation && spec.animation !== false) {
|
|
62770
62908
|
const config = animationConfig({}, userAnimationConfig(spec.type, spec, this._markAttributeContext));
|
|
62771
62909
|
mark.setAnimationConfig(config);
|
|
62772
62910
|
}
|
|
@@ -62776,7 +62914,7 @@
|
|
|
62776
62914
|
this._createExtensionMark(s, mark, namePrefix, i, options);
|
|
62777
62915
|
});
|
|
62778
62916
|
}
|
|
62779
|
-
|
|
62917
|
+
if (!isNil$1(spec.dataId) || !isNil$1(spec.dataIndex)) {
|
|
62780
62918
|
const dataView = this._option.getSeriesData(spec.dataId, spec.dataIndex);
|
|
62781
62919
|
if (dataView === this._rawData) {
|
|
62782
62920
|
mark.setData(this._data);
|
|
@@ -76414,6 +76552,7 @@
|
|
|
76414
76552
|
constructor() {
|
|
76415
76553
|
super(...arguments);
|
|
76416
76554
|
this.type = exports.SeriesTypeEnum.boxPlot;
|
|
76555
|
+
this._bandPosition = 0;
|
|
76417
76556
|
}
|
|
76418
76557
|
getMinField() {
|
|
76419
76558
|
return this._minField;
|
|
@@ -76446,7 +76585,7 @@
|
|
|
76446
76585
|
return this._outliersStyle;
|
|
76447
76586
|
}
|
|
76448
76587
|
setAttrFromSpec() {
|
|
76449
|
-
var _a, _b, _c, _d, _e;
|
|
76588
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
76450
76589
|
super.setAttrFromSpec();
|
|
76451
76590
|
const boxPlotStyle = (_b = (_a = this._spec.boxPlot) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {};
|
|
76452
76591
|
this._minField = this._spec.minField;
|
|
@@ -76463,7 +76602,7 @@
|
|
|
76463
76602
|
this._strokeColor = boxPlotStyle.stroke;
|
|
76464
76603
|
this._shaftFillOpacity =
|
|
76465
76604
|
this._shaftShape === 'bar' ? (_e = boxPlotStyle.shaftFillOpacity) !== null && _e !== void 0 ? _e : DEFAULT_SHAFT_FILL_OPACITY : undefined;
|
|
76466
|
-
this._outliersStyle = this._spec.outliersStyle;
|
|
76605
|
+
this._outliersStyle = ((_f = this._spec.outliersStyle) !== null && _f !== void 0 ? _f : (_g = this._spec.outlier) === null || _g === void 0 ? void 0 : _g.style);
|
|
76467
76606
|
}
|
|
76468
76607
|
initMark() {
|
|
76469
76608
|
this._boxPlotMark = this._createMark(BoxPlotSeries.mark.boxPlot, {
|
|
@@ -76485,24 +76624,37 @@
|
|
|
76485
76624
|
if (boxPlotMark) {
|
|
76486
76625
|
const commonBoxplotStyles = {
|
|
76487
76626
|
lineWidth: this._lineWidth,
|
|
76488
|
-
fill: (_a = this._boxFillColor) !== null && _a !== void 0 ? _a : (this._shaftShape
|
|
76627
|
+
fill: (_a = this._boxFillColor) !== null && _a !== void 0 ? _a : (this._shaftShape !== 'line' ? this.getColorAttribute() : DEFAULT_FILL_COLOR),
|
|
76489
76628
|
minMaxFillOpacity: this._shaftFillOpacity,
|
|
76490
|
-
stroke: (_b = this._strokeColor) !== null && _b !== void 0 ? _b : (this._shaftShape
|
|
76629
|
+
stroke: (_b = this._strokeColor) !== null && _b !== void 0 ? _b : (this._shaftShape !== 'line' ? DEFAULT_STROKE_COLOR : this.getColorAttribute())
|
|
76491
76630
|
};
|
|
76492
76631
|
boxPlotMark.setGlyphConfig({
|
|
76493
76632
|
direction: this._direction,
|
|
76494
76633
|
shaftShape: this._shaftShape
|
|
76495
76634
|
});
|
|
76496
76635
|
const boxPlotMarkStyles = this._direction === "horizontal"
|
|
76497
|
-
?
|
|
76498
|
-
|
|
76636
|
+
? {
|
|
76637
|
+
y: (datum) => this._getPosition(this.direction, datum),
|
|
76638
|
+
boxHeight: () => { var _a; return getActualNumValue((_a = this._boxWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76639
|
+
ruleHeight: () => { var _a; return getActualNumValue((_a = this._shaftWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76640
|
+
q1q3Height: () => { var _a; return getActualNumValue((_a = this._boxWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76641
|
+
minMaxHeight: () => { var _a; return getActualNumValue((_a = this._shaftWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); }
|
|
76642
|
+
}
|
|
76643
|
+
: {
|
|
76644
|
+
x: (datum) => this._getPosition(this.direction, datum),
|
|
76645
|
+
boxWidth: () => { var _a; return getActualNumValue((_a = this._boxWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76646
|
+
ruleWidth: () => { var _a; return getActualNumValue((_a = this._shaftWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76647
|
+
q1q3Width: () => { var _a; return getActualNumValue((_a = this._boxWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); },
|
|
76648
|
+
minMaxWidth: () => { var _a; return getActualNumValue((_a = this._shaftWidth) !== null && _a !== void 0 ? _a : '100%', this._getMarkWidth()); }
|
|
76649
|
+
};
|
|
76650
|
+
this.setMarkStyle(boxPlotMark, commonBoxplotStyles, exports.STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
76651
|
+
this.setMarkStyle(boxPlotMark, boxPlotMarkStyles, exports.STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Built_In);
|
|
76499
76652
|
}
|
|
76500
76653
|
const outlierMark = this._outlierMark;
|
|
76501
76654
|
if (outlierMark) {
|
|
76502
76655
|
this.setMarkStyle(outlierMark, {
|
|
76503
76656
|
fill: (_d = (_c = this._outliersStyle) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.getColorAttribute(),
|
|
76504
|
-
size: isNumber$1((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE
|
|
76505
|
-
symbolType: 'circle'
|
|
76657
|
+
size: isNumber$1((_e = this._outliersStyle) === null || _e === void 0 ? void 0 : _e.size) ? this._outliersStyle.size : DEFAULT_OUTLIER_SIZE
|
|
76506
76658
|
}, exports.STATE_VALUE_ENUM.STATE_NORMAL, exports.AttributeLevel.Series);
|
|
76507
76659
|
}
|
|
76508
76660
|
}
|
|
@@ -76537,13 +76689,13 @@
|
|
|
76537
76689
|
const scale = (_b = axisHelper === null || axisHelper === void 0 ? void 0 : axisHelper.getScale) === null || _b === void 0 ? void 0 : _b.call(axisHelper, 0);
|
|
76538
76690
|
const outlierMarkPositionChannel = this._direction === "horizontal"
|
|
76539
76691
|
? {
|
|
76540
|
-
y: this.
|
|
76692
|
+
y: (datum) => this._getPosition(this.direction, datum),
|
|
76541
76693
|
x: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
76542
76694
|
bandPosition: this._bandPosition
|
|
76543
76695
|
}), scale)
|
|
76544
76696
|
}
|
|
76545
76697
|
: {
|
|
76546
|
-
x: this.
|
|
76698
|
+
x: (datum) => this._getPosition(this.direction, datum),
|
|
76547
76699
|
y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, BOX_PLOT_OUTLIER_VALUE_FIELD), {
|
|
76548
76700
|
bandPosition: this._bandPosition
|
|
76549
76701
|
}), scale)
|
|
@@ -76589,16 +76741,73 @@
|
|
|
76589
76741
|
this.initBoxPlotMarkStyle();
|
|
76590
76742
|
}
|
|
76591
76743
|
_getMarkWidth() {
|
|
76744
|
+
var _a;
|
|
76592
76745
|
if (this._autoBoxWidth) {
|
|
76593
76746
|
return this._autoBoxWidth;
|
|
76594
76747
|
}
|
|
76595
76748
|
const bandAxisHelper = this._direction === "horizontal" ? this._yAxisHelper : this._xAxisHelper;
|
|
76596
|
-
const
|
|
76597
|
-
const
|
|
76598
|
-
|
|
76599
|
-
this.
|
|
76749
|
+
const depthFromSpec = this._groups ? this._groups.fields.length : 1;
|
|
76750
|
+
const bandWidth = (_a = bandAxisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(bandAxisHelper, depthFromSpec - 1);
|
|
76751
|
+
let width = bandWidth;
|
|
76752
|
+
if (isValid$1(this._spec.boxWidth)) {
|
|
76753
|
+
width = getActualNumValue(this._spec.boxWidth, bandWidth);
|
|
76754
|
+
}
|
|
76755
|
+
if (isValid$1(this._spec.boxMinWidth)) {
|
|
76756
|
+
width = Math.max(width, getActualNumValue(this._spec.boxMinWidth, bandWidth));
|
|
76757
|
+
}
|
|
76758
|
+
if (isValid$1(this._spec.boxMaxWidth)) {
|
|
76759
|
+
width = Math.min(width, getActualNumValue(this._spec.boxMaxWidth, bandWidth));
|
|
76760
|
+
}
|
|
76761
|
+
this._autoBoxWidth = width;
|
|
76600
76762
|
return this._autoBoxWidth;
|
|
76601
76763
|
}
|
|
76764
|
+
_getPosition(direction, datum) {
|
|
76765
|
+
var _a, _b, _c, _d;
|
|
76766
|
+
let axisHelper;
|
|
76767
|
+
let sizeAttribute;
|
|
76768
|
+
let dataToPosition;
|
|
76769
|
+
if (direction === "horizontal") {
|
|
76770
|
+
axisHelper = this.getYAxisHelper();
|
|
76771
|
+
sizeAttribute = 'boxHeight';
|
|
76772
|
+
dataToPosition = this.dataToPositionY.bind(this);
|
|
76773
|
+
}
|
|
76774
|
+
else {
|
|
76775
|
+
axisHelper = this.getXAxisHelper();
|
|
76776
|
+
sizeAttribute = 'boxWidth';
|
|
76777
|
+
dataToPosition = this.dataToPositionX.bind(this);
|
|
76778
|
+
}
|
|
76779
|
+
const scale = axisHelper.getScale(0);
|
|
76780
|
+
const depthFromSpec = this._groups ? this._groups.fields.length : 1;
|
|
76781
|
+
const depth = depthFromSpec;
|
|
76782
|
+
const bandWidth = (_a = axisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(axisHelper, depth - 1);
|
|
76783
|
+
const size = this._boxPlotMark.getAttribute(sizeAttribute, datum);
|
|
76784
|
+
if (depth > 1 && isValid$1(this._spec.boxGapInGroup)) {
|
|
76785
|
+
const groupFields = this._groups.fields;
|
|
76786
|
+
const boxGapInGroup = array(this._spec.boxGapInGroup);
|
|
76787
|
+
let totalWidth = 0;
|
|
76788
|
+
let offSet = 0;
|
|
76789
|
+
for (let index = groupFields.length - 1; index >= 1; index--) {
|
|
76790
|
+
const groupField = groupFields[index];
|
|
76791
|
+
const groupValues = (_c = (_b = axisHelper.getScale(index)) === null || _b === void 0 ? void 0 : _b.domain()) !== null && _c !== void 0 ? _c : [];
|
|
76792
|
+
const groupCount = groupValues.length;
|
|
76793
|
+
const gap = getActualNumValue((_d = boxGapInGroup[index - 1]) !== null && _d !== void 0 ? _d : last(boxGapInGroup), bandWidth);
|
|
76794
|
+
const i = groupValues.indexOf(datum[groupField]);
|
|
76795
|
+
if (index === groupFields.length - 1) {
|
|
76796
|
+
totalWidth += groupCount * size + (groupCount - 1) * gap;
|
|
76797
|
+
offSet += i * (size + gap);
|
|
76798
|
+
}
|
|
76799
|
+
else {
|
|
76800
|
+
offSet += i * (totalWidth + gap);
|
|
76801
|
+
totalWidth += totalWidth + (groupCount - 1) * gap;
|
|
76802
|
+
}
|
|
76803
|
+
}
|
|
76804
|
+
const center = scale.scale(datum[groupFields[0]]) + axisHelper.getBandwidth(0) / 2;
|
|
76805
|
+
return center - totalWidth / 2 + offSet + size / 2;
|
|
76806
|
+
}
|
|
76807
|
+
const continuous = isContinuous(scale.type || 'band');
|
|
76808
|
+
const pos = dataToPosition(datum);
|
|
76809
|
+
return pos + bandWidth * 0.5 + (continuous ? -bandWidth / 2 : 0);
|
|
76810
|
+
}
|
|
76602
76811
|
onLayoutEnd() {
|
|
76603
76812
|
super.onLayoutEnd();
|
|
76604
76813
|
this._autoBoxWidth = null;
|
|
@@ -76607,10 +76816,10 @@
|
|
|
76607
76816
|
const newConfig = merge$1({}, config);
|
|
76608
76817
|
['appear', 'enter', 'update', 'exit', 'disappear'].forEach(state => {
|
|
76609
76818
|
if (newConfig[state] && newConfig[state].type === 'scaleIn') {
|
|
76610
|
-
newConfig[state].type = this._shaftShape === '
|
|
76819
|
+
newConfig[state].type = this._shaftShape === 'bar' ? 'barBoxplotScaleIn' : 'boxplotScaleIn';
|
|
76611
76820
|
}
|
|
76612
76821
|
else if (newConfig[state] && newConfig[state].type === 'scaleOut') {
|
|
76613
|
-
newConfig[state].type = this._shaftShape === '
|
|
76822
|
+
newConfig[state].type = this._shaftShape === 'bar' ? 'barBoxplotScaleOut' : 'boxplotScaleOut';
|
|
76614
76823
|
}
|
|
76615
76824
|
});
|
|
76616
76825
|
return newConfig;
|
|
@@ -93829,13 +94038,18 @@
|
|
|
93829
94038
|
const dataFields = [spec.maxField, spec.medianField, spec.q1Field, spec.q3Field, spec.minField, spec.outliersField];
|
|
93830
94039
|
const seriesSpec = super._getDefaultSeriesSpec(spec, [
|
|
93831
94040
|
'boxPlot',
|
|
94041
|
+
'outlier',
|
|
93832
94042
|
'minField',
|
|
93833
94043
|
'maxField',
|
|
93834
94044
|
'q1Field',
|
|
93835
94045
|
'medianField',
|
|
93836
94046
|
'q3Field',
|
|
93837
94047
|
'outliersField',
|
|
93838
|
-
'outliersStyle'
|
|
94048
|
+
'outliersStyle',
|
|
94049
|
+
'boxWidth',
|
|
94050
|
+
'boxMaxWidth',
|
|
94051
|
+
'boxMinWidth',
|
|
94052
|
+
'boxGapInGroup'
|
|
93839
94053
|
]);
|
|
93840
94054
|
seriesSpec.direction = (_a = spec.direction) !== null && _a !== void 0 ? _a : "vertical";
|
|
93841
94055
|
seriesSpec[seriesSpec.direction === "horizontal" ? 'xField' : 'yField'] = dataFields;
|
|
@@ -95123,7 +95337,7 @@
|
|
|
95123
95337
|
return Object.keys(data).length > 0;
|
|
95124
95338
|
};
|
|
95125
95339
|
function showTooltip(datum, options, component) {
|
|
95126
|
-
var _a, _b, _c;
|
|
95340
|
+
var _a, _b, _c, _d, _e, _f;
|
|
95127
95341
|
const opt = Object.assign({ regionIndex: 0 }, options);
|
|
95128
95342
|
const componentOptions = component.getOption();
|
|
95129
95343
|
const region = componentOptions.getRegionsInUserIdOrIndex(isValid$1(opt.regionId) ? [opt.regionId] : undefined, isValid$1(opt.regionIndex) ? [opt.regionIndex] : undefined)[0];
|
|
@@ -95206,7 +95420,7 @@
|
|
|
95206
95420
|
}),
|
|
95207
95421
|
item: undefined
|
|
95208
95422
|
};
|
|
95209
|
-
component.processor.dimension.showTooltip(mockDimensionInfo, mockParams, false);
|
|
95423
|
+
(_e = (_d = (_c = component.processor) === null || _c === void 0 ? void 0 : _c.dimension) === null || _d === void 0 ? void 0 : _d.showTooltip) === null || _e === void 0 ? void 0 : _e.call(_d, mockDimensionInfo, mockParams, false);
|
|
95210
95424
|
const vchart = componentOptions.globalInstance;
|
|
95211
95425
|
if (VChart.globalConfig.uniqueTooltip) {
|
|
95212
95426
|
VChart.hideTooltip(vchart.id);
|
|
@@ -95235,7 +95449,7 @@
|
|
|
95235
95449
|
changePositionOnly: false,
|
|
95236
95450
|
tooltip: null,
|
|
95237
95451
|
dimensionInfo: mockDimensionInfo,
|
|
95238
|
-
chart: (
|
|
95452
|
+
chart: (_f = componentOptions.globalInstance.getChart()) !== null && _f !== void 0 ? _f : undefined,
|
|
95239
95453
|
datum: mockDatum,
|
|
95240
95454
|
model: info.series,
|
|
95241
95455
|
source: Event_Source_Type.chart,
|
|
@@ -103141,10 +103355,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
103141
103355
|
if (isValid$1(spec.dataId) || isValidNumber$1(spec.dataIndex)) {
|
|
103142
103356
|
const dataview = this.getChart().getSeriesData(spec.dataId, spec.dataIndex);
|
|
103143
103357
|
if (dataview) {
|
|
103358
|
+
mark.setDataView(dataview);
|
|
103144
103359
|
dataview.target.addListener('change', () => {
|
|
103145
103360
|
mark.getData().updateData();
|
|
103146
103361
|
});
|
|
103147
|
-
mark.setDataView(dataview);
|
|
103148
103362
|
}
|
|
103149
103363
|
}
|
|
103150
103364
|
}
|