evui 3.3.29 → 3.3.30
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 +163 -146
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +163 -146
- 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 +50 -40
- package/src/components/chart/element/element.bar.js +10 -6
- package/src/components/chart/element/element.line.js +37 -26
- package/src/components/chart/element/element.pie.js +2 -3
- package/src/components/chart/element/element.scatter.js +8 -15
- package/src/components/chart/plugins/plugins.interaction.js +39 -30
- package/src/components/chart/plugins/plugins.legend.js +7 -27
- package/src/components/chart/plugins/plugins.pie.js +6 -2
package/dist/evui.umd.js
CHANGED
|
@@ -7949,7 +7949,7 @@ $({ target: 'Number', stat: true }, {
|
|
|
7949
7949
|
/***/ "9224":
|
|
7950
7950
|
/***/ (function(module) {
|
|
7951
7951
|
|
|
7952
|
-
module.exports = JSON.parse("{\"a\":\"3.3.
|
|
7952
|
+
module.exports = JSON.parse("{\"a\":\"3.3.30\"}");
|
|
7953
7953
|
|
|
7954
7954
|
/***/ }),
|
|
7955
7955
|
|
|
@@ -34909,7 +34909,6 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34909
34909
|
});
|
|
34910
34910
|
this.type = 'line';
|
|
34911
34911
|
this.sId = sId;
|
|
34912
|
-
this.state = 'normal';
|
|
34913
34912
|
this.extent = {
|
|
34914
34913
|
downplay: {
|
|
34915
34914
|
opacity: 0.1,
|
|
@@ -34940,7 +34939,9 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34940
34939
|
_createClass(Line, [{
|
|
34941
34940
|
key: "draw",
|
|
34942
34941
|
value: function draw(param) {
|
|
34943
|
-
var
|
|
34942
|
+
var _selectLabel$selected,
|
|
34943
|
+
_selectLabel$selected2,
|
|
34944
|
+
_selectSeries$option,
|
|
34944
34945
|
_this2 = this;
|
|
34945
34946
|
|
|
34946
34947
|
if (!this.show) {
|
|
@@ -34951,24 +34952,39 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34951
34952
|
chartRect = param.chartRect,
|
|
34952
34953
|
labelOffset = param.labelOffset,
|
|
34953
34954
|
axesSteps = param.axesSteps,
|
|
34954
|
-
selectLabel = param.selectLabel
|
|
34955
|
-
|
|
34956
|
-
|
|
34957
|
-
|
|
34958
|
-
var
|
|
34959
|
-
var
|
|
34960
|
-
var
|
|
34961
|
-
|
|
34955
|
+
selectLabel = param.selectLabel,
|
|
34956
|
+
selectSeries = param.selectSeries,
|
|
34957
|
+
legendHitInfo = param.legendHitInfo; // about selectLabel
|
|
34958
|
+
|
|
34959
|
+
var selectLabelOption = selectLabel === null || selectLabel === void 0 ? void 0 : selectLabel.option;
|
|
34960
|
+
var useSelectLabel = (selectLabelOption === null || selectLabelOption === void 0 ? void 0 : selectLabelOption.use) && (selectLabelOption === null || selectLabelOption === void 0 ? void 0 : selectLabelOption.useSeriesOpacity);
|
|
34961
|
+
var selectedLabelIndexList = (_selectLabel$selected = selectLabel === null || selectLabel === void 0 ? void 0 : (_selectLabel$selected2 = selectLabel.selected) === null || _selectLabel$selected2 === void 0 ? void 0 : _selectLabel$selected2.dataIndex) !== null && _selectLabel$selected !== void 0 ? _selectLabel$selected : []; // set Style
|
|
34962
|
+
|
|
34963
|
+
var extent;
|
|
34964
|
+
|
|
34965
|
+
if (legendHitInfo) {
|
|
34966
|
+
extent = this.extent[(legendHitInfo === null || legendHitInfo === void 0 ? void 0 : legendHitInfo.sId) === this.sId ? 'highlight' : 'downplay'];
|
|
34967
|
+
} else if (selectSeries !== null && selectSeries !== void 0 && (_selectSeries$option = selectSeries.option) !== null && _selectSeries$option !== void 0 && _selectSeries$option.use) {
|
|
34968
|
+
var _selectSeries$selecte, _selectSeries$selecte2;
|
|
34969
|
+
|
|
34970
|
+
var isSelectedSeries = selectSeries === null || selectSeries === void 0 ? void 0 : (_selectSeries$selecte = selectSeries.selected) === null || _selectSeries$selecte === void 0 ? void 0 : (_selectSeries$selecte2 = _selectSeries$selecte.seriesId) === null || _selectSeries$selecte2 === void 0 ? void 0 : _selectSeries$selecte2.includes(this.sId);
|
|
34971
|
+
extent = this.extent[isSelectedSeries ? 'highlight' : 'downplay'];
|
|
34972
|
+
} else if (useSelectLabel && selectedLabelIndexList.length) {
|
|
34973
|
+
extent = this.extent.downplay;
|
|
34974
|
+
} else {
|
|
34975
|
+
extent = this.extent.normal;
|
|
34976
|
+
}
|
|
34962
34977
|
|
|
34963
34978
|
var getOpacity = function getOpacity(colorStr) {
|
|
34964
|
-
|
|
34965
|
-
return _this2.state === 'downplay' || isExistSelectedLabel ? 0.1 : noneDownplayOpacity;
|
|
34979
|
+
return colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : extent.opacity;
|
|
34966
34980
|
};
|
|
34967
34981
|
|
|
34968
34982
|
var mainColor = this.color;
|
|
34969
34983
|
var mainColorOpacity = getOpacity(mainColor);
|
|
34970
34984
|
var pointFillColor = this.pointFill;
|
|
34971
34985
|
var pointFillColorOpacity = getOpacity(pointFillColor);
|
|
34986
|
+
var fillOpacity = getOpacity(mainColor) * this.fillOpacity;
|
|
34987
|
+
var lineWidth = this.lineWidth * extent.lineWidth;
|
|
34972
34988
|
ctx.beginPath();
|
|
34973
34989
|
ctx.save();
|
|
34974
34990
|
ctx.lineJoin = 'round';
|
|
@@ -35071,19 +35087,23 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
35071
35087
|
}
|
|
35072
35088
|
});
|
|
35073
35089
|
ctx.fill();
|
|
35074
|
-
}
|
|
35090
|
+
} // Draw points
|
|
35075
35091
|
|
|
35076
|
-
|
|
35092
|
+
|
|
35093
|
+
if (this.point || useSelectLabel) {
|
|
35077
35094
|
ctx.strokeStyle = helpers_util.colorStringToRgba(mainColor, mainColorOpacity);
|
|
35078
35095
|
var focusStyle = helpers_util.colorStringToRgba(pointFillColor, 1);
|
|
35079
35096
|
var blurStyle = helpers_util.colorStringToRgba(pointFillColor, pointFillColorOpacity);
|
|
35080
|
-
this.data.forEach(function (curr,
|
|
35081
|
-
|
|
35082
|
-
ctx.fillStyle = isExistSelectedLabel && selectedLabel.dataIndex.includes(i) ? focusStyle : blurStyle;
|
|
35097
|
+
this.data.forEach(function (curr, ix) {
|
|
35098
|
+
var isSelectedLabel = selectedLabelIndexList.includes(ix);
|
|
35083
35099
|
|
|
35084
|
-
|
|
35085
|
-
|
|
35086
|
-
|
|
35100
|
+
if (curr.xp === null || curr.yp === null) {
|
|
35101
|
+
return;
|
|
35102
|
+
}
|
|
35103
|
+
|
|
35104
|
+
if (_this2.point || isSelectedLabel) {
|
|
35105
|
+
ctx.fillStyle = isSelectedLabel && !legendHitInfo ? focusStyle : blurStyle;
|
|
35106
|
+
helpers_canvas.drawPoint(ctx, _this2.pointStyle, _this2.pointSize, curr.xp, curr.yp);
|
|
35087
35107
|
}
|
|
35088
35108
|
});
|
|
35089
35109
|
}
|
|
@@ -35378,22 +35398,17 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
|
|
|
35378
35398
|
|
|
35379
35399
|
var getOpacity = function getOpacity(colorStr, dataIndex) {
|
|
35380
35400
|
var noneDownplayOpacity = colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : 1;
|
|
35381
|
-
var
|
|
35382
|
-
var selectInfo = param.selectInfo
|
|
35401
|
+
var isDownplay = false;
|
|
35402
|
+
var selectInfo = param.selectInfo,
|
|
35403
|
+
legendHitInfo = param.legendHitInfo;
|
|
35383
35404
|
|
|
35384
|
-
if (
|
|
35385
|
-
|
|
35386
|
-
|
|
35387
|
-
|
|
35388
|
-
resultOpacity = noneDownplayOpacity;
|
|
35389
|
-
} else {
|
|
35390
|
-
resultOpacity = 0.1;
|
|
35391
|
-
}
|
|
35392
|
-
} else {
|
|
35393
|
-
resultOpacity = _this2.state === 'downplay' ? 0.1 : noneDownplayOpacity;
|
|
35405
|
+
if (legendHitInfo) {
|
|
35406
|
+
isDownplay = legendHitInfo.sId !== _this2.sId;
|
|
35407
|
+
} else if (selectInfo) {
|
|
35408
|
+
isDownplay = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.seriesID) !== _this2.sId || (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.dataIndex) !== dataIndex;
|
|
35394
35409
|
}
|
|
35395
35410
|
|
|
35396
|
-
return
|
|
35411
|
+
return isDownplay ? 0.1 : noneDownplayOpacity;
|
|
35397
35412
|
};
|
|
35398
35413
|
|
|
35399
35414
|
this.data.forEach(function (curr, idx) {
|
|
@@ -35616,7 +35631,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
35616
35631
|
this.borderRadius = param.borderRadius;
|
|
35617
35632
|
var categoryPoint = null;
|
|
35618
35633
|
this.data.forEach(function (dataItem, index) {
|
|
35619
|
-
var _param$selectLabel$se;
|
|
35634
|
+
var _param$selectLabel, _param$selectLabel$se, _param$selectLabel2, _param$selectLabel2$s;
|
|
35620
35635
|
|
|
35621
35636
|
ctx.beginPath();
|
|
35622
35637
|
var item = dataItem;
|
|
@@ -35652,11 +35667,16 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
35652
35667
|
}
|
|
35653
35668
|
|
|
35654
35669
|
var barColor = item.dataColor || _this2.color;
|
|
35655
|
-
var
|
|
35656
|
-
var
|
|
35657
|
-
|
|
35658
|
-
|
|
35659
|
-
|
|
35670
|
+
var legendHitInfo = param === null || param === void 0 ? void 0 : param.legendHitInfo;
|
|
35671
|
+
var selectLabelOption = param === null || param === void 0 ? void 0 : (_param$selectLabel = param.selectLabel) === null || _param$selectLabel === void 0 ? void 0 : _param$selectLabel.option;
|
|
35672
|
+
var selectedLabelList = (_param$selectLabel$se = param === null || param === void 0 ? void 0 : (_param$selectLabel2 = param.selectLabel) === null || _param$selectLabel2 === void 0 ? void 0 : (_param$selectLabel2$s = _param$selectLabel2.selected) === null || _param$selectLabel2$s === void 0 ? void 0 : _param$selectLabel2$s.dataIndex) !== null && _param$selectLabel$se !== void 0 ? _param$selectLabel$se : [];
|
|
35673
|
+
var isDownplay = false;
|
|
35674
|
+
|
|
35675
|
+
if (legendHitInfo) {
|
|
35676
|
+
isDownplay = (legendHitInfo === null || legendHitInfo === void 0 ? void 0 : legendHitInfo.sId) !== _this2.sId;
|
|
35677
|
+
} else if (selectLabelOption !== null && selectLabelOption !== void 0 && selectLabelOption.use && selectLabelOption !== null && selectLabelOption !== void 0 && selectLabelOption.useSeriesOpacity) {
|
|
35678
|
+
isDownplay = selectedLabelList.length && !selectedLabelList.includes(index);
|
|
35679
|
+
}
|
|
35660
35680
|
|
|
35661
35681
|
if (typeof barColor !== 'string') {
|
|
35662
35682
|
ctx.fillStyle = helpers_canvas.createGradient(ctx, isHorizontal, {
|
|
@@ -36402,7 +36422,6 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36402
36422
|
this.doughnutHoleSize = 0;
|
|
36403
36423
|
this.startAngle = 0;
|
|
36404
36424
|
this.endAngle = 0;
|
|
36405
|
-
this.state = null;
|
|
36406
36425
|
this.ctx = null;
|
|
36407
36426
|
this.isSelect = false;
|
|
36408
36427
|
}
|
|
@@ -36426,7 +36445,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36426
36445
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
36427
36446
|
var color = this.color;
|
|
36428
36447
|
var noneDownplayOpacity = color.includes('rgba') ? helpers_util.getOpacity(color) : 1;
|
|
36429
|
-
var opacity = this.
|
|
36448
|
+
var opacity = this.isDownplay ? 0.1 : noneDownplayOpacity;
|
|
36430
36449
|
ctx.beginPath();
|
|
36431
36450
|
slice.moveTo(this.centerX, this.centerY);
|
|
36432
36451
|
slice.arc(this.centerX, this.centerY, radius, this.startAngle, this.endAngle);
|
|
@@ -36499,7 +36518,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36499
36518
|
}, {
|
|
36500
36519
|
key: "itemHighlight",
|
|
36501
36520
|
value: function itemHighlight(item, context) {
|
|
36502
|
-
var _this$showValue2;
|
|
36521
|
+
var _item$data, _this$showValue2;
|
|
36503
36522
|
|
|
36504
36523
|
var ctx = context;
|
|
36505
36524
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
@@ -36507,7 +36526,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36507
36526
|
ctx.shadowOffsetX = 0;
|
|
36508
36527
|
ctx.shadowOffsetY = 0;
|
|
36509
36528
|
ctx.shadowBlur = 4;
|
|
36510
|
-
var color = item.data.dataColor || this.color;
|
|
36529
|
+
var color = (item === null || item === void 0 ? void 0 : (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.dataColor) || this.color;
|
|
36511
36530
|
ctx.fillStyle = color;
|
|
36512
36531
|
ctx.shadowColor = color;
|
|
36513
36532
|
ctx.beginPath();
|
|
@@ -39294,7 +39313,6 @@ var plugins_title_modules = {
|
|
|
39294
39313
|
|
|
39295
39314
|
|
|
39296
39315
|
|
|
39297
|
-
|
|
39298
39316
|
var plugins_legend_modules = {
|
|
39299
39317
|
/**
|
|
39300
39318
|
* Create legend DOM
|
|
@@ -39518,8 +39536,6 @@ var plugins_legend_modules = {
|
|
|
39518
39536
|
|
|
39519
39537
|
|
|
39520
39538
|
this.onLegendBoxOver = function (e) {
|
|
39521
|
-
var _this3$defaultSelectI, _this3$defaultSelectI2;
|
|
39522
|
-
|
|
39523
39539
|
var type = e.target.dataset.type;
|
|
39524
39540
|
var targetDOM;
|
|
39525
39541
|
|
|
@@ -39533,19 +39549,10 @@ var plugins_legend_modules = {
|
|
|
39533
39549
|
|
|
39534
39550
|
var nameDOM = targetDOM.getElementsByClassName('ev-chart-legend-name')[0];
|
|
39535
39551
|
var targetId = nameDOM.series.sId;
|
|
39536
|
-
var
|
|
39537
|
-
|
|
39538
|
-
|
|
39539
|
-
|
|
39540
|
-
});
|
|
39541
|
-
var hitInfo = null;
|
|
39542
|
-
|
|
39543
|
-
if (helpers_util.isPieType(_this3.options.type)) {
|
|
39544
|
-
hitInfo = {
|
|
39545
|
-
sId: targetId,
|
|
39546
|
-
type: _this3.options.type
|
|
39547
|
-
};
|
|
39548
|
-
}
|
|
39552
|
+
var legendHitInfo = {
|
|
39553
|
+
sId: targetId,
|
|
39554
|
+
type: _this3.options.type
|
|
39555
|
+
};
|
|
39549
39556
|
|
|
39550
39557
|
_this3.update({
|
|
39551
39558
|
updateSeries: false,
|
|
@@ -39553,7 +39560,9 @@ var plugins_legend_modules = {
|
|
|
39553
39560
|
update: false,
|
|
39554
39561
|
keepDomain: false
|
|
39555
39562
|
},
|
|
39556
|
-
hitInfo:
|
|
39563
|
+
hitInfo: {
|
|
39564
|
+
legend: legendHitInfo
|
|
39565
|
+
}
|
|
39557
39566
|
});
|
|
39558
39567
|
};
|
|
39559
39568
|
/**
|
|
@@ -39564,23 +39573,14 @@ var plugins_legend_modules = {
|
|
|
39564
39573
|
|
|
39565
39574
|
|
|
39566
39575
|
this.onLegendBoxLeave = function () {
|
|
39567
|
-
var _this3$defaultSelectI3, _this3$defaultSelectI4;
|
|
39568
|
-
|
|
39569
|
-
var selectSeriesOption = _this3.options.selectSeries;
|
|
39570
|
-
var selectedList = (_this3$defaultSelectI3 = (_this3$defaultSelectI4 = _this3.defaultSelectInfo) === null || _this3$defaultSelectI4 === void 0 ? void 0 : _this3$defaultSelectI4.seriesId) !== null && _this3$defaultSelectI3 !== void 0 ? _this3$defaultSelectI3 : [];
|
|
39571
|
-
Object.values(_this3.seriesList).forEach(function (series) {
|
|
39572
|
-
if (selectSeriesOption.use && selectedList.length) {
|
|
39573
|
-
series.state = selectedList.includes(series.sId) ? 'highlight' : 'downplay';
|
|
39574
|
-
} else {
|
|
39575
|
-
series.state = 'normal';
|
|
39576
|
-
}
|
|
39577
|
-
});
|
|
39578
|
-
|
|
39579
39576
|
_this3.update({
|
|
39580
39577
|
updateSeries: false,
|
|
39581
39578
|
updateSelTip: {
|
|
39582
39579
|
update: false,
|
|
39583
39580
|
keepDomain: false
|
|
39581
|
+
},
|
|
39582
|
+
hitInfo: {
|
|
39583
|
+
legend: null
|
|
39584
39584
|
}
|
|
39585
39585
|
});
|
|
39586
39586
|
};
|
|
@@ -40881,9 +40881,6 @@ var es_object_from_entries = __webpack_require__("c1f9");
|
|
|
40881
40881
|
|
|
40882
40882
|
|
|
40883
40883
|
|
|
40884
|
-
|
|
40885
|
-
|
|
40886
|
-
|
|
40887
40884
|
var plugins_interaction_modules = {
|
|
40888
40885
|
/**
|
|
40889
40886
|
* Hide legend components by manipulating css
|
|
@@ -41433,37 +41430,60 @@ var plugins_interaction_modules = {
|
|
|
41433
41430
|
addNotHitInfo: function addNotHitInfo(hitInfo) {
|
|
41434
41431
|
var _hitInfo$items, _hitInfo$items$hitIte, _hitInfo$items$hitIte2, _hitInfo$items2, _hitInfo$items2$hitIt, _hitInfo$items2$hitIt2;
|
|
41435
41432
|
|
|
41433
|
+
var ctx = this.tooltipCtx;
|
|
41436
41434
|
var isHorizontal = !!this.options.horizontal;
|
|
41437
41435
|
var hitItemId = Object.keys(hitInfo.items)[0];
|
|
41438
41436
|
var hitItemData = isHorizontal ? (_hitInfo$items = hitInfo.items) === null || _hitInfo$items === void 0 ? void 0 : (_hitInfo$items$hitIte = _hitInfo$items[hitItemId]) === null || _hitInfo$items$hitIte === void 0 ? void 0 : (_hitInfo$items$hitIte2 = _hitInfo$items$hitIte.data) === null || _hitInfo$items$hitIte2 === void 0 ? void 0 : _hitInfo$items$hitIte2.y : (_hitInfo$items2 = hitInfo.items) === null || _hitInfo$items2 === void 0 ? void 0 : (_hitInfo$items2$hitIt = _hitInfo$items2[hitItemId]) === null || _hitInfo$items2$hitIt === void 0 ? void 0 : (_hitInfo$items2$hitIt2 = _hitInfo$items2$hitIt.data) === null || _hitInfo$items2$hitIt2 === void 0 ? void 0 : _hitInfo$items2$hitIt2.x;
|
|
41437
|
+
var maxSeriesName = '';
|
|
41438
|
+
var maxValueTxt = '';
|
|
41439
41439
|
var sIds = Object.keys(this.seriesList);
|
|
41440
41440
|
|
|
41441
41441
|
for (var ix = 0; ix < sIds.length; ix++) {
|
|
41442
41442
|
var sId = sIds[ix];
|
|
41443
41443
|
var series = this.seriesList[sId];
|
|
41444
|
-
var hasData = series.data.find(function (data) {
|
|
41445
|
-
return isHorizontal ? (data === null || data === void 0 ? void 0 : data.y) === hitItemData : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
|
|
41446
|
-
});
|
|
41447
41444
|
|
|
41448
|
-
if (
|
|
41449
|
-
var
|
|
41450
|
-
|
|
41451
|
-
|
|
41452
|
-
|
|
41453
|
-
item.axis = {
|
|
41454
|
-
x: series.xAxisIndex,
|
|
41455
|
-
y: series.yAxisIndex
|
|
41456
|
-
};
|
|
41457
|
-
item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
|
|
41458
|
-
item.data = hasData;
|
|
41459
|
-
item.data.formatted = this.getFormattedTooltipValue({
|
|
41445
|
+
if (series !== null && series !== void 0 && series.show) {
|
|
41446
|
+
var hasData = series.data.find(function (data) {
|
|
41447
|
+
return isHorizontal ? (data === null || data === void 0 ? void 0 : data.y) === hitItemData : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
|
|
41448
|
+
});
|
|
41449
|
+
var formattedValue = this.getFormattedTooltipValue({
|
|
41460
41450
|
seriesName: series.name,
|
|
41461
|
-
value: hasData.o,
|
|
41451
|
+
value: hasData === null || hasData === void 0 ? void 0 : hasData.o,
|
|
41462
41452
|
itemData: hasData
|
|
41463
41453
|
});
|
|
41464
|
-
|
|
41454
|
+
|
|
41455
|
+
if (hasData && !hitInfo.items[sId]) {
|
|
41456
|
+
var item = {};
|
|
41457
|
+
item.color = series.color;
|
|
41458
|
+
item.hit = false;
|
|
41459
|
+
item.name = series.name;
|
|
41460
|
+
item.axis = {
|
|
41461
|
+
x: series.xAxisIndex,
|
|
41462
|
+
y: series.yAxisIndex
|
|
41463
|
+
};
|
|
41464
|
+
item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
|
|
41465
|
+
item.data = hasData;
|
|
41466
|
+
item.data.formatted = formattedValue;
|
|
41467
|
+
hitInfo.items[sId] = item;
|
|
41468
|
+
}
|
|
41469
|
+
|
|
41470
|
+
var maxSeriesNameWidth = ctx ? ctx.measureText(maxSeriesName).width : 1;
|
|
41471
|
+
var seriesNameWidth = ctx ? ctx.measureText(series.name).width : 1;
|
|
41472
|
+
|
|
41473
|
+
if (maxSeriesNameWidth < seriesNameWidth) {
|
|
41474
|
+
maxSeriesName = series.name;
|
|
41475
|
+
}
|
|
41476
|
+
|
|
41477
|
+
var maxValueWidth = ctx ? ctx.measureText(maxValueTxt).width : 1;
|
|
41478
|
+
var valueWidth = ctx ? ctx.measureText("".concat(formattedValue)).width : 1;
|
|
41479
|
+
|
|
41480
|
+
if (maxValueWidth < valueWidth) {
|
|
41481
|
+
maxValueTxt = "".concat(formattedValue);
|
|
41482
|
+
}
|
|
41465
41483
|
}
|
|
41466
41484
|
}
|
|
41485
|
+
|
|
41486
|
+
hitInfo.maxTip = [maxSeriesName, maxValueTxt];
|
|
41467
41487
|
},
|
|
41468
41488
|
|
|
41469
41489
|
/**
|
|
@@ -41552,17 +41572,6 @@ var plugins_interaction_modules = {
|
|
|
41552
41572
|
seriesId: []
|
|
41553
41573
|
};
|
|
41554
41574
|
}
|
|
41555
|
-
|
|
41556
|
-
var selectedList = this.defaultSelectInfo.seriesId;
|
|
41557
|
-
Object.values(this.seriesList).forEach(function (series) {
|
|
41558
|
-
if (!selectedList.length) {
|
|
41559
|
-
series.state = 'normal';
|
|
41560
|
-
} else if (selectedList.includes(series.sId)) {
|
|
41561
|
-
series.state = 'highlight';
|
|
41562
|
-
} else {
|
|
41563
|
-
series.state = 'downplay';
|
|
41564
|
-
}
|
|
41565
|
-
});
|
|
41566
41575
|
}
|
|
41567
41576
|
},
|
|
41568
41577
|
|
|
@@ -42538,7 +42547,10 @@ var plugins_pie_modules = {
|
|
|
42538
42547
|
ctx.stroke();
|
|
42539
42548
|
}
|
|
42540
42549
|
|
|
42541
|
-
|
|
42550
|
+
var selectInfo = hitInfo.selectInfo,
|
|
42551
|
+
legendHitInfo = hitInfo.legendHitInfo;
|
|
42552
|
+
series.isSelect = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.sId) === slice.id;
|
|
42553
|
+
series.isDownplay = legendHitInfo && legendHitInfo.sId !== slice.id;
|
|
42542
42554
|
series.type = isDoughnut ? 'doughnut' : 'pie';
|
|
42543
42555
|
series.centerX = centerX;
|
|
42544
42556
|
series.centerY = centerY;
|
|
@@ -42643,7 +42655,10 @@ var plugins_pie_modules = {
|
|
|
42643
42655
|
ctx.stroke();
|
|
42644
42656
|
}
|
|
42645
42657
|
|
|
42646
|
-
|
|
42658
|
+
var selectInfo = hitInfo.selectInfo,
|
|
42659
|
+
legendHitInfo = hitInfo.legendHitInfo;
|
|
42660
|
+
series.isSelect = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.sId) === slice.id;
|
|
42661
|
+
series.isDownplay = legendHitInfo && legendHitInfo.sId !== slice.id;
|
|
42647
42662
|
series.type = 'sunburst';
|
|
42648
42663
|
series.centerX = centerX;
|
|
42649
42664
|
series.centerY = centerY;
|
|
@@ -43338,7 +43353,6 @@ var element_tip_modules = {
|
|
|
43338
43353
|
|
|
43339
43354
|
|
|
43340
43355
|
|
|
43341
|
-
|
|
43342
43356
|
|
|
43343
43357
|
|
|
43344
43358
|
var chart_core_EvChart = /*#__PURE__*/function () {
|
|
@@ -43500,7 +43514,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43500
43514
|
this.axesSteps = this.calculateSteps();
|
|
43501
43515
|
this.drawAxis(hitInfo);
|
|
43502
43516
|
this.drawSeries(hitInfo);
|
|
43503
|
-
this.drawTip(
|
|
43517
|
+
this.drawTip();
|
|
43504
43518
|
|
|
43505
43519
|
if (this.bufferCanvas) {
|
|
43506
43520
|
this.displayCtx.drawImage(this.bufferCanvas, 0, 0);
|
|
@@ -43508,7 +43522,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43508
43522
|
}
|
|
43509
43523
|
/**
|
|
43510
43524
|
* Draw each series
|
|
43511
|
-
* @param {any} [hitInfo=undefined]
|
|
43525
|
+
* @param {any} [hitInfo=undefined] legend mouseover callback (object or undefined)
|
|
43512
43526
|
*
|
|
43513
43527
|
* @returns {undefined}
|
|
43514
43528
|
*/
|
|
@@ -43562,12 +43576,17 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43562
43576
|
case 'line':
|
|
43563
43577
|
case 'heatMap':
|
|
43564
43578
|
{
|
|
43565
|
-
|
|
43579
|
+
var legendHitInfo = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43580
|
+
series.draw(_objectSpread2({
|
|
43581
|
+
legendHitInfo: legendHitInfo
|
|
43582
|
+
}, opt));
|
|
43566
43583
|
break;
|
|
43567
43584
|
}
|
|
43568
43585
|
|
|
43569
43586
|
case 'bar':
|
|
43570
43587
|
{
|
|
43588
|
+
var _legendHitInfo = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43589
|
+
|
|
43571
43590
|
var _this$options3 = this.options,
|
|
43572
43591
|
thickness = _this$options3.thickness,
|
|
43573
43592
|
cPadRatio = _this$options3.cPadRatio,
|
|
@@ -43577,7 +43596,8 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43577
43596
|
cPadRatio: cPadRatio,
|
|
43578
43597
|
borderRadius: borderRadius,
|
|
43579
43598
|
showSeriesCount: showSeriesCount,
|
|
43580
|
-
showIndex: showIndex
|
|
43599
|
+
showIndex: showIndex,
|
|
43600
|
+
legendHitInfo: _legendHitInfo
|
|
43581
43601
|
}, opt));
|
|
43582
43602
|
|
|
43583
43603
|
if (series.show) {
|
|
@@ -43589,16 +43609,24 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43589
43609
|
|
|
43590
43610
|
case 'pie':
|
|
43591
43611
|
{
|
|
43592
|
-
var
|
|
43612
|
+
var _this$lastHitInfo, _this$defaultSelectIt;
|
|
43593
43613
|
|
|
43594
|
-
var selectInfo = (
|
|
43614
|
+
var selectInfo = (_this$lastHitInfo = this.lastHitInfo) !== null && _this$lastHitInfo !== void 0 ? _this$lastHitInfo : {
|
|
43595
43615
|
sId: (_this$defaultSelectIt = this.defaultSelectItemInfo) === null || _this$defaultSelectIt === void 0 ? void 0 : _this$defaultSelectIt.seriesID
|
|
43596
43616
|
};
|
|
43597
43617
|
|
|
43618
|
+
var _legendHitInfo2 = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43619
|
+
|
|
43598
43620
|
if (this.options.sunburst) {
|
|
43599
|
-
this.drawSunburst(
|
|
43621
|
+
this.drawSunburst({
|
|
43622
|
+
selectInfo: selectInfo,
|
|
43623
|
+
legendHitInfo: _legendHitInfo2
|
|
43624
|
+
});
|
|
43600
43625
|
} else {
|
|
43601
|
-
this.drawPie(
|
|
43626
|
+
this.drawPie({
|
|
43627
|
+
selectInfo: selectInfo,
|
|
43628
|
+
legendHitInfo: _legendHitInfo2
|
|
43629
|
+
});
|
|
43602
43630
|
}
|
|
43603
43631
|
|
|
43604
43632
|
if (this.options.doughnutHoleSize > 0) {
|
|
@@ -43610,34 +43638,30 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43610
43638
|
|
|
43611
43639
|
case 'scatter':
|
|
43612
43640
|
{
|
|
43641
|
+
var _legendHitInfo3 = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43642
|
+
|
|
43643
|
+
var _selectInfo = void 0;
|
|
43644
|
+
|
|
43613
43645
|
if (selectItem.use && selectItem.useSeriesOpacity) {
|
|
43614
|
-
var
|
|
43615
|
-
|
|
43616
|
-
|
|
43617
|
-
|
|
43618
|
-
|
|
43619
|
-
|
|
43620
|
-
|
|
43621
|
-
};
|
|
43622
|
-
} else {
|
|
43623
|
-
opt.selectInfo = null;
|
|
43624
|
-
}
|
|
43625
|
-
} else if ((_this$lastHitInfo = this.lastHitInfo) !== null && _this$lastHitInfo !== void 0 && _this$lastHitInfo.maxIndex || ((_this$lastHitInfo2 = this.lastHitInfo) === null || _this$lastHitInfo2 === void 0 ? void 0 : _this$lastHitInfo2.maxIndex) === 0) {
|
|
43626
|
-
opt.selectInfo = {
|
|
43627
|
-
seriesID: this.lastHitInfo.sId,
|
|
43628
|
-
dataIndex: this.lastHitInfo.maxIndex
|
|
43629
|
-
};
|
|
43630
|
-
} else if ((_this$defaultSelectIt2 = this.defaultSelectItemInfo) !== null && _this$defaultSelectIt2 !== void 0 && _this$defaultSelectIt2.dataIndex || ((_this$defaultSelectIt3 = this.defaultSelectItemInfo) === null || _this$defaultSelectIt3 === void 0 ? void 0 : _this$defaultSelectIt3.dataIndex) === 0) {
|
|
43631
|
-
opt.selectInfo = {
|
|
43632
|
-
seriesID: this.defaultSelectItemInfo.seriesID,
|
|
43633
|
-
dataIndex: this.defaultSelectItemInfo.dataIndex
|
|
43646
|
+
var lastHitInfo = this.lastHitInfo;
|
|
43647
|
+
var defaultSelectInfo = this.defaultSelectItemInfo;
|
|
43648
|
+
|
|
43649
|
+
if (lastHitInfo !== null && lastHitInfo !== void 0 && lastHitInfo.maxIndex || (lastHitInfo === null || lastHitInfo === void 0 ? void 0 : lastHitInfo.maxIndex) === 0) {
|
|
43650
|
+
_selectInfo = {
|
|
43651
|
+
seriesID: lastHitInfo.sId,
|
|
43652
|
+
dataIndex: lastHitInfo.maxIndex
|
|
43634
43653
|
};
|
|
43654
|
+
} else if (defaultSelectInfo !== null && defaultSelectInfo !== void 0 && defaultSelectInfo.dataIndex || (defaultSelectInfo === null || defaultSelectInfo === void 0 ? void 0 : defaultSelectInfo.dataIndex) === 0) {
|
|
43655
|
+
_selectInfo = _objectSpread2({}, defaultSelectInfo);
|
|
43635
43656
|
} else {
|
|
43636
|
-
|
|
43657
|
+
_selectInfo = null;
|
|
43637
43658
|
}
|
|
43638
43659
|
}
|
|
43639
43660
|
|
|
43640
|
-
series.draw(
|
|
43661
|
+
series.draw(_objectSpread2({
|
|
43662
|
+
legendHitInfo: _legendHitInfo3,
|
|
43663
|
+
selectInfo: _selectInfo
|
|
43664
|
+
}, opt));
|
|
43641
43665
|
break;
|
|
43642
43666
|
}
|
|
43643
43667
|
|
|
@@ -43651,21 +43675,14 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43651
43675
|
}
|
|
43652
43676
|
/**
|
|
43653
43677
|
* Draw Tip with hitInfo and defaultSelectItemInfo
|
|
43654
|
-
* @param hitInfo
|
|
43655
43678
|
*/
|
|
43656
43679
|
|
|
43657
43680
|
}, {
|
|
43658
43681
|
key: "drawTip",
|
|
43659
|
-
value: function drawTip(
|
|
43660
|
-
if (helpers_util.isPieType(hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.type)) {
|
|
43661
|
-
return;
|
|
43662
|
-
}
|
|
43663
|
-
|
|
43682
|
+
value: function drawTip() {
|
|
43664
43683
|
var tipLocationInfo;
|
|
43665
43684
|
|
|
43666
|
-
if (
|
|
43667
|
-
tipLocationInfo = hitInfo;
|
|
43668
|
-
} else if (this.lastHitInfo) {
|
|
43685
|
+
if (this.lastHitInfo) {
|
|
43669
43686
|
tipLocationInfo = this.lastHitInfo;
|
|
43670
43687
|
} else if (this.defaultSelectItemInfo) {
|
|
43671
43688
|
tipLocationInfo = this.getItem(this.defaultSelectItemInfo, false);
|