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

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.
Files changed (62) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.es.js +73 -64
  3. package/build/index.js +73 -64
  4. package/build/index.min.js +2 -2
  5. package/build/tsconfig.tsbuildinfo +1 -1
  6. package/cjs/animation/index.js +1 -2
  7. package/cjs/chart/base/base-chart.js +13 -7
  8. package/cjs/chart/base/base-chart.js.map +1 -1
  9. package/cjs/chart/radar/radar-transformer.js +4 -4
  10. package/cjs/chart/radar/radar-transformer.js.map +1 -1
  11. package/cjs/compile/compiler.d.ts +2 -0
  12. package/cjs/compile/compiler.js +14 -2
  13. package/cjs/compile/compiler.js.map +1 -1
  14. package/cjs/compile/state-manager.js +2 -1
  15. package/cjs/component/legend/base-legend.js +1 -1
  16. package/cjs/component/legend/base-legend.js.map +1 -1
  17. package/cjs/core/index.d.ts +1 -1
  18. package/cjs/core/index.js +1 -1
  19. package/cjs/core/index.js.map +1 -1
  20. package/cjs/interaction/triggers/element-active.js +2 -1
  21. package/cjs/interaction/triggers/element-active.js.map +1 -1
  22. package/cjs/mark/base/base-line.js +2 -2
  23. package/cjs/mark/base/base-line.js.map +1 -1
  24. package/cjs/series/bar/bar.js +1 -1
  25. package/cjs/series/bar/bar.js.map +1 -1
  26. package/cjs/series/rose/rose.js +3 -7
  27. package/cjs/series/rose/rose.js.map +1 -1
  28. package/cjs/series/scatter/scatter.d.ts +0 -3
  29. package/cjs/series/scatter/scatter.js +6 -24
  30. package/cjs/series/scatter/scatter.js.map +1 -1
  31. package/cjs/series/waterfall/waterfall.d.ts +2 -0
  32. package/cjs/series/waterfall/waterfall.js +12 -4
  33. package/cjs/series/waterfall/waterfall.js.map +1 -1
  34. package/esm/animation/index.js +1 -2
  35. package/esm/chart/base/base-chart.js +12 -7
  36. package/esm/chart/base/base-chart.js.map +1 -1
  37. package/esm/chart/radar/radar-transformer.js +4 -4
  38. package/esm/chart/radar/radar-transformer.js.map +1 -1
  39. package/esm/compile/compiler.d.ts +2 -0
  40. package/esm/compile/compiler.js +14 -2
  41. package/esm/compile/compiler.js.map +1 -1
  42. package/esm/compile/state-manager.js +2 -1
  43. package/esm/component/legend/base-legend.js +1 -1
  44. package/esm/component/legend/base-legend.js.map +1 -1
  45. package/esm/core/index.d.ts +1 -1
  46. package/esm/core/index.js +1 -1
  47. package/esm/core/index.js.map +1 -1
  48. package/esm/interaction/triggers/element-active.js +2 -1
  49. package/esm/interaction/triggers/element-active.js.map +1 -1
  50. package/esm/mark/base/base-line.js +2 -2
  51. package/esm/mark/base/base-line.js.map +1 -1
  52. package/esm/series/bar/bar.js +1 -1
  53. package/esm/series/bar/bar.js.map +1 -1
  54. package/esm/series/rose/rose.js +3 -7
  55. package/esm/series/rose/rose.js.map +1 -1
  56. package/esm/series/scatter/scatter.d.ts +0 -3
  57. package/esm/series/scatter/scatter.js +5 -27
  58. package/esm/series/scatter/scatter.js.map +1 -1
  59. package/esm/series/waterfall/waterfall.d.ts +2 -0
  60. package/esm/series/waterfall/waterfall.js +12 -4
  61. package/esm/series/waterfall/waterfall.js.map +1 -1
  62. package/package.json +5 -5
