evui 3.4.123 → 3.4.201
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 +506 -190
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +506 -190
- 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 +40 -17
- package/src/components/chart/plugins/plugins.legend.js +4 -6
- package/src/components/chart/scale/scale.js +19 -9
- 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.201\"}");
|
|
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 = !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;
|
|
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,
|
|
@@ -39453,22 +39457,24 @@ var modules = {
|
|
|
39453
39457
|
var isHorizontal = this.options.horizontal;
|
|
39454
39458
|
|
|
39455
39459
|
if (data.length) {
|
|
39460
|
+
var usePassingValue = !helpers_util.isNullOrUndefined(passingValue);
|
|
39456
39461
|
return data.reduce(function (acc, p, index) {
|
|
39457
|
-
var _p$x, _p$y;
|
|
39462
|
+
var _p$x, _p$y, _p$o;
|
|
39458
39463
|
|
|
39459
39464
|
var minmax = acc;
|
|
39460
39465
|
var px = ((_p$x = p.x) === null || _p$x === void 0 ? void 0 : _p$x.value) || p.x;
|
|
39461
39466
|
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;
|
|
39462
39468
|
|
|
39463
|
-
if (px <= minmax.minX) {
|
|
39469
|
+
if (usePassingValue ? po !== passingValue && px <= minmax.minX : px <= minmax.minX) {
|
|
39464
39470
|
minmax.minX = px === null ? 0 : px;
|
|
39465
39471
|
}
|
|
39466
39472
|
|
|
39467
|
-
if (py <= minmax.minY) {
|
|
39473
|
+
if (usePassingValue ? po !== passingValue && py <= minmax.minY : py <= minmax.minY) {
|
|
39468
39474
|
minmax.minY = py === null ? 0 : py;
|
|
39469
39475
|
}
|
|
39470
39476
|
|
|
39471
|
-
if (px >= minmax.maxX) {
|
|
39477
|
+
if (usePassingValue ? po !== passingValue && px >= minmax.maxX : px >= minmax.maxX) {
|
|
39472
39478
|
minmax.maxX = px === null ? 0 : px;
|
|
39473
39479
|
|
|
39474
39480
|
if (isHorizontal && px !== null) {
|
|
@@ -39477,7 +39483,7 @@ var modules = {
|
|
|
39477
39483
|
}
|
|
39478
39484
|
}
|
|
39479
39485
|
|
|
39480
|
-
if (py >= minmax.maxY) {
|
|
39486
|
+
if (usePassingValue ? po !== passingValue && py >= minmax.maxY : py >= minmax.maxY) {
|
|
39481
39487
|
minmax.maxY = py === null ? 0 : py;
|
|
39482
39488
|
|
|
39483
39489
|
if (!isHorizontal && py !== null) {
|
|
@@ -40231,14 +40237,25 @@ var modules = {
|
|
|
40231
40237
|
}
|
|
40232
40238
|
}
|
|
40233
40239
|
|
|
40234
|
-
|
|
40240
|
+
var isExistGrp = _this10.seriesList[key].isExistGrp;
|
|
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) {
|
|
40235
40247
|
minmax.x[axisX].max = smm.maxX;
|
|
40236
40248
|
minmax.x[axisX].maxSID = key;
|
|
40237
40249
|
}
|
|
40238
40250
|
|
|
40239
|
-
|
|
40251
|
+
var maxYisNegative = minmax.y[axisY].max < 0;
|
|
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) {
|
|
40240
40257
|
minmax.y[axisY].max = smm.maxY;
|
|
40241
|
-
minmax.y[
|
|
40258
|
+
minmax.y[axisY].maxSID = key;
|
|
40242
40259
|
}
|
|
40243
40260
|
}
|
|
40244
40261
|
|
|
@@ -41699,6 +41716,7 @@ var TIME_INTERVALS = {
|
|
|
41699
41716
|
|
|
41700
41717
|
|
|
41701
41718
|
|
|
41719
|
+
|
|
41702
41720
|
var element_line_Line = /*#__PURE__*/function () {
|
|
41703
41721
|
function Line(sId, opt, sIdx) {
|
|
41704
41722
|
var _this = this;
|
|
@@ -41832,7 +41850,6 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41832
41850
|
ctx.setLineDash(this.segments);
|
|
41833
41851
|
}
|
|
41834
41852
|
|
|
41835
|
-
var endPoint = chartRect.y2 - labelOffset.bottom;
|
|
41836
41853
|
var isLinearInterpolation = this.useLinearInterpolation();
|
|
41837
41854
|
var barAreaByCombo = 0;
|
|
41838
41855
|
var minmaxX = axesSteps.x[this.xAxisIndex];
|
|
@@ -41855,8 +41872,12 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41855
41872
|
|
|
41856
41873
|
var getYPos = function getYPos(val) {
|
|
41857
41874
|
return helpers_canvas.calculateY(val, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
41858
|
-
};
|
|
41875
|
+
};
|
|
41859
41876
|
|
|
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
|
|
41860
41881
|
|
|
41861
41882
|
var prevValid;
|
|
41862
41883
|
this.data.forEach(function (curr) {
|
|
@@ -41916,9 +41937,10 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41916
41937
|
}
|
|
41917
41938
|
});
|
|
41918
41939
|
var gradient = ctx.createLinearGradient(0, chartRect.y2, 0, maxValueYPos);
|
|
41919
|
-
|
|
41940
|
+
var mainGradientColor = extent.opacity < 1 ? fillColor : mainColor;
|
|
41941
|
+
gradient.addColorStop(0, includeNegativeValue ? mainGradientColor : fillColor);
|
|
41920
41942
|
gradient.addColorStop(0.5, fillColor);
|
|
41921
|
-
gradient.addColorStop(1,
|
|
41943
|
+
gradient.addColorStop(1, mainGradientColor);
|
|
41922
41944
|
ctx.fillStyle = gradient;
|
|
41923
41945
|
} else {
|
|
41924
41946
|
ctx.fillStyle = fillColor;
|
|
@@ -41986,7 +42008,7 @@ var element_line_Line = /*#__PURE__*/function () {
|
|
|
41986
42008
|
|
|
41987
42009
|
var nextData = _this2.data[jx];
|
|
41988
42010
|
var xp = getXPos(nextData.x);
|
|
41989
|
-
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 :
|
|
42011
|
+
var bp = (_getYPos2 = getYPos(nextData.b)) !== null && _getYPos2 !== void 0 ? _getYPos2 : getYPos(0);
|
|
41990
42012
|
ctx.lineTo(xp, bp);
|
|
41991
42013
|
}
|
|
41992
42014
|
|
|
@@ -42740,8 +42762,12 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42740
42762
|
|
|
42741
42763
|
var xArea = chartRect.chartWidth - (labelOffset.left + labelOffset.right);
|
|
42742
42764
|
var yArea = chartRect.chartHeight - (labelOffset.top + labelOffset.bottom);
|
|
42743
|
-
var
|
|
42744
|
-
var
|
|
42765
|
+
var xAxisPosition = chartRect.x1 + labelOffset.left;
|
|
42766
|
+
var yAxisPosition = chartRect.y2 - labelOffset.bottom;
|
|
42767
|
+
var xZeroPosition = helpers_canvas.calculateX(0, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42768
|
+
var yZeroPosition = helpers_canvas.calculateY(0, minmaxY.graphMin, minmaxY.graphMax, yArea);
|
|
42769
|
+
var xsp = isHorizontal ? xAxisPosition + xZeroPosition : xAxisPosition;
|
|
42770
|
+
var ysp = isHorizontal ? yAxisPosition : yAxisPosition + yZeroPosition;
|
|
42745
42771
|
var dArea = isHorizontal ? yArea : xArea;
|
|
42746
42772
|
var cArea = dArea / (totalCount || 1);
|
|
42747
42773
|
var cPad;
|
|
@@ -42805,7 +42831,8 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42805
42831
|
categoryPoint = ysp - cArea * screenIndex - cPad;
|
|
42806
42832
|
} else {
|
|
42807
42833
|
categoryPoint = xsp + cArea * screenIndex + cPad;
|
|
42808
|
-
}
|
|
42834
|
+
} // 기본 위치 설정
|
|
42835
|
+
|
|
42809
42836
|
|
|
42810
42837
|
if (isHorizontal) {
|
|
42811
42838
|
x = xsp;
|
|
@@ -42813,22 +42840,30 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
42813
42840
|
} else {
|
|
42814
42841
|
x = Math.round(categoryPoint + (bArea * barSeriesX - (w + bPad)));
|
|
42815
42842
|
y = ysp;
|
|
42816
|
-
}
|
|
42843
|
+
} // 너비 / 높이 계산, 스택의 경우 위치 값 재계산
|
|
42844
|
+
|
|
42817
42845
|
|
|
42818
42846
|
if (isHorizontal) {
|
|
42847
|
+
var barValue = item.b ? item.o : item.x;
|
|
42848
|
+
w = helpers_canvas.calculateX(barValue, minmaxX.graphMin, minmaxX.graphMax, xArea, -xZeroPosition);
|
|
42849
|
+
|
|
42819
42850
|
if (item.b) {
|
|
42820
|
-
|
|
42821
|
-
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp);
|
|
42822
|
-
} else {
|
|
42823
|
-
w = helpers_canvas.calculateX(item.x, minmaxX.graphMin, minmaxX.graphMax, xArea);
|
|
42851
|
+
x = helpers_canvas.calculateX(item.b, minmaxX.graphMin, minmaxX.graphMax, xArea, xsp - xZeroPosition);
|
|
42824
42852
|
}
|
|
42825
|
-
|
|
42826
|
-
|
|
42827
|
-
|
|
42828
|
-
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp);
|
|
42853
|
+
|
|
42854
|
+
var minimumBarWidth = barValue > 0 ? -1 : 1;
|
|
42855
|
+
w = barValue && Math.abs(w) === 0 ? minimumBarWidth : w;
|
|
42829
42856
|
} else {
|
|
42830
|
-
|
|
42831
|
-
|
|
42857
|
+
var _barValue = item.b ? item.o : item.y;
|
|
42858
|
+
|
|
42859
|
+
h = helpers_canvas.calculateY(_barValue, minmaxY.graphMin, minmaxY.graphMax, yArea, -yZeroPosition);
|
|
42860
|
+
|
|
42861
|
+
if (item.b) {
|
|
42862
|
+
y = helpers_canvas.calculateY(item.b, minmaxY.graphMin, minmaxY.graphMax, yArea, ysp - yZeroPosition);
|
|
42863
|
+
}
|
|
42864
|
+
|
|
42865
|
+
var minimumBarHeight = _barValue > 0 ? -1 : 1;
|
|
42866
|
+
h = _barValue && Math.abs(h) === 0 ? minimumBarHeight : h;
|
|
42832
42867
|
}
|
|
42833
42868
|
|
|
42834
42869
|
var barColor = item.dataColor || this.color;
|
|
@@ -43117,10 +43152,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43117
43152
|
align = _this$showValue.align,
|
|
43118
43153
|
formatter = _this$showValue.formatter,
|
|
43119
43154
|
decimalPoint = _this$showValue.decimalPoint;
|
|
43120
|
-
var
|
|
43121
|
-
|
|
43122
|
-
|
|
43123
|
-
|
|
43155
|
+
var barX = positions.x,
|
|
43156
|
+
barY = positions.y,
|
|
43157
|
+
barWidth = positions.w,
|
|
43158
|
+
barHeight = positions.h;
|
|
43124
43159
|
var ctx = context;
|
|
43125
43160
|
ctx.save();
|
|
43126
43161
|
ctx.beginPath();
|
|
@@ -43155,25 +43190,27 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43155
43190
|
formattedTxt = (_Util$labelSignFormat = helpers_util.labelSignFormat(value, decimalPoint)) !== null && _Util$labelSignFormat !== void 0 ? _Util$labelSignFormat : '';
|
|
43156
43191
|
}
|
|
43157
43192
|
|
|
43193
|
+
var isNegativeValue = value < 0;
|
|
43158
43194
|
var textWidth = Math.round(ctx.measureText(formattedTxt).width);
|
|
43159
|
-
var textHeight = fontSize
|
|
43160
|
-
|
|
43161
|
-
var
|
|
43162
|
-
var
|
|
43163
|
-
var
|
|
43164
|
-
var
|
|
43165
|
-
var
|
|
43166
|
-
var
|
|
43195
|
+
var textHeight = fontSize; // fontSize와 textHeight는 같을 수 없지만, 정확히 구할 필요 없음
|
|
43196
|
+
|
|
43197
|
+
var GAP = 10;
|
|
43198
|
+
var minXPos = isNegativeValue ? barX - GAP : barX + GAP;
|
|
43199
|
+
var minYPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43200
|
+
var centerXOnBar = barX + barWidth / 2;
|
|
43201
|
+
var centerYOnBar = isHighlight ? barY + barHeight / 2 : barY - barHeight / 2;
|
|
43202
|
+
var drawableBarWidth = Math.abs(barWidth) - GAP;
|
|
43203
|
+
var drawableBarHeight = Math.abs(barHeight) - GAP;
|
|
43167
43204
|
|
|
43168
43205
|
switch (align) {
|
|
43169
43206
|
case 'start':
|
|
43170
43207
|
{
|
|
43171
|
-
if (isHorizontal) {
|
|
43172
|
-
|
|
43173
|
-
|
|
43174
|
-
|
|
43175
|
-
|
|
43176
|
-
ctx.fillText(formattedTxt,
|
|
43208
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43209
|
+
var xPos = isNegativeValue ? minXPos - textWidth : minXPos;
|
|
43210
|
+
ctx.fillText(formattedTxt, xPos, centerYOnBar);
|
|
43211
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43212
|
+
var yPos = isNegativeValue ? barY + GAP : barY - GAP;
|
|
43213
|
+
ctx.fillText(formattedTxt, centerXOnBar, yPos);
|
|
43177
43214
|
}
|
|
43178
43215
|
|
|
43179
43216
|
break;
|
|
@@ -43181,12 +43218,10 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43181
43218
|
|
|
43182
43219
|
case 'center':
|
|
43183
43220
|
{
|
|
43184
|
-
if (isHorizontal) {
|
|
43185
|
-
|
|
43186
|
-
|
|
43187
|
-
|
|
43188
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43189
|
-
ctx.fillText(formattedTxt, centerX, centerY);
|
|
43221
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43222
|
+
ctx.fillText(formattedTxt, centerXOnBar, centerYOnBar);
|
|
43223
|
+
} else if (!isHorizontal && textHeight < drawableBarHeight) {
|
|
43224
|
+
ctx.fillText(formattedTxt, centerXOnBar, barY + barHeight / 2);
|
|
43190
43225
|
}
|
|
43191
43226
|
|
|
43192
43227
|
break;
|
|
@@ -43200,9 +43235,26 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43200
43235
|
}
|
|
43201
43236
|
|
|
43202
43237
|
if (isHorizontal) {
|
|
43203
|
-
|
|
43238
|
+
var minXOnChart = this.chartRect.x1 + this.labelOffset.left;
|
|
43239
|
+
var maxXOnChart = this.chartRect.x2 - this.labelOffset.right;
|
|
43240
|
+
|
|
43241
|
+
if (isNegativeValue) {
|
|
43242
|
+
var _xPos = barX - GAP + barWidth - textWidth;
|
|
43243
|
+
|
|
43244
|
+
if (_xPos > minXOnChart) {
|
|
43245
|
+
ctx.fillText(formattedTxt, _xPos, centerYOnBar);
|
|
43246
|
+
}
|
|
43247
|
+
} else {
|
|
43248
|
+
var _xPos2 = barX + GAP + barWidth;
|
|
43249
|
+
|
|
43250
|
+
if (_xPos2 + textWidth < maxXOnChart) {
|
|
43251
|
+
ctx.fillText(formattedTxt, _xPos2, centerYOnBar);
|
|
43252
|
+
}
|
|
43253
|
+
}
|
|
43204
43254
|
} else {
|
|
43205
|
-
|
|
43255
|
+
var _yPos = isNegativeValue ? barY + barHeight + GAP : barY + barHeight - GAP;
|
|
43256
|
+
|
|
43257
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos);
|
|
43206
43258
|
}
|
|
43207
43259
|
|
|
43208
43260
|
break;
|
|
@@ -43211,14 +43263,22 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43211
43263
|
default:
|
|
43212
43264
|
case 'end':
|
|
43213
43265
|
{
|
|
43214
|
-
if (isHorizontal) {
|
|
43215
|
-
|
|
43216
|
-
|
|
43217
|
-
|
|
43266
|
+
if (isHorizontal && textWidth < drawableBarWidth) {
|
|
43267
|
+
var _xPos3 = isNegativeValue ? barX + barWidth + GAP : barX + barWidth - textWidth - GAP;
|
|
43268
|
+
|
|
43269
|
+
ctx.fillText(formattedTxt, _xPos3, centerYOnBar);
|
|
43270
|
+
} else if (!isHorizontal) {
|
|
43271
|
+
if (isNegativeValue) {
|
|
43272
|
+
var _yPos2 = barY + barHeight - GAP;
|
|
43273
|
+
|
|
43274
|
+
if (_yPos2 > minYPos) {
|
|
43275
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos2);
|
|
43276
|
+
}
|
|
43277
|
+
} else if (textHeight < drawableBarHeight) {
|
|
43278
|
+
var _yPos3 = barY + barHeight + GAP;
|
|
43279
|
+
|
|
43280
|
+
ctx.fillText(formattedTxt, centerXOnBar, _yPos3);
|
|
43218
43281
|
}
|
|
43219
|
-
} else if (textHeight < heightFreeSpaceToDraw) {
|
|
43220
|
-
var yPos = y + h + textHeight;
|
|
43221
|
-
ctx.fillText(formattedTxt, centerX, yPos >= minYPos ? minYPos : yPos);
|
|
43222
43282
|
}
|
|
43223
43283
|
|
|
43224
43284
|
break;
|
|
@@ -43275,28 +43335,50 @@ var element_bar_Bar = /*#__PURE__*/function () {
|
|
|
43275
43335
|
ctx.beginPath();
|
|
43276
43336
|
ctx.moveTo(x, y);
|
|
43277
43337
|
|
|
43338
|
+
if (Math.abs(w) < r * 2) {
|
|
43339
|
+
r = Math.abs(w) / 2;
|
|
43340
|
+
}
|
|
43341
|
+
|
|
43342
|
+
if (Math.abs(h) < r * 2) {
|
|
43343
|
+
r = Math.abs(h) / 2;
|
|
43344
|
+
}
|
|
43345
|
+
|
|
43278
43346
|
if (isHorizontal) {
|
|
43279
|
-
|
|
43280
|
-
|
|
43347
|
+
var isNegativeValue = w < 0;
|
|
43348
|
+
|
|
43349
|
+
if (isNegativeValue) {
|
|
43350
|
+
w += r;
|
|
43351
|
+
ctx.lineTo(x + w, y);
|
|
43352
|
+
ctx.arcTo(x + w - r, y, x + w - r, y - r, r);
|
|
43353
|
+
ctx.arcTo(x + w - r, y - h, x + w, y - h, r);
|
|
43354
|
+
ctx.lineTo(x, y - h);
|
|
43355
|
+
ctx.lineTo(x, y);
|
|
43356
|
+
} else {
|
|
43357
|
+
w -= r;
|
|
43358
|
+
ctx.lineTo(x + w, y);
|
|
43359
|
+
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43360
|
+
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43361
|
+
ctx.lineTo(x, y - h);
|
|
43362
|
+
ctx.lineTo(x, y);
|
|
43281
43363
|
}
|
|
43282
|
-
|
|
43283
|
-
w -= r;
|
|
43284
|
-
ctx.lineTo(x + w, y);
|
|
43285
|
-
ctx.arcTo(x + w + r, y, x + w + r, y - r, r);
|
|
43286
|
-
ctx.arcTo(x + w + r, y - h, x + w, y - h, r);
|
|
43287
|
-
ctx.lineTo(x, y - h);
|
|
43288
|
-
ctx.lineTo(x, y);
|
|
43289
43364
|
} else {
|
|
43290
|
-
|
|
43291
|
-
|
|
43365
|
+
var _isNegativeValue = h > 0;
|
|
43366
|
+
|
|
43367
|
+
if (_isNegativeValue) {
|
|
43368
|
+
h -= r;
|
|
43369
|
+
ctx.lineTo(x + w, y);
|
|
43370
|
+
ctx.lineTo(x + w, y + h);
|
|
43371
|
+
ctx.arcTo(x + w, y + h + r, x - w + r, y + h + r, r);
|
|
43372
|
+
ctx.arcTo(x, y + h + r, x, y + h, r);
|
|
43373
|
+
ctx.lineTo(x, y);
|
|
43374
|
+
} else {
|
|
43375
|
+
h += r;
|
|
43376
|
+
ctx.lineTo(x + w, y);
|
|
43377
|
+
ctx.lineTo(x + w, y + h);
|
|
43378
|
+
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43379
|
+
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43380
|
+
ctx.lineTo(x, y);
|
|
43292
43381
|
}
|
|
43293
|
-
|
|
43294
|
-
h += r;
|
|
43295
|
-
ctx.lineTo(x + w, y);
|
|
43296
|
-
ctx.lineTo(x + w, y + h);
|
|
43297
|
-
ctx.arcTo(x + w, y + h - r, x + w - r, y + h - r, r);
|
|
43298
|
-
ctx.arcTo(x, y + h - r, x, y + h, r);
|
|
43299
|
-
ctx.lineTo(x, y);
|
|
43300
43382
|
}
|
|
43301
43383
|
|
|
43302
43384
|
ctx.fill();
|
|
@@ -45051,6 +45133,7 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45051
45133
|
}
|
|
45052
45134
|
/**
|
|
45053
45135
|
* With range information, calculate how many labels in axis
|
|
45136
|
+
* linear type은 scale.linear.js에서 처리
|
|
45054
45137
|
* @param {object} range min/max information
|
|
45055
45138
|
*
|
|
45056
45139
|
* @returns {object} steps, interval, min/max graph value
|
|
@@ -45259,6 +45342,14 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45259
45342
|
|
|
45260
45343
|
ctx.beginPath();
|
|
45261
45344
|
ticks[ix] = axisMinForLabel + ix * stepValue;
|
|
45345
|
+
var isZeroLine = ticks[ix] === 0;
|
|
45346
|
+
|
|
45347
|
+
if (isZeroLine && _this3.zeroLineColor) {
|
|
45348
|
+
ctx.strokeStyle = _this3.zeroLineColor;
|
|
45349
|
+
} else {
|
|
45350
|
+
ctx.strokeStyle = _this3.gridLineColor;
|
|
45351
|
+
}
|
|
45352
|
+
|
|
45262
45353
|
linePosition = labelCenter + aliasPixel;
|
|
45263
45354
|
labelText = _this3.getLabelFormat(Math.min(axisMax, ticks[ix]), {
|
|
45264
45355
|
prev: (_ticks = ticks[ix - 1]) !== null && _ticks !== void 0 ? _ticks : ''
|
|
@@ -45364,9 +45455,11 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45364
45455
|
}
|
|
45365
45456
|
|
|
45366
45457
|
var mergedPlotBandOpt = lodash_es_defaultsDeep({}, plotBand, PLOT_BAND_OPTION);
|
|
45367
|
-
var
|
|
45368
|
-
|
|
45458
|
+
var userDefinedFrom = mergedPlotBandOpt.from,
|
|
45459
|
+
userDefinedTo = mergedPlotBandOpt.to,
|
|
45369
45460
|
labelOpt = mergedPlotBandOpt.label;
|
|
45461
|
+
var from = userDefinedFrom ? Math.max(userDefinedFrom, axisMin) : axisMin;
|
|
45462
|
+
var to = userDefinedTo ? Math.min(userDefinedTo, axisMax) : axisMax;
|
|
45370
45463
|
|
|
45371
45464
|
_this3.setPlotBandStyle(mergedPlotBandOpt);
|
|
45372
45465
|
|
|
@@ -45374,8 +45467,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45374
45467
|
var toPos;
|
|
45375
45468
|
|
|
45376
45469
|
if (_this3.type === 'x') {
|
|
45377
|
-
fromPos = helpers_canvas.calculateX(from
|
|
45378
|
-
toPos = helpers_canvas.calculateX(to
|
|
45470
|
+
fromPos = helpers_canvas.calculateX(from, axisMin, axisMax, xArea, minX);
|
|
45471
|
+
toPos = helpers_canvas.calculateX(to, axisMin, axisMax, xArea, minX);
|
|
45379
45472
|
|
|
45380
45473
|
if (fromPos === null || toPos === null) {
|
|
45381
45474
|
return;
|
|
@@ -45383,8 +45476,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45383
45476
|
|
|
45384
45477
|
_this3.drawXPlotBand(fromPos, toPos, minX, maxX, minY, maxY);
|
|
45385
45478
|
} else {
|
|
45386
|
-
fromPos = helpers_canvas.calculateY(from
|
|
45387
|
-
toPos = helpers_canvas.calculateY(to
|
|
45479
|
+
fromPos = helpers_canvas.calculateY(from, axisMin, axisMax, yArea, maxY);
|
|
45480
|
+
toPos = helpers_canvas.calculateY(to, axisMin, axisMax, yArea, maxY);
|
|
45388
45481
|
|
|
45389
45482
|
if (fromPos === null || toPos === null) {
|
|
45390
45483
|
return;
|
|
@@ -45411,9 +45504,6 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45411
45504
|
var mergedPlotLineOpt = lodash_es_defaultsDeep({}, plotLine, PLOT_LINE_OPTION);
|
|
45412
45505
|
var value = mergedPlotLineOpt.value,
|
|
45413
45506
|
labelOpt = mergedPlotLineOpt.label;
|
|
45414
|
-
|
|
45415
|
-
_this3.setPlotLineStyle(mergedPlotLineOpt);
|
|
45416
|
-
|
|
45417
45507
|
var dataPos;
|
|
45418
45508
|
|
|
45419
45509
|
if (_this3.type === 'x') {
|
|
@@ -45423,6 +45513,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45423
45513
|
return;
|
|
45424
45514
|
}
|
|
45425
45515
|
|
|
45516
|
+
_this3.setPlotLineStyle(mergedPlotLineOpt);
|
|
45517
|
+
|
|
45426
45518
|
_this3.drawXPlotLine(dataPos, minX, maxX, minY, maxY);
|
|
45427
45519
|
} else {
|
|
45428
45520
|
dataPos = helpers_canvas.calculateY(value, axisMin, axisMax, yArea, maxY);
|
|
@@ -45431,6 +45523,8 @@ var scale_Scale = /*#__PURE__*/function () {
|
|
|
45431
45523
|
return;
|
|
45432
45524
|
}
|
|
45433
45525
|
|
|
45526
|
+
_this3.setPlotLineStyle(mergedPlotLineOpt);
|
|
45527
|
+
|
|
45434
45528
|
_this3.drawYPlotLine(dataPos, minX, maxX, minY, maxY);
|
|
45435
45529
|
}
|
|
45436
45530
|
|
|
@@ -45954,6 +46048,7 @@ var scale_time_TimeScale = /*#__PURE__*/function (_Scale) {
|
|
|
45954
46048
|
|
|
45955
46049
|
|
|
45956
46050
|
|
|
46051
|
+
|
|
45957
46052
|
var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
45958
46053
|
_inherits(LinearScale, _Scale);
|
|
45959
46054
|
|
|
@@ -45992,16 +46087,192 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
|
|
|
45992
46087
|
* Calculate interval
|
|
45993
46088
|
* @param {object} range range information
|
|
45994
46089
|
*
|
|
45995
|
-
* @returns {number}
|
|
46090
|
+
* @returns {number} interval (한 칸에 표시할 값의 간격)
|
|
45996
46091
|
*/
|
|
45997
46092
|
|
|
45998
46093
|
}, {
|
|
45999
46094
|
key: "getInterval",
|
|
46000
46095
|
value: function getInterval(range) {
|
|
46096
|
+
if (this.interval) return this.interval;
|
|
46001
46097
|
var max = range.maxValue;
|
|
46002
46098
|
var min = range.minValue;
|
|
46003
|
-
var
|
|
46004
|
-
|
|
46099
|
+
var steps = range.maxSteps; // step이 0이면 interval 계산 불가
|
|
46100
|
+
|
|
46101
|
+
if (!steps || steps <= 0) return 0; // startToZero이고, 최소값이 음수일 경우 0을 반드시 포함
|
|
46102
|
+
|
|
46103
|
+
if (this.startToZero && min < 0) {
|
|
46104
|
+
var totalRange = Math.abs(min) + Math.abs(max); // 비율로 나눔
|
|
46105
|
+
|
|
46106
|
+
var negativeRatio = Math.abs(min) / totalRange;
|
|
46107
|
+
var positiveRatio = Math.abs(max) / totalRange; // 각 방향에 최소 1칸 이상 배정되도록 보장
|
|
46108
|
+
|
|
46109
|
+
var negativeSteps = Math.max(1, Math.round(negativeRatio * steps));
|
|
46110
|
+
var positiveSteps = Math.max(1, steps - negativeSteps); // 다시 합이 steps보다 커질 수도 있으니, 조정
|
|
46111
|
+
|
|
46112
|
+
if (negativeSteps + positiveSteps > steps) {
|
|
46113
|
+
// 가장 큰 쪽에서 하나 줄임
|
|
46114
|
+
if (negativeRatio > positiveRatio) {
|
|
46115
|
+
negativeSteps -= 1;
|
|
46116
|
+
} else {
|
|
46117
|
+
positiveSteps -= 1;
|
|
46118
|
+
}
|
|
46119
|
+
}
|
|
46120
|
+
|
|
46121
|
+
return Math.ceil(Math.max(Math.abs(min) / (negativeSteps || 1), Math.abs(max) / (positiveSteps || 1)));
|
|
46122
|
+
}
|
|
46123
|
+
|
|
46124
|
+
return Math.ceil((max - min) / steps);
|
|
46125
|
+
}
|
|
46126
|
+
/**
|
|
46127
|
+
* With range information, calculate how many labels in axis
|
|
46128
|
+
* @param {object} range min/max information
|
|
46129
|
+
*
|
|
46130
|
+
* @returns {object} steps, interval, min/max graph value
|
|
46131
|
+
*/
|
|
46132
|
+
|
|
46133
|
+
}, {
|
|
46134
|
+
key: "calculateSteps",
|
|
46135
|
+
value: function calculateSteps(range) {
|
|
46136
|
+
var maxValue = range.maxValue,
|
|
46137
|
+
minValue = range.minValue;
|
|
46138
|
+
var _range$maxSteps = range.maxSteps,
|
|
46139
|
+
maxSteps = _range$maxSteps === void 0 ? 1 : _range$maxSteps;
|
|
46140
|
+
var interval = this.getInterval(range);
|
|
46141
|
+
var graphMin = 0;
|
|
46142
|
+
var graphMax = 0; // 그래프 최대/최소 값 계산
|
|
46143
|
+
|
|
46144
|
+
if (minValue >= 0) {
|
|
46145
|
+
// 전부 양수
|
|
46146
|
+
graphMin = +minValue;
|
|
46147
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46148
|
+
} else if (maxValue >= 0) {
|
|
46149
|
+
// 양수/음수 혼합
|
|
46150
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46151
|
+
graphMax = Math.ceil(maxValue / interval) * interval;
|
|
46152
|
+
} else {
|
|
46153
|
+
// 전부 음수
|
|
46154
|
+
graphMax = +maxValue;
|
|
46155
|
+
graphMin = Math.floor(minValue / interval) * interval;
|
|
46156
|
+
}
|
|
46157
|
+
|
|
46158
|
+
var graphRange = graphMax - graphMin;
|
|
46159
|
+
var numberOfSteps = Math.round(graphRange / interval); // 특수 케이스: 양수 최소값, 최대값이 1일 경우
|
|
46160
|
+
|
|
46161
|
+
if (minValue > 0 && maxValue === 1) {
|
|
46162
|
+
if (!this.decimalPoint) {
|
|
46163
|
+
interval = 1;
|
|
46164
|
+
numberOfSteps = 1;
|
|
46165
|
+
maxSteps = 1;
|
|
46166
|
+
} else if (maxSteps > 2) {
|
|
46167
|
+
interval = 0.2;
|
|
46168
|
+
numberOfSteps = 5;
|
|
46169
|
+
maxSteps = 5;
|
|
46170
|
+
} else {
|
|
46171
|
+
interval = 0.5;
|
|
46172
|
+
numberOfSteps = 2;
|
|
46173
|
+
maxSteps = 2;
|
|
46174
|
+
}
|
|
46175
|
+
} // 최대 스텝 수 조정
|
|
46176
|
+
|
|
46177
|
+
|
|
46178
|
+
while (numberOfSteps > maxSteps) {
|
|
46179
|
+
interval *= 2;
|
|
46180
|
+
numberOfSteps = Math.round(graphRange / interval);
|
|
46181
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46182
|
+
}
|
|
46183
|
+
|
|
46184
|
+
if (graphRange > numberOfSteps * interval) {
|
|
46185
|
+
interval = Math.ceil(graphRange / numberOfSteps);
|
|
46186
|
+
}
|
|
46187
|
+
|
|
46188
|
+
return {
|
|
46189
|
+
steps: numberOfSteps,
|
|
46190
|
+
interval: interval,
|
|
46191
|
+
graphMin: graphMin,
|
|
46192
|
+
graphMax: graphMax
|
|
46193
|
+
};
|
|
46194
|
+
}
|
|
46195
|
+
/**
|
|
46196
|
+
* Calculate min/max value, label and size information for axis
|
|
46197
|
+
* @param {object} minMax min/max information
|
|
46198
|
+
* @param {object} scrollbarOpt scrollbar option
|
|
46199
|
+
*
|
|
46200
|
+
* @returns {object} min/max value and label
|
|
46201
|
+
*/
|
|
46202
|
+
|
|
46203
|
+
}, {
|
|
46204
|
+
key: "calculateScaleRange",
|
|
46205
|
+
value: function calculateScaleRange(minMax, scrollbarOpt) {
|
|
46206
|
+
var _this$labelStyle;
|
|
46207
|
+
|
|
46208
|
+
var maxValue;
|
|
46209
|
+
var minValue;
|
|
46210
|
+
var isDefaultMaxSameAsMin = false;
|
|
46211
|
+
var range = scrollbarOpt !== null && scrollbarOpt !== void 0 && scrollbarOpt.use ? scrollbarOpt === null || scrollbarOpt === void 0 ? void 0 : scrollbarOpt.range : this.range;
|
|
46212
|
+
|
|
46213
|
+
if (Array.isArray(range) && (range === null || range === void 0 ? void 0 : range.length) === 2) {
|
|
46214
|
+
if (this.options.type === 'heatMap') {
|
|
46215
|
+
maxValue = range[1] > +minMax.max ? +minMax.max : range[1];
|
|
46216
|
+
minValue = range[0] < +minMax.min ? +minMax.min : range[0];
|
|
46217
|
+
} else {
|
|
46218
|
+
maxValue = range[1];
|
|
46219
|
+
minValue = range[0];
|
|
46220
|
+
}
|
|
46221
|
+
} else if (typeof range === 'function') {
|
|
46222
|
+
var _range = range(minMax.min, minMax.max);
|
|
46223
|
+
|
|
46224
|
+
var _range2 = _slicedToArray(_range, 2);
|
|
46225
|
+
|
|
46226
|
+
minValue = _range2[0];
|
|
46227
|
+
maxValue = _range2[1];
|
|
46228
|
+
} else {
|
|
46229
|
+
maxValue = minMax.max;
|
|
46230
|
+
minValue = minMax.min;
|
|
46231
|
+
} // autoScaleRatio 적용 케이스
|
|
46232
|
+
|
|
46233
|
+
|
|
46234
|
+
if (this.autoScaleRatio) {
|
|
46235
|
+
var temp = maxValue; // 양수 방향에만 autoScaleRatio 적용
|
|
46236
|
+
|
|
46237
|
+
maxValue = Math.ceil(maxValue * (this.autoScaleRatio + 1));
|
|
46238
|
+
|
|
46239
|
+
if (maxValue > 0 && minValue < 0) {
|
|
46240
|
+
// 양수/음수 혼합 케이스 -- 음수 방향에도 maxValue 증가분만큼 더하기
|
|
46241
|
+
var diff = temp - maxValue;
|
|
46242
|
+
minValue += diff;
|
|
46243
|
+
} else if (maxValue < 0 && minValue < 0) {
|
|
46244
|
+
// 전부 음수 케이스 -- 음수 방향에도 autoScaleRatio 적용
|
|
46245
|
+
minValue = Math.ceil(minValue * (this.autoScaleRatio + 1));
|
|
46246
|
+
}
|
|
46247
|
+
} // 0 기준 축 설정 케이스
|
|
46248
|
+
|
|
46249
|
+
|
|
46250
|
+
if (this.startToZero) {
|
|
46251
|
+
if (minValue > 0) {
|
|
46252
|
+
minValue = 0;
|
|
46253
|
+
}
|
|
46254
|
+
|
|
46255
|
+
if (maxValue < 0) {
|
|
46256
|
+
maxValue = 0;
|
|
46257
|
+
}
|
|
46258
|
+
}
|
|
46259
|
+
|
|
46260
|
+
if (maxValue === minValue) {
|
|
46261
|
+
maxValue += 1;
|
|
46262
|
+
isDefaultMaxSameAsMin = true;
|
|
46263
|
+
}
|
|
46264
|
+
|
|
46265
|
+
var minLabel = this.getLabelFormat(minValue);
|
|
46266
|
+
var maxLabel = this.getLabelFormat(maxValue, {
|
|
46267
|
+
isMaxValueSameAsMin: isDefaultMaxSameAsMin
|
|
46268
|
+
});
|
|
46269
|
+
return {
|
|
46270
|
+
min: minValue,
|
|
46271
|
+
max: maxValue,
|
|
46272
|
+
minLabel: minLabel,
|
|
46273
|
+
maxLabel: maxLabel,
|
|
46274
|
+
size: helpers_util.calcTextSize(maxLabel, helpers_util.getLabelStyle(this.labelStyle), (_this$labelStyle = this.labelStyle) === null || _this$labelStyle === void 0 ? void 0 : _this$labelStyle.padding)
|
|
46275
|
+
};
|
|
46005
46276
|
}
|
|
46006
46277
|
}]);
|
|
46007
46278
|
|
|
@@ -47223,7 +47494,7 @@ var plugins_legend_modules = {
|
|
|
47223
47494
|
var useLegendSeries = [];
|
|
47224
47495
|
|
|
47225
47496
|
if (groups) {
|
|
47226
|
-
useLegendSeries = groups.
|
|
47497
|
+
useLegendSeries = groups.filter(function (sId) {
|
|
47227
47498
|
return _this3.seriesList[sId].showLegend;
|
|
47228
47499
|
}).map(function (sId) {
|
|
47229
47500
|
return [sId, _this3.seriesList[sId]];
|
|
@@ -47274,9 +47545,8 @@ var plugins_legend_modules = {
|
|
|
47274
47545
|
},
|
|
47275
47546
|
|
|
47276
47547
|
/**
|
|
47277
|
-
* Adds legends for each group in `groups` array, iterating through each series
|
|
47278
|
-
*
|
|
47279
|
-
* order as displayed in the chart. Only adds series with `showLegend` set to `true`.
|
|
47548
|
+
* Adds legends for each group in `groups` array, iterating through each series within the group.
|
|
47549
|
+
* Only adds series with `showLegend` set to `true`.
|
|
47280
47550
|
*
|
|
47281
47551
|
* @param {Array} groups - Array of groups containing series identifiers.
|
|
47282
47552
|
* @param {Object} seriesList - Object containing all series, keyed by series ID.
|
|
@@ -47287,7 +47557,7 @@ var plugins_legend_modules = {
|
|
|
47287
47557
|
var _this5 = this;
|
|
47288
47558
|
|
|
47289
47559
|
groups.forEach(function (group) {
|
|
47290
|
-
group.
|
|
47560
|
+
group.forEach(function (sId) {
|
|
47291
47561
|
var series = seriesList[sId];
|
|
47292
47562
|
|
|
47293
47563
|
if (series && series.showLegend) {
|
|
@@ -53305,7 +53575,6 @@ var plugins_pie_modules = {
|
|
|
53305
53575
|
|
|
53306
53576
|
|
|
53307
53577
|
|
|
53308
|
-
|
|
53309
53578
|
var element_tip_modules = {
|
|
53310
53579
|
/**
|
|
53311
53580
|
* Draw TextTip with tip's locationInfo
|
|
@@ -53339,8 +53608,7 @@ var element_tip_modules = {
|
|
|
53339
53608
|
}
|
|
53340
53609
|
|
|
53341
53610
|
if (labelTipOpt.use && labelTipOpt.showTip) {
|
|
53342
|
-
|
|
53343
|
-
isExistSelectedLabel = isHeatMap ? this.drawLabelTipForHeatMap() : this.drawLabelTip();
|
|
53611
|
+
isExistSelectedLabel = opt.type === 'heatMap' ? this.drawLabelTipForHeatMap() : this.drawTipForSelectedLabel();
|
|
53344
53612
|
}
|
|
53345
53613
|
|
|
53346
53614
|
var executeDrawIndicator = function executeDrawIndicator(tipOpt) {
|
|
@@ -53626,9 +53894,10 @@ var element_tip_modules = {
|
|
|
53626
53894
|
|
|
53627
53895
|
/**
|
|
53628
53896
|
* Draw Selected Label Tip
|
|
53897
|
+
* none Text
|
|
53629
53898
|
* @returns {boolean} Whether drew at least one tip
|
|
53630
53899
|
*/
|
|
53631
|
-
|
|
53900
|
+
drawTipForSelectedLabel: function drawTipForSelectedLabel() {
|
|
53632
53901
|
var _this2 = this;
|
|
53633
53902
|
|
|
53634
53903
|
var opt = this.options;
|
|
@@ -53654,7 +53923,7 @@ var element_tip_modules = {
|
|
|
53654
53923
|
};
|
|
53655
53924
|
var labelAxes = isHorizontal ? this.axesY[0] : this.axesX[0];
|
|
53656
53925
|
var valueAxes = isHorizontal ? this.axesX[0] : this.axesY[0];
|
|
53657
|
-
var
|
|
53926
|
+
var valueAxesSteps = isHorizontal ? this.axesSteps.x[0] : this.axesSteps.y[0];
|
|
53658
53927
|
var valuePositionCalcFunction = isHorizontal ? helpers_canvas.calculateX : helpers_canvas.calculateY;
|
|
53659
53928
|
var labelPositionCalcFunction = isHorizontal ? helpers_canvas.calculateY : helpers_canvas.calculateX;
|
|
53660
53929
|
var scrollbarOpt = isHorizontal ? this.scrollbar.y : this.scrollbar.x;
|
|
@@ -53672,8 +53941,8 @@ var element_tip_modules = {
|
|
|
53672
53941
|
return _this2.seriesList[sId].isExistGrp && !_this2.seriesList[sId].isOverlapping;
|
|
53673
53942
|
});
|
|
53674
53943
|
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$ : [];
|
|
53675
|
-
var
|
|
53676
|
-
var
|
|
53944
|
+
var labelPos;
|
|
53945
|
+
var dataPos;
|
|
53677
53946
|
var value;
|
|
53678
53947
|
var labelStartPoint;
|
|
53679
53948
|
var labelEndPoint;
|
|
@@ -53721,31 +53990,39 @@ var element_tip_modules = {
|
|
|
53721
53990
|
}
|
|
53722
53991
|
|
|
53723
53992
|
data.forEach(function (selectedData, i) {
|
|
53724
|
-
|
|
53725
|
-
|
|
53726
|
-
|
|
53727
|
-
|
|
53728
|
-
var
|
|
53729
|
-
|
|
53730
|
-
|
|
53731
|
-
|
|
53732
|
-
|
|
53733
|
-
|
|
53734
|
-
|
|
53735
|
-
var
|
|
53736
|
-
|
|
53737
|
-
|
|
53738
|
-
|
|
53739
|
-
|
|
53740
|
-
|
|
53741
|
-
|
|
53742
|
-
var
|
|
53743
|
-
|
|
53744
|
-
|
|
53745
|
-
|
|
53746
|
-
|
|
53747
|
-
|
|
53748
|
-
|
|
53993
|
+
value = valueAxesSteps.graphMax;
|
|
53994
|
+
|
|
53995
|
+
if (!labelTipOpt.fixedPosTop) {
|
|
53996
|
+
if (isExistGrp) {
|
|
53997
|
+
var _visibleSeries$filter, _visibleSeries$filter2;
|
|
53998
|
+
|
|
53999
|
+
var positiveSum = visibleSeries === null || visibleSeries === void 0 ? void 0 : visibleSeries.reduce(function (ac, sId) {
|
|
54000
|
+
var _selectedData$sId$val, _selectedData$sId, _selectedData$sId$val2, _selectedData$sId2;
|
|
54001
|
+
|
|
54002
|
+
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;
|
|
54003
|
+
}, 0);
|
|
54004
|
+
var nonGroupValues = (_visibleSeries$filter = visibleSeries === null || visibleSeries === void 0 ? void 0 : (_visibleSeries$filter2 = visibleSeries.filter(function (sId) {
|
|
54005
|
+
return !groups.includes(sId);
|
|
54006
|
+
})) === null || _visibleSeries$filter2 === void 0 ? void 0 : _visibleSeries$filter2.map(function (sId) {
|
|
54007
|
+
var _selectedData$sId$val3, _selectedData$sId3;
|
|
54008
|
+
|
|
54009
|
+
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];
|
|
54010
|
+
})) !== null && _visibleSeries$filter !== void 0 ? _visibleSeries$filter : [];
|
|
54011
|
+
var maxNonGroupValue = (nonGroupValues === null || nonGroupValues === void 0 ? void 0 : nonGroupValues.length) > 0 ? nonGroupValues.reduce(function (max, val) {
|
|
54012
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54013
|
+
}, -Infinity) : -Infinity;
|
|
54014
|
+
value = positiveSum > 0 ? Math.max(maxNonGroupValue, positiveSum) : Math.max(maxNonGroupValue, 0);
|
|
54015
|
+
} else if (visibleSeries.length) {
|
|
54016
|
+
var visibleValue = visibleSeries.map(function (sId) {
|
|
54017
|
+
var _selectedData$sId$val4, _selectedData$sId4;
|
|
54018
|
+
|
|
54019
|
+
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];
|
|
54020
|
+
});
|
|
54021
|
+
var maxValue = visibleValue.length > 0 ? visibleValue.reduce(function (max, val) {
|
|
54022
|
+
return Math.max(max, val !== null && val !== void 0 ? val : -Infinity);
|
|
54023
|
+
}, -Infinity) : -Infinity;
|
|
54024
|
+
value = maxValue > 0 || _this2.options.type !== 'bar' ? maxValue : 0;
|
|
54025
|
+
}
|
|
53749
54026
|
}
|
|
53750
54027
|
|
|
53751
54028
|
if (labelAxes.labels) {
|
|
@@ -53755,18 +54032,17 @@ var element_tip_modules = {
|
|
|
53755
54032
|
|
|
53756
54033
|
var labelIndex = dataIndex[i] - startIndex;
|
|
53757
54034
|
var labelCenter = Math.round(labelStartPoint + labelGap * labelIndex);
|
|
53758
|
-
|
|
54035
|
+
labelPos = labelCenter + labelGap / 2;
|
|
53759
54036
|
} else {
|
|
53760
|
-
|
|
54037
|
+
labelPos = labelPositionCalcFunction(label[i], graphX.graphMin, graphX.graphMax, chartWidth - sizeObj.comboOffset, aPos.x1 + sizeObj.comboOffset / 2);
|
|
53761
54038
|
}
|
|
53762
54039
|
|
|
53763
|
-
|
|
53764
|
-
gp += offset;
|
|
54040
|
+
dataPos = valuePositionCalcFunction(value, valueAxesSteps.graphMin, valueAxesSteps.graphMax, valueSpace, valueStartPoint) + offset;
|
|
53765
54041
|
|
|
53766
54042
|
_this2.showTip({
|
|
53767
54043
|
context: _this2.bufferCtx,
|
|
53768
|
-
x: isHorizontal ?
|
|
53769
|
-
y: isHorizontal ?
|
|
54044
|
+
x: isHorizontal ? dataPos : labelPos,
|
|
54045
|
+
y: isHorizontal ? labelPos : dataPos,
|
|
53770
54046
|
opt: labelTipOpt,
|
|
53771
54047
|
isSamePos: false
|
|
53772
54048
|
});
|
|
@@ -53878,10 +54154,11 @@ var element_tip_modules = {
|
|
|
53878
54154
|
}
|
|
53879
54155
|
} else if (isHorizontal) {
|
|
53880
54156
|
gp = helpers_canvas.calculateX(value, graphX.graphMin, graphX.graphMax, xArea, xsp);
|
|
53881
|
-
gp
|
|
54157
|
+
gp = value < 0 ? gp - offset : gp + offset;
|
|
53882
54158
|
} else {
|
|
53883
|
-
|
|
53884
|
-
gp
|
|
54159
|
+
var adjustedValue = type === 'bar' && value < 0 ? 0 : value;
|
|
54160
|
+
gp = helpers_canvas.calculateY(adjustedValue, graphY.graphMin, graphY.graphMax, yArea, ysp);
|
|
54161
|
+
gp = adjustedValue < 0 ? gp + offset : gp - offset;
|
|
53885
54162
|
}
|
|
53886
54163
|
|
|
53887
54164
|
var maxTipType = 'center';
|
|
@@ -53913,7 +54190,8 @@ var element_tip_modules = {
|
|
|
53913
54190
|
arrowSize: arrowSize,
|
|
53914
54191
|
borderRadius: borderRadius,
|
|
53915
54192
|
text: text,
|
|
53916
|
-
textStyle: textStyle
|
|
54193
|
+
textStyle: textStyle,
|
|
54194
|
+
isNegative: value < 0
|
|
53917
54195
|
});
|
|
53918
54196
|
}
|
|
53919
54197
|
|
|
@@ -53947,12 +54225,21 @@ var element_tip_modules = {
|
|
|
53947
54225
|
borderRadius = param.borderRadius,
|
|
53948
54226
|
text = param.text,
|
|
53949
54227
|
opt = param.opt,
|
|
53950
|
-
textStyle = param.textStyle
|
|
54228
|
+
textStyle = param.textStyle,
|
|
54229
|
+
isNegative = param.isNegative;
|
|
53951
54230
|
var ctx = param.context;
|
|
53952
54231
|
var sx = x - width / 2;
|
|
53953
54232
|
var ex = x + width / 2;
|
|
53954
54233
|
var sy = y - height;
|
|
53955
54234
|
var ey = y;
|
|
54235
|
+
|
|
54236
|
+
if (isNegative) {
|
|
54237
|
+
if (isHorizontal) {
|
|
54238
|
+
sx = x - width / 2 - width;
|
|
54239
|
+
ex = x - width / 2;
|
|
54240
|
+
}
|
|
54241
|
+
}
|
|
54242
|
+
|
|
53956
54243
|
ctx.save();
|
|
53957
54244
|
ctx.font = textStyle;
|
|
53958
54245
|
ctx.fillStyle = (_opt$tipBackground = opt.tipBackground) !== null && _opt$tipBackground !== void 0 ? _opt$tipBackground : opt.tipStyle.background;
|
|
@@ -53960,44 +54247,73 @@ var element_tip_modules = {
|
|
|
53960
54247
|
ctx.beginPath();
|
|
53961
54248
|
ctx.moveTo(sx + borderRadius, sy);
|
|
53962
54249
|
ctx.quadraticCurveTo(sx, sy, sx, sy + borderRadius);
|
|
53963
|
-
|
|
53964
|
-
if (isHorizontal) {
|
|
53965
|
-
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
53966
|
-
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
53967
|
-
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
53968
|
-
}
|
|
53969
|
-
|
|
53970
54250
|
ctx.lineTo(sx, ey - borderRadius);
|
|
53971
54251
|
ctx.quadraticCurveTo(sx, ey, sx + borderRadius, ey);
|
|
53972
|
-
|
|
53973
|
-
if (!isHorizontal) {
|
|
53974
|
-
if (type === 'left') {
|
|
53975
|
-
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
53976
|
-
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
53977
|
-
} else if (type === 'right') {
|
|
53978
|
-
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
53979
|
-
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
53980
|
-
} else {
|
|
53981
|
-
ctx.lineTo(x - arrowSize, ey);
|
|
53982
|
-
ctx.lineTo(x, ey + arrowSize);
|
|
53983
|
-
ctx.lineTo(x + arrowSize, ey);
|
|
53984
|
-
}
|
|
53985
|
-
}
|
|
53986
|
-
|
|
53987
54252
|
ctx.lineTo(ex - borderRadius, ey);
|
|
53988
54253
|
ctx.quadraticCurveTo(ex, ey, ex, ey - borderRadius);
|
|
53989
54254
|
ctx.lineTo(ex, sy + borderRadius);
|
|
53990
54255
|
ctx.quadraticCurveTo(ex, sy, ex - borderRadius, sy);
|
|
53991
54256
|
ctx.lineTo(sx + borderRadius, sy);
|
|
53992
54257
|
ctx.closePath();
|
|
53993
|
-
ctx.fill();
|
|
54258
|
+
ctx.fill(); // draw arrow
|
|
54259
|
+
|
|
54260
|
+
ctx.beginPath();
|
|
54261
|
+
|
|
54262
|
+
if (isHorizontal) {
|
|
54263
|
+
if (isNegative) {
|
|
54264
|
+
ctx.moveTo(ex, ey);
|
|
54265
|
+
ctx.lineTo(ex, sy + borderRadius + arrowSize / 2);
|
|
54266
|
+
ctx.lineTo(ex + arrowSize, ey - height / 2);
|
|
54267
|
+
ctx.lineTo(ex, ey - borderRadius - arrowSize / 2);
|
|
54268
|
+
} else {
|
|
54269
|
+
ctx.moveTo(sx, sy);
|
|
54270
|
+
ctx.lineTo(sx, sy + borderRadius + arrowSize / 2);
|
|
54271
|
+
ctx.lineTo(sx - arrowSize, ey - height / 2);
|
|
54272
|
+
ctx.lineTo(sx, ey - borderRadius - arrowSize / 2);
|
|
54273
|
+
}
|
|
54274
|
+
|
|
54275
|
+
ctx.closePath();
|
|
54276
|
+
ctx.fill();
|
|
54277
|
+
} else {
|
|
54278
|
+
if (isNegative) {
|
|
54279
|
+
if (type === 'left') {
|
|
54280
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54281
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54282
|
+
} else if (type === 'right') {
|
|
54283
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54284
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54285
|
+
} else {
|
|
54286
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54287
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54288
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54289
|
+
}
|
|
54290
|
+
} else if (!isNegative) {
|
|
54291
|
+
if (type === 'left') {
|
|
54292
|
+
ctx.moveTo(sx, sy);
|
|
54293
|
+
ctx.lineTo(sx + borderRadius + arrowSize, ey + arrowSize);
|
|
54294
|
+
ctx.lineTo(sx + borderRadius + arrowSize * 2, ey);
|
|
54295
|
+
} else if (type === 'right') {
|
|
54296
|
+
ctx.moveTo(ex, sy);
|
|
54297
|
+
ctx.lineTo(ex - arrowSize * 2 - borderRadius, ey);
|
|
54298
|
+
ctx.lineTo(ex - arrowSize - borderRadius, ey + arrowSize);
|
|
54299
|
+
} else {
|
|
54300
|
+
ctx.lineTo(x - arrowSize, ey);
|
|
54301
|
+
ctx.lineTo(x, ey + arrowSize);
|
|
54302
|
+
ctx.lineTo(x + arrowSize, ey);
|
|
54303
|
+
}
|
|
54304
|
+
}
|
|
54305
|
+
|
|
54306
|
+
ctx.closePath();
|
|
54307
|
+
ctx.fill();
|
|
54308
|
+
}
|
|
54309
|
+
|
|
53994
54310
|
ctx.restore();
|
|
53995
54311
|
ctx.save();
|
|
53996
54312
|
ctx.font = textStyle;
|
|
53997
54313
|
ctx.fillStyle = (_opt$tipTextColor = opt.tipTextColor) !== null && _opt$tipTextColor !== void 0 ? _opt$tipTextColor : opt.tipStyle.textColor;
|
|
53998
54314
|
ctx.textBaseline = 'middle';
|
|
53999
54315
|
ctx.textAlign = 'center';
|
|
54000
|
-
ctx.fillText("".concat(text),
|
|
54316
|
+
ctx.fillText("".concat(text), sx + width / 2, sy + height / 2);
|
|
54001
54317
|
ctx.restore();
|
|
54002
54318
|
},
|
|
54003
54319
|
|