evui 3.4.140 → 3.4.142

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.
@@ -11191,7 +11191,7 @@ $({ target: 'Number', stat: true }, {
11191
11191
  /***/ "9224":
11192
11192
  /***/ (function(module) {
11193
11193
 
11194
- module.exports = JSON.parse("{\"a\":\"3.4.140\"}");
11194
+ module.exports = JSON.parse("{\"a\":\"3.4.142\"}");
11195
11195
 
11196
11196
  /***/ }),
11197
11197
 
@@ -26936,13 +26936,13 @@ var notification_componentObj = Object(external_commonjs_vue_commonjs2_vue_root_
26936
26936
  var notification_rootId = 'ev-notification-modal';
26937
26937
  var notification_root = document.createElement('div');
26938
26938
  notification_root.id = notification_rootId;
26939
- var notification_positionList = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
26939
+ var positionList = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
26940
26940
 
26941
26941
  var notification_notification = function notification() {
26942
26942
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26943
26943
  var position = options.position || 'top-right';
26944
26944
 
26945
- if (!notification_positionList.includes(position)) {
26945
+ if (!positionList.includes(position)) {
26946
26946
  console.warn('[EVUI][Notification] The position value is incorrectly entered.');
26947
26947
  return;
26948
26948
  }
@@ -38876,10 +38876,6 @@ function isNil(value) {
38876
38876
 
38877
38877
 
38878
38878
 
38879
-
38880
-
38881
-
38882
-
38883
38879
 
38884
38880
 
38885
38881
 
@@ -39886,190 +39882,6 @@ var modules = {
39886
39882
  };
39887
39883
  },
39888
39884
 
39889
- /**
39890
- * Find seriesId by position x and y
39891
- * @param {array} offset position x and y
39892
- *
39893
- * @returns {object} clicked series id
39894
- */
39895
- getSeriesInfoByPosition: function getSeriesInfoByPosition(offset) {
39896
- var _this8 = this;
39897
-
39898
- var _offset = _slicedToArray(offset, 2),
39899
- clickedX = _offset[0],
39900
- clickedY = _offset[1];
39901
-
39902
- var chartRect = this.chartRect;
39903
- var labelOffset = this.labelOffset;
39904
- var aPos = {
39905
- x1: chartRect.x1 + labelOffset.left,
39906
- x2: chartRect.x2 - labelOffset.right,
39907
- y1: chartRect.y1 + labelOffset.top,
39908
- y2: chartRect.y2 - labelOffset.bottom
39909
- };
39910
- var valueAxes = this.axesY[0];
39911
- var labelAxes = this.axesX[0];
39912
- var valueStartPoint = aPos[valueAxes.units.rectStart];
39913
- var valueEndPoint = aPos[valueAxes.units.rectEnd];
39914
- var labelStartPoint = aPos[labelAxes.units.rectStart];
39915
- var labelEndPoint = aPos[labelAxes.units.rectEnd];
39916
- var result = {
39917
- sId: null
39918
- };
39919
-
39920
- if (clickedY > valueEndPoint && clickedY < valueStartPoint && clickedX < labelEndPoint && clickedX > labelStartPoint) {
39921
- var hitSeries;
39922
- var positionList;
39923
- var hitItem = this.findHitItem(offset);
39924
- var hitSeriesList = Object.keys(hitItem.items);
39925
-
39926
- switch (this.options.type) {
39927
- case 'line':
39928
- {
39929
- var orderedSeriesList = this.seriesInfo.charts.line;
39930
- var isStackChart = Object.values(this.seriesList).some(function (_ref3) {
39931
- var stackIndex = _ref3.stackIndex;
39932
- return stackIndex;
39933
- });
39934
-
39935
- if (hitSeriesList.length) {
39936
- // 클릭한 위치에 data 가 존재하는 경우
39937
- if (isStackChart) {
39938
- var _positionList$find;
39939
-
39940
- positionList = orderedSeriesList.filter(function (sId) {
39941
- return hitSeriesList.includes(sId);
39942
- }).map(function (sId) {
39943
- var _hitItem$items$sId, _hitItem$items$sId$da;
39944
-
39945
- return {
39946
- sId: sId,
39947
- position: (_hitItem$items$sId = hitItem.items[sId]) === null || _hitItem$items$sId === void 0 ? void 0 : (_hitItem$items$sId$da = _hitItem$items$sId.data) === null || _hitItem$items$sId$da === void 0 ? void 0 : _hitItem$items$sId$da.yp
39948
- };
39949
- });
39950
- hitSeries = (_positionList$find = positionList.find(function (_ref4) {
39951
- var position = _ref4.position;
39952
- return clickedY > position;
39953
- })) === null || _positionList$find === void 0 ? void 0 : _positionList$find.sId;
39954
- } else {
39955
- var _Object$entries$find;
39956
-
39957
- hitSeries = (_Object$entries$find = Object.entries(hitItem.items).find(function (_ref5) {
39958
- var _ref6 = _slicedToArray(_ref5, 2),
39959
- hit = _ref6[1].hit;
39960
-
39961
- return hit;
39962
- })) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0];
39963
- }
39964
- } else {
39965
- var _positionList$0$posit;
39966
-
39967
- // 클릭한 위치에 data 가 존재하지 않는 경우
39968
- var visibleSeriesList = orderedSeriesList.filter(function (sId) {
39969
- return _this8.seriesList[sId].show;
39970
- });
39971
- positionList = visibleSeriesList.map(function (sId) {
39972
- var _this8$seriesList$sId;
39973
-
39974
- return {
39975
- sId: sId,
39976
- position: (_this8$seriesList$sId = _this8.seriesList[sId].data) === null || _this8$seriesList$sId === void 0 ? void 0 : _this8$seriesList$sId.map(function (_ref7) {
39977
- var xp = _ref7.xp,
39978
- yp = _ref7.yp;
39979
- return [xp, yp];
39980
- })
39981
- };
39982
- });
39983
- var dataIndex = (_positionList$0$posit = positionList[0].position) === null || _positionList$0$posit === void 0 ? void 0 : _positionList$0$posit.findIndex(function (_ref8) {
39984
- var _ref9 = _slicedToArray(_ref8, 1),
39985
- xp = _ref9[0];
39986
-
39987
- return xp >= clickedX;
39988
- });
39989
- var vectorList = positionList.map(function (_ref10) {
39990
- var sId = _ref10.sId,
39991
- position = _ref10.position;
39992
- return {
39993
- sId: sId,
39994
- vector: {
39995
- start: position[dataIndex - 1],
39996
- end: position[dataIndex]
39997
- }
39998
- };
39999
- });
40000
-
40001
- var isEmptyVector = function isEmptyVector(arr) {
40002
- return !arr || !Array.isArray(arr) || (arr === null || arr === void 0 ? void 0 : arr.length) !== 2;
40003
- }; // canvas 의 클릭 위치값은 제 4 사분면의 위치이므로 clickedY, y1, y2 의 값은 음수를 취한다.
40004
-
40005
-
40006
- if (isStackChart) {
40007
- var _vectorList$find;
40008
-
40009
- hitSeries = (_vectorList$find = vectorList.find(function (_ref11) {
40010
- var vector = _ref11.vector;
40011
-
40012
- if (isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.start) && isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.end)) {
40013
- return false;
40014
- }
40015
-
40016
- var _vector$start = _slicedToArray(vector.start, 2),
40017
- x1 = _vector$start[0],
40018
- y1 = _vector$start[1];
40019
-
40020
- var _vector$end = _slicedToArray(vector.end, 2),
40021
- x2 = _vector$end[0],
40022
- y2 = _vector$end[1];
40023
-
40024
- var v1 = [x2 - x1, y1 - y2];
40025
- var v2 = [x2 - clickedX, clickedY - y2];
40026
- var xp = v1[0] * v2[1] - v1[1] * v2[0];
40027
- return vector.start.every(function (v) {
40028
- return typeof v === 'number';
40029
- }) && vector.end.every(function (v) {
40030
- return typeof v === 'number';
40031
- }) && xp > 0;
40032
- })) === null || _vectorList$find === void 0 ? void 0 : _vectorList$find.sId;
40033
- } else {
40034
- var _vectorList$find2;
40035
-
40036
- hitSeries = (_vectorList$find2 = vectorList.find(function (_ref12) {
40037
- var vector = _ref12.vector;
40038
-
40039
- if (isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.start) && isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.end)) {
40040
- return false;
40041
- }
40042
-
40043
- var _vector$start2 = _slicedToArray(vector.start, 2),
40044
- x1 = _vector$start2[0],
40045
- y1 = _vector$start2[1];
40046
-
40047
- var _vector$end2 = _slicedToArray(vector.end, 2),
40048
- x2 = _vector$end2[0],
40049
- y2 = _vector$end2[1];
40050
-
40051
- var a = (y1 - y2) / (x2 - x1);
40052
- var b = -1;
40053
- var c = -y1 - a * x1;
40054
- var distance = Math.abs(a * clickedX - b * clickedY + c) / Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
40055
- return distance < 3;
40056
- })) === null || _vectorList$find2 === void 0 ? void 0 : _vectorList$find2.sId;
40057
- }
40058
- }
40059
-
40060
- break;
40061
- }
40062
-
40063
- default:
40064
- break;
40065
- }
40066
-
40067
- result.sId = hitSeries;
40068
- }
40069
-
40070
- return result;
40071
- },
40072
-
40073
39885
  /**
40074
39886
  * @typedef {Object} LabelInfoResult
40075
39887
  * @property {number} labelIndex - 선택된 라벨의 인덱스
@@ -40086,9 +39898,9 @@ var modules = {
40086
39898
  getLabelInfoByPosition: function getLabelInfoByPosition(offset, targetAxis) {
40087
39899
  var _Object$values$sort$, _Object$values$sort$2, _scrollbarOpt, _scale, _scale$labels, _scale3, _scale3$labels;
40088
39900
 
40089
- var _offset2 = _slicedToArray(offset, 2),
40090
- x = _offset2[0],
40091
- y = _offset2[1];
39901
+ var _offset = _slicedToArray(offset, 2),
39902
+ x = _offset[0],
39903
+ y = _offset[1];
40092
39904
 
40093
39905
  var aPos = {
40094
39906
  x1: this.chartRect.x1 + this.labelOffset.left,
@@ -40098,9 +39910,9 @@ var modules = {
40098
39910
  };
40099
39911
  var seriesList = this.data.series;
40100
39912
  var pointSize = (_Object$values$sort$ = (_Object$values$sort$2 = Object.values(seriesList).sort(function (a, b) {
40101
- var _ref13, _b$pointSize;
39913
+ var _ref3, _b$pointSize;
40102
39914
 
40103
- return (_ref13 = (_b$pointSize = b.pointSize) !== null && _b$pointSize !== void 0 ? _b$pointSize : 0 - a.pointSize) !== null && _ref13 !== void 0 ? _ref13 : 0;
39915
+ return (_ref3 = (_b$pointSize = b.pointSize) !== null && _b$pointSize !== void 0 ? _b$pointSize : 0 - a.pointSize) !== null && _ref3 !== void 0 ? _ref3 : 0;
40104
39916
  })[0]) === null || _Object$values$sort$2 === void 0 ? void 0 : _Object$values$sort$2.pointSize) !== null && _Object$values$sort$ !== void 0 ? _Object$values$sort$ : 3; // default pointSize 3
40105
39917
 
40106
39918
  var _this$options = this.options,
@@ -40132,10 +39944,10 @@ var modules = {
40132
39944
  _scrollbarOpt2$interv = _scrollbarOpt2.interval,
40133
39945
  interval = _scrollbarOpt2$interv === void 0 ? 1 : _scrollbarOpt2$interv;
40134
39946
 
40135
- var _ref14 = range !== null && range !== void 0 ? range : [0, scale.labels.length],
40136
- _ref15 = _slicedToArray(_ref14, 2),
40137
- min = _ref15[0],
40138
- max = _ref15[1];
39947
+ var _ref4 = range !== null && range !== void 0 ? range : [0, scale.labels.length],
39948
+ _ref5 = _slicedToArray(_ref4, 2),
39949
+ min = _ref5[0],
39950
+ max = _ref5[1];
40139
39951
 
40140
39952
  var labelCount = Math.floor((+max - +min) / interval) + 1;
40141
39953
  var labelGap = (endPoint - startPoint) / labelCount;
@@ -40198,7 +40010,7 @@ var modules = {
40198
40010
  * @returns {MouseLabelValue} current mouse target label value
40199
40011
  */
