@visactor/react-vchart 2.0.23-alpha.4 → 2.0.23-alpha.6

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
@@ -57833,7 +57833,7 @@
57833
57833
  this._interaction = new Interaction();
57834
57834
  const series = this.getAllSeries(),
57835
57835
  mergedTriggers = [],
57836
- mergedTriggersMarks = {};
57836
+ groupedTriggers = [];
57837
57837
  series.forEach(s => {
57838
57838
  const triggers = s.getInteractionTriggers();
57839
57839
  if (triggers && triggers.length) {
@@ -57842,12 +57842,17 @@
57842
57842
  trigger: trigger,
57843
57843
  marks: marks
57844
57844
  }) => {
57845
- const interactionId = `${regionId}-${trigger.type}`;
57846
- mergedTriggersMarks[interactionId] ? marks.forEach(m => {
57847
- mergedTriggersMarks[interactionId].marks.push(m);
57848
- }) : (mergedTriggersMarks[interactionId] = Object.assign(Object.assign({}, trigger), {
57849
- marks: marks
57850
- }), mergedTriggers.push(mergedTriggersMarks[interactionId]));
57845
+ const sameTrigger = groupedTriggers.find(item => item.regionId === regionId && isEqual(item.config, trigger));
57846
+ if (sameTrigger) sameTrigger.trigger.marks.push(...marks);else {
57847
+ const mergedTrigger = Object.assign(Object.assign({}, trigger), {
57848
+ marks: [...marks]
57849
+ });
57850
+ groupedTriggers.push({
57851
+ regionId: regionId,
57852
+ config: Object.assign({}, trigger),
57853
+ trigger: mergedTrigger
57854
+ }), mergedTriggers.push(mergedTrigger);
57855
+ }
57851
57856
  });
57852
57857
  }
57853
57858
  }), mergedTriggers.forEach(trigger => {
@@ -76142,11 +76147,12 @@
76142
76147
 
76143
76148
  class RadarChartSpecTransformer extends RoseLikeChartSpecTransformer {
76144
76149
  _getDefaultSeriesSpec(spec) {
76145
- var _a;
76146
- const series = super._getDefaultSeriesSpec(spec);
76150
+ var _a, _b, _c, _d;
76151
+ const series = super._getDefaultSeriesSpec(spec),
76152
+ areaTheme = null === (_b = (_a = this._option).getTheme) || void 0 === _b ? void 0 : _b.call(_a, "series", "radar", "area");
76147
76153
  return series.line = spec.line, series.point = spec.point, series.stack = spec.stack, series.percent = spec.percent, series.area = mergeSpec({
76148
- visible: !1
76149
- }, spec.area), series.seriesMark = null !== (_a = spec.seriesMark) && void 0 !== _a ? _a : "area", series.activePoint = spec.activePoint, series.pointDis = spec.pointDis, series.pointDisMul = spec.pointDisMul, series.markOverlap = spec.markOverlap, series;
76154
+ visible: null !== (_c = null == areaTheme ? void 0 : areaTheme.visible) && void 0 !== _c && _c
76155
+ }, spec.area), series.seriesMark = null !== (_d = spec.seriesMark) && void 0 !== _d ? _d : "area", series.activePoint = spec.activePoint, series.pointDis = spec.pointDis, series.pointDisMul = spec.pointDisMul, series.markOverlap = spec.markOverlap, series;
76150
76156
  }
76151
76157
  transformSpec(spec) {
76152
76158
  var _a;
@@ -82117,7 +82123,7 @@
82117
82123
  };
82118
82124
  }
