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.common.js
CHANGED
|
@@ -7940,7 +7940,7 @@ $({ target: 'Number', stat: true }, {
|
|
|
7940
7940
|
/***/ "9224":
|
|
7941
7941
|
/***/ (function(module) {
|
|
7942
7942
|
|
|
7943
|
-
module.exports = JSON.parse("{\"a\":\"3.3.
|
|
7943
|
+
module.exports = JSON.parse("{\"a\":\"3.3.30\"}");
|
|
7944
7944
|
|
|
7945
7945
|
/***/ }),
|
|
7946
7946
|
|
|
@@ -34900,7 +34900,6 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34900
34900
|
});
|
|
34901
34901
|
this.type = 'line';
|
|
34902
34902
|
this.sId = sId;
|
|
34903
|
-
this.state = 'normal';
|
|
34904
34903
|
this.extent = {
|
|
34905
34904
|
downplay: {
|
|
34906
34905
|
opacity: 0.1,
|
|
@@ -34931,7 +34930,9 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34931
34930
|
_createClass(Line, [{
|
|
34932
34931
|
key: "draw",
|
|
34933
34932
|
value: function draw(param) {
|
|
34934
|
-
var
|
|
34933
|
+
var _selectLabel$selected,
|
|
34934
|
+
_selectLabel$selected2,
|
|
34935
|
+
_selectSeries$option,
|
|
34935
34936
|
_this2 = this;
|
|
34936
34937
|
|
|
34937
34938
|
if (!this.show) {
|
|
@@ -34942,24 +34943,39 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
34942
34943
|
chartRect = param.chartRect,
|
|
34943
34944
|
labelOffset = param.labelOffset,
|
|
34944
34945
|
axesSteps = param.axesSteps,
|
|
34945
|
-
selectLabel = param.selectLabel
|
|
34946
|
-
|
|
34947
|
-
|
|
34948
|
-
|
|
34949
|
-
var
|
|
34950
|
-
var
|
|
34951
|
-
var
|
|
34952
|
-
|
|
34946
|
+
selectLabel = param.selectLabel,
|
|
34947
|
+
selectSeries = param.selectSeries,
|
|
34948
|
+
legendHitInfo = param.legendHitInfo; // about selectLabel
|
|
34949
|
+
|
|
34950
|
+
var selectLabelOption = selectLabel === null || selectLabel === void 0 ? void 0 : selectLabel.option;
|
|
34951
|
+
var useSelectLabel = (selectLabelOption === null || selectLabelOption === void 0 ? void 0 : selectLabelOption.use) && (selectLabelOption === null || selectLabelOption === void 0 ? void 0 : selectLabelOption.useSeriesOpacity);
|
|
34952
|
+
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
|
|
34953
|
+
|
|
34954
|
+
var extent;
|
|
34955
|
+
|
|
34956
|
+
if (legendHitInfo) {
|
|
34957
|
+
extent = this.extent[(legendHitInfo === null || legendHitInfo === void 0 ? void 0 : legendHitInfo.sId) === this.sId ? 'highlight' : 'downplay'];
|
|
34958
|
+
} else if (selectSeries !== null && selectSeries !== void 0 && (_selectSeries$option = selectSeries.option) !== null && _selectSeries$option !== void 0 && _selectSeries$option.use) {
|
|
34959
|
+
var _selectSeries$selecte, _selectSeries$selecte2;
|
|
34960
|
+
|
|
34961
|
+
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);
|
|
34962
|
+
extent = this.extent[isSelectedSeries ? 'highlight' : 'downplay'];
|
|
34963
|
+
} else if (useSelectLabel && selectedLabelIndexList.length) {
|
|
34964
|
+
extent = this.extent.downplay;
|
|
34965
|
+
} else {
|
|
34966
|
+
extent = this.extent.normal;
|
|
34967
|
+
}
|
|
34953
34968
|
|
|
34954
34969
|
var getOpacity = function getOpacity(colorStr) {
|
|
34955
|
-
|
|
34956
|
-
return _this2.state === 'downplay' || isExistSelectedLabel ? 0.1 : noneDownplayOpacity;
|
|
34970
|
+
return colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : extent.opacity;
|
|
34957
34971
|
};
|
|
34958
34972
|
|
|
34959
34973
|
var mainColor = this.color;
|
|
34960
34974
|
var mainColorOpacity = getOpacity(mainColor);
|
|
34961
34975
|
var pointFillColor = this.pointFill;
|
|
34962
34976
|
var pointFillColorOpacity = getOpacity(pointFillColor);
|
|
34977
|
+
var fillOpacity = getOpacity(mainColor) * this.fillOpacity;
|
|
34978
|
+
var lineWidth = this.lineWidth * extent.lineWidth;
|
|
34963
34979
|
ctx.beginPath();
|
|
34964
34980
|
ctx.save();
|
|
34965
34981
|
ctx.lineJoin = 'round';
|
|
@@ -35062,19 +35078,23 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
35062
35078
|
}
|
|
35063
35079
|
});
|
|
35064
35080
|
ctx.fill();
|
|
35065
|
-
}
|
|
35081
|
+
} // Draw points
|
|
35066
35082
|
|
|
35067
|
-
|
|
35083
|
+
|
|
35084
|
+
if (this.point || useSelectLabel) {
|
|
35068
35085
|
ctx.strokeStyle = helpers_util.colorStringToRgba(mainColor, mainColorOpacity);
|
|
35069
35086
|
var focusStyle = helpers_util.colorStringToRgba(pointFillColor, 1);
|
|
35070
35087
|
var blurStyle = helpers_util.colorStringToRgba(pointFillColor, pointFillColorOpacity);
|
|
35071
|
-
this.data.forEach(function (curr,
|
|
35072
|
-
|
|
35073
|
-
ctx.fillStyle = isExistSelectedLabel && selectedLabel.dataIndex.includes(i) ? focusStyle : blurStyle;
|
|
35088
|
+
this.data.forEach(function (curr, ix) {
|
|
35089
|
+
var isSelectedLabel = selectedLabelIndexList.includes(ix);
|
|
35074
35090
|
|
|
35075
|
-
|
|
35076
|
-
|
|
35077
|
-
|
|
35091
|
+
if (curr.xp === null || curr.yp === null) {
|
|
35092
|
+
return;
|
|
35093
|
+
}
|
|
35094
|
+
|
|
35095
|
+
if (_this2.point || isSelectedLabel) {
|
|
35096
|
+
ctx.fillStyle = isSelectedLabel && !legendHitInfo ? focusStyle : blurStyle;
|
|
35097
|
+
helpers_canvas.drawPoint(ctx, _this2.pointStyle, _this2.pointSize, curr.xp, curr.yp);
|
|
35078
35098
|
}
|
|
35079
35099
|
});
|
|
35080
35100
|
}
|
|
@@ -35369,22 +35389,17 @@ var element_scatter_Scatter = /*#__PURE__*/function () {
|
|
|
35369
35389
|
|
|
35370
35390
|
var getOpacity = function getOpacity(colorStr, dataIndex) {
|
|
35371
35391
|
var noneDownplayOpacity = colorStr.includes('rgba') ? helpers_util.getOpacity(colorStr) : 1;
|
|
35372
|
-
var
|
|
35373
|
-
var selectInfo = param.selectInfo
|
|
35392
|
+
var isDownplay = false;
|
|
35393
|
+
var selectInfo = param.selectInfo,
|
|
35394
|
+
legendHitInfo = param.legendHitInfo;
|
|
35374
35395
|
|
|
35375
|
-
if (
|
|
35376
|
-
|
|
35377
|
-
|
|
35378
|
-
|
|
35379
|
-
resultOpacity = noneDownplayOpacity;
|
|
35380
|
-
} else {
|
|
35381
|
-
resultOpacity = 0.1;
|
|
35382
|
-
}
|
|
35383
|
-
} else {
|
|
35384
|
-
resultOpacity = _this2.state === 'downplay' ? 0.1 : noneDownplayOpacity;
|
|
35396
|
+
if (legendHitInfo) {
|
|
35397
|
+
isDownplay = legendHitInfo.sId !== _this2.sId;
|
|
35398
|
+
} else if (selectInfo) {
|
|
35399
|
+
isDownplay = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.seriesID) !== _this2.sId || (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.dataIndex) !== dataIndex;
|
|
35385
35400
|
}
|
|
35386
35401
|
|
|
35387
|
-
return
|
|
35402
|
+
return isDownplay ? 0.1 : noneDownplayOpacity;
|
|
35388
35403
|
};
|
|
35389
35404
|
|
|
35390
35405
|
this.data.forEach(function (curr, idx) {
|
|
@@ -35607,7 +35622,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
35607
35622
|
this.borderRadius = param.borderRadius;
|
|
35608
35623
|
var categoryPoint = null;
|
|
35609
35624
|
this.data.forEach(function (dataItem, index) {
|
|
35610
|
-
var _param$selectLabel$se;
|
|
35625
|
+
var _param$selectLabel, _param$selectLabel$se, _param$selectLabel2, _param$selectLabel2$s;
|
|
35611
35626
|
|
|
35612
35627
|
ctx.beginPath();
|
|
35613
35628
|
var item = dataItem;
|
|
@@ -35643,11 +35658,16 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
35643
35658
|
}
|
|
35644
35659
|
|
|
35645
35660
|
var barColor = item.dataColor || _this2.color;
|
|
35646
|
-
var
|
|
35647
|
-
var
|
|
35648
|
-
|
|
35649
|
-
|
|
35650
|
-
|
|
35661
|
+
var legendHitInfo = param === null || param === void 0 ? void 0 : param.legendHitInfo;
|
|
35662
|
+
var selectLabelOption = param === null || param === void 0 ? void 0 : (_param$selectLabel = param.selectLabel) === null || _param$selectLabel === void 0 ? void 0 : _param$selectLabel.option;
|
|
35663
|
+
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 : [];
|
|
35664
|
+
var isDownplay = false;
|
|
35665
|
+
|
|
35666
|
+
if (legendHitInfo) {
|
|
35667
|
+
isDownplay = (legendHitInfo === null || legendHitInfo === void 0 ? void 0 : legendHitInfo.sId) !== _this2.sId;
|
|
35668
|
+
} else if (selectLabelOption !== null && selectLabelOption !== void 0 && selectLabelOption.use && selectLabelOption !== null && selectLabelOption !== void 0 && selectLabelOption.useSeriesOpacity) {
|
|
35669
|
+
isDownplay = selectedLabelList.length && !selectedLabelList.includes(index);
|
|
35670
|
+
}
|
|
35651
35671
|
|
|
35652
35672
|
if (typeof barColor !== 'string') {
|
|
35653
35673
|
ctx.fillStyle = helpers_canvas.createGradient(ctx, isHorizontal, {
|
|
@@ -36393,7 +36413,6 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36393
36413
|
this.doughnutHoleSize = 0;
|
|
36394
36414
|
this.startAngle = 0;
|
|
36395
36415
|
this.endAngle = 0;
|
|
36396
|
-
this.state = null;
|
|
36397
36416
|
this.ctx = null;
|
|
36398
36417
|
this.isSelect = false;
|
|
36399
36418
|
}
|
|
@@ -36417,7 +36436,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36417
36436
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
36418
36437
|
var color = this.color;
|
|
36419
36438
|
var noneDownplayOpacity = color.includes('rgba') ? helpers_util.getOpacity(color) : 1;
|
|
36420
|
-
var opacity = this.
|
|
36439
|
+
var opacity = this.isDownplay ? 0.1 : noneDownplayOpacity;
|
|
36421
36440
|
ctx.beginPath();
|
|
36422
36441
|
slice.moveTo(this.centerX, this.centerY);
|
|
36423
36442
|
slice.arc(this.centerX, this.centerY, radius, this.startAngle, this.endAngle);
|
|
@@ -36490,7 +36509,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36490
36509
|
}, {
|
|
36491
36510
|
key: "itemHighlight",
|
|
36492
36511
|
value: function itemHighlight(item, context) {
|
|
36493
|
-
var _this$showValue2;
|
|
36512
|
+
var _item$data, _this$showValue2;
|
|
36494
36513
|
|
|
36495
36514
|
var ctx = context;
|
|
36496
36515
|
var radius = this.isSelect ? this.radius + 5 : this.radius;
|
|
@@ -36498,7 +36517,7 @@ var element_pie_Pie = /*#__PURE__*/function () {
|
|
|
36498
36517
|
ctx.shadowOffsetX = 0;
|
|
36499
36518
|
ctx.shadowOffsetY = 0;
|
|
36500
36519
|
ctx.shadowBlur = 4;
|
|
36501
|
-
var color = item.data.dataColor || this.color;
|
|
36520
|
+
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;
|
|
36502
36521
|
ctx.fillStyle = color;
|
|
36503
36522
|
ctx.shadowColor = color;
|
|
36504
36523
|
ctx.beginPath();
|
|
@@ -39285,7 +39304,6 @@ var plugins_title_modules = {
|
|
|
39285
39304
|
|
|
39286
39305
|
|
|
39287
39306
|
|
|
39288
|
-
|
|
39289
39307
|
var plugins_legend_modules = {
|
|
39290
39308
|
/**
|
|
39291
39309
|
* Create legend DOM
|
|
@@ -39509,8 +39527,6 @@ var plugins_legend_modules = {
|
|
|
39509
39527
|
|
|
39510
39528
|
|
|
39511
39529
|
this.onLegendBoxOver = function (e) {
|
|
39512
|
-
var _this3$defaultSelectI, _this3$defaultSelectI2;
|
|
39513
|
-
|
|
39514
39530
|
var type = e.target.dataset.type;
|
|
39515
39531
|
var targetDOM;
|
|
39516
39532
|
|
|
@@ -39524,19 +39540,10 @@ var plugins_legend_modules = {
|
|
|
39524
39540
|
|
|
39525
39541
|
var nameDOM = targetDOM.getElementsByClassName('ev-chart-legend-name')[0];
|
|
39526
39542
|
var targetId = nameDOM.series.sId;
|
|
39527
|
-
var
|
|
39528
|
-
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
});
|
|
39532
|
-
var hitInfo = null;
|
|
39533
|
-
|
|
39534
|
-
if (helpers_util.isPieType(_this3.options.type)) {
|
|
39535
|
-
hitInfo = {
|
|
39536
|
-
sId: targetId,
|
|
39537
|
-
type: _this3.options.type
|
|
39538
|
-
};
|
|
39539
|
-
}
|
|
39543
|
+
var legendHitInfo = {
|
|
39544
|
+
sId: targetId,
|
|
39545
|
+
type: _this3.options.type
|
|
39546
|
+
};
|
|
39540
39547
|
|
|
39541
39548
|
_this3.update({
|
|
39542
39549
|
updateSeries: false,
|
|
@@ -39544,7 +39551,9 @@ var plugins_legend_modules = {
|
|
|
39544
39551
|
update: false,
|
|
39545
39552
|
keepDomain: false
|
|
39546
39553
|
},
|
|
39547
|
-
hitInfo:
|
|
39554
|
+
hitInfo: {
|
|
39555
|
+
legend: legendHitInfo
|
|
39556
|
+
}
|
|
39548
39557
|
});
|
|
39549
39558
|
};
|
|
39550
39559
|
/**
|
|
@@ -39555,23 +39564,14 @@ var plugins_legend_modules = {
|
|
|
39555
39564
|
|
|
39556
39565
|
|
|
39557
39566
|
this.onLegendBoxLeave = function () {
|
|
39558
|
-
var _this3$defaultSelectI3, _this3$defaultSelectI4;
|
|
39559
|
-
|
|
39560
|
-
var selectSeriesOption = _this3.options.selectSeries;
|
|
39561
|
-
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 : [];
|
|
39562
|
-
Object.values(_this3.seriesList).forEach(function (series) {
|
|
39563
|
-
if (selectSeriesOption.use && selectedList.length) {
|
|
39564
|
-
series.state = selectedList.includes(series.sId) ? 'highlight' : 'downplay';
|
|
39565
|
-
} else {
|
|
39566
|
-
series.state = 'normal';
|
|
39567
|
-
}
|
|
39568
|
-
});
|
|
39569
|
-
|
|
39570
39567
|
_this3.update({
|
|
39571
39568
|
updateSeries: false,
|
|
39572
39569
|
updateSelTip: {
|
|
39573
39570
|
update: false,
|
|
39574
39571
|
keepDomain: false
|
|
39572
|
+
},
|
|
39573
|
+
hitInfo: {
|
|
39574
|
+
legend: null
|
|
39575
39575
|
}
|
|
39576
39576
|
});
|
|
39577
39577
|
};
|
|
@@ -40872,9 +40872,6 @@ var es_object_from_entries = __webpack_require__("c1f9");
|
|
|
40872
40872
|
|
|
40873
40873
|
|
|
40874
40874
|
|
|
40875
|
-
|
|
40876
|
-
|
|
40877
|
-
|
|
40878
40875
|
var plugins_interaction_modules = {
|
|
40879
40876
|
/**
|
|
40880
40877
|
* Hide legend components by manipulating css
|
|
@@ -41424,37 +41421,60 @@ var plugins_interaction_modules = {
|
|
|
41424
41421
|
addNotHitInfo: function addNotHitInfo(hitInfo) {
|
|
41425
41422
|
var _hitInfo$items, _hitInfo$items$hitIte, _hitInfo$items$hitIte2, _hitInfo$items2, _hitInfo$items2$hitIt, _hitInfo$items2$hitIt2;
|
|
41426
41423
|
|
|
41424
|
+
var ctx = this.tooltipCtx;
|
|
41427
41425
|
var isHorizontal = !!this.options.horizontal;
|
|
41428
41426
|
var hitItemId = Object.keys(hitInfo.items)[0];
|
|
41429
41427
|
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;
|
|
41428
|
+
var maxSeriesName = '';
|
|
41429
|
+
var maxValueTxt = '';
|
|
41430
41430
|
var sIds = Object.keys(this.seriesList);
|
|
41431
41431
|
|
|
41432
41432
|
for (var ix = 0; ix < sIds.length; ix++) {
|
|
41433
41433
|
var sId = sIds[ix];
|
|
41434
41434
|
var series = this.seriesList[sId];
|
|
41435
|
-
var hasData = series.data.find(function (data) {
|
|
41436
|
-
return isHorizontal ? (data === null || data === void 0 ? void 0 : data.y) === hitItemData : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
|
|
41437
|
-
});
|
|
41438
41435
|
|
|
41439
|
-
if (
|
|
41440
|
-
var
|
|
41441
|
-
|
|
41442
|
-
|
|
41443
|
-
|
|
41444
|
-
item.axis = {
|
|
41445
|
-
x: series.xAxisIndex,
|
|
41446
|
-
y: series.yAxisIndex
|
|
41447
|
-
};
|
|
41448
|
-
item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
|
|
41449
|
-
item.data = hasData;
|
|
41450
|
-
item.data.formatted = this.getFormattedTooltipValue({
|
|
41436
|
+
if (series !== null && series !== void 0 && series.show) {
|
|
41437
|
+
var hasData = series.data.find(function (data) {
|
|
41438
|
+
return isHorizontal ? (data === null || data === void 0 ? void 0 : data.y) === hitItemData : (data === null || data === void 0 ? void 0 : data.x) === hitItemData;
|
|
41439
|
+
});
|
|
41440
|
+
var formattedValue = this.getFormattedTooltipValue({
|
|
41451
41441
|
seriesName: series.name,
|
|
41452
|
-
value: hasData.o,
|
|
41442
|
+
value: hasData === null || hasData === void 0 ? void 0 : hasData.o,
|
|
41453
41443
|
itemData: hasData
|
|
41454
41444
|
});
|
|
41455
|
-
|
|
41445
|
+
|
|
41446
|
+
if (hasData && !hitInfo.items[sId]) {
|
|
41447
|
+
var item = {};
|
|
41448
|
+
item.color = series.color;
|
|
41449
|
+
item.hit = false;
|
|
41450
|
+
item.name = series.name;
|
|
41451
|
+
item.axis = {
|
|
41452
|
+
x: series.xAxisIndex,
|
|
41453
|
+
y: series.yAxisIndex
|
|
41454
|
+
};
|
|
41455
|
+
item.index = isHorizontal ? series.yAxisIndex : series.xAxisIndex;
|
|
41456
|
+
item.data = hasData;
|
|
41457
|
+
item.data.formatted = formattedValue;
|
|
41458
|
+
hitInfo.items[sId] = item;
|
|
41459
|
+
}
|
|
41460
|
+
|
|
41461
|
+
var maxSeriesNameWidth = ctx ? ctx.measureText(maxSeriesName).width : 1;
|
|
41462
|
+
var seriesNameWidth = ctx ? ctx.measureText(series.name).width : 1;
|
|
41463
|
+
|
|
41464
|
+
if (maxSeriesNameWidth < seriesNameWidth) {
|
|
41465
|
+
maxSeriesName = series.name;
|
|
41466
|
+
}
|
|
41467
|
+
|
|
41468
|
+
var maxValueWidth = ctx ? ctx.measureText(maxValueTxt).width : 1;
|
|
41469
|
+
var valueWidth = ctx ? ctx.measureText("".concat(formattedValue)).width : 1;
|
|
41470
|
+
|
|
41471
|
+
if (maxValueWidth < valueWidth) {
|
|
41472
|
+
maxValueTxt = "".concat(formattedValue);
|
|
41473
|
+
}
|
|
41456
41474
|
}
|
|
41457
41475
|
}
|
|
41476
|
+
|
|
41477
|
+
hitInfo.maxTip = [maxSeriesName, maxValueTxt];
|
|
41458
41478
|
},
|
|
41459
41479
|
|
|
41460
41480
|
/**
|
|
@@ -41543,17 +41563,6 @@ var plugins_interaction_modules = {
|
|
|
41543
41563
|
seriesId: []
|
|
41544
41564
|
};
|
|
41545
41565
|
}
|
|
41546
|
-
|
|
41547
|
-
var selectedList = this.defaultSelectInfo.seriesId;
|
|
41548
|
-
Object.values(this.seriesList).forEach(function (series) {
|
|
41549
|
-
if (!selectedList.length) {
|
|
41550
|
-
series.state = 'normal';
|
|
41551
|
-
} else if (selectedList.includes(series.sId)) {
|
|
41552
|
-
series.state = 'highlight';
|
|
41553
|
-
} else {
|
|
41554
|
-
series.state = 'downplay';
|
|
41555
|
-
}
|
|
41556
|
-
});
|
|
41557
41566
|
}
|
|
41558
41567
|
},
|
|
41559
41568
|
|
|
@@ -42529,7 +42538,10 @@ var plugins_pie_modules = {
|
|
|
42529
42538
|
ctx.stroke();
|
|
42530
42539
|
}
|
|
42531
42540
|
|
|
42532
|
-
|
|
42541
|
+
var selectInfo = hitInfo.selectInfo,
|
|
42542
|
+
legendHitInfo = hitInfo.legendHitInfo;
|
|
42543
|
+
series.isSelect = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.sId) === slice.id;
|
|
42544
|
+
series.isDownplay = legendHitInfo && legendHitInfo.sId !== slice.id;
|
|
42533
42545
|
series.type = isDoughnut ? 'doughnut' : 'pie';
|
|
42534
42546
|
series.centerX = centerX;
|
|
42535
42547
|
series.centerY = centerY;
|
|
@@ -42634,7 +42646,10 @@ var plugins_pie_modules = {
|
|
|
42634
42646
|
ctx.stroke();
|
|
42635
42647
|
}
|
|
42636
42648
|
|
|
42637
|
-
|
|
42649
|
+
var selectInfo = hitInfo.selectInfo,
|
|
42650
|
+
legendHitInfo = hitInfo.legendHitInfo;
|
|
42651
|
+
series.isSelect = (selectInfo === null || selectInfo === void 0 ? void 0 : selectInfo.sId) === slice.id;
|
|
42652
|
+
series.isDownplay = legendHitInfo && legendHitInfo.sId !== slice.id;
|
|
42638
42653
|
series.type = 'sunburst';
|
|
42639
42654
|
series.centerX = centerX;
|
|
42640
42655
|
series.centerY = centerY;
|
|
@@ -43329,7 +43344,6 @@ var element_tip_modules = {
|
|
|
43329
43344
|
|
|
43330
43345
|
|
|
43331
43346
|
|
|
43332
|
-
|
|
43333
43347
|
|
|
43334
43348
|
|
|
43335
43349
|
var chart_core_EvChart = /*#__PURE__*/function () {
|
|
@@ -43491,7 +43505,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43491
43505
|
this.axesSteps = this.calculateSteps();
|
|
43492
43506
|
this.drawAxis(hitInfo);
|
|
43493
43507
|
this.drawSeries(hitInfo);
|
|
43494
|
-
this.drawTip(
|
|
43508
|
+
this.drawTip();
|
|
43495
43509
|
|
|
43496
43510
|
if (this.bufferCanvas) {
|
|
43497
43511
|
this.displayCtx.drawImage(this.bufferCanvas, 0, 0);
|
|
@@ -43499,7 +43513,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43499
43513
|
}
|
|
43500
43514
|
/**
|
|
43501
43515
|
* Draw each series
|
|
43502
|
-
* @param {any} [hitInfo=undefined]
|
|
43516
|
+
* @param {any} [hitInfo=undefined] legend mouseover callback (object or undefined)
|
|
43503
43517
|
*
|
|
43504
43518
|
* @returns {undefined}
|
|
43505
43519
|
*/
|
|
@@ -43553,12 +43567,17 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43553
43567
|
case 'line':
|
|
43554
43568
|
case 'heatMap':
|
|
43555
43569
|
{
|
|
43556
|
-
|
|
43570
|
+
var legendHitInfo = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43571
|
+
series.draw(_objectSpread2({
|
|
43572
|
+
legendHitInfo: legendHitInfo
|
|
43573
|
+
}, opt));
|
|
43557
43574
|
break;
|
|
43558
43575
|
}
|
|
43559
43576
|
|
|
43560
43577
|
case 'bar':
|
|
43561
43578
|
{
|
|
43579
|
+
var _legendHitInfo = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43580
|
+
|
|
43562
43581
|
var _this$options3 = this.options,
|
|
43563
43582
|
thickness = _this$options3.thickness,
|
|
43564
43583
|
cPadRatio = _this$options3.cPadRatio,
|
|
@@ -43568,7 +43587,8 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43568
43587
|
cPadRatio: cPadRatio,
|
|
43569
43588
|
borderRadius: borderRadius,
|
|
43570
43589
|
showSeriesCount: showSeriesCount,
|
|
43571
|
-
showIndex: showIndex
|
|
43590
|
+
showIndex: showIndex,
|
|
43591
|
+
legendHitInfo: _legendHitInfo
|
|
43572
43592
|
}, opt));
|
|
43573
43593
|
|
|
43574
43594
|
if (series.show) {
|
|
@@ -43580,16 +43600,24 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43580
43600
|
|
|
43581
43601
|
case 'pie':
|
|
43582
43602
|
{
|
|
43583
|
-
var
|
|
43603
|
+
var _this$lastHitInfo, _this$defaultSelectIt;
|
|
43584
43604
|
|
|
43585
|
-
var selectInfo = (
|
|
43605
|
+
var selectInfo = (_this$lastHitInfo = this.lastHitInfo) !== null && _this$lastHitInfo !== void 0 ? _this$lastHitInfo : {
|
|
43586
43606
|
sId: (_this$defaultSelectIt = this.defaultSelectItemInfo) === null || _this$defaultSelectIt === void 0 ? void 0 : _this$defaultSelectIt.seriesID
|
|
43587
43607
|
};
|
|
43588
43608
|
|
|
43609
|
+
var _legendHitInfo2 = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43610
|
+
|
|
43589
43611
|
if (this.options.sunburst) {
|
|
43590
|
-
this.drawSunburst(
|
|
43612
|
+
this.drawSunburst({
|
|
43613
|
+
selectInfo: selectInfo,
|
|
43614
|
+
legendHitInfo: _legendHitInfo2
|
|
43615
|
+
});
|
|
43591
43616
|
} else {
|
|
43592
|
-
this.drawPie(
|
|
43617
|
+
this.drawPie({
|
|
43618
|
+
selectInfo: selectInfo,
|
|
43619
|
+
legendHitInfo: _legendHitInfo2
|
|
43620
|
+
});
|
|
43593
43621
|
}
|
|
43594
43622
|
|
|
43595
43623
|
if (this.options.doughnutHoleSize > 0) {
|
|
@@ -43601,34 +43629,30 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43601
43629
|
|
|
43602
43630
|
case 'scatter':
|
|
43603
43631
|
{
|
|
43632
|
+
var _legendHitInfo3 = hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.legend;
|
|
43633
|
+
|
|
43634
|
+
var _selectInfo = void 0;
|
|
43635
|
+
|
|
43604
43636
|
if (selectItem.use && selectItem.useSeriesOpacity) {
|
|
43605
|
-
var
|
|
43606
|
-
|
|
43607
|
-
|
|
43608
|
-
|
|
43609
|
-
|
|
43610
|
-
|
|
43611
|
-
|
|
43612
|
-
};
|
|
43613
|
-
} else {
|
|
43614
|
-
opt.selectInfo = null;
|
|
43615
|
-
}
|
|
43616
|
-
} 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) {
|
|
43617
|
-
opt.selectInfo = {
|
|
43618
|
-
seriesID: this.lastHitInfo.sId,
|
|
43619
|
-
dataIndex: this.lastHitInfo.maxIndex
|
|
43620
|
-
};
|
|
43621
|
-
} 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) {
|
|
43622
|
-
opt.selectInfo = {
|
|
43623
|
-
seriesID: this.defaultSelectItemInfo.seriesID,
|
|
43624
|
-
dataIndex: this.defaultSelectItemInfo.dataIndex
|
|
43637
|
+
var lastHitInfo = this.lastHitInfo;
|
|
43638
|
+
var defaultSelectInfo = this.defaultSelectItemInfo;
|
|
43639
|
+
|
|
43640
|
+
if (lastHitInfo !== null && lastHitInfo !== void 0 && lastHitInfo.maxIndex || (lastHitInfo === null || lastHitInfo === void 0 ? void 0 : lastHitInfo.maxIndex) === 0) {
|
|
43641
|
+
_selectInfo = {
|
|
43642
|
+
seriesID: lastHitInfo.sId,
|
|
43643
|
+
dataIndex: lastHitInfo.maxIndex
|
|
43625
43644
|
};
|
|
43645
|
+
} else if (defaultSelectInfo !== null && defaultSelectInfo !== void 0 && defaultSelectInfo.dataIndex || (defaultSelectInfo === null || defaultSelectInfo === void 0 ? void 0 : defaultSelectInfo.dataIndex) === 0) {
|
|
43646
|
+
_selectInfo = _objectSpread2({}, defaultSelectInfo);
|
|
43626
43647
|
} else {
|
|
43627
|
-
|
|
43648
|
+
_selectInfo = null;
|
|
43628
43649
|
}
|
|
43629
43650
|
}
|
|
43630
43651
|
|
|
43631
|
-
series.draw(
|
|
43652
|
+
series.draw(_objectSpread2({
|
|
43653
|
+
legendHitInfo: _legendHitInfo3,
|
|
43654
|
+
selectInfo: _selectInfo
|
|
43655
|
+
}, opt));
|
|
43632
43656
|
break;
|
|
43633
43657
|
}
|
|
43634
43658
|
|
|
@@ -43642,21 +43666,14 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
43642
43666
|
}
|
|
43643
43667
|
/**
|
|
43644
43668
|
* Draw Tip with hitInfo and defaultSelectItemInfo
|
|
43645
|
-
* @param hitInfo
|
|
43646
43669
|
*/
|
|
43647
43670
|
|
|
43648
43671
|
}, {
|
|
43649
43672
|
key: "drawTip",
|
|
43650
|
-
value: function drawTip(
|
|
43651
|
-
if (helpers_util.isPieType(hitInfo === null || hitInfo === void 0 ? void 0 : hitInfo.type)) {
|
|
43652
|
-
return;
|
|
43653
|
-
}
|
|
43654
|
-
|
|
43673
|
+
value: function drawTip() {
|
|
43655
43674
|
var tipLocationInfo;
|
|
43656
43675
|
|
|
43657
|
-
if (
|
|
43658
|
-
tipLocationInfo = hitInfo;
|
|
43659
|
-
} else if (this.lastHitInfo) {
|
|
43676
|
+
if (this.lastHitInfo) {
|
|
43660
43677
|
tipLocationInfo = this.lastHitInfo;
|
|
43661
43678
|
} else if (this.defaultSelectItemInfo) {
|
|
43662
43679
|
tipLocationInfo = this.getItem(this.defaultSelectItemInfo, false);
|