package/build/index.es.js CHANGED
@@ -55398,6 +55398,33 @@ class Compiler {
55398
55398
  updateLayoutTag() {
55399
55399
  this._layoutState = LayoutState.before;
55400
55400
  }
55401
+ _isGeoRegionRoamDragEnabled() {
55402
+ var _a, _b;
55403
+ const chartSpec = (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getSpec) === null || _b === void 0 ? void 0 : _b.call(_a);
55404
+ const regions = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.region;
55405
+ if (!isArray$1(regions)) {
55406
+ return false;
55407
+ }
55408
+ return regions.some((region) => {
55409
+ var _a;
55410
+ if ((region === null || region === void 0 ? void 0 : region.coordinate) !== 'geo' || !region.roam) {
55411
+ return false;
55412
+ }
55413
+ if (region.roam === true) {
55414
+ return true;
55415
+ }
55416
+ return (_a = region.roam.drag) !== null && _a !== void 0 ? _a : true;
55417
+ });
55418
+ }
55419
+ _shouldDisableCanvasTouchAction() {
55420
+ if (!isTrueBrowser(this._option.mode)) {
55421
+ return false;
55422
+ }
55423
+ const supportsTouchEvents = isValid$1(this._option.supportsTouchEvents)
55424
+ ? this._option.supportsTouchEvents
55425
+ : vglobal.supportsTouchEvents;
55426
+ return supportsTouchEvents === false && this._isGeoRegionRoamDragEnabled();
55427
+ }
55401
55428
  _setCanvasStyle() {
55402
55429
  if (!this._stage) {
55403
55430
  return;
@@ -55408,6 +55435,7 @@ class Compiler {
55408
55435
  const canvas = this.getCanvas();
55409
55436
  if (canvas) {
55410
55437
  canvas.style.display = 'block';
55438
+ canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? 'none' : '';
55411
55439
  }
55412
55440
  }
55413
55441
  }
@@ -55426,6 +55454,7 @@ class Compiler {
55426
55454
  this._cachedMarks = null;
55427
55455
  }
55428
55456
  chart.compile();
55457
+ this._setCanvasStyle();
55429
55458
  chart.afterCompile();
55430
55459
  }
55431
55460
  clearNextRender() {
@@ -62179,7 +62208,7 @@ const lookup = (data, opt) => {
62179
62208
  });
62180
62209
  };
62181
62210
 
62182
- const version = "2.0.23-alpha.5";
62211
+ const version = "2.0.22";
62183
62212
 
62184
62213
  const addVChartProperty = (data, op) => {
62185
62214
  const context = op.beforeCall();
@@ -65394,7 +65423,7 @@ class BaseLineMark extends BaseMark {
65394
65423
  : null));
65395
65424
  }
65396
65425
  _runPointsEncoder(newStyles, g, attrs = {}) {
65397
- var _a, _b, _c;
65426
+ var _a, _b;
65398
65427
  const data = g.context.data;
65399
65428
  const lineAttrs = [];
65400
65429
  const points = [];
@@ -65419,7 +65448,7 @@ class BaseLineMark extends BaseMark {
65419
65448
  points[index].context = (_a = this._keyGetter(datum)) !== null && _a !== void 0 ? _a : index;
65420
65449
  });
