@visactor/react-vchart 2.0.20-alpha.2 → 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/index.js CHANGED
@@ -20641,9 +20641,10 @@
20641
20641
  }), context.highPerformanceRestore(), context.setTransformForCurrent();
20642
20642
  } else {
20643
20643
  const {
20644
- backgroundCornerRadius: backgroundCornerRadius
20644
+ backgroundCornerRadius: backgroundCornerRadius,
20645
+ backgroundOpacity = 1
20645
20646
  } = graphic.attribute;
20646
- 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();
20647
+ 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();
20647
20648
  }
20648
20649
  shouldReCalBounds && boundsAllocate.free(b), restore();
20649
20650
  }
@@ -37417,8 +37418,9 @@
37417
37418
  const label = labels[i];
37418
37419
  if (!label) continue;
37419
37420
  const baseMark = this.getRelatedGraphic(label.attribute);
37420
- let backgroundColor = baseMark.getAttributes(!0).fill,
37421
- foregroundColor = label.attribute.fill;
37421
+ let backgroundColor = baseMark.getAttributes(!0).fill;
37422
+ const backgroundOpacity = baseMark.getAttributes(!0).fillOpacity;
37423
+ let foregroundColor = label.attribute.fill;
37422
37424
  if (isObject$2(backgroundColor) && backgroundColor.gradient) {
37423
37425
  const firstStopColor = null === (_g = null === (_f = backgroundColor.stops) || void 0 === _f ? void 0 : _f[0]) || void 0 === _g ? void 0 : _g.color;
37424
37426
  firstStopColor && (backgroundColor = firstStopColor, foregroundColor = firstStopColor);
@@ -37432,11 +37434,26 @@
37432
37434
  if (fill && label.setAttributes({
37433
37435
  fill: fill
37434
37436
  }), 0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
37435
- const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
37436
- stroke && label.setAttributes({
37437
- stroke: stroke
37438
- });
37437
+ if ("background" === interactInvertType) label.setAttributes({
37438
+ stroke: !1
37439
+ });else {
37440
+ const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
37441
+ stroke && label.setAttributes({
37442
+ stroke: stroke
37443
+ });
37444
+ }
37439
37445
  } else if (isIntersect && "none" !== interactInvertType) {
37446
+ if ("background" === interactInvertType) {
37447
+ const fill = smartInvertStrategy(fillStrategy, backgroundColor, invertColor, similarColor);
37448
+ fill && label.setAttributes({
37449
+ fill: fill
37450
+ }), label.setAttributes({
37451
+ stroke: !1,
37452
+ background: backgroundColor,
37453
+ backgroundOpacity: backgroundOpacity
37454
+ });
37455
+ continue;
37456
+ }
37440
37457
  if (0 === label.attribute.lineWidth || 0 === label.attribute.strokeOpacity) continue;
37441
37458
  if (label.attribute.stroke) {
37442
37459
  label.setAttributes({
@@ -37453,6 +37470,9 @@
37453
37470
  stroke: stroke
37454
37471
  });
37455
37472
  }
37473
+ !1 === isInside && "background" === interactInvertType && label.setAttributes({
37474
+ background: null
37475
+ });
37456
37476
  }
37457
37477
  }
37458
37478
  _canPlaceInside(textBound, shapeBound) {
@@ -42996,7 +43016,31 @@
42996
43016
  return graphicCreator.symbol(style);
42997
43017
  }
