@visactor/vchart 2.0.14 → 2.0.15

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
@@ -35301,7 +35301,7 @@ class AnimateExecutor {
35301
35301
  let parsedFromProps = null,
35302
35302
  props = params.to,
35303
35303
  from = params.from;
35304
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
35304
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
35305
35305
  let totalDelay = 0;
35306
35306
  oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
35307
35307
  const delayAfterValue = isFunction$1(delayAfter) ? delayAfter(null === (_h = null === (_g = graphic.context) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h[0], graphic, {}) : delayAfter;
@@ -35364,7 +35364,7 @@ class AnimateExecutor {
35364
35364
  let parsedFromProps = null,
35365
35365
  props = effect.to,
35366
35366
  from = effect.from;
35367
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
35367
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
35368
35368
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
35369
35369
  customType = effect.custom ? effect.customType : getCustomType(custom);
35370
35370
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
@@ -35383,22 +35383,31 @@ class AnimateExecutor {
35383
35383
  animate.play(customAnimate);
35384
35384
  }
35385
35385
  createPropsFromChannel(channel, graphic) {
35386
+ var _a;
35386
35387
  const props = {};
35387
35388
  let from = null;
35388
- return channel ? (Array.isArray(channel) ? channel.forEach(key => {
35389
- var _a, _b;
35390
- const value = null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs) || void 0 === _b ? void 0 : _b[key];
35391
- void 0 !== value && (props[key] = value);
35392
- }) : Object.keys(channel).forEach(key => {
35389
+ if (!channel) return {
35390
+ from: from,
35391
+ props: props,
35392
+ attrOutChannel: null
35393
+ };
35394
+ const attrOutChannel = {};
35395
+ let hasAttrs = !1;
35396
+ const diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
35397
+ if (Array.isArray(channel) && (channel = channel.reduce((res, key) => (void 0 === diffAttrs[key] || (res[key] = {
35398
+ to: diffAttrs[key]
35399
+ }), res), {})), Object.keys(channel).forEach(key => {
35393
35400
  var _a, _b, _c, _d;
35394
35401
  const config = channel[key];
35395
35402
  void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
35396
- }), {
35397
- from: from,
35398
- props: props
35399
- }) : {
35403
+ }), diffAttrs) for (const key in diffAttrs) {
35404
+ const value = diffAttrs[key];
35405
+ void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
35406
+ }
35407
+ return {
35400
35408
  from: from,
35401
- props: props
35409
+ props: props,
35410
+ attrOutChannel: hasAttrs ? attrOutChannel : null
35402
35411
  };
35403
35412
  }
35404
35413
  resolveValue(value, graphic, defaultValue) {
@@ -55479,6 +55488,7 @@ class Compiler {
55479
55488
  else if (this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive())) {
55480
55489
  this._progressiveMarks.forEach(mark => {
55481
55490
  mark.runAnimation();
55491
+ mark.clearExitGraphics();
55482
55492
  });
55483
55493
  }
55484
55494
  else if (this._progressiveMarks) {
@@ -58549,7 +58559,7 @@ class BaseMark extends GrammarItem {
58549
58559
  }
58550
58560
  }
58551
58561
  _computeGradientAttr(gradientStyle) {
58552
- var _a, _b;
58562
+ var _a, _b, _c, _d, _e;
58553
58563
  const { gradient, scale, field } = gradientStyle, rest = __rest$e(gradientStyle, ["gradient", "scale", "field"]);
58554
58564
  let colorScale = scale;
58555
58565
  let colorField = field;
@@ -58562,7 +58572,7 @@ class BaseMark extends GrammarItem {
58562
58572
  colorField = globalField;
58563
58573
  }
58564
58574
  }
58565
- const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), this.model.getDefaultColorDomain());
58575
+ const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), (_e = (_d = (_c = this.model) === null || _c === void 0 ? void 0 : _c.getDefaultColorDomain) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : []);
58566
58576
  const mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
58567
58577
  return (data) => {
58568
58578
  const computeStyle = {};
@@ -61790,7 +61800,7 @@ const lookup = (data, opt) => {
61790
61800
  });
61791
61801
  };
61792
61802
 
61793
- const version = "2.0.14";
61803
+ const version = "2.0.15";
61794
61804
 
61795
61805
  const addVChartProperty = (data, op) => {
61796
61806
  const context = op.beforeCall();
@@ -81368,7 +81378,9 @@ const getWordCloudTheme = () => {
81368
81378
  padding: 1,
81369
81379
  style: {
81370
81380
  textAlign: 'center',
81371
- textBaseline: 'alphabetic'
81381
+ textBaseline: 'alphabetic',
81382
+ scaleX: 1,
81383
+ scaleY: 1
81372
81384
  }
81373
81385
  }
81374
81386
  };
