@visactor/vchart 1.4.2 → 1.4.3

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 (173) hide show
  1. package/build/es5/index.js +1 -1
  2. package/build/index.js +138 -41
  3. package/build/index.min.js +1 -1
  4. package/build/tsconfig.tsbuildinfo +1 -1
  5. package/cjs/chart/base-chart.js.map +1 -1
  6. package/cjs/component/brush/brush.d.ts +1 -0
  7. package/cjs/component/brush/brush.js +23 -16
  8. package/cjs/component/brush/brush.js.map +1 -1
  9. package/cjs/component/legend/discrete/legend.js +12 -9
  10. package/cjs/component/legend/discrete/legend.js.map +1 -1
  11. package/cjs/core/index.d.ts +1 -1
  12. package/cjs/core/index.js +1 -1
  13. package/cjs/core/index.js.map +1 -1
  14. package/cjs/series/area/area.d.ts +4 -1
  15. package/cjs/series/area/area.js +11 -0
  16. package/cjs/series/area/area.js.map +1 -1
  17. package/cjs/series/bar/bar.d.ts +2 -0
  18. package/cjs/series/bar/bar.js +3 -0
  19. package/cjs/series/bar/bar.js.map +1 -1
  20. package/cjs/series/base/base-series.d.ts +1 -0
  21. package/cjs/series/base/base-series.js +1 -1
  22. package/cjs/series/base/base-series.js.map +1 -1
  23. package/cjs/series/box-plot/box-plot.d.ts +2 -0
  24. package/cjs/series/box-plot/box-plot.js +3 -0
  25. package/cjs/series/box-plot/box-plot.js.map +1 -1
  26. package/cjs/series/circle-packing/circle-packing.d.ts +2 -0
  27. package/cjs/series/circle-packing/circle-packing.js +3 -0
  28. package/cjs/series/circle-packing/circle-packing.js.map +1 -1
  29. package/cjs/series/dot/dot.d.ts +1 -0
  30. package/cjs/series/dot/dot.js +3 -0
  31. package/cjs/series/dot/dot.js.map +1 -1
  32. package/cjs/series/funnel/funnel.d.ts +2 -0
  33. package/cjs/series/funnel/funnel.js +3 -0
  34. package/cjs/series/funnel/funnel.js.map +1 -1
  35. package/cjs/series/gauge/gauge-pointer.d.ts +2 -0
  36. package/cjs/series/gauge/gauge-pointer.js +3 -0
  37. package/cjs/series/gauge/gauge-pointer.js.map +1 -1
  38. package/cjs/series/gauge/gauge.d.ts +2 -0
  39. package/cjs/series/gauge/gauge.js +3 -0
  40. package/cjs/series/gauge/gauge.js.map +1 -1
  41. package/cjs/series/geo/geo.d.ts +2 -0
  42. package/cjs/series/geo/geo.js +3 -0
  43. package/cjs/series/geo/geo.js.map +1 -1
  44. package/cjs/series/heatmap/heatmap.d.ts +2 -0
  45. package/cjs/series/heatmap/heatmap.js +3 -0
  46. package/cjs/series/heatmap/heatmap.js.map +1 -1
  47. package/cjs/series/interface/series.d.ts +1 -0
  48. package/cjs/series/interface/series.js.map +1 -1
  49. package/cjs/series/line/line.d.ts +2 -0
  50. package/cjs/series/line/line.js +4 -1
  51. package/cjs/series/line/line.js.map +1 -1
  52. package/cjs/series/link/link.d.ts +1 -0
  53. package/cjs/series/link/link.js +3 -0
  54. package/cjs/series/link/link.js.map +1 -1
  55. package/cjs/series/map/map.d.ts +2 -0
  56. package/cjs/series/map/map.js +3 -0
  57. package/cjs/series/map/map.js.map +1 -1
  58. package/cjs/series/pie/pie.d.ts +1 -0
  59. package/cjs/series/pie/pie.js +3 -0
  60. package/cjs/series/pie/pie.js.map +1 -1
  61. package/cjs/series/progress/circular/circular.d.ts +2 -0
  62. package/cjs/series/progress/circular/circular.js +3 -0
  63. package/cjs/series/progress/circular/circular.js.map +1 -1
  64. package/cjs/series/progress/linear/linear.d.ts +2 -0
  65. package/cjs/series/progress/linear/linear.js +3 -0
  66. package/cjs/series/progress/linear/linear.js.map +1 -1
  67. package/cjs/series/radar/radar.d.ts +4 -2
  68. package/cjs/series/radar/radar.js +11 -0
  69. package/cjs/series/radar/radar.js.map +1 -1
  70. package/cjs/series/range-area/range-area.js.map +1 -1
  71. package/cjs/series/rose/rose.d.ts +2 -0
  72. package/cjs/series/rose/rose.js +3 -0
  73. package/cjs/series/rose/rose.js.map +1 -1
  74. package/cjs/series/sankey/sankey.d.ts +2 -0
  75. package/cjs/series/sankey/sankey.js +3 -0
  76. package/cjs/series/sankey/sankey.js.map +1 -1
  77. package/cjs/series/scatter/scatter.d.ts +2 -0
  78. package/cjs/series/scatter/scatter.js +3 -0
  79. package/cjs/series/scatter/scatter.js.map +1 -1
  80. package/cjs/series/sunburst/sunburst.d.ts +2 -0
  81. package/cjs/series/sunburst/sunburst.js +3 -0
  82. package/cjs/series/sunburst/sunburst.js.map +1 -1
  83. package/cjs/series/treemap/treemap.d.ts +2 -0
  84. package/cjs/series/treemap/treemap.js +3 -0
  85. package/cjs/series/treemap/treemap.js.map +1 -1
  86. package/cjs/series/word-cloud/base.d.ts +2 -0
  87. package/cjs/series/word-cloud/base.js +3 -0
  88. package/cjs/series/word-cloud/base.js.map +1 -1
  89. package/esm/chart/base-chart.js.map +1 -1
  90. package/esm/component/brush/brush.d.ts +1 -0
  91. package/esm/component/brush/brush.js +25 -16
  92. package/esm/component/brush/brush.js.map +1 -1
  93. package/esm/component/legend/discrete/legend.js +12 -9
  94. package/esm/component/legend/discrete/legend.js.map +1 -1
  95. package/esm/core/index.d.ts +1 -1
  96. package/esm/core/index.js +1 -1
  97. package/esm/core/index.js.map +1 -1
  98. package/esm/series/area/area.d.ts +4 -1
  99. package/esm/series/area/area.js +12 -1
  100. package/esm/series/area/area.js.map +1 -1
  101. package/esm/series/bar/bar.d.ts +2 -0
  102. package/esm/series/bar/bar.js +3 -0
  103. package/esm/series/bar/bar.js.map +1 -1
  104. package/esm/series/base/base-series.d.ts +1 -0
  105. package/esm/series/base/base-series.js +1 -1
  106. package/esm/series/base/base-series.js.map +1 -1
  107. package/esm/series/box-plot/box-plot.d.ts +2 -0
  108. package/esm/series/box-plot/box-plot.js +3 -0
  109. package/esm/series/box-plot/box-plot.js.map +1 -1
  110. package/esm/series/circle-packing/circle-packing.d.ts +2 -0
  111. package/esm/series/circle-packing/circle-packing.js +3 -0
  112. package/esm/series/circle-packing/circle-packing.js.map +1 -1
  113. package/esm/series/dot/dot.d.ts +1 -0
  114. package/esm/series/dot/dot.js +3 -0
  115. package/esm/series/dot/dot.js.map +1 -1
  116. package/esm/series/funnel/funnel.d.ts +2 -0
  117. package/esm/series/funnel/funnel.js +3 -0
  118. package/esm/series/funnel/funnel.js.map +1 -1
  119. package/esm/series/gauge/gauge-pointer.d.ts +2 -0
  120. package/esm/series/gauge/gauge-pointer.js +3 -0
  121. package/esm/series/gauge/gauge-pointer.js.map +1 -1
  122. package/esm/series/gauge/gauge.d.ts +2 -0
  123. package/esm/series/gauge/gauge.js +3 -0
  124. package/esm/series/gauge/gauge.js.map +1 -1
  125. package/esm/series/geo/geo.d.ts +2 -0
  126. package/esm/series/geo/geo.js +3 -0
  127. package/esm/series/geo/geo.js.map +1 -1
  128. package/esm/series/heatmap/heatmap.d.ts +2 -0
  129. package/esm/series/heatmap/heatmap.js +3 -0
  130. package/esm/series/heatmap/heatmap.js.map +1 -1
  131. package/esm/series/interface/series.d.ts +1 -0
  132. package/esm/series/interface/series.js.map +1 -1
  133. package/esm/series/line/line.d.ts +2 -0
  134. package/esm/series/line/line.js +4 -1
  135. package/esm/series/line/line.js.map +1 -1
  136. package/esm/series/link/link.d.ts +1 -0
  137. package/esm/series/link/link.js +3 -0
  138. package/esm/series/link/link.js.map +1 -1
  139. package/esm/series/map/map.d.ts +2 -0
  140. package/esm/series/map/map.js +3 -0
  141. package/esm/series/map/map.js.map +1 -1
  142. package/esm/series/pie/pie.d.ts +1 -0
  143. package/esm/series/pie/pie.js +3 -0
  144. package/esm/series/pie/pie.js.map +1 -1
  145. package/esm/series/progress/circular/circular.d.ts +2 -0
  146. package/esm/series/progress/circular/circular.js +3 -0
  147. package/esm/series/progress/circular/circular.js.map +1 -1
  148. package/esm/series/progress/linear/linear.d.ts +2 -0
  149. package/esm/series/progress/linear/linear.js +3 -0
  150. package/esm/series/progress/linear/linear.js.map +1 -1
  151. package/esm/series/radar/radar.d.ts +4 -2
  152. package/esm/series/radar/radar.js +12 -1
  153. package/esm/series/radar/radar.js.map +1 -1
  154. package/esm/series/range-area/range-area.js.map +1 -1
  155. package/esm/series/rose/rose.d.ts +2 -0
  156. package/esm/series/rose/rose.js +3 -0
  157. package/esm/series/rose/rose.js.map +1 -1
  158. package/esm/series/sankey/sankey.d.ts +2 -0
  159. package/esm/series/sankey/sankey.js +3 -0
  160. package/esm/series/sankey/sankey.js.map +1 -1
  161. package/esm/series/scatter/scatter.d.ts +2 -0
  162. package/esm/series/scatter/scatter.js +3 -0
  163. package/esm/series/scatter/scatter.js.map +1 -1
  164. package/esm/series/sunburst/sunburst.d.ts +2 -0
  165. package/esm/series/sunburst/sunburst.js +3 -0
  166. package/esm/series/sunburst/sunburst.js.map +1 -1
  167. package/esm/series/treemap/treemap.d.ts +2 -0
  168. package/esm/series/treemap/treemap.js +3 -0
  169. package/esm/series/treemap/treemap.js.map +1 -1
  170. package/esm/series/word-cloud/base.d.ts +2 -0
  171. package/esm/series/word-cloud/base.js +3 -0
  172. package/esm/series/word-cloud/base.js.map +1 -1
  173. package/package.json +5 -5