65421
65450
  if (progressive) {
65422
- const segments = (_c = (_b = g.attribute) === null || _b === void 0 ? void 0 : _b.segments) !== null && _c !== void 0 ? _c : [];
65451
+ const segments = ((_b = g.attribute) === null || _b === void 0 ? void 0 : _b.segments) ? [...g.attribute.segments] : [];
65423
65452
  segments.push({
65424
65453
  points
65425
65454
  });
@@ -70221,21 +70250,24 @@ class BaseChart extends CompilableBase {
70221
70250
  this._interaction = new Interaction();
70222
70251
  const series = this.getAllSeries();
70223
70252
  const mergedTriggers = [];
70224
- const mergedTriggersMarks = {};
70253
+ const groupedTriggers = [];
70225
70254
  series.forEach(s => {
70226
70255
  const triggers = s.getInteractionTriggers();
70227
70256
  if (triggers && triggers.length) {
70228
70257
  const regionId = s.getRegion().id;
70229
70258
  triggers.forEach(({ trigger, marks }) => {
70230
- const interactionId = `${regionId}-${trigger.type}`;
70231
- if (mergedTriggersMarks[interactionId]) {
70232
- marks.forEach(m => {
70233
- mergedTriggersMarks[interactionId].marks.push(m);
70234
- });
70259
+ const sameTrigger = groupedTriggers.find(item => item.regionId === regionId && isEqual(item.config, trigger));
70260
+ if (sameTrigger) {
70261
+ sameTrigger.trigger.marks.push(...marks);
70235
70262
  }
70236
70263
  else {
70237
- mergedTriggersMarks[interactionId] = Object.assign(Object.assign({}, trigger), { marks });
70238
- mergedTriggers.push(mergedTriggersMarks[interactionId]);
70264
+ const mergedTrigger = Object.assign(Object.assign({}, trigger), { marks: [...marks] });
70265
+ groupedTriggers.push({
70266
+ regionId,
70267
+ config: Object.assign({}, trigger),
70268
+ trigger: mergedTrigger
70269
+ });
70270
+ mergedTriggers.push(mergedTrigger);
70239
70271
  }
70240
70272
  });
70241
70273
  }
@@ -73676,7 +73708,7 @@ class BarSeries extends CartesianSeries {
73676
73708
  const fieldsX = this._fieldX;
73677
73709
  this._data.setTransform([
73678
73710
  {
73679
- type: 'dataSampling',
73711
+ type: 'sampling',
73680
73712
  size: this._direction === "horizontal" ? height : width,
73681
73713
  factor: this._spec.samplingFactor,
73682
73714
  yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
@@ -74007,10 +74039,6 @@ class ScatterSeries extends CartesianSeries {
74007
74039
  if (this._symbolMark.getProduct()) {
74008
74040
  this._symbolMark.compileEncode();
74009
74041
  }
74010
- if (this._isGeoCoordinateSeries()) {
74011
- this._updateSymbolGraphicPosition();
74012
- this._refreshLabelComponent(true, true);
74013
- }
74014
74042
  }
74015
74043
  initLabelMarkStyle(labelMark) {
74016
74044
  if (!labelMark) {
@@ -74058,38 +74086,6 @@ class ScatterSeries extends CartesianSeries {
74058
74086
  }
74059
74087
  return labelGraphic;
74060
74088
  }
74061
- _isGeoCoordinateSeries() {
74062
- var _a, _b;
74063
- return ((_b = (_a = this.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.getAxisType) === null || _b === void 0 ? void 0 : _b.call(_a)) === ComponentTypeEnum.geoCoordinate;
74064
- }
74065
- _refreshLabelComponent(resetPostMatrix = false, disableAnimation = false) {
74066
- var _a, _b;
74067
- const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
74068
- const labelGraphic = (_b = vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getComponent) === null || _b === void 0 ? void 0 : _b.call(vgrammarLabel);
74069
- if (resetPostMatrix) {
74070
- if (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.attribute.postMatrix) {
74071
- labelGraphic.setAttributes({
74072
- postMatrix: new Matrix()
74073
- });
74074
- }
74075
- }
74076
- if (disableAnimation && (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.disableAnimation)) {
74077
- labelGraphic.disableAnimation();
74078
- if (!this._enableLabelAnimationHook) {
74079
- this._enableLabelAnimationHook = () => {
74080
- var _a, _b, _c, _d;
74081
- const currentLabelGraphic = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent) === null || _c === void 0 ? void 0 : _c.call(_b);
74082
- (_d = currentLabelGraphic === null || currentLabelGraphic === void 0 ? void 0 : currentLabelGraphic.enableAnimation) === null || _d === void 0 ? void 0 : _d.call(currentLabelGraphic);
74083
- this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74084
- this._enableLabelAnimationHook = undefined;
74085
- };
74086
- this.event.on(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74087
- }
74088
- }
74089
- if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getProduct()) {
74090
- vgrammarLabel.renderInner();
74091
- }
74092
- }
74093
74089
  handleZoom(e) {
74094
74090
  const { scale, scaleCenter } = e;
74095
74091
  if (scale === 1) {
@@ -74113,7 +74109,7 @@ class ScatterSeries extends CartesianSeries {
74113
74109
  }
74114
74110
  }
74115
74111
  onLayoutEnd() {
74116
- var _a, _b;
74112
+ var _a, _b, _c;
74117
74113
  super.onLayoutEnd();
74118
74114
  this._updateSymbolGraphicPosition();
74119
74115
  const labelGraphic = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent();
@@ -74122,7 +74118,10 @@ class ScatterSeries extends CartesianSeries {
74122
74118
  postMatrix: new Matrix()
74123
74119
  });
74124
74120
  }
74125
- this._refreshLabelComponent();
74121
+ const vgrammarLabel = (_c = this._labelMark) === null || _c === void 0 ? void 0 : _c.getComponent();
74122
+ if (vgrammarLabel) {
74123
+ vgrammarLabel.renderInner();
74124
+ }
74126
74125
  }
74127
74126
  getDefaultShapeType() {
74128
74127
  return 'circle';
@@ -76548,6 +76547,17 @@ class WaterfallSeries extends BarSeries {
76548
76547
  bandPosition: this._bandPosition
76549
76548
  }));
76550
76549
  }
76550
+ _isCategoryAxisInverse() {
76551
+ var _a, _b, _c, _e;
76552
+ return this._direction === "horizontal"
76553
+ ? (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.isInverse) === null || _b === void 0 ? void 0 : _b.call(_a)
76554
+ : (_e = (_c = this._xAxisHelper) === null || _c === void 0 ? void 0 : _c.isInverse) === null || _e === void 0 ? void 0 : _e.call(_c);
76555
+ }
76556
+ _getLeaderLineCategoryPos(isStart, isDecrease) {
76557
+ const inverse = !!this._isCategoryAxisInverse();
76558
+ const normalPos = isStart ? (isDecrease ? 0 : 1) : isDecrease ? 1 : 0;
76559
+ return inverse ? 1 - normalPos : normalPos;
76560
+ }
76551
76561
  initMarkStyle() {
76552
76562
  super.initMarkStyle();
76553
76563
  const isDecrease = this._spec.calculationMode === 'decrease';
@@ -76561,9 +76571,9 @@ class WaterfallSeries extends BarSeries {
76561
76571
  if (!datum.lastIndex) {
76562
76572
  return 0;
76563
76573
  }
76564
- return this.totalPositionY(datum, 'lastIndex', isDecrease ? 0 : 1);
76574
+ return this.totalPositionY(datum, 'lastIndex', this._getLeaderLineCategoryPos(true, isDecrease));
76565
76575
  },
76566
- y1: (datum) => this.totalPositionY(datum, 'index', isDecrease ? 1 : 0)
76576
+ y1: (datum) => this.totalPositionY(datum, 'index', this._getLeaderLineCategoryPos(false, isDecrease))
76567
76577
  }, 'normal', AttributeLevel.Series);
76568
76578
  }
76569
76579
  else {
@@ -76573,9 +76583,9 @@ class WaterfallSeries extends BarSeries {
76573
76583
  if (!datum.lastIndex) {
76574
76584
  return 0;
76575
76585
  }
76576
- return this.totalPositionX(datum, 'lastIndex', isDecrease ? 0 : 1);
76586
+ return this.totalPositionX(datum, 'lastIndex', this._getLeaderLineCategoryPos(true, isDecrease));
76577
76587
  },
76578
- x1: (datum) => this.totalPositionX(datum, 'index', isDecrease ? 1 : 0),
76588
+ x1: (datum) => this.totalPositionX(datum, 'index', this._getLeaderLineCategoryPos(false, isDecrease)),
76579
76589
  y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
76580
76590
  y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
76581
76591
  }, 'normal', AttributeLevel.Series);
@@ -79928,14 +79938,11 @@ class RoseSeries extends RoseLikeSeries {
79928
79938
  fill: this.getColorAttribute(),
79929
79939
  outerRadius: (datum) => valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._radiusField[0]]]), this.radiusAxisHelper.getScale(0)),
79930
79940
  innerRadius: (datum) => {
79931
- var _a;
79932
79941
  if (!this.getStack()) {
79933
- return 0;
79942
+ return this._computeLayoutRadius() * this._innerRadius;
79934
79943
  }
79935
79944
  const stackStart = valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._innerRadiusField[0]]]), this.radiusAxisHelper.getScale(0));