42998
43018
  _renderHandlerText(value, position) {
42999
- var _a, _b, _c;
43019
+ return graphicCreator.text(this._getHandlerTextAttributes(value, position));
43020
+ }
43021
+ _getHandlerPosition(isStart) {
43022
+ return this.attribute.range && isStart ? "start" : "end";
43023
+ }
43024
+ _getHandlerTextStyle(value, position) {
43025
+ const {
43026
+ align: align,
43027
+ handlerSize = 14,
43028
+ handlerText = {},
43029
+ railHeight: railHeight,
43030
+ railWidth: railWidth,
43031
+ slidable: slidable
43032
+ } = this.attribute;
43033
+ return isFunction$1(handlerText.style) ? handlerText.style(value, position, {
43034
+ layout: this.attribute.layout,
43035
+ align: align,
43036
+ railWidth: railWidth,
43037
+ railHeight: railHeight,
43038
+ handlerSize: handlerSize,
43039
+ slidable: slidable
43040
+ }) : handlerText.style;
43041
+ }
43042
+ _getHandlerTextAttributes(value, position) {
43043
+ var _a, _b;
43000
43044
  const {
43001
43045
  align: align,
43002
43046
  handlerSize = 14,
@@ -43008,13 +43052,13 @@
43008
43052
  isHorizontal = this._isHorizontal,
43009
43053
  pos = this.calculatePosByValue(value, position),
43010
43054
  textSpace = null !== (_a = handlerText.space) && void 0 !== _a ? _a : 4,
43055
+ handlerTextStyle = this._getHandlerTextStyle(value, position),
43011
43056
  textStyle = {
43012
43057
  text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed(null !== (_b = handlerText.precision) && void 0 !== _b ? _b : 0),
43013
- lineHeight: null === (_c = handlerText.style) || void 0 === _c ? void 0 : _c.lineHeight,
43058
+ lineHeight: null == handlerTextStyle ? void 0 : handlerTextStyle.lineHeight,
43014
43059
  cursor: !1 === slidable ? "default" : getDefaultCursor(isHorizontal)
43015
43060
  };
43016
- 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);
43017
- return graphicCreator.text(Object.assign(Object.assign({}, textStyle), handlerText.style));
43061
+ 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);
43018
43062
  }
43019
43063
  _renderTooltip() {
43020
43064
  var _a;
@@ -43142,31 +43186,19 @@
43142
43186
  }
43143
43187
  }
43144
43188
  _updateHandler(handler, position, value) {
43145
- var _a;
43146
43189
  const isHorizontal = this._isHorizontal;
43147
43190
  handler.setAttribute(isHorizontal ? "x" : "y", position);
43148
43191
  const updateHandlerText = handler.name === SLIDER_ELEMENT_NAME.startHandler ? this._startHandlerText : this._endHandlerText;
43149
43192
  if (updateHandlerText) {
43150
- const {
43151
- handlerText = {}
43152
- } = this.attribute;
43153
- updateHandlerText.setAttributes({
43154
- text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed(null !== (_a = handlerText.precision) && void 0 !== _a ? _a : 0),
43155
- [isHorizontal ? "x" : "y"]: position
43156
- });
43193
+ const handlerPosition = this._getHandlerPosition(handler.name === SLIDER_ELEMENT_NAME.startHandler);
43194
+ updateHandlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
43157
43195
  }
43158
43196
  handler.name === SLIDER_ELEMENT_NAME.startHandler ? (this._currentValue.startValue = value, this._currentValue.startPos = position) : (this._currentValue.endValue = value, this._currentValue.endPos = position);
43159
43197
  }
