@visactor/react-vchart 2.0.19 → 2.0.20-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -49153,6 +49153,9 @@
49153
49153
  });
49154
49154
  });
49155
49155
  }
49156
+ clearAllStateInfo() {
49157
+ this._stateInfoList = [];
49158
+ }
49156
49159
  _isMultiMark() {
49157
49160
  return !this._mark || isMultiDatumMark(this._mark.type);
49158
49161
  }
@@ -50301,6 +50304,9 @@
50301
50304
  runAnimation() {
50302
50305
  this._runStateAnimation(this.getGraphics());
50303
50306
  }
50307
+ clearBeforeReInit() {
50308
+ this.state.clearAllStateInfo(), this.uncommit(), this.stateStyle = {};
50309
+ }
50304
50310
  }
50305
50311
 
50306
50312
  class GroupMark extends BaseMark {
@@ -51483,11 +51489,8 @@
51483
51489
  return (null === (_a = theme.chart) || void 0 === _a ? void 0 : _a[type]) && (theme = mergeTheme({}, theme, theme.chart[type])), theme;
51484
51490
  };
51485
51491
  let currentTheme;
51486
- if (isEmpty(optionTheme) && isEmpty(specTheme)) currentTheme = getThemeObject(this._currentThemeName), this._currentTheme = processThemeByChartType(chartType, currentTheme);else if (isString$1(optionTheme) && (!specTheme || isString$1(specTheme)) || isString$1(specTheme) && (!optionTheme || isString$1(optionTheme))) {
51487
- const finalTheme = mergeTheme({}, getThemeObject(this._currentThemeName), getThemeObject(optionTheme), getThemeObject(specTheme));
51488
- this._currentTheme = processThemeByChartType(chartType, finalTheme);
51489
- } else {
51490
- const finalTheme = mergeTheme({}, getThemeObject(this._currentThemeName), getThemeObject(optionTheme), getThemeObject(specTheme));
51492
+ if (isEmpty(optionTheme) && isEmpty(specTheme)) currentTheme = getThemeObject(this._currentThemeName), this._currentTheme = processThemeByChartType(chartType, currentTheme);else {
51493
+ const finalTheme = mergeTheme({}, getThemeObject(isObject$2(specTheme) && specTheme.type ? specTheme.type : isObject$2(optionTheme) && optionTheme.type ? optionTheme.type : this._currentThemeName), getThemeObject(optionTheme), getThemeObject(specTheme));
51491
51494
  this._currentTheme = processThemeByChartType(chartType, finalTheme);
51492
51495
  }
51493
51496
  this._cachedProcessedTheme = null, setPoptipTheme(this.getTheme("component", "poptip")), null === (_c = this._compiler) || void 0 === _c || _c.setBackground(this._getBackground());
@@ -53035,7 +53038,7 @@
53035
53038
  super.reInit(spec);
53036
53039
  const marks = this.getMarksWithoutRoot();
53037
53040
  marks.forEach(mark => {
53038
- this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53041
+ mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53039
53042
  }), this.initMarkStyle(), marks.forEach(mark => {
53040
53043
  mark.commit(!1);
53041
53044
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();
@@ -66986,13 +66989,14 @@
66986
66989
  }
66987
66990
  class CirclePackingLayout {
66988
66991
  constructor(options) {
66992
+ var _a;
66989
66993
  this.options = options;
66990
66994
  const keyOption = null == options ? void 0 : options.nodeKey,
66991
66995
  keyFunc = isFunction$1(keyOption) ? keyOption : keyOption ? field$2(keyOption) : null;
66992
66996
  this._getNodeKey = keyFunc, this._getPadding = isNumber$1(null == options ? void 0 : options.padding) ? node => options.padding : isArray$1(null == options ? void 0 : options.padding) ? node => {
66993
66997
  var _a;
66994
66998
  return null !== (_a = options.padding[node.depth + 1]) && void 0 !== _a ? _a : 0;
66995
- } : () => 0, this._maxDepth = -1;
66999
+ } : () => 0, this._maxDepth = -1, this._valueField = null !== (_a = null == options ? void 0 : options.valueField) && void 0 !== _a ? _a : "value";
66996
67000
  }
66997
67001
  layout(data, config) {
66998
67002
  var _a;
@@ -67013,7 +67017,7 @@
67013
67017
  };
67014
67018
  if (!data || !data.length) return [];
67015
67019
  const nodes = [],
67016
- res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey);
67020
+ res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey, this._valueField);
67017
67021
  this._maxDepth = res.maxDepth;
67018
67022
  const random = randomLCG(),
67019
67023
  root = {
@@ -72231,6 +72235,7 @@
72231
72235
  type: "circlePackingLayout",
72232
72236
  options: () => ({
72233
72237
  nodeKey: this._categoryField,
72238
+ valueField: this._valueField,
72234
72239
  padding: this._layoutPadding,
72235
72240
  includeRoot: !1,
72236
72241
  width: this.getLayoutRect().width || 1,