79936
- return stackStart <= Number.MIN_VALUE
79937
- ? this._computeLayoutRadius() * ((_a = this._spec.innerRadius) !== null && _a !== void 0 ? _a : 0)
79938
- : stackStart;
79945
+ return stackStart <= Number.MIN_VALUE ? this._computeLayoutRadius() * this._innerRadius : stackStart;
79939
79946
  }
79940
79947
  });
79941
79948
  }
@@ -79961,7 +79968,7 @@ class RoseSeries extends RoseLikeSeries {
79961
79968
  const appearPreset = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.animationAppear) === null || _b === void 0 ? void 0 : _b.preset;
79962
79969
  if (this._roseMark) {
79963
79970
  const animationParams = {
79964
- innerRadius: () => { var _a; return this._computeLayoutRadius() * ((_a = this._spec.innerRadius) !== null && _a !== void 0 ? _a : 0); }
79971
+ innerRadius: () => this._computeLayoutRadius() * this._innerRadius
79965
79972
  };
79966
79973
  this._roseMark.setAnimationConfig(animationConfig((_c = Factory.getAnimationInKey('rose')) === null || _c === void 0 ? void 0 : _c(animationParams, appearPreset), userAnimationConfig("rose", this._spec, this._markAttributeContext)));
79967
79974
  }
