evui 3.4.119 → 3.4.200
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 +501 -187
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +501 -187
- 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/element/element.bar.js +131 -61
- package/src/components/chart/element/element.line.js +6 -5
- package/src/components/chart/element/element.tip.js +120 -60
- package/src/components/chart/helpers/helpers.util.js +19 -15
- package/src/components/chart/model/model.store.js +37 -17
- package/src/components/chart/plugins/plugins.legend.js +4 -6
- package/src/components/chart/scale/scale.js +17 -7
- package/src/components/chart/scale/scale.linear.js +183 -3
package/dist/evui.common.js
CHANGED
|
@@ -11171,7 +11171,7 @@ module.exports = exports;
|
|
|
11171
11171
|
/***/ "9224":
|
|
11172
11172
|
/***/ (function(module) {
|
|
11173
11173
|
|
|
11174
|
-
module.exports = JSON.parse("{\"a\":\"3.4.
|
|
11174
|
+
module.exports = JSON.parse("{\"a\":\"3.4.200\"}");
|
|
11175
11175
|
|
|
11176
11176
|
/***/ }),
|
|
11177
11177
|
|
|
@@ -38503,26 +38503,26 @@ var es_string_match = __webpack_require__("466d");
|
|
|
38503
38503
|
return value;
|
|
38504
38504
|
}
|
|
38505
38505
|
|
|
38506
|
-
var
|
|
38507
|
-
|
|
38508
|
-
return "".concat((v / target).toFixed(decimalPoint)).concat(lb);
|
|
38509
|
-
}
|
|
38510
|
-
|
|
38511
|
-
return "".concat((v / target).toFixed(1)).concat(lb);
|
|
38512
|
-
};
|
|
38506
|
+
var isNegative = value < 0;
|
|
38507
|
+
var absValue = Math.abs(value);
|
|
38513
38508
|
|
|
38514
|
-
|
|
38515
|
-
|
|
38516
|
-
|
|
38517
|
-
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38521
|
-
|
|
38522
|
-
|
|
38523
|
-
|
|
38509
|
+
var assignLabelWith = function assignLabelWith(v, target, lb) {
|
|
38510
|
+
var result = v % target === 0 ? "".concat((v / target).toFixed(decimalPoint)).concat(lb) : "".concat((v / target).toFixed(1)).concat(lb);
|
|
38511
|
+
return isNegative ? "-".concat(result) : result;
|
|
38512
|
+
};
|
|
38513
|
+
|
|
38514
|
+
if (absValue >= quad) {
|
|
38515
|
+
label = assignLabelWith(absValue, quad, 'P');
|
|
38516
|
+
} else if (absValue >= trill) {
|
|
38517
|
+
label = assignLabelWith(absValue, trill, 'T');
|
|
38518
|
+
} else if (absValue >= billi) {
|
|
38519
|
+
label = assignLabelWith(absValue, billi, 'G');
|
|
38520
|
+
} else if (absValue >= milli) {
|
|
38521
|
+
label = assignLabelWith(absValue, milli, 'M');
|
|
38522
|
+
} else if (absValue >= killo) {
|
|
38523
|
+
label = assignLabelWith(absValue, 1000, 'K');
|
|
38524
38524
|
} else {
|
|
38525
|
-
label = value.toFixed(decimalPoint);
|
|
38525
|
+
label = isNegative ? "-".concat(absValue.toFixed(decimalPoint)) : value.toFixed(decimalPoint);
|
|
38526
38526
|
}
|
|
38527
38527
|
|
|
38528
38528
|
return label;
|
|
@@ -38796,21 +38796,23 @@ 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;
|
|
38799
38800
|
|
|
38800
38801
|
if (series && sData) {
|
|
38801
38802
|
series.data = _this.addSeriesDSforScatter(sData);
|
|
38802
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38803
|
+
series.minMax = _this.getSeriesMinMax(series.data, passingValue);
|
|
38803
38804
|
}
|
|
38804
38805
|
});
|
|
38805
38806
|
} else if (typeKey === 'heatMap') {
|
|
38806
38807
|
seriesIDs.forEach(function (seriesID) {
|
|
38807
38808
|
var series = _this.seriesList[seriesID];
|
|
38809
|
+
var passingValue = series === null || series === void 0 ? void 0 : series.passingValue;
|
|
38808
38810
|
var sData = data[seriesID];
|
|
38809
38811
|
|
|
38810
38812
|
if (series && sData) {
|
|
38811
38813
|
series.labels = label;
|
|
38812
38814
|
series.data = _this.addSeriesDSForHeatMap(sData);
|
|
38813
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38815
|
+
series.minMax = _this.getSeriesMinMax(series.data, passingValue);
|
|
38814
38816
|
series.valueOpt = _this.getSeriesValueOptForHeatMap(series);
|
|
38815
38817
|
}
|
|
38816
38818
|
});
|
|
@@ -38842,7 +38844,7 @@ var modules = {
|
|
|
38842
38844
|
series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
|
|
38843
38845
|
}
|
|
38844
38846
|
|
|
38845
|
-
series.minMax = _this.getSeriesMinMax(series.data);
|
|
38847
|
+
series.minMax = _this.getSeriesMinMax(series.data, series.passingValue);
|
|
38846
38848
|
}
|
|
38847
38849
|
});
|
|
38848
38850
|
}
|
|
@@ -39238,17 +39240,19 @@ var modules = {
|
|
|
39238
39240
|
var isHorizontal = this.options.horizontal;
|
|
39239
39241
|
var sdata = [];
|
|
39240
39242
|
|
|
39241
|
-
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex) {
|
|
39243
|
+
var getBaseDataPosition = function getBaseDataPosition(baseIndex, dataIndex, curr) {
|
|
39242
39244
|
var nextBaseSeriesIndex = baseIndex - 1;
|
|
39243
39245
|
var baseSeries = _this4.seriesList[bsIds[baseIndex]];
|
|
39244
39246
|
var baseDataList = baseSeries.data;
|
|
39245
39247
|
var baseData = baseDataList[dataIndex];
|
|
39246
39248
|
var position = isHorizontal ? baseData === null || baseData === void 0 ? void 0 : baseData.x : baseData === null || baseData === void 0 ? void 0 : baseData.y;
|
|
39247
|
-
var
|
|
39249
|
+
var baseValue = baseData === null || baseData === void 0 ? void 0 : baseData.o;
|
|
39250
|
+
var isPassingValue = baseSeries.passingValue === baseValue;
|
|
39251
|
+
var isSameSign = curr >= 0 && baseValue >= 0 || curr < 0 && baseValue < 0;
|
|
39248
39252
|
|
|
39249
|
-
if (isPassingValue || position == null || !baseSeries.show) {
|
|
39253
|
+
if (isPassingValue || position == null || !isSameSign || !baseSeries.show) {
|
|
39250
39254
|
if (nextBaseSeriesIndex > -1) {
|
|
39251
|
-
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex);
|
|
39255
|
+
return getBaseDataPosition(nextBaseSeriesIndex, dataIndex, curr);
|
|
39252
39256
|
}
|
|
39253
39257
|
|
|
39254
39258
|
return 0;
|
|
@@ -39259,7 +39263,7 @@ var modules = {
|
|
|
39259
39263
|
|
|
39260
39264
|
data.forEach(function (curr, index) {
|
|
39261
39265
|
var baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
|
|
39262
|
-
var bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
|
|
39266
|
+
var bdata = getBaseDataPosition(baseIndex, index, curr); // base(previous) series data
|
|
39263
39267
|
|
|
39264
39268
|
var odata = curr; // current series original data
|
|
39265
39269
|
|
|
@@ -39442,7 +39446,7 @@ var modules = {
|
|
|
39442
39446
|
*
|
|
39443
39447
|
* @returns {object} min/max info for series
|
|
39444
39448
|
*/
|
|
39445
|
-
getSeriesMinMax: function getSeriesMinMax(data) {
|
|
39449
|
+
getSeriesMinMax: function getSeriesMinMax(data, passingValue) {
|
|
39446
39450
|
var def = {
|
|
39447
39451
|
minX: null,
|
|
39448
39452
|
minY: null,
|
|
@@ -39454,21 +39458,22 @@ var modules = {
|
|
|
39454
39458
|
|
|
39455
39459
|
if (data.length) {
|
|
39456
39460
|
return data.reduce(function (acc, p, index) {
|
|
39457
|
-
var _p$x, _p$y;
|
|
39461
|
+
var _p$x, _p$y, _p$o;
|
|
39458
39462
|
|
|
39459
39463
|
var minmax = acc;
|
|
39460
39464
|
var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
|
|
39461
39465
|
var py = ((_p$y = p.y) === null || _p$y === void 0 ? void 0 : _p$y.value) || p.y;
|
|
39466
|
+
var po = ((_p$o = p.o) === null || _p$o === void 0 ? void 0 : _p$o.value) || p.o;
|
|
39462
39467
|
|
|
39463
|
-
if (px <= minmax.minX) {
|
|
39468
|
+
if (po !== passingValue && px <= minmax.minX) {
|
|
39464
39469
|
minmax.minX = px === null ? 0 : px;
|
|
39465
39470
|
}
|
|
39466
39471
|
|
|
39467
|
-
if (py <= minmax.minY) {
|
|
39472
|
+
if (po !== passingValue && py <= minmax.minY) {
|
|
39468
39473
|
minmax.minY = py === null ? 0 : py;
|
|
39469
39474
|
}
|
|
39470
39475
|
|
|
39471
|
-
if (px >= minmax.maxX) {
|
|
39476
|
+
if (po !== passingValue && px >= minmax.maxX) {
|
|
39472
39477
|
minmax.maxX = px === null ? 0 : px;
|
|
39473
39478
|
|
|
39474
39479
|
if (isHorizontal && px !== null) {
|
|
@@ -39477,7 +39482,7 @@ var modules = {
|
|
|
39477
39482
|
}
|
|
39478
39483
|
}
|
|
39479
39484
|
|
|
39480
|
-
if (py >= minmax.maxY) {
|
|
39485
|
+
if (po !== passingValue && py >= minmax.maxY) {
|
|
39481
39486
|
minmax.maxY = py === null ? 0 : py;
|
|
39482
39487
|
|
|
39483
39488
|
if (!isHorizontal && py !== null) {
|
|
@@ -40231,14 +40236,25 @@ var modules = {
|
|
|
40231
40236
|
}
|
|
40232
40237
|
}
|
|
40233
40238
|
|
|
40234
|
-
|
|
40239
|
+
var isExistGrp = _this10.seriesList[key].isExistGrp;
|
|
40240
|
+
var maxXisNegative = minmax.x[axisX].max < 0;
|
|
40241
|
+
|
|
40242
|
+
if (isExistGrp && maxXisNegative) {
|
|
40243
|
+
minmax.x[axisX].max = smm.maxX;
|
|
40244
|
+
minmax.x[axisX].maxSID = key;
|
|
40245
|
+
} else if (!minmax.x[axisX].max || smm.maxX >= minmax.x[axisX].max) {
|
|
40235
40246
|
minmax.x[axisX].max = smm.maxX;
|
|
40236
40247
|
minmax.x[axisX].maxSID = key;
|
|
40237
40248
|
}
|
|
40238
40249
|
|
|
40239
|
-
|
|
40250
|
+
var maxYisNegative = minmax.y[axisY].max < 0;
|
|
40251
|
+
|
|
40252
|
+
if (isExistGrp && maxYisNegative) {
|
|
40253
|
+
minmax.y[axisY].max = smm.maxY;
|
|
40254
|
+
minmax.y[axisY].maxSID = key;
|
|
40255
|
+
} else if (!minmax.y[axisY].max || smm.maxY >= minmax.y[axisY].max) {
|
|
40240
40256
|
minmax.y[axisY].max = smm.maxY;
|
|
40241
|
-
minmax.y[
|
|
40257
|
+
minmax.y[axisY].maxSID = key;
|
|
40242
40258
|
}
|
|
40243
40259
|
}
|
|
40244
40260
|
|
|
@@ -41699,6 +41715,7 @@ var TIME_INTERVALS = {
|
|
|
41699
41715
|
|
|
41700
41716
|
|
|
41701
41717
|
|
|
41718
|
+
|
|
41702
41719
|
var element_line_Line = /*#__PURE__*/function () {
|
|
41703
41720
|
function Line(sId, opt, sIdx) {
|
|
41704
41721
|
var _this = this;
|
|
@@ -41832,7 +41849,6 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41832
41849
|
ctx.setLineDash(this.segments);
|
|
41833
41850
|
}
|
|
41834
41851
|
|
|
41835
|
-
var endPoint = chartRect.y2 - labelOffset.bottom;
|
|
41836
41852
|
var isLinearInterpolation = this.useLinearInterpolation();
|
|
41837
41853
|
var barAreaByCombo = 0;
|
|
41838
41854
|
var minmaxX = axesSteps.x[this.xAxisIndex];
|
|
@@ -41855,8 +41871,12 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41855
41871
|
|
|
41856
41872
|
var getYPos = function getYPos(val) {
|
|
41857
41873
|
return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
41858
|
-
};
|
|
41874
|
+
};
|
|
41859
41875
|
|
|
41876
|
+
var includeNegativeValue = this.data.some(function (data) {
|
|
41877
|
+
return data.o < 0;
|
|
41878
|
+
});
|
|
41879
|
+
var endPoint = includeNegativeValue ? getYPos(0) : chartRect.y2 - labelOffset.bottom; // draw line
|
|
41860
41880
|
|
|
41861
41881
|
var prevValid;
|
|
41862
41882
|
this.data.forEach(function (curr) {
|
|
@@ -41916,9 +41936,10 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41916
41936
|
}
|
|
41917
41937
|
});
|
|
41918
41938
|
var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
|
|
41919
|
-
|
|
41939
|
+
var mainGradientColor = extent.opacity < 1 ? fillColor : mainColor;
|
|
41940
|
+
gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
|
|
41920
41941
|
gradient.addColorStop(0.5, fillColor);
|
|
41921
|
-
gradient.addColorStop(1,
|
|
41942
|
+
gradient.addColorStop(1, mainGradientColor);
|
|
41922
41943
|
ctx.fillStyle = gradient;
|
|
41923
41944
|
} else {
|
|
41924
41945
|
ctx.fillStyle = fillColor;
|
|
@@ -41986,7 +42007,7 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41986
42007
|
|
|
41987
42008
|
var nextData = _this2.data[jx];
|
|
41988
42009
|
var xp = getXPos(nextData.x);
|
|
41989
|
-
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 :
|
|
42010
|
+
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : getYPos(0);
|
|
41990
42011
|
ctx.lineTo(xp, bp);
|
|
41991
42012
|
}
|
|
41992
42013
|
|
|
@@ -42747,8 +42768,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42747
42768
|
|
|
42748
42769
|
var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
|
|
42749
42770
|
var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
|
|
42750
|
-
var
|
|
42751
|
-
var
|
|
42771
|
+
var xAxisPosition = chartRect.x1 + labelOffset.left;
|
|
42772
|
+
var yAxisPosition = chartRect.y2 - labelOffset.bottom;
|
|
42773
|
+
var xZeroPosition = helpers_canvas.calculateX(0, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42774
|
+
var yZeroPosition = helpers_canvas.calculateY(0, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42775
|
+
var xsp = isHorizontal ? xAxisPosition + xZeroPosition : xAxisPosition;
|
|
42776
|
+
var ysp = isHorizontal ? yAxisPosition : yAxisPosition + yZeroPosition;
|
|
42752
42777
|
var dArea = isHorizontal ? yArea : xArea;
|
|
42753
42778
|
var cArea = dArea / (totalCount || 1);
|
|
42754
42779
|
var cPad;
|
|
@@ -42812,7 +42837,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42812
42837
|
categoryPoint = ysp - cArea * screenIndex - cPad;
|
|
42813
42838
|
} else {
|
|
42814
42839
|
categoryPoint = xsp + cArea * screenIndex + cPad;
|
|
42815
|
-
}
|
|
42840
|
+
} // 기본 위치 설정
|
|
42841
|
+
|
|
42816
42842
|
|
|
42817
42843
|
if (isHorizontal) {
|
|
42818
42844
|
x = xsp;
|
|
@@ -42820,22 +42846,30 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42820
42846
|
} else {
|
|
42821
42847
|
x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
|
|
42822
42848
|
y = ysp;
|
|
42823
|
-
}
|
|
42849
|
+
} // 너비 / 높이 계산, 스택의 경우 위치 값 재계산
|
|
42850
|
+
|
|
42824
42851
|
|
|
42825
42852
|
if (isHorizontal) {
|
|
42853
|
+
var barValue = item.b ? item.o : item.x;
|
|
42854
|
+
w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
|
|
42855
|
+
|
|
42826
42856
|
if (item.b) {
|
|
42827
|
-
|
|
42828
|
-
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
|
|
42829
|
-
} else {
|
|
42830
|
-
w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42857
|
+
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp - xZeroPosition);
|
|
42831
42858
|
}
|
|
42832
|
-
|
|
42833
|
-
|
|
42834
|
-
|
|
42835
|
-
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
42859
|
+
|
|
42860
|
+
var minimumBarWidth = barValue > 0 ? -1 : 1;
|
|
42861
|
+
w = barValue && Math.abs(w) === 0 ? minimumBarWidth : w;
|
|
42836
42862
|
} else {
|
|
42837
|
-
|
|
42838
|
-
|
|
42863
|
+
var _barValue = item.b ? item.o : item.y;
|
|
42864
|
+
|
|
42865
|
+
h = helpers_canvas.calculateY(_barValue, minmaxY.graphMin, minmaxY.graphMax, yArea, -yZeroPosition);
|
|
42866
|
+
|
|
42867
|
+
if (item.b) {
|
|
42868
|
+
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp - yZeroPosition);
|
|
42869
|
+
}
|
|
42870
|
+
|
|
42871
|
+
var minimumBarHeight = _barValue > 0 ? -1 : 1;
|
|
42872
|
+
h = _barValue && Math.abs(h) === 0 ? minimumBarHeight : h;
|
|
42839
42873
|
}
|
|
42840
42874
|
|
|
42841
42875
|
var barColor = item.dataColor || this.color;
|
|
@@ -43124,10 +43158,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43124
43158
|
align = _this$showValue.align,
|
|
43125
43159
|
formatter = _this$showValue.formatter,
|
|
43126
43160
|
decimalPoint = _this$showValue.decimalPoint;
|
|
43127
|
-
var
|
|
43128
|
-
|
|
43129
|
-
|
|
43130
|
-
|
|
43161
|
+
var barX = positions.x,
|
|
43162
|
+
barY = positions.y,
|
|
43163
|
+
barWidth = positions.w,
|
|
43164
|
+
barHeight = positions.h;
|
|
43131
43165
|
var ctx = context;
|
|
43132
43166
|
ctx.save();
|
|
43133
43167
|
ctx.beginPath();
|
|
@@ -43162,25 +43196,27 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43162
43196
|
formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
|
|
43163
43197
|
}
|
|
43164
43198
|
|
|
43199
|
+
var isNegativeValue = value < 0;
|
|
43165
43200
|
var textWidth = Math.round(ctx.measureText(formattedTxt).width);
|
|
43166
|
-
var textHeight = fontSize
|
|
43167
|
-
|
|
43168
|
-
var
|
|
43169
|
-
var
|
|
43170
|
-
var
|
|
43171
|
-
var
|
|
43172
|
-
var
|
|
43173
|
-
var
|
|
43201
|
+
var textHeight = fontSize; // fontSize와 textHeight는 같을 수 없지만, 정확히 구할 필요 없음
|
|
43202
|
+
|
|
43203
|
+
var GAP = 10;
|
|
43204
|
+
var minXPos = isNegativeValue ? barX - GAP : barX + GAP;
|
|
43205
|
+
var minYPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43206
|
+
var centerXOnBar = barX + barWidth / 2;
|
|
43207
|
+
var centerYOnBar = isHighlight ? barY + barHeight / 2 : barY - barHeight / 2;
|
|
43208
|
+
var drawableBarWidth = Math.abs(barWidth) - GAP;
|
|
43209
|
+
var drawableBarHeight = Math.abs(barHeight) - GAP;
|
|
43174
43210
|
|
|
43175
43211
|
switch (align) {
|
|
43176
43212
|
case 'start':
|
|
43177
43213
|
{
|
|
43178
|
-
if (isHorizontal) {
|
|
43179
|
-
|
|
43180
|
-
|
|
43181
|
-
|
|
43182
|
-
|
|
43183
|
-
ctx.fillText(formattedTxt,
|
|
43214
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43215
|
+
var xPos = isNegativeValue ? minXPos - textWidth : minXPos;
|
|
43216
|
+
ctx.fillText(formattedTxt, xPos, centerYOnBar);
|
|
43217
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43218
|
+
var yPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43219
|
+
ctx.fillText(formattedTxt, centerXOnBar, yPos);
|
|
43184
43220
|
}
|
|
43185
43221
|
|
|
43186
43222
|
break;
|
|
@@ -43188,12 +43224,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43188
43224
|
|
|
43189
43225
|
case 'center':
|
|
43190
43226
|
{
|
|
43191
|
-
if (isHorizontal) {
|
|
43192
|
-
|
|
43193
|
-
|
|
43194
|
-
|
|
43195
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43196
|
-
ctx.fillText(formattedTxt, centerX, centerY);
|
|
43227
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43228
|
+
ctx.fillText(formattedTxt, centerXOnBar, centerYOnBar);
|
|
43229
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43230
|
+
ctx.fillText(formattedTxt, centerXOnBar, barY + barHeight / 2);
|
|
43197
43231
|
}
|
|
43198
43232
|
|
|
43199
43233
|
break;
|
|
@@ -43207,9 +43241,26 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43207
43241
|
}
|
|
43208
43242
|
|
|
43209
43243
|
if (isHorizontal) {
|
|
43210
|
-
|
|
43244
|
+
var minXOnChart = this.chartRect.x1 + this.labelOffset.left;
|
|
43245
|
+
var maxXOnChart = this.chartRect.x2 - this.labelOffset.right;
|
|
43246
|
+
|
|
43247
|
+
if (isNegativeValue) {
|
|
43248
|
+
var _xPos = barX - GAP + barWidth - textWidth;
|
|
43249
|
+
|
|
43250
|
+
if (_xPos > minXOnChart) {
|
|
43251
|
+
ctx.fillText(formattedTxt, _xPos, centerYOnBar);
|
|
43252
|
+
}
|
|
43253
|
+
} else {
|
|
43254
|
+
var _xPos2 = barX + GAP + barWidth;
|
|
43255
|
+
|
|
43256
|
+
if (_xPos2 + textWidth < maxXOnChart) {
|
|
43257
|
+
ctx.fillText(formattedTxt, _xPos2, centerYOnBar);
|
|
43258
|
+
}
|
|
43259
|
+
}
|
|
43211
43260
|
} else {
|
|
43212
|
-
|
|
43261
|
+
var _yPos = isNegativeValue ? barY + barHeight + GAP : barY + barHeight - GAP;
|
|
43262
|
+
|
|
43263
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos);
|
|
43213
43264
|
}
|
|
43214
43265
|
|
|
43215
43266
|
break;
|
|
@@ -43218,14 +43269,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43218
43269
|
default:
|
|
43219
43270
|
case 'end':
|
|
43220
43271
|
{
|
|
43221
|
-
if (isHorizontal) {
|
|
43222
|
-
|
|
43223
|
-
|
|
43224
|
-
|
|
43272
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43273
|
+
var _xPos3 = isNegativeValue ? barX + barWidth + GAP : barX + barWidth - textWidth - GAP;
|
|
43274
|
+
|
|
43275
|
+
ctx.fillText(formattedTxt, _xPos3, centerYOnBar);
|
|
43276
|
+
} else if (!isHorizontal) {
|
|
43277
|
+
if (isNegativeValue) {
|
|
43278
|
+
var _yPos2 = barY + barHeight - GAP;
|
|
43279
|
+
|
|
43280
|
+
if (_yPos2 > minYPos) {
|
|
43281
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos2);
|
|
43282
|
+
}
|
|
43283
|
+
} else if (textHeight < drawableBarHeight) {
|
|
43284
|
+
var _yPos3 = barY + barHeight + GAP;
|
|
43285
|
+
|
|
43286
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos3);
|
|
43225
43287
|
}
|
|
43226
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43227
|
-
var yPos = y + h + textHeight;
|
|
43228
|
-
ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
|
|
43229
43288
|
}
|
|
43230
43289
|
|
|
43231
43290
|
break;
|
|
@@ -43282,28 +43341,50 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43282
43341
|
ctx.beginPath();
|
|
43283
43342
|
ctx.moveTo(x, y);
|
|
43284
43343
|
|
|
43344
|
+
if (Math.abs(w) < r * 2) {
|
|
43345
|
+
r = Math.abs(w) / 2;
|
|
43346
|
+
}
|
|
43347
|
+
|
|
43348
|
+
if (Math.abs(h) < r * 2) {
|
|
43349
|
+
r = Math.abs(h) / 2;
|
|
43350
|
+
}
|
|
43351
|
+
|
|
43285
43352
|
if (isHorizontal) {
|
|
43286
|
-
|
|
43287
|
-
|
|
43353
|
+
var isNegativeValue = w < 0;
|
|
43354
|
+
|
|
43355
|
+
if (isNegativeValue) {
|
|
43356
|
+
w += r;
|
|
43357
|
+
ctx.lineTo(x + w, y);
|
|
43358
|
+
ctx.arcTo(x + w - r, y, x + w - r, y - r, r);
|
|
43359
|
+
ctx.arcTo(x + w - r, y - h, x + w, y - h, r);
|
|
43360
|
+
ctx.lineTo(x, y - h);
|
|
43361
|
+
ctx.lineTo(x, y);
|
|
43362
|
+
} else {
|
|
43363
|
+
w -= r;
|
|
43364
|
+
ctx.lineTo(x + w, y);
|
|
43365
|
+
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43366
|
+
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43367
|
+
ctx.lineTo(x, y - h);
|
|
43368
|
+
ctx.lineTo(x, y);
|
|
43288
43369
|
}
|
|
43289
|
-
|
|
43290
|
-
w -= r;
|
|
43291
|
-
ctx.lineTo(x + w, y);
|
|
43292
|
-
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43293
|
-
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43294
|
-
ctx.lineTo(x, y - h);
|
|
43295
|
-
ctx.lineTo(x, y);
|
|
43296
43370
|
} else {
|
|
43297
|
-
|
|
43298
|
-
|
|
43371
|
+
var _isNegativeValue = h > 0;
|
|
43372
|
+
|
|
43373
|
+
if (_isNegativeValue) {
|
|
43374
|
+
h -= r;
|
|
43375
|
+
ctx.lineTo(x + w, y);
|
|
43376
|
+
ctx.lineTo(x + w, y + h);
|
|
43377
|
+
ctx.arcTo(x + w, y + h + r, x - w + r, y + h + r, r);
|
|
43378
|
+
ctx.arcTo(x, y + h + r, x, y + h, r);
|
|
43379
|
+
ctx.lineTo(x, y);
|
|
43380
|
+
} else {
|
|
43381
|
+
h += r;
|
|
43382
|
+
ctx.lineTo(x + w, y);
|
|
43383
|
+
ctx.lineTo(x + w, y + h);
|
|
43384
|
+
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43385
|
+
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43386
|
+
ctx.lineTo(x, y);
|
|
43299
43387
|
}
|
|
43300
|
-
|
|
43301
|
-
h += r;
|
|
43302
|
-
ctx.lineTo(x + w, y);
|
|
43303
|
-
ctx.lineTo(x + w, y + h);
|
|
43304
|
-
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43305
|
-
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43306
|
-
ctx.lineTo(x, y);
|
|
43307
43388
|
}
|
|
43308
43389
|
|
|
43309
43390
|
ctx.fill();
|
|
@@ -45058,6 +45139,7 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45058
45139
|
}
|
|
45059
45140
|
/**
|
|
45060
45141
|
* With range information, calculate how many labels in axis
|
|
45142
|
+
* linear type은 scale.linear.js에서 처리
|
|
45061
45143
|
* @param {object} range min/max information
|
|
45062
45144
|
*
|
|
45063
45145
|
* @returns {object} steps, interval, min/max graph value
|
|
@@ -45266,6 +45348,14 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45266
45348
|
|
|
45267
45349
|
ctx.beginPath();
|
|
45268
45350
|
ticks[ix] = axisMinForLabel + ix * stepValue;
|
|
45351
|
+
var isZeroLine = ticks[ix] === 0;
|
|
45352
|
+
|
|
45353
|
+
if (isZeroLine && _this3.zeroLineColor) {
|
|
45354
|
+
ctx.strokeStyle = _this3.zeroLineColor;
|
|
45355
|
+
} else {
|
|
45356
|
+
ctx.strokeStyle = _this3.gridLineColor;
|
|
45357
|
+
}
|
|
45358
|
+
|
|
45269
45359
|
linePosition = labelCenter + aliasPixel;
|
|
45270
45360
|
labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
|
|
45271
45361
|
prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
|
|
@@ -45371,9 +45461,11 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45371
45461
|
}
|
|
45372
45462
|
|
|
45373
45463
|
var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
|
|
45374
|
-
var
|
|
45375
|
-
|
|
45464
|
+
var userDefinedFrom = mergedPlotBandOpt.from,
|
|
45465
|
+
userDefinedTo = mergedPlotBandOpt.to,
|
|
45376
45466
|
labelOpt = mergedPlotBandOpt.label;
|
|
45467
|
+
var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
|
|
45468
|
+
var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
|
|
45377
45469
|
|
|
45378
45470
|
_this3.setPlotBandStyle(mergedPlotBandOpt);
|
|
45379
45471
|
|
|
@@ -45381,8 +45473,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45381
45473
|
var toPos;
|
|
45382
45474
|
|
|
45383
45475
|
if (_this3.type === 'x') {
|
|
45384
|
-
fromPos = helpers_canvas.calculateX(from
|
|
45385
|
-
toPos = helpers_canvas.calculateX(to
|
|
45476
|
+
fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
|
|
45477
|
+
toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
|
|
45386
45478
|
|
|
45387
45479
|
if (fromPos === null || toPos === null) {
|
|
45388
45480
|
return;
|
|
@@ -45390,8 +45482,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45390
45482
|
|
|
45391
45483
|
_this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
|
|
45392
45484
|
} else {
|
|
45393
|
-
fromPos = helpers_canvas.calculateY(from
|
|
45394
|
-
toPos = helpers_canvas.calculateY(to
|
|
45485
|
+
fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
|
|
45486
|
+
toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
|
|
45395
45487
|
|
|
45396
45488
|
if (fromPos === null || toPos === null) {
|
|
45397
45489
|
return;
|
|
@@ -45961,6 +46053,7 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
|
|
|
45961
46053
|
|
|
45962
46054
|
|
|
45963
46055
|
|
|
46056
|
+
|
|
45964
46057
|
var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
45965
46058
|
_inherits(LinearScale, _Scale);
|
|
45966
46059
|
|
|
@@ -45999,16 +46092,192 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
|
45999
46092
|
* Calculate interval
|
|
46000
46093
|
* @param {object} range range information
|
|
46001
46094
|
*
|
|
46002
|
-
* @returns {number}
|
|
46095
|
+
* @returns {number} interval (한 칸에 표시할 값의 간격)
|
|
46003
46096
|
*/
|
|
46004
46097
|
|
|
46005
46098
|
}, {
|
|
46006
46099
|
key: "getInterval",
|
|
46007
46100
|
value: function getInterval(range) {
|
|
46101
|
+
if (this.interval) return this.interval;
|
|
46008
46102
|
var max = range.maxValue;
|
|
46009
46103
|
var min = range.minValue;
|
|
46010
|
-
var
|
|
46011
|
-
|
|
46104
|
+
var steps = range.maxSteps; // step이 0이면 interval 계산 불가
|
|
46105
|
+
|
|
46106
|
+
if (!steps || steps <= 0) return 0; // startToZero이고, 최소값이 음수일 경우 0을 반드시 포함
|
|
46107
|
+
|
|
46108
|
+
if (this.startToZero && min < 0) {
|
|
46109
|
+
var totalRange = Math.abs(min) + Math.abs(max); // 비율로 나눔
|
|
46110
|
+
|
|
46111
|
+
var negativeRatio = Math.abs(min) / totalRange;
|
|
46112
|
+
var positiveRatio = Math.abs(max) / totalRange; // 각 방향에 최소 1칸 이상 배정되도록 보장
|
|
46113
|
+
|
|
46114
|
+
var negativeSteps = Math.max(1, Math.round(negativeRatio * steps));
|
|
46115
|
+
var positiveSteps = Math.max(1, steps - negativeSteps); // 다시 합이 steps보다 커질 수도 있으니, 조정
|
|
46116
|
+
|
|
46117
|
+
if (negativeSteps + positiveSteps > steps) {
|
|
46118
|
+
// 가장 큰 쪽에서 하나 줄임
|
|
46119
|
+
if (negativeRatio > positiveRatio) {
|
|
46120
|
+
negativeSteps -= 1;
|
|
46121
|
+
} else {
|
|
46122
|
+
positiveSteps -= 1;
|
|
46123
|
+
}
|
|
46124
|
+
}
|
|
46125
|
+
|
|
46126
|
+
return Math.ceil(Math.max(Math.abs(min) / (negativeSteps || 1), Math.abs(max) / (positiveSteps || 1)));
|
|
46127
|
+
}
|
|
46128
|
+
|
|
46129
|
+
return Math.ceil((max - min) / steps);
|
|
46130
|
+
}
|
|
46131
|
+
/**
|
|
46132
|
+
* With range information, calculate how many labels in axis
|
|
46133
|
+
* @param {object} range min/max information
|
|
46134
|
+
*
|
|
46135
|
+
* @returns {object} steps, interval, min/max graph value
|
|
46136
|
+
*/
|
|
46137
|
+
|
|
46138
|
+
}, {
|
|
46139
|
+
key: "calculateSteps",
|
|
46140
|
+
value: function calculateSteps(range) {
|
|
46141
|
+
var maxValue = range.maxValue,
|
|
46142
|
+
minValue = range.minValue;
|
|
46143
|
+
var _range$maxSteps = range.maxSteps,
|
|
46144
|
+
maxSteps = _range$maxSteps === void 0 ? 1 : _range$maxSteps;
|
|
46145
|
+
var interval = this.getInterval(range);
|
|
46146
|
+
var graphMin = 0;
|
|
46147
|
+
var graphMax = 0; // 그래프 최대/최소 값 계산
|
|
46148
|
+
|
|
46149
|
+
if (minValue >= 0) {
|
|
46150
|
+
// 전부 양수
|
|
46151
|
+
graphMin = +minValue;
|
|
46152
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46153
|
+
} else if (maxValue >= 0) {
|
|
46154
|
+
// 양수/음수 혼합
|
|
46155
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46156
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46157
|
+
} else {
|
|
46158
|
+
// 전부 음수
|
|
46159
|
+
graphMax = +maxValue;
|
|
46160
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46161
|
+
}
|
|
46162
|
+
|
|
46163
|
+
var graphRange = graphMax - graphMin;
|
|
46164
|
+
var numberOfSteps = Math.round(graphRange / interval); // 특수 케이스: 양수 최소값, 최대값이 1일 경우
|
|
46165
|
+
|
|
46166
|
+
if (minValue > 0 && maxValue === 1) {
|
|
46167
|
+
if (!this.decimalPoint) {
|
|
46168
|
+
interval = 1;
|
|
46169
|
+
numberOfSteps = 1;
|
|
46170
|
+
maxSteps = 1;
|
|
46171
|
+
} else if (maxSteps > 2) {
|
|
46172
|
+
interval = 0.2;
|
|
46173
|
+
numberOfSteps = 5;
|
|
46174
|
+
maxSteps = 5;
|
|
46175
|
+
} else {
|
|
46176
|
+
interval = 0.5;
|
|
46177
|
+
numberOfSteps = 2;
|
|
46178
|
+
maxSteps = 2;
|
|
46179
|
+
}
|
|
46180
|
+
} // 최대 스텝 수 조정
|
|
46181
|
+
|
|
46182
|
+
|
|
46183
|
+
while (numberOfSteps > maxSteps) {
|
|
46184
|
+
interval *= 2;
|
|
46185
|
+
numberOfSteps = Math.round(graphRange / interval);
|
|
46186
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46187
|
+
}
|
|
46188
|
+
|
|
46189
|
+
if (graphRange > numberOfSteps * interval) {
|
|
46190
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46191
|
+
}
|
|
46192
|
+
|
|
46193
|
+
return {
|
|
46194
|
+
steps: numberOfSteps,
|
|
46195
|
+
interval: interval,
|
|
46196
|
+
graphMin: graphMin,
|
|
46197
|
+
graphMax: graphMax
|
|
46198
|
+
};
|
|
46199
|
+
}
|
|
46200
|
+
/**
|
|
46201
|
+
* Calculate min/max value, label and size information for axis
|
|
46202
|
+
* @param {object} minMax min/max information
|
|
46203
|
+
* @param {object} scrollbarOpt scrollbar option
|
|
46204
|
+
*
|
|
46205
|
+
* @returns {object} min/max value and label
|
|
46206
|
+
*/
|
|
46207
|
+
|
|
46208
|
+
}, {
|
|
46209
|
+
key: "calculateScaleRange",
|
|
46210
|
+
value: function calculateScaleRange(minMax, scrollbarOpt) {
|
|
46211
|
+
var _this$labelStyle;
|
|
46212
|
+
|
|
46213
|
+
var maxValue;
|
|
46214
|
+
var minValue;
|
|
46215
|
+
var isDefaultMaxSameAsMin = false;
|
|
46216
|
+
var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
|
|
46217
|
+
|
|
46218
|
+
if (Array.isArray(range) && (range === null || range === void 0 ? void 0 : range.length) === 2) {
|
|
46219
|
+
if (this.options.type === 'heatMap') {
|
|
46220
|
+
maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
|
|
46221
|
+
minValue = range[0] < +minMax.min ? +minMax.min : range[0];
|
|
46222
|
+
} else {
|
|
46223
|
+
maxValue = range[1];
|
|
46224
|
+
minValue = range[0];
|
|
46225
|
+
}
|
|
46226
|
+
} else if (typeof range === 'function') {
|
|
46227
|
+
var _range = range(minMax.min, minMax.max);
|
|
46228
|
+
|
|
46229
|
+
var _range2 = _slicedToArray(_range, 2);
|
|
46230
|
+
|
|
46231
|
+
minValue = _range2[0];
|
|
46232
|
+
maxValue = _range2[1];
|
|
46233
|
+
} else {
|
|
46234
|
+
maxValue = minMax.max;
|
|
46235
|
+
minValue = minMax.min;
|
|
46236
|
+
} // autoScaleRatio 적용 케이스
|
|
46237
|
+
|
|
46238
|
+
|
|
46239
|
+
if (this.autoScaleRatio) {
|
|
46240
|
+
var temp = maxValue; // 양수 방향에만 autoScaleRatio 적용
|
|
46241
|
+
|
|
46242
|
+
maxValue = Math.ceil(maxValue * (this.autoScaleRatio + 1));
|
|
46243
|
+
|
|
46244
|
+
if (maxValue > 0 && minValue < 0) {
|
|
46245
|
+
// 양수/음수 혼합 케이스 -- 음수 방향에도 maxValue 증가분만큼 더하기
|
|
46246
|
+
var diff = temp - maxValue;
|
|
46247
|
+
minValue += diff;
|
|
46248
|
+
} else if (maxValue < 0 && minValue < 0) {
|
|
46249
|
+
// 전부 음수 케이스 -- 음수 방향에도 autoScaleRatio 적용
|
|
46250
|
+
minValue = Math.ceil(minValue * (this.autoScaleRatio + 1));
|
|
46251
|
+
}
|
|
46252
|
+
} // 0 기준 축 설정 케이스
|
|
46253
|
+
|
|
46254
|
+
|
|
46255
|
+
if (this.startToZero) {
|
|
46256
|
+
if (minValue > 0) {
|
|
46257
|
+
minValue = 0;
|
|
46258
|
+
}
|
|
46259
|
+
|
|
46260
|
+
if (maxValue < 0) {
|
|
46261
|
+
maxValue = 0;
|
|
46262
|
+
}
|
|
46263
|
+
}
|
|
46264
|
+
|
|
46265
|
+
if (maxValue === minValue) {
|
|
46266
|
+
maxValue += 1;
|
|
46267
|
+
isDefaultMaxSameAsMin = true;
|
|
46268
|
+
}
|
|
46269
|
+
|
|
46270
|
+
var minLabel = this.getLabelFormat(minValue);
|
|
46271
|
+
var maxLabel = this.getLabelFormat(maxValue, {
|
|
46272
|
+
isMaxValueSameAsMin: isDefaultMaxSameAsMin
|
|
46273
|
+
});
|
|
46274
|
+
return {
|
|
46275
|
+
min: minValue,
|
|
46276
|
+
max: maxValue,
|
|
46277
|
+
minLabel: minLabel,
|
|
46278
|
+
maxLabel: maxLabel,
|
|
46279
|
+
size: helpers_util.calcTextSize(maxLabel, helpers_util.getLabelStyle(this.labelStyle), (_this$labelStyle = this.labelStyle) === null || _this$labelStyle === void 0 ? void 0 : _this$labelStyle.padding)
|
|
46280
|
+
};
|
|
46012
46281
|
}
|
|
46013
46282
|
}]);
|
|
46014
46283
|
|
|
@@ -47230,7 +47499,7 @@ var plugins_legend_modules = {
|
|
|
47230
47499
|
var useLegendSeries = [];
|
|
47231
47500
|
|
|
47232
47501
|
if (groups) {
|
|
47233
|
-
useLegendSeries = groups.
|
|
47502
|
+
useLegendSeries = groups.filter(function (sId) {
|
|
47234
47503
|
return _this3.seriesList[sId].showLegend;
|
|
47235
47504
|
}).map(function (sId) {
|
|
47236
47505
|
return [sId, _this3.seriesList[sId]];
|
|
@@ -47281,9 +47550,8 @@ var plugins_legend_modules = {
|
|
|
47281
47550
|
},
|
|
47282
47551
|
|
|
47283
47552
|
/**
|
|
47284
|
-
* Adds legends for each group in `groups` array, iterating through each series
|
|
47285
|
-
*
|
|
47286
|
-
* order as displayed in the chart. Only adds series with `showLegend` set to `true`.
|
|
47553
|
+
* Adds legends for each group in `groups` array, iterating through each series within the group.
|
|
47554
|
+
* Only adds series with `showLegend` set to `true`.
|
|
47287
47555
|
*
|
|
47288
47556
|
* @param {Array} groups - Array of groups containing series identifiers.
|
|
47289
47557
|
* @param {Object} seriesList - Object containing all series, keyed by series ID.
|
|
@@ -47294,7 +47562,7 @@ var plugins_legend_modules = {
|
|
|
47294
47562
|
var _this5 = this;
|
|
47295
47563
|
|
|
47296
47564
|
groups.forEach(function (group) {
|
|
47297
|
-
group.
|
|
47565
|
+
group.forEach(function (sId) {
|
|
47298
47566
|
var series = seriesList[sId];
|
|
47299
47567
|
|
|
47300
47568
|
if (series && series.showLegend) {
|
|
@@ -53312,7 +53580,6 @@ var plugins_pie_modules = {
|
|
|
53312
53580
|
|
|
53313
53581
|
|
|
53314
53582
|
|
|
53315
|
-
|
|
53316
53583
|
var element_tip_modules = {
|
|
53317
53584
|
/**
|
|
53318
53585
|
* Draw TextTip with tip's locationInfo
|
|
@@ -53346,8 +53613,7 @@ var element_tip_modules = {
|
|
|
53346
53613
|
}
|
|
53347
53614
|
|
|
53348
53615
|
if (labelTipOpt.use && labelTipOpt.showTip) {
|
|
53349
|
-
|
|
53350
|
-
isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
|
|
53616
|
+
isExistSelectedLabel = opt.type === 'heatMap' ? this.drawLabelTipForHeatMap() : this.drawTipForSelectedLabel();
|
|
53351
53617
|
}
|
|
53352
53618
|
|
|
53353
53619
|
var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
|
|
@@ -53633,9 +53899,10 @@ var element_tip_modules = {
|
|
|
53633
53899
|
|
|
53634
53900
|
/**
|
|
53635
53901
|
* Draw Selected Label Tip
|
|
53902
|
+
* none Text
|
|
53636
53903
|
* @returns {boolean} Whether drew at least one tip
|
|
53637
53904
|
*/
|
|
53638
|
-
|
|
53905
|
+
drawTipForSelectedLabel: function drawTipForSelectedLabel() {
|
|
53639
53906
|
var _this2 = this;
|
|
53640
53907
|
|
|
53641
53908
|
var opt = this.options;
|
|
@@ -53661,7 +53928,7 @@ var element_tip_modules = {
|
|
|
53661
53928
|
};
|
|
53662
53929
|
var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
|
|
53663
53930
|
var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
|
|
53664
|
-
var
|
|
53931
|
+
var valueAxesSteps = isHorizontal ? this.axesSteps.x[0] : this.axesSteps.y[0];
|
|
53665
53932
|
var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
|
|
53666
53933
|
var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
|
|
53667
53934
|
var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
|
|
@@ -53679,8 +53946,8 @@ var element_tip_modules = {
|
|
|
53679
53946
|
return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
|
|
53680
53947
|
});
|
|
53681
53948
|
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$ : [];
|
|
53682
|
-
var
|
|
53683
|
-
var
|
|
53949
|
+
var labelPos;
|
|
53950
|
+
var dataPos;
|
|
53684
53951
|
var value;
|
|
53685
53952
|
var labelStartPoint;
|
|
53686
53953
|
var labelEndPoint;
|
|
@@ -53728,31 +53995,39 @@ var element_tip_modules = {
|
|
|
53728
53995
|
}
|
|
53729
53996
|
|
|
53730
53997
|
data.forEach(function (selectedData, i) {
|
|
53731
|
-
|
|
53732
|
-
|
|
53733
|
-
|
|
53734
|
-
|
|
53735
|
-
var
|
|
53736
|
-
|
|
53737
|
-
|
|
53738
|
-
|
|
53739
|
-
|
|
53740
|
-
|
|
53741
|
-
|
|
53742
|
-
var
|
|
53743
|
-
|
|
53744
|
-
|
|
53745
|
-
|
|
53746
|
-
|
|
53747
|
-
|
|
53748
|
-
|
|
53749
|
-
var
|
|
53750
|
-
|
|
53751
|
-
|
|
53752
|
-
|
|
53753
|
-
|
|
53754
|
-
|
|
53755
|
-
|
|
53998
|
+
value = valueAxesSteps.graphMax;
|
|
53999
|
+
|
|
54000
|
+
if (!labelTipOpt.fixedPosTop) {
|
|
54001
|
+
if (isExistGrp) {
|
|
54002
|
+
var _visibleSeries$filter, _visibleSeries$filter2;
|
|
54003
|
+
|
|
54004
|
+
var positiveSum = visibleSeries === null || visibleSeries === void 0 ? void 0 : visibleSeries.reduce(function (ac, sId) {
|
|
54005
|
+
var _selectedData$sId$val, _selectedData$sId, _selectedData$sId$val2, _selectedData$sId2;
|
|
54006
|
+
|
|
54007
|
+
return groups.includes(sId) && ((_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]) > 0 ? ac + ((_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]) : ac;
|
|
54008
|
+
}, 0);
|
|
54009
|
+
var nonGroupValues = (_visibleSeries$filter = visibleSeries === null || visibleSeries === void 0 ? void 0 : (_visibleSeries$filter2 = visibleSeries.filter(function (sId) {
|
|
54010
|
+
return !groups.includes(sId);
|
|
54011
|
+
})) === null || _visibleSeries$filter2 === void 0 ? void 0 : _visibleSeries$filter2.map(function (sId) {
|
|
54012
|
+
var _selectedData$sId$val3, _selectedData$sId3;
|
|
54013
|
+
|
|
54014
|
+
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];
|
|
54015
|
+
})) !== null && _visibleSeries$filter !== void 0 ? _visibleSeries$filter : [];
|
|
54016
|
+
var maxNonGroupValue = (nonGroupValues === null || nonGroupValues === void 0 ? void 0 : nonGroupValues.length) > 0 ? nonGroupValues.reduce(function (max, val) {
|
|
54017
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54018
|
+
}, -Infinity) : -Infinity;
|
|
54019
|
+
value = positiveSum > 0 ? Math.max(maxNonGroupValue, positiveSum) : Math.max(maxNonGroupValue, 0);
|
|
54020
|
+
} else if (visibleSeries.length) {
|
|
54021
|
+
var visibleValue = visibleSeries.map(function (sId) {
|
|
54022
|
+
var _selectedData$sId$val4, _selectedData$sId4;
|
|
54023
|
+
|
|
54024
|
+
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];
|
|
54025
|
+
});
|
|
54026
|
+
var maxValue = visibleValue.length > 0 ? visibleValue.reduce(function (max, val) {
|
|
54027
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54028
|
+
}, -Infinity) : -Infinity;
|
|
54029
|
+
value = maxValue > 0 || _this2.options.type !== 'bar' ? maxValue : 0;
|
|
54030
|
+
}
|
|
53756
54031
|
}
|
|
53757
54032
|
|
|
53758
54033
|
if (labelAxes.labels) {
|
|
@@ -53762,18 +54037,17 @@ var element_tip_modules = {
|
|
|
53762
54037
|
|
|
53763
54038
|
var labelIndex = dataIndex[i] - startIndex;
|
|
53764
54039
|
var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
|
|
53765
|
-
|
|
54040
|
+
labelPos = labelCenter + labelGap / 2;
|
|
53766
54041
|
} else {
|
|
53767
|
-
|
|
54042
|
+
labelPos = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
|
|
53768
54043
|
}
|
|
53769
54044
|
|
|
53770
|
-
|
|
53771
|
-
gp += offset;
|
|
54045
|
+
dataPos = valuePositionCalcFunction(value, valueAxesSteps.graphMin, valueAxesSteps.graphMax, valueSpace, valueStartPoint) + offset;
|
|
53772
54046
|
|
|
53773
54047
|
_this2.showTip({
|
|
53774
54048
|
context: _this2.bufferCtx,
|
|
53775
|
-
x: isHorizontal ?
|
|
53776
|
-
y: isHorizontal ?
|
|
54049
|
+
x: isHorizontal ? dataPos : labelPos,
|
|
54050
|
+
y: isHorizontal ? labelPos : dataPos,
|
|
53777
54051
|
opt: labelTipOpt,
|
|
53778
54052
|
isSamePos: false
|
|
53779
54053
|
});
|
|
@@ -53885,10 +54159,11 @@ var element_tip_modules = {
|
|
|
53885
54159
|
}
|
|
53886
54160
|
} else if (isHorizontal) {
|
|
53887
54161
|
gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
|
|
53888
|
-
gp
|
|
54162
|
+
gp = value < 0 ? gp - offset : gp + offset;
|
|
53889
54163
|
} else {
|
|
53890
|
-
|
|
53891
|
-
gp
|
|
54164
|
+
var adjustedValue = type === 'bar' && value < 0 ? 0 : value;
|
|
54165
|
+
gp = helpers_canvas.calculateY(adjustedValue, graphY.graphMin, graphY.graphMax, yArea, ysp);
|
|
54166
|
+
gp = adjustedValue < 0 ? gp + offset : gp - offset;
|
|
53892
54167
|
}
|
|
53893
54168
|
|
|
53894
54169
|
var maxTipType = 'center';
|
|
@@ -53920,7 +54195,8 @@ var element_tip_modules = {
|
|
|
53920
54195
|
arrowSize: arrowSize,
|
|
53921
54196
|
borderRadius: borderRadius,
|
|
53922
54197
|
text: text,
|
|
53923
|
-
textStyle: textStyle
|
|
54198
|
+
textStyle: textStyle,
|
|
54199
|
+
isNegative: value < 0
|
|
53924
54200
|
});
|
|
53925
54201
|
}
|
|
53926
54202
|
|
|
@@ -53954,12 +54230,21 @@ var element_tip_modules = {
|
|
|
53954
54230
|
borderRadius = param.borderRadius,
|
|
53955
54231
|
text = param.text,
|
|
53956
54232
|
opt = param.opt,
|
|
53957
|
-
textStyle = param.textStyle
|
|
54233
|
+
textStyle = param.textStyle,
|
|
54234
|
+
isNegative = param.isNegative;
|
|
53958
54235
|
var ctx = param.context;
|
|
53959
54236
|
var sx = x - width / 2;
|
|
53960
54237
|
var ex = x + width / 2;
|
|
53961
54238
|
var sy = y - height;
|
|
53962
54239
|
var ey = y;
|
|
54240
|
+
|
|
54241
|
+
if (isNegative) {
|
|
54242
|
+
if (isHorizontal) {
|
|
54243
|
+
sx = x - width / 2 - width;
|
|
54244
|
+
ex = x - width / 2;
|
|
54245
|
+
}
|
|
54246
|
+
}
|
|
54247
|
+
|
|
53963
54248
|
ctx.save();
|
|
53964
54249
|
ctx.font = textStyle;
|
|
53965
54250
|
ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
|
|
@@ -53967,44 +54252,73 @@ var element_tip_modules = {
|
|
|
53967
54252
|
ctx.beginPath();
|
|
53968
54253
|
ctx.moveTo(sx + borderRadius, sy);
|
|
53969
54254
|
ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
|
|
53970
|
-
|
|
53971
|
-
if (isHorizontal) {
|
|
53972
|
-
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
53973
|
-
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
53974
|
-
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
53975
|
-
}
|
|
53976
|
-
|
|
53977
54255
|
ctx.lineTo(sx, ey - borderRadius);
|
|
53978
54256
|
ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
|
|
53979
|
-
|
|
53980
|
-
if (!isHorizontal) {
|
|
53981
|
-
if (type === 'left') {
|
|
53982
|
-
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
53983
|
-
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
53984
|
-
} else if (type === 'right') {
|
|
53985
|
-
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
53986
|
-
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
53987
|
-
} else {
|
|
53988
|
-
ctx.lineTo(x - arrowSize, ey);
|
|
53989
|
-
ctx.lineTo(x, ey + arrowSize);
|
|
53990
|
-
ctx.lineTo(x + arrowSize, ey);
|
|
53991
|
-
}
|
|
53992
|
-
}
|
|
53993
|
-
|
|
53994
54257
|
ctx.lineTo(ex - borderRadius, ey);
|
|
53995
54258
|
ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
|
|
53996
54259
|
ctx.lineTo(ex, sy + borderRadius);
|
|
53997
54260
|
ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
|
|
53998
54261
|
ctx.lineTo(sx + borderRadius, sy);
|
|
53999
54262
|
ctx.closePath();
|
|
54000
|
-
ctx.fill();
|
|
54263
|
+
ctx.fill(); // draw arrow
|
|
54264
|
+
|
|
54265
|
+
ctx.beginPath();
|
|
54266
|
+
|
|
54267
|
+
if (isHorizontal) {
|
|
54268
|
+
if (isNegative) {
|
|
54269
|
+
ctx.moveTo(ex, ey);
|
|
54270
|
+
ctx.lineTo(ex, sy + borderRadius + arrowSize / 2);
|
|
54271
|
+
ctx.lineTo(ex + arrowSize, ey - height / 2);
|
|
54272
|
+
ctx.lineTo(ex, ey - borderRadius - arrowSize / 2);
|
|
54273
|
+
} else {
|
|
54274
|
+
ctx.moveTo(sx, sy);
|
|
54275
|
+
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54276
|
+
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54277
|
+
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54278
|
+
}
|
|
54279
|
+
|
|
54280
|
+
ctx.closePath();
|
|
54281
|
+
ctx.fill();
|
|
54282
|
+
} else {
|
|
54283
|
+
if (isNegative) {
|
|
54284
|
+
if (type === 'left') {
|
|
54285
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54286
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54287
|
+
} else if (type === 'right') {
|
|
54288
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54289
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54290
|
+
} else {
|
|
54291
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54292
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54293
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54294
|
+
}
|
|
54295
|
+
} else if (!isNegative) {
|
|
54296
|
+
if (type === 'left') {
|
|
54297
|
+
ctx.moveTo(sx, sy);
|
|
54298
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54299
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54300
|
+
} else if (type === 'right') {
|
|
54301
|
+
ctx.moveTo(ex, sy);
|
|
54302
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54303
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54304
|
+
} else {
|
|
54305
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54306
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54307
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54308
|
+
}
|
|
54309
|
+
}
|
|
54310
|
+
|
|
54311
|
+
ctx.closePath();
|
|
54312
|
+
ctx.fill();
|
|
54313
|
+
}
|
|
54314
|
+
|
|
54001
54315
|
ctx.restore();
|
|
54002
54316
|
ctx.save();
|
|
54003
54317
|
ctx.font = textStyle;
|
|
54004
54318
|
ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
|
|
54005
54319
|
ctx.textBaseline = 'middle';
|
|
54006
54320
|
ctx.textAlign = 'center';
|
|
54007
|
-
ctx.fillText("".concat(text),
|
|
54321
|
+
ctx.fillText("".concat(text), sx + width / 2, sy + height / 2);
|
|
54008
54322
|
ctx.restore();
|
|
54009
54323
|
},
|
|
54010
54324
|
|