package/build/index.js CHANGED
@@ -63472,7 +63472,7 @@
63472
63472
  VChart.useMark([ComponentMark, GroupMark, ImageMark]);
63473
63473
  Factory.registerRegion('region', Region);
63474
63474
  Factory.registerLayout('base', Layout);
63475
- const version = "1.4.2";
63475
+ const version = "1.4.3";
63476
63476
  Logger.getInstance(LoggerLevel.Error);
63477
63477
 
63478
63478
  const WordCloud3dAnimation = (params) => {
@@ -66369,7 +66369,7 @@
66369
66369
  return [`${this.type}_${this.id}`];
66370
66370
  }
66371
66371
  getSeriesStyle(datum) {
66372
- return (attribute) => { var _a, _b; return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : null; };
66372
+ return (attribute) => { var _a, _b; return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined; };
66373
66373
  }
66374
66374
  _getSeriesInfo(field, keys) {
66375
66375
  const defaultShapeType = this.getDefaultShapeType();
@@ -67228,6 +67228,23 @@
67228
67228
  getDefaultShapeType() {
67229
67229
  return 'square';
67230
67230
  }
67231
+ getActiveMarks() {
67232
+ return [this._areaMark, this._symbolMark, this._lineMark];
67233
+ }
67234
+ getSeriesStyle(datum) {
67235
+ return (attribute) => {
67236
+ var _a, _b, _c, _d;
67237
+ let result = (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
67238
+ if (attribute === 'fill' && !result) {
67239
+ attribute = 'stroke';
67240
+ result = (_d = (_c = this._seriesMark) === null || _c === void 0 ? void 0 : _c.getAttribute(attribute, datum)) !== null && _d !== void 0 ? _d : undefined;
67241
+ }
67242
+ if (attribute === 'stroke' && isArray$4(result)) {
67243
+ return result[0];
67244
+ }
67245
+ return result;
67246
+ };
67247
+ }
67231
67248
  }
67232
67249
  AreaSeries.type = SeriesTypeEnum.area;
67233
67250
  AreaSeries.mark = areaSeriesMark;
@@ -69166,6 +69183,9 @@
69166
69183
  getDefaultShapeType() {
69167
69184
  return 'square';
69168
69185
  }
69186
+ getActiveMarks() {
69187
+ return [this._rectMark];
69188
+ }
69169
69189
  }