@@ -93869,16 +93876,17 @@ const registerRoseChart = () => {
93869
93876
 
93870
93877
  class RadarChartSpecTransformer extends RoseLikeChartSpecTransformer {
93871
93878
  _getDefaultSeriesSpec(spec) {
93872
- var _a;
93879
+ var _a, _b, _c, _d;
93873
93880
  const series = super._getDefaultSeriesSpec(spec);
93881
+ const areaTheme = (_b = (_a = this._option).getTheme) === null || _b === void 0 ? void 0 : _b.call(_a, 'series', 'radar', 'area');
93874
93882
  series.line = spec.line;
93875
93883
  series.point = spec.point;
93876
93884
  series.stack = spec.stack;
93877
93885
  series.percent = spec.percent;
93878
93886
  series.area = mergeSpec({
93879
- visible: false
93887
+ visible: (_c = areaTheme === null || areaTheme === void 0 ? void 0 : areaTheme.visible) !== null && _c !== void 0 ? _c : false
93880
93888
  }, spec.area);
93881
- series.seriesMark = (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area';
93889
+ series.seriesMark = (_d = spec.seriesMark) !== null && _d !== void 0 ? _d : 'area';
93882
93890
  series.activePoint = spec.activePoint;
93883
93891
  series.pointDis = spec.pointDis;
93884
93892
  series.pointDisMul = spec.pointDisMul;
@@ -95638,6 +95646,7 @@ class BaseLegend extends BaseComponent {
95638
95646
  }
95639
95647
  clear() {
95640
95648
  super.clear();
95649
+ this._legendComponent = null;
95641
95650
  this._cacheAttrs = null;
95642
95651
  this._preSelectedData = null;
95643
95652
  }
@@ -106379,7 +106388,7 @@ class ElementActive extends BaseTrigger {
106379
106388
  const { interaction, state } = this.options;
106380
106389
  const statedGraphics = interaction.getStatedGraphics(this);
106381
106390
  const g = graphic !== null && graphic !== void 0 ? graphic : statedGraphics === null || statedGraphics === void 0 ? void 0 : statedGraphics[0];
106382
- if (g && statedGraphics.includes(g)) {
106391
+ if (g && (statedGraphics === null || statedGraphics === void 0 ? void 0 : statedGraphics.includes(g))) {
106383
106392
  g.removeState(state);
106384
106393
  interaction.setStatedGraphics(this, statedGraphics.filter(sg => sg !== g));
106385
106394
  }
package/build/index.js CHANGED
@@ -55404,6 +55404,33 @@
55404
55404
  updateLayoutTag() {
55405
55405
  this._layoutState = LayoutState.before;
55406
55406
  }
55407
+ _isGeoRegionRoamDragEnabled() {
55408
+ var _a, _b;
55409
+ const chartSpec = (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getSpec) === null || _b === void 0 ? void 0 : _b.call(_a);
55410
+ const regions = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.region;
55411
+ if (!isArray$1(regions)) {
55412
+ return false;
55413
+ }
55414
+ return regions.some((region) => {
55415
+ var _a;
55416
+ if ((region === null || region === void 0 ? void 0 : region.coordinate) !== 'geo' || !region.roam) {
55417
+ return false;
55418
+ }
55419
+ if (region.roam === true) {
55420
+ return true;
55421
+ }
55422
+ return (_a = region.roam.drag) !== null && _a !== void 0 ? _a : true;
55423
+ });
55424
+ }
55425
+ _shouldDisableCanvasTouchAction() {
55426
+ if (!isTrueBrowser(this._option.mode)) {
55427
+ return false;
55428
+ }
55429
+ const supportsTouchEvents = isValid$1(this._option.supportsTouchEvents)
55430
+ ? this._option.supportsTouchEvents
55431
+ : vglobal.supportsTouchEvents;
55432
+ return supportsTouchEvents === false && this._isGeoRegionRoamDragEnabled();
55433
+ }
55407
55434
  _setCanvasStyle() {
55408
55435
  if (!this._stage) {
55409
55436
  return;
@@ -55414,6 +55441,7 @@
55414
55441
  const canvas = this.getCanvas();
55415
55442
  if (canvas) {
55416
55443
  canvas.style.display = 'block';
55444
+ canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? 'none' : '';
55417
55445
  }
55418
55446
  }
55419
55447
  }
@@ -55432,6 +55460,7 @@
55432
55460
  this._cachedMarks = null;
55433
55461
  }
55434
55462
  chart.compile();
55463
+ this._setCanvasStyle();
55435
55464
  chart.afterCompile();
55436
55465
  }
55437
55466
  clearNextRender() {
@@ -62185,7 +62214,7 @@
62185
62214
  });
62186
62215
  };
62187
62216
 
62188
- const version = "2.0.23-alpha.5";
62217
+ const version = "2.0.22";
62189
62218
 
62190
62219
  const addVChartProperty = (data, op) => {
62191
62220
  const context = op.beforeCall();
@@ -65400,7 +65429,7 @@
65400
65429
  : null));
65401
65430
  }