43160
43198
  _updateHandlerText(handlerText, position, value) {
43161
- var _a;
43162
43199
  const isHorizontal = this._isHorizontal,
43163
- {
43164
- handlerText: handlerTextAttr = {}
43165
- } = this.attribute;
43166
- handlerText.setAttributes({
43167
- [isHorizontal ? "x" : "y"]: position,
43168
- text: handlerTextAttr.formatter ? handlerTextAttr.formatter(value) : value.toFixed(null !== (_a = handlerTextAttr.precision) && void 0 !== _a ? _a : 0)
43169
- });
43200
+ handlerPosition = this._getHandlerPosition(handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText);
43201
+ handlerText.setAttributes(this._getHandlerTextAttributes(value, handlerPosition));
43170
43202
  const updateHandler = handlerText.name === SLIDER_ELEMENT_NAME.startHandlerText ? this._startHandler : this._endHandler;
43171
43203
  updateHandler && updateHandler.setAttributes({
43172
43204
  [isHorizontal ? "x" : "y"]: position
@@ -47252,24 +47284,11 @@
47252
47284
  updateLayoutTag() {
47253
47285
  this._layoutState = LayoutState.before;
47254
47286
  }
47255
- _isGeoRegionRoamDragEnabled() {
47256
- var _a, _b;
47257
- const chartSpec = null === (_b = null === (_a = this._compileChart) || void 0 === _a ? void 0 : _a.getSpec) || void 0 === _b ? void 0 : _b.call(_a),
47258
- regions = null == chartSpec ? void 0 : chartSpec.region;
47259
- return !!isArray$1(regions) && regions.some(region => {
47260
- var _a;
47261
- return !("geo" !== (null == region ? void 0 : region.coordinate) || !region.roam) && (!0 === region.roam || null === (_a = region.roam.drag) || void 0 === _a || _a);
47262
- });
47263
- }
47264
- _shouldDisableCanvasTouchAction() {
47265
- if (!isTrueBrowser(this._option.mode)) return !1;
47266
- return !1 === (isValid$1(this._option.supportsTouchEvents) ? this._option.supportsTouchEvents : vglobal.supportsTouchEvents) && this._isGeoRegionRoamDragEnabled();
47267
- }
47268
47287
  _setCanvasStyle() {
47269
47288
  if (this._stage && this._container.dom && !isString$1(this._container.dom)) {
47270
47289
  this._container.dom.style.display = "block", this._container.dom.style.position = "relative";
47271
47290
  const canvas = this.getCanvas();
47272
- canvas && (canvas.style.display = "block", canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? "none" : "");
47291
+ canvas && (canvas.style.display = "block");
47273
47292
  }
47274
47293
  }
47275
47294
  compile(ctx, option) {
@@ -47277,7 +47296,7 @@
47277
47296
  const {
47278
47297
  chart: chart
47279
47298
  } = ctx;
47280
- this._compileChart = chart, this.initView(), this._stage && ("render" !== (null == option ? void 0 : option.actionSource) && this._cachedMarks && (this.reuseOrMorphing(option.morphConfig), this._cachedMarks = null), chart.compile(), this._setCanvasStyle(), chart.afterCompile());
47299
+ this._compileChart = chart, this.initView(), this._stage && ("render" !== (null == option ? void 0 : option.actionSource) && this._cachedMarks && (this.reuseOrMorphing(option.morphConfig), this._cachedMarks = null), chart.compile(), chart.afterCompile());
47281
47300
  }
47282
47301
  clearNextRender() {
47283
47302
  return !!this._nextRafId && (vglobal.getSpecifiedCancelAnimationFrame(10)(this._nextRafId), this._nextRafId = null, !0);
@@ -49166,6 +49185,9 @@
49166
49185
  });
49167
49186
  });
49168
49187
  }
49188
+ clearAllStateInfo() {
49189
+ this._stateInfoList = [];
49190
+ }
49169
49191
  _isMultiMark() {
49170
49192
  return !this._mark || isMultiDatumMark(this._mark.type);
49171
49193
  }
@@ -49868,7 +49890,9 @@
49868
49890
  this._lastMark = mark;
49869
49891
  }
49870
49892
  reuse(mark) {
49871
- this.type === mark.type && (this._product = mark.getProduct(), this._graphics = mark.getGraphics(), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49893
+ this.type === mark.type && (this._product = mark.getProduct(), this._product.clearStates(), this._graphics = mark.getGraphics(), this._graphics.forEach(g => {
49894
+ g.clearStates();
49895
+ }), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49872
49896
  g.context = Object.assign(Object.assign({}, g.context), this._getCommonContext());
49873
49897
  }), this._dataByKey = mark._dataByKey, this._prevDataByKey = mark._prevDataByKey, this.needClear = mark.needClear);
49874
49898
  }
@@ -50173,7 +50197,7 @@
50173
50197
  (null === (_c = this.renderContext) || void 0 === _c ? void 0 : _c.progressive) ? (this._graphicMap.clear(), this._runProgressiveStep()) : (this._runJoin(markData), this._runState(this._graphics), this._runEncoder(this._graphics), this._runEncoderTransform(this._graphics, !1), this._runApplyGraphic(this._graphics)), this._updateAttrsOfGroup();