69170
69190
  BarSeries.type = SeriesTypeEnum.bar;
69171
69191
  BarSeries.mark = barSeriesMark;
@@ -69724,6 +69744,9 @@
69724
69744
  getDefaultShapeType() {
69725
69745
  return 'square';
69726
69746
  }
69747
+ getActiveMarks() {
69748
+ return [this._boxPlotMark];
69749
+ }
69727
69750
  }
69728
69751
  BoxPlotSeries.type = SeriesTypeEnum.boxPlot;
69729
69752
  BoxPlotSeries.mark = boxPlotSeriesMark;
@@ -70950,6 +70973,9 @@
70950
70973
  _noAnimationDataKey(datum, index) {
70951
70974
  return undefined;
70952
70975
  }
70976
+ getActiveMarks() {
70977
+ return [this._circlePackingMark];
70978
+ }
70953
70979
  }
70954
70980
  CirclePackingSeries.type = SeriesTypeEnum.circlePacking;
70955
70981
  CirclePackingSeries.mark = circlePackingSeriesMark;
@@ -71786,6 +71812,9 @@
71786
71812
  getDefaultShapeType() {
71787
71813
  return 'square';
71788
71814
  }
71815
+ getActiveMarks() {
71816
+ return [this._funnelMark];
71817
+ }
71789
71818
  }