65402
65431
  _runPointsEncoder(newStyles, g, attrs = {}) {
65403
- var _a, _b, _c;
65432
+ var _a, _b;
65404
65433
  const data = g.context.data;
65405
65434
  const lineAttrs = [];
65406
65435
  const points = [];
@@ -65425,7 +65454,7 @@
65425
65454
  points[index].context = (_a = this._keyGetter(datum)) !== null && _a !== void 0 ? _a : index;
65426
65455
  });
65427
65456
  if (progressive) {
65428
- const segments = (_c = (_b = g.attribute) === null || _b === void 0 ? void 0 : _b.segments) !== null && _c !== void 0 ? _c : [];
65457
+ const segments = ((_b = g.attribute) === null || _b === void 0 ? void 0 : _b.segments) ? [...g.attribute.segments] : [];
65429
65458
  segments.push({
65430
65459
  points
65431
65460
  });
@@ -70227,21 +70256,24 @@
70227
70256
  this._interaction = new Interaction();
70228
70257
  const series = this.getAllSeries();
70229
70258
  const mergedTriggers = [];
70230
- const mergedTriggersMarks = {};
70259
+ const groupedTriggers = [];
70231
70260
  series.forEach(s => {
70232
70261
  const triggers = s.getInteractionTriggers();
70233
70262
  if (triggers && triggers.length) {
70234
70263
  const regionId = s.getRegion().id;
70235
70264
  triggers.forEach(({ trigger, marks }) => {
70236
- const interactionId = `${regionId}-${trigger.type}`;
70237
- if (mergedTriggersMarks[interactionId]) {
70238
- marks.forEach(m => {
70239
- mergedTriggersMarks[interactionId].marks.push(m);
70240
- });
70265
+ const sameTrigger = groupedTriggers.find(item => item.regionId === regionId && isEqual(item.config, trigger));
70266
+ if (sameTrigger) {
70267
+ sameTrigger.trigger.marks.push(...marks);
70241
70268
  }
70242
70269
  else {
70243
- mergedTriggersMarks[interactionId] = Object.assign(Object.assign({}, trigger), { marks });
70244
- mergedTriggers.push(mergedTriggersMarks[interactionId]);
70270
+ const mergedTrigger = Object.assign(Object.assign({}, trigger), { marks: [...marks] });
70271
+ groupedTriggers.push({
70272
+ regionId,
70273
+ config: Object.assign({}, trigger),
70274
+ trigger: mergedTrigger
70275
+ });
70276
+ mergedTriggers.push(mergedTrigger);
70245
70277
  }
70246
70278
  });
70247
70279
  }
@@ -73682,7 +73714,7 @@
73682
73714
  const fieldsX = this._fieldX;
73683
73715
  this._data.setTransform([
73684
73716
  {
73685
- type: 'dataSampling',
73717
+ type: 'sampling',
73686
73718
  size: this._direction === "horizontal" ? height : width,
73687
73719
  factor: this._spec.samplingFactor,
73688
73720
  yfield: this._direction === "horizontal" ? fieldsX[0] : fieldsY[0],
@@ -74013,10 +74045,6 @@
74013
74045
  if (this._symbolMark.getProduct()) {
74014
74046
  this._symbolMark.compileEncode();
74015
74047
  }
74016
- if (this._isGeoCoordinateSeries()) {
74017
- this._updateSymbolGraphicPosition();
74018
- this._refreshLabelComponent(true, true);
74019
- }
74020
74048
  }
74021
74049
  initLabelMarkStyle(labelMark) {
74022
74050
  if (!labelMark) {
@@ -74064,38 +74092,6 @@
74064
74092
  }
74065
74093
  return labelGraphic;
74066
74094
  }
74067
- _isGeoCoordinateSeries() {
74068
- var _a, _b;
74069
- return ((_b = (_a = this.getXAxisHelper()) === null || _a === void 0 ? void 0 : _a.getAxisType) === null || _b === void 0 ? void 0 : _b.call(_a)) === ComponentTypeEnum.geoCoordinate;
74070
- }
74071
- _refreshLabelComponent(resetPostMatrix = false, disableAnimation = false) {
74072
- var _a, _b;
74073
- const vgrammarLabel = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent();
74074
- const labelGraphic = (_b = vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getComponent) === null || _b === void 0 ? void 0 : _b.call(vgrammarLabel);
74075
- if (resetPostMatrix) {
74076
- if (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.attribute.postMatrix) {
74077
- labelGraphic.setAttributes({
74078
- postMatrix: new Matrix()
74079
- });
74080
- }
74081
- }
74082
- if (disableAnimation && (labelGraphic === null || labelGraphic === void 0 ? void 0 : labelGraphic.disableAnimation)) {
74083
- labelGraphic.disableAnimation();
74084
- if (!this._enableLabelAnimationHook) {
74085
- this._enableLabelAnimationHook = () => {
74086
- var _a, _b, _c, _d;
74087
- const currentLabelGraphic = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent) === null || _c === void 0 ? void 0 : _c.call(_b);
74088
- (_d = currentLabelGraphic === null || currentLabelGraphic === void 0 ? void 0 : currentLabelGraphic.enableAnimation) === null || _d === void 0 ? void 0 : _d.call(currentLabelGraphic);
74089
- this.event.off(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74090
- this._enableLabelAnimationHook = undefined;
74091
- };
74092
- this.event.on(HOOK_EVENT.AFTER_MARK_RENDER_END, this._enableLabelAnimationHook);
74093
- }
74094
- }
74095
- if (vgrammarLabel === null || vgrammarLabel === void 0 ? void 0 : vgrammarLabel.getProduct()) {
74096
- vgrammarLabel.renderInner();
74097
- }
74098
- }
74099
74095
  handleZoom(e) {
74100
74096
  const { scale, scaleCenter } = e;
74101
74097
  if (scale === 1) {
@@ -74119,7 +74115,7 @@
74119
74115
  }
74120
74116
  }
74121
74117
  onLayoutEnd() {
74122
- var _a, _b;
74118
+ var _a, _b, _c;
74123
74119
  super.onLayoutEnd();
74124
74120
  this._updateSymbolGraphicPosition();
74125
74121
  const labelGraphic = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getComponent();
@@ -74128,7 +74124,10 @@
74128
74124
  postMatrix: new Matrix()
74129
74125
  });
74130
74126
  }
74131
- this._refreshLabelComponent();
74127
+ const vgrammarLabel = (_c = this._labelMark) === null || _c === void 0 ? void 0 : _c.getComponent();
74128
+ if (vgrammarLabel) {
74129
+ vgrammarLabel.renderInner();
74130
+ }
74132
74131
  }
74133
74132
  getDefaultShapeType() {
74134
74133
  return 'circle';
@@ -76554,6 +76553,17 @@
76554
76553
  bandPosition: this._bandPosition
76555
76554
  }));
76556
76555
  }
