@visactor/vchart 2.0.20-alpha.1 → 2.0.20-alpha.3
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 +178 -69
- package/build/index.js +178 -69
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/component/axis/base-axis.d.ts +9 -1
- package/cjs/component/axis/base-axis.js +37 -7
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +4 -3
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +1 -0
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +1 -0
- package/cjs/component/axis/mixin/band-axis-mixin.js +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +1 -0
- package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/axis/polar/axis.js +1 -1
- package/cjs/component/axis/polar/axis.js.map +1 -1
- package/cjs/component/legend/continuous/interface.d.ts +5 -2
- package/cjs/component/legend/continuous/interface.js.map +1 -1
- package/cjs/component/legend/continuous/util.js +12 -4
- package/cjs/component/legend/continuous/util.js.map +1 -1
- package/cjs/constant/funnel.js +1 -1
- package/cjs/constant/gradient.js +1 -1
- package/cjs/constant/hierarchy.js +1 -1
- package/cjs/constant/label.js +1 -1
- package/cjs/constant/layout.js +1 -1
- package/cjs/constant/marker.js +1 -1
- package/cjs/constant/polar.js +1 -1
- package/cjs/constant/scatter.js +1 -1
- package/cjs/constant/scroll-bar.js +2 -1
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -1
- package/cjs/constant/word-cloud.js +1 -1
- package/cjs/core/interface.js +1 -1
- package/cjs/core/util.js +1 -1
- package/cjs/core/vchart.js +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/cjs/env/env.js +1 -1
- package/cjs/env/index.js +1 -1
- package/cjs/event/bubble.js +1 -1
- package/cjs/event/event-dispatcher.js +1 -1
- package/cjs/event/event.js +1 -1
- package/cjs/event/index.js +1 -1
- package/cjs/event/interface.js +1 -2
- package/cjs/mark/base/base-mark.js +2 -2
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +2 -0
- package/cjs/series/pie/pie.js +6 -4
- package/cjs/series/pie/pie.js.map +1 -1
- package/esm/component/axis/base-axis.d.ts +9 -1
- package/esm/component/axis/base-axis.js +37 -7
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +4 -3
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +1 -0
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +1 -0
- package/esm/component/axis/mixin/band-axis-mixin.js +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +1 -0
- package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/axis/polar/axis.js +1 -1
- package/esm/component/axis/polar/axis.js.map +1 -1
- package/esm/component/legend/continuous/interface.d.ts +5 -2
- package/esm/component/legend/continuous/interface.js.map +1 -1
- package/esm/component/legend/continuous/util.js +9 -2
- package/esm/component/legend/continuous/util.js.map +1 -1
- package/esm/constant/funnel.js +1 -1
- package/esm/constant/gradient.js +1 -1
- package/esm/constant/hierarchy.js +1 -1
- package/esm/constant/label.js +1 -1
- package/esm/constant/layout.js +1 -1
- package/esm/constant/marker.js +1 -1
- package/esm/constant/polar.js +1 -1
- package/esm/constant/scatter.js +1 -1
- package/esm/constant/scroll-bar.js +2 -1
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -1
- package/esm/constant/word-cloud.js +1 -1
- package/esm/core/interface.js +1 -1
- package/esm/core/util.js +1 -1
- package/esm/core/vchart.js +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/esm/env/env.js +1 -1
- package/esm/env/index.js +1 -1
- package/esm/event/bubble.js +1 -1
- package/esm/event/event-dispatcher.js +1 -1
- package/esm/event/event.js +1 -1
- package/esm/event/index.js +1 -1
- package/esm/event/interface.js +1 -2
- package/esm/mark/base/base-mark.js +3 -2
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/series/pie/pie.d.ts +2 -0
- package/esm/series/pie/pie.js +7 -4
- package/esm/series/pie/pie.js.map +1 -1
- package/package.json +9 -9
package/build/index.es.js
CHANGED
|
@@ -22135,9 +22135,10 @@ class DefaultTextBackgroundRenderContribution extends DefaultBaseBackgroundRende
|
|
|
22135
22135
|
}), context.highPerformanceRestore(), context.setTransformForCurrent();
|
|
22136
22136
|
} else {
|
|
22137
22137
|
const {
|
|
22138
|
-
backgroundCornerRadius: backgroundCornerRadius
|
|
22138
|
+
backgroundCornerRadius: backgroundCornerRadius,
|
|
22139
|
+
backgroundOpacity = 1
|
|
22139
22140
|
} = graphic.attribute;
|
|
22140
|
-
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
22141
|
+
context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.globalAlpha = backgroundOpacity, context.fillStyle = background, backgroundCornerRadius ? (createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius, !0), context.fill()) : context.fillRect(b.x1, b.y1, b.width(), b.height()), context.highPerformanceRestore();
|
|
22141
22142
|
}
|
|
22142
22143
|
shouldReCalBounds && boundsAllocate.free(b), restore();
|
|
22143
22144
|
}
|
|
@@ -44071,8 +44072,9 @@ class LabelBase extends AnimateComponent {
|
|
|
44071
44072
|
const label = labels[i];
|
|
44072
44073
|
if (!label) continue;
|
|
44073
44074
|
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
44074
|
-
let backgroundColor = baseMark.getAttributes(!0).fill
|
|
44075
|
-
|
|
44075
|
+
let backgroundColor = baseMark.getAttributes(!0).fill;
|
|
44076
|
+
const backgroundOpacity = baseMark.getAttributes(!0).fillOpacity;
|
|
44077
|
+
let foregroundColor = label.attribute.fill;
|
|
44076
44078
|
if (isObject$2(backgroundColor) && backgroundColor.gradient) {
|
|
44077
44079
|
const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
|
|
44078
44080
|
firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
|
|
@@ -44086,11 +44088,26 @@ class LabelBase extends AnimateComponent {
|
|
|
44086
44088
|
if (fill && label.setAttributes({
|
|
44087
44089
|
fill: fill
|
|
44088
44090
|
}), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
44089
|
-
|
|
44090
|
-
|
|
44091
|
-
|
|
44092
|
-
|
|
44091
|
+
if ("background" === interactInvertType) label.setAttributes({
|
|
44092
|
+
stroke: !1
|
|
44093
|
+
});else {
|
|
44094
|
+
const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
|
|
44095
|
+
stroke && label.setAttributes({
|
|
44096
|
+
stroke: stroke
|
|
44097
|
+
});
|
|
44098
|
+
}
|
|
44093
44099
|
} else if (isIntersect && "none" !== interactInvertType) {
|
|
44100
|
+
if ("background" === interactInvertType) {
|
|
44101
|
+
const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
|
|
44102
|
+
fill && label.setAttributes({
|
|
44103
|
+
fill: fill
|
|
44104
|
+
}), label.setAttributes({
|
|
44105
|
+
stroke: !1,
|
|
44106
|
+
background: backgroundColor,
|
|
44107
|
+
backgroundOpacity: backgroundOpacity
|
|
44108
|
+
});
|
|
44109
|
+
continue;
|
|
44110
|
+
}
|
|
44094
44111
|
if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
|
|
44095
44112
|
if (label.attribute.stroke) {
|
|
44096
44113
|
label.setAttributes({
|
|
@@ -44107,6 +44124,9 @@ class LabelBase extends AnimateComponent {
|
|
|
44107
44124
|
stroke: stroke
|
|
44108
44125
|
});
|
|
44109
44126
|
}
|
|
44127
|
+
!1 === isInside && "background" === interactInvertType && label.setAttributes({
|
|
44128
|
+
background: null
|
|
44129
|
+
});
|
|
44110
44130
|
}
|
|
44111
44131
|
}
|
|
44112
44132
|
_canPlaceInside(textBound, shapeBound) {
|
|
@@ -49650,7 +49670,31 @@ class Slider extends AbstractComponent {
|
|
|
49650
49670
|
return graphicCreator.symbol(style);
|
|
49651
49671
|
}
|
|
49652
49672
|
_renderHandlerText(value, position) {
|
|
49653
|
-
|
|
49673
|
+
return graphicCreator.text(this._getHandlerTextAttributes(value, position));
|
|
49674
|
+
}
|
|
49675
|
+
_getHandlerPosition(isStart) {
|
|
49676
|
+
return this.attribute.range && isStart ? "start" : "end";
|
|
49677
|
+
}
|
|
49678
|
+
_getHandlerTextStyle(value, position) {
|
|
49679
|
+
const {
|
|
49680
|
+
align: align,
|
|
49681
|
+
handlerSize = 14,
|
|
49682
|
+
handlerText = {},
|
|
49683
|
+
railHeight: railHeight,
|
|
49684
|
+
railWidth: railWidth,
|
|
49685
|
+
slidable: slidable
|
|
49686
|
+
} = this.attribute;
|
|
49687
|
+
return isFunction$1(handlerText.style) ? handlerText.style(value, position, {
|
|
49688
|
+
layout: this.attribute.layout,
|
|
49689
|
+
align: align,
|
|
49690
|
+
railWidth: railWidth,
|
|
49691
|
+
railHeight: railHeight,
|
|
49692
|
+
handlerSize: handlerSize,
|
|
49693
|
+
slidable: slidable
|
|
49694
|
+
}) : handlerText.style;
|
|
49695
|
+
}
|
|
49696
|
+
_getHandlerTextAttributes(value, position) {
|
|
49697
|
+
var _a, _b;
|
|
49654
49698
|
const {
|
|
49655
49699
|
align: align,
|
|
49656
49700
|
handlerSize = 14,
|
|
@@ -49662,13 +49706,13 @@ class Slider extends AbstractComponent {
|
|
|
49662
49706
|
isHorizontal = this._isHorizontal,
|
|
49663
49707
|
pos = this.calculatePosByValue(value, position),
|
|
49664
49708
|
textSpace = null !== (_a = handlerText.space) && void 0 !== _a ? _a : 4,
|
|
49709
|
+
handlerTextStyle = this._getHandlerTextStyle(value, position),
|
|
49665
49710
|
textStyle = {
|
|
49666
49711
|
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed(null !== (_b = handlerText.precision) && void 0 !== _b ? _b : 0),
|
|
49667
|
-
lineHeight: null
|
|
49712
|
+
lineHeight: null == handlerTextStyle ? void 0 : handlerTextStyle.lineHeight,
|
|
49668
49713
|
cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
|
|
49669
49714
|
};
|
|
49670
|
-
isHorizontal ? "top" === align ? (textStyle.textBaseline = "bottom", textStyle.textAlign = "center", textStyle.x = pos, textStyle.y = (railHeight - handlerSize) / 2 - textSpace) : (textStyle.textBaseline = "top", textStyle.textAlign = "center", textStyle.x = pos, textStyle.y = (railHeight + handlerSize) / 2 + textSpace) : "left" === align ? (textStyle.textBaseline = "middle", textStyle.textAlign = "end", textStyle.x = (railWidth - handlerSize) / 2 - textSpace, textStyle.y = pos) : (textStyle.textBaseline = "middle", textStyle.textAlign = "start", textStyle.x = (railWidth + handlerSize) / 2 + textSpace, textStyle.y = pos);
|
|
49671
|
-
return graphicCreator.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
|
|
49715
|
+
return isHorizontal ? "top" === align ? (textStyle.textBaseline = "bottom", textStyle.textAlign = "center", textStyle.x = pos, textStyle.y = (railHeight - handlerSize) / 2 - textSpace) : (textStyle.textBaseline = "top", textStyle.textAlign = "center", textStyle.x = pos, textStyle.y = (railHeight + handlerSize) / 2 + textSpace) : "left" === align ? (textStyle.textBaseline = "middle", textStyle.textAlign = "end", textStyle.x = (railWidth - handlerSize) / 2 - textSpace, textStyle.y = pos) : (textStyle.textBaseline = "middle", textStyle.textAlign = "start", textStyle.x = (railWidth + handlerSize) / 2 + textSpace, textStyle.y = pos), Object.assign(Object.assign({}, textStyle), handlerTextStyle);
|
|
49672
49716
|
}
|
|
49673
49717
|
_renderTooltip() {
|
|
49674
49718
|
var _a;
|
|
@@ -49796,31 +49840,19 @@ class Slider extends AbstractComponent {
|
|
|
49796
49840
|
}
|
|
49797
49841
|
}
|
|
49798
49842
|
_updateHandler(handler, position, value) {
|
|
49799
|
-
var _a;
|
|
49800
49843
|
const isHorizontal = this._isHorizontal;
|
|
49801
49844
|
handler.setAttribute(isHorizontal ? "x" : "y", position);
|
|
49802
49845
|
const updateHandlerText = handler.name === SLIDER_ELEMENT_NAME.startHandler ? this._startHandlerText : this._endHandlerText;
|
|
49803
49846
|
if (updateHandlerText) {
|
|
49804
|
-
const
|
|
49805
|
-
|
|
49806
|
-
} = this.attribute;
|
|
49807
|
-
updateHandlerText.setAttributes({
|
|
49808
|
-
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed(null !== (_a = handlerText.precision) && void 0 !== _a ? _a : 0),
|
|
49809
|
-
[isHorizontal ? "x" : "y"]: position
|
|
49810
|
-
});
|
|
49847
|
+
const handlerPosition = this._getHandlerPosition(handler.name === SLIDER_ELEMENT_NAME.startHandler);
|
|
49848
|
+
updateHandlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
|
|
49811
49849
|
}
|
|
49812
49850
|
handler.name === SLIDER_ELEMENT_NAME.startHandler ? (this._currentValue.startValue = value, this._currentValue.startPos = position) : (this._currentValue.endValue = value, this._currentValue.endPos = position);
|
|
49813
49851
|
}
|
|
49814
49852
|
_updateHandlerText(handlerText, position, value) {
|
|
49815
|
-
var _a;
|
|
49816
49853
|
const isHorizontal = this._isHorizontal,
|
|
49817
|
-
|
|
49818
|
-
|
|
49819
|
-
} = this.attribute;
|
|
49820
|
-
handlerText.setAttributes({
|
|
49821
|
-
[isHorizontal ? "x" : "y"]: position,
|
|
49822
|
-
text: handlerTextAttr.formatter ? handlerTextAttr.formatter(value) : value.toFixed(null !== (_a = handlerTextAttr.precision) && void 0 !== _a ? _a : 0)
|
|
49823
|
-
});
|
|
49854
|
+
handlerPosition = this._getHandlerPosition(handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText);
|
|
49855
|
+
handlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
|
|
49824
49856
|
const updateHandler = handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText ? this._startHandler : this._endHandler;
|
|
49825
49857
|
updateHandler && updateHandler.setAttributes({
|
|
49826
49858
|
[isHorizontal ? "x" : "y"]: position
|
|
@@ -59213,6 +59245,9 @@ class BaseMark extends GrammarItem {
|
|
|
59213
59245
|
if (this.isCommited()) {
|
|
59214
59246
|
if (this.getVisible() &&
|
|
59215
59247
|
(!this._skipBeforeLayouted || this.getCompiler().getLayoutState() !== LayoutState.before)) {
|
|
59248
|
+
if (!this._product) {
|
|
59249
|
+
this._initProduct();
|
|
59250
|
+
}
|
|
59216
59251
|
log(`render mark: ${this.getProductId()}, type is ${this.type}`);
|
|
59217
59252
|
this.renderInner();
|
|
59218
59253
|
}
|
|
@@ -66132,6 +66167,9 @@ class AxisComponent extends BaseComponent {
|
|
|
66132
66167
|
getTickData(index = 0) {
|
|
66133
66168
|
return this._tickData[index];
|
|
66134
66169
|
}
|
|
66170
|
+
getVisible() {
|
|
66171
|
+
return this._visible;
|
|
66172
|
+
}
|
|
66135
66173
|
get visible() {
|
|
66136
66174
|
return this._visible;
|
|
66137
66175
|
}
|
|
@@ -66142,20 +66180,34 @@ class AxisComponent extends BaseComponent {
|
|
|
66142
66180
|
return this._coordinateType;
|
|
66143
66181
|
}
|
|
66144
66182
|
constructor(spec, options) {
|
|
66145
|
-
var _a;
|
|
66183
|
+
var _a, _b;
|
|
66146
66184
|
super(spec, options);
|
|
66147
66185
|
this.specKey = 'axes';
|
|
66148
66186
|
this._scales = [];
|
|
66149
66187
|
this._tickData = [];
|
|
66150
66188
|
this._visible = true;
|
|
66189
|
+
this._specVisible = true;
|
|
66190
|
+
this._hideWhenEmpty = false;
|
|
66151
66191
|
this._tick = undefined;
|
|
66152
66192
|
this._onTickDataChange = (tickData) => {
|
|
66153
66193
|
this._forceLayout();
|
|
66154
66194
|
tickData === null || tickData === void 0 ? void 0 : tickData.updateData();
|
|
66155
66195
|
};
|
|
66156
|
-
this.
|
|
66196
|
+
this._specVisible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
66197
|
+
this._hideWhenEmpty = (_b = spec.hideWhenEmpty) !== null && _b !== void 0 ? _b : false;
|
|
66198
|
+
this._visible = this._specVisible;
|
|
66157
66199
|
this._coordinateType = 'none';
|
|
66158
66200
|
}
|
|
66201
|
+
setAttrFromSpec() {
|
|
66202
|
+
var _a, _b;
|
|
66203
|
+
super.setAttrFromSpec();
|
|
66204
|
+
this._specVisible = (_a = this._spec.visible) !== null && _a !== void 0 ? _a : true;
|
|
66205
|
+
this._hideWhenEmpty = (_b = this._spec.hideWhenEmpty) !== null && _b !== void 0 ? _b : false;
|
|
66206
|
+
this._visible = this._specVisible;
|
|
66207
|
+
if (this._scale) {
|
|
66208
|
+
this._refreshVisibilityByData();
|
|
66209
|
+
}
|
|
66210
|
+
}
|
|
66159
66211
|
getVRenderComponents() {
|
|
66160
66212
|
var _a, _b;
|
|
66161
66213
|
return [(_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.getProduct(), (_b = this._gridMark) === null || _b === void 0 ? void 0 : _b.getProduct()].filter(isValid$1);
|
|
@@ -66167,8 +66219,9 @@ class AxisComponent extends BaseComponent {
|
|
|
66167
66219
|
this.initEvent();
|
|
66168
66220
|
this.initScales();
|
|
66169
66221
|
this.updateSeriesScale();
|
|
66222
|
+
this._refreshVisibilityByData();
|
|
66170
66223
|
this._shouldComputeTickData() && this._initData();
|
|
66171
|
-
if (this.
|
|
66224
|
+
if (this._specVisible) {
|
|
66172
66225
|
const axisMark = this._createMark({ type: 'component', name: `axis-${this.getOrient()}` }, {
|
|
66173
66226
|
componentType: this.getOrient() === 'angle' ? AxisEnum.circleAxis : AxisEnum.lineAxis,
|
|
66174
66227
|
mode: this._spec.mode
|
|
@@ -66198,6 +66251,7 @@ class AxisComponent extends BaseComponent {
|
|
|
66198
66251
|
this._marks.addMark(gridMark);
|
|
66199
66252
|
this._gridMark = gridMark;
|
|
66200
66253
|
}
|
|
66254
|
+
this._syncComponentVisibility();
|
|
66201
66255
|
if (((_h = this._option.globalInstance) === null || _h === void 0 ? void 0 : _h.isAnimationEnable()) &&
|
|
66202
66256
|
get$1(this._option.getChart().getSpec(), 'animation') !== false &&
|
|
66203
66257
|
this._spec.animation === true) {
|
|
@@ -66218,7 +66272,7 @@ class AxisComponent extends BaseComponent {
|
|
|
66218
66272
|
}
|
|
66219
66273
|
}
|
|
66220
66274
|
_shouldComputeTickData() {
|
|
66221
|
-
return this.getVisible() || this._spec.forceInitTick;
|
|
66275
|
+
return this._specVisible && (this.getVisible() || this._spec.forceInitTick || this._hideWhenEmpty);
|
|
66222
66276
|
}
|
|
66223
66277
|
_initData() {
|
|
66224
66278
|
const tickData = this._initTickDataSet(this._tickTransformOption());
|
|
@@ -66230,40 +66284,41 @@ class AxisComponent extends BaseComponent {
|
|
|
66230
66284
|
}
|
|
66231
66285
|
collectData(depth, rawData) {
|
|
66232
66286
|
const data = [];
|
|
66233
|
-
|
|
66234
|
-
|
|
66235
|
-
|
|
66236
|
-
|
|
66237
|
-
|
|
66238
|
-
|
|
66239
|
-
|
|
66240
|
-
|
|
66241
|
-
|
|
66242
|
-
|
|
66243
|
-
|
|
66244
|
-
|
|
66245
|
-
|
|
66246
|
-
|
|
66247
|
-
|
|
66248
|
-
|
|
66249
|
-
|
|
66250
|
-
|
|
66251
|
-
|
|
66252
|
-
|
|
66253
|
-
if (
|
|
66254
|
-
|
|
66255
|
-
|
|
66256
|
-
|
|
66257
|
-
|
|
66287
|
+
this._regions &&
|
|
66288
|
+
eachSeries(this._regions, s => {
|
|
66289
|
+
var _a;
|
|
66290
|
+
let field = this.collectSeriesField(depth, s);
|
|
66291
|
+
field = (isArray$1(field) ? (isContinuous(this._scale.type) ? field : [field[0]]) : [field]);
|
|
66292
|
+
if (!depth) {
|
|
66293
|
+
this._dataFieldText = s.getFieldAlias(field[0]);
|
|
66294
|
+
}
|
|
66295
|
+
if (field) {
|
|
66296
|
+
const viewData = s.getViewData();
|
|
66297
|
+
if (rawData) {
|
|
66298
|
+
field.forEach(f => {
|
|
66299
|
+
data.push(s.getRawDataStatisticsByField(f, !!isContinuous(this._scale.type)));
|
|
66300
|
+
});
|
|
66301
|
+
}
|
|
66302
|
+
else if (viewData && viewData.latestData && viewData.latestData.length) {
|
|
66303
|
+
const seriesData = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s);
|
|
66304
|
+
const userSetBreaks = this.type === ComponentTypeEnum.cartesianLinearAxis && this._spec.breaks && this._spec.breaks.length;
|
|
66305
|
+
field.forEach(f => {
|
|
66306
|
+
var _a;
|
|
66307
|
+
if ((_a = seriesData === null || seriesData === void 0 ? void 0 : seriesData.latestData) === null || _a === void 0 ? void 0 : _a[f]) {
|
|
66308
|
+
if (userSetBreaks) {
|
|
66309
|
+
data.push(Object.assign(Object.assign({}, seriesData.latestData[f]), { values: viewData.latestData.map((obj) => obj[f]) }));
|
|
66310
|
+
}
|
|
66311
|
+
else {
|
|
66312
|
+
data.push(seriesData.latestData[f]);
|
|
66313
|
+
}
|
|
66258
66314
|
}
|
|
66259
|
-
}
|
|
66260
|
-
}
|
|
66315
|
+
});
|
|
66316
|
+
}
|
|
66261
66317
|
}
|
|
66262
|
-
}
|
|
66263
|
-
|
|
66264
|
-
|
|
66265
|
-
|
|
66266
|
-
});
|
|
66318
|
+
}, {
|
|
66319
|
+
userId: this._seriesUserId,
|
|
66320
|
+
specIndex: this._seriesIndex
|
|
66321
|
+
});
|
|
66267
66322
|
return data;
|
|
66268
66323
|
}
|
|
66269
66324
|
isSeriesDataEnable() {
|
|
@@ -66323,6 +66378,30 @@ class AxisComponent extends BaseComponent {
|
|
|
66323
66378
|
}
|
|
66324
66379
|
updateScaleDomain() {
|
|
66325
66380
|
}
|
|
66381
|
+
_hasCollectedSeriesData() {
|
|
66382
|
+
return this.collectData(0).length > 0;
|
|
66383
|
+
}
|
|
66384
|
+
_refreshVisibilityByData() {
|
|
66385
|
+
const nextVisible = this._specVisible && (!this._hideWhenEmpty || this._hasCollectedSeriesData());
|
|
66386
|
+
const changed = this._visible !== nextVisible;
|
|
66387
|
+
this._visible = nextVisible;
|
|
66388
|
+
if (this._axisMark || this._gridMark) {
|
|
66389
|
+
this._syncComponentVisibility();
|
|
66390
|
+
}
|
|
66391
|
+
if (changed) {
|
|
66392
|
+
this._forceLayout();
|
|
66393
|
+
}
|
|
66394
|
+
return changed;
|
|
66395
|
+
}
|
|
66396
|
+
_syncComponentVisibility() {
|
|
66397
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
66398
|
+
(_a = this._axisMark) === null || _a === void 0 ? void 0 : _a.setVisible(this._visible);
|
|
66399
|
+
(_b = this._gridMark) === null || _b === void 0 ? void 0 : _b.setVisible(this._visible && ((_c = this._spec.grid) === null || _c === void 0 ? void 0 : _c.visible) !== false);
|
|
66400
|
+
(_g = (_f = (_e = (_d = this._axisMark) === null || _d === void 0 ? void 0 : _d.getComponent) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.setAttributes) === null || _g === void 0 ? void 0 : _g.call(_f, { visibleAll: this._visible });
|
|
66401
|
+
(_l = (_k = (_j = (_h = this._gridMark) === null || _h === void 0 ? void 0 : _h.getComponent) === null || _j === void 0 ? void 0 : _j.call(_h)) === null || _k === void 0 ? void 0 : _k.setAttributes) === null || _l === void 0 ? void 0 : _l.call(_k, {
|
|
66402
|
+
visibleAll: this._visible && ((_m = this._spec.grid) === null || _m === void 0 ? void 0 : _m.visible) !== false
|
|
66403
|
+
});
|
|
66404
|
+
}
|
|
66326
66405
|
_clearRawDomain() {
|
|
66327
66406
|
}
|
|
66328
66407
|
onLayoutEnd() {
|
|
@@ -66784,6 +66863,10 @@ class CartesianAxis extends AxisComponent {
|
|
|
66784
66863
|
return padding;
|
|
66785
66864
|
};
|
|
66786
66865
|
this._updateAxisLayout = () => {
|
|
66866
|
+
if (!this._visible) {
|
|
66867
|
+
this._syncComponentVisibility();
|
|
66868
|
+
return;
|
|
66869
|
+
}
|
|
66787
66870
|
const startPoint = this.getLayoutStartPoint();
|
|
66788
66871
|
const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$e(_a, ["grid"]);
|
|
66789
66872
|
const axisAttrs = mergeSpec({ x: startPoint.x, y: startPoint.y }, this._axisStyle, updateAxisAttrs);
|
|
@@ -66791,6 +66874,7 @@ class CartesianAxis extends AxisComponent {
|
|
|
66791
66874
|
if (this._gridMark) {
|
|
66792
66875
|
this._gridMark.setSimpleStyle(mergeSpec({ x: startPoint.x, y: startPoint.y }, this._getGridAttributes(), updateGridAttrs));
|
|
66793
66876
|
}
|
|
66877
|
+
this._syncComponentVisibility();
|
|
66794
66878
|
};
|
|
66795
66879
|
this._fixAxisOnZero = () => {
|
|
66796
66880
|
const { onZero, visible } = this._spec.domainLine;
|
|
@@ -66957,7 +67041,7 @@ class CartesianAxis extends AxisComponent {
|
|
|
66957
67041
|
setAttrFromSpec() {
|
|
66958
67042
|
var _a;
|
|
66959
67043
|
super.setAttrFromSpec();
|
|
66960
|
-
if (this.
|
|
67044
|
+
if (this._specVisible) {
|
|
66961
67045
|
const isX = isXAxis(this.getOrient());
|
|
66962
67046
|
if (isX) {
|
|
66963
67047
|
if (isUndefined$1(this._spec.maxHeight)) {
|
|
@@ -67287,7 +67371,7 @@ class CartesianAxis extends AxisComponent {
|
|
|
67287
67371
|
}
|
|
67288
67372
|
initEvent() {
|
|
67289
67373
|
super.initEvent();
|
|
67290
|
-
if (this.
|
|
67374
|
+
if (this._specVisible) {
|
|
67291
67375
|
this.event.on(ChartEvent.layoutEnd, this._updateAxisLayout);
|
|
67292
67376
|
this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero);
|
|
67293
67377
|
this.event.on(ChartEvent.layoutRectUpdate, () => {
|
|
@@ -67806,6 +67890,7 @@ class LinearAxisMixin {
|
|
|
67806
67890
|
}
|
|
67807
67891
|
this._updateNiceLabelFormatter(domain);
|
|
67808
67892
|
this._domainAfterSpec = this._scale.domain();
|
|
67893
|
+
this._refreshVisibilityByData();
|
|
67809
67894
|
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
67810
67895
|
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'domain' });
|
|
67811
67896
|
}
|
|
@@ -68204,6 +68289,7 @@ class BandAxisMixin {
|
|
|
68204
68289
|
}
|
|
68205
68290
|
}
|
|
68206
68291
|
this.transformScaleDomain();
|
|
68292
|
+
this._refreshVisibilityByData();
|
|
68207
68293
|
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
68208
68294
|
this.event.emit(ChartEvent.scaleUpdate, { model: this, value: 'domain' });
|
|
68209
68295
|
}
|
|
@@ -78425,6 +78511,14 @@ class BasePieSeries extends PolarSeries {
|
|
|
78425
78511
|
this._labelMark = null;
|
|
78426
78512
|
this._labelLineMark = null;
|
|
78427
78513
|
this._emptyArcMark = null;
|
|
78514
|
+
this._pendingViewDataLabelUpdate = false;
|
|
78515
|
+
this.flushViewDataLabelUpdate = () => {
|
|
78516
|
+
if (!this._pendingViewDataLabelUpdate) {
|
|
78517
|
+
return;
|
|
78518
|
+
}
|
|
78519
|
+
this._pendingViewDataLabelUpdate = false;
|
|
78520
|
+
this._viewDataLabel.getDataView().reRunAllTransform();
|
|
78521
|
+
};
|
|
78428
78522
|
this.dataToCentralPosition = (datum) => {
|
|
78429
78523
|
const angle = datum[ARC_MIDDLE_ANGLE];
|
|
78430
78524
|
if (isNil$1(angle)) {
|
|
@@ -78600,12 +78694,13 @@ class BasePieSeries extends PolarSeries {
|
|
|
78600
78694
|
var _a;
|
|
78601
78695
|
super.initEvent();
|
|
78602
78696
|
(_a = this._viewDataLabel.getDataView()) === null || _a === void 0 ? void 0 : _a.target.addListener('change', this.viewDataLabelUpdate.bind(this));
|
|
78697
|
+
this.event.on(ChartEvent.afterRender, this.flushViewDataLabelUpdate);
|
|
78603
78698
|
}
|
|
78604
78699
|
initGroups() {
|
|
78605
78700
|
return;
|
|
78606
78701
|
}
|
|
78607
78702
|
onLayoutEnd() {
|
|
78608
|
-
this.
|
|
78703
|
+
this._pendingViewDataLabelUpdate = true;
|
|
78609
78704
|
this.onMarkPositionUpdate();
|
|
78610
78705
|
super.onLayoutEnd();
|
|
78611
78706
|
}
|
|
@@ -79009,7 +79104,7 @@ class PolarAxis extends AxisComponent {
|
|
|
79009
79104
|
}
|
|
79010
79105
|
setAttrFromSpec() {
|
|
79011
79106
|
super.setAttrFromSpec();
|
|
79012
|
-
if (this.
|
|
79107
|
+
if (this._specVisible) {
|
|
79013
79108
|
this._axisStyle = this._getAxisAttributes();
|
|
79014
79109
|
this._gridStyle = this._getGridAttributes();
|
|
79015
79110
|
}
|
|
@@ -95535,6 +95630,20 @@ const continuousLegendFilter = (data, op) => {
|
|
|
95535
95630
|
return data;
|
|
95536
95631
|
};
|
|
95537
95632
|
|
|
95633
|
+
function transformHandlerText(handlerText) {
|
|
95634
|
+
if (!handlerText) {
|
|
95635
|
+
return handlerText;
|
|
95636
|
+
}
|
|
95637
|
+
const nextHandlerText = Object.assign({}, handlerText);
|
|
95638
|
+
const handlerTextStyle = handlerText.style;
|
|
95639
|
+
if (isFunction$1(handlerTextStyle)) {
|
|
95640
|
+
nextHandlerText.style = (value, position, context) => transformToGraphic(handlerTextStyle(value, position, context));
|
|
95641
|
+
}
|
|
95642
|
+
else if (!isEmpty(handlerTextStyle)) {
|
|
95643
|
+
nextHandlerText.style = transformToGraphic(handlerTextStyle);
|
|
95644
|
+
}
|
|
95645
|
+
return nextHandlerText;
|
|
95646
|
+
}
|
|
95538
95647
|
function getContinuousLegendAttributes(spec) {
|
|
95539
95648
|
const _a = mergeSpec({}, spec), { title = {}, handler = {}, rail = {}, track = {}, startText, endText, handlerText, sizeBackground, background = {}, type, id, visible, orient, position, data, defaultSelected, field, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = _a, restSpec = __rest$e(_a, ["title", "handler", "rail", "track", "startText", "endText", "handlerText", "sizeBackground", "background", "type", "id", "visible", "orient", "position", "data", "defaultSelected", "field", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
|
|
95540
95649
|
const attrs = restSpec;
|
|
@@ -95562,7 +95671,7 @@ function getContinuousLegendAttributes(spec) {
|
|
|
95562
95671
|
}
|
|
95563
95672
|
attrs.startText = transformComponentStyle(startText);
|
|
95564
95673
|
attrs.endText = transformComponentStyle(endText);
|
|
95565
|
-
attrs.handlerText =
|
|
95674
|
+
attrs.handlerText = transformHandlerText(handlerText);
|
|
95566
95675
|
if (!isEmpty(sizeBackground)) {
|
|
95567
95676
|
attrs.sizeBackground = transformToGraphic(sizeBackground);
|
|
95568
95677
|
}
|