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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/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
  }
@@ -49855,7 +49858,9 @@
49855
49858
  this._lastMark = mark;
49856
49859
  }
49857
49860
  reuse(mark) {
49858
- this.type === mark.type && (this._product = mark.getProduct(), this._graphics = mark.getGraphics(), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49861
+ this.type === mark.type && (this._product = mark.getProduct(), this._product.clearStates(), this._graphics = mark.getGraphics(), this._graphics.forEach(g => {
49862
+ g.clearStates();
49863
+ }), this._graphicMap = mark._graphicMap, this._graphicMap.forEach(g => {
49859
49864
  g.context = Object.assign(Object.assign({}, g.context), this._getCommonContext());
49860
49865
  }), this._dataByKey = mark._dataByKey, this._prevDataByKey = mark._prevDataByKey, this.needClear = mark.needClear);
49861
49866
  }
@@ -50301,6 +50306,11 @@
50301
50306
  runAnimation() {
50302
50307
  this._runStateAnimation(this.getGraphics());
50303
50308
  }
50309
+ clearBeforeReInit() {
50310
+ this.state.clearAllStateInfo(), this.uncommit(), this.stateStyle = {}, this.getGraphics().forEach(g => {
50311
+ g.clearStates();
50312
+ });
50313
+ }
50304
50314
  }
50305
50315
 
50306
50316
  class GroupMark extends BaseMark {
@@ -51483,11 +51493,8 @@
51483
51493
  return (null === (_a = theme.chart) || void 0 === _a ? void 0 : _a[type]) && (theme = mergeTheme({}, theme, theme.chart[type])), theme;
51484
51494
  };
51485
51495
  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));
51496
+ if (isEmpty(optionTheme) && isEmpty(specTheme)) currentTheme = getThemeObject(this._currentThemeName), this._currentTheme = processThemeByChartType(chartType, currentTheme);else {
51497
+ 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
51498
  this._currentTheme = processThemeByChartType(chartType, finalTheme);
51492
51499
  }
51493
51500
  this._cachedProcessedTheme = null, setPoptipTheme(this.getTheme("component", "poptip")), null === (_c = this._compiler) || void 0 === _c || _c.setBackground(this._getBackground());
@@ -53035,7 +53042,7 @@
53035
53042
  super.reInit(spec);
53036
53043
  const marks = this.getMarksWithoutRoot();
53037
53044
  marks.forEach(mark => {
53038
- this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53045
+ mark.clearBeforeReInit(), this._spec[mark.name] && this.initMarkStyleWithSpec(mark, this._spec[mark.name]);
53039
53046
  }), this.initMarkStyle(), marks.forEach(mark => {
53040
53047
  mark.commit(!1);
53041
53048
  }), this._updateExtensionMarkSpec(), this._updateSpecData(), this._tooltipHelper && this._tooltipHelper.updateTooltipSpec();
@@ -66986,13 +66993,14 @@
66986
66993
  }
66987
66994
  class CirclePackingLayout {
66988
66995
  constructor(options) {
66996
+ var _a;
66989
66997
  this.options = options;
66990
66998
  const keyOption = null == options ? void 0 : options.nodeKey,
66991
66999
  keyFunc = isFunction$1(keyOption) ? keyOption : keyOption ? field$2(keyOption) : null;
66992
67000
  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
67001
  var _a;
66994
67002
  return null !== (_a = options.padding[node.depth + 1]) && void 0 !== _a ? _a : 0;
66995
- } : () => 0, this._maxDepth = -1;
67003
+ } : () => 0, this._maxDepth = -1, this._valueField = null !== (_a = null == options ? void 0 : options.valueField) && void 0 !== _a ? _a : "value";
66996
67004
  }
66997
67005
  layout(data, config) {
66998
67006
  var _a;
@@ -67013,7 +67021,7 @@
67013
67021
  };
67014
67022
  if (!data || !data.length) return [];
67015
67023
  const nodes = [],
67016
- res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey);
67024
+ res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey, this._valueField);
67017
67025
  this._maxDepth = res.maxDepth;
67018
67026
  const random = randomLCG(),
67019
67027
  root = {
@@ -72231,6 +72239,7 @@
72231
72239
  type: "circlePackingLayout",
72232
72240
  options: () => ({
72233
72241
  nodeKey: this._categoryField,
72242
+ valueField: this._valueField,
72234
72243
  padding: this._layoutPadding,
72235
72244
  includeRoot: !1,
72236
72245
  width: this.getLayoutRect().width || 1,