82119
82125
  _markerLayout() {
82120
- var _a, _b, _c, _d, _e;
82126
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
82121
82127
  const updateAttrs = this._getUpdateMarkerAttrs();
82122
82128
  if ("type-step" === this._spec.type) {
82123
82129
  const startRelativeSeries = this._startRelativeSeries,
@@ -82127,9 +82133,26 @@
82127
82133
  mainSegmentIndex: mainSegmentIndex
82128
82134
  } = this._spec.line || {},
82129
82135
  {
82130
- connectDirection: connectDirection,
82131
- expandDistance = 0
82136
+ connectDirection: connectDirection
82132
82137
  } = this._spec;
82138
+ let {
82139
+ expandDistance = 0
82140
+ } = this._spec;
82141
+ const {
82142
+ points: points,
82143
+ limitRect: limitRect
82144
+ } = updateAttrs,
82145
+ coordinatePoints = array(points).filter(Boolean);
82146
+ if (isFunction$1(expandDistance)) {
82147
+ const startRegion = null === (_a = null == startRelativeSeries ? void 0 : startRelativeSeries.getRegion) || void 0 === _a ? void 0 : _a.call(startRelativeSeries),
82148
+ endRegion = null === (_b = null == endRelativeSeries ? void 0 : endRelativeSeries.getRegion) || void 0 === _b ? void 0 : _b.call(endRelativeSeries);
82149
+ expandDistance = expandDistance(this._markerData, Object.assign(Object.assign({}, this.getMarkAttributeContext()), {
82150
+ region: null === (_d = null === (_c = this._relativeSeries) || void 0 === _c ? void 0 : _c.getRegion) || void 0 === _d ? void 0 : _d.call(_c),
82151
+ startRegion: startRegion,
82152
+ endRegion: endRegion,
82153
+ coordinatePoints: coordinatePoints
82154
+ }));
82155
+ }
82133
82156
  let expandDistanceValue;
82134
82157
  if (isPercent(expandDistance)) {
82135
82158
  const regionStart = startRelativeSeries.getRegion(),
@@ -82144,11 +82167,7 @@
82144
82167
  expandDistanceValue = Number(expandDistance.substring(0, expandDistance.length - 1)) * regionWidth / 100;
82145
82168
  }
82146
82169
  } else expandDistanceValue = expandDistance;
82147
- const {
82148
- points: points,
82149
- limitRect: limitRect
82150
- } = updateAttrs;
82151
- if (!points || points.length < 2) return void (null === (_a = this._markerComponent) || void 0 === _a || _a.setAttributes(updateAttrs));
82170
+ if (!points || points.length < 2) return void (null === (_e = this._markerComponent) || void 0 === _e || _e.setAttributes(updateAttrs));
82152
82171
  const joinPoints = getInsertPoints(points[0], points[1], connectDirection, expandDistanceValue);
82153
82172
  let labelPositionAttrs;
82154
82173
  labelPositionAttrs = multiSegment && isValid$1(mainSegmentIndex) ? {
@@ -82158,11 +82177,11 @@
82158
82177
  position: "start",
82159
82178
  autoRotate: !1
82160
82179
  }, getTextOffset(points[0], points[1], connectDirection, expandDistanceValue));
82161
- const markerComponentAttr = null !== (_c = null === (_b = this._markerComponent) || void 0 === _b ? void 0 : _b.attribute) && void 0 !== _c ? _c : {},
82180
+ const markerComponentAttr = null !== (_g = null === (_f = this._markerComponent) || void 0 === _f ? void 0 : _f.attribute) && void 0 !== _g ? _g : {},
82162
82181
  prevLabelAttrs = array(markerComponentAttr.label),
82163
82182
  updateLabels = array(updateAttrs.label),
82164
82183
  labelsInSpec = array(this._spec.label);
82165
- null === (_d = this._markerComponent) || void 0 === _d || _d.setAttributes({
82184
+ null === (_h = this._markerComponent) || void 0 === _h || _h.setAttributes({
82166
82185
  points: multiSegment ? [[joinPoints[0], joinPoints[1]], [joinPoints[1], joinPoints[2]], [joinPoints[2], joinPoints[3]]] : joinPoints,
82167
82186
  label: updateLabels.map((labelItem, index) => {
82168
82187
  var _a, _b, _c, _d;
@@ -82188,7 +82207,7 @@
82188
82207
  dx: this._layoutOffsetX,
82189
82208
  dy: this._layoutOffsetY
82190
82209
  });
82191
- } else null === (_e = this._markerComponent) || void 0 === _e || _e.setAttributes(updateAttrs);
82210
+ } else null === (_j = this._markerComponent) || void 0 === _j || _j.setAttributes(updateAttrs);
82192
82211
  }
82193
82212
  _computeOptions() {
82194
82213
  let options,
@@ -85824,7 +85843,7 @@
85824
85843
  } = this.options,
85825
85844
  statedGraphics = interaction.getStatedGraphics(this),
85826
85845
  g = null != graphic ? graphic : null == statedGraphics ? void 0 : statedGraphics[0];
85827
- g && statedGraphics.includes(g) && (g.removeState(state), interaction.setStatedGraphics(this, statedGraphics.filter(sg => sg !== g)));
85846
+ g && (null == statedGraphics ? void 0 : statedGraphics.includes(g)) && (g.removeState(state), interaction.setStatedGraphics(this, statedGraphics.filter(sg => sg !== g)));
85828
85847
  }
85829
85848
  }
85830
85849
  ElementActive.type = "element-active", ElementActive.defaultOptions = defaultOptions$3;