@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.
Files changed (102) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +178 -69
  3. package/build/index.js +178 -69
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/component/axis/base-axis.d.ts +9 -1
  7. package/cjs/component/axis/base-axis.js +37 -7
  8. package/cjs/component/axis/base-axis.js.map +1 -1
  9. package/cjs/component/axis/cartesian/axis.js +4 -3
  10. package/cjs/component/axis/cartesian/axis.js.map +1 -1
  11. package/cjs/component/axis/cartesian/interface/spec.d.ts +1 -0
  12. package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
  13. package/cjs/component/axis/mixin/band-axis-mixin.d.ts +1 -0
  14. package/cjs/component/axis/mixin/band-axis-mixin.js +1 -1
  15. package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
  16. package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +1 -0
  17. package/cjs/component/axis/mixin/linear-axis-mixin.js +1 -1
  18. package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  19. package/cjs/component/axis/polar/axis.js +1 -1
  20. package/cjs/component/axis/polar/axis.js.map +1 -1
  21. package/cjs/component/legend/continuous/interface.d.ts +5 -2
  22. package/cjs/component/legend/continuous/interface.js.map +1 -1
  23. package/cjs/component/legend/continuous/util.js +12 -4
  24. package/cjs/component/legend/continuous/util.js.map +1 -1
  25. package/cjs/constant/funnel.js +1 -1
  26. package/cjs/constant/gradient.js +1 -1
  27. package/cjs/constant/hierarchy.js +1 -1
  28. package/cjs/constant/label.js +1 -1
  29. package/cjs/constant/layout.js +1 -1
  30. package/cjs/constant/marker.js +1 -1
  31. package/cjs/constant/polar.js +1 -1
  32. package/cjs/constant/scatter.js +1 -1
  33. package/cjs/constant/scroll-bar.js +2 -1
  34. package/cjs/constant/sunburst.js +1 -1
  35. package/cjs/constant/waterfall.js +1 -1
  36. package/cjs/constant/word-cloud.js +1 -1
  37. package/cjs/core/interface.js +1 -1
  38. package/cjs/core/util.js +1 -1
  39. package/cjs/core/vchart.js +1 -1
  40. package/cjs/data/initialize.js +1 -1
  41. package/cjs/data/register.js +1 -1
  42. package/cjs/env/env.js +1 -1
  43. package/cjs/env/index.js +1 -1
  44. package/cjs/event/bubble.js +1 -1
  45. package/cjs/event/event-dispatcher.js +1 -1
  46. package/cjs/event/event.js +1 -1
  47. package/cjs/event/index.js +1 -1
  48. package/cjs/event/interface.js +1 -2
  49. package/cjs/mark/base/base-mark.js +2 -2
  50. package/cjs/mark/base/base-mark.js.map +1 -1
  51. package/cjs/series/pie/pie.d.ts +2 -0
  52. package/cjs/series/pie/pie.js +6 -4
  53. package/cjs/series/pie/pie.js.map +1 -1
  54. package/esm/component/axis/base-axis.d.ts +9 -1
  55. package/esm/component/axis/base-axis.js +37 -7
  56. package/esm/component/axis/base-axis.js.map +1 -1
  57. package/esm/component/axis/cartesian/axis.js +4 -3
  58. package/esm/component/axis/cartesian/axis.js.map +1 -1
  59. package/esm/component/axis/cartesian/interface/spec.d.ts +1 -0
  60. package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
  61. package/esm/component/axis/mixin/band-axis-mixin.d.ts +1 -0
  62. package/esm/component/axis/mixin/band-axis-mixin.js +1 -1
  63. package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
  64. package/esm/component/axis/mixin/linear-axis-mixin.d.ts +1 -0
  65. package/esm/component/axis/mixin/linear-axis-mixin.js +1 -1
  66. package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
  67. package/esm/component/axis/polar/axis.js +1 -1
  68. package/esm/component/axis/polar/axis.js.map +1 -1
  69. package/esm/component/legend/continuous/interface.d.ts +5 -2
  70. package/esm/component/legend/continuous/interface.js.map +1 -1
  71. package/esm/component/legend/continuous/util.js +9 -2
  72. package/esm/component/legend/continuous/util.js.map +1 -1
  73. package/esm/constant/funnel.js +1 -1
  74. package/esm/constant/gradient.js +1 -1
  75. package/esm/constant/hierarchy.js +1 -1
  76. package/esm/constant/label.js +1 -1
  77. package/esm/constant/layout.js +1 -1
  78. package/esm/constant/marker.js +1 -1
  79. package/esm/constant/polar.js +1 -1
  80. package/esm/constant/scatter.js +1 -1
  81. package/esm/constant/scroll-bar.js +2 -1
  82. package/esm/constant/sunburst.js +1 -1
  83. package/esm/constant/waterfall.js +1 -1
  84. package/esm/constant/word-cloud.js +1 -1
  85. package/esm/core/interface.js +1 -1
  86. package/esm/core/util.js +1 -1
  87. package/esm/core/vchart.js +1 -1
  88. package/esm/data/initialize.js +1 -1
  89. package/esm/data/register.js +1 -1
  90. package/esm/env/env.js +1 -1
  91. package/esm/env/index.js +1 -1
  92. package/esm/event/bubble.js +1 -1
  93. package/esm/event/event-dispatcher.js +1 -1
  94. package/esm/event/event.js +1 -1
  95. package/esm/event/index.js +1 -1
  96. package/esm/event/interface.js +1 -2
  97. package/esm/mark/base/base-mark.js +3 -2
  98. package/esm/mark/base/base-mark.js.map +1 -1
  99. package/esm/series/pie/pie.d.ts +2 -0
  100. package/esm/series/pie/pie.js +7 -4
  101. package/esm/series/pie/pie.js.map +1 -1
  102. 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