71790
71819
  FunnelSeries.type = SeriesTypeEnum.funnel;
71791
71820
  FunnelSeries.mark = funnelSeriesMark;
@@ -72466,6 +72495,9 @@
72466
72495
  getDefaultShapeType() {
72467
72496
  return 'circle';
72468
72497
  }
72498
+ getActiveMarks() {
72499
+ return [];
72500
+ }
72469
72501
  }
72470
72502
  GaugePointerSeries.type = SeriesTypeEnum.gaugePointer;
72471
72503
  GaugePointerSeries.mark = gaugePointerSeriesMark;
@@ -72666,6 +72698,9 @@
72666
72698
  getDefaultShapeType() {
72667
72699
  return 'circle';
72668
72700
  }
72701
+ getActiveMarks() {
72702
+ return [];
72703
+ }
72669
72704
  }
72670
72705
  GaugeSeries.type = SeriesTypeEnum.gauge;
72671
72706
  GaugeSeries.mark = gaugeSeriesMark;
@@ -73082,6 +73117,9 @@
73082
73117
  getMeasureField() {
73083
73118
  return this.getFieldValue();
73084
73119
  }
73120
+ getActiveMarks() {
73121
+ return [this._cellMark];
73122
+ }
73085
73123
  }
73086
73124
  HeatmapSeries.type = SeriesTypeEnum.heatmap;
73087
73125
  HeatmapSeries.mark = heatmapSeriesMark;
@@ -73177,12 +73215,15 @@
73177
73215
  if (isLineAsSeriesMark) {
73178
73216
  attribute === 'fill' && (attribute = 'stroke');
73179
73217
  }
73180
- return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : null;
73218
+ return (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
73181
73219
  };
73182
73220
  }
73183
73221
  getDefaultShapeType() {
73184
73222
  return 'circle';
73185
73223
  }
73224
+ getActiveMarks() {
73225
+ return [this._lineMark, this._symbolMark];
73226
+ }
73186
73227
  }
73187
73228
  LineSeries.type = SeriesTypeEnum.line;
73188
73229
  LineSeries.mark = lineSeriesMark;
@@ -73539,6 +73580,9 @@
73539
73580
  (_a = this._mapViewData.getDataView()) === null || _a === void 0 ? void 0 : _a.reRunAllTransform();
