evui 3.4.149 → 3.4.151

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.
@@ -11227,7 +11227,7 @@ var update = add("9519e5b6", content, true, {"sourceMap":false,"shadowMode":fals
11227
11227
  /***/ "9224":
11228
11228
  /***/ (function(module) {
11229
11229
 
11230
- module.exports = JSON.parse("{\"a\":\"3.4.149\"}");
11230
+ module.exports = JSON.parse("{\"a\":\"3.4.151\"}");
11231
11231
 
11232
11232
  /***/ }),
11233
11233
 
@@ -39044,18 +39044,17 @@ var modules = {
39044
39044
  };
39045
39045
 
39046
39046
  for (var x = 0; x < keys.length; x++) {
39047
- var _this$dataSet$key$dat, _this$dataSet$key$dat2, _this$dataSet$key$dat3;
39047
+ var _dataGroup$at, _dataGroup$at$data, _dataGroup$at$data$at;
39048
39048
 
39049
39049
  var key = keys[x];
39050
39050
  var data = datas[key];
39051
- var storeLength = data === null || data === void 0 ? void 0 : data.length;
39052
- var lastTime = 0;
39051
+ var storeLength = data === null || data === void 0 ? void 0 : data.length; // 1) init / updateSeries 시 dataset shape 보장
39053
39052
 
39054
- if (!this.isInit || this.updateSeries) {
39053
+ if (!this.isInit || this.updateSeries || !this.dataSet[key]) {
39055
39054
  var defaultValues = {
39056
39055
  dataGroup: [],
39057
39056
  startIndex: 0,
39058
- endIndex: 0,
39057
+ endIndex: null,
39059
39058
  length: 0,
39060
39059
  fromTime: 0,
39061
39060
  toTime: 0
@@ -39063,104 +39062,132 @@ var modules = {
39063
39062
  this.dataSet[key] = _objectSpread2(_objectSpread2({}, defaultValues), this.dataSet[key]);
39064
39063
  }
39065
39064
 
39066
- this.dataSet[key].length = this.options.realTimeScatter.range || 300;
39065
+ var dataset = this.dataSet[key];
39066
+ var dataGroup = dataset.dataGroup; // 2) range(length) 결정 + 변경 감지
39067
+
39068
+ var nextLength = this.options.realTimeScatter.range || 300;
39069
+ var lengthChanged = dataset.length !== nextLength;
39070
+ dataset.length = nextLength;
39071
+ var length = dataset.length; // 3) 이번 배치의 lastTime(초 단위) 계산
39072
+
39073
+ var lastTime = 0;
39067
39074
 
39068
39075
  for (var i = 0; i < storeLength; i++) {
39069
39076
  var item = data[i];
39070
39077
 
39071
- if (lastTime < item.x) {
39078
+ if (item && lastTime < item.x) {
39072
39079
  lastTime = item.x;
39073
39080
  }
39074
39081
  }
39075
39082
 
39076
- lastTime = Math.floor(lastTime / 1000) * 1000;
39077
- var dataGroupLastTime = ((_this$dataSet$key$dat = this.dataSet[key].dataGroup.at(-1)) === null || _this$dataSet$key$dat === void 0 ? void 0 : (_this$dataSet$key$dat2 = _this$dataSet$key$dat.data) === null || _this$dataSet$key$dat2 === void 0 ? void 0 : (_this$dataSet$key$dat3 = _this$dataSet$key$dat2.at(-1)) === null || _this$dataSet$key$dat3 === void 0 ? void 0 : _this$dataSet$key$dat3.x) || Date.now();
39078
- this.dataSet[key].toTime = lastTime || (dataGroupLastTime ? Math.floor(dataGroupLastTime / 1000) * 1000 : 0);
39079
- this.dataSet[key].fromTime = this.dataSet[key].toTime - this.dataSet[key].length * 1000;
39080
- this.dataSet[key].endIndex = this.dataSet[key].length - 1;
39083
+ lastTime = lastTime ? Math.floor(lastTime / 1000) * 1000 : 0;
39084
+ var dataGroupLastTime = ((_dataGroup$at = dataGroup.at(-1)) === null || _dataGroup$at === void 0 ? void 0 : (_dataGroup$at$data = _dataGroup$at.data) === null || _dataGroup$at$data === void 0 ? void 0 : (_dataGroup$at$data$at = _dataGroup$at$data.at(-1)) === null || _dataGroup$at$data$at === void 0 ? void 0 : _dataGroup$at$data$at.x) || Date.now();
39085
+ var fallbackTime = Math.floor(dataGroupLastTime / 1000) * 1000; // 4) prevToTime은 덮기 전 값 (없으면 fallback)
39081
39086
 
39082
- if ((this.dataSet[key].toTime - lastTime) / 1000 > this.dataSet[key].length && key === '') {
39083
- return;
39084
- }
39087
+ var prevToTime = dataset.toTime || fallbackTime; // 5) nextToTime 결정: 데이터가 있으면 lastTime, 없으면 이전 유지
39085
39088
 
39086
- var gapCount = (lastTime - this.dataSet[key].toTime) / 1000;
39089
+ var nextToTime = lastTime || prevToTime; // 6) endIndex/startIndex 초기화 (최초 1회) + length 변경 시 재구성
39087
39090
 
39088
- if (gapCount > 0) {
39089
- this.dataSet[key].toTime = lastTime;
39090
- this.dataSet[key].fromTime = lastTime - this.dataSet[key].length * 1000;
39091
- }
39091
+ if (dataset.endIndex == null || lengthChanged) {
39092
+ dataset.startIndex = 0;
39093
+ dataset.endIndex = length - 1; // dataGroup 크기 맞추고 모두 reset
39092
39094
 
39093
- for (var _i = 0; _i < this.dataSet[key].length; _i++) {
39094
- var _defaultValues = {
39095
- data: [],
39096
- max: 0,
39097
- min: Infinity
39098
- };
39099
- this.dataSet[key].dataGroup[_i] = _objectSpread2(_objectSpread2({}, _defaultValues), this.dataSet[key].dataGroup[_i]);
39095
+ dataGroup.length = length;
39096
+
39097
+ for (var _i = 0; _i < length; _i++) {
39098
+ dataGroup[_i] = dataGroup[_i] || {
39099
+ data: [],
39100
+ max: 0,
39101
+ min: Infinity
39102
+ };
39103
+ dataGroup[_i].data.length = 0;
39104
+ dataGroup[_i].max = 0;
39105
+ dataGroup[_i].min = Infinity;
39106
+ } // toTime/fromTime도 새 기준으로 맞춤
39107
+
39108
+
39109
+ dataset.toTime = nextToTime;
39110
+ dataset.fromTime = dataset.toTime - length * 1000;
39111
+ } // 7) gapCount 계산 (반드시 정수) — prevToTime 기준
39112
+
39113
+
39114
+ var rawGap = (nextToTime - prevToTime) / 1000;
39115
+ var gapCount = Number.isFinite(rawGap) ? Math.max(0, Math.floor(rawGap)) : 0; // 8) to/from 갱신
39116
+
39117
+ dataset.toTime = nextToTime;
39118
+ dataset.fromTime = dataset.toTime - length * 1000; // (원래 코드에 있던 early return 유지)
39119
+
39120
+ if (lastTime && (dataset.toTime - lastTime) / 1000 > length && key === '') {
39121
+ return;
39100
39122
  }
39101
39123
 
39102
- if (gapCount > 0) {
39103
- if (gapCount >= this.dataSet[key].length) {
39104
- for (var _i2 = 0; _i2 < this.dataSet[key].length; _i2++) {
39105
- this.dataSet[key].dataGroup[_i2].data.length = 0;
39106
- this.dataSet[key].dataGroup[_i2].max = 0;
39107
- this.dataSet[key].dataGroup[_i2].min = Infinity;
39108
- }
39124
+ var resetDataGroup = function resetDataGroup(group) {
39125
+ group.data.length = 0;
39126
+ group.max = 0;
39127
+ group.min = Infinity;
39128
+ }; // 9) dataGroup 슬롯 확보
39109
39129
 
39110
- this.dataSet[key].startIndex = 0;
39111
- this.dataSet[key].endIndex = this.dataSet[key].length - 1;
39112
- } else {
39113
- while (gapCount > 0) {
39114
- if (this.dataSet[key].dataGroup[this.dataSet[key].startIndex] === null) {
39115
- this.dataSet[key].dataGroup[this.dataSet[key].startIndex] = {
39116
- data: [],
39117
- max: 0,
39118
- min: Infinity
39119
- };
39120
- } else {
39121
- this.dataSet[key].dataGroup[this.dataSet[key].startIndex].data.length = 0;
39122
- this.dataSet[key].dataGroup[this.dataSet[key].startIndex].max = 0;
39123
- this.dataSet[key].dataGroup[this.dataSet[key].startIndex].min = Infinity;
39124
- }
39125
39130
 
39126
- ++this.dataSet[key].startIndex;
39131
+ for (var _i2 = 0; _i2 < length; _i2++) {
39132
+ if (!dataGroup[_i2]) {
39133
+ dataGroup[_i2] = {
39134
+ data: [],
39135
+ max: 0,
39136
+ min: Infinity
39137
+ };
39138
+ } else if (!dataGroup[_i2].data) {
39139
+ dataGroup[_i2].data = [];
39140
+ dataGroup[_i2].max = 0;
39141
+ dataGroup[_i2].min = Infinity;
39142
+ }
39143
+ } // 10) gap만큼 링 전진 + 지나간 버킷 clear
39127
39144
 
39128
- if (this.dataSet[key].startIndex >= this.dataSet[key].length) {
39129
- this.dataSet[key].startIndex = 0;
39130
- }
39131
39145
 
39132
- ++this.dataSet[key].endIndex;
39146
+ if (gapCount > 0) {
39147
+ if (gapCount >= length) {
39148
+ for (var _i3 = 0; _i3 < length; _i3++) {
39149
+ resetDataGroup(dataGroup[_i3]);
39150
+ }
39133
39151
 
39134
- if (this.dataSet[key].endIndex >= this.dataSet[key].length) {
39135
- this.dataSet[key].endIndex = 0;
39136
- }
39152
+ dataset.startIndex = 0;
39153
+ dataset.endIndex = length - 1;
39154
+ } else {
39155
+ var currentStart = dataset.startIndex;
39156
+ var currentEnd = dataset.endIndex;
39137
39157
 
39138
- --gapCount;
39158
+ for (var _i4 = 0; _i4 < gapCount; _i4++) {
39159
+ resetDataGroup(dataGroup[currentStart]);
39160
+ currentStart = (currentStart + 1) % length;
39161
+ currentEnd = (currentEnd + 1) % length;
39139
39162
  }
39163
+
39164
+ dataset.startIndex = currentStart;
39165
+ dataset.endIndex = currentEnd;
39140
39166
  }
39141
- }
39167
+ } // 11) 데이터 push (윈도우 안에 들어오는 것만)
39142
39168
 
39143
- for (var _i3 = 0; _i3 < storeLength; _i3++) {
39144
- var _item = data[_i3];
39145
- var xAxisTime = Math.floor(_item.x / 1000) * 1000;
39146
39169
 
39147
- if (this.dataSet[key].fromTime <= xAxisTime) {
39148
- var _item$value;
39170
+ for (var _i5 = 0; _i5 < storeLength; _i5++) {
39171
+ var _item = data[_i5];
39149
39172
 
39150
- var index = this.dataSet[key].endIndex - (this.dataSet[key].toTime - xAxisTime) / 1000;
39173
+ if (_item) {
39174
+ var xAxisTime = Math.floor(_item.x / 1000) * 1000;
39151
39175
 
39152
- if (index < 0) {
39153
- index = this.dataSet[key].length + index;
39154
- }
39176
+ if (dataset.fromTime <= xAxisTime) {
39177
+ var _item$value;
39155
39178
 
39156
- this.dataSet[key].dataGroup[index].data.push({
39157
- x: _item.x,
39158
- y: _item.y,
39159
- o: (_item$value = _item.value) !== null && _item$value !== void 0 ? _item$value : _item.y,
39160
- color: _item.color
39161
- });
39162
- this.dataSet[key].dataGroup[index].max = Math.max(this.dataSet[key].dataGroup[index].max, _item.y);
39163
- this.dataSet[key].dataGroup[index].min = Math.min(this.dataSet[key].dataGroup[index].min, _item.y);
39179
+ var index = dataset.endIndex - (dataset.toTime - xAxisTime) / 1000;
39180
+ if (index < 0) index = length + index;
39181
+ var group = dataGroup[index];
39182
+ group.data.push({
39183
+ x: _item.x,
39184
+ y: _item.y,
39185
+ o: (_item$value = _item.value) !== null && _item$value !== void 0 ? _item$value : _item.y,
39186
+ color: _item.color
39187
+ });
39188
+ group.max = Math.max(group.max, _item.y);
39189
+ group.min = Math.min(group.min, _item.y);
39190
+ }
39164
39191
  }
39165
39192
  } // 실제 차트에 그려지는 데이터(fromTime ~ toTime 범위)에서만 min/max 계산
39166
39193
 
@@ -39169,12 +39196,11 @@ var modules = {
39169
39196
  maxY: -Infinity,
39170
39197
  minY: Infinity
39171
39198
  };
39172
- var _this$dataSet$key = this.dataSet[key],
39173
- fromTime = _this$dataSet$key.fromTime,
39174
- toTime = _this$dataSet$key.toTime;
39199
+ var fromTime = dataset.fromTime,
39200
+ toTime = dataset.toTime;
39175
39201
 
39176
- for (var _i4 = 0; _i4 < this.dataSet[key].length; _i4++) {
39177
- var groupData = this.dataSet[key].dataGroup[_i4].data;
39202
+ for (var _i6 = 0; _i6 < length; _i6++) {
39203
+ var groupData = dataGroup[_i6].data;
39178
39204
 
39179
39205
  for (var j = 0; j < groupData.length; j++) {
39180
39206
  var _item2 = groupData[j]; // 현재 시간 범위 내의 데이터만 minMax 계산에 포함
@@ -39202,8 +39228,8 @@ var modules = {
39202
39228
 
39203
39229
  minMaxValues.maxY = Math.max(minMaxValues.maxY, tempMinMax.maxY);
39204
39230
  minMaxValues.minY = Math.min(minMaxValues.minY, tempMinMax.minY);
39205
- minMaxValues.fromTime = this.dataSet[key].fromTime;
39206
- minMaxValues.toTime = this.dataSet[key].toTime;
39231
+ minMaxValues.fromTime = dataset.fromTime;
39232
+ minMaxValues.toTime = dataset.toTime;
39207
39233
  }
39208
39234
 
39209
39235
  this.seriesInfo.charts.scatter.forEach(function (seriesID) {
@@ -55475,11 +55501,7 @@ var chart_core_EvChart = /*#__PURE__*/function () {
55475
55501
  }, {
55476
55502
  key: "adjustXAndYAxisWidth",
55477
55503
  value: function adjustXAndYAxisWidth() {
55478
- var _this2 = this,
55479
- _this$axesRange,
55480
- _this$axesRange$x,
55481
- _this$axesRange2,
55482
- _this$axesRange2$y;
55504
+ var _this2 = this;
55483
55505
 
55484
55506
  var getNotFormattedLabels = function getNotFormattedLabels(axesSteps, axisType, axis) {
55485
55507
  var _ref2 = axesSteps !== null && axesSteps !== void 0 ? axesSteps : {},
@@ -55523,42 +55545,51 @@ var chart_core_EvChart = /*#__PURE__*/function () {
55523
55545
  return result;
55524
55546
  };
55525
55547
 
55526
- var adjustedRange = {
55527
- x: (_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, index) {
55528
- var _this2$axesSteps, _axis$labelStyle, _axis$getLabelWidthHa, _axis$getLabelWidthHa2;
55529
-
55530
- var axis = _this2.axesX[index];
55531
- var axesSteps = (_this2$axesSteps = _this2.axesSteps) === null || _this2$axesSteps === void 0 ? void 0 : _this2$axesSteps.x[index];
55532
- var notFormattedLabels = getNotFormattedLabels(axesSteps, 'x', axis);
55533
- var fixWidth = truthyNumber(axis === null || axis === void 0 ? void 0 : (_axis$labelStyle = axis.labelStyle) === null || _axis$labelStyle === void 0 ? void 0 : _axis$labelStyle.fixWidth) ? axis.labelStyle.fixWidth : 0;
55534
- var maxWidth = (_axis$getLabelWidthHa = axis === null || axis === void 0 ? void 0 : (_axis$getLabelWidthHa2 = axis.getLabelWidthHasMaxLength) === null || _axis$getLabelWidthHa2 === void 0 ? void 0 : _axis$getLabelWidthHa2.call(axis, notFormattedLabels, _this2.chartRect)) !== null && _axis$getLabelWidthHa !== void 0 ? _axis$getLabelWidthHa : 0;
55535
- return _objectSpread2(_objectSpread2({}, value), {}, {
55536
- size: {
55537
- width: fixWidth || Math.max(maxWidth, value.size.width),
55538
- height: value.size.height
55539
- }
55540
- });
55541
- }),
55542
- y: (_this$axesRange2 = this.axesRange) === null || _this$axesRange2 === void 0 ? void 0 : (_this$axesRange2$y = _this$axesRange2.y) === null || _this$axesRange2$y === void 0 ? void 0 : _this$axesRange2$y.map(function (value, index) {
55543
- var _this2$axesSteps2, _axis$labelStyle2, _axis$getLabelWidthHa3, _axis$getLabelWidthHa4;
55544
-
55545
- var axis = _this2.axesY[index];
55546
- var axesSteps = (_this2$axesSteps2 = _this2.axesSteps) === null || _this2$axesSteps2 === void 0 ? void 0 : _this2$axesSteps2.y[index];
55547
- var notFormattedLabels = getNotFormattedLabels(axesSteps, 'y', axis);
55548
- var fixWidth = truthyNumber(axis === null || axis === void 0 ? void 0 : (_axis$labelStyle2 = axis.labelStyle) === null || _axis$labelStyle2 === void 0 ? void 0 : _axis$labelStyle2.fixWidth) ? axis.labelStyle.fixWidth : 0;
55549
- var maxWidth = (_axis$getLabelWidthHa3 = axis === null || axis === void 0 ? void 0 : (_axis$getLabelWidthHa4 = axis.getLabelWidthHasMaxLength) === null || _axis$getLabelWidthHa4 === void 0 ? void 0 : _axis$getLabelWidthHa4.call(axis, notFormattedLabels, _this2.chartRect)) !== null && _axis$getLabelWidthHa3 !== void 0 ? _axis$getLabelWidthHa3 : 0;
55550
- return _objectSpread2(_objectSpread2({}, value), {}, {
55551
- size: {
55552
- width: fixWidth || Math.max(maxWidth, value.size.width),
55553
- height: value.size.height
55554
- }
55555
- });
55556
- })
55548
+ var remeasureRange = function remeasureRange(currentRange) {
55549
+ var _currentRange$x, _currentRange$y;
55550
+
55551
+ return {
55552
+ x: currentRange === null || currentRange === void 0 ? void 0 : (_currentRange$x = currentRange.x) === null || _currentRange$x === void 0 ? void 0 : _currentRange$x.map(function (value, index) {
55553
+ var _this2$axesSteps, _axis$labelStyle, _axis$getLabelWidthHa, _axis$getLabelWidthHa2;
55554
+
55555
+ var axis = _this2.axesX[index];
55556
+ var axesSteps = (_this2$axesSteps = _this2.axesSteps) === null || _this2$axesSteps === void 0 ? void 0 : _this2$axesSteps.x[index];
55557
+ var notFormattedLabels = getNotFormattedLabels(axesSteps, 'x', axis);
55558
+ var fixWidth = truthyNumber(axis === null || axis === void 0 ? void 0 : (_axis$labelStyle = axis.labelStyle) === null || _axis$labelStyle === void 0 ? void 0 : _axis$labelStyle.fixWidth) ? axis.labelStyle.fixWidth : 0;
55559
+ var maxWidth = (_axis$getLabelWidthHa = axis === null || axis === void 0 ? void 0 : (_axis$getLabelWidthHa2 = axis.getLabelWidthHasMaxLength) === null || _axis$getLabelWidthHa2 === void 0 ? void 0 : _axis$getLabelWidthHa2.call(axis, notFormattedLabels, _this2.chartRect)) !== null && _axis$getLabelWidthHa !== void 0 ? _axis$getLabelWidthHa : 0;
55560
+ return _objectSpread2(_objectSpread2({}, value), {}, {
55561
+ size: {
55562
+ width: fixWidth || Math.max(maxWidth, value.size.width),
55563
+ height: value.size.height
55564
+ }
55565
+ });
55566
+ }),
55567
+ y: currentRange === null || currentRange === void 0 ? void 0 : (_currentRange$y = currentRange.y) === null || _currentRange$y === void 0 ? void 0 : _currentRange$y.map(function (value, index) {
55568
+ var _this2$axesSteps2, _axis$labelStyle2, _axis$getLabelWidthHa3, _axis$getLabelWidthHa4;
55569
+
55570
+ var axis = _this2.axesY[index];
55571
+ var axesSteps = (_this2$axesSteps2 = _this2.axesSteps) === null || _this2$axesSteps2 === void 0 ? void 0 : _this2$axesSteps2.y[index];
55572
+ var notFormattedLabels = getNotFormattedLabels(axesSteps, 'y', axis);
55573
+ var fixWidth = truthyNumber(axis === null || axis === void 0 ? void 0 : (_axis$labelStyle2 = axis.labelStyle) === null || _axis$labelStyle2 === void 0 ? void 0 : _axis$labelStyle2.fixWidth) ? axis.labelStyle.fixWidth : 0;
55574
+ var maxWidth = (_axis$getLabelWidthHa3 = axis === null || axis === void 0 ? void 0 : (_axis$getLabelWidthHa4 = axis.getLabelWidthHasMaxLength) === null || _axis$getLabelWidthHa4 === void 0 ? void 0 : _axis$getLabelWidthHa4.call(axis, notFormattedLabels, _this2.chartRect)) !== null && _axis$getLabelWidthHa3 !== void 0 ? _axis$getLabelWidthHa3 : 0;
55575
+ return _objectSpread2(_objectSpread2({}, value), {}, {
55576
+ size: {
55577
+ width: fixWidth || Math.max(maxWidth, value.size.width),
55578
+ height: value.size.height
55579
+ }
55580
+ });
55581
+ })
55582
+ };
55557
55583
  };
55558
- this.axesRange = adjustedRange;
55559
- this.labelOffset = this.getLabelOffset(adjustedRange);
55584
+
55585
+ this.axesRange = remeasureRange(this.axesRange);
55586
+ this.labelOffset = this.getLabelOffset(this.axesRange);
55560
55587
  this.labelRange = this.getAxesLabelRange();
55561
- this.axesSteps = this.calculateSteps();
55588
+ this.axesSteps = this.calculateSteps(); // 새로운 step 기준으로 라벨 너비를 다시 측정하여 잘림 방지
55589
+ // TODO: 추후 개선 (3.4.200 이후 버전)
55590
+
55591
+ this.axesRange = remeasureRange(this.axesRange);
55592
+ this.labelOffset = this.getLabelOffset(this.axesRange);
55562
55593
  }
55563
55594
  /**
55564
55595
  * To draw canvas chart, it processes several sequential jobs