76556
+ _isCategoryAxisInverse() {
76557
+ var _a, _b, _c, _e;
76558
+ return this._direction === "horizontal"
76559
+ ? (_b = (_a = this._yAxisHelper) === null || _a === void 0 ? void 0 : _a.isInverse) === null || _b === void 0 ? void 0 : _b.call(_a)
76560
+ : (_e = (_c = this._xAxisHelper) === null || _c === void 0 ? void 0 : _c.isInverse) === null || _e === void 0 ? void 0 : _e.call(_c);
76561
+ }
76562
+ _getLeaderLineCategoryPos(isStart, isDecrease) {
76563
+ const inverse = !!this._isCategoryAxisInverse();
76564
+ const normalPos = isStart ? (isDecrease ? 0 : 1) : isDecrease ? 1 : 0;
76565
+ return inverse ? 1 - normalPos : normalPos;
76566
+ }
76557
76567
  initMarkStyle() {
76558
76568
  super.initMarkStyle();
76559
76569
  const isDecrease = this._spec.calculationMode === 'decrease';
@@ -76567,9 +76577,9 @@
76567
76577
  if (!datum.lastIndex) {
76568
76578
  return 0;
76569
76579
  }
76570
- return this.totalPositionY(datum, 'lastIndex', isDecrease ? 0 : 1);
76580
+ return this.totalPositionY(datum, 'lastIndex', this._getLeaderLineCategoryPos(true, isDecrease));
76571
76581
  },
76572
- y1: (datum) => this.totalPositionY(datum, 'index', isDecrease ? 1 : 0)
76582
+ y1: (datum) => this.totalPositionY(datum, 'index', this._getLeaderLineCategoryPos(false, isDecrease))
76573
76583
  }, 'normal', exports.AttributeLevel.Series);
76574
76584
  }
76575
76585
  else {
@@ -76579,9 +76589,9 @@
76579
76589
  if (!datum.lastIndex) {
76580
76590
  return 0;
76581
76591
  }
76582
- return this.totalPositionX(datum, 'lastIndex', isDecrease ? 0 : 1);
76592
+ return this.totalPositionX(datum, 'lastIndex', this._getLeaderLineCategoryPos(true, isDecrease));
76583
76593
  },
76584
- x1: (datum) => this.totalPositionX(datum, 'index', isDecrease ? 1 : 0),
76594
+ x1: (datum) => this.totalPositionX(datum, 'index', this._getLeaderLineCategoryPos(false, isDecrease)),
76585
76595
  y: (datum) => this.totalPositionY(datum, 'lastEnd', 0),