- foregroundColor = label.attribute.fill;
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
- const stroke = smartInvertStrategy(strokeStrategy, backgroundColor, invertColor, similarColor);
44090
- stroke && label.setAttributes({
44091
- stroke: stroke
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
- var _a, _b, _c;
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 === (_c = handlerText.style) || void 0 === _c ? void 0 : _c.lineHeight,
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
- handlerText = {}
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
- handlerText: handlerTextAttr = {}
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._visible = (_a = spec.visible) !== null && _a !== void 0 ? _a : true;
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._visible) {
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
- eachSeries(this._regions, s => {
66234
- var _a;
66235
- let field = this.collectSeriesField(depth, s);
66236
- field = (isArray$1(field) ? (isContinuous(this._scale.type) ? field : [field[0]]) : [field]);
66237
- if (!depth) {
66238
- this._dataFieldText = s.getFieldAlias(field[0]);
66239
- }
66240
- if (field) {
66241
- const viewData = s.getViewData();
66242
- if (rawData) {
66243
- field.forEach(f => {
66244
- data.push(s.getRawDataStatisticsByField(f, !!isContinuous(this._scale.type)));
66245
- });
66246
- }
66247
- else if (viewData && viewData.latestData && viewData.latestData.length) {
66248
- const seriesData = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s);
66249
- const userSetBreaks = this.type === ComponentTypeEnum.cartesianLinearAxis && this._spec.breaks && this._spec.breaks.length;
66250
- field.forEach(f => {
66251
- var _a;
66252
- if ((_a = seriesData === null || seriesData === void 0 ? void 0 : seriesData.latestData) === null || _a === void 0 ? void 0 : _a[f]) {
66253
- if (userSetBreaks) {
66254
- data.push(Object.assign(Object.assign({}, seriesData.latestData[f]), { values: viewData.latestData.map((obj) => obj[f]) }));
66255
- }
66256
- else {
66257
- data.push(seriesData.latestData[f]);
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
- userId: this._seriesUserId,
66265
- specIndex: this._seriesIndex
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.visible) {
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.visible) {
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._viewDataLabel.getDataView().reRunAllTransform();
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.visible) {
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 = transformComponentStyle(handlerText);
95674
+ attrs.handlerText = transformHandlerText(handlerText);
95566
95675
  if (!isEmpty(sizeBackground)) {
95567
95676
  attrs.sizeBackground = transformToGraphic(sizeBackground);
95568
95677
  }