evui 3.4.141 → 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.
package/dist/evui.umd.js CHANGED
@@ -11200,7 +11200,7 @@ $({ target: 'Number', stat: true }, {
11200
11200
  /***/ "9224":
11201
11201
  /***/ (function(module) {
11202
11202
 
11203
- module.exports = JSON.parse("{\"a\":\"3.4.141\"}");
11203
+ module.exports = JSON.parse("{\"a\":\"3.4.142\"}");
11204
11204
 
11205
11205
  /***/ }),
11206
11206
 
@@ -26945,13 +26945,13 @@ var notification_componentObj = Object(external_commonjs_vue_commonjs2_vue_root_
26945
26945
  var notification_rootId = 'ev-notification-modal';
26946
26946
  var notification_root = document.createElement('div');
26947
26947
  notification_root.id = notification_rootId;
26948
- var notification_positionList = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
26948
+ var positionList = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];
26949
26949
 
26950
26950
  var notification_notification = function notification() {
26951
26951
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26952
26952
  var position = options.position || 'top-right';
26953
26953
 
26954
- if (!notification_positionList.includes(position)) {
26954
+ if (!positionList.includes(position)) {
26955
26955
  console.warn('[EVUI][Notification] The position value is incorrectly entered.');
26956
26956
  return;
26957
26957
  }
@@ -38885,10 +38885,6 @@ function isNil(value) {
38885
38885
 
38886
38886
 
38887
38887
 
38888
-
38889
-
38890
-
38891
-
38892
38888
 
38893
38889
 
38894
38890
 
@@ -39895,190 +39891,6 @@ var modules = {
39895
39891
  };
39896
39892
  },
39897
39893
 
39898
- /**
39899
- * Find seriesId by position x and y
39900
- * @param {array} offset position x and y
39901
- *
39902
- * @returns {object} clicked series id
39903
- */
39904
- getSeriesInfoByPosition: function getSeriesInfoByPosition(offset) {
39905
- var _this8 = this;
39906
-
39907
- var _offset = _slicedToArray(offset, 2),
39908
- clickedX = _offset[0],
39909
- clickedY = _offset[1];
39910
-
39911
- var chartRect = this.chartRect;
39912
- var labelOffset = this.labelOffset;
39913
- var aPos = {
39914
- x1: chartRect.x1 + labelOffset.left,
39915
- x2: chartRect.x2 - labelOffset.right,
39916
- y1: chartRect.y1 + labelOffset.top,
39917
- y2: chartRect.y2 - labelOffset.bottom
39918
- };
39919
- var valueAxes = this.axesY[0];
39920
- var labelAxes = this.axesX[0];
39921
- var valueStartPoint = aPos[valueAxes.units.rectStart];
39922
- var valueEndPoint = aPos[valueAxes.units.rectEnd];
39923
- var labelStartPoint = aPos[labelAxes.units.rectStart];
39924
- var labelEndPoint = aPos[labelAxes.units.rectEnd];
39925
- var result = {
39926
- sId: null
39927
- };
39928
-
39929
- if (clickedY > valueEndPoint && clickedY < valueStartPoint && clickedX < labelEndPoint && clickedX > labelStartPoint) {
39930
- var hitSeries;
39931
- var positionList;
39932
- var hitItem = this.findHitItem(offset);
39933
- var hitSeriesList = Object.keys(hitItem.items);
39934
-
39935
- switch (this.options.type) {
39936
- case 'line':
39937
- {
39938
- var orderedSeriesList = this.seriesInfo.charts.line;
39939
- var isStackChart = Object.values(this.seriesList).some(function (_ref3) {
39940
- var stackIndex = _ref3.stackIndex;
39941
- return stackIndex;
39942
- });
39943
-
39944
- if (hitSeriesList.length) {
39945
- // 클릭한 위치에 data 가 존재하는 경우
39946
- if (isStackChart) {
39947
- var _positionList$find;
39948
-
39949
- positionList = orderedSeriesList.filter(function (sId) {
39950
- return hitSeriesList.includes(sId);
39951
- }).map(function (sId) {
39952
- var _hitItem$items$sId, _hitItem$items$sId$da;
39953
-
39954
- return {
39955
- sId: sId,
39956
- 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
39957
- };
39958
- });
39959
- hitSeries = (_positionList$find = positionList.find(function (_ref4) {
39960
- var position = _ref4.position;
39961
- return clickedY > position;
39962
- })) === null || _positionList$find === void 0 ? void 0 : _positionList$find.sId;
39963
- } else {
39964
- var _Object$entries$find;
39965
-
39966
- hitSeries = (_Object$entries$find = Object.entries(hitItem.items).find(function (_ref5) {
39967
- var _ref6 = _slicedToArray(_ref5, 2),
39968
- hit = _ref6[1].hit;
39969
-
39970
- return hit;
39971
- })) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0];
39972
- }
39973
- } else {
39974
- var _positionList$0$posit;
39975
-
39976
- // 클릭한 위치에 data 가 존재하지 않는 경우
39977
- var visibleSeriesList = orderedSeriesList.filter(function (sId) {
39978
- return _this8.seriesList[sId].show;
39979
- });
39980
- positionList = visibleSeriesList.map(function (sId) {
39981
- var _this8$seriesList$sId;
39982
-
39983
- return {
39984
- sId: sId,
39985
- position: (_this8$seriesList$sId = _this8.seriesList[sId].data) === null || _this8$seriesList$sId === void 0 ? void 0 : _this8$seriesList$sId.map(function (_ref7) {
39986
- var xp = _ref7.xp,
39987
- yp = _ref7.yp;
39988
- return [xp, yp];
39989
- })
39990
- };
39991
- });
39992
- var dataIndex = (_positionList$0$posit = positionList[0].position) === null || _positionList$0$posit === void 0 ? void 0 : _positionList$0$posit.findIndex(function (_ref8) {
39993
- var _ref9 = _slicedToArray(_ref8, 1),
39994
- xp = _ref9[0];
39995
-
39996
- return xp >= clickedX;
39997
- });
39998
- var vectorList = positionList.map(function (_ref10) {
39999
- var sId = _ref10.sId,
40000
- position = _ref10.position;
40001
- return {
40002
- sId: sId,
40003
- vector: {
40004
- start: position[dataIndex - 1],
40005
- end: position[dataIndex]
40006
- }
40007
- };
40008
- });
40009
-
40010
- var isEmptyVector = function isEmptyVector(arr) {
40011
- return !arr || !Array.isArray(arr) || (arr === null || arr === void 0 ? void 0 : arr.length) !== 2;
40012
- }; // canvas 의 클릭 위치값은 제 4 사분면의 위치이므로 clickedY, y1, y2 의 값은 음수를 취한다.
40013
-
40014
-
40015
- if (isStackChart) {
40016
- var _vectorList$find;
40017
-
40018
- hitSeries = (_vectorList$find = vectorList.find(function (_ref11) {
40019
- var vector = _ref11.vector;
40020
-
40021
- if (isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.start) && isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.end)) {
40022
- return false;
40023
- }
40024
-
40025
- var _vector$start = _slicedToArray(vector.start, 2),
40026
- x1 = _vector$start[0],
40027
- y1 = _vector$start[1];
40028
-
40029
- var _vector$end = _slicedToArray(vector.end, 2),
40030
- x2 = _vector$end[0],
40031
- y2 = _vector$end[1];
40032
-
40033
- var v1 = [x2 - x1, y1 - y2];
40034
- var v2 = [x2 - clickedX, clickedY - y2];
40035
- var xp = v1[0] * v2[1] - v1[1] * v2[0];
40036
- return vector.start.every(function (v) {
40037
- return typeof v === 'number';
40038
- }) && vector.end.every(function (v) {
40039
- return typeof v === 'number';
40040
- }) && xp > 0;
40041
- })) === null || _vectorList$find === void 0 ? void 0 : _vectorList$find.sId;
40042
- } else {
40043
- var _vectorList$find2;
40044
-
40045
- hitSeries = (_vectorList$find2 = vectorList.find(function (_ref12) {
40046
- var vector = _ref12.vector;
40047
-
40048
- if (isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.start) && isEmptyVector(vector === null || vector === void 0 ? void 0 : vector.end)) {
40049
- return false;
40050
- }
40051
-
40052
- var _vector$start2 = _slicedToArray(vector.start, 2),
40053
- x1 = _vector$start2[0],
40054
- y1 = _vector$start2[1];
40055
-
40056
- var _vector$end2 = _slicedToArray(vector.end, 2),
40057
- x2 = _vector$end2[0],
40058
- y2 = _vector$end2[1];
40059
-
40060
- var a = (y1 - y2) / (x2 - x1);
40061
- var b = -1;
40062
- var c = -y1 - a * x1;
40063
- var distance = Math.abs(a * clickedX - b * clickedY + c) / Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
40064
- return distance < 3;
40065
- })) === null || _vectorList$find2 === void 0 ? void 0 : _vectorList$find2.sId;
40066
- }
40067
- }
40068
-
40069
- break;
40070
- }
40071
-
40072
- default:
40073
- break;
40074
- }
40075
-
40076
- result.sId = hitSeries;
40077
- }
40078
-
40079
- return result;
40080
- },
40081
-
40082
39894
  /**
40083
39895
  * @typedef {Object} LabelInfoResult
40084
39896
  * @property {number} labelIndex - 선택된 라벨의 인덱스
@@ -40095,9 +39907,9 @@ var modules = {
40095
39907
  getLabelInfoByPosition: function getLabelInfoByPosition(offset, targetAxis) {
40096
39908
  var _Object$values$sort$, _Object$values$sort$2, _scrollbarOpt, _scale, _scale$labels, _scale3, _scale3$labels;
40097
39909
 
40098
- var _offset2 = _slicedToArray(offset, 2),
40099
- x = _offset2[0],
40100
- y = _offset2[1];
39910
+ var _offset = _slicedToArray(offset, 2),
39911
+ x = _offset[0],
39912
+ y = _offset[1];
40101
39913
 
40102
39914
  var aPos = {
40103
39915
  x1: this.chartRect.x1 + this.labelOffset.left,
@@ -40107,9 +39919,9 @@ var modules = {
40107
39919
  };
40108
39920
  var seriesList = this.data.series;
40109
39921
  var pointSize = (_Object$values$sort$ = (_Object$values$sort$2 = Object.values(seriesList).sort(function (a, b) {
40110
- var _ref13, _b$pointSize;
39922
+ var _ref3, _b$pointSize;
40111
39923
 
40112
- return (_ref13 = (_b$pointSize = b.pointSize) !== null && _b$pointSize !== void 0 ? _b$pointSize : 0 - a.pointSize) !== null && _ref13 !== void 0 ? _ref13 : 0;
39924
+ return (_ref3 = (_b$pointSize = b.pointSize) !== null && _b$pointSize !== void 0 ? _b$pointSize : 0 - a.pointSize) !== null && _ref3 !== void 0 ? _ref3 : 0;
40113
39925
  })[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
40114
39926
 
40115
39927
  var _this$options = this.options,
@@ -40141,10 +39953,10 @@ var modules = {
40141
39953
  _scrollbarOpt2$interv = _scrollbarOpt2.interval,
40142
39954
  interval = _scrollbarOpt2$interv === void 0 ? 1 : _scrollbarOpt2$interv;
40143
39955
 
40144
- var _ref14 = range !== null && range !== void 0 ? range : [0, scale.labels.length],
40145
- _ref15 = _slicedToArray(_ref14, 2),
40146
- min = _ref15[0],
40147
- max = _ref15[1];
39956
+ var _ref4 = range !== null && range !== void 0 ? range : [0, scale.labels.length],
39957
+ _ref5 = _slicedToArray(_ref4, 2),
39958
+ min = _ref5[0],
39959
+ max = _ref5[1];
40148
39960
 
40149
39961
  var labelCount = Math.floor((+max - +min) / interval) + 1;
40150
39962
  var labelGap = (endPoint - startPoint) / labelCount;
@@ -40207,7 +40019,7 @@ var modules = {
40207
40019
  * @returns {MouseLabelValue} current mouse target label value
40208
40020
  */