50174
50198
  }
50175
50199
  render() {
50176
- this.isCommited() && (!this.getVisible() || this._skipBeforeLayouted && this.getCompiler().getLayoutState() === LayoutState.before || (log(`render mark: ${this.getProductId()}, type is ${this.type}`), this.renderInner()), this.uncommit());
50200
+ this.isCommited() && (!this.getVisible() || this._skipBeforeLayouted && this.getCompiler().getLayoutState() === LayoutState.before || (this._product || this._initProduct(), log(`render mark: ${this.getProductId()}, type is ${this.type}`), this.renderInner()), this.uncommit());
50177
50201
  }
50178
50202
  updateMarkState(key) {
50179
50203
  if (!this._product) return;
@@ -50314,6 +50338,11 @@
50314
50338
  runAnimation() {
50315
50339
  this._runStateAnimation(this.getGraphics());
50316
50340
  }
50341
+ clearBeforeReInit() {
50342
+ this.state.clearAllStateInfo(), this.uncommit(), this.stateStyle = {}, this.getGraphics().forEach(g => {
50343
+ g.clearStates();
50344
+ });
50345
+ }
50317
50346
  }
50318
50347
 
50319
50348
  class GroupMark extends BaseMark {
@@ -53045,7 +53074,7 @@
53045
53074
  super.reInit(spec);
53046
53075
  const marks = this.getMarksWithoutRoot();
53047
53076
  marks.forEach(mark => {
53048
- this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53077
+ mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53049
53078
  }), this.initMarkStyle(), marks.forEach(mark => {
53050
53079
  mark.commit(!1);
53051
53080
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();
@@ -54924,6 +54953,9 @@
54924
54953
  getTickData(index = 0) {
54925
54954
  return this._tickData[index];
54926
54955
  }
54956
+ getVisible() {
54957
+ return this._visible;
54958
+ }
54927
54959
  get visible() {
54928
54960
  return this._visible;
54929
54961
  }
@@ -54934,10 +54966,14 @@
54934
54966
  return this._coordinateType;
54935
54967
  }
54936
54968
  constructor(spec, options) {
54937
- var _a;
54938
- super(spec, options), this.specKey = "axes", this._scales = [], this._tickData = [], this._visible = !0, this._tick = void 0, this._onTickDataChange = tickData => {
54969
+ var _a, _b;
54970
+ super(spec, options), this.specKey = "axes", this._scales = [], this._tickData = [], this._visible = !0, this._specVisible = !0, this._hideWhenEmpty = !1, this._tick = void 0, this._onTickDataChange = tickData => {
54939
54971
  this._forceLayout(), null == tickData || tickData.updateData();
54940
- }, this._visible = null === (_a = spec.visible) || void 0 === _a || _a, this._coordinateType = "none";
54972
+ }, this._specVisible = null === (_a = spec.visible) || void 0 === _a || _a, this._hideWhenEmpty = null !== (_b = spec.hideWhenEmpty) && void 0 !== _b && _b, this._visible = this._specVisible, this._coordinateType = "none";
54973
+ }
54974
+ setAttrFromSpec() {
54975
+ var _a, _b;
54976
+ super.setAttrFromSpec(), this._specVisible = null === (_a = this._spec.visible) || void 0 === _a || _a, this._hideWhenEmpty = null !== (_b = this._spec.hideWhenEmpty) && void 0 !== _b && _b, this._visible = this._specVisible, this._scale && this._refreshVisibilityByData();
54941
54977
  }
54942
54978
  getVRenderComponents() {
54943
54979
  var _a, _b;
@@ -54945,7 +54981,7 @@
54945
54981
  }
54946
54982
  created() {
54947
54983
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
54948
- if (super.created(), this.setSeriesAndRegionsFromSpec(), this.initEvent(), this.initScales(), this.updateSeriesScale(), this._shouldComputeTickData() && this._initData(), this._visible) {
54984
+ if (super.created(), this.setSeriesAndRegionsFromSpec(), this.initEvent(), this.initScales(), this.updateSeriesScale(), this._refreshVisibilityByData(), this._shouldComputeTickData() && this._initData(), this._specVisible) {
54949
54985
  const axisMark = this._createMark({
54950
54986
  type: "component",
54951
54987
  name: `axis-${this.getOrient()}`
@@ -54974,7 +55010,7 @@
54974
55010
  interactive: !1
54975
55011
  }), this._marks.addMark(gridMark), this._gridMark = gridMark;
54976
55012
  }
54977
- if ((null === (_h = this._option.globalInstance) || void 0 === _h ? void 0 : _h.isAnimationEnable()) && !1 !== get$1(this._option.getChart().getSpec(), "animation") && !0 === this._spec.animation) {
55013
+ if (this._syncComponentVisibility(), (null === (_h = this._option.globalInstance) || void 0 === _h ? void 0 : _h.isAnimationEnable()) && !1 !== get$1(this._option.getChart().getSpec(), "animation") && !0 === this._spec.animation) {
54978
55014
  const axisAnimateConfig = animationConfig(null === (_j = Factory.getAnimationInKey("axis")) || void 0 === _j ? void 0 : _j(), {
54979
55015
  appear: null !== (_l = null !== (_k = this._spec.animationAppear) && void 0 !== _k ? _k : get$1(this._option.getChart().getSpec(), "animationAppear.axis")) && void 0 !== _l ? _l : get$1(this._option.getChart().getSpec(), "animationAppear"),
54980
55016
  disappear: null !== (_o = null !== (_m = this._spec.animationDisappear) && void 0 !== _m ? _m : get$1(this._option.getChart().getSpec(), "animationDisappear.axis")) && void 0 !== _o ? _o : get$1(this._option.getChart().getSpec(), "animationDisappear"),
@@ -54989,7 +55025,7 @@
54989
55025
  }
54990
55026
  }
54991
55027
  _shouldComputeTickData() {
54992
- return this.getVisible() || this._spec.forceInitTick;
55028
+ return this._specVisible && (this.getVisible() || this._spec.forceInitTick || this._hideWhenEmpty);
54993
55029
  }
54994
55030
  _initData() {
54995
55031
  const tickData = this._initTickDataSet(this._tickTransformOption()),
@@ -55000,7 +55036,7 @@
55000
55036
  }
55001
55037
  collectData(depth, rawData) {
55002
55038
  const data = [];
55003
- return eachSeries(this._regions, s => {
55039
+ return this._regions && eachSeries(this._regions, s => {
55004
55040
  var _a;
55005
55041
  let field = this.collectSeriesField(depth, s);
55006
55042
  if (field = isArray$1(field) ? isContinuous(this._scale.type) ? field : [field[0]] : [field], depth || (this._dataFieldText = s.getFieldAlias(field[0])), field) {
@@ -55076,6 +55112,22 @@
55076
55112
  });
55077
55113
  }
55078
55114
  updateScaleDomain() {}
55115
+ _hasCollectedSeriesData() {
55116
+ return this.collectData(0).length > 0;
55117
+ }
55118
+ _refreshVisibilityByData() {
55119
+ const nextVisible = this._specVisible && (!this._hideWhenEmpty || this._hasCollectedSeriesData()),
55120
+ changed = this._visible !== nextVisible;
55121
+ return this._visible = nextVisible, (this._axisMark || this._gridMark) && this._syncComponentVisibility(), changed && this._forceLayout(), changed;
55122
+ }
55123
+ _syncComponentVisibility() {
55124
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
55125
+ null === (_a = this._axisMark) || void 0 === _a || _a.setVisible(this._visible), null === (_b = this._gridMark) || void 0 === _b || _b.setVisible(this._visible && !1 !== (null === (_c = this._spec.grid) || void 0 === _c ? void 0 : _c.visible)), null === (_g = null === (_f = null === (_e = null === (_d = this._axisMark) || void 0 === _d ? void 0 : _d.getComponent) || void 0 === _e ? void 0 : _e.call(_d)) || void 0 === _f ? void 0 : _f.setAttributes) || void 0 === _g || _g.call(_f, {
55126
+ visibleAll: this._visible
55127
+ }), null === (_l = null === (_k = null === (_j = null === (_h = this._gridMark) || void 0 === _h ? void 0 : _h.getComponent) || void 0 === _j ? void 0 : _j.call(_h)) || void 0 === _k ? void 0 : _k.setAttributes) || void 0 === _l || _l.call(_k, {
55128
+ visibleAll: this._visible && !1 !== (null === (_m = this._spec.grid) || void 0 === _m ? void 0 : _m.visible)
55129
+ });
55130
+ }
55079
55131
  _clearRawDomain() {}
55080
55132
  onLayoutEnd() {
55081
55133
  this.updateScaleRange();
@@ -55424,6 +55476,7 @@
55424
55476
  }
55425
55477
  return result.width = Math.ceil(result.width), result.height = Math.ceil(result.height), this._layout.setRectInSpec(this._layoutCacheProcessing(result));
55426
55478
  }, this._transformLayoutPadding = padding => ("left" === this.layoutOrient || "right" === this.layoutOrient ? (padding.top = 0, padding.bottom = 0) : "top" !== this.layoutOrient && "bottom" !== this.layoutOrient || (padding.left = 0, padding.right = 0), padding), this._updateAxisLayout = () => {
55479
+ if (!this._visible) return void this._syncComponentVisibility();
55427
55480
  const startPoint = this.getLayoutStartPoint(),
55428
55481
  _a = this._getUpdateAttribute(!1),
55429
55482
  {
@@ -55437,7 +55490,7 @@
55437
55490
  this._axisMark.setSimpleStyle(axisAttrs), this._gridMark && this._gridMark.setSimpleStyle(mergeSpec({
55438
55491
  x: startPoint.x,
55439
55492
  y: startPoint.y
55440
- }, this._getGridAttributes(), updateGridAttrs));
55493
+ }, this._getGridAttributes(), updateGridAttrs)), this._syncComponentVisibility();
55441
55494
  }, this._fixAxisOnZero = () => {
55442
55495
  const {
55443
55496
  onZero: onZero,
@@ -55565,7 +55618,7 @@
55565
55618
  }
55566
55619
  setAttrFromSpec() {
55567
55620
  var _a;
55568
- if (super.setAttrFromSpec(), this.visible) {
55621
+ if (super.setAttrFromSpec(), this._specVisible) {
55569
55622
  isXAxis(this.getOrient()) ? isUndefined$1(this._spec.maxHeight) && (this._spec.maxHeight = "30%") : isUndefined$1(this._spec.maxWidth) && (this._spec.maxWidth = "30%");
55570
55623
  const axisStyle = this._getAxisAttributes();
55571
55624
  axisStyle.label.formatMethod = this._getLabelFormatMethod(), axisStyle.verticalFactor = "top" === this.getOrient() || "right" === this.getOrient() ? -1 : 1, this._axisStyle = axisStyle;
@@ -55790,7 +55843,7 @@
55790
55843
  })] : [];
55791
55844
  }
55792
55845
  initEvent() {
55793
- super.initEvent(), this.visible && (this.event.on(ChartEvent.layoutEnd, this._updateAxisLayout), this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero), this.event.on(ChartEvent.layoutRectUpdate, () => {
55846
+ super.initEvent(), this._specVisible && (this.event.on(ChartEvent.layoutEnd, this._updateAxisLayout), this.event.on(ChartEvent.layoutEnd, this._fixAxisOnZero), this.event.on(ChartEvent.layoutRectUpdate, () => {
55794
55847
  this._clearLayoutCache();
55795
55848
  }));
55796
55849
  }
@@ -56128,7 +56181,7 @@
56128
56181
  if (domain = null != domain ? domain : this._scale.domain(), this.extendDomain(domain), this.includeZero(domain), this.setDomainMinMax(domain), this.niceDomain(domain), this._scale.domain(domain, this._nice), this._nice) {
56129
56182
  !this.setScaleNice() && this._scale.rescale();
56130
56183
  }
56131
- this._updateNiceLabelFormatter(domain), this._domainAfterSpec = this._scale.domain(), this.event.emit(ChartEvent.scaleDomainUpdate, {
56184
+ this._updateNiceLabelFormatter(domain), this._domainAfterSpec = this._scale.domain(), this._refreshVisibilityByData(), this.event.emit(ChartEvent.scaleDomainUpdate, {
56132
56185
  model: this
56133
56186
  }), this.event.emit(ChartEvent.scaleUpdate, {
56134
56187
  model: this,
@@ -56517,7 +56570,7 @@
56517
56570
  domain = this.computeBandDomain(data);
56518
56571
  this._scales[i].domain(domain.sort((a, b) => this._rawDomainIndex[i][a] - this._rawDomainIndex[i][b]));
56519
56572
  }
56520
- this.transformScaleDomain(), this.event.emit(ChartEvent.scaleDomainUpdate, {
56573
+ this.transformScaleDomain(), this._refreshVisibilityByData(), this.event.emit(ChartEvent.scaleDomainUpdate, {
56521
56574
  model: this
56522
56575
  }), this.event.emit(ChartEvent.scaleUpdate, {
56523
56576
  model: this,
@@ -63875,7 +63928,9 @@
63875
63928
  x: calcLayoutNumber(null === (_a = this._spec) || void 0 === _a ? void 0 : _a.centerX, layoutRect.width, layoutRect, layoutRect.width / 2),
63876
63929
  y: calcLayoutNumber(null === (_b = this._spec) || void 0 === _b ? void 0 : _b.centerY, layoutRect.height, layoutRect, layoutRect.height / 2)
63877
63930
  };
63878
- }, this._startAngle = POLAR_START_RADIAN, this._endAngle = POLAR_END_RADIAN, this._pieMark = null, this._labelMark = null, this._labelLineMark = null, this._emptyArcMark = null, this.dataToCentralPosition = datum => {
63931
+ }, this._startAngle = POLAR_START_RADIAN, this._endAngle = POLAR_END_RADIAN, this._pieMark = null, this._labelMark = null, this._labelLineMark = null, this._emptyArcMark = null, this._pendingViewDataLabelUpdate = !1, this.flushViewDataLabelUpdate = () => {
63932
+ this._pendingViewDataLabelUpdate && (this._pendingViewDataLabelUpdate = !1, this._viewDataLabel.getDataView().reRunAllTransform());
63933
+ }, this.dataToCentralPosition = datum => {
63879
63934
  const angle = datum[ARC_MIDDLE_ANGLE];
63880
63935
  if (isNil$1(angle)) return null;
63881
63936
  const radius = this.computeDatumRadius(datum),
@@ -64009,11 +64064,11 @@
64009
64064
  }
64010
64065
  initEvent() {
64011
64066
  var _a;
64012
- super.initEvent(), null === (_a = this._viewDataLabel.getDataView()) || void 0 === _a || _a.target.addListener("change", this.viewDataLabelUpdate.bind(this));
64067
+ super.initEvent(), null === (_a = this._viewDataLabel.getDataView()) || void 0 === _a || _a.target.addListener("change", this.viewDataLabelUpdate.bind(this)), this.event.on(ChartEvent.afterRender, this.flushViewDataLabelUpdate);
64013
64068
  }
64014
64069
  initGroups() {}
64015
64070
  onLayoutEnd() {
64016
- this._viewDataLabel.getDataView().reRunAllTransform(), this.onMarkPositionUpdate(), super.onLayoutEnd();
64071
+ this._pendingViewDataLabelUpdate = !0, this.onMarkPositionUpdate(), super.onLayoutEnd();
64017
64072
  }
64018
64073
  getDimensionField() {
64019
64074
  return this._seriesField ? [this._seriesField] : [];
@@ -64333,7 +64388,7 @@
64333
64388
  }, this.getRefLayoutRect = () => this.getRegions()[0].getLayoutRect(), this._coordinateType = "polar";
64334
64389
  }
64335
64390
  setAttrFromSpec() {
64336
- super.setAttrFromSpec(), this.visible && (this._axisStyle = this._getAxisAttributes(), this._gridStyle = this._getGridAttributes()), this._tick = this._spec.tick, this._orient = "angle" === this._spec.orient ? "angle" : "radius", this._center = this._spec.center, this._startAngle = degreeToRadian(this._spec.startAngle), this._endAngle = degreeToRadian(this._spec.endAngle), this._inverse = this._spec.inverse;
64391
+ super.setAttrFromSpec(), this._specVisible && (this._axisStyle = this._getAxisAttributes(), this._gridStyle = this._getGridAttributes()), this._tick = this._spec.tick, this._orient = "angle" === this._spec.orient ? "angle" : "radius", this._center = this._spec.center, this._startAngle = degreeToRadian(this._spec.startAngle), this._endAngle = degreeToRadian(this._spec.endAngle), this._inverse = this._spec.inverse;
64337
64392
  }
64338
64393
  _tickTransformOption() {
64339
64394
  var _a;
@@ -77153,6 +77208,12 @@
77153
77208
  }
77154
77209
  return t;
77155
77210
  };
77211
+ function transformHandlerText(handlerText) {
77212
+ if (!handlerText) return handlerText;
77213
+ const nextHandlerText = Object.assign({}, handlerText),
77214
+ handlerTextStyle = handlerText.style;
77215
+ return isFunction$1(handlerTextStyle) ? nextHandlerText.style = (value, position, context) => transformToGraphic(handlerTextStyle(value, position, context)) : isEmpty(handlerTextStyle) || (nextHandlerText.style = transformToGraphic(handlerTextStyle)), nextHandlerText;
77216
+ }
77156
77217
  function getContinuousLegendAttributes(spec) {
77157
77218
  const _a = mergeSpec({}, spec),
77158
77219
  {
@@ -77183,7 +77244,7 @@
77183
77244
  attrs = __rest$6(_a, ["title", "handler", "rail", "track", "startText", "endText", "handlerText", "sizeBackground", "background", "type", "id", "visible", "orient", "position", "data", "defaultSelected", "field", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
77184
77245
  return title.visible ? attrs.title = transformLegendTitleAttributes(title) : attrs.title = {
77185
77246
  visible: !1
77186
- }, attrs.showHandler = !1 !== handler.visible, isEmpty(handler.style) || (attrs.handlerStyle = transformToGraphic(handler.style)), isValid$1(rail.width) && (attrs.railWidth = rail.width), isValid$1(rail.height) && (attrs.railHeight = rail.height), isEmpty(rail.style) || (attrs.railStyle = transformToGraphic(rail.style)), isEmpty(track.style) || (attrs.trackStyle = transformToGraphic(track.style)), attrs.startText = transformComponentStyle(startText), attrs.endText = transformComponentStyle(endText), attrs.handlerText = transformComponentStyle(handlerText), isEmpty(sizeBackground) || (attrs.sizeBackground = transformToGraphic(sizeBackground)), background.visible && !isEmpty(background.style) && (mergeSpec(attrs, background.style), isValid$1(background.padding) && (attrs.padding = background.padding)), attrs;
77247
+ }, attrs.showHandler = !1 !== handler.visible, isEmpty(handler.style) || (attrs.handlerStyle = transformToGraphic(handler.style)), isValid$1(rail.width) && (attrs.railWidth = rail.width), isValid$1(rail.height) && (attrs.railHeight = rail.height), isEmpty(rail.style) || (attrs.railStyle = transformToGraphic(rail.style)), isEmpty(track.style) || (attrs.trackStyle = transformToGraphic(track.style)), attrs.startText = transformComponentStyle(startText), attrs.endText = transformComponentStyle(endText), attrs.handlerText = transformHandlerText(handlerText), isEmpty(sizeBackground) || (attrs.sizeBackground = transformToGraphic(sizeBackground)), background.visible && !isEmpty(background.style) && (mergeSpec(attrs, background.style), isValid$1(background.padding) && (attrs.padding = background.padding)), attrs;
77187
77248
  }
77188
77249
  function isContinuousLegend(type) {
77189
77250
  return "color" === type || "size" === type;