76586
76596
  y1: (datum) => this.totalPositionY(datum, datum.isTotal ? 'end' : 'start', 0)
76587
76597
  }, 'normal', exports.AttributeLevel.Series);
@@ -79934,14 +79944,11 @@
79934
79944
  fill: this.getColorAttribute(),
79935
79945
  outerRadius: (datum) => valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._radiusField[0]]]), this.radiusAxisHelper.getScale(0)),
79936
79946
  innerRadius: (datum) => {
79937
- var _a;
79938
79947
  if (!this.getStack()) {
79939
- return 0;
79948
+ return this._computeLayoutRadius() * this._innerRadius;
79940
79949
  }
79941
79950
  const stackStart = valueInScaleRange(this.radiusAxisHelper.dataToPosition([datum[this._innerRadiusField[0]]]), this.radiusAxisHelper.getScale(0));
79942
- return stackStart <= Number.MIN_VALUE
79943
- ? this._computeLayoutRadius() * ((_a = this._spec.innerRadius) !== null && _a !== void 0 ? _a : 0)
79944
- : stackStart;
79951
+ return stackStart <= Number.MIN_VALUE ? this._computeLayoutRadius() * this._innerRadius : stackStart;
79945
79952
  }
79946
79953
  });
79947
79954
  }
@@ -79967,7 +79974,7 @@
79967
79974
  const appearPreset = (_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.animationAppear) === null || _b === void 0 ? void 0 : _b.preset;
79968
79975
  if (this._roseMark) {
79969
79976
  const animationParams = {
79970
- innerRadius: () => { var _a; return this._computeLayoutRadius() * ((_a = this._spec.innerRadius) !== null && _a !== void 0 ? _a : 0); }
79977
+ innerRadius: () => this._computeLayoutRadius() * this._innerRadius
79971
79978
  };
79972
79979
  this._roseMark.setAnimationConfig(animationConfig((_c = Factory.getAnimationInKey('rose')) === null || _c === void 0 ? void 0 : _c(animationParams, appearPreset), userAnimationConfig("rose", this._spec, this._markAttributeContext)));
79973
79980
  }
@@ -93875,16 +93882,17 @@
93875
93882
 
93876
93883
  class RadarChartSpecTransformer extends RoseLikeChartSpecTransformer {
93877
93884
  _getDefaultSeriesSpec(spec) {
93878
- var _a;
93885
+ var _a, _b, _c, _d;
93879
93886
  const series = super._getDefaultSeriesSpec(spec);
93887
+ const areaTheme = (_b = (_a = this._option).getTheme) === null || _b === void 0 ? void 0 : _b.call(_a, 'series', 'radar', 'area');
93880
93888
  series.line = spec.line;
93881
93889
  series.point = spec.point;
93882
93890
  series.stack = spec.stack;
93883
93891
  series.percent = spec.percent;
93884
93892
  series.area = mergeSpec({
93885
- visible: false
93893
+ visible: (_c = areaTheme === null || areaTheme === void 0 ? void 0 : areaTheme.visible) !== null && _c !== void 0 ? _c : false
93886
93894
  }, spec.area);
93887
- series.seriesMark = (_a = spec.seriesMark) !== null && _a !== void 0 ? _a : 'area';
93895
+ series.seriesMark = (_d = spec.seriesMark) !== null && _d !== void 0 ? _d : 'area';
93888
93896
  series.activePoint = spec.activePoint;
93889
93897
  series.pointDis = spec.pointDis;
93890
93898
  series.pointDisMul = spec.pointDisMul;
@@ -95644,6 +95652,7 @@
95644
95652
  }
95645
95653
  clear() {
95646
95654
  super.clear();
95655
+ this._legendComponent = null;
95647
95656
  this._cacheAttrs = null;
95648
95657
  this._preSelectedData = null;
95649
95658
  }
@@ -106385,7 +106394,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
106385
106394
  const { interaction, state } = this.options;
106386
106395
  const statedGraphics = interaction.getStatedGraphics(this);
106387
106396
  const g = graphic !== null && graphic !== void 0 ? graphic : statedGraphics === null || statedGraphics === void 0 ? void 0 : statedGraphics[0];
106388
- if (g && statedGraphics.includes(g)) {
106397
+ if (g && (statedGraphics === null || statedGraphics === void 0 ? void 0 : statedGraphics.includes(g))) {
106389
106398
  g.removeState(state);
106390
106399
  interaction.setStatedGraphics(this, statedGraphics.filter(sg => sg !== g));
106391
106400
  }