73540
73581
  (_b = this._mapViewDataStatistics) === null || _b === void 0 ? void 0 : _b.reRunAllTransform();
73541
73582
  }
73583
+ getActiveMarks() {
73584
+ return [];
73585
+ }
73542
73586
  }
73543
73587
 
73544
73588
  const DEFAULT_MAP_LOOK_UP_KEY = `${PREFIX}_MAP_LOOK_UP_KEY`;
@@ -73809,6 +73853,9 @@
73809
73853
  _getDataIdKey() {
73810
73854
  return DEFAULT_DATA_INDEX;
73811
73855
  }
73856
+ getActiveMarks() {
73857
+ return [this._pathMark];
73858
+ }
73812
73859
  }
73813
73860
  MapSeries.type = SeriesTypeEnum.map;
73814
73861
  MapSeries.mark = mapSeriesMark;
@@ -74312,6 +74359,9 @@
74312
74359
  _noAnimationDataKey(datum, index) {
74313
74360
  return index;
74314
74361
  }
74362
+ getActiveMarks() {
74363
+ return [this._pieMark];
74364
+ }
74315
74365
  }
74316
74366
  BasePieSeries.mark = pieSeriesMark;
74317
74367
  class PieSeries extends BasePieSeries {
@@ -74568,6 +74618,9 @@
74568
74618
  }, appearPreset), userAnimationConfig(SeriesMarkNameEnum.progress, this._spec)));
74569
74619
  this._trackMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.progressBackground(), userAnimationConfig(SeriesMarkNameEnum.track, this._spec)));
74570
74620
  }
74621
+ getActiveMarks() {
74622
+ return [this._progressMark];
74623
+ }
74571
74624
  }
74572
74625
  CircularProgressSeries.type = SeriesTypeEnum.circularProgress;
74573
74626
  CircularProgressSeries.mark = circularProgressSeriesMark;
@@ -74787,6 +74840,9 @@
74787
74840
  initTooltip() {
74788
74841
  this._tooltipHelper = new LinearProgressSeriesTooltipHelper(this);
74789
74842
  }
74843
+ getActiveMarks() {
74844
+ return [this._progressMark];
74845
+ }
74790
74846
  }
74791
74847
  LinearProgressSeries.type = SeriesTypeEnum.linearProgress;
74792
74848
  LinearProgressSeries.mark = linearProgressSeriesMark;
@@ -75045,6 +75101,23 @@
75045
75101
  getDefaultShapeType() {
75046
75102
  return 'square';
75047
75103
  }
75104
+ getActiveMarks() {
75105
+ return [this._areaMark, this._symbolMark, this._lineMark];
75106
+ }
75107
+ getSeriesStyle(datum) {
75108
+ return (attribute) => {
75109
+ var _a, _b, _c, _d;
75110
+ let result = (_b = (_a = this._seriesMark) === null || _a === void 0 ? void 0 : _a.getAttribute(attribute, datum)) !== null && _b !== void 0 ? _b : undefined;
75111
+ if (attribute === 'fill' && !result) {
75112
+ attribute = 'stroke';
75113
+ result = (_d = (_c = this._seriesMark) === null || _c === void 0 ? void 0 : _c.getAttribute(attribute, datum)) !== null && _d !== void 0 ? _d : undefined;
75114
+ }
75115
+ if (attribute === 'stroke' && isArray$4(result)) {
75116
+ return result[0];
75117
+ }
75118
+ return result;
75119
+ };
75120
+ }
75048
75121
  }
75049
75122
  RadarSeries.type = SeriesTypeEnum.radar;
75050
75123
  RadarSeries.mark = radarSeriesMark;
@@ -75798,6 +75871,9 @@
75798
75871
  getDefaultShapeType() {
75799
75872
  return 'circle';
75800
75873
  }
75874
+ getActiveMarks() {
75875
+ return [this._roseMark];
75876
+ }
75801
75877
  }
75802
75878
  RoseSeries.type = SeriesTypeEnum.rose;
75803
75879
  RoseSeries.mark = roseSeriesMark;
@@ -77602,6 +77678,9 @@
77602
77678
  _noAnimationDataKey(datum, index) {
77603
77679
  return undefined;
77604
77680
  }
77681
+ getActiveMarks() {
77682
+ return [this._nodeMark, this._linkMark];
77683
+ }
77605
77684
  }