@@ -104758,7 +104770,7 @@ const getPanelStyle = (style) => {
104758
104770
  if (isValid$1(radius)) {
104759
104771
  panelStyle.borderRadius = isValidNumber$1(radius) ? `${radius}px` : `${radius}`;
104760
104772
  }
104761
- if (padding) {
104773
+ if (isValid$1(padding)) {
104762
104774
  panelPadding = normalizePadding(padding);
104763
104775
  panelStyle.padding = getPixelPropertyStr(panelPadding);
104764
104776
  }
package/build/index.js CHANGED
@@ -35307,7 +35307,7 @@
35307
35307
  let parsedFromProps = null,
35308
35308
  props = params.to,
35309
35309
  from = params.from;
35310
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
35310
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel), this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
35311
35311
  let totalDelay = 0;
35312
35312
  oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
35313
35313
  const delayAfterValue = isFunction$1(delayAfter) ? delayAfter(null === (_h = null === (_g = graphic.context) || void 0 === _g ? void 0 : _g.data) || void 0 === _h ? void 0 : _h[0], graphic, {}) : delayAfter;
@@ -35370,7 +35370,7 @@
35370
35370
  let parsedFromProps = null,
35371
35371
  props = effect.to,
35372
35372
  from = effect.from;
35373
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
35373
+ props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from), parsedFromProps.attrOutChannel && graphic.setAttributes(parsedFromProps.attrOutChannel);
35374
35374
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
35375
35375
  customType = effect.custom ? effect.customType : getCustomType(custom);
35376
35376
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
@@ -35389,22 +35389,31 @@
35389
35389
  animate.play(customAnimate);
35390
35390
  }
35391
35391
  createPropsFromChannel(channel, graphic) {
35392
+ var _a;
35392
35393
  const props = {};
35393
35394
  let from = null;
35394
- return channel ? (Array.isArray(channel) ? channel.forEach(key => {
35395
- var _a, _b;
35396
- const value = null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs) || void 0 === _b ? void 0 : _b[key];
35397
- void 0 !== value && (props[key] = value);
35398
- }) : Object.keys(channel).forEach(key => {
35395
+ if (!channel) return {
35396
+ from: from,
35397
+ props: props,
35398
+ attrOutChannel: null
35399
+ };
35400
+ const attrOutChannel = {};
35401
+ let hasAttrs = !1;
35402
+ const diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
35403
+ if (Array.isArray(channel) && (channel = channel.reduce((res, key) => (void 0 === diffAttrs[key] || (res[key] = {
35404
+ to: diffAttrs[key]
35405
+ }), res), {})), Object.keys(channel).forEach(key => {
35399
35406
  var _a, _b, _c, _d;
35400
35407
  const config = channel[key];
35401
35408
  void 0 !== config.to && ("function" == typeof config.to ? props[key] = config.to(null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.data) || void 0 === _b ? void 0 : _b[0], graphic, {}) : props[key] = config.to), void 0 !== config.from && (from || (from = {}), "function" == typeof config.from ? from[key] = config.from(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : from[key] = config.from);
35402
- }), {
35403
- from: from,
35404
- props: props
35405
- }) : {
35409
+ }), diffAttrs) for (const key in diffAttrs) {
35410
+ const value = diffAttrs[key];
35411
+ void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
35412
+ }
35413
+ return {
35406
35414
  from: from,
35407
- props: props
35415
+ props: props,
35416
+ attrOutChannel: hasAttrs ? attrOutChannel : null
35408
35417
  };
35409
35418
  }
35410
35419
  resolveValue(value, graphic, defaultValue) {
@@ -55485,6 +55494,7 @@
55485
55494
  else if (this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive())) {
55486
55495
  this._progressiveMarks.forEach(mark => {
55487
55496
  mark.runAnimation();
55497
+ mark.clearExitGraphics();
55488
55498
  });
55489
55499
  }
55490
55500
  else if (this._progressiveMarks) {
@@ -58555,7 +58565,7 @@
58555
58565
  }
58556
58566
  }
58557
58567
  _computeGradientAttr(gradientStyle) {
58558
- var _a, _b;
58568
+ var _a, _b, _c, _d, _e;
58559
58569
  const { gradient, scale, field } = gradientStyle, rest = __rest$e(gradientStyle, ["gradient", "scale", "field"]);
58560
58570
  let colorScale = scale;
58561
58571
  let colorField = field;
@@ -58568,7 +58578,7 @@
58568
58578
  colorField = globalField;
58569
58579
  }
58570
58580
  }
58571
- const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), this.model.getDefaultColorDomain());
58581
+ const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? (_b = (_a = this.model).getSpec) === null || _b === void 0 ? void 0 : _b.call(_a) : undefined), (_e = (_d = (_c = this.model) === null || _c === void 0 ? void 0 : _c.getDefaultColorDomain) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : []);
58572
58582
  const mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
58573
58583
  return (data) => {
58574
58584
  const computeStyle = {};
@@ -61796,7 +61806,7 @@
61796
61806
  });
61797
61807
  };
61798
61808
 
61799
- const version = "2.0.14";
61809
+ const version = "2.0.15";
61800
61810
 
61801
61811
  const addVChartProperty = (data, op) => {
61802
61812
  const context = op.beforeCall();
@@ -81374,7 +81384,9 @@
81374
81384
  padding: 1,
81375
81385
  style: {
81376
81386
  textAlign: 'center',
81377
- textBaseline: 'alphabetic'
81387
+ textBaseline: 'alphabetic',
81388
+ scaleX: 1,
81389
+ scaleY: 1
81378
81390
  }
81379
81391
  }
81380
81392
  };
@@ -104764,7 +104776,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
104764
104776
  if (isValid$1(radius)) {
104765
104777
  panelStyle.borderRadius = isValidNumber$1(radius) ? `${radius}px` : `${radius}`;
104766
104778
  }
104767
- if (padding) {
104779
+ if (isValid$1(padding)) {
104768
104780
  panelPadding = normalizePadding(padding);
104769
104781
  panelStyle.padding = getPixelPropertyStr(panelPadding);
104770
104782
  }