@visactor/vchart 2.0.23-alpha.8 → 2.0.23-alpha.9

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.es.js CHANGED
@@ -53660,27 +53660,27 @@ function specTransform(spec, special = {
53660
53660
  }
53661
53661
  return spec;
53662
53662
  }
53663
- function functionTransform(spec, VChart) {
53664
- if (!spec) {
53665
- return spec;
53663
+ function functionTransform(value, registry) {
53664
+ var _a;
53665
+ if (!value) {
53666
+ return value;
53666
53667
  }
53667
- if (isPlainObject$1(spec)) {
53668
+ if (isString$1(value)) {
53669
+ return (_a = registry.getFunction(value)) !== null && _a !== void 0 ? _a : value;
53670
+ }
53671
+ if (isPlainObject$1(value)) {
53668
53672
  const result = {};
53669
- for (const key in spec) {
53670
- if (Object.prototype.hasOwnProperty.call(spec, key)) {
53671
- if (isString$1(spec[key]) && VChart.getFunction(spec[key])) {
53672
- result[key] = VChart.getFunction(spec[key]);
53673
- continue;
53674
- }
53675
- result[key] = functionTransform(spec[key], VChart);
53673
+ for (const key in value) {
53674
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
53675
+ result[key] = functionTransform(value[key], registry);
53676
53676
  }
53677
53677
  }
53678
53678
  return result;
53679
53679
  }
53680
- if (isArray$1(spec)) {
53681
- return spec.map((s) => functionTransform(s, VChart));
53680
+ if (isArray$1(value)) {
53681
+ return value.map(item => functionTransform(item, registry));
53682
53682
  }
53683
- return spec;
53683
+ return value;
53684
53684
  }
53685
53685
  function transformFunctionAttribute(att, ...args) {
53686
53686
  if (isFunction$1(att)) {
@@ -60893,6 +60893,7 @@ class VChart {
60893
60893
  }
60894
60894
  let theme = this._currentTheme;
60895
60895
  keys.forEach((key, index) => {
60896
+ var _a;
60896
60897
  if (index === 1 && (keys[0] === 'series' || keys[0] === 'component')) {
60897
60898
  const buildInTheme = keys[0] === 'series' ? Factory.getSeriesBuiltInTheme(key) : Factory.getComponentBuiltInTheme(key);
60898
60899
  theme = theme ? mergeSpec({}, buildInTheme, theme[key]) : buildInTheme;
@@ -60904,6 +60905,9 @@ class VChart {
60904
60905
  theme = preprocessTheme({
60905
60906
  [key]: theme
60906
60907
  }, this._currentTheme.colorScheme, this._currentTheme.token)[key];
60908
+ if ((_a = this.getFunctionList()) === null || _a === void 0 ? void 0 : _a.length) {
60909
+ theme = functionTransform(theme, this);
60910
+ }
60907
60911
  }
60908
60912
  });
60909
60913
  this._cachedProcessedTheme[cacheKey] = theme;
@@ -62208,7 +62212,7 @@ const lookup = (data, opt) => {
62208
62212
  });
62209
62213
  };
62210
62214
 
62211
- const version = "2.0.22";
62215
+ const version = "2.0.23-alpha.8";
62212
62216
 
62213
62217
  const addVChartProperty = (data, op) => {
62214
62218
  const context = op.beforeCall();
package/build/index.js CHANGED
@@ -53666,27 +53666,27 @@
53666
53666
  }
53667
53667
  return spec;
53668
53668
  }
53669
- function functionTransform(spec, VChart) {
53670
- if (!spec) {
53671
- return spec;
53669
+ function functionTransform(value, registry) {
53670
+ var _a;
53671
+ if (!value) {
53672
+ return value;
53672
53673
  }
53673
- if (isPlainObject$1(spec)) {
53674
+ if (isString$1(value)) {
53675
+ return (_a = registry.getFunction(value)) !== null && _a !== void 0 ? _a : value;
53676
+ }
53677
+ if (isPlainObject$1(value)) {
53674
53678
  const result = {};
53675
- for (const key in spec) {
53676
- if (Object.prototype.hasOwnProperty.call(spec, key)) {
53677
- if (isString$1(spec[key]) && VChart.getFunction(spec[key])) {
53678
- result[key] = VChart.getFunction(spec[key]);
53679
- continue;
53680
- }
53681
- result[key] = functionTransform(spec[key], VChart);
53679
+ for (const key in value) {
53680
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
53681
+ result[key] = functionTransform(value[key], registry);
53682
53682
  }
53683
53683
  }
53684
53684
  return result;
53685
53685
  }
53686
- if (isArray$1(spec)) {
53687
- return spec.map((s) => functionTransform(s, VChart));
53686
+ if (isArray$1(value)) {
53687
+ return value.map(item => functionTransform(item, registry));
53688
53688
  }
53689
- return spec;
53689
+ return value;
53690
53690
  }
53691
53691
  function transformFunctionAttribute(att, ...args) {
53692
53692
  if (isFunction$1(att)) {
@@ -60899,6 +60899,7 @@
60899
60899
  }
60900
60900
  let theme = this._currentTheme;
60901
60901
  keys.forEach((key, index) => {
60902
+ var _a;
60902
60903
  if (index === 1 && (keys[0] === 'series' || keys[0] === 'component')) {
60903
60904
  const buildInTheme = keys[0] === 'series' ? Factory.getSeriesBuiltInTheme(key) : Factory.getComponentBuiltInTheme(key);
60904
60905
  theme = theme ? mergeSpec({}, buildInTheme, theme[key]) : buildInTheme;
@@ -60910,6 +60911,9 @@
60910
60911
  theme = preprocessTheme({
60911
60912
  [key]: theme
60912
60913
  }, this._currentTheme.colorScheme, this._currentTheme.token)[key];
60914
+ if ((_a = this.getFunctionList()) === null || _a === void 0 ? void 0 : _a.length) {
60915
+ theme = functionTransform(theme, this);
60916
+ }
60913
60917
  }
60914
60918
  });
60915
60919
  this._cachedProcessedTheme[cacheKey] = theme;
@@ -62214,7 +62218,7 @@
62214
62218
  });
62215
62219
  };
62216
62220
 
62217
- const version = "2.0.22";
62221
+ const version = "2.0.23-alpha.8";
62218
62222
 
62219
62223
  const addVChartProperty = (data, op) => {
62220
62224
  const context = op.beforeCall();