evui 3.4.113 → 3.4.114

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.umd.js CHANGED
@@ -11173,7 +11173,7 @@ module.exports = exports;
11173
11173
  /***/ "9224":
11174
11174
  /***/ (function(module) {
11175
11175
 
11176
- module.exports = JSON.parse("{\"a\":\"3.4.113\"}");
11176
+ module.exports = JSON.parse("{\"a\":\"3.4.114\"}");
11177
11177
 
11178
11178
  /***/ }),
11179
11179
 
@@ -38829,9 +38829,9 @@ var modules = {
38829
38829
 
38830
38830
  if (series && sData) {
38831
38831
  if (series.isExistGrp && series.stackIndex && !series.isOverlapping) {
38832
- series.data = _this.addSeriesStackDS(sData, label, series.bsIds, series.stackIndex, series.interpolation);
38832
+ series.data = _this.addSeriesStackDS(sData, label, series.bsIds, series.stackIndex);
38833
38833
  } else {
38834
- series.data = _this.addSeriesDS(sData, label, series.isExistGrp, series.interpolation);
38834
+ series.data = _this.addSeriesDS(sData, label, series.isExistGrp);
38835
38835
  }
38836
38836
 
38837
38837
  series.minMax = _this.getSeriesMinMax(series.data);
@@ -39218,17 +39218,13 @@ var modules = {
39218
39218
  * @param {object} label chart label
39219
39219
  * @param {array} bsIds stacked base data ID List
39220
39220
  * @param {number} sIdx series ordered index
39221
- * @param {import('./index').InterpolationType} interpolation interpolation type
39222
39221
  *
39223
- * @typedef {import('./index').ChartSeriesDataPoint} ChartSeriesDataPoint
39224
- *
39225
- * @returns {ChartSeriesDataPoint[]} data for each series
39222
+ * @returns {array} data for each series
39226
39223
  */
39227
39224
  addSeriesStackDS: function addSeriesStackDS(data, label, bsIds) {
39228
39225
  var _this4 = this;
39229
39226
 
39230
39227
  var sIdx = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
39231
- var interpolation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'none';
39232
39228
  var isHorizontal = this.options.horizontal;
39233
39229
  var sdata = [];
39234
39230
 
@@ -39275,14 +39271,15 @@ var modules = {
39275
39271
  if (oData != null) {
39276
39272
  gdata = bdata + oData;
39277
39273
  } else {
39278
- gdata = odata;
39274
+ gdata = null;
39275
+ bdata = 0;
39279
39276
  }
39280
39277
  } else {
39281
39278
  bdata = 0;
39282
39279
  gdata = oData;
39283
39280
  }
39284
39281
 
39285
- sdata.push(_this4.addData(gdata, ldata, odata, bdata, interpolation));
39282
+ sdata.push(_this4.addData(gdata, ldata, odata, bdata));
39286
39283
  }
39287
39284
  });
39288
39285
  return sdata;
@@ -39293,17 +39290,13 @@ var modules = {
39293
39290
  * @param {object} data chart series info
39294
39291
  * @param {object} label chart label
39295
39292
  * @param {boolean} isBase is Base(bottommost) series at stack chart
39296
- * @param {import('./index').InterpolationType} interpolation interpolation type
39297
- *
39298
- * @typedef {import('./index').ChartSeriesDataPoint} ChartSeriesDataPoint
39299
39293
  *
39300
- * @returns {ChartSeriesDataPoint[]} data for each series
39294
+ * @returns {array} data for each series
39301
39295
  */
39302
39296
  addSeriesDS: function addSeriesDS(data, label, isBase) {
39303
39297
  var _this$seriesList$Obje,
39304
39298
  _this5 = this;
39305
39299
 
39306
- var interpolation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'none';
39307
39300
  var isHorizontal = this.options.horizontal;
39308
39301
  var sdata = [];
39309
39302
  var passingValue = (_this$seriesList$Obje = this.seriesList[Object.keys(this.seriesList)[0]]) === null || _this$seriesList$Obje === void 0 ? void 0 : _this$seriesList$Obje.passingValue;
@@ -39318,7 +39311,7 @@ var modules = {
39318
39311
 
39319
39312
  if (ldata !== null) {
39320
39313
  var isPassingValueWithStack = isBase && !helpers_util.isNullOrUndefined(passingValue) && gdata === passingValue;
39321
- sdata.push(_this5.addData(isPassingValueWithStack ? 0 : gdata, ldata, gdata, null, interpolation));
39314
+ sdata.push(_this5.addData(isPassingValueWithStack ? 0 : gdata, ldata, gdata));
39322
39315
  }
39323
39316
  });
39324
39317
  return sdata;
@@ -39375,18 +39368,13 @@ var modules = {
39375
39368
  * @param {object} ldata label data (x-axis value for vertical chart)
39376
39369
  * @param {object} odata original data (without stacked value)
39377
39370
  * @param {object} bdata base data (stacked value)
39378
- * @param {import('./index').InterpolationType} interpolation interpolation type
39379
- *
39380
- * @typedef {import('./index').ChartSeriesDataPoint} ChartSeriesDataPoint
39381
- *
39382
- * @returns {ChartSeriesDataPoint} data for each graph point
39371
+ * @returns {object} data for each graph point
39383
39372
  */
39384
39373
  addData: function addData(gdata, ldata) {
39385
39374
  var _gdataColor;
39386
39375
 
39387
39376
  var odata = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
39388
39377
  var bdata = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
39389
- var interpolation = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'none';
39390
39378
  var data;
39391
39379
  var gdataValue = null;
39392
39380
  var odataValue = null;
@@ -39399,7 +39387,7 @@ var modules = {
39399
39387
  gdataColor = gdata.color;
39400
39388
  dataTextColor = gdata.textColor;
39401
39389
  } else {
39402
- gdataValue = interpolation === 'zero' && !gdata ? bdata !== null && bdata !== void 0 ? bdata : 0 : gdata !== null && gdata !== void 0 ? gdata : null;
39390
+ gdataValue = gdata !== null && gdata !== void 0 ? gdata : null;
39403
39391
  }
39404
39392
 
39405
39393
  if (odata !== null && _typeof(odata) === 'object') {
@@ -39956,18 +39944,12 @@ var modules = {
39956
39944
  return result;
39957
39945
  },
39958
39946
 
39959
- /**
39960
- * @typedef {Object} LabelInfoResult
39961
- * @property {number} labelIndex - 선택된 라벨의 인덱스
39962
- * @property {object} hitInfo - 해당 위치에서의 히트 정보 (getItemByPosition 반환값)
39963
- */
39964
-
39965
39947
  /**
39966
39948
  * Find label info by position x and y
39967
39949
  * @param {array} offset position x and y
39968
39950
  * @param {string | null} targetAxis target Axis Location ('xAxis', 'yAxis' , null)
39969
39951
  *
39970
- * @returns {LabelInfoResult} clicked label information
39952
+ * @returns {object} clicked label information
39971
39953
  */
39972
39954
  getLabelInfoByPosition: function getLabelInfoByPosition(offset, targetAxis) {
39973
39955
  var _Object$values$sort$, _Object$values$sort$2, _scrollbarOpt, _scale, _scale$labels, _scale3, _scale3$labels;
@@ -40074,14 +40056,11 @@ var modules = {
40074
40056
 
40075
40057
  /**
40076
40058
  * Get current mouse target label value in label array or calculated using mouse position
40077
- *
40078
- * @typedef {import('./index').MouseLabelValue} MouseLabelValue
40079
- *
40080
40059
  * @param {string} targetAxis target Axis Location ('xAxis', 'yAxis')
40081
40060
  * @param {array} offset return value from getMousePosition()
40082
40061
  * @param {number} labelIndex
40083
40062
  *
40084
- * @returns {MouseLabelValue} current mouse target label value
40063
+ * @returns {object} current mouse target label value
40085
40064
  */
40086
40065
  getCurMouseLabelVal: function getCurMouseLabelVal(targetAxis, offset, labelIndex) {
40087
40066
  var _this9 = this;
@@ -41111,57 +41090,6 @@ var defaultsDeep = _baseRest(function(args) {
41111
41090
 
41112
41091
  /* harmony default export */ var lodash_es_defaultsDeep = (defaultsDeep);
41113
41092
 
41114
- // CONCATENATED MODULE: ./node_modules/lodash-es/isUndefined.js
41115
- /**
41116
- * Checks if `value` is `undefined`.
41117
- *
41118
- * @static
41119
- * @since 0.1.0
41120
- * @memberOf _
41121
- * @category Lang
41122
- * @param {*} value The value to check.
41123
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
41124
- * @example
41125
- *
41126
- * _.isUndefined(void 0);
41127
- * // => true
41128
- *
41129
- * _.isUndefined(null);
41130
- * // => false
41131
- */
41132
- function isUndefined(value) {
41133
- return value === undefined;
41134
- }
41135
-
41136
- /* harmony default export */ var lodash_es_isUndefined = (isUndefined);
41137
-
41138
- // CONCATENATED MODULE: ./node_modules/lodash-es/isNil.js
41139
- /**
41140
- * Checks if `value` is `null` or `undefined`.
41141
- *
41142
- * @static
41143
- * @memberOf _
41144
- * @since 4.0.0
41145
- * @category Lang
41146
- * @param {*} value The value to check.
41147
- * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
41148
- * @example
41149
- *
41150
- * _.isNil(null);
41151
- * // => true
41152
- *
41153
- * _.isNil(void 0);
41154
- * // => true
41155
- *
41156
- * _.isNil(NaN);
41157
- * // => false
41158
- */
41159
- function isNil(value) {
41160
- return value == null;
41161
- }
41162
-
41163
- /* harmony default export */ var lodash_es_isNil = (isNil);
41164
-
41165
41093
  // CONCATENATED MODULE: ./src/components/chart/helpers/helpers.constant.js
41166
41094
  var AXIS_UNITS = {
41167
41095
  x: {
@@ -41209,8 +41137,7 @@ var LINE_OPTION = {
41209
41137
  fill: false,
41210
41138
  fillOpacity: 0.4,
41211
41139
  showLegend: true,
41212
- passingValue: null,
41213
- interpolation: 'none'
41140
+ passingValue: null
41214
41141
  };
41215
41142
  var BAR_OPTION = {
41216
41143
  show: true,
@@ -41397,13 +41324,13 @@ var TIME_INTERVALS = {
41397
41324
  /* harmony default export */ var helpers_canvas = ({
41398
41325
  /**
41399
41326
  * Calculate X position
41400
- * @param {number|null|undefined} value graph value
41327
+ * @param {any} value graph value
41401
41328
  * @param {number} min min value
41402
41329
  * @param {number} max max value
41403
41330
  * @param {number} area height for axis
41404
41331
  * @param {number} startPoint startPoint
41405
41332
  *
41406
- * @returns {number|null} position
41333
+ * @returns {any} position
41407
41334
  */
41408
41335
  calculateX: function calculateX(value, min, max, area) {
41409
41336
  var startPoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
@@ -41443,13 +41370,13 @@ var TIME_INTERVALS = {
41443
41370
 
41444
41371
  /**
41445
41372
  * Calculate Y position
41446
- * @param {number|null|undefined} value graph value
41373
+ * @param {any} value graph value
41447
41374
  * @param {number} min min value
41448
41375
  * @param {number} max max value
41449
41376
  * @param {number} area height for axis
41450
41377
  * @param {number} startPoint startPoint
41451
41378
  *
41452
- * @returns {number|null} position
41379
+ * @returns {any} position
41453
41380
  */
41454
41381
  calculateY: function calculateY(value, min, max, area) {
41455
41382
  var startPoint = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
@@ -41697,6 +41624,7 @@ var TIME_INTERVALS = {
41697
41624
 
41698
41625
 
41699
41626
 
41627
+
41700
41628
  var element_line_Line = /*#__PURE__*/function () {
41701
41629
  function Line(sId, opt, sIdx) {
41702
41630
  var _this = this;
@@ -41733,8 +41661,6 @@ var element_line_Line = /*#__PURE__*/function () {
41733
41661
  lineWidth: 2
41734
41662
  }
41735
41663
  };
41736
- /** @type {import('../model/index').ChartSeriesDataPoint[]} */
41737
-
41738
41664
  this.data = [];
41739
41665
  this.beforeMouseXp = 0;
41740
41666
  this.beforeMouseYp = 0;
@@ -41742,23 +41668,11 @@ var element_line_Line = /*#__PURE__*/function () {
41742
41668
  this.size = {
41743
41669
  comboOffset: 0
41744
41670
  };
41745
- this.usePassingValue = !lodash_es_isUndefined(this.passingValue) && this.interpolation === 'linear';
41671
+ this.usePassingValue = !!this.passingValue;
41746
41672
  }
41747
- /**
41748
- * @typedef {Object} LineDrawParam
41749
- * @property {CanvasRenderingContext2D} ctx - 캔버스 렌더링 컨텍스트
41750
- * @property {object} chartRect - 차트 영역 정보
41751
- * @property {object} labelOffset - 라벨 오프셋 정보
41752
- * @property {object} axesSteps - 축 스텝 정보
41753
- * @property {object} [selectLabel] - 선택된 라벨 정보
41754
- * @property {object} [selectSeries] - 선택된 시리즈 정보
41755
- * @property {object} [legendHitInfo] - 범례 히트 정보
41756
- * @property {boolean} [isBrush] - 브러시 사용 여부
41757
- */
41758
-
41759
41673
  /**
41760
41674
  * Draw series data
41761
- * @param {LineDrawParam} param object for drawing series data
41675
+ * @param {object} param object for drawing series data
41762
41676
  *
41763
41677
  * @returns {undefined}
41764
41678
  */
@@ -41827,6 +41741,8 @@ var element_line_Line = /*#__PURE__*/function () {
41827
41741
  }
41828
41742
 
41829
41743
  var endPoint = chartRect.y2 - labelOffset.bottom;
41744
+ var x;
41745
+ var y;
41830
41746
  var barAreaByCombo = 0;
41831
41747
  var minmaxX = axesSteps.x[this.xAxisIndex];
41832
41748
  var minmaxY = axesSteps.y[this.yAxisIndex];
@@ -41851,40 +41767,51 @@ var element_line_Line = /*#__PURE__*/function () {
41851
41767
  }; // draw line
41852
41768
 
41853
41769
 
41854
- var prevValid;
41855
- this.data.forEach(function (curr) {
41856
- var _prevValid, _prevValid2, _prevValid3;
41857
-
41858
- var x = getXPos(curr.x);
41859
- var y = getYPos(curr.y);
41860
-
41861
- if (_this2.isExistGrp && _this2.usePassingValue && curr.o === _this2.passingValue) {
41862
- var _curr$b;
41863
-
41864
- y = getYPos((_curr$b = curr.b) !== null && _curr$b !== void 0 ? _curr$b : 0);
41865
- }
41770
+ var needCutoff = false;
41771
+ this.data.reduce(function (prev, curr) {
41772
+ x = getXPos(curr.x);
41773
+ y = getYPos(curr.y);
41866
41774
 
41867
41775
  if (x !== null) {
41868
41776
  x += helpers_util.aliasPixel(x);
41869
41777
  }
41870
41778
 
41871
- curr.xp = x;
41872
- curr.yp = y;
41779
+ if (_this2.usePassingValue) {
41780
+ if (curr.o === _this2.passingValue) {
41781
+ y = getYPos(prev.y);
41873
41782
 
41874
- if (_this2.usePassingValue && curr.o === _this2.passingValue) {
41875
- if (!_this2.isExistGrp) {
41876
- return;
41783
+ if (prev.o === null) {
41784
+ needCutoff = true;
41785
+ }
41786
+
41787
+ if (_this2.isExistGrp && !needCutoff) {
41788
+ var _curr$b;
41789
+
41790
+ y = getYPos((_curr$b = curr.b) !== null && _curr$b !== void 0 ? _curr$b : 0);
41791
+ ctx.lineTo(x, y);
41792
+ }
41793
+
41794
+ curr.xp = x;
41795
+ curr.yp = y;
41796
+ return curr;
41877
41797
  }
41878
41798
  }
41879
41799
 
41880
- if (lodash_es_isNil((_prevValid = prevValid) === null || _prevValid === void 0 ? void 0 : _prevValid.y) && _this2.usePassingValue && _this2.passingValue !== ((_prevValid2 = prevValid) === null || _prevValid2 === void 0 ? void 0 : _prevValid2.o) || !_this2.usePassingValue && lodash_es_isNil(curr.o) && _this2.interpolation !== 'zero' || !_this2.usePassingValue && lodash_es_isNil((_prevValid3 = prevValid) === null || _prevValid3 === void 0 ? void 0 : _prevValid3.y) || lodash_es_isNil(curr.o) && curr.y == null && _this2.passingValue !== curr.o) {
41800
+ var isNullValue = helpers_util.isNullOrUndefined(prev.o) || helpers_util.isNullOrUndefined(curr.o) || helpers_util.isNullOrUndefined(curr.x) || helpers_util.isNullOrUndefined(curr.y);
41801
+
41802
+ if (isNullValue || needCutoff) {
41881
41803
  ctx.moveTo(x, y);
41804
+ needCutoff = false;
41882
41805
  } else {
41883
41806
  ctx.lineTo(x, y);
41884
41807
  }
41885
41808
 
41886
- prevValid = curr;
41887
- });
41809
+ curr.xp = x; // eslint-disable-line
41810
+
41811
+ curr.yp = y; // eslint-disable-line
41812
+
41813
+ return curr;
41814
+ }, this.data[0]);
41888
41815
  ctx.stroke();
41889
41816
 
41890
41817
  if (this.segments) {
@@ -41924,24 +41851,20 @@ var element_line_Line = /*#__PURE__*/function () {
41924
41851
  var valueArray = this.data.map(function (item) {
41925
41852
  return item === null || item === void 0 ? void 0 : item.o;
41926
41853
  });
41927
- /** @type {Array<[number, number]>} */
41928
-
41929
41854
  var needFillDataIndexList = [];
41930
41855
 
41931
41856
  for (var i = 0; i < valueArray.length + 1; i++) {
41932
- var isNoneInterpolation = this.interpolation === 'none' || this.usePassingValue && this.passingValue !== null;
41933
-
41934
- if (isNoneInterpolation ? lodash_es_isNil(valueArray[i]) : lodash_es_isUndefined(valueArray[i])) {
41857
+ if (helpers_util.isNullOrUndefined(valueArray[i])) {
41935
41858
  if (start !== null && end !== null) {
41936
41859
  var temp = valueArray.slice(start, i);
41937
41860
  var lastNormalValueIndex = temp.findLastIndex(function (item) {
41938
- return !lodash_es_isNil(item) && item !== _this2.passingValue;
41861
+ return item !== helpers_util.isNullOrUndefined(item) && item !== _this2.passingValue;
41939
41862
  });
41940
41863
  needFillDataIndexList.push([start, start + lastNormalValueIndex]);
41941
41864
  start = null;
41942
41865
  end = null;
41943
41866
  }
41944
- } else if (this.usePassingValue && valueArray[i] === this.passingValue) {
41867
+ } else if (valueArray[i] === this.passingValue) {
41945
41868
  end = i;
41946
41869
  } else {
41947
41870
  start = start === null ? i : start;
@@ -41971,7 +41894,7 @@ var element_line_Line = /*#__PURE__*/function () {
41971
41894
 
41972
41895
  if (ix === startIndex) {
41973
41896
  ctx.moveTo(currData.xp, currData.yp);
41974
- } else if (_this2.isExistGrp || _this2.passingValue !== currData.o || _this2.interpolation === 'zero' && lodash_es_isNil(currData.o)) {
41897
+ } else if (_this2.isExistGrp || _this2.passingValue !== currData.o) {
41975
41898
  ctx.lineTo(currData.xp, currData.yp);
41976
41899
  }
41977
41900
 
@@ -42004,7 +41927,7 @@ var element_line_Line = /*#__PURE__*/function () {
42004
41927
  return;
42005
41928
  }
42006
41929
 
42007
- var isSingle = _this2.interpolation === 'none' && helpers_util.isNullOrUndefined((_this2$data = _this2.data[ix - 1]) === null || _this2$data === void 0 ? void 0 : _this2$data.o) && helpers_util.isNullOrUndefined((_this2$data2 = _this2.data[ix + 1]) === null || _this2$data2 === void 0 ? void 0 : _this2$data2.o);
41930
+ var isSingle = helpers_util.isNullOrUndefined((_this2$data = _this2.data[ix - 1]) === null || _this2$data === void 0 ? void 0 : _this2$data.o) && helpers_util.isNullOrUndefined((_this2$data2 = _this2.data[ix + 1]) === null || _this2$data2 === void 0 ? void 0 : _this2$data2.o);
42008
41931
  var isSelectedLabel = selectedLabelIndexList.includes(ix);
42009
41932
 
42010
41933
  if (_this2.point || isSingle || isSelectedLabel) {
@@ -44828,47 +44751,6 @@ var model_series_modules = {
44828
44751
  Store: model_store,
44829
44752
  Series: model_series
44830
44753
  });
44831
- /**
44832
- * @typedef {Object} ChartDOMSize
44833
- * @property {number} width - 차트 DOM의 너비
44834
- * @property {number} height - 차트 DOM의 높이
44835
- */
44836
-
44837
- /**
44838
- * @typedef {Object} ChartRect
44839
- * @property {number} x1 - 차트 영역의 시작 X 좌표
44840
- * @property {number} x2 - 차트 영역의 끝 X 좌표
44841
- * @property {number} y1 - 차트 영역의 시작 Y 좌표
44842
- * @property {number} y2 - 차트 영역의 끝 Y 좌표
44843
- * @property {number} chartWidth - 실제 차트 그리기 영역의 너비
44844
- * @property {number} chartHeight - 실제 차트 그리기 영역의 높이
44845
- * @property {number} width - 전체 차트 컨테이너의 너비
44846
- * @property {number} height - 전체 차트 컨테이너의 높이
44847
- */
44848
-
44849
- /**
44850
- * @typedef {Object} MouseLabelValue
44851
- * @property {string|number} labelVal - 마우스 위치에 해당하는 라벨 값
44852
- * @property {number} labelIdx - 라벨 인덱스 (없으면 -1)
44853
- */
44854
-
44855
- /**
44856
- * @typedef {Object} ChartSeriesDataPoint
44857
- * @property {number|null} x - x축 값 또는 라벨
44858
- * @property {number|null} y - y축 값 또는 데이터 값
44859
- * @property {number|null} o - 원본 데이터 값
44860
- * @property {number|null} b - 스택형 차트의 베이스 값
44861
- * @property {number|null} xp - x좌표 위치(픽셀 등)
44862
- * @property {number|null} yp - y좌표 위치(픽셀 등)
44863
- * @property {number|null} w - 너비
44864
- * @property {number|null} h - 높이
44865
- * @property {string|null} dataColor - 데이터 색상
44866
- * @property {string|null} dataTextColor - 텍스트 색상
44867
- */
44868
-
44869
- /**
44870
- * @typedef {'none' | 'linear' | 'zero'} InterpolationType
44871
- */
44872
44754
  // CONCATENATED MODULE: ./src/components/chart/scale/scale.js
44873
44755
 
44874
44756
 
@@ -51355,7 +51237,7 @@ var plugins_interaction_modules = {
51355
51237
  if (item !== null && item !== void 0 && item.data) {
51356
51238
  var gdata = void 0;
51357
51239
 
51358
- if (item.data.o === null && series.interpolation !== 'zero') {
51240
+ if (item.data.o === null) {
51359
51241
  if (!series.isExistGrp) {
51360
51242
  gdata = isHorizontal ? item.data.x : item.data.y;
51361
51243
  }
@@ -54018,6 +53900,7 @@ var element_tip_modules = {
54018
53900
 
54019
53901
 
54020
53902
 
53903
+
54021
53904
 
54022
53905
 
54023
53906
  var chart_core_EvChart = /*#__PURE__*/function () {
@@ -54205,60 +54088,87 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54205
54088
  });
54206
54089
  }
54207
54090
  }, {
54208
- key: "adjustYAxisWidth",
54209
- value: function adjustYAxisWidth() {
54210
- var _this$options$axesY, _this$axesY, _this$axesRange, _this$axesSteps, _this$axesSteps$y, _this$axesSteps$y$, _this$axesSteps2, _this$axesY$;
54091
+ key: "adjustXAndYAxisWidth",
54092
+ value: function adjustXAndYAxisWidth() {
54093
+ var _this$options$axesX,
54094
+ _this$options$axesY,
54095
+ _this2 = this,
54096
+ _this$axesSteps,
54097
+ _this$axesSteps2,
54098
+ _this$axesX$,
54099
+ _this$axesY$,
54100
+ _this$axesRange,
54101
+ _this$axesRange$x,
54102
+ _this$axesRange2,
54103
+ _this$axesRange3,
54104
+ _this$axesRange3$y,
54105
+ _this$axesRange4;
54211
54106
 
54212
54107
  // fitWidth(maxWidth에 넘을 시 말줄임표 들어가는 기능)을 사용중인 step Axis인 경우에는 적용 제외
54213
- var isStepAxisUseFitWidth = (_this$options$axesY = this.options.axesY) === null || _this$options$axesY === void 0 ? void 0 : _this$options$axesY.some(function (axisY) {
54108
+ var isStepXAxisUseFitWidth = (_this$options$axesX = this.options.axesX) === null || _this$options$axesX === void 0 ? void 0 : _this$options$axesX.some(function (axisX) {
54109
+ var _axisX$labelStyle;
54110
+
54111
+ return axisX.type === 'step' && ((_axisX$labelStyle = axisX.labelStyle) === null || _axisX$labelStyle === void 0 ? void 0 : _axisX$labelStyle.fitWidth);
54112
+ });
54113
+ var isStepYAxisUseFitWidth = (_this$options$axesY = this.options.axesY) === null || _this$options$axesY === void 0 ? void 0 : _this$options$axesY.some(function (axisY) {
54214
54114
  var _axisY$labelStyle;
54215
54115
 
54216
54116
  return axisY.type === 'step' && ((_axisY$labelStyle = axisY.labelStyle) === null || _axisY$labelStyle === void 0 ? void 0 : _axisY$labelStyle.fitWidth);
54217
54117
  });
54218
54118
 
54219
- if (!((_this$axesY = this.axesY) !== null && _this$axesY !== void 0 && _this$axesY.length) || !((_this$axesRange = this.axesRange) !== null && _this$axesRange !== void 0 && _this$axesRange.y) || !((_this$axesSteps = this.axesSteps) !== null && _this$axesSteps !== void 0 && (_this$axesSteps$y = _this$axesSteps.y) !== null && _this$axesSteps$y !== void 0 && _this$axesSteps$y.length) || isStepAxisUseFitWidth) {
54220
- return;
54221
- }
54222
-
54223
- var notFormattedLabels = [];
54224
-
54225
- var _ref2 = (_this$axesSteps$y$ = (_this$axesSteps2 = this.axesSteps) === null || _this$axesSteps2 === void 0 ? void 0 : _this$axesSteps2.y[0]) !== null && _this$axesSteps$y$ !== void 0 ? _this$axesSteps$y$ : {},
54226
- interval = _ref2.interval,
54227
- graphMin = _ref2.graphMin,
54228
- graphMax = _ref2.graphMax,
54229
- _ref2$steps = _ref2.steps,
54230
- steps = _ref2$steps === void 0 ? 0 : _ref2$steps;
54119
+ var getNotFormattedLabels = function getNotFormattedLabels(axesSteps) {
54120
+ var _ref2 = axesSteps !== null && axesSteps !== void 0 ? axesSteps : {},
54121
+ interval = _ref2.interval,
54122
+ graphMin = _ref2.graphMin,
54123
+ graphMax = _ref2.graphMax,
54124
+ _ref2$steps = _ref2.steps,
54125
+ steps = _ref2$steps === void 0 ? 0 : _ref2$steps;
54126
+
54127
+ var result = [];
54128
+
54129
+ if (interval) {
54130
+ result = Array.from({
54131
+ length: steps
54132
+ }, function (_, i) {
54133
+ return graphMin + i * interval;
54134
+ });
54135
+ result.push(graphMax);
54136
+ } else {
54137
+ var _ref3, _labels$y;
54231
54138
 
54232
- if (interval) {
54233
- for (var i = 0; i < steps; i++) {
54234
- notFormattedLabels.push(graphMin + i * interval);
54139
+ var labels = _this2.data.labels;
54140
+ result = (_ref3 = (_labels$y = labels === null || labels === void 0 ? void 0 : labels.y) !== null && _labels$y !== void 0 ? _labels$y : labels) !== null && _ref3 !== void 0 ? _ref3 : [];
54235
54141
  }
54236
54142
 
54237
- notFormattedLabels.push(graphMax);
54238
- } else {
54239
- var _ref3, _this$data$labels$y, _this$data$labels;
54240
-
54241
- notFormattedLabels = (_ref3 = (_this$data$labels$y = (_this$data$labels = this.data.labels) === null || _this$data$labels === void 0 ? void 0 : _this$data$labels.y) !== null && _this$data$labels$y !== void 0 ? _this$data$labels$y : this.data.labels) !== null && _ref3 !== void 0 ? _ref3 : [];
54242
- }
54243
-
54244
- var yMaxWidth = (_this$axesY$ = this.axesY[0]) === null || _this$axesY$ === void 0 ? void 0 : _this$axesY$.getLabelWidthHasMaxLength(notFormattedLabels);
54143
+ return result;
54144
+ };
54245
54145
 
54246
- if (yMaxWidth > 0) {
54247
- var adjustedRange = {
54248
- x: this.axesRange.x,
54249
- y: this.axesRange.y.map(function (value) {
54250
- return _objectSpread2(_objectSpread2({}, value), {}, {
54251
- size: {
54252
- width: yMaxWidth,
54253
- height: value.size.height
54254
- }
54255
- });
54256
- })
54257
- };
54258
- this.labelOffset = this.getLabelOffset(adjustedRange);
54259
- this.labelRange = this.getAxesLabelRange();
54260
- this.axesSteps = this.calculateSteps();
54261
- }
54146
+ var notFormattedXLabels = getNotFormattedLabels((_this$axesSteps = this.axesSteps) === null || _this$axesSteps === void 0 ? void 0 : _this$axesSteps.x[0]);
54147
+ var notFormattedYLabels = getNotFormattedLabels((_this$axesSteps2 = this.axesSteps) === null || _this$axesSteps2 === void 0 ? void 0 : _this$axesSteps2.y[0]);
54148
+ var xMaxWidth = (_this$axesX$ = this.axesX[0]) === null || _this$axesX$ === void 0 ? void 0 : _this$axesX$.getLabelWidthHasMaxLength(notFormattedXLabels);
54149
+ var yMaxWidth = (_this$axesY$ = this.axesY[0]) === null || _this$axesY$ === void 0 ? void 0 : _this$axesY$.getLabelWidthHasMaxLength(notFormattedYLabels);
54150
+ var adjustedRange = {
54151
+ x: !isStepXAxisUseFitWidth ? (_this$axesRange = this.axesRange) === null || _this$axesRange === void 0 ? void 0 : (_this$axesRange$x = _this$axesRange.x) === null || _this$axesRange$x === void 0 ? void 0 : _this$axesRange$x.map(function (value) {
54152
+ return _objectSpread2(_objectSpread2({}, value), {}, {
54153
+ size: {
54154
+ width: Math.max(xMaxWidth, value.size.width),
54155
+ height: value.size.height
54156
+ }
54157
+ });
54158
+ }) : (_this$axesRange2 = this.axesRange) === null || _this$axesRange2 === void 0 ? void 0 : _this$axesRange2.x,
54159
+ y: !isStepYAxisUseFitWidth ? (_this$axesRange3 = this.axesRange) === null || _this$axesRange3 === void 0 ? void 0 : (_this$axesRange3$y = _this$axesRange3.y) === null || _this$axesRange3$y === void 0 ? void 0 : _this$axesRange3$y.map(function (value) {
54160
+ return _objectSpread2(_objectSpread2({}, value), {}, {
54161
+ size: {
54162
+ width: Math.max(yMaxWidth, value.size.width),
54163
+ height: value.size.height
54164
+ }
54165
+ });
54166
+ }) : (_this$axesRange4 = this.axesRange) === null || _this$axesRange4 === void 0 ? void 0 : _this$axesRange4.y
54167
+ };
54168
+ this.axesRange = adjustedRange;
54169
+ this.labelOffset = this.getLabelOffset(adjustedRange);
54170
+ this.labelRange = this.getAxesLabelRange();
54171
+ this.axesSteps = this.calculateSteps();
54262
54172
  }
54263
54173
  /**
54264
54174
  * To draw canvas chart, it processes several sequential jobs
@@ -54277,7 +54187,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54277
54187
  this.labelOffset = this.getLabelOffset();
54278
54188
  this.labelRange = this.getAxesLabelRange();
54279
54189
  this.axesSteps = this.calculateSteps();
54280
- this.adjustYAxisWidth();
54190
+ this.adjustXAndYAxisWidth();
54281
54191
  this.drawAxis(hitInfo);
54282
54192
  this.drawSeries(hitInfo);
54283
54193
 
@@ -54302,7 +54212,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54302
54212
  }, {
54303
54213
  key: "drawSeries",
54304
54214
  value: function drawSeries(hitInfo) {
54305
- var _this2 = this;
54215
+ var _this3 = this;
54306
54216
 
54307
54217
  var _this$options2 = this.options,
54308
54218
  maxTip = _this$options2.maxTip,
@@ -54339,7 +54249,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54339
54249
  var showIndex = 0;
54340
54250
  var showSeriesCount = 0;
54341
54251
  this.seriesInfo.charts.bar.forEach(function (series) {
54342
- if (_this2.seriesList[series].show) {
54252
+ if (_this3.seriesList[series].show) {
54343
54253
  showSeriesCount++;
54344
54254
  }
54345
54255
  });
@@ -54541,14 +54451,14 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54541
54451
  }, {
54542
54452
  key: "getAxesRange",
54543
54453
  value: function getAxesRange() {
54544
- var _this3 = this;
54454
+ var _this4 = this;
54545
54455
 
54546
54456
  /* eslint-disable max-len */
54547
54457
  var axesXMinMax = this.axesX.map(function (axis, index) {
54548
- return axis.calculateScaleRange(_this3.minMax.x[index], _this3.scrollbar.x, _this3.chartRect);
54458
+ return axis.calculateScaleRange(_this4.minMax.x[index], _this4.scrollbar.x, _this4.chartRect);
54549
54459
  });
54550
54460
  var axesYMinMax = this.axesY.map(function (axis, index) {
54551
- return axis.calculateScaleRange(_this3.minMax.y[index], _this3.scrollbar.y, _this3.chartRect);
54461
+ return axis.calculateScaleRange(_this4.minMax.y[index], _this4.scrollbar.y, _this4.chartRect);
54552
54462
  });
54553
54463
  /* eslint-enable max-len */
54554
54464
 
@@ -54566,13 +54476,13 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54566
54476
  }, {
54567
54477
  key: "drawAxis",
54568
54478
  value: function drawAxis(hitInfo) {
54569
- var _this4 = this;
54479
+ var _this5 = this;
54570
54480
 
54571
54481
  this.axesX.forEach(function (axis, index) {
54572
- axis.draw(_this4.chartRect, _this4.labelOffset, _this4.axesSteps.x[index], hitInfo, _this4.defaultSelectInfo, _this4.data.labels);
54482
+ axis.draw(_this5.chartRect, _this5.labelOffset, _this5.axesSteps.x[index], hitInfo, _this5.defaultSelectInfo, _this5.data.labels);
54573
54483
  });
54574
54484
  this.axesY.forEach(function (axis, index) {
54575
- axis.draw(_this4.chartRect, _this4.labelOffset, _this4.axesSteps.y[index], hitInfo, _this4.defaultSelectInfo);
54485
+ axis.draw(_this5.chartRect, _this5.labelOffset, _this5.axesSteps.y[index], hitInfo, _this5.defaultSelectInfo);
54576
54486
  });
54577
54487
  }
54578
54488
  /**
@@ -54584,27 +54494,27 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54584
54494
  }, {
54585
54495
  key: "calculateSteps",
54586
54496
  value: function calculateSteps() {
54587
- var _this5 = this;
54497
+ var _this6 = this;
54588
54498
 
54589
54499
  var axesXMinMax = this.axesX.map(function (axis, index) {
54590
54500
  var range = {
54591
- minValue: _this5.axesRange.x[index].min,
54592
- maxValue: _this5.axesRange.x[index].max,
54593
- minIndex: _this5.axesRange.x[index].minIndex,
54594
- maxIndex: _this5.axesRange.x[index].maxIndex,
54595
- minSteps: _this5.labelRange.x[index].min,
54596
- maxSteps: _this5.labelRange.x[index].max
54501
+ minValue: _this6.axesRange.x[index].min,
54502
+ maxValue: _this6.axesRange.x[index].max,
54503
+ minIndex: _this6.axesRange.x[index].minIndex,
54504
+ maxIndex: _this6.axesRange.x[index].maxIndex,
54505
+ minSteps: _this6.labelRange.x[index].min,
54506
+ maxSteps: _this6.labelRange.x[index].max
54597
54507
  };
54598
54508
  return axis.calculateSteps(range);
54599
54509
  });
54600
54510
  var axesYMinMax = this.axesY.map(function (axis, index) {
54601
54511
  var range = {
54602
- minValue: _this5.axesRange.y[index].min,
54603
- maxValue: _this5.axesRange.y[index].max,
54604
- minIndex: _this5.axesRange.y[index].minIndex,
54605
- maxIndex: _this5.axesRange.y[index].maxIndex,
54606
- minSteps: _this5.labelRange.y[index].min,
54607
- maxSteps: _this5.labelRange.y[index].max
54512
+ minValue: _this6.axesRange.y[index].min,
54513
+ maxValue: _this6.axesRange.y[index].max,
54514
+ minIndex: _this6.axesRange.y[index].minIndex,
54515
+ maxIndex: _this6.axesRange.y[index].maxIndex,
54516
+ minSteps: _this6.labelRange.y[index].min,
54517
+ maxSteps: _this6.labelRange.y[index].max
54608
54518
  };
54609
54519
  return axis.calculateSteps(range);
54610
54520
  });
@@ -54622,15 +54532,15 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54622
54532
  }, {
54623
54533
  key: "getAxesLabelRange",
54624
54534
  value: function getAxesLabelRange() {
54625
- var _this6 = this;
54535
+ var _this7 = this;
54626
54536
 
54627
54537
  var axesXSteps = this.axesX.map(function (axis, index) {
54628
- var size = _this6.axesRange.x[index].size;
54629
- return axis.calculateLabelRange('x', _this6.chartRect, _this6.labelOffset, size.width);
54538
+ var size = _this7.axesRange.x[index].size;
54539
+ return axis.calculateLabelRange('x', _this7.chartRect, _this7.labelOffset, size.width);
54630
54540
  });
54631
54541
  var axesYSteps = this.axesY.map(function (axis, index) {
54632
- var size = _this6.axesRange.y[index].size;
54633
- return axis.calculateLabelRange('y', _this6.chartRect, _this6.labelOffset, size.height);
54542
+ var size = _this7.axesRange.y[index].size;
54543
+ return axis.calculateLabelRange('y', _this7.chartRect, _this7.labelOffset, size.height);
54634
54544
  });
54635
54545
  return {
54636
54546
  x: axesXSteps,
@@ -54662,9 +54572,8 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54662
54572
  }
54663
54573
  /**
54664
54574
  * Get chart DOM size and set canvas size
54665
- * @typedef {import('./model/index').ChartDOMSize} ChartDOMSize
54666
54575
  *
54667
- * @returns {ChartDOMSize} chart size information
54576
+ * @returns {object} chart size information
54668
54577
  */
54669
54578
 
54670
54579
  }, {
@@ -54684,22 +54593,21 @@ var chart_core_EvChart = /*#__PURE__*/function () {
54684
54593
  }
54685
54594
  /**
54686
54595
  * Calculate chart size
54687
- * @typedef {import('./model/index').ChartRect} ChartRect
54688
54596
  *
54689
- * @returns {ChartRect} chart size information
54597
+ * @returns {object} chart size information
54690
54598
  */
54691
54599
 
54692
54600
  }, {
54693
54601
  key: "getChartRect",
54694
54602
  value: function getChartRect() {
54695
- var _this$options$axesX, _this$options$axesX$, _this$options$axesY2, _this$options$axesY2$;
54603
+ var _this$options$axesX2, _this$options$axesX2$, _this$options$axesY2, _this$options$axesY2$;
54696
54604
 
54697
54605
  var _this$getChartDOMRect = this.getChartDOMRect(),
54698
54606
  width = _this$getChartDOMRect.width,
54699
54607
  height = _this$getChartDOMRect.height;
54700
54608
 
54701
54609
  var padding = this.options.padding;
54702
- var xAxisTitleOpt = (_this$options$axesX = this.options.axesX) === null || _this$options$axesX === void 0 ? void 0 : (_this$options$axesX$ = _this$options$axesX[0]) === null || _this$options$axesX$ === void 0 ? void 0 : _this$options$axesX$.title;
54610
+ var xAxisTitleOpt = (_this$options$axesX2 = this.options.axesX) === null || _this$options$axesX2 === void 0 ? void 0 : (_this$options$axesX2$ = _this$options$axesX2[0]) === null || _this$options$axesX2$ === void 0 ? void 0 : _this$options$axesX2$.title;
54703
54611
  var yAxisTitleOpt = (_this$options$axesY2 = this.options.axesY) === null || _this$options$axesY2 === void 0 ? void 0 : (_this$options$axesY2$ = _this$options$axesY2[0]) === null || _this$options$axesY2$ === void 0 ? void 0 : _this$options$axesY2$.title;
54704
54612
  var titleMargin = 10;
54705
54613
  var xAxisTitleHeight = 0;