evui 3.4.70 → 3.4.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evui.common.js +273 -81
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +273 -81
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/chart.core.js +13 -0
- package/src/components/chart/element/element.line.js +2 -2
- package/src/components/chart/plugins/plugins.legend.js +178 -23
- package/src/components/chart/uses.js +1 -0
package/dist/evui.common.js
CHANGED
|
@@ -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.
|
|
11227
|
+
module.exports = JSON.parse("{\"a\":\"3.4.72\"}");
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
46670
|
-
_this2.addLegendWithValues(series);
|
|
46671
|
-
} else {
|
|
46672
|
-
_this2.addLegend(series);
|
|
46673
|
-
}
|
|
46805
|
+
_this5.addLegendBasedOnType(series, useTable);
|
|
46674
46806
|
}
|
|
46675
46807
|
});
|
|
46676
46808
|
});
|
|
46677
|
-
|
|
46678
|
-
if (series.isExistGrp || !series.showLegend) {
|
|
46679
|
-
return;
|
|
46680
|
-
}
|
|
46809
|
+
},
|
|
46681
46810
|
|
|
46682
|
-
|
|
46683
|
-
|
|
46684
|
-
|
|
46685
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
46970
|
+
var chartIdx = _this8.data.chartIdx;
|
|
46814
46971
|
|
|
46815
|
-
var targetDOM =
|
|
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 &&
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
46875
|
-
var seriesList = _toConsumableArray(
|
|
47031
|
+
if (_this8.brushSeries) {
|
|
47032
|
+
var seriesList = _toConsumableArray(_this8.brushSeries.list);
|
|
46876
47033
|
|
|
46877
|
-
seriesList[chartIdx] =
|
|
46878
|
-
|
|
46879
|
-
|
|
47034
|
+
seriesList[chartIdx] = _this8.seriesList;
|
|
47035
|
+
_this8.brushSeries.list = seriesList;
|
|
47036
|
+
_this8.brushSeries.chartIdx = chartIdx;
|
|
46880
47037
|
}
|
|
46881
47038
|
|
|
46882
|
-
|
|
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 =
|
|
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:
|
|
47066
|
+
type: _this8.options.type
|
|
46910
47067
|
};
|
|
46911
47068
|
|
|
46912
|
-
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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(
|
|
47138
|
+
var series = Object.values(_this9.seriesList)[0];
|
|
46976
47139
|
|
|
46977
|
-
var targetDOM =
|
|
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
|
-
|
|
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(
|
|
47202
|
+
var series = (_Object$values = Object.values(_this9.seriesList)) === null || _Object$values === void 0 ? void 0 : _Object$values[0];
|
|
47040
47203
|
|
|
47041
|
-
var targetDOM =
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
47111
|
-
|
|
47273
|
+
var ghostDOM = _this10.ghostDOM;
|
|
47274
|
+
_this10.resizeDOM.style.display = 'none';
|
|
47112
47275
|
|
|
47113
|
-
|
|
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 =
|
|
47119
|
-
ghostDOM.style.right =
|
|
47120
|
-
ghostDOM.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 =
|
|
47288
|
+
ghostDOM.style.top = _this10.resizeDOM.style.top;
|
|
47126
47289
|
} else if (pos === 'bottom') {
|
|
47127
|
-
ghostDOM.style.bottom =
|
|
47290
|
+
ghostDOM.style.bottom = _this10.resizeDOM.style.bottom;
|
|
47128
47291
|
}
|
|
47129
47292
|
}
|
|
47130
47293
|
|
|
47131
|
-
|
|
47294
|
+
_this10.wrapperDOM.addEventListener('mousemove', _this10.mouseMove, false);
|
|
47132
47295
|
|
|
47133
|
-
|
|
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
|
-
|
|
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 =
|
|
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,9 @@ var plugins_legend_modules = {
|
|
|
47220
47384
|
}
|
|
47221
47385
|
|
|
47222
47386
|
this.setLegendColumnHeader();
|
|
47387
|
+
} else if (this.options.legend.virtualScroll) {
|
|
47388
|
+
this.updateVisibleRowCount();
|
|
47389
|
+
this.renderVisibleLegends();
|
|
47223
47390
|
} else {
|
|
47224
47391
|
while (legendBoxDOM.hasChildNodes()) {
|
|
47225
47392
|
legendBoxDOM.removeChild(legendBoxDOM.firstChild);
|
|
@@ -47237,6 +47404,16 @@ var plugins_legend_modules = {
|
|
|
47237
47404
|
destroyLegend: function destroyLegend() {
|
|
47238
47405
|
var legendDOM = this.legendDOM;
|
|
47239
47406
|
|
|
47407
|
+
if (this.renderVisibleLegendsFrameId != null) {
|
|
47408
|
+
cancelAnimationFrame(this.renderVisibleLegendsFrameId);
|
|
47409
|
+
this.renderVisibleLegendsFrameId = null;
|
|
47410
|
+
}
|
|
47411
|
+
|
|
47412
|
+
if (this.updateVisibleRowCountFrameId != null) {
|
|
47413
|
+
cancelAnimationFrame(this.updateVisibleRowCountFrameId);
|
|
47414
|
+
this.updateVisibleRowCountFrameId = null;
|
|
47415
|
+
}
|
|
47416
|
+
|
|
47240
47417
|
if (!legendDOM) {
|
|
47241
47418
|
return;
|
|
47242
47419
|
}
|
|
@@ -47292,7 +47469,6 @@ var plugins_legend_modules = {
|
|
|
47292
47469
|
nameDOM.textContent = series.name;
|
|
47293
47470
|
nameDOM.setAttribute('title', series.name);
|
|
47294
47471
|
nameDOM.dataset.type = 'name';
|
|
47295
|
-
this.legendDOM.style.padding = '5px 0 0 0';
|
|
47296
47472
|
containerDOM.appendChild(colorDOM);
|
|
47297
47473
|
containerDOM.appendChild(nameDOM);
|
|
47298
47474
|
|
|
@@ -47303,11 +47479,11 @@ var plugins_legend_modules = {
|
|
|
47303
47479
|
containerDOM.style.width = '100%';
|
|
47304
47480
|
}
|
|
47305
47481
|
|
|
47306
|
-
containerDOM.style.height =
|
|
47482
|
+
containerDOM.style.height = "".concat(this.legendItemHeight, "px");
|
|
47307
47483
|
containerDOM.style.display = 'inline-block';
|
|
47308
47484
|
containerDOM.style.overflow = 'hidden';
|
|
47309
47485
|
containerDOM.dataset.type = 'container';
|
|
47310
|
-
this.legendBoxDOM.
|
|
47486
|
+
this.legendBoxDOM.insertBefore(containerDOM, this.legendBottomSpacer);
|
|
47311
47487
|
|
|
47312
47488
|
if (series.show) {
|
|
47313
47489
|
this.seriesInfo.count++;
|
|
@@ -47325,7 +47501,7 @@ var plugins_legend_modules = {
|
|
|
47325
47501
|
_opt$table3,
|
|
47326
47502
|
_opt$table3$style,
|
|
47327
47503
|
_columns$name,
|
|
47328
|
-
|
|
47504
|
+
_this12 = this;
|
|
47329
47505
|
|
|
47330
47506
|
var opt = this.options.legend;
|
|
47331
47507
|
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 +47597,7 @@ var plugins_legend_modules = {
|
|
|
47421
47597
|
if (columns[key].use) {
|
|
47422
47598
|
var _columns$key2;
|
|
47423
47599
|
|
|
47424
|
-
var formattedTxt =
|
|
47600
|
+
var formattedTxt = _this12.getFormattedValue(columns[key], aggregations[key]);
|
|
47425
47601
|
|
|
47426
47602
|
var valueDOM = document.createElement('td');
|
|
47427
47603
|
valueDOM.className = 'ev-chart-legend--table__value';
|
|
@@ -47463,15 +47639,15 @@ var plugins_legend_modules = {
|
|
|
47463
47639
|
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
47640
|
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
47641
|
|
|
47466
|
-
var
|
|
47467
|
-
|
|
47468
|
-
top =
|
|
47469
|
-
|
|
47470
|
-
bottom =
|
|
47471
|
-
|
|
47472
|
-
left =
|
|
47473
|
-
|
|
47474
|
-
right =
|
|
47642
|
+
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 : {},
|
|
47643
|
+
_ref5$top = _ref5.top,
|
|
47644
|
+
top = _ref5$top === void 0 ? 0 : _ref5$top,
|
|
47645
|
+
_ref5$bottom = _ref5.bottom,
|
|
47646
|
+
bottom = _ref5$bottom === void 0 ? 0 : _ref5$bottom,
|
|
47647
|
+
_ref5$left = _ref5.left,
|
|
47648
|
+
left = _ref5$left === void 0 ? 0 : _ref5$left,
|
|
47649
|
+
_ref5$right = _ref5.right,
|
|
47650
|
+
right = _ref5$right === void 0 ? 0 : _ref5$right;
|
|
47475
47651
|
|
|
47476
47652
|
if (!wrapperStyle || !legendStyle) {
|
|
47477
47653
|
return;
|
|
@@ -47815,9 +47991,9 @@ var plugins_legend_modules = {
|
|
|
47815
47991
|
* @param value
|
|
47816
47992
|
* @returns {string}
|
|
47817
47993
|
*/
|
|
47818
|
-
getFormattedValue: function getFormattedValue(
|
|
47819
|
-
var formatter =
|
|
47820
|
-
decimalPoint =
|
|
47994
|
+
getFormattedValue: function getFormattedValue(_ref6, value) {
|
|
47995
|
+
var formatter = _ref6.formatter,
|
|
47996
|
+
decimalPoint = _ref6.decimalPoint;
|
|
47821
47997
|
|
|
47822
47998
|
if (value === undefined || value === null) {
|
|
47823
47999
|
return 'Null';
|
|
@@ -54117,6 +54293,11 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54117
54293
|
if (this.options.legend.type === 'gradient') {
|
|
54118
54294
|
this.legendBoxDOM.removeEventListener('mousedown', this.onLegendMouseDown);
|
|
54119
54295
|
}
|
|
54296
|
+
|
|
54297
|
+
if (this.options.legend.virtualScroll && !this.useTable) {
|
|
54298
|
+
this.legendBoxDOM.removeEventListener('resize', this.updateVisibleRowCount);
|
|
54299
|
+
this.legendBoxDOM.removeEventListener('scroll', this.renderVisibleLegends);
|
|
54300
|
+
}
|
|
54120
54301
|
}
|
|
54121
54302
|
|
|
54122
54303
|
if (this.resizeDOM) {
|
|
@@ -54141,6 +54322,16 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54141
54322
|
this.tooltipDOM = null;
|
|
54142
54323
|
}
|
|
54143
54324
|
|
|
54325
|
+
if (this.renderVisibleLegendsFrameId != null) {
|
|
54326
|
+
cancelAnimationFrame(this.renderVisibleLegendsFrameId);
|
|
54327
|
+
this.renderVisibleLegendsFrameId = null;
|
|
54328
|
+
}
|
|
54329
|
+
|
|
54330
|
+
if (this.updateVisibleRowCountFrameId != null) {
|
|
54331
|
+
cancelAnimationFrame(this.updateVisibleRowCountFrameId);
|
|
54332
|
+
this.updateVisibleRowCountFrameId = null;
|
|
54333
|
+
}
|
|
54334
|
+
|
|
54144
54335
|
this.wrapperDOM = null;
|
|
54145
54336
|
this.chartDOM = null;
|
|
54146
54337
|
this.legendDOM = null;
|
|
@@ -54831,6 +55022,7 @@ var DEFAULT_OPTIONS = {
|
|
|
54831
55022
|
width: 140,
|
|
54832
55023
|
height: 24,
|
|
54833
55024
|
allowResize: false,
|
|
55025
|
+
virtualScroll: false,
|
|
54834
55026
|
table: {
|
|
54835
55027
|
use: false,
|
|
54836
55028
|
columns: {
|