77606
77685
  SankeySeries.type = SeriesTypeEnum.sankey;
77607
77686
  SankeySeries.mark = sankeySeriesMark;
@@ -77876,6 +77955,9 @@
77876
77955
  getDefaultShapeType() {
77877
77956
  return 'circle';
77878
77957
  }
77958
+ getActiveMarks() {
77959
+ return [this._symbolMark];
77960
+ }
77879
77961
  }
77880
77962
  ScatterSeries.type = SeriesTypeEnum.scatter;
77881
77963
  ScatterSeries.mark = scatterSeriesMark;
@@ -78217,6 +78299,9 @@
78217
78299
  var _a, _b;
78218
78300
  return (_b = ((_a = this._linkMark) !== null && _a !== void 0 ? _a : this._arrowMark)) === null || _b === void 0 ? void 0 : _b.getData();
78219
78301
  }
78302
+ getActiveMarks() {
78303
+ return [this._linkMark, this._arrowMark];
78304
+ }
78220
78305
  }
78221
78306
  LinkSeries.type = SeriesTypeEnum.link;
78222
78307
  LinkSeries.mark = linkSeriesMark;
@@ -78655,6 +78740,9 @@
78655
78740
  getStackValueField() {
78656
78741
  return null;
78657
78742
  }
78743
+ getActiveMarks() {
78744
+ return [this._dotMark];
78745
+ }
78658
78746
  }
78659
78747
  DotSeries.type = SeriesTypeEnum.dot;
78660
78748
  DotSeries.mark = dotSeriesMark;
@@ -79218,6 +79306,9 @@
79218
79306
  _noAnimationDataKey(datum, index) {
79219
79307
  return undefined;
79220
79308
  }
79309
+ getActiveMarks() {
79310
+ return [this._sunburstMark];
79311
+ }
79221
79312
  }
79222
79313
  SunburstSeries.type = SeriesTypeEnum.sunburst;
79223
79314
  SunburstSeries.mark = sunburstSeriesMark;
@@ -79897,6 +79988,9 @@
79897
79988
  getDefaultShapeType() {
79898
79989
  return 'square';
79899
79990
  }
79991
+ getActiveMarks() {
79992
+ return [this._nonLeafMark, this._leafMark];
79993
+ }
79900
79994
  }
79901
79995
  TreemapSeries.type = SeriesTypeEnum.treemap;
79902
79996
  TreemapSeries.mark = treemapSeriesMark;
@@ -82899,6 +82993,9 @@
82899
82993
  super.onLayoutEnd(ctx);
82900
82994
  this.compile();
82901
82995
  }
82996
+ getActiveMarks() {
82997
+ return [this._wordMark, this._fillingWordMark];
82998
+ }
82902
82999
  }
82903
83000
  BaseWordCloudSeries.mark = wordCloudSeriesMark;
82904
83001
 
@@ -84578,6 +84675,8 @@
84578
84675
  }
84579
84676
  CustomMark.type = ComponentTypeEnum.customMark;
84580
84677
 
