evui 3.4.70 → 3.4.71

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.
@@ -11224,7 +11224,7 @@ $({ target: 'Number', stat: true }, {
11224
11224
  /***/ "9224":
11225
11225
  /***/ (function(module) {
11226
11226
 
11227
- module.exports = JSON.parse("{\"a\":\"3.4.70\"}");
11227
+ module.exports = JSON.parse("{\"a\":\"3.4.71\"}");
11228
11228
 
11229
11229
  /***/ }),
11230
11230
 
@@ -41505,7 +41505,7 @@ var element_line_Line = /*#__PURE__*/function () {
41505
41505
 
41506
41506
  ['color', 'pointFill', 'fillColor'].forEach(function (colorProp) {
41507
41507
  if (_this[colorProp] === undefined) {
41508
- _this[colorProp] = colorProp === 'pointFill' ? _this.color : COLOR[sIdx];
41508
+ _this[colorProp] = colorProp === 'pointFill' ? _this.color : COLOR[sIdx % COLOR.length];
41509
41509
  }
41510
41510
  });
41511
41511
  this.type = 'line';
@@ -41584,7 +41584,7 @@ var element_line_Line = /*#__PURE__*/function () {
41584
41584
  }
41585
41585
 
41586
41586
  var getOpacity = function getOpacity(colorStr) {
41587
- return colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : extent.opacity;
41587
+ return colorStr !== null && colorStr !== void 0 && colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : extent.opacity;
41588
41588
  };
41589
41589
 
41590
41590
  var mainColor = this.color;
@@ -46546,6 +46546,9 @@ var plugins_title_modules = {
46546
46546
 
46547
46547
 
46548
46548
 
46549
+
46550
+
46551
+
46549
46552
 
46550
46553
 
46551
46554
  var plugins_legend_modules = {
@@ -46555,7 +46558,9 @@ var plugins_legend_modules = {
46555
46558
  * @returns {undefined}
46556
46559
  */
46557
46560
  createLegendLayout: function createLegendLayout() {
46558
- var _this$options, _this$options$legend;
46561
+ var _this$options,
46562
+ _this$options$legend,
46563
+ _this = this;
46559
46564
 
46560
46565
  this.legendDOM = document.createElement('div');
46561
46566
  this.legendDOM.className = 'ev-chart-legend';
@@ -46579,10 +46584,27 @@ var plugins_legend_modules = {
46579
46584
  } else {
46580
46585
  this.legendBoxDOM.style.overflowX = 'hidden';
46581
46586
  this.legendBoxDOM.style.overflowY = 'auto';
46587
+ this.legendBoxDOM.style.height = '100%';
46582
46588
  }
46583
46589
 
46584
46590
  this.legendDOM.appendChild(this.legendBoxDOM);
46585
46591
  this.wrapperDOM.appendChild(this.legendDOM);
46592
+
46593
+ if (this.options.legend.virtualScroll && !this.useTable) {
46594
+ this.legendTopSpacer = document.createElement('div');
46595
+ this.legendTopSpacer.className = 'ev-chart-legend--top-spacer';
46596
+ this.legendTopSpacer.style.clear = 'both';
46597
+ this.legendTopSpacer.style.opacity = 0;
46598
+ this.legendBottomSpacer = document.createElement('div');
46599
+ this.legendBottomSpacer.className = 'ev-chart-legend--bottom-spacer';
46600
+ this.legendBottomSpacer.style.clear = 'both';
46601
+ this.legendBottomSpacer.style.opacity = 0;
46602
+ this.legendBoxDOM.appendChild(this.legendTopSpacer);
46603
+ this.legendBoxDOM.appendChild(this.legendBottomSpacer);
46604
+ this.updateVisibleRowCountFrameId = requestAnimationFrame(function () {
46605
+ _this.updateVisibleRowCount();
46606
+ });
46607
+ }
46586
46608
  },
46587
46609
 
46588
46610
  /**
@@ -46593,7 +46615,7 @@ var plugins_legend_modules = {
46593
46615
  */
46594
46616
  setLegendColumnHeader: function setLegendColumnHeader() {
46595
46617
  var _this$options$legend2,
46596
- _this = this;
46618
+ _this2 = this;
46597
46619
 
46598
46620
  var tableOpt = (_this$options$legend2 = this.options.legend) === null || _this$options$legend2 === void 0 ? void 0 : _this$options$legend2.table;
46599
46621
  var columns = tableOpt.columns;
@@ -46614,7 +46636,7 @@ var plugins_legend_modules = {
46614
46636
  columnNameDOM.dataset.type = keyText;
46615
46637
  helpers_util.setDOMStyle(columnNameDOM, tableOpt === null || tableOpt === void 0 ? void 0 : (_tableOpt$style = tableOpt.style) === null || _tableOpt$style === void 0 ? void 0 : _tableOpt$style.header);
46616
46638
 
46617
- _this.legendTableDOM.append(columnNameDOM);
46639
+ _this2.legendTableDOM.append(columnNameDOM);
46618
46640
  }
46619
46641
  });
46620
46642
  },
@@ -46631,6 +46653,7 @@ var plugins_legend_modules = {
46631
46653
 
46632
46654
  this.isHeatMapType = this.options.type === 'heatMap';
46633
46655
  this.useTable = !!((_this$options$legend3 = this.options.legend) !== null && _this$options$legend3 !== void 0 && (_this$options$legend4 = _this$options$legend3.table) !== null && _this$options$legend4 !== void 0 && _this$options$legend4.use) && this.options.type !== 'heatmap' && this.options.type !== 'scatter';
46656
+ this.legendItemHeight = 18;
46634
46657
 
46635
46658
  if (!this.isInitLegend) {
46636
46659
  this.createLegendLayout();
@@ -46649,6 +46672,90 @@ var plugins_legend_modules = {
46649
46672
  this.isLegendMove = false;
46650
46673
  },
46651
46674
 
46675
+ /**
46676
+ * Calculate and update the number of rows and items per row that are visible
46677
+ * within the legend container based on its dimensions and the layout of the legend.
46678
+ * If the legend is positioned on the right or left, only one item per row is shown.
46679
+ * Otherwise, the number of items per row is determined by dividing the container width
46680
+ * by the item width.
46681
+ *
46682
+ * @returns {undefined}
46683
+ */
46684
+ updateVisibleRowCount: function updateVisibleRowCount() {
46685
+ var isLeftOrRight = this.options.legend.position === 'right' || this.options.legend.position === 'left';
46686
+ var legendBoxHeight = this.legendBoxDOM.clientHeight;
46687
+ var legendBoxWidth = this.legendBoxDOM.clientWidth;
46688
+ var itemWidth = Math.max(this.options.legend.width - 8, 1);
46689
+ var useLegendSeriesCount = Object.values(this.seriesList).filter(function (series) {
46690
+ return series.showLegend !== false;
46691
+ }).length;
46692
+ this.itemsPerRow = isLeftOrRight ? 1 : Math.floor(legendBoxWidth / itemWidth);
46693
+ this.totalRowCount = Math.ceil(useLegendSeriesCount / this.itemsPerRow);
46694
+ this.visibleRowCount = legendBoxHeight > this.legendItemHeight ? Math.round(legendBoxHeight / this.legendItemHeight) + 1 : this.totalRowCount;
46695
+ },
46696
+
46697
+ /**
46698
+ * Calculate and set the start and end row indexes for visible items within the
46699
+ * scrollable legend area. Determines the row range that should be displayed based
46700
+ * on the current scroll position and the height of each legend item.
46701
+ *
46702
+ * @returns {undefined}
46703
+ */
46704
+ updateStartEndRowIndex: function updateStartEndRowIndex() {
46705
+ var index = Math.max(Math.floor(this.legendBoxDOM.scrollTop / this.legendItemHeight), 0);
46706
+ this.startRowIndex = index > this.totalRowCount - 1 ? 0 : index;
46707
+ this.endRowIndex = this.startRowIndex + this.visibleRowCount;
46708
+ },
46709
+
46710
+ /**
46711
+ * Render only the visible legend items in the legend container based on the
46712
+ * calculated start and end row indexes. Removes existing legend items,
46713
+ * adjusts spacer heights to enable smooth scrolling, and adds only the items
46714
+ * within the visible range.
46715
+ *
46716
+ * @returns {undefined}
46717
+ */
46718
+ renderVisibleLegends: function renderVisibleLegends() {
46719
+ var _this3 = this;
46720
+
46721
+ this.updateStartEndRowIndex();
46722
+ var elementsToRemove = this.legendBoxDOM.querySelectorAll('.ev-chart-legend-container');
46723
+ elementsToRemove.forEach(function (element) {
46724
+ return element.remove();
46725
+ });
46726
+ var totalScrollHeight = this.totalRowCount * this.legendItemHeight;
46727
+ var top = this.startRowIndex * this.legendItemHeight;
46728
+ var bottom = Math.max(totalScrollHeight - this.visibleRowCount * this.legendItemHeight - top, 0);
46729
+ this.legendTopSpacer.style.height = "".concat(top, "px");
46730
+ this.legendBottomSpacer.style.height = "".concat(bottom, "px");
46731
+ var startIndex = this.startRowIndex * this.itemsPerRow;
46732
+ var endIndex = this.endRowIndex * this.itemsPerRow;
46733
+ var groups = this.data.groups.at(0);
46734
+ var useLegendSeries = [];
46735
+
46736
+ if (groups) {
46737
+ useLegendSeries = groups.slice().reverse().filter(function (sId) {
46738
+ return _this3.seriesList[sId].showLegend;
46739
+ }).map(function (sId) {
46740
+ return [sId, _this3.seriesList[sId]];
46741
+ });
46742
+ } else {
46743
+ useLegendSeries = Object.entries(this.seriesList).filter(function (_ref) {
46744
+ var _ref2 = _slicedToArray(_ref, 2),
46745
+ series = _ref2[1];
46746
+
46747
+ return series.showLegend;
46748
+ });
46749
+ }
46750
+
46751
+ useLegendSeries.slice(startIndex, endIndex).forEach(function (_ref3) {
46752
+ var _ref4 = _slicedToArray(_ref3, 2),
46753
+ series = _ref4[1];
46754
+
46755
+ _this3.addLegend(series);
46756
+ });
46757
+ },
46758
+
46652
46759
  /**
46653
46760
  * Add legend with group information to align each series properly.
46654
46761
  * Especially if a chart is stacked,
@@ -46657,36 +46764,86 @@ var plugins_legend_modules = {
46657
46764
  * @returns {undefined}
46658
46765
  */
46659
46766
  addLegendList: function addLegendList() {
46660
- var _this2 = this;
46767
+ var _this4 = this;
46661
46768
 
46662
46769
  var groups = this.data.groups;
46663
46770
  var seriesList = this.seriesList;
46771
+
46772
+ if (this.options.legend.virtualScroll) {
46773
+ if (this.useTable) {
46774
+ this.addLegendForGroups(groups, seriesList, true);
46775
+ this.addStandaloneLegends(seriesList, true);
46776
+ } else {
46777
+ this.renderVisibleLegendsFrameId = requestAnimationFrame(function () {
46778
+ _this4.renderVisibleLegends();
46779
+ });
46780
+ }
46781
+ } else {
46782
+ this.addLegendForGroups(groups, seriesList, this.useTable);
46783
+ this.addStandaloneLegends(seriesList, this.useTable);
46784
+ }
46785
+ },
46786
+
46787
+ /**
46788
+ * Adds legends for each group in `groups` array, iterating through each series
46789
+ * within the group in reverse order. This ensures the legends align with the series
46790
+ * order as displayed in the chart. Only adds series with `showLegend` set to `true`.
46791
+ *
46792
+ * @param {Array} groups - Array of groups containing series identifiers.
46793
+ * @param {Object} seriesList - Object containing all series, keyed by series ID.
46794
+ * @param {boolean} useTable - Determines whether to add legends with additional values.
46795
+ * @returns {undefined}
46796
+ */
46797
+ addLegendForGroups: function addLegendForGroups(groups, seriesList, useTable) {
46798
+ var _this5 = this;
46799
+
46664
46800
  groups.forEach(function (group) {
46665
46801
  group.slice().reverse().forEach(function (sId) {
46666
46802
  var series = seriesList[sId];
46667
46803
 
46668
46804
  if (series && series.showLegend) {
46669
- if (_this2.useTable) {
46670
- _this2.addLegendWithValues(series);
46671
- } else {
46672
- _this2.addLegend(series);
46673
- }
46805
+ _this5.addLegendBasedOnType(series, useTable);
46674
46806
  }
46675
46807
  });
46676
46808
  });
46677
- Object.values(seriesList).forEach(function (series) {
46678
- if (series.isExistGrp || !series.showLegend) {
46679
- return;
46680
- }
46809
+ },
46681
46810
 
46682
- if (_this2.useTable) {
46683
- _this2.addLegendWithValues(series);
46684
- } else {
46685
- _this2.addLegend(series);
46811
+ /**
46812
+ * Adds legends for series that are not part of any group. Iterates through each series
46813
+ * in `seriesList` and only adds those that are not assigned to any group (based on `isExistGrp`)
46814
+ * and have `showLegend` set to `true`.
46815
+ *
46816
+ * @param {Object} seriesList - Object containing all series, keyed by series ID.
46817
+ * @param {boolean} useTable - Determines whether to add legends with additional values.
46818
+ * @returns {undefined}
46819
+ */
46820
+ addStandaloneLegends: function addStandaloneLegends(seriesList, useTable) {
46821
+ var _this6 = this;
46822
+
46823
+ Object.values(seriesList).forEach(function (series) {
46824
+ if (!series.isExistGrp && series.showLegend) {
46825
+ _this6.addLegendBasedOnType(series, useTable);
46686
46826
  }
46687
46827
  });
46688
46828
  },
46689
46829
 
46830
+ /**
46831
+ * Adds a legend item for a specific series, determining whether to include additional
46832
+ * values based on the `useTable` parameter. Calls `addLegendWithValues` if `useTable` is true,
46833
+ * otherwise calls `addLegend`.
46834
+ *
46835
+ * @param {Object} series - Series object containing data to display in the legend.
46836
+ * @param {boolean} useTable - Determines whether to add legends with additional values.
46837
+ * @returns {undefined}
46838
+ */
46839
+ addLegendBasedOnType: function addLegendBasedOnType(series, useTable) {
46840
+ if (useTable) {
46841
+ this.addLegendWithValues(series);
46842
+ } else {
46843
+ this.addLegend(series);
46844
+ }
46845
+ },
46846
+
46690
46847
  /**
46691
46848
  * Add Legend with Color Information
46692
46849
  * Only Heatmap chart
@@ -46694,7 +46851,7 @@ var plugins_legend_modules = {
46694
46851
  * @returns {undefined}
46695
46852
  */
46696
46853
  addColorLegendList: function addColorLegendList() {
46697
- var _this3 = this;
46854
+ var _this7 = this;
46698
46855
 
46699
46856
  var seriesList = this.seriesList;
46700
46857
  Object.values(seriesList).forEach(function (series) {
@@ -46742,7 +46899,7 @@ var plugins_legend_modules = {
46742
46899
  }
46743
46900
  }
46744
46901
 
46745
- _this3.addLegend({
46902
+ _this7.addLegend({
46746
46903
  cId: id,
46747
46904
  color: color,
46748
46905
  name: name,
@@ -46785,7 +46942,7 @@ var plugins_legend_modules = {
46785
46942
  * @returns {undefined}
46786
46943
  */
46787
46944
  initEvent: function initEvent() {
46788
- var _this4 = this;
46945
+ var _this8 = this;
46789
46946
 
46790
46947
  if (this.isInitLegend) {
46791
46948
  return;
@@ -46804,15 +46961,15 @@ var plugins_legend_modules = {
46804
46961
  */
46805
46962
 
46806
46963
  this.onLegendBoxClick = function (e) {
46807
- var opt = _this4.options.legend;
46964
+ var opt = _this8.options.legend;
46808
46965
 
46809
46966
  if (opt !== null && opt !== void 0 && opt.stopClickEvt) {
46810
46967
  return;
46811
46968
  }
46812
46969
 
46813
- var chartIdx = _this4.data.chartIdx;
46970
+ var chartIdx = _this8.data.chartIdx;
46814
46971
 
46815
- var targetDOM = _this4.getContainerDOM(e);
46972
+ var targetDOM = _this8.getContainerDOM(e);
46816
46973
 
46817
46974
  if (!targetDOM) {
46818
46975
  return;
@@ -46824,7 +46981,7 @@ var plugins_legend_modules = {
46824
46981
  var valueDOMList = targetDOM === null || targetDOM === void 0 ? void 0 : targetDOM.getElementsByClassName(classList.value);
46825
46982
  var isActive = !(targetDOM !== null && targetDOM !== void 0 && targetDOM.className.includes('inactive'));
46826
46983
 
46827
- if (isActive && _this4.seriesInfo.count === 1) {
46984
+ if (isActive && _this8.seriesInfo.count === 1) {
46828
46985
  return;
46829
46986
  }
46830
46987
 
@@ -46833,7 +46990,7 @@ var plugins_legend_modules = {
46833
46990
  }
46834
46991
 
46835
46992
  if (isActive) {
46836
- _this4.seriesInfo.count--;
46993
+ _this8.seriesInfo.count--;
46837
46994
  var inactiveColor = opt.inactive;
46838
46995
  colorDOM.style.backgroundColor = inactiveColor;
46839
46996
  colorDOM.style.borderColor = inactiveColor;
@@ -46842,7 +46999,7 @@ var plugins_legend_modules = {
46842
46999
  dom.style.color = inactiveColor;
46843
47000
  });
46844
47001
  } else {
46845
- _this4.seriesInfo.count++;
47002
+ _this8.seriesInfo.count++;
46846
47003
  var seriesColor;
46847
47004
 
46848
47005
  if (typeof series.color !== 'string') {
@@ -46871,15 +47028,15 @@ var plugins_legend_modules = {
46871
47028
  series.show = !series.show;
46872
47029
  targetDOM.classList.toggle('inactive');
46873
47030
 
46874
- if (_this4.brushSeries) {
46875
- var seriesList = _toConsumableArray(_this4.brushSeries.list);
47031
+ if (_this8.brushSeries) {
47032
+ var seriesList = _toConsumableArray(_this8.brushSeries.list);
46876
47033
 
46877
- seriesList[chartIdx] = _this4.seriesList;
46878
- _this4.brushSeries.list = seriesList;
46879
- _this4.brushSeries.chartIdx = chartIdx;
47034
+ seriesList[chartIdx] = _this8.seriesList;
47035
+ _this8.brushSeries.list = seriesList;
47036
+ _this8.brushSeries.chartIdx = chartIdx;
46880
47037
  }
46881
47038
 
46882
- _this4.update({
47039
+ _this8.update({
46883
47040
  updateSeries: false,
46884
47041
  updateSelTip: {
46885
47042
  update: true,
@@ -46897,7 +47054,7 @@ var plugins_legend_modules = {
46897
47054
  this.onLegendBoxOver = function (e) {
46898
47055
  var _targetDOM$series;
46899
47056
 
46900
- var targetDOM = _this4.getContainerDOM(e);
47057
+ var targetDOM = _this8.getContainerDOM(e);
46901
47058
 
46902
47059
  if (!targetDOM) {
46903
47060
  return;
@@ -46906,10 +47063,10 @@ var plugins_legend_modules = {
46906
47063
  var targetId = targetDOM === null || targetDOM === void 0 ? void 0 : (_targetDOM$series = targetDOM.series) === null || _targetDOM$series === void 0 ? void 0 : _targetDOM$series.sId;
46907
47064
  var legendHitInfo = {
46908
47065
  sId: targetId,
46909
- type: _this4.options.type
47066
+ type: _this8.options.type
46910
47067
  };
46911
47068
 
46912
- _this4.update({
47069
+ _this8.update({
46913
47070
  updateSeries: false,
46914
47071
  updateSelTip: {
46915
47072
  update: false,
@@ -46928,7 +47085,7 @@ var plugins_legend_modules = {
46928
47085
 
46929
47086
 
46930
47087
  this.onLegendBoxLeave = function () {
46931
- _this4.update({
47088
+ _this8.update({
46932
47089
  updateSeries: false,
46933
47090
  updateSelTip: {
46934
47091
  update: false,
@@ -46943,6 +47100,12 @@ var plugins_legend_modules = {
46943
47100
  this.legendBoxDOM.addEventListener('click', this.onLegendBoxClick);
46944
47101
  this.legendBoxDOM.addEventListener('mouseover', this.onLegendBoxOver);
46945
47102
  this.legendBoxDOM.addEventListener('mouseleave', this.onLegendBoxLeave);
47103
+
47104
+ if (this.options.legend.virtualScroll && !this.useTable) {
47105
+ this.legendBoxDOM.addEventListener('resize', this.updateVisibleRowCount);
47106
+ this.legendBoxDOM.addEventListener('scroll', this.renderVisibleLegends.bind(this));
47107
+ }
47108
+
46946
47109
  this.initResizeEvent();
46947
47110
  },
46948
47111
 
@@ -46951,7 +47114,7 @@ var plugins_legend_modules = {
46951
47114
  * Only Heatmap
46952
47115
  */
46953
47116
  initEventForColorLegend: function initEventForColorLegend() {
46954
- var _this5 = this;
47117
+ var _this9 = this;
46955
47118
 
46956
47119
  if (this.isInitLegend) {
46957
47120
  return;
@@ -46966,15 +47129,15 @@ var plugins_legend_modules = {
46966
47129
  this.onLegendBoxClick = function (e) {
46967
47130
  var _targetDOM$series2;
46968
47131
 
46969
- var opt = _this5.options.legend;
47132
+ var opt = _this9.options.legend;
46970
47133
 
46971
47134
  if (opt !== null && opt !== void 0 && opt.stopClickEvt) {
46972
47135
  return;
46973
47136
  }
46974
47137
 
46975
- var series = Object.values(_this5.seriesList)[0];
47138
+ var series = Object.values(_this9.seriesList)[0];
46976
47139
 
46977
- var targetDOM = _this5.getContainerDOM(e);
47140
+ var targetDOM = _this9.getContainerDOM(e);
46978
47141
 
46979
47142
  if (!targetDOM) {
46980
47143
  return;
@@ -47018,7 +47181,7 @@ var plugins_legend_modules = {
47018
47181
  colorDOM.classList.toggle('inactive');
47019
47182
  nameDOM.classList.toggle('inactive');
47020
47183
 
47021
- _this5.update({
47184
+ _this9.update({
47022
47185
  updateSeries: false,
47023
47186
  updateSelTip: {
47024
47187
  update: true,
@@ -47036,9 +47199,9 @@ var plugins_legend_modules = {
47036
47199
  this.onLegendBoxOver = function (e) {
47037
47200
  var _Object$values, _targetDOM$series4;
47038
47201
 
47039
- var series = (_Object$values = Object.values(_this5.seriesList)) === null || _Object$values === void 0 ? void 0 : _Object$values[0];
47202
+ var series = (_Object$values = Object.values(_this9.seriesList)) === null || _Object$values === void 0 ? void 0 : _Object$values[0];
47040
47203
 
47041
- var targetDOM = _this5.getContainerDOM(e);
47204
+ var targetDOM = _this9.getContainerDOM(e);
47042
47205
 
47043
47206
  if (!targetDOM) {
47044
47207
  return;
@@ -47047,13 +47210,13 @@ var plugins_legend_modules = {
47047
47210
  var targetId = targetDOM === null || targetDOM === void 0 ? void 0 : (_targetDOM$series4 = targetDOM.series) === null || _targetDOM$series4 === void 0 ? void 0 : _targetDOM$series4.cId;
47048
47211
  var legendHitInfo = {
47049
47212
  sId: targetId,
47050
- type: _this5.options.type
47213
+ type: _this9.options.type
47051
47214
  };
47052
47215
  series.colorState.forEach(function (colorItem) {
47053
47216
  colorItem.state = colorItem.id === targetId ? 'highlight' : 'downplay';
47054
47217
  });
47055
47218
 
47056
- _this5.update({
47219
+ _this9.update({
47057
47220
  updateSeries: false,
47058
47221
  updateSelTip: {
47059
47222
  update: false,
@@ -47072,12 +47235,12 @@ var plugins_legend_modules = {
47072
47235
 
47073
47236
 
47074
47237
  this.onLegendBoxLeave = function () {
47075
- var series = Object.values(_this5.seriesList)[0];
47238
+ var series = Object.values(_this9.seriesList)[0];
47076
47239
  series.colorState.forEach(function (item) {
47077
47240
  item.state = 'normal';
47078
47241
  });
47079
47242
 
47080
- _this5.update({
47243
+ _this9.update({
47081
47244
  updateSeries: false,
47082
47245
  updateSelTip: {
47083
47246
  update: false,
@@ -47092,7 +47255,7 @@ var plugins_legend_modules = {
47092
47255
  this.initResizeEvent();
47093
47256
  },
47094
47257
  initResizeEvent: function initResizeEvent() {
47095
- var _this6 = this;
47258
+ var _this10 = this;
47096
47259
 
47097
47260
  /**
47098
47261
  * callback for resizeDOM click event
@@ -47104,33 +47267,33 @@ var plugins_legend_modules = {
47104
47267
  this.onResizeMouseDown = function (e) {
47105
47268
  e.stopPropagation();
47106
47269
  e.preventDefault();
47107
- var opt = _this6.options;
47270
+ var opt = _this10.options;
47108
47271
  var pos = opt.legend.position;
47109
47272
  var title = opt.title.show ? opt.title.height : 0;
47110
- var ghostDOM = _this6.ghostDOM;
47111
- _this6.resizeDOM.style.display = 'none';
47273
+ var ghostDOM = _this10.ghostDOM;
47274
+ _this10.resizeDOM.style.display = 'none';
47112
47275
 
47113
- _this6.wrapperDOM.appendChild(ghostDOM); // mouse down 시, resizeDOM의 위치를 기반으로 ghostDOM의 위치를 세팅
47276
+ _this10.wrapperDOM.appendChild(ghostDOM); // mouse down 시, resizeDOM의 위치를 기반으로 ghostDOM의 위치를 세팅
47114
47277
 
47115
47278
 
47116
47279
  if (pos === 'left' || pos === 'right') {
47117
47280
  ghostDOM.style.top = "".concat(title, "px");
47118
- ghostDOM.style.left = _this6.resizeDOM.style.left;
47119
- ghostDOM.style.right = _this6.resizeDOM.style.right;
47120
- ghostDOM.style.height = _this6.resizeDOM.style.height;
47281
+ ghostDOM.style.left = _this10.resizeDOM.style.left;
47282
+ ghostDOM.style.right = _this10.resizeDOM.style.right;
47283
+ ghostDOM.style.height = _this10.resizeDOM.style.height;
47121
47284
  } else {
47122
47285
  ghostDOM.classList.add('horizontal');
47123
47286
 
47124
47287
  if (pos === 'top') {
47125
- ghostDOM.style.top = _this6.resizeDOM.style.top;
47288
+ ghostDOM.style.top = _this10.resizeDOM.style.top;
47126
47289
  } else if (pos === 'bottom') {
47127
- ghostDOM.style.bottom = _this6.resizeDOM.style.bottom;
47290
+ ghostDOM.style.bottom = _this10.resizeDOM.style.bottom;
47128
47291
  }
47129
47292
  }
47130
47293
 
47131
- _this6.wrapperDOM.addEventListener('mousemove', _this6.mouseMove, false);
47294
+ _this10.wrapperDOM.addEventListener('mousemove', _this10.mouseMove, false);
47132
47295
 
47133
- _this6.wrapperDOM.addEventListener('mouseup', _this6.mouseUp, false);
47296
+ _this10.wrapperDOM.addEventListener('mouseup', _this10.mouseUp, false);
47134
47297
  };
47135
47298
 
47136
47299
  if (this.resizeDOM) {
@@ -47167,7 +47330,7 @@ var plugins_legend_modules = {
47167
47330
  _this$options2$legend,
47168
47331
  _this$options2$legend2,
47169
47332
  _this$legendBoxDOM,
47170
- _this7 = this;
47333
+ _this11 = this;
47171
47334
 
47172
47335
  var columns = (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : (_this$options2$legend = _this$options2.legend) === null || _this$options2$legend === void 0 ? void 0 : (_this$options2$legend2 = _this$options2$legend.table) === null || _this$options2$legend2 === void 0 ? void 0 : _this$options2$legend2.columns;
47173
47336
  var aggregations = this.getAggregations();
@@ -47185,7 +47348,7 @@ var plugins_legend_modules = {
47185
47348
 
47186
47349
  var seriesId = row.series.sId;
47187
47350
  var value = aggregations === null || aggregations === void 0 ? void 0 : (_aggregations$seriesI = aggregations[seriesId]) === null || _aggregations$seriesI === void 0 ? void 0 : _aggregations$seriesI[key];
47188
- dom.textContent = _this7.getFormattedValue(columns[key], value);
47351
+ dom.textContent = _this11.getFormattedValue(columns[key], value);
47189
47352
  });
47190
47353
  });
47191
47354
  },
@@ -47202,6 +47365,7 @@ var plugins_legend_modules = {
47202
47365
 
47203
47366
  /**
47204
47367
  * To update legend, remove all of legendBoxDOM's children
47368
+ * (except spacers when virtualScroll is enabled)
47205
47369
  *
47206
47370
  * @returns {undefined}
47207
47371
  */
@@ -47220,6 +47384,11 @@ var plugins_legend_modules = {
47220
47384
  }
47221
47385
 
47222
47386
  this.setLegendColumnHeader();
47387
+ } else if (this.options.legend.virtualScroll) {
47388
+ var elementsToRemove = this.legendBoxDOM.querySelectorAll('.ev-chart-legend-container');
47389
+ elementsToRemove.forEach(function (element) {
47390
+ return element.remove();
47391
+ });
47223
47392
  } else {
47224
47393
  while (legendBoxDOM.hasChildNodes()) {
47225
47394
  legendBoxDOM.removeChild(legendBoxDOM.firstChild);
@@ -47237,6 +47406,16 @@ var plugins_legend_modules = {
47237
47406
  destroyLegend: function destroyLegend() {
47238
47407
  var legendDOM = this.legendDOM;
47239
47408
 
47409
+ if (this.renderVisibleLegendsFrameId != null) {
47410
+ cancelAnimationFrame(this.renderVisibleLegendsFrameId);
47411
+ this.renderVisibleLegendsFrameId = null;
47412
+ }
47413
+
47414
+ if (this.updateVisibleRowCountFrameId != null) {
47415
+ cancelAnimationFrame(this.updateVisibleRowCountFrameId);
47416
+ this.updateVisibleRowCountFrameId = null;
47417
+ }
47418
+
47240
47419
  if (!legendDOM) {
47241
47420
  return;
47242
47421
  }
@@ -47292,7 +47471,6 @@ var plugins_legend_modules = {
47292
47471
  nameDOM.textContent = series.name;
47293
47472
  nameDOM.setAttribute('title', series.name);
47294
47473
  nameDOM.dataset.type = 'name';
47295
- this.legendDOM.style.padding = '5px 0 0 0';
47296
47474
  containerDOM.appendChild(colorDOM);
47297
47475
  containerDOM.appendChild(nameDOM);
47298
47476
 
@@ -47303,11 +47481,11 @@ var plugins_legend_modules = {
47303
47481
  containerDOM.style.width = '100%';
47304
47482
  }
47305
47483
 
47306
- containerDOM.style.height = '18px';
47484
+ containerDOM.style.height = "".concat(this.legendItemHeight, "px");
47307
47485
  containerDOM.style.display = 'inline-block';
47308
47486
  containerDOM.style.overflow = 'hidden';
47309
47487
  containerDOM.dataset.type = 'container';
47310
- this.legendBoxDOM.appendChild(containerDOM);
47488
+ this.legendBoxDOM.insertBefore(containerDOM, this.legendBottomSpacer);
47311
47489
 
47312
47490
  if (series.show) {
47313
47491
  this.seriesInfo.count++;
@@ -47325,7 +47503,7 @@ var plugins_legend_modules = {
47325
47503
  _opt$table3,
47326
47504
  _opt$table3$style,
47327
47505
  _columns$name,
47328
- _this8 = this;
47506
+ _this12 = this;
47329
47507
 
47330
47508
  var opt = this.options.legend;
47331
47509
  var columns = opt === null || opt === void 0 ? void 0 : (_opt$table2 = opt.table) === null || _opt$table2 === void 0 ? void 0 : _opt$table2.columns;
@@ -47421,7 +47599,7 @@ var plugins_legend_modules = {
47421
47599
  if (columns[key].use) {
47422
47600
  var _columns$key2;
47423
47601
 
47424
- var formattedTxt = _this8.getFormattedValue(columns[key], aggregations[key]);
47602
+ var formattedTxt = _this12.getFormattedValue(columns[key], aggregations[key]);
47425
47603
 
47426
47604
  var valueDOM = document.createElement('td');
47427
47605
  valueDOM.className = 'ev-chart-legend--table__value';
@@ -47463,15 +47641,15 @@ var plugins_legend_modules = {
47463
47641
  var title = opt !== null && opt !== void 0 && (_opt$title = opt.title) !== null && _opt$title !== void 0 && _opt$title.show ? opt === null || opt === void 0 ? void 0 : (_opt$title2 = opt.title) === null || _opt$title2 === void 0 ? void 0 : _opt$title2.height : 0;
47464
47642
  var positionTop = title + (opt === null || opt === void 0 ? void 0 : (_opt$legend2 = opt.legend) === null || _opt$legend2 === void 0 ? void 0 : _opt$legend2.height);
47465
47643
 
47466
- var _ref = (_opt$legend$padding = opt === null || opt === void 0 ? void 0 : (_opt$legend3 = opt.legend) === null || _opt$legend3 === void 0 ? void 0 : _opt$legend3.padding) !== null && _opt$legend$padding !== void 0 ? _opt$legend$padding : {},
47467
- _ref$top = _ref.top,
47468
- top = _ref$top === void 0 ? 0 : _ref$top,
47469
- _ref$bottom = _ref.bottom,
47470
- bottom = _ref$bottom === void 0 ? 0 : _ref$bottom,
47471
- _ref$left = _ref.left,
47472
- left = _ref$left === void 0 ? 0 : _ref$left,
47473
- _ref$right = _ref.right,
47474
- right = _ref$right === void 0 ? 0 : _ref$right;
47644
+ var _ref5 = (_opt$legend$padding = opt === null || opt === void 0 ? void 0 : (_opt$legend3 = opt.legend) === null || _opt$legend3 === void 0 ? void 0 : _opt$legend3.padding) !== null && _opt$legend$padding !== void 0 ? _opt$legend$padding : {},
47645
+ _ref5$top = _ref5.top,
47646
+ top = _ref5$top === void 0 ? 0 : _ref5$top,
47647
+ _ref5$bottom = _ref5.bottom,
47648
+ bottom = _ref5$bottom === void 0 ? 0 : _ref5$bottom,
47649
+ _ref5$left = _ref5.left,
47650
+ left = _ref5$left === void 0 ? 0 : _ref5$left,
47651
+ _ref5$right = _ref5.right,
47652
+ right = _ref5$right === void 0 ? 0 : _ref5$right;
47475
47653
 
47476
47654
  if (!wrapperStyle || !legendStyle) {
47477
47655
  return;
@@ -47815,9 +47993,9 @@ var plugins_legend_modules = {
47815
47993
  * @param value
47816
47994
  * @returns {string}
47817
47995
  */
47818
- getFormattedValue: function getFormattedValue(_ref2, value) {
47819
- var formatter = _ref2.formatter,
47820
- decimalPoint = _ref2.decimalPoint;
47996
+ getFormattedValue: function getFormattedValue(_ref6, value) {
47997
+ var formatter = _ref6.formatter,
47998
+ decimalPoint = _ref6.decimalPoint;
47821
47999
 
47822
48000
  if (value === undefined || value === null) {
47823
48001
  return 'Null';
@@ -54117,6 +54295,11 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54117
54295
  if (this.options.legend.type === 'gradient') {
54118
54296
  this.legendBoxDOM.removeEventListener('mousedown', this.onLegendMouseDown);
54119
54297
  }
54298
+
54299
+ if (this.options.legend.virtualScroll && !this.useTable) {
54300
+ this.legendBoxDOM.removeEventListener('resize', this.updateVisibleRowCount);
54301
+ this.legendBoxDOM.removeEventListener('scroll', this.renderVisibleLegends);
54302
+ }
54120
54303
  }
54121
54304
 
54122
54305
  if (this.resizeDOM) {
@@ -54141,6 +54324,16 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54141
54324
  this.tooltipDOM = null;
54142
54325
  }
54143
54326
 
54327
+ if (this.renderVisibleLegendsFrameId != null) {
54328
+ cancelAnimationFrame(this.renderVisibleLegendsFrameId);
54329
+ this.renderVisibleLegendsFrameId = null;
54330
+ }
54331
+
54332
+ if (this.updateVisibleRowCountFrameId != null) {
54333
+ cancelAnimationFrame(this.updateVisibleRowCountFrameId);
54334
+ this.updateVisibleRowCountFrameId = null;
54335
+ }
54336
+
54144
54337
  this.wrapperDOM = null;
54145
54338
  this.chartDOM = null;
54146
54339
  this.legendDOM = null;
@@ -54831,6 +55024,7 @@ var DEFAULT_OPTIONS = {
54831
55024
  width: 140,
54832
55025
  height: 24,
54833
55026
  allowResize: false,
55027
+ virtualScroll: false,
54834
55028
  table: {
54835
55029
  use: false,
54836
55030
  columns: {