evui 3.4.129 → 3.4.130
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 +282 -706
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +282 -706
- 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 +2 -2
- package/src/components/chart/element/element.bar.js +61 -131
- package/src/components/chart/element/element.heatmap.js +3 -4
- package/src/components/chart/element/element.line.js +9 -11
- package/src/components/chart/element/element.tip.js +60 -120
- package/src/components/chart/helpers/helpers.util.js +15 -19
- package/src/components/chart/model/model.store.js +17 -40
- package/src/components/chart/plugins/plugins.interaction.js +8 -69
- package/src/components/chart/plugins/plugins.legend.js +6 -4
- package/src/components/chart/plugins/plugins.tooltip.js +4 -15
- package/src/components/chart/scale/scale.js +7 -17
- package/src/components/chart/scale/scale.linear.js +3 -183
- package/src/components/chart/uses.js +0 -1
package/dist/evui.common.js
CHANGED
|
@@ -11174,7 +11174,7 @@ module.exports = exports;
|
|
|
11174
11174
|
/***/ "9224":
|
|
11175
11175
|
/***/ (function(module) {
|
|
11176
11176
|
|
|
11177
|
-
module.exports = JSON.parse("{\"a\":\"3.4.
|
|
11177
|
+
module.exports = JSON.parse("{\"a\":\"3.4.130\"}");
|
|
11178
11178
|
|
|
11179
11179
|
/***/ }),
|
|
11180
11180
|
|
|
@@ -38503,26 +38503,26 @@ var es_string_match = __webpack_require__("466d");
|
|
|
38503
38503
|
return value;
|
|
38504
38504
|
}
|
|
38505
38505
|
|
|
38506
|
-
var isNegative = value < 0;
|
|
38507
|
-
var absValue = Math.abs(value);
|
|
38508
|
-
|
|
38509
38506
|
var assignLabelWith = function assignLabelWith(v, target, lb) {
|
|
38510
|
-
|
|
38511
|
-
|
|
38512
|
-
|
|
38513
|
-
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
|
|
38517
|
-
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38521
|
-
|
|
38522
|
-
|
|
38523
|
-
|
|
38507
|
+
if (v % target === 0) {
|
|
38508
|
+
return "".concat((v / target).toFixed(decimalPoint)).concat(lb);
|
|
38509
|
+
}
|
|
38510
|
+
|
|
38511
|
+
return "".concat((v / target).toFixed(1)).concat(lb);
|
|
38512
|
+
};
|
|
38513
|
+
|
|
38514
|
+
if (value >= quad) {
|
|
38515
|
+
label = assignLabelWith(value, quad, 'P');
|
|
38516
|
+
} else if (value >= trill) {
|
|
38517
|
+
label = assignLabelWith(value, trill, 'T');
|
|
38518
|
+
} else if (value >= billi) {
|
|
38519
|
+
label = assignLabelWith(value, billi, 'G');
|
|
38520
|
+
} else if (value >= milli) {
|
|
38521
|
+
label = assignLabelWith(value, milli, 'M');
|
|
38522
|
+
} else if (value >= killo) {
|
|
38523
|
+
label = assignLabelWith(value, 1000, 'K');
|
|
38524
38524
|
} else {
|
|
38525
|
-
label =
|
|
38525
|
+
label = value.toFixed(decimalPoint);
|
|
38526
38526
|
}
|
|
38527
38527
|
|
|
38528
38528
|
return label;
|
|
@@ -38796,23 +38796,21 @@ var modules = {
|
|
|
38796
38796
|
seriesIDs.forEach(function (seriesID) {
|
|
38797
38797
|
var series = _this.seriesList[seriesID];
|
|
38798
38798
|
var sData = data[seriesID];
|
|
38799
|
-
var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
|
|
38800
38799
|
|
|
38801
38800
|
if (series && sData) {
|
|
38802
38801
|
series.data = _this.addSeriesDSforScatter(sData);
|
|
38803
|
-
series.minMax = _this.getSeriesMinMax(series.data
|
|
38802
|
+
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38804
38803
|
}
|
|
38805
38804
|
});
|
|
38806
38805
|
} else if (typeKey === 'heatMap') {
|
|
38807
38806
|
seriesIDs.forEach(function (seriesID) {
|
|
38808
38807
|
var series = _this.seriesList[seriesID];
|
|
38809
|
-
var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
|
|
38810
38808
|
var sData = data[seriesID];
|
|
38811
38809
|
|
|
38812
38810
|
if (series && sData) {
|
|
38813
38811
|
series.labels = label;
|
|
38814
38812
|
series.data = _this.addSeriesDSForHeatMap(sData);
|
|
38815
|
-
series.minMax = _this.getSeriesMinMax(series.data
|
|
38813
|
+
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38816
38814
|
series.valueOpt = _this.getSeriesValueOptForHeatMap(series);
|
|
38817
38815
|
}
|
|
38818
38816
|
});
|
|
@@ -38844,7 +38842,7 @@ var modules = {
|
|
|
38844
38842
|
series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
|
|
38845
38843
|
}
|
|
38846
38844
|
|
|
38847
|
-
series.minMax = _this.getSeriesMinMax(series.data
|
|
38845
|
+
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38848
38846
|
}
|
|
38849
38847
|
});
|
|
38850
38848
|
}
|
|
@@ -39240,19 +39238,17 @@ var modules = {
|
|
|
39240
39238
|
var isHorizontal = this.options.horizontal;
|
|
39241
39239
|
var sdata = [];
|
|
39242
39240
|
|
|
39243
|
-
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex
|
|
39241
|
+
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex) {
|
|
39244
39242
|
var nextBaseSeriesIndex = baseIndex - 1;
|
|
39245
39243
|
var baseSeries = _this4.seriesList[bsIds[baseIndex]];
|
|
39246
39244
|
var baseDataList = baseSeries.data;
|
|
39247
39245
|
var baseData = baseDataList[dataIndex];
|
|
39248
39246
|
var position = isHorizontal ? baseData === null || baseData === void 0 ? void 0 : baseData.x : baseData === null || baseData === void 0 ? void 0 : baseData.y;
|
|
39249
|
-
var
|
|
39250
|
-
var isPassingValue = !helpers_util.isNullOrUndefined(baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) && (baseSeries === null || baseSeries === void 0 ? void 0 : baseSeries.passingValue) === baseValue;
|
|
39251
|
-
var isSameSign = curr >= 0 && baseValue >= 0 || curr < 0 && baseValue < 0;
|
|
39247
|
+
var isPassingValue = baseSeries.passingValue === (baseData === null || baseData === void 0 ? void 0 : baseData.o);
|
|
39252
39248
|
|
|
39253
|
-
if (isPassingValue || position == null || !
|
|
39249
|
+
if (isPassingValue || position == null || !baseSeries.show) {
|
|
39254
39250
|
if (nextBaseSeriesIndex > -1) {
|
|
39255
|
-
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex
|
|
39251
|
+
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex);
|
|
39256
39252
|
}
|
|
39257
39253
|
|
|
39258
39254
|
return 0;
|
|
@@ -39263,7 +39259,7 @@ var modules = {
|
|
|
39263
39259
|
|
|
39264
39260
|
data.forEach(function (curr, index) {
|
|
39265
39261
|
var baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
|
|
39266
|
-
var bdata = getBaseDataPosition(baseIndex, index
|
|
39262
|
+
var bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
|
|
39267
39263
|
|
|
39268
39264
|
var odata = curr; // current series original data
|
|
39269
39265
|
|
|
@@ -39446,7 +39442,7 @@ var modules = {
|
|
|
39446
39442
|
*
|
|
39447
39443
|
* @returns {object} min/max info for series
|
|
39448
39444
|
*/
|
|
39449
|
-
getSeriesMinMax: function getSeriesMinMax(data
|
|
39445
|
+
getSeriesMinMax: function getSeriesMinMax(data) {
|
|
39450
39446
|
var def = {
|
|
39451
39447
|
minX: null,
|
|
39452
39448
|
minY: null,
|
|
@@ -39457,24 +39453,22 @@ var modules = {
|
|
|
39457
39453
|
var isHorizontal = this.options.horizontal;
|
|
39458
39454
|
|
|
39459
39455
|
if (data.length) {
|
|
39460
|
-
var usePassingValue = !helpers_util.isNullOrUndefined(passingValue);
|
|
39461
39456
|
return data.reduce(function (acc, p, index) {
|
|
39462
|
-
var _p$x, _p$y
|
|
39457
|
+
var _p$x, _p$y;
|
|
39463
39458
|
|
|
39464
39459
|
var minmax = acc;
|
|
39465
39460
|
var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
|
|
39466
39461
|
var py = ((_p$y = p.y) === null || _p$y === void 0 ? void 0 : _p$y.value) || p.y;
|
|
39467
|
-
var po = ((_p$o = p.o) === null || _p$o === void 0 ? void 0 : _p$o.value) || p.o;
|
|
39468
39462
|
|
|
39469
|
-
if (
|
|
39463
|
+
if (px <= minmax.minX) {
|
|
39470
39464
|
minmax.minX = px === null ? 0 : px;
|
|
39471
39465
|
}
|
|
39472
39466
|
|
|
39473
|
-
if (
|
|
39467
|
+
if (py <= minmax.minY) {
|
|
39474
39468
|
minmax.minY = py === null ? 0 : py;
|
|
39475
39469
|
}
|
|
39476
39470
|
|
|
39477
|
-
if (
|
|
39471
|
+
if (px >= minmax.maxX) {
|
|
39478
39472
|
minmax.maxX = px === null ? 0 : px;
|
|
39479
39473
|
|
|
39480
39474
|
if (isHorizontal && px !== null) {
|
|
@@ -39483,7 +39477,7 @@ var modules = {
|
|
|
39483
39477
|
}
|
|
39484
39478
|
}
|
|
39485
39479
|
|
|
39486
|
-
if (
|
|
39480
|
+
if (py >= minmax.maxY) {
|
|
39487
39481
|
minmax.maxY = py === null ? 0 : py;
|
|
39488
39482
|
|
|
39489
39483
|
if (!isHorizontal && py !== null) {
|
|
@@ -40237,25 +40231,14 @@ var modules = {
|
|
|
40237
40231
|
}
|
|
40238
40232
|
}
|
|
40239
40233
|
|
|
40240
|
-
|
|
40241
|
-
var maxXisNegative = minmax.x[axisX].max < 0;
|
|
40242
|
-
|
|
40243
|
-
if (isExistGrp && maxXisNegative) {
|
|
40244
|
-
minmax.x[axisX].max = smm.maxX;
|
|
40245
|
-
minmax.x[axisX].maxSID = key;
|
|
40246
|
-
} else if (!minmax.x[axisX].max || smm.maxX >= minmax.x[axisX].max) {
|
|
40234
|
+
if (smm.maxX >= minmax.x[axisX].max) {
|
|
40247
40235
|
minmax.x[axisX].max = smm.maxX;
|
|
40248
40236
|
minmax.x[axisX].maxSID = key;
|
|
40249
40237
|
}
|
|
40250
40238
|
|
|
40251
|
-
|
|
40252
|
-
|
|
40253
|
-
if (isExistGrp && maxYisNegative) {
|
|
40254
|
-
minmax.y[axisY].max = smm.maxY;
|
|
40255
|
-
minmax.y[axisY].maxSID = key;
|
|
40256
|
-
} else if (!minmax.y[axisY].max || smm.maxY >= minmax.y[axisY].max) {
|
|
40239
|
+
if (smm.maxY >= minmax.y[axisY].max) {
|
|
40257
40240
|
minmax.y[axisY].max = smm.maxY;
|
|
40258
|
-
minmax.y[
|
|
40241
|
+
minmax.y[axisX].maxSID = key;
|
|
40259
40242
|
}
|
|
40260
40243
|
}
|
|
40261
40244
|
|
|
@@ -41716,7 +41699,6 @@ var TIME_INTERVALS = {
|
|
|
41716
41699
|
|
|
41717
41700
|
|
|
41718
41701
|
|
|
41719
|
-
|
|
41720
41702
|
var element_line_Line = /*#__PURE__*/function () {
|
|
41721
41703
|
function Line(sId, opt, sIdx) {
|
|
41722
41704
|
var _this = this;
|
|
@@ -41850,6 +41832,7 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41850
41832
|
ctx.setLineDash(this.segments);
|
|
41851
41833
|
}
|
|
41852
41834
|
|
|
41835
|
+
var endPoint = chartRect.y2 - labelOffset.bottom;
|
|
41853
41836
|
var isLinearInterpolation = this.useLinearInterpolation();
|
|
41854
41837
|
var barAreaByCombo = 0;
|
|
41855
41838
|
var minmaxX = axesSteps.x[this.xAxisIndex];
|
|
@@ -41872,12 +41855,8 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41872
41855
|
|
|
41873
41856
|
var getYPos = function getYPos(val) {
|
|
41874
41857
|
return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
41875
|
-
};
|
|
41858
|
+
}; // draw line
|
|
41876
41859
|
|
|
41877
|
-
var includeNegativeValue = this.data.some(function (data) {
|
|
41878
|
-
return data.o < 0;
|
|
41879
|
-
});
|
|
41880
|
-
var endPoint = includeNegativeValue ? getYPos(0) : chartRect.y2 - labelOffset.bottom; // draw line
|
|
41881
41860
|
|
|
41882
41861
|
var prevValid;
|
|
41883
41862
|
this.data.forEach(function (curr) {
|
|
@@ -41937,10 +41916,9 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41937
41916
|
}
|
|
41938
41917
|
});
|
|
41939
41918
|
var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
|
|
41940
|
-
|
|
41941
|
-
gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
|
|
41919
|
+
gradient.addColorStop(0, fillColor);
|
|
41942
41920
|
gradient.addColorStop(0.5, fillColor);
|
|
41943
|
-
gradient.addColorStop(1,
|
|
41921
|
+
gradient.addColorStop(1, extent.opacity < 1 ? fillColor : mainColor);
|
|
41944
41922
|
ctx.fillStyle = gradient;
|
|
41945
41923
|
} else {
|
|
41946
41924
|
ctx.fillStyle = fillColor;
|
|
@@ -42008,7 +41986,7 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
42008
41986
|
|
|
42009
41987
|
var nextData = _this2.data[jx];
|
|
42010
41988
|
var xp = getXPos(nextData.x);
|
|
42011
|
-
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 :
|
|
41989
|
+
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : endPoint;
|
|
42012
41990
|
ctx.lineTo(xp, bp);
|
|
42013
41991
|
}
|
|
42014
41992
|
|
|
@@ -42119,23 +42097,22 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
42119
42097
|
|
|
42120
42098
|
var s = 0;
|
|
42121
42099
|
var e = gdata.length - 1;
|
|
42122
|
-
var
|
|
42123
|
-
var xpInterval = Math.max(gap, 6);
|
|
42100
|
+
var xpInterval = ((_gdata$ = gdata[1]) === null || _gdata$ === void 0 ? void 0 : _gdata$.xp) - gdata[0].xp < 6 ? 1.5 : 6;
|
|
42124
42101
|
|
|
42125
42102
|
while (s <= e) {
|
|
42126
42103
|
var m = Math.floor((s + e) / 2);
|
|
42127
42104
|
var x = gdata[m].xp;
|
|
42128
42105
|
var y = gdata[m].yp;
|
|
42129
42106
|
|
|
42130
|
-
if (x - xpInterval
|
|
42107
|
+
if (x - xpInterval < xp && xp < x + xpInterval) {
|
|
42131
42108
|
var _gdata$m, _gdata$xp, _gdata, _gdata2, _gdata3;
|
|
42132
42109
|
|
|
42133
42110
|
var curXpInterval = ((_gdata$m = gdata[m]) === null || _gdata$m === void 0 ? void 0 : _gdata$m.xp) - ((_gdata$xp = (_gdata = gdata[m - 1]) === null || _gdata === void 0 ? void 0 : _gdata.xp) !== null && _gdata$xp !== void 0 ? _gdata$xp : 0);
|
|
42134
42111
|
|
|
42135
42112
|
if ((_gdata2 = gdata[m - 1]) !== null && _gdata2 !== void 0 && _gdata2.xp && (_gdata3 = gdata[m + 1]) !== null && _gdata3 !== void 0 && _gdata3.xp && curXpInterval > 0) {
|
|
42136
|
-
var leftXp =
|
|
42113
|
+
var leftXp = xp - gdata[m - 1].xp;
|
|
42137
42114
|
var midXp = Math.abs(xp - gdata[m].xp);
|
|
42138
|
-
var rightXp =
|
|
42115
|
+
var rightXp = gdata[m + 1].xp - xp;
|
|
42139
42116
|
|
|
42140
42117
|
if (Math.abs(this.beforeMouseXp - xp) >= curXpInterval - SPARE_XP && (this.beforeFindItemIndex === m || midXp === rightXp || midXp === leftXp)) {
|
|
42141
42118
|
if (this.beforeMouseXp - xp > 0) {
|
|
@@ -42783,12 +42760,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42783
42760
|
|
|
42784
42761
|
var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
|
|
42785
42762
|
var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
|
|
42786
|
-
var
|
|
42787
|
-
var
|
|
42788
|
-
var xZeroPosition = helpers_canvas.calculateX(0, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42789
|
-
var yZeroPosition = helpers_canvas.calculateY(0, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42790
|
-
var xsp = isHorizontal ? xAxisPosition + xZeroPosition : xAxisPosition;
|
|
42791
|
-
var ysp = isHorizontal ? yAxisPosition : yAxisPosition + yZeroPosition;
|
|
42763
|
+
var xsp = chartRect.x1 + labelOffset.left;
|
|
42764
|
+
var ysp = chartRect.y2 - labelOffset.bottom;
|
|
42792
42765
|
var dArea = isHorizontal ? yArea : xArea;
|
|
42793
42766
|
var cArea = dArea / (totalCount || 1);
|
|
42794
42767
|
var cPad;
|
|
@@ -42852,8 +42825,7 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42852
42825
|
categoryPoint = ysp - cArea * screenIndex - cPad;
|
|
42853
42826
|
} else {
|
|
42854
42827
|
categoryPoint = xsp + cArea * screenIndex + cPad;
|
|
42855
|
-
}
|
|
42856
|
-
|
|
42828
|
+
}
|
|
42857
42829
|
|
|
42858
42830
|
if (isHorizontal) {
|
|
42859
42831
|
x = xsp;
|
|
@@ -42861,30 +42833,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42861
42833
|
} else {
|
|
42862
42834
|
x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
|
|
42863
42835
|
y = ysp;
|
|
42864
|
-
}
|
|
42865
|
-
|
|
42836
|
+
}
|
|
42866
42837
|
|
|
42867
42838
|
if (isHorizontal) {
|
|
42868
|
-
var barValue = item.b ? item.o : item.x;
|
|
42869
|
-
w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
|
|
42870
|
-
|
|
42871
42839
|
if (item.b) {
|
|
42872
|
-
|
|
42840
|
+
w = helpers_canvas.calculateX(item.x - item.b, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42841
|
+
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
|
|
42842
|
+
} else {
|
|
42843
|
+
w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42873
42844
|
}
|
|
42874
|
-
|
|
42875
|
-
|
|
42876
|
-
|
|
42845
|
+
} else if (item.b) {
|
|
42846
|
+
// vertical stack bar chart
|
|
42847
|
+
h = helpers_canvas.calculateY(item.y - item.b, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42848
|
+
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
42877
42849
|
} else {
|
|
42878
|
-
|
|
42879
|
-
|
|
42880
|
-
h = helpers_canvas.calculateY(_barValue, minmaxY.graphMin, minmaxY.graphMax, yArea, -yZeroPosition);
|
|
42881
|
-
|
|
42882
|
-
if (item.b) {
|
|
42883
|
-
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp - yZeroPosition);
|
|
42884
|
-
}
|
|
42885
|
-
|
|
42886
|
-
var minimumBarHeight = _barValue > 0 ? -1 : 1;
|
|
42887
|
-
h = _barValue && Math.abs(h) === 0 ? minimumBarHeight : h;
|
|
42850
|
+
// vertical bar chart
|
|
42851
|
+
h = helpers_canvas.calculateY(item.y, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42888
42852
|
}
|
|
42889
42853
|
|
|
42890
42854
|
var barColor = item.dataColor || this.color;
|
|
@@ -43173,10 +43137,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43173
43137
|
align = _this$showValue.align,
|
|
43174
43138
|
formatter = _this$showValue.formatter,
|
|
43175
43139
|
decimalPoint = _this$showValue.decimalPoint;
|
|
43176
|
-
var
|
|
43177
|
-
|
|
43178
|
-
|
|
43179
|
-
|
|
43140
|
+
var x = positions.x,
|
|
43141
|
+
y = positions.y,
|
|
43142
|
+
w = positions.w,
|
|
43143
|
+
h = positions.h;
|
|
43180
43144
|
var ctx = context;
|
|
43181
43145
|
ctx.save();
|
|
43182
43146
|
ctx.beginPath();
|
|
@@ -43211,27 +43175,25 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43211
43175
|
formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
|
|
43212
43176
|
}
|
|
43213
43177
|
|
|
43214
|
-
var isNegativeValue = value < 0;
|
|
43215
43178
|
var textWidth = Math.round(ctx.measureText(formattedTxt).width);
|
|
43216
|
-
var textHeight = fontSize
|
|
43217
|
-
|
|
43218
|
-
var
|
|
43219
|
-
var
|
|
43220
|
-
var
|
|
43221
|
-
var
|
|
43222
|
-
var
|
|
43223
|
-
var
|
|
43224
|
-
var drawableBarHeight = Math.abs(barHeight) - GAP;
|
|
43179
|
+
var textHeight = fontSize + 4;
|
|
43180
|
+
var minXPos = x + 10;
|
|
43181
|
+
var minYPos = y - 10;
|
|
43182
|
+
var widthFreeSpaceToDraw = w - 10;
|
|
43183
|
+
var heightFreeSpaceToDraw = Math.abs(h + 10);
|
|
43184
|
+
var centerX = x + w / 2 <= minXPos ? minXPos : x + w / 2;
|
|
43185
|
+
var centerY = y + h / 2 >= minYPos ? minYPos : y + h / 2;
|
|
43186
|
+
var centerYHorizontal = isHighlight ? y + h / 2 : y - h / 2;
|
|
43225
43187
|
|
|
43226
43188
|
switch (align) {
|
|
43227
43189
|
case 'start':
|
|
43228
43190
|
{
|
|
43229
|
-
if (isHorizontal
|
|
43230
|
-
|
|
43231
|
-
|
|
43232
|
-
|
|
43233
|
-
|
|
43234
|
-
ctx.fillText(formattedTxt,
|
|
43191
|
+
if (isHorizontal) {
|
|
43192
|
+
if (textWidth < widthFreeSpaceToDraw) {
|
|
43193
|
+
ctx.fillText(formattedTxt, minXPos, centerYHorizontal);
|
|
43194
|
+
}
|
|
43195
|
+
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43196
|
+
ctx.fillText(formattedTxt, centerX, minYPos);
|
|
43235
43197
|
}
|
|
43236
43198
|
|
|
43237
43199
|
break;
|
|
@@ -43239,10 +43201,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43239
43201
|
|
|
43240
43202
|
case 'center':
|
|
43241
43203
|
{
|
|
43242
|
-
if (isHorizontal
|
|
43243
|
-
|
|
43244
|
-
|
|
43245
|
-
|
|
43204
|
+
if (isHorizontal) {
|
|
43205
|
+
if (textWidth < widthFreeSpaceToDraw) {
|
|
43206
|
+
ctx.fillText(formattedTxt, centerX, centerYHorizontal);
|
|
43207
|
+
}
|
|
43208
|
+
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43209
|
+
ctx.fillText(formattedTxt, centerX, centerY);
|
|
43246
43210
|
}
|
|
43247
43211
|
|
|
43248
43212
|
break;
|
|
@@ -43256,26 +43220,9 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43256
43220
|
}
|
|
43257
43221
|
|
|
43258
43222
|
if (isHorizontal) {
|
|
43259
|
-
|
|
43260
|
-
var maxXOnChart = this.chartRect.x2 - this.labelOffset.right;
|
|
43261
|
-
|
|
43262
|
-
if (isNegativeValue) {
|
|
43263
|
-
var _xPos = barX - GAP + barWidth - textWidth;
|
|
43264
|
-
|
|
43265
|
-
if (_xPos > minXOnChart) {
|
|
43266
|
-
ctx.fillText(formattedTxt, _xPos, centerYOnBar);
|
|
43267
|
-
}
|
|
43268
|
-
} else {
|
|
43269
|
-
var _xPos2 = barX + GAP + barWidth;
|
|
43270
|
-
|
|
43271
|
-
if (_xPos2 + textWidth < maxXOnChart) {
|
|
43272
|
-
ctx.fillText(formattedTxt, _xPos2, centerYOnBar);
|
|
43273
|
-
}
|
|
43274
|
-
}
|
|
43223
|
+
ctx.fillText(formattedTxt, minXPos + w, centerYHorizontal);
|
|
43275
43224
|
} else {
|
|
43276
|
-
|
|
43277
|
-
|
|
43278
|
-
ctx.fillText(formattedTxt, centerXOnBar, _yPos);
|
|
43225
|
+
ctx.fillText(formattedTxt, centerX, y + h - textHeight / 2);
|
|
43279
43226
|
}
|
|
43280
43227
|
|
|
43281
43228
|
break;
|
|
@@ -43284,22 +43231,14 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43284
43231
|
default:
|
|
43285
43232
|
case 'end':
|
|
43286
43233
|
{
|
|
43287
|
-
if (isHorizontal
|
|
43288
|
-
|
|
43289
|
-
|
|
43290
|
-
|
|
43291
|
-
} else if (!isHorizontal) {
|
|
43292
|
-
if (isNegativeValue) {
|
|
43293
|
-
var _yPos2 = barY + barHeight - GAP;
|
|
43294
|
-
|
|
43295
|
-
if (_yPos2 > minYPos) {
|
|
43296
|
-
ctx.fillText(formattedTxt, centerXOnBar, _yPos2);
|
|
43297
|
-
}
|
|
43298
|
-
} else if (textHeight < drawableBarHeight) {
|
|
43299
|
-
var _yPos3 = barY + barHeight + GAP;
|
|
43300
|
-
|
|
43301
|
-
ctx.fillText(formattedTxt, centerXOnBar, _yPos3);
|
|
43234
|
+
if (isHorizontal) {
|
|
43235
|
+
if (textWidth < widthFreeSpaceToDraw) {
|
|
43236
|
+
var xPos = x + w - textWidth * 2;
|
|
43237
|
+
ctx.fillText(formattedTxt, xPos <= minXPos ? minXPos : xPos, centerYHorizontal);
|
|
43302
43238
|
}
|
|
43239
|
+
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43240
|
+
var yPos = y + h + textHeight;
|
|
43241
|
+
ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
|
|
43303
43242
|
}
|
|
43304
43243
|
|
|
43305
43244
|
break;
|
|
@@ -43356,50 +43295,28 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43356
43295
|
ctx.beginPath();
|
|
43357
43296
|
ctx.moveTo(x, y);
|
|
43358
43297
|
|
|
43359
|
-
if (Math.abs(w) < r * 2) {
|
|
43360
|
-
r = Math.abs(w) / 2;
|
|
43361
|
-
}
|
|
43362
|
-
|
|
43363
|
-
if (Math.abs(h) < r * 2) {
|
|
43364
|
-
r = Math.abs(h) / 2;
|
|
43365
|
-
}
|
|
43366
|
-
|
|
43367
43298
|
if (isHorizontal) {
|
|
43368
|
-
|
|
43369
|
-
|
|
43370
|
-
if (isNegativeValue) {
|
|
43371
|
-
w += r;
|
|
43372
|
-
ctx.lineTo(x + w, y);
|
|
43373
|
-
ctx.arcTo(x + w - r, y, x + w - r, y - r, r);
|
|
43374
|
-
ctx.arcTo(x + w - r, y - h, x + w, y - h, r);
|
|
43375
|
-
ctx.lineTo(x, y - h);
|
|
43376
|
-
ctx.lineTo(x, y);
|
|
43377
|
-
} else {
|
|
43378
|
-
w -= r;
|
|
43379
|
-
ctx.lineTo(x + w, y);
|
|
43380
|
-
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43381
|
-
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43382
|
-
ctx.lineTo(x, y - h);
|
|
43383
|
-
ctx.lineTo(x, y);
|
|
43299
|
+
if (h < r * 2) {
|
|
43300
|
+
r = h / 2;
|
|
43384
43301
|
}
|
|
43302
|
+
|
|
43303
|
+
w -= r;
|
|
43304
|
+
ctx.lineTo(x + w, y);
|
|
43305
|
+
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43306
|
+
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43307
|
+
ctx.lineTo(x, y - h);
|
|
43308
|
+
ctx.lineTo(x, y);
|
|
43385
43309
|
} else {
|
|
43386
|
-
|
|
43387
|
-
|
|
43388
|
-
if (_isNegativeValue) {
|
|
43389
|
-
h -= r;
|
|
43390
|
-
ctx.lineTo(x + w, y);
|
|
43391
|
-
ctx.lineTo(x + w, y + h);
|
|
43392
|
-
ctx.arcTo(x + w, y + h + r, x - w + r, y + h + r, r);
|
|
43393
|
-
ctx.arcTo(x, y + h + r, x, y + h, r);
|
|
43394
|
-
ctx.lineTo(x, y);
|
|
43395
|
-
} else {
|
|
43396
|
-
h += r;
|
|
43397
|
-
ctx.lineTo(x + w, y);
|
|
43398
|
-
ctx.lineTo(x + w, y + h);
|
|
43399
|
-
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43400
|
-
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43401
|
-
ctx.lineTo(x, y);
|
|
43310
|
+
if (w < r * 2) {
|
|
43311
|
+
r = w / 2;
|
|
43402
43312
|
}
|
|
43313
|
+
|
|
43314
|
+
h += r;
|
|
43315
|
+
ctx.lineTo(x + w, y);
|
|
43316
|
+
ctx.lineTo(x + w, y + h);
|
|
43317
|
+
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43318
|
+
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43319
|
+
ctx.lineTo(x, y);
|
|
43403
43320
|
}
|
|
43404
43321
|
|
|
43405
43322
|
ctx.fill();
|
|
@@ -44723,7 +44640,7 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
|
|
|
44723
44640
|
key: "findSelectionRange",
|
|
44724
44641
|
value: function findSelectionRange(rangeInfo) {
|
|
44725
44642
|
var xsp = rangeInfo.xsp,
|
|
44726
|
-
|
|
44643
|
+
ysp = rangeInfo.ysp,
|
|
44727
44644
|
width = rangeInfo.width,
|
|
44728
44645
|
height = rangeInfo.height,
|
|
44729
44646
|
range = rangeInfo.range;
|
|
@@ -44751,7 +44668,6 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
|
|
|
44751
44668
|
var gapX = (x2 - x1) / labelXCount;
|
|
44752
44669
|
var gapY = (y2 - y1) / labelYCount;
|
|
44753
44670
|
var xep = xsp + width;
|
|
44754
|
-
var ysp = ycp;
|
|
44755
44671
|
var yep = ysp + height;
|
|
44756
44672
|
var xIndex = {
|
|
44757
44673
|
min: Math.floor((xsp - x1) / gapX),
|
|
@@ -44759,8 +44675,8 @@ var element_heatmap_HeatMap = /*#__PURE__*/function () {
|
|
|
44759
44675
|
};
|
|
44760
44676
|
var lastIndexY = labelYCount - 1;
|
|
44761
44677
|
var yIndex = {
|
|
44762
|
-
min: lastIndexY - Math.
|
|
44763
|
-
max: lastIndexY - Math.
|
|
44678
|
+
min: lastIndexY - Math.round((yep - y1 - gapY) / gapY),
|
|
44679
|
+
max: lastIndexY - Math.round((ysp - y1) / gapY)
|
|
44764
44680
|
};
|
|
44765
44681
|
var filteredLabelX = this.getFilteredLabel(labelX, labelXCount, xMin, xMax);
|
|
44766
44682
|
var filteredLabelY = this.getFilteredLabel(labelY, labelYCount, yMin, yMax);
|
|
@@ -45154,7 +45070,6 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45154
45070
|
}
|
|
45155
45071
|
/**
|
|
45156
45072
|
* With range information, calculate how many labels in axis
|
|
45157
|
-
* linear type은 scale.linear.js에서 처리
|
|
45158
45073
|
* @param {object} range min/max information
|
|
45159
45074
|
*
|
|
45160
45075
|
* @returns {object} steps, interval, min/max graph value
|
|
@@ -45363,14 +45278,6 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45363
45278
|
|
|
45364
45279
|
ctx.beginPath();
|
|
45365
45280
|
ticks[ix] = axisMinForLabel + ix * stepValue;
|
|
45366
|
-
var isZeroLine = ticks[ix] === 0;
|
|
45367
|
-
|
|
45368
|
-
if (isZeroLine && _this3.zeroLineColor) {
|
|
45369
|
-
ctx.strokeStyle = _this3.zeroLineColor;
|
|
45370
|
-
} else {
|
|
45371
|
-
ctx.strokeStyle = _this3.gridLineColor;
|
|
45372
|
-
}
|
|
45373
|
-
|
|
45374
45281
|
linePosition = labelCenter + aliasPixel;
|
|
45375
45282
|
labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
|
|
45376
45283
|
prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
|
|
@@ -45476,11 +45383,9 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45476
45383
|
}
|
|
45477
45384
|
|
|
45478
45385
|
var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
|
|
45479
|
-
var
|
|
45480
|
-
|
|
45386
|
+
var from = mergedPlotBandOpt.from,
|
|
45387
|
+
to = mergedPlotBandOpt.to,
|
|
45481
45388
|
labelOpt = mergedPlotBandOpt.label;
|
|
45482
|
-
var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
|
|
45483
|
-
var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
|
|
45484
45389
|
|
|
45485
45390
|
_this3.setPlotBandStyle(mergedPlotBandOpt);
|
|
45486
45391
|
|
|
@@ -45488,8 +45393,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45488
45393
|
var toPos;
|
|
45489
45394
|
|
|
45490
45395
|
if (_this3.type === 'x') {
|
|
45491
|
-
fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
|
|
45492
|
-
toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
|
|
45396
|
+
fromPos = helpers_canvas.calculateX(from !== null && from !== void 0 ? from : minX, axisMin, axisMax, xArea, minX);
|
|
45397
|
+
toPos = helpers_canvas.calculateX(to !== null && to !== void 0 ? to : maxX, axisMin, axisMax, xArea, minX);
|
|
45493
45398
|
|
|
45494
45399
|
if (fromPos === null || toPos === null) {
|
|
45495
45400
|
return;
|
|
@@ -45497,8 +45402,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45497
45402
|
|
|
45498
45403
|
_this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
|
|
45499
45404
|
} else {
|
|
45500
|
-
fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
|
|
45501
|
-
toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
|
|
45405
|
+
fromPos = helpers_canvas.calculateY(from !== null && from !== void 0 ? from : axisMin, axisMin, axisMax, yArea, maxY);
|
|
45406
|
+
toPos = helpers_canvas.calculateY(to !== null && to !== void 0 ? to : axisMax, axisMin, axisMax, yArea, maxY);
|
|
45502
45407
|
|
|
45503
45408
|
if (fromPos === null || toPos === null) {
|
|
45504
45409
|
return;
|
|
@@ -46069,7 +45974,6 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
|
|
|
46069
45974
|
|
|
46070
45975
|
|
|
46071
45976
|
|
|
46072
|
-
|
|
46073
45977
|
var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
46074
45978
|
_inherits(LinearScale, _Scale);
|
|
46075
45979
|
|
|
@@ -46108,192 +46012,16 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
|
46108
46012
|
* Calculate interval
|
|
46109
46013
|
* @param {object} range range information
|
|
46110
46014
|
*
|
|
46111
|
-
* @returns {number}
|
|
46015
|
+
* @returns {number} interval
|
|
46112
46016
|
*/
|
|
46113
46017
|
|
|
46114
46018
|
}, {
|
|
46115
46019
|
key: "getInterval",
|
|
46116
46020
|
value: function getInterval(range) {
|
|
46117
|
-
if (this.interval) return this.interval;
|
|
46118
46021
|
var max = range.maxValue;
|
|
46119
46022
|
var min = range.minValue;
|
|
46120
|
-
var
|
|
46121
|
-
|
|
46122
|
-
if (!steps || steps <= 0) return 0; // startToZero이고, 최소값이 음수일 경우 0을 반드시 포함
|
|
46123
|
-
|
|
46124
|
-
if (this.startToZero && min < 0) {
|
|
46125
|
-
var totalRange = Math.abs(min) + Math.abs(max); // 비율로 나눔
|
|
46126
|
-
|
|
46127
|
-
var negativeRatio = Math.abs(min) / totalRange;
|
|
46128
|
-
var positiveRatio = Math.abs(max) / totalRange; // 각 방향에 최소 1칸 이상 배정되도록 보장
|
|
46129
|
-
|
|
46130
|
-
var negativeSteps = Math.max(1, Math.round(negativeRatio * steps));
|
|
46131
|
-
var positiveSteps = Math.max(1, steps - negativeSteps); // 다시 합이 steps보다 커질 수도 있으니, 조정
|
|
46132
|
-
|
|
46133
|
-
if (negativeSteps + positiveSteps > steps) {
|
|
46134
|
-
// 가장 큰 쪽에서 하나 줄임
|
|
46135
|
-
if (negativeRatio > positiveRatio) {
|
|
46136
|
-
negativeSteps -= 1;
|
|
46137
|
-
} else {
|
|
46138
|
-
positiveSteps -= 1;
|
|
46139
|
-
}
|
|
46140
|
-
}
|
|
46141
|
-
|
|
46142
|
-
return Math.ceil(Math.max(Math.abs(min) / (negativeSteps || 1), Math.abs(max) / (positiveSteps || 1)));
|
|
46143
|
-
}
|
|
46144
|
-
|
|
46145
|
-
return Math.ceil((max - min) / steps);
|
|
46146
|
-
}
|
|
46147
|
-
/**
|
|
46148
|
-
* With range information, calculate how many labels in axis
|
|
46149
|
-
* @param {object} range min/max information
|
|
46150
|
-
*
|
|
46151
|
-
* @returns {object} steps, interval, min/max graph value
|
|
46152
|
-
*/
|
|
46153
|
-
|
|
46154
|
-
}, {
|
|
46155
|
-
key: "calculateSteps",
|
|
46156
|
-
value: function calculateSteps(range) {
|
|
46157
|
-
var maxValue = range.maxValue,
|
|
46158
|
-
minValue = range.minValue;
|
|
46159
|
-
var _range$maxSteps = range.maxSteps,
|
|
46160
|
-
maxSteps = _range$maxSteps === void 0 ? 1 : _range$maxSteps;
|
|
46161
|
-
var interval = this.getInterval(range);
|
|
46162
|
-
var graphMin = 0;
|
|
46163
|
-
var graphMax = 0; // 그래프 최대/최소 값 계산
|
|
46164
|
-
|
|
46165
|
-
if (minValue >= 0) {
|
|
46166
|
-
// 전부 양수
|
|
46167
|
-
graphMin = +minValue;
|
|
46168
|
-
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46169
|
-
} else if (maxValue >= 0) {
|
|
46170
|
-
// 양수/음수 혼합
|
|
46171
|
-
graphMin = Math.floor(minValue / interval) * interval;
|
|
46172
|
-
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46173
|
-
} else {
|
|
46174
|
-
// 전부 음수
|
|
46175
|
-
graphMax = +maxValue;
|
|
46176
|
-
graphMin = Math.floor(minValue / interval) * interval;
|
|
46177
|
-
}
|
|
46178
|
-
|
|
46179
|
-
var graphRange = graphMax - graphMin;
|
|
46180
|
-
var numberOfSteps = Math.round(graphRange / interval); // 특수 케이스: 양수 최소값, 최대값이 1일 경우
|
|
46181
|
-
|
|
46182
|
-
if (minValue > 0 && maxValue === 1) {
|
|
46183
|
-
if (!this.decimalPoint) {
|
|
46184
|
-
interval = 1;
|
|
46185
|
-
numberOfSteps = 1;
|
|
46186
|
-
maxSteps = 1;
|
|
46187
|
-
} else if (maxSteps > 2) {
|
|
46188
|
-
interval = 0.2;
|
|
46189
|
-
numberOfSteps = 5;
|
|
46190
|
-
maxSteps = 5;
|
|
46191
|
-
} else {
|
|
46192
|
-
interval = 0.5;
|
|
46193
|
-
numberOfSteps = 2;
|
|
46194
|
-
maxSteps = 2;
|
|
46195
|
-
}
|
|
46196
|
-
} // 최대 스텝 수 조정
|
|
46197
|
-
|
|
46198
|
-
|
|
46199
|
-
while (numberOfSteps > maxSteps) {
|
|
46200
|
-
interval *= 2;
|
|
46201
|
-
numberOfSteps = Math.round(graphRange / interval);
|
|
46202
|
-
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46203
|
-
}
|
|
46204
|
-
|
|
46205
|
-
if (graphRange > numberOfSteps * interval) {
|
|
46206
|
-
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46207
|
-
}
|
|
46208
|
-
|
|
46209
|
-
return {
|
|
46210
|
-
steps: numberOfSteps,
|
|
46211
|
-
interval: interval,
|
|
46212
|
-
graphMin: graphMin,
|
|
46213
|
-
graphMax: graphMax
|
|
46214
|
-
};
|
|
46215
|
-
}
|
|
46216
|
-
/**
|
|
46217
|
-
* Calculate min/max value, label and size information for axis
|
|
46218
|
-
* @param {object} minMax min/max information
|
|
46219
|
-
* @param {object} scrollbarOpt scrollbar option
|
|
46220
|
-
*
|
|
46221
|
-
* @returns {object} min/max value and label
|
|
46222
|
-
*/
|
|
46223
|
-
|
|
46224
|
-
}, {
|
|
46225
|
-
key: "calculateScaleRange",
|
|
46226
|
-
value: function calculateScaleRange(minMax, scrollbarOpt) {
|
|
46227
|
-
var _this$labelStyle;
|
|
46228
|
-
|
|
46229
|
-
var maxValue;
|
|
46230
|
-
var minValue;
|
|
46231
|
-
var isDefaultMaxSameAsMin = false;
|
|
46232
|
-
var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
|
|
46233
|
-
|
|
46234
|
-
if (Array.isArray(range) && (range === null || range === void 0 ? void 0 : range.length) === 2) {
|
|
46235
|
-
if (this.options.type === 'heatMap') {
|
|
46236
|
-
maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
|
|
46237
|
-
minValue = range[0] < +minMax.min ? +minMax.min : range[0];
|
|
46238
|
-
} else {
|
|
46239
|
-
maxValue = range[1];
|
|
46240
|
-
minValue = range[0];
|
|
46241
|
-
}
|
|
46242
|
-
} else if (typeof range === 'function') {
|
|
46243
|
-
var _range = range(minMax.min, minMax.max);
|
|
46244
|
-
|
|
46245
|
-
var _range2 = _slicedToArray(_range, 2);
|
|
46246
|
-
|
|
46247
|
-
minValue = _range2[0];
|
|
46248
|
-
maxValue = _range2[1];
|
|
46249
|
-
} else {
|
|
46250
|
-
maxValue = minMax.max;
|
|
46251
|
-
minValue = minMax.min;
|
|
46252
|
-
} // autoScaleRatio 적용 케이스
|
|
46253
|
-
|
|
46254
|
-
|
|
46255
|
-
if (this.autoScaleRatio) {
|
|
46256
|
-
var temp = maxValue; // 양수 방향에만 autoScaleRatio 적용
|
|
46257
|
-
|
|
46258
|
-
maxValue = Math.ceil(maxValue * (this.autoScaleRatio + 1));
|
|
46259
|
-
|
|
46260
|
-
if (maxValue > 0 && minValue < 0) {
|
|
46261
|
-
// 양수/음수 혼합 케이스 -- 음수 방향에도 maxValue 증가분만큼 더하기
|
|
46262
|
-
var diff = temp - maxValue;
|
|
46263
|
-
minValue += diff;
|
|
46264
|
-
} else if (maxValue < 0 && minValue < 0) {
|
|
46265
|
-
// 전부 음수 케이스 -- 음수 방향에도 autoScaleRatio 적용
|
|
46266
|
-
minValue = Math.ceil(minValue * (this.autoScaleRatio + 1));
|
|
46267
|
-
}
|
|
46268
|
-
} // 0 기준 축 설정 케이스
|
|
46269
|
-
|
|
46270
|
-
|
|
46271
|
-
if (this.startToZero) {
|
|
46272
|
-
if (minValue > 0) {
|
|
46273
|
-
minValue = 0;
|
|
46274
|
-
}
|
|
46275
|
-
|
|
46276
|
-
if (maxValue < 0) {
|
|
46277
|
-
maxValue = 0;
|
|
46278
|
-
}
|
|
46279
|
-
}
|
|
46280
|
-
|
|
46281
|
-
if (maxValue === minValue) {
|
|
46282
|
-
maxValue += 1;
|
|
46283
|
-
isDefaultMaxSameAsMin = true;
|
|
46284
|
-
}
|
|
46285
|
-
|
|
46286
|
-
var minLabel = this.getLabelFormat(minValue);
|
|
46287
|
-
var maxLabel = this.getLabelFormat(maxValue, {
|
|
46288
|
-
isMaxValueSameAsMin: isDefaultMaxSameAsMin
|
|
46289
|
-
});
|
|
46290
|
-
return {
|
|
46291
|
-
min: minValue,
|
|
46292
|
-
max: maxValue,
|
|
46293
|
-
minLabel: minLabel,
|
|
46294
|
-
maxLabel: maxLabel,
|
|
46295
|
-
size: helpers_util.calcTextSize(maxLabel, helpers_util.getLabelStyle(this.labelStyle), (_this$labelStyle = this.labelStyle) === null || _this$labelStyle === void 0 ? void 0 : _this$labelStyle.padding)
|
|
46296
|
-
};
|
|
46023
|
+
var step = range.maxSteps;
|
|
46024
|
+
return this.interval ? this.interval : Math.ceil((max - min) / step);
|
|
46297
46025
|
}
|
|
46298
46026
|
}]);
|
|
46299
46027
|
|
|
@@ -47523,7 +47251,7 @@ var plugins_legend_modules = {
|
|
|
47523
47251
|
var useLegendSeries = [];
|
|
47524
47252
|
|
|
47525
47253
|
if (groups) {
|
|
47526
|
-
useLegendSeries = groups.filter(function (sId) {
|
|
47254
|
+
useLegendSeries = groups.slice().reverse().filter(function (sId) {
|
|
47527
47255
|
return _this3.seriesList[sId].showLegend;
|
|
47528
47256
|
}).map(function (sId) {
|
|
47529
47257
|
return [sId, _this3.seriesList[sId]];
|
|
@@ -47574,8 +47302,9 @@ var plugins_legend_modules = {
|
|
|
47574
47302
|
},
|
|
47575
47303
|
|
|
47576
47304
|
/**
|
|
47577
|
-
* Adds legends for each group in `groups` array, iterating through each series
|
|
47578
|
-
*
|
|
47305
|
+
* Adds legends for each group in `groups` array, iterating through each series
|
|
47306
|
+
* within the group in reverse order. This ensures the legends align with the series
|
|
47307
|
+
* order as displayed in the chart. Only adds series with `showLegend` set to `true`.
|
|
47579
47308
|
*
|
|
47580
47309
|
* @param {Array} groups - Array of groups containing series identifiers.
|
|
47581
47310
|
* @param {Object} seriesList - Object containing all series, keyed by series ID.
|
|
@@ -47586,7 +47315,7 @@ var plugins_legend_modules = {
|
|
|
47586
47315
|
var _this5 = this;
|
|
47587
47316
|
|
|
47588
47317
|
groups.forEach(function (group) {
|
|
47589
|
-
group.forEach(function (sId) {
|
|
47318
|
+
group.slice().reverse().forEach(function (sId) {
|
|
47590
47319
|
var series = seriesList[sId];
|
|
47591
47320
|
|
|
47592
47321
|
if (series && series.showLegend) {
|
|
@@ -50728,15 +50457,6 @@ function inRange(number, start, end) {
|
|
|
50728
50457
|
|
|
50729
50458
|
|
|
50730
50459
|
|
|
50731
|
-
|
|
50732
|
-
|
|
50733
|
-
|
|
50734
|
-
|
|
50735
|
-
|
|
50736
|
-
|
|
50737
|
-
|
|
50738
|
-
|
|
50739
|
-
|
|
50740
50460
|
|
|
50741
50461
|
|
|
50742
50462
|
|
|
@@ -50843,30 +50563,14 @@ var plugins_interaction_modules = {
|
|
|
50843
50563
|
}
|
|
50844
50564
|
|
|
50845
50565
|
if (indicator.use && type !== 'pie' && type !== 'scatter' && type !== 'heatMap') {
|
|
50846
|
-
|
|
50847
|
-
var indicatorOffset = offset;
|
|
50566
|
+
_this.drawIndicator(offset, indicator.color);
|
|
50848
50567
|
|
|
50849
50568
|
var label = _this.getTimeLabel(offset);
|
|
50850
50569
|
|
|
50851
|
-
var useAxisTrigger = tooltip.use && tooltip.trigger === 'axis' && type === 'line';
|
|
50852
|
-
|
|
50853
|
-
if (useAxisTrigger && Object.keys(hitInfo.items).length) {
|
|
50854
|
-
var hitId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
|
|
50855
|
-
var hitItem = hitInfo.items[hitId];
|
|
50856
|
-
|
|
50857
|
-
if (hitItem && hitItem.data && hitItem.data.xp !== undefined && hitItem.data.yp !== undefined) {
|
|
50858
|
-
indicatorOffset = [hitItem.data.xp, hitItem.data.yp];
|
|
50859
|
-
label = _this.data.labels[hitItem.index];
|
|
50860
|
-
}
|
|
50861
|
-
}
|
|
50862
|
-
|
|
50863
|
-
_this.drawIndicator(indicatorOffset, indicator.color);
|
|
50864
|
-
|
|
50865
50570
|
args.hoveredLabel = {
|
|
50866
50571
|
horizontal: _this.options.horizontal,
|
|
50867
50572
|
label: label,
|
|
50868
|
-
mousePosition: [e.clientX, e.clientY]
|
|
50869
|
-
useAxisTrigger: useAxisTrigger
|
|
50573
|
+
mousePosition: [e.clientX, e.clientY]
|
|
50870
50574
|
};
|
|
50871
50575
|
} else {
|
|
50872
50576
|
args.hoveredLabel = {
|
|
@@ -51726,59 +51430,17 @@ var plugins_interaction_modules = {
|
|
|
51726
51430
|
}
|
|
51727
51431
|
},
|
|
51728
51432
|
|
|
51729
|
-
/**
|
|
51730
|
-
* @typedef {object} HitInfo
|
|
51731
|
-
* @property {object} items
|
|
51732
|
-
* @property {string} hitId
|
|
51733
|
-
* @property {object} maxTip
|
|
51734
|
-
* @property {object} maxHighlight
|
|
51735
|
-
*/
|
|
51736
|
-
|
|
51737
51433
|
/**
|
|
51738
51434
|
* Find graph item on mouse position
|
|
51739
51435
|
* @param {array} offset return value from getMousePosition()
|
|
51740
51436
|
*
|
|
51741
|
-
* @returns {
|
|
51437
|
+
* @returns {object} hit item information
|
|
51742
51438
|
*/
|
|
51743
51439
|
findHitItem: function findHitItem(offset) {
|
|
51744
|
-
var _this4 = this;
|
|
51745
|
-
|
|
51746
51440
|
var sIds = Object.keys(this.seriesList);
|
|
51747
51441
|
var items = {};
|
|
51748
51442
|
var isHorizontal = !!this.options.horizontal;
|
|
51749
|
-
var ctx = this.tooltipCtx;
|
|
51750
|
-
|
|
51751
|
-
if (!this._measureTextCache) {
|
|
51752
|
-
this._measureTextCache = new Map();
|
|
51753
|
-
} // Use sliding window cache based on text length to maintain frequently used entries
|
|
51754
|
-
|
|
51755
|
-
|
|
51756
|
-
if (this._measureTextCache.size > 1000) {
|
|
51757
|
-
var entries = Array.from(this._measureTextCache.entries()); // Sort by text length (shorter texts are likely more frequently used)
|
|
51758
|
-
|
|
51759
|
-
entries.sort(function (_ref2, _ref3) {
|
|
51760
|
-
var _ref4 = _slicedToArray(_ref2, 1),
|
|
51761
|
-
keyA = _ref4[0];
|
|
51762
|
-
|
|
51763
|
-
var _ref5 = _slicedToArray(_ref3, 1),
|
|
51764
|
-
keyB = _ref5[0];
|
|
51765
|
-
|
|
51766
|
-
var textA = keyA.split('-')[0];
|
|
51767
|
-
var textB = keyB.split('-')[0];
|
|
51768
|
-
return textA.length - textB.length;
|
|
51769
|
-
}); // Keep the first 500 entries (shorter texts)
|
|
51770
|
-
|
|
51771
|
-
this._measureTextCache.clear();
|
|
51772
|
-
|
|
51773
|
-
entries.slice(0, 500).forEach(function (_ref6) {
|
|
51774
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
51775
|
-
key = _ref7[0],
|
|
51776
|
-
value = _ref7[1];
|
|
51777
|
-
|
|
51778
|
-
_this4._measureTextCache.set(key, value);
|
|
51779
|
-
});
|
|
51780
|
-
}
|
|
51781
|
-
|
|
51443
|
+
var ctx = this.tooltipCtx;
|
|
51782
51444
|
var hitId = null;
|
|
51783
51445
|
var maxs = '';
|
|
51784
51446
|
var maxsw = 0;
|
|
@@ -51788,80 +51450,63 @@ var plugins_interaction_modules = {
|
|
|
51788
51450
|
|
|
51789
51451
|
for (var ix = 0; ix < sIds.length; ix++) {
|
|
51790
51452
|
var sId = sIds[ix];
|
|
51791
|
-
var series = this.seriesList[sId];
|
|
51792
|
-
|
|
51793
|
-
if (!series.show || !series.findGraphData) {
|
|
51794
|
-
// eslint-disable-next-line no-continue
|
|
51795
|
-
continue;
|
|
51796
|
-
}
|
|
51797
|
-
|
|
51798
|
-
var item = series.findGraphData(offset, isHorizontal);
|
|
51799
|
-
|
|
51800
|
-
if (item !== null && item !== void 0 && item.data) {
|
|
51801
|
-
var gdata = void 0;
|
|
51802
|
-
|
|
51803
|
-
if (item.data.o === null && series.interpolation !== 'zero') {
|
|
51804
|
-
if (!series.isExistGrp) {
|
|
51805
|
-
gdata = isHorizontal ? item.data.x : item.data.y;
|
|
51806
|
-
}
|
|
51807
|
-
} else if (!isNaN(item.data.o)) {
|
|
51808
|
-
gdata = item.data.o;
|
|
51809
|
-
}
|
|
51810
|
-
|
|
51811
|
-
if (gdata !== null && gdata !== undefined) {
|
|
51812
|
-
var formattedSeriesName = this.getFormattedTooltipLabel({
|
|
51813
|
-
dataId: series.id,
|
|
51814
|
-
seriesId: sId,
|
|
51815
|
-
seriesName: series.name,
|
|
51816
|
-
itemData: item.data
|
|
51817
|
-
}); // Use cached measureText for better performance
|
|
51818
|
-
|
|
51819
|
-
var sw = 1;
|
|
51453
|
+
var series = this.seriesList[sId];
|
|
51820
51454
|
|
|
51821
|
-
|
|
51822
|
-
|
|
51455
|
+
if (series.findGraphData) {
|
|
51456
|
+
var item = series.findGraphData(offset, isHorizontal);
|
|
51823
51457
|
|
|
51824
|
-
|
|
51825
|
-
|
|
51826
|
-
} else {
|
|
51827
|
-
sw = ctx.measureText(formattedSeriesName).width;
|
|
51458
|
+
if (item !== null && item !== void 0 && item.data) {
|
|
51459
|
+
var gdata = void 0;
|
|
51828
51460
|
|
|
51829
|
-
|
|
51461
|
+
if (item.data.o === null && series.interpolation !== 'zero') {
|
|
51462
|
+
if (!series.isExistGrp) {
|
|
51463
|
+
gdata = isHorizontal ? item.data.x : item.data.y;
|
|
51830
51464
|
}
|
|
51465
|
+
} else if (!isNaN(item.data.o)) {
|
|
51466
|
+
gdata = item.data.o;
|
|
51831
51467
|
}
|
|
51832
51468
|
|
|
51833
|
-
|
|
51834
|
-
|
|
51835
|
-
|
|
51836
|
-
|
|
51837
|
-
|
|
51838
|
-
|
|
51839
|
-
|
|
51840
|
-
|
|
51841
|
-
|
|
51842
|
-
|
|
51843
|
-
|
|
51844
|
-
|
|
51845
|
-
|
|
51846
|
-
|
|
51847
|
-
|
|
51469
|
+
if (gdata !== null && gdata !== undefined) {
|
|
51470
|
+
var formattedSeriesName = this.getFormattedTooltipLabel({
|
|
51471
|
+
dataId: series.id,
|
|
51472
|
+
seriesId: sId,
|
|
51473
|
+
seriesName: series.name,
|
|
51474
|
+
itemData: item.data
|
|
51475
|
+
});
|
|
51476
|
+
var sw = ctx ? ctx.measureText(formattedSeriesName).width : 1;
|
|
51477
|
+
item.id = series.id;
|
|
51478
|
+
item.name = formattedSeriesName;
|
|
51479
|
+
item.axis = {
|
|
51480
|
+
x: series.xAxisIndex,
|
|
51481
|
+
y: series.yAxisIndex
|
|
51482
|
+
};
|
|
51483
|
+
items[sId] = item;
|
|
51484
|
+
var formattedTxt = this.getFormattedTooltipValue({
|
|
51485
|
+
dataId: series.id,
|
|
51486
|
+
seriesId: sId,
|
|
51487
|
+
seriesName: formattedSeriesName,
|
|
51488
|
+
value: gdata,
|
|
51489
|
+
itemData: item.data
|
|
51490
|
+
});
|
|
51491
|
+
item.data.formatted = formattedTxt;
|
|
51848
51492
|
|
|
51849
|
-
|
|
51850
|
-
|
|
51851
|
-
|
|
51852
|
-
|
|
51493
|
+
if (maxsw < sw) {
|
|
51494
|
+
maxs = formattedSeriesName;
|
|
51495
|
+
maxsw = sw;
|
|
51496
|
+
}
|
|
51853
51497
|
|
|
51854
|
-
|
|
51855
|
-
|
|
51856
|
-
|
|
51498
|
+
if (maxv.length <= "".concat(formattedTxt).length) {
|
|
51499
|
+
maxv = "".concat(formattedTxt);
|
|
51500
|
+
}
|
|
51857
51501
|
|
|
51858
|
-
|
|
51859
|
-
|
|
51860
|
-
|
|
51861
|
-
|
|
51502
|
+
if (maxg === null || maxg <= gdata) {
|
|
51503
|
+
maxg = gdata;
|
|
51504
|
+
maxSID = sId;
|
|
51505
|
+
}
|
|
51862
51506
|
|
|
51863
|
-
|
|
51864
|
-
|
|
51507
|
+
if (item.hit) {
|
|
51508
|
+
hitId = sId;
|
|
51509
|
+
}
|
|
51865
51510
|
}
|
|
51866
51511
|
}
|
|
51867
51512
|
}
|
|
@@ -51885,13 +51530,13 @@ var plugins_interaction_modules = {
|
|
|
51885
51530
|
* @param itemData
|
|
51886
51531
|
* @returns {string}
|
|
51887
51532
|
*/
|
|
51888
|
-
getFormattedTooltipLabel: function getFormattedTooltipLabel(
|
|
51533
|
+
getFormattedTooltipLabel: function getFormattedTooltipLabel(_ref2) {
|
|
51889
51534
|
var _tooltipOpt$formatter;
|
|
51890
51535
|
|
|
51891
|
-
var dataId =
|
|
51892
|
-
seriesId =
|
|
51893
|
-
seriesName =
|
|
51894
|
-
itemData =
|
|
51536
|
+
var dataId = _ref2.dataId,
|
|
51537
|
+
seriesId = _ref2.seriesId,
|
|
51538
|
+
seriesName = _ref2.seriesName,
|
|
51539
|
+
itemData = _ref2.itemData;
|
|
51895
51540
|
var opt = this.options;
|
|
51896
51541
|
var tooltipOpt = opt.tooltip;
|
|
51897
51542
|
var tooltipLabelFormatter = tooltipOpt === null || tooltipOpt === void 0 ? void 0 : (_tooltipOpt$formatter = tooltipOpt.formatter) === null || _tooltipOpt$formatter === void 0 ? void 0 : _tooltipOpt$formatter.label;
|
|
@@ -51918,14 +51563,14 @@ var plugins_interaction_modules = {
|
|
|
51918
51563
|
* @param itemData
|
|
51919
51564
|
* @returns {string}
|
|
51920
51565
|
*/
|
|
51921
|
-
getFormattedTooltipValue: function getFormattedTooltipValue(
|
|
51566
|
+
getFormattedTooltipValue: function getFormattedTooltipValue(_ref3) {
|
|
51922
51567
|
var _tooltipOpt$formatter2;
|
|
51923
51568
|
|
|
51924
|
-
var dataId =
|
|
51925
|
-
seriesId =
|
|
51926
|
-
seriesName =
|
|
51927
|
-
value =
|
|
51928
|
-
itemData =
|
|
51569
|
+
var dataId = _ref3.dataId,
|
|
51570
|
+
seriesId = _ref3.seriesId,
|
|
51571
|
+
seriesName = _ref3.seriesName,
|
|
51572
|
+
value = _ref3.value,
|
|
51573
|
+
itemData = _ref3.itemData;
|
|
51929
51574
|
var opt = this.options;
|
|
51930
51575
|
var isHorizontal = !!opt.horizontal;
|
|
51931
51576
|
var tooltipOpt = opt.tooltip;
|
|
@@ -52098,7 +51743,7 @@ var plugins_interaction_modules = {
|
|
|
52098
51743
|
* @returns {object[]}
|
|
52099
51744
|
*/
|
|
52100
51745
|
getSelectedLabelInfoWithLabelData: function getSelectedLabelInfoWithLabelData(labelIndexList, targetAxis) {
|
|
52101
|
-
var
|
|
51746
|
+
var _this4 = this;
|
|
52102
51747
|
|
|
52103
51748
|
var _this$options9 = this.options,
|
|
52104
51749
|
selectLabelOpt = _this$options9.selectLabel,
|
|
@@ -52114,14 +51759,14 @@ var plugins_interaction_modules = {
|
|
|
52114
51759
|
{
|
|
52115
51760
|
result.dataIndex.splice(selectLabelOpt.limit);
|
|
52116
51761
|
result.label = result.dataIndex.map(function (i) {
|
|
52117
|
-
return
|
|
51762
|
+
return _this4.data.labels[i];
|
|
52118
51763
|
});
|
|
52119
51764
|
var dataEntries = Object.entries(this.data.data);
|
|
52120
51765
|
result.data = result.dataIndex.map(function (labelIdx) {
|
|
52121
|
-
return Object.fromEntries(dataEntries.map(function (
|
|
52122
|
-
var
|
|
52123
|
-
sId =
|
|
52124
|
-
data =
|
|
51766
|
+
return Object.fromEntries(dataEntries.map(function (_ref4) {
|
|
51767
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
51768
|
+
sId = _ref5[0],
|
|
51769
|
+
data = _ref5[1];
|
|
52125
51770
|
|
|
52126
51771
|
return [sId, data[labelIdx]];
|
|
52127
51772
|
}));
|
|
@@ -52144,12 +51789,12 @@ var plugins_interaction_modules = {
|
|
|
52144
51789
|
}
|
|
52145
51790
|
|
|
52146
51791
|
result.label = result.dataIndex.map(function (i) {
|
|
52147
|
-
return
|
|
51792
|
+
return _this4.data.labels[targetAxisDirection][i];
|
|
52148
51793
|
});
|
|
52149
51794
|
var dataValues = Object.values(this.data.data)[0];
|
|
52150
|
-
result.data = dataValues.filter(function (
|
|
52151
|
-
var x =
|
|
52152
|
-
y =
|
|
51795
|
+
result.data = dataValues.filter(function (_ref6) {
|
|
51796
|
+
var x = _ref6.x,
|
|
51797
|
+
y = _ref6.y;
|
|
52153
51798
|
return result.label.includes(targetAxisDirection === 'y' ? y : x);
|
|
52154
51799
|
});
|
|
52155
51800
|
break;
|
|
@@ -52272,14 +51917,14 @@ var plugins_interaction_modules = {
|
|
|
52272
51917
|
* object.range: coordinate-based range in graph
|
|
52273
51918
|
* @returns {object}
|
|
52274
51919
|
*/
|
|
52275
|
-
getSelectionRange: function getSelectionRange(
|
|
51920
|
+
getSelectionRange: function getSelectionRange(_ref7) {
|
|
52276
51921
|
var _this$boxOverflow, _this$boxOverflow2, _this$boxOverflow3, _this$boxOverflow4;
|
|
52277
51922
|
|
|
52278
|
-
var xsp =
|
|
52279
|
-
ysp =
|
|
52280
|
-
width =
|
|
52281
|
-
height =
|
|
52282
|
-
range =
|
|
51923
|
+
var xsp = _ref7.xsp,
|
|
51924
|
+
ysp = _ref7.ysp,
|
|
51925
|
+
width = _ref7.width,
|
|
51926
|
+
height = _ref7.height,
|
|
51927
|
+
range = _ref7.range;
|
|
52283
51928
|
var dataRangeX = this.axesSteps.x.length ? this.axesSteps.x[0] : null;
|
|
52284
51929
|
var dataRangeY = this.axesSteps.y.length ? this.axesSteps.y[0] : null;
|
|
52285
51930
|
|
|
@@ -52336,11 +51981,11 @@ var plugins_interaction_modules = {
|
|
|
52336
51981
|
|
|
52337
51982
|
var sId = Object.keys(this.seriesList)[0];
|
|
52338
51983
|
|
|
52339
|
-
var
|
|
52340
|
-
xMin =
|
|
52341
|
-
xMax =
|
|
52342
|
-
yMin =
|
|
52343
|
-
yMax =
|
|
51984
|
+
var _ref8 = (_this$seriesList$sId$ = this.seriesList[sId].findSelectionRange(range)) !== null && _this$seriesList$sId$ !== void 0 ? _this$seriesList$sId$ : {},
|
|
51985
|
+
xMin = _ref8.xMin,
|
|
51986
|
+
xMax = _ref8.xMax,
|
|
51987
|
+
yMin = _ref8.yMin,
|
|
51988
|
+
yMax = _ref8.yMax;
|
|
52344
51989
|
|
|
52345
51990
|
return {
|
|
52346
51991
|
xMin: xMin !== null && xMin !== void 0 ? xMin : dataRangeX.graphMin,
|
|
@@ -52430,7 +52075,6 @@ var plugins_interaction_modules = {
|
|
|
52430
52075
|
|
|
52431
52076
|
|
|
52432
52077
|
|
|
52433
|
-
|
|
52434
52078
|
var LINE_SPACING = 8;
|
|
52435
52079
|
var VALUE_MARGIN = 50;
|
|
52436
52080
|
var SCROLL_WIDTH = 17;
|
|
@@ -53221,7 +52865,7 @@ var plugins_tooltip_modules = {
|
|
|
53221
52865
|
y1: this.chartRect.y1 + this.labelOffset.top,
|
|
53222
52866
|
y2: this.chartRect.y2 - this.labelOffset.bottom
|
|
53223
52867
|
};
|
|
53224
|
-
var mouseXIp =
|
|
52868
|
+
var mouseXIp = 1; // mouseInterpolation
|
|
53225
52869
|
|
|
53226
52870
|
var mouseYIp = 10;
|
|
53227
52871
|
var options = this.options;
|
|
@@ -53317,8 +52961,7 @@ var plugins_tooltip_modules = {
|
|
|
53317
52961
|
|
|
53318
52962
|
var horizontal = _ref5.horizontal,
|
|
53319
52963
|
label = _ref5.label,
|
|
53320
|
-
mousePosition = _ref5.mousePosition
|
|
53321
|
-
useAxisTrigger = _ref5.useAxisTrigger;
|
|
52964
|
+
mousePosition = _ref5.mousePosition;
|
|
53322
52965
|
|
|
53323
52966
|
if (!mousePosition || !!horizontal !== !!this.options.horizontal) {
|
|
53324
52967
|
return;
|
|
@@ -53365,25 +53008,7 @@ var plugins_tooltip_modules = {
|
|
|
53365
53008
|
y2: this.chartRect.y2 - this.labelOffset.bottom
|
|
53366
53009
|
};
|
|
53367
53010
|
|
|
53368
|
-
if (
|
|
53369
|
-
var _this$data$labels5;
|
|
53370
|
-
|
|
53371
|
-
var matchIndex = (_this$data$labels5 = this.data.labels) === null || _this$data$labels5 === void 0 ? void 0 : _this$data$labels5.findIndex(function (l) {
|
|
53372
|
-
return (l === null || l === void 0 ? void 0 : l.valueOf()) === (label === null || label === void 0 ? void 0 : label.valueOf());
|
|
53373
|
-
});
|
|
53374
|
-
|
|
53375
|
-
if (matchIndex >= 0) {
|
|
53376
|
-
var _Object$keys, _this$seriesList, _this$seriesList$seri, _this$seriesList$seri2;
|
|
53377
|
-
|
|
53378
|
-
var seriesId = (_Object$keys = Object.keys(this.seriesList)) === null || _Object$keys === void 0 ? void 0 : _Object$keys[0];
|
|
53379
|
-
var dataPoint = (_this$seriesList = this.seriesList) === null || _this$seriesList === void 0 ? void 0 : (_this$seriesList$seri = _this$seriesList[seriesId]) === null || _this$seriesList$seri === void 0 ? void 0 : (_this$seriesList$seri2 = _this$seriesList$seri.data) === null || _this$seriesList$seri2 === void 0 ? void 0 : _this$seriesList$seri2[matchIndex];
|
|
53380
|
-
|
|
53381
|
-
if ((dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== undefined && (dataPoint === null || dataPoint === void 0 ? void 0 : dataPoint.xp) !== null) {
|
|
53382
|
-
var yPosition = !lodash_es_isNil(dataPoint.yp) ? dataPoint.yp : (graphPos.y1 + graphPos.y2) / 2;
|
|
53383
|
-
this.drawIndicator([dataPoint.xp, yPosition], this.options.indicator.color);
|
|
53384
|
-
}
|
|
53385
|
-
}
|
|
53386
|
-
} else if (horizontal) {
|
|
53011
|
+
if (horizontal) {
|
|
53387
53012
|
var chartHeight = graphPos.y2 - graphPos.y1;
|
|
53388
53013
|
var offsetY = chartHeight * (label - fromTime) / (toTime - fromTime) + graphPos.y1;
|
|
53389
53014
|
this.drawIndicator([graphPos.x2, offsetY], this.options.indicator.color);
|
|
@@ -53734,6 +53359,7 @@ var plugins_pie_modules = {
|
|
|
53734
53359
|
|
|
53735
53360
|
|
|
53736
53361
|
|
|
53362
|
+
|
|
53737
53363
|
var element_tip_modules = {
|
|
53738
53364
|
/**
|
|
53739
53365
|
* Draw TextTip with tip's locationInfo
|
|
@@ -53767,7 +53393,8 @@ var element_tip_modules = {
|
|
|
53767
53393
|
}
|
|
53768
53394
|
|
|
53769
53395
|
if (labelTipOpt.use && labelTipOpt.showTip) {
|
|
53770
|
-
|
|
53396
|
+
var isHeatMap = opt.type === 'heatMap';
|
|
53397
|
+
isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
|
|
53771
53398
|
}
|
|
53772
53399
|
|
|
53773
53400
|
var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
|
|
@@ -54053,10 +53680,9 @@ var element_tip_modules = {
|
|
|
54053
53680
|
|
|
54054
53681
|
/**
|
|
54055
53682
|
* Draw Selected Label Tip
|
|
54056
|
-
* none Text
|
|
54057
53683
|
* @returns {boolean} Whether drew at least one tip
|
|
54058
53684
|
*/
|
|
54059
|
-
|
|
53685
|
+
drawLabelTip: function drawLabelTip() {
|
|
54060
53686
|
var _this2 = this;
|
|
54061
53687
|
|
|
54062
53688
|
var opt = this.options;
|
|
@@ -54082,7 +53708,7 @@ var element_tip_modules = {
|
|
|
54082
53708
|
};
|
|
54083
53709
|
var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
|
|
54084
53710
|
var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
|
|
54085
|
-
var
|
|
53711
|
+
var valueAxesRange = isHorizontal ? this.axesRange.x[0] : this.axesRange.y[0];
|
|
54086
53712
|
var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
|
|
54087
53713
|
var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
|
|
54088
53714
|
var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
|
|
@@ -54100,8 +53726,8 @@ var element_tip_modules = {
|
|
|
54100
53726
|
return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
|
|
54101
53727
|
});
|
|
54102
53728
|
var groups = (_this$data$groups$ = (_this$data$groups = this.data.groups) === null || _this$data$groups === void 0 ? void 0 : _this$data$groups[0]) !== null && _this$data$groups$ !== void 0 ? _this$data$groups$ : [];
|
|
54103
|
-
var
|
|
54104
|
-
var
|
|
53729
|
+
var gp;
|
|
53730
|
+
var dp;
|
|
54105
53731
|
var value;
|
|
54106
53732
|
var labelStartPoint;
|
|
54107
53733
|
var labelEndPoint;
|
|
@@ -54149,39 +53775,31 @@ var element_tip_modules = {
|
|
|
54149
53775
|
}
|
|
54150
53776
|
|
|
54151
53777
|
data.forEach(function (selectedData, i) {
|
|
54152
|
-
|
|
54153
|
-
|
|
54154
|
-
if (
|
|
54155
|
-
|
|
54156
|
-
var
|
|
54157
|
-
|
|
54158
|
-
|
|
54159
|
-
|
|
54160
|
-
|
|
54161
|
-
|
|
54162
|
-
|
|
54163
|
-
var
|
|
54164
|
-
|
|
54165
|
-
|
|
54166
|
-
|
|
54167
|
-
|
|
54168
|
-
|
|
54169
|
-
|
|
54170
|
-
var
|
|
54171
|
-
|
|
54172
|
-
|
|
54173
|
-
|
|
54174
|
-
|
|
54175
|
-
|
|
54176
|
-
|
|
54177
|
-
|
|
54178
|
-
return (_selectedData$sId$val4 = (_selectedData$sId4 = selectedData[sId]) === null || _selectedData$sId4 === void 0 ? void 0 : _selectedData$sId4.value) !== null && _selectedData$sId$val4 !== void 0 ? _selectedData$sId$val4 : selectedData[sId];
|
|
54179
|
-
});
|
|
54180
|
-
var maxValue = visibleValue.length > 0 ? visibleValue.reduce(function (max, val) {
|
|
54181
|
-
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54182
|
-
}, -Infinity) : -Infinity;
|
|
54183
|
-
value = maxValue > 0 || _this2.options.type !== 'bar' ? maxValue : 0;
|
|
54184
|
-
}
|
|
53778
|
+
if (labelTipOpt.fixedPosTop) {
|
|
53779
|
+
value = valueAxesRange.max;
|
|
53780
|
+
} else if (isExistGrp) {
|
|
53781
|
+
var sumValue = visibleSeries.reduce(function (ac, sId) {
|
|
53782
|
+
var _selectedData$sId$val, _selectedData$sId;
|
|
53783
|
+
|
|
53784
|
+
return groups.includes(sId) ? ac + ((_selectedData$sId$val = (_selectedData$sId = selectedData[sId]) === null || _selectedData$sId === void 0 ? void 0 : _selectedData$sId.value) !== null && _selectedData$sId$val !== void 0 ? _selectedData$sId$val : selectedData[sId]) : ac;
|
|
53785
|
+
}, 0);
|
|
53786
|
+
var nonGroupValues = visibleSeries.filter(function (sId) {
|
|
53787
|
+
return !groups.includes(sId);
|
|
53788
|
+
}).map(function (sId) {
|
|
53789
|
+
var _selectedData$sId$val2, _selectedData$sId2;
|
|
53790
|
+
|
|
53791
|
+
return (_selectedData$sId$val2 = (_selectedData$sId2 = selectedData[sId]) === null || _selectedData$sId2 === void 0 ? void 0 : _selectedData$sId2.value) !== null && _selectedData$sId$val2 !== void 0 ? _selectedData$sId$val2 : selectedData[sId];
|
|
53792
|
+
});
|
|
53793
|
+
value = Math.max.apply(Math, _toConsumableArray(nonGroupValues).concat([sumValue]));
|
|
53794
|
+
} else if (visibleSeries.length) {
|
|
53795
|
+
var visibleValue = visibleSeries.map(function (sId) {
|
|
53796
|
+
var _selectedData$sId$val3, _selectedData$sId3;
|
|
53797
|
+
|
|
53798
|
+
return (_selectedData$sId$val3 = (_selectedData$sId3 = selectedData[sId]) === null || _selectedData$sId3 === void 0 ? void 0 : _selectedData$sId3.value) !== null && _selectedData$sId$val3 !== void 0 ? _selectedData$sId$val3 : selectedData[sId];
|
|
53799
|
+
});
|
|
53800
|
+
value = Math.max.apply(Math, _toConsumableArray(visibleValue));
|
|
53801
|
+
} else {
|
|
53802
|
+
value = valueAxesRange.max;
|
|
54185
53803
|
}
|
|
54186
53804
|
|
|
54187
53805
|
if (labelAxes.labels) {
|
|
@@ -54191,17 +53809,18 @@ var element_tip_modules = {
|
|
|
54191
53809
|
|
|
54192
53810
|
var labelIndex = dataIndex[i] - startIndex;
|
|
54193
53811
|
var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
|
|
54194
|
-
|
|
53812
|
+
dp = labelCenter + labelGap / 2;
|
|
54195
53813
|
} else {
|
|
54196
|
-
|
|
53814
|
+
dp = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
|
|
54197
53815
|
}
|
|
54198
53816
|
|
|
54199
|
-
|
|
53817
|
+
gp = valuePositionCalcFunction(value, valueAxesRange.min, valueAxesRange.max, valueSpace, valueStartPoint);
|
|
53818
|
+
gp += offset;
|
|
54200
53819
|
|
|
54201
53820
|
_this2.showTip({
|
|
54202
53821
|
context: _this2.bufferCtx,
|
|
54203
|
-
x: isHorizontal ?
|
|
54204
|
-
y: isHorizontal ?
|
|
53822
|
+
x: isHorizontal ? gp : dp,
|
|
53823
|
+
y: isHorizontal ? dp : gp,
|
|
54205
53824
|
opt: labelTipOpt,
|
|
54206
53825
|
isSamePos: false
|
|
54207
53826
|
});
|
|
@@ -54313,11 +53932,10 @@ var element_tip_modules = {
|
|
|
54313
53932
|
}
|
|
54314
53933
|
} else if (isHorizontal) {
|
|
54315
53934
|
gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
|
|
54316
|
-
gp
|
|
53935
|
+
gp += offset;
|
|
54317
53936
|
} else {
|
|
54318
|
-
|
|
54319
|
-
gp
|
|
54320
|
-
gp = adjustedValue < 0 ? gp + offset : gp - offset;
|
|
53937
|
+
gp = helpers_canvas.calculateY(value, graphY.graphMin, graphY.graphMax, yArea, ysp);
|
|
53938
|
+
gp -= offset;
|
|
54321
53939
|
}
|
|
54322
53940
|
|
|
54323
53941
|
var maxTipType = 'center';
|
|
@@ -54349,8 +53967,7 @@ var element_tip_modules = {
|
|
|
54349
53967
|
arrowSize: arrowSize,
|
|
54350
53968
|
borderRadius: borderRadius,
|
|
54351
53969
|
text: text,
|
|
54352
|
-
textStyle: textStyle
|
|
54353
|
-
isNegative: value < 0
|
|
53970
|
+
textStyle: textStyle
|
|
54354
53971
|
});
|
|
54355
53972
|
}
|
|
54356
53973
|
|
|
@@ -54384,21 +54001,12 @@ var element_tip_modules = {
|
|
|
54384
54001
|
borderRadius = param.borderRadius,
|
|
54385
54002
|
text = param.text,
|
|
54386
54003
|
opt = param.opt,
|
|
54387
|
-
textStyle = param.textStyle
|
|
54388
|
-
isNegative = param.isNegative;
|
|
54004
|
+
textStyle = param.textStyle;
|
|
54389
54005
|
var ctx = param.context;
|
|
54390
54006
|
var sx = x - width / 2;
|
|
54391
54007
|
var ex = x + width / 2;
|
|
54392
54008
|
var sy = y - height;
|
|
54393
54009
|
var ey = y;
|
|
54394
|
-
|
|
54395
|
-
if (isNegative) {
|
|
54396
|
-
if (isHorizontal) {
|
|
54397
|
-
sx = x - width / 2 - width;
|
|
54398
|
-
ex = x - width / 2;
|
|
54399
|
-
}
|
|
54400
|
-
}
|
|
54401
|
-
|
|
54402
54010
|
ctx.save();
|
|
54403
54011
|
ctx.font = textStyle;
|
|
54404
54012
|
ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
|
|
@@ -54406,73 +54014,44 @@ var element_tip_modules = {
|
|
|
54406
54014
|
ctx.beginPath();
|
|
54407
54015
|
ctx.moveTo(sx + borderRadius, sy);
|
|
54408
54016
|
ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
|
|
54017
|
+
|
|
54018
|
+
if (isHorizontal) {
|
|
54019
|
+
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54020
|
+
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54021
|
+
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54022
|
+
}
|
|
54023
|
+
|
|
54409
54024
|
ctx.lineTo(sx, ey - borderRadius);
|
|
54410
54025
|
ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
|
|
54026
|
+
|
|
54027
|
+
if (!isHorizontal) {
|
|
54028
|
+
if (type === 'left') {
|
|
54029
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54030
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54031
|
+
} else if (type === 'right') {
|
|
54032
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54033
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54034
|
+
} else {
|
|
54035
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54036
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54037
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54038
|
+
}
|
|
54039
|
+
}
|
|
54040
|
+
|
|
54411
54041
|
ctx.lineTo(ex - borderRadius, ey);
|
|
54412
54042
|
ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
|
|
54413
54043
|
ctx.lineTo(ex, sy + borderRadius);
|
|
54414
54044
|
ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
|
|
54415
54045
|
ctx.lineTo(sx + borderRadius, sy);
|
|
54416
54046
|
ctx.closePath();
|
|
54417
|
-
ctx.fill();
|
|
54418
|
-
|
|
54419
|
-
ctx.beginPath();
|
|
54420
|
-
|
|
54421
|
-
if (isHorizontal) {
|
|
54422
|
-
if (isNegative) {
|
|
54423
|
-
ctx.moveTo(ex, ey);
|
|
54424
|
-
ctx.lineTo(ex, sy + borderRadius + arrowSize / 2);
|
|
54425
|
-
ctx.lineTo(ex + arrowSize, ey - height / 2);
|
|
54426
|
-
ctx.lineTo(ex, ey - borderRadius - arrowSize / 2);
|
|
54427
|
-
} else {
|
|
54428
|
-
ctx.moveTo(sx, sy);
|
|
54429
|
-
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54430
|
-
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54431
|
-
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54432
|
-
}
|
|
54433
|
-
|
|
54434
|
-
ctx.closePath();
|
|
54435
|
-
ctx.fill();
|
|
54436
|
-
} else {
|
|
54437
|
-
if (isNegative) {
|
|
54438
|
-
if (type === 'left') {
|
|
54439
|
-
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54440
|
-
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54441
|
-
} else if (type === 'right') {
|
|
54442
|
-
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54443
|
-
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54444
|
-
} else {
|
|
54445
|
-
ctx.lineTo(x - arrowSize, ey);
|
|
54446
|
-
ctx.lineTo(x, ey + arrowSize);
|
|
54447
|
-
ctx.lineTo(x + arrowSize, ey);
|
|
54448
|
-
}
|
|
54449
|
-
} else if (!isNegative) {
|
|
54450
|
-
if (type === 'left') {
|
|
54451
|
-
ctx.moveTo(sx, sy);
|
|
54452
|
-
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54453
|
-
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54454
|
-
} else if (type === 'right') {
|
|
54455
|
-
ctx.moveTo(ex, sy);
|
|
54456
|
-
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54457
|
-
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54458
|
-
} else {
|
|
54459
|
-
ctx.lineTo(x - arrowSize, ey);
|
|
54460
|
-
ctx.lineTo(x, ey + arrowSize);
|
|
54461
|
-
ctx.lineTo(x + arrowSize, ey);
|
|
54462
|
-
}
|
|
54463
|
-
}
|
|
54464
|
-
|
|
54465
|
-
ctx.closePath();
|
|
54466
|
-
ctx.fill();
|
|
54467
|
-
}
|
|
54468
|
-
|
|
54047
|
+
ctx.fill();
|
|
54469
54048
|
ctx.restore();
|
|
54470
54049
|
ctx.save();
|
|
54471
54050
|
ctx.font = textStyle;
|
|
54472
54051
|
ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
|
|
54473
54052
|
ctx.textBaseline = 'middle';
|
|
54474
54053
|
ctx.textAlign = 'center';
|
|
54475
|
-
ctx.fillText("".concat(text),
|
|
54054
|
+
ctx.fillText("".concat(text), x, sy + height / 2);
|
|
54476
54055
|
ctx.restore();
|
|
54477
54056
|
},
|
|
54478
54057
|
|
|
@@ -54724,13 +54303,11 @@ var chart_core_EvChart = /*#__PURE__*/function () {
|
|
|
54724
54303
|
value: function drawSyncedIndicator(_ref) {
|
|
54725
54304
|
var horizontal = _ref.horizontal,
|
|
54726
54305
|
label = _ref.label,
|
|
54727
|
-
mousePosition = _ref.mousePosition
|
|
54728
|
-
useAxisTrigger = _ref.useAxisTrigger;
|
|
54306
|
+
mousePosition = _ref.mousePosition;
|
|
54729
54307
|
this.drawSyncedIndicator({
|
|
54730
54308
|
horizontal: horizontal,
|
|
54731
54309
|
label: label,
|
|
54732
|
-
mousePosition: mousePosition
|
|
54733
|
-
useAxisTrigger: useAxisTrigger
|
|
54310
|
+
mousePosition: mousePosition
|
|
54734
54311
|
});
|
|
54735
54312
|
}
|
|
54736
54313
|
}, {
|
|
@@ -56558,7 +56135,6 @@ var DEFAULT_OPTIONS = {
|
|
|
56558
56135
|
combo: false,
|
|
56559
56136
|
tooltip: {
|
|
56560
56137
|
use: true,
|
|
56561
|
-
trigger: 'axis',
|
|
56562
56138
|
sortByValue: true,
|
|
56563
56139
|
backgroundColor: '#4C4C4C',
|
|
56564
56140
|
fontColor: '#FFFFFF',
|