84678
+ const IN_BRUSH_STATE = 'inBrush';
84679
+ const OUT_BRUSH_STATE = 'outOfBrush';
84581
84680
  class Brush extends BaseComponent {
84582
84681
  constructor() {
84583
84682
  super(...arguments);
@@ -84594,7 +84693,20 @@
84594
84693
  this._linkedOutOfBrushElementsMap = {};
84595
84694
  this._needInitOutState = true;
84596
84695
  this._cacheInteractiveRangeAttrs = [];
84597
- this._needEnablePickable = false;
84696
+ this._needEnablePickable = true;
84697
+ }
84698
+ init() {
84699
+ var _a, _b;
84700
+ const inBrushMarkAttr = this._transformBrushedMarkAttr((_a = this._spec) === null || _a === void 0 ? void 0 : _a.inBrush);
84701
+ const outOfBrushMarkAttr = this._transformBrushedMarkAttr((_b = this._spec) === null || _b === void 0 ? void 0 : _b.outOfBrush);
84702
+ this._option.getAllSeries().forEach((s) => {
84703
+ s.getActiveMarks().forEach((m) => {
84704
+ if (m) {
84705
+ s.setMarkStyle(m, Object.assign({}, inBrushMarkAttr), IN_BRUSH_STATE, AttributeLevel.Series);
84706
+ s.setMarkStyle(m, Object.assign({}, outOfBrushMarkAttr), OUT_BRUSH_STATE, AttributeLevel.Series);
84707
+ }
84708
+ });
84709
+ });
84598
84710
  }
84599
84711
  static createComponent(spec, options) {
84600
84712
  const brushSpec = spec.brush || options.defaultSpec;
@@ -84664,7 +84776,7 @@
84664
84776
  const { operateType, operateMask } = operateParams;
84665
84777
  let operateTypeCache = operateType;
84666
84778
  if (this._needInitOutState && brushMode === 'single' && operateType === IOperateType.drawing) {
84667
- this._initMarkBrushState(componentIndex, 'outOfBrush');
84779
+ this._initMarkBrushState(componentIndex, OUT_BRUSH_STATE);
84668
84780
  }
84669
84781
  (_c = (_b = (_a = this._option) === null || _a === void 0 ? void 0 : _a.getChart()) === null || _b === void 0 ? void 0 : _b.getEvent()) === null || _c === void 0 ? void 0 : _c.on('click', p => {
84670
84782
  if (!p.mark && operateTypeCache === IOperateType.brushClear) {
@@ -84738,7 +84850,7 @@
84738
84850
  const graphicItem = el.getGraphicItem();
84739
84851
  const elementKey = mark.id + '_' + el.key;
84740
84852
  if (((_a = this._outOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) && this._isBrushContainItem(operateMask, graphicItem)) {
84741
- graphicItem.addState('inBrush');
84853
+ el.addState(IN_BRUSH_STATE);
84742
84854
  if (!this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
84743
84855
  this._inBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
84744
84856
  }
@@ -84747,8 +84859,8 @@
84747
84859
  }
84748
84860
  else if (((_c = (_b = this._inBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
84749
84861
  !this._isBrushContainItem(operateMask, graphicItem)) {
84750
- graphicItem.removeState('inBrush');
84751
- graphicItem.addState('outOfBrush');
84862
+ el.removeState(IN_BRUSH_STATE);
84863
+ el.addState(OUT_BRUSH_STATE);
84752
84864
  this._outOfBrushElementsMap[elementKey] = el;
84753
84865
  delete this._inBrushElementsMap[operateMask.name][elementKey];
84754
84866
  }
@@ -84774,7 +84886,7 @@
84774
84886
  const elementKey = mark.id + '_' + el.key;
84775
84887
  if (((_a = this._linkedOutOfBrushElementsMap) === null || _a === void 0 ? void 0 : _a[elementKey]) &&
84776
84888
  this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
84777
- graphicItem.addState('inBrush');
84889
+ el.addState(IN_BRUSH_STATE);
84778
84890
  if (!this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) {
84779
84891
  this._linkedInBrushElementsMap[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name] = {};
84780
84892
  }
@@ -84783,8 +84895,8 @@
84783
84895
  }
84784
84896
  else if (((_c = (_b = this._linkedInBrushElementsMap) === null || _b === void 0 ? void 0 : _b[operateMask === null || operateMask === void 0 ? void 0 : operateMask.name]) === null || _c === void 0 ? void 0 : _c[elementKey]) &&
84785
84897
  !this._isBrushContainItem(operateMask, graphicItem, { dx: regionOffsetX, dy: regionOffsetY })) {
84786
- graphicItem.removeState('inBrush');
84787
- graphicItem.addState('outOfBrush');
84898
+ el.removeState(IN_BRUSH_STATE);
84899
+ el.addState(OUT_BRUSH_STATE);
84788
84900
  this._linkedOutOfBrushElementsMap[elementKey] = el;
84789
84901
  }
84790
84902
  graphicItem.setAttribute('pickable', !this._needEnablePickable);
@@ -84892,7 +85004,6 @@
84892
85004
  });
84893
85005
  }
84894
85006
  _initMarkBrushState(componentIndex, stateName) {
84895
- var _a, _b;
84896
85007
  this._brushComponents.forEach((brush, index) => {
84897
85008
  if (index !== componentIndex) {
84898
85009
  brush.children[0].removeAllChild();
@@ -84902,8 +85013,6 @@
84902
85013
  this._outOfBrushElementsMap = {};
84903
85014
  this._linkedInBrushElementsMap = {};
84904
85015
  this._linkedOutOfBrushElementsMap = {};
84905
- const inBrushMarkAttr = this._transformBrushedMarkAttr((_a = this._spec) === null || _a === void 0 ? void 0 : _a.inBrush);
84906
- const outOfBrushMarkAttr = this._transformBrushedMarkAttr((_b = this._spec) === null || _b === void 0 ? void 0 : _b.outOfBrush);
84907
85016
  this._option.getAllSeries().forEach((s) => {
84908
85017
  s.getMarksWithoutRoot().forEach((mark) => {
84909
85018
  const grammarMark = mark.getProduct();
@@ -84912,18 +85021,10 @@
84912
85021
  }
84913
85022
  const elements = grammarMark.elements;
84914
85023
  elements.forEach((el) => {
84915
- const graphicItem = el.getGraphicItem();
84916
85024
  const elementKey = mark.id + '_' + el.key;
84917
- graphicItem.stateProxy = (stateName) => {
84918
- if (stateName === 'inBrush') {
84919
- return inBrushMarkAttr;
84920
- }
84921
- if (stateName === 'outOfBrush') {
84922
- return outOfBrushMarkAttr;
84923
- }
84924
- return;
84925
- };
84926
- graphicItem.addState(stateName);
85025
+ el.removeState(IN_BRUSH_STATE);
85026
+ el.removeState(OUT_BRUSH_STATE);
85027
+ el.addState(stateName);
84927
85028
  this._outOfBrushElementsMap[elementKey] = el;
84928
85029
  this._linkedOutOfBrushElementsMap[elementKey] = el;
84929
85030
  });
@@ -84983,7 +85084,7 @@
84983
85084
  }
84984
85085
  }
84985
85086
  Brush.type = ComponentTypeEnum.brush;
84986
- Brush.speckey = 'inBrush';
85087
+ Brush.speckey = 'brush';
84987
85088
 
84988
85089
  function overlap(a, b, sep = 0) {
84989
85090
  return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
@@ -88286,33 +88387,29 @@
88286
88387
  }
88287
88388
  _getLegendItems() {
88288
88389
  const originData = (this._legendData.getLatestData() || []).map((datum) => {
88289
- var _a;
88290
- const fill = datum.style('fill') || datum.style('stroke');
88291
- const stroke = datum.style('stroke');
88292
- const lineWidth = datum.style('lineWidth');
88293
- const symbolType = datum.style('symbolType');
88390
+ var _a, _b;
88294
88391
  const fillOpacity = datum.style('fillOpacity');
88295
88392
  const strokeOpacity = datum.style('strokeOpacity');
88296
88393
  const opacity = datum.style('opacity');
88297
88394
  const texture = datum.style('texture');
88298
- const textureColor = datum.style('textureColor');
88299
- const outerBorder = datum.style('outerBorder');
88300
- const innerBorder = datum.style('innerBorder');
88301
88395
  return {
88302
88396
  label: datum.key,
88303
88397
  shape: {
88304
- fill,
88305
- symbolType: (_a = symbolType !== null && symbolType !== void 0 ? symbolType : datum.shapeType) !== null && _a !== void 0 ? _a : 'circle',
88306
- stroke: lineWidth === 0 || fill === stroke ? null : stroke,
88398
+ symbolType: (_b = (_a = datum.style('symbolType')) !== null && _a !== void 0 ? _a : datum.shapeType) !== null && _b !== void 0 ? _b : 'circle',
88307
88399
  fillOpacity: isValidNumber$1(fillOpacity) ? fillOpacity : 1,
88308
88400
  strokeOpacity: isValidNumber$1(strokeOpacity) ? strokeOpacity : 1,
88309
88401
  opacity: isValidNumber$1(opacity) ? opacity : 1,
88310
- texture: texture,
88311
88402
  texturePadding: texture ? 1 : null,
88312
88403
  textureSize: texture ? 4 : null,
88313
- textureColor,
88314
- innerBorder,
88315
- outerBorder
88404
+ texture,
88405
+ fill: datum.style('fill'),
88406
+ stroke: datum.style('stroke'),
88407
+ textureColor: datum.style('textureColor'),
88408
+ innerBorder: datum.style('innerBorder'),
88409
+ outerBorder: datum.style('outerBorder'),
88410
+ lineDash: datum.style('lineDash'),
88411
+ lineDashOffset: datum.style('lineDashOffset'),
88412
+ lineWidth: datum.style('lineWidth')
88316
88413
  }
88317
88414
  };
88318
88415
  });