@visactor/react-vchart 2.0.14 → 2.0.16-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
@@ -31323,7 +31323,7 @@
31323
31323
  let parsedFromProps = null,
31324
31324
  props = params.to,
31325
31325
  from = params.from;
31326
- 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);
31326
+ 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);
31327
31327
  let totalDelay = 0;
31328
31328
  oneByOneDelay && (totalDelay = oneByOneDelay * (count - index - 1));
31329
31329
  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;
@@ -31386,7 +31386,7 @@
31386
31386
  let parsedFromProps = null,
31387
31387
  props = effect.to,
31388
31388
  from = effect.from;
31389
- props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
31389
+ 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);
31390
31390
  const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
31391
31391
  customType = effect.custom ? effect.customType : getCustomType(custom);
31392
31392
  this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic);
@@ -31405,22 +31405,31 @@
31405
31405
  animate.play(customAnimate);
31406
31406
  }
31407
31407
  createPropsFromChannel(channel, graphic) {
31408
+ var _a;
31408
31409
  const props = {};
31409
31410
  let from = null;
31410
- return channel ? (Array.isArray(channel) ? channel.forEach(key => {
31411
- var _a, _b;
31412
- const value = null === (_b = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs) || void 0 === _b ? void 0 : _b[key];
31413
- void 0 !== value && (props[key] = value);
31414
- }) : Object.keys(channel).forEach(key => {
31411
+ if (!channel) return {
31412
+ from: from,
31413
+ props: props,
31414
+ attrOutChannel: null
31415
+ };
31416
+ const attrOutChannel = {};
31417
+ let hasAttrs = !1;
31418
+ const diffAttrs = null === (_a = graphic.context) || void 0 === _a ? void 0 : _a.diffAttrs;
31419
+ if (Array.isArray(channel) && (channel = channel.reduce((res, key) => (void 0 === diffAttrs[key] || (res[key] = {
31420
+ to: diffAttrs[key]
31421
+ }), res), {})), Object.keys(channel).forEach(key => {
31415
31422
  var _a, _b, _c, _d;
31416
31423
  const config = channel[key];
31417
31424
  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);
31418
- }), {
31419
- from: from,
31420
- props: props
31421
- }) : {
31425
+ }), diffAttrs) for (const key in diffAttrs) {
31426
+ const value = diffAttrs[key];
31427
+ void 0 !== value && (props.hasOwnProperty(key) || (attrOutChannel[key] = value, hasAttrs = !0));
31428
+ }
31429
+ return {
31422
31430
  from: from,
31423
- props: props
31431
+ props: props,
31432
+ attrOutChannel: hasAttrs ? attrOutChannel : null
31424
31433
  };
31425
31434
  }
31426
31435
  resolveValue(value, graphic, defaultValue) {
@@ -47489,7 +47498,7 @@
47489
47498
  const raf = vglobal.getSpecifiedRequestAnimationFrame(10);
47490
47499
  this._progressiveRafId = raf(this.handleProgressiveFrame);
47491
47500
  } else this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive()) ? this._progressiveMarks.forEach(mark => {
47492
- mark.runAnimation();
47501
+ mark.runAnimation(), mark.clearExitGraphics();
47493
47502
  }) : this._progressiveMarks && (this._progressiveMarks = null);
47494
47503
  }
47495
47504
  clearProgressive() {
@@ -49718,7 +49727,7 @@
49718
49727
  });
49719
49728
  }
49720
49729
  _computeGradientAttr(gradientStyle) {
49721
- var _a, _b;
49730
+ var _a, _b, _c, _d, _e;
49722
49731
  const {
49723
49732
  gradient: gradient,
49724
49733
  scale: scale,
@@ -49734,7 +49743,7 @@
49734
49743
  } = this.model.getColorAttribute();
49735
49744
  scale || (colorScale = globalColorScale), colorField || (colorField = globalField);
49736
49745
  }
49737
- const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), "series" === this.model.modelType ? null === (_b = (_a = this.model).getSpec) || void 0 === _b ? void 0 : _b.call(_a) : void 0), this.model.getDefaultColorDomain()),
49746
+ const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), "series" === this.model.modelType ? null === (_b = (_a = this.model).getSpec) || void 0 === _b ? void 0 : _b.call(_a) : void 0), null !== (_e = null === (_d = null === (_c = this.model) || void 0 === _c ? void 0 : _c.getDefaultColorDomain) || void 0 === _d ? void 0 : _d.call(_c)) && void 0 !== _e ? _e : []),
49738
49747
  mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