40200
40012
  getCurMouseLabelVal: function getCurMouseLabelVal(targetAxis, offset, labelIndex) {
40201
- var _this9 = this;
40013
+ var _this8 = this;
40202
40014
 
40203
40015
  var _this$options2 = this.options,
40204
40016
  chartType = _this$options2.type,
@@ -40215,13 +40027,13 @@ var modules = {
40215
40027
  case 'bar':
40216
40028
  case 'line':
40217
40029
  {
40218
- result = horizontal && !isXAxis || !horizontal && isXAxis ? _this9.data.labels[labelIndex] : '';
40030
+ result = horizontal && !isXAxis || !horizontal && isXAxis ? _this8.data.labels[labelIndex] : '';
40219
40031
  break;
40220
40032
  }
40221
40033
 
40222
40034
  case 'heatMap':
40223
40035
  {
40224
- result = _this9.data.labels[targetAxisDirection][labelIndex];
40036
+ result = _this8.data.labels[targetAxisDirection][labelIndex];
40225
40037
  break;
40226
40038
  }
40227
40039
 
@@ -40235,19 +40047,19 @@ var modules = {
40235
40047
  var calLabelValUseMousePos = function calLabelValUseMousePos() {
40236
40048
  var result = '';
40237
40049
  var aPos = {
40238
- x1: _this9.chartRect.x1 + _this9.labelOffset.left,
40239
- x2: _this9.chartRect.x2 - _this9.labelOffset.right,
40240
- y1: _this9.chartRect.y1 + _this9.labelOffset.top,
40241
- y2: _this9.chartRect.y2 - _this9.labelOffset.bottom
40050
+ x1: _this8.chartRect.x1 + _this8.labelOffset.left,
40051
+ x2: _this8.chartRect.x2 - _this8.labelOffset.right,
40052
+ y1: _this8.chartRect.y1 + _this8.labelOffset.top,
40053
+ y2: _this8.chartRect.y2 - _this8.labelOffset.bottom
40242
40054
  };
40243
- var _this9$axesSteps$targ = _this9.axesSteps[targetAxisDirection][0],
40244
- steps = _this9$axesSteps$targ.steps,
40245
- labelValInterval = _this9$axesSteps$targ.interval,
40246
- graphMin = _this9$axesSteps$targ.graphMin;
40247
- var _this9$axesRange$targ = _this9.axesRange[targetAxisDirection][0].size,
40248
- labelWidth = _this9$axesRange$targ.width,
40249
- labelHeight = _this9$axesRange$targ.height;
40250
- var axes = isXAxis ? _this9.axesX : _this9.axesY;
40055
+ var _this8$axesSteps$targ = _this8.axesSteps[targetAxisDirection][0],
40056
+ steps = _this8$axesSteps$targ.steps,
40057
+ labelValInterval = _this8$axesSteps$targ.interval,
40058
+ graphMin = _this8$axesSteps$targ.graphMin;
40059
+ var _this8$axesRange$targ = _this8.axesRange[targetAxisDirection][0].size,
40060
+ labelWidth = _this8$axesRange$targ.width,
40061
+ labelHeight = _this8$axesRange$targ.height;
40062
+ var axes = isXAxis ? _this8.axesX : _this8.axesY;
40251
40063
  var axisStartPoint = aPos[axes[0].units.rectStart];
40252
40064
  var axisEndPoint = aPos[axes[0].units.rectEnd];
40253
40065
  var curMousePosInAxis = Math.abs(offset[isXAxis ? 0 : 1] - axisStartPoint);
@@ -40285,7 +40097,7 @@ var modules = {
40285
40097
  * @returns {object} min/max info for all of data
40286
40098
  */
40287
40099
  getStoreMinMax: function getStoreMinMax() {
40288
- var _this10 = this;
40100
+ var _this9 = this;
40289
40101
 
40290
40102
  var keys = Object.keys(this.seriesList);
40291
40103
  var isHorizontal = this.options.horizontal;
@@ -40303,7 +40115,7 @@ var modules = {
40303
40115
  if (keys.length) {
40304
40116
  return keys.reduce(function (acc, key) {
40305
40117
  var minmax = acc;
40306
- var series = _this10.seriesList[key];
40118
+ var series = _this9.seriesList[key];
40307
40119
  var smm = series.minMax;
40308
40120
  var axisX = series.xAxisIndex;
40309
40121
  var axisY = series.yAxisIndex;
@@ -46321,11 +46133,12 @@ var scale_linear_LinearScale = /*#__PURE__*/function (_Scale) {
46321
46133
  var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46322
46134
 
46323
46135
  if (this.formatter) {
46324
- var formattedLabel = this.formatter(this.getTruthyValue(value), _objectSpread2(_objectSpread2({}, data), {}, {
46136
+ var currentDecimalPointValue = this.getTruthyValue(value);
46137
+ var formattedLabel = this.formatter(currentDecimalPointValue, _objectSpread2(_objectSpread2({}, data), {}, {
46325
46138
  prevOriginalValue: data === null || data === void 0 ? void 0 : data.prev,
46326
46139
  prevDecimalPointValue: this.getTruthyValue(data === null || data === void 0 ? void 0 : data.prev),
46327
46140
  currentOriginalValue: value,
46328
- currentDecimalPointValue: Number(value.toFixed(this.decimalPoint))
46141
+ currentDecimalPointValue: currentDecimalPointValue
46329
46142
  }));
46330
46143
 
46331
46144
  if (typeof formattedLabel === 'string') {
@@ -51396,10 +51209,8 @@ var plugins_interaction_modules = {
51396
51209
  var hitItemId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
51397
51210
  var hitItem = hitInfo.items[hitItemId];
51398
51211
 
51399
- var seriesHitInfo = _this.getSeriesInfoByPosition(offset);
51400
-
51401
- if (seriesHitInfo.sId !== null) {
51402
- var allSelectedList = _this.updateSelectedSeriesInfo(seriesHitInfo.sId, true);
51212
+ if (hitItemId !== null) {
51213
+ var allSelectedList = _this.updateSelectedSeriesInfo(hitItemId, true);
51403
51214
 
51404
51215
  if (hitItem) {
51405
51216
  var _hitItem$data9, _hitItem$data10, _hitItem$data11, _allSelectedList$seri, _hitItem$data12;
@@ -51518,19 +51329,20 @@ var plugins_interaction_modules = {
51518
51329
  };
51519
51330
 
51520
51331
  var setSelectedSeriesInfo = function setSelectedSeriesInfo() {
51521
- var itemHitInfo = _this.getItemByPosition(offset, false);
51332
+ var hitInfo = _this.findHitItem(offset);
51522
51333
 
51523
- var hitInfo = _this.getSeriesInfoByPosition(offset);
51334
+ var hitItemId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
51335
+ var hitItem = hitInfo.items[hitItemId];
51524
51336
 
51525
- if (hitInfo.sId !== null) {
51526
- var allSelectedList = _this.updateSelectedSeriesInfo(hitInfo.sId, false);
51337
+ if (hitItemId !== null) {
51338
+ var allSelectedList = _this.updateSelectedSeriesInfo(hitItemId, false);
51527
51339
 
51528
51340
  _this.defaultSelectInfo.seriesId = allSelectedList.seriesId;
51529
51341
  args.selected = _objectSpread2({
51530
51342
  eventTarget: 'series'
51531
51343
  }, lodash_es_cloneDeep(_this.defaultSelectInfo));
51532
- args.label = itemHitInfo.label;
51533
- args.dataIndex = itemHitInfo.maxIndex;
51344
+ args.label = hitItem.label;
51345
+ args.dataIndex = hitItem.maxIndex;
51534
51346
  }
51535
51347
  };
51536
51348
 
@@ -52148,7 +51960,8 @@ var plugins_interaction_modules = {
52148
51960
  var maxsw = 0;
52149
51961
  var maxv = '';
52150
51962
  var maxg = null;
52151
- var maxSID = null; // 1. 먼저 공통으로 사용할 데이터 인덱스 결정
51963
+ var maxSID = null;
51964
+ var minDistance = Infinity; // 1. 먼저 공통으로 사용할 데이터 인덱스 결정
52152
51965
 
52153
51966
  var targetDataIndex = this.findClosestDataIndex(offset, sIds);
52154
51967
 
@@ -52221,10 +52034,16 @@ var plugins_interaction_modules = {
52221
52034
  if (maxg === null || maxg <= gdata) {
52222
52035
  maxg = gdata;
52223
52036
  maxSID = sId;
52224
- }
52037
+ } // 마우스 위치와의 거리 계산하여 가장 가까운 시리즈 선택
52038
+
52225
52039
 
52226
- if (item.hit) {
52227
- hitId = sId;
52040
+ if (item.hit && item.data.xp !== undefined && item.data.yp !== undefined) {
52041
+ var distance = Math.pow(item.data.xp - offset[0], 2) + Math.pow(item.data.yp - offset[1], 2);
52042
+
52043
+ if (distance < minDistance) {
52044
+ minDistance = distance;
52045
+ hitId = sId;
52046
+ }
52228
52047
  }
52229
52048
  }
52230
52049
  }