40209
40021
  getCurMouseLabelVal: function getCurMouseLabelVal(targetAxis, offset, labelIndex) {
40210
- var _this9 = this;
40022
+ var _this8 = this;
40211
40023
 
40212
40024
  var _this$options2 = this.options,
40213
40025
  chartType = _this$options2.type,
@@ -40224,13 +40036,13 @@ var modules = {
40224
40036
  case 'bar':
40225
40037
  case 'line':
40226
40038
  {
40227
- result = horizontal && !isXAxis || !horizontal && isXAxis ? _this9.data.labels[labelIndex] : '';
40039
+ result = horizontal && !isXAxis || !horizontal && isXAxis ? _this8.data.labels[labelIndex] : '';
40228
40040
  break;
40229
40041
  }
40230
40042
 
40231
40043
  case 'heatMap':
40232
40044
  {
40233
- result = _this9.data.labels[targetAxisDirection][labelIndex];
40045
+ result = _this8.data.labels[targetAxisDirection][labelIndex];
40234
40046
  break;
40235
40047
  }
40236
40048
 
@@ -40244,19 +40056,19 @@ var modules = {
40244
40056
  var calLabelValUseMousePos = function calLabelValUseMousePos() {
40245
40057
  var result = '';
40246
40058
  var aPos = {
40247
- x1: _this9.chartRect.x1 + _this9.labelOffset.left,
40248
- x2: _this9.chartRect.x2 - _this9.labelOffset.right,
40249
- y1: _this9.chartRect.y1 + _this9.labelOffset.top,
40250
- y2: _this9.chartRect.y2 - _this9.labelOffset.bottom
40059
+ x1: _this8.chartRect.x1 + _this8.labelOffset.left,
40060
+ x2: _this8.chartRect.x2 - _this8.labelOffset.right,
40061
+ y1: _this8.chartRect.y1 + _this8.labelOffset.top,
40062
+ y2: _this8.chartRect.y2 - _this8.labelOffset.bottom
40251
40063
  };
40252
- var _this9$axesSteps$targ = _this9.axesSteps[targetAxisDirection][0],
40253
- steps = _this9$axesSteps$targ.steps,
40254
- labelValInterval = _this9$axesSteps$targ.interval,
40255
- graphMin = _this9$axesSteps$targ.graphMin;
40256
- var _this9$axesRange$targ = _this9.axesRange[targetAxisDirection][0].size,
40257
- labelWidth = _this9$axesRange$targ.width,
40258
- labelHeight = _this9$axesRange$targ.height;
40259
- var axes = isXAxis ? _this9.axesX : _this9.axesY;
40064
+ var _this8$axesSteps$targ = _this8.axesSteps[targetAxisDirection][0],
40065
+ steps = _this8$axesSteps$targ.steps,
40066
+ labelValInterval = _this8$axesSteps$targ.interval,
40067
+ graphMin = _this8$axesSteps$targ.graphMin;
40068
+ var _this8$axesRange$targ = _this8.axesRange[targetAxisDirection][0].size,
40069
+ labelWidth = _this8$axesRange$targ.width,
40070
+ labelHeight = _this8$axesRange$targ.height;
40071
+ var axes = isXAxis ? _this8.axesX : _this8.axesY;
40260
40072
  var axisStartPoint = aPos[axes[0].units.rectStart];
40261
40073
  var axisEndPoint = aPos[axes[0].units.rectEnd];
40262
40074
  var curMousePosInAxis = Math.abs(offset[isXAxis ? 0 : 1] - axisStartPoint);
@@ -40294,7 +40106,7 @@ var modules = {
40294
40106
  * @returns {object} min/max info for all of data
40295
40107
  */
40296
40108
  getStoreMinMax: function getStoreMinMax() {
40297
- var _this10 = this;
40109
+ var _this9 = this;
40298
40110
 
40299
40111
  var keys = Object.keys(this.seriesList);
40300
40112
  var isHorizontal = this.options.horizontal;
@@ -40312,7 +40124,7 @@ var modules = {
40312
40124
  if (keys.length) {
40313
40125
  return keys.reduce(function (acc, key) {
40314
40126
  var minmax = acc;
40315
- var series = _this10.seriesList[key];
40127
+ var series = _this9.seriesList[key];
40316
40128
  var smm = series.minMax;
40317
40129
  var axisX = series.xAxisIndex;
40318
40130
  var axisY = series.yAxisIndex;
@@ -51406,10 +51218,8 @@ var plugins_interaction_modules = {
51406
51218
  var hitItemId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
51407
51219
  var hitItem = hitInfo.items[hitItemId];
51408
51220
 
51409
- var seriesHitInfo = _this.getSeriesInfoByPosition(offset);
51410
-
51411
- if (seriesHitInfo.sId !== null) {
51412
- var allSelectedList = _this.updateSelectedSeriesInfo(seriesHitInfo.sId, true);
51221
+ if (hitItemId !== null) {
51222
+ var allSelectedList = _this.updateSelectedSeriesInfo(hitItemId, true);
51413
51223
 
51414
51224
  if (hitItem) {
51415
51225
  var _hitItem$data9, _hitItem$data10, _hitItem$data11, _allSelectedList$seri, _hitItem$data12;
@@ -51528,19 +51338,20 @@ var plugins_interaction_modules = {
51528
51338
  };
51529
51339
 
51530
51340
  var setSelectedSeriesInfo = function setSelectedSeriesInfo() {
51531
- var itemHitInfo = _this.getItemByPosition(offset, false);
51341
+ var hitInfo = _this.findHitItem(offset);
51532
51342
 
51533
- var hitInfo = _this.getSeriesInfoByPosition(offset);
51343
+ var hitItemId = hitInfo.hitId || Object.keys(hitInfo.items)[0];
51344
+ var hitItem = hitInfo.items[hitItemId];
51534
51345
 
51535
- if (hitInfo.sId !== null) {
51536
- var allSelectedList = _this.updateSelectedSeriesInfo(hitInfo.sId, false);
51346
+ if (hitItemId !== null) {
51347
+ var allSelectedList = _this.updateSelectedSeriesInfo(hitItemId, false);
51537
51348
 
51538
51349
  _this.defaultSelectInfo.seriesId = allSelectedList.seriesId;
51539
51350
  args.selected = _objectSpread2({
51540
51351
  eventTarget: 'series'
51541
51352
  }, lodash_es_cloneDeep(_this.defaultSelectInfo));
51542
- args.label = itemHitInfo.label;
51543
- args.dataIndex = itemHitInfo.maxIndex;
51353
+ args.label = hitItem.label;
51354
+ args.dataIndex = hitItem.maxIndex;
51544
51355
  }
51545
51356
  };
51546
51357
 
@@ -52158,7 +51969,8 @@ var plugins_interaction_modules = {
52158
51969
  var maxsw = 0;
52159
51970
  var maxv = '';
52160
51971
  var maxg = null;
52161
- var maxSID = null; // 1. 먼저 공통으로 사용할 데이터 인덱스 결정
51972
+ var maxSID = null;
51973
+ var minDistance = Infinity; // 1. 먼저 공통으로 사용할 데이터 인덱스 결정
52162
51974
 
52163
51975
  var targetDataIndex = this.findClosestDataIndex(offset, sIds);
52164
51976
 
@@ -52231,10 +52043,16 @@ var plugins_interaction_modules = {
52231
52043
  if (maxg === null || maxg <= gdata) {
52232
52044
  maxg = gdata;
52233
52045
  maxSID = sId;
52234
- }
52046
+ } // 마우스 위치와의 거리 계산하여 가장 가까운 시리즈 선택
52047
+
52235
52048
 
52236
- if (item.hit) {
52237
- hitId = sId;
52049
+ if (item.hit && item.data.xp !== undefined && item.data.yp !== undefined) {
52050
+ var distance = Math.pow(item.data.xp - offset[0], 2) + Math.pow(item.data.yp - offset[1], 2);
52051
+
52052
+ if (distance < minDistance) {
52053
+ minDistance = distance;
52054
+ hitId = sId;
52055
+ }
52238
52056
  }
52239
52057
  }
52240
52058
  }