49739
49748
  return data => {
49740
49749
  const computeStyle = {},
@@ -66344,7 +66353,9 @@
66344
66353
  padding: 1,
66345
66354
  style: {
66346
66355
  textAlign: "center",
66347
- textBaseline: "alphabetic"
66356
+ textBaseline: "alphabetic",
66357
+ scaleX: 1,
66358
+ scaleY: 1
66348
66359
  }
66349
66360
  }
66350
66361
  };
@@ -84562,7 +84573,7 @@
84562
84573
  const {
84563
84574
  radius: radius
84564
84575
  } = null != border ? border : {};
84565
- return isValid$1(radius) && (panelStyle.borderRadius = isValidNumber$1(radius) ? `${radius}px` : `${radius}`), padding && (panelPadding = normalizePadding(padding), panelStyle.padding = getPixelPropertyStr(panelPadding)), {
84576
+ return isValid$1(radius) && (panelStyle.borderRadius = isValidNumber$1(radius) ? `${radius}px` : `${radius}`), isValid$1(padding) && (panelPadding = normalizePadding(padding), panelStyle.padding = getPixelPropertyStr(panelPadding)), {
84566
84577
  panelStyle: panelStyle,
84567
84578
  panelPadding: panelPadding
84568
84579
  };
@@ -86056,10 +86067,12 @@
86056
86067
  const REACT_TOOLTIP_ClASS_NAME = `${PREFIX}_REACT_TOOLTIP`;
86057
86068
 
86058
86069
  const initCustomTooltip = (setTooltipNode, props, spec) => {
86070
+ var _a, _b, _c;
86071
+ const nextSpec = Object.assign({}, (spec !== null && spec !== void 0 ? spec : {}));
86059
86072
  let render;
86060
86073
  if (spec === null || spec === void 0 ? void 0 : spec.tooltipRender) {
86061
86074
  render = spec.tooltipRender;
86062
- delete spec.tooltipRender;
86075
+ delete nextSpec.tooltipRender;
86063
86076
  }
86064
86077
  else if (props.tooltipRender) {
86065
86078
  render = props.tooltipRender;
@@ -86068,12 +86081,19 @@
86068
86081
  let reserve;
86069
86082
  if (spec === null || spec === void 0 ? void 0 : spec.reserveDefaultTooltip) {
86070
86083
  reserve = spec.reserveDefaultTooltip;
86071
- delete spec.reserveDefaultTooltip;
86084
+ delete nextSpec.reserveDefaultTooltip;
86072
86085
  }
86073
86086
  else {
86074
86087
  reserve = props.reserveDefaultTooltip;
86075
86088
  }
86076
- return Object.assign(Object.assign({}, spec), { updateElement: (el, actualTooltip, params) => {
86089
+ if (!reserve) {
86090
+ const panelStyle = Object.assign({}, ((_b = (_a = nextSpec.style) === null || _a === void 0 ? void 0 : _a.panel) !== null && _b !== void 0 ? _b : {}));
86091
+ panelStyle.padding = 0;
86092
+ panelStyle.border = Object.assign(Object.assign({}, panelStyle.border), { radius: 0 });
86093
+ panelStyle.backgroundColor = 'unset';
86094
+ nextSpec.style = Object.assign(Object.assign({}, ((_c = nextSpec.style) !== null && _c !== void 0 ? _c : {})), { panel: panelStyle });
86095
+ }
86096
+ return Object.assign(Object.assign({}, nextSpec), { updateElement: (el, actualTooltip, params) => {
86077
86097
  const { changePositionOnly } = params;
86078
86098
  if (changePositionOnly) {
86079
86099
  return;
@@ -86082,7 +86102,6 @@
86082
86102
  el.style.width = 'auto';
86083
86103
  el.style.height = 'auto';
86084
86104
  el.style.minHeight = 'auto';
86085
- el.style.padding = '0px';
86086
86105
  for (let i = 0; i < el.children.length; i++) {
86087
86106
  const childNode = el.children[i];
86088
86107
  if (childNode.className !== REACT_TOOLTIP_ClASS_NAME && childNode.style.display !== 'none') {
@@ -88684,7 +88703,7 @@
88684
88703
 
88685
88704
  const VChartSimple = createChart('VChartSimple');
88686
88705
 
88687
- const version = "2.0.14";
88706
+ const version = "2.0.15";
88688
88707
 
88689
88708
  exports.Area = Area;
88690
88709
  exports.AreaChart = AreaChart;