evui 3.4.207 → 3.4.209
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/README.md +18 -33
- package/dist/404.html +44 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.js +22738 -0
- package/dist/index.umd.cjs +28 -0
- package/dist/style.css +1 -0
- package/package.json +46 -43
- package/dist/evui.common.js +0 -63681
- package/dist/evui.common.js.map +0 -1
- package/dist/evui.umd.js +0 -63691
- package/dist/evui.umd.js.map +0 -1
- package/dist/evui.umd.min.js +0 -2
- package/dist/evui.umd.min.js.map +0 -1
- package/dist/img/EVUI.b82ee81a.svg +0 -293
- package/src/assets/logo.png +0 -0
- package/src/common/emitter.js +0 -20
- package/src/common/utils.bignumber.js +0 -67
- package/src/common/utils.debounce.js +0 -223
- package/src/common/utils.js +0 -151
- package/src/common/utils.table.js +0 -78
- package/src/common/utils.throttle.js +0 -83
- package/src/common/utils.tree.js +0 -18
- package/src/components/button/Button.vue +0 -195
- package/src/components/button/index.js +0 -7
- package/src/components/buttonGroup/ButtonGroup.vue +0 -11
- package/src/components/buttonGroup/index.js +0 -7
- package/src/components/calendar/Calendar.vue +0 -725
- package/src/components/calendar/index.js +0 -7
- package/src/components/calendar/uses.js +0 -1410
- package/src/components/chart/Chart.vue +0 -363
- package/src/components/chart/ChartToolbar.vue +0 -52
- package/src/components/chart/chart.core.js +0 -1170
- package/src/components/chart/chartZoom.core.js +0 -540
- package/src/components/chart/element/element.bar.js +0 -672
- package/src/components/chart/element/element.bar.time.js +0 -166
- package/src/components/chart/element/element.heatmap.js +0 -743
- package/src/components/chart/element/element.line.js +0 -611
- package/src/components/chart/element/element.pie.js +0 -197
- package/src/components/chart/element/element.scatter.js +0 -320
- package/src/components/chart/element/element.tip.js +0 -717
- package/src/components/chart/helpers/helpers.canvas.js +0 -265
- package/src/components/chart/helpers/helpers.constant.js +0 -235
- package/src/components/chart/helpers/helpers.util.js +0 -400
- package/src/components/chart/index.js +0 -9
- package/src/components/chart/model/index.js +0 -50
- package/src/components/chart/model/model.series.js +0 -125
- package/src/components/chart/model/model.store.js +0 -1427
- package/src/components/chart/plugins/plugins.interaction.js +0 -1659
- package/src/components/chart/plugins/plugins.legend.gradient.js +0 -606
- package/src/components/chart/plugins/plugins.legend.js +0 -1543
- package/src/components/chart/plugins/plugins.pie.js +0 -254
- package/src/components/chart/plugins/plugins.scrollbar.js +0 -732
- package/src/components/chart/plugins/plugins.title.js +0 -61
- package/src/components/chart/plugins/plugins.tooltip.js +0 -1041
- package/src/components/chart/scale/scale.js +0 -951
- package/src/components/chart/scale/scale.linear.js +0 -268
- package/src/components/chart/scale/scale.logarithmic.js +0 -135
- package/src/components/chart/scale/scale.step.js +0 -430
- package/src/components/chart/scale/scale.time.category.js +0 -338
- package/src/components/chart/scale/scale.time.js +0 -49
- package/src/components/chart/style/chart.scss +0 -405
- package/src/components/chart/uses.js +0 -721
- package/src/components/chartBrush/ChartBrush.vue +0 -323
- package/src/components/chartBrush/chartBrush.core.js +0 -691
- package/src/components/chartBrush/index.js +0 -9
- package/src/components/chartBrush/uses.js +0 -23
- package/src/components/chartGroup/ChartGroup.vue +0 -144
- package/src/components/chartGroup/index.js +0 -9
- package/src/components/chartGroup/style/chartGroup.scss +0 -5
- package/src/components/chartGroup/uses.js +0 -53
- package/src/components/checkbox/Checkbox.vue +0 -229
- package/src/components/checkbox/index.js +0 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +0 -44
- package/src/components/checkboxGroup/index.js +0 -7
- package/src/components/contextMenu/ContextMenu.vue +0 -95
- package/src/components/contextMenu/MenuList.vue +0 -182
- package/src/components/contextMenu/index.js +0 -7
- package/src/components/contextMenu/uses.js +0 -223
- package/src/components/datePicker/DatePicker.vue +0 -504
- package/src/components/datePicker/index.js +0 -7
- package/src/components/datePicker/uses.js +0 -460
- package/src/components/grid/Grid.vue +0 -1535
- package/src/components/grid/GridColumnSetting.vue +0 -358
- package/src/components/grid/GridFilterSetting.vue +0 -323
- package/src/components/grid/GridPagination.vue +0 -75
- package/src/components/grid/GridSummary.vue +0 -314
- package/src/components/grid/GridToolbar.vue +0 -35
- package/src/components/grid/icon/icon-option-button.vue +0 -17
- package/src/components/grid/icon/icon-sort-button.vue +0 -67
- package/src/components/grid/index.js +0 -11
- package/src/components/grid/style/grid.scss +0 -417
- package/src/components/grid/uses.js +0 -1629
- package/src/components/icon/Icon.vue +0 -53
- package/src/components/icon/index.js +0 -8
- package/src/components/inputNumber/InputNumber.vue +0 -212
- package/src/components/inputNumber/index.js +0 -7
- package/src/components/inputNumber/uses.js +0 -217
- package/src/components/loading/Loading.vue +0 -125
- package/src/components/loading/index.js +0 -7
- package/src/components/menu/Menu.vue +0 -79
- package/src/components/menu/MenuItem.vue +0 -201
- package/src/components/menu/index.js +0 -7
- package/src/components/message/Message.vue +0 -229
- package/src/components/message/index.js +0 -34
- package/src/components/messageBox/MessageBox.vue +0 -358
- package/src/components/messageBox/index.js +0 -22
- package/src/components/notification/Notification.vue +0 -316
- package/src/components/notification/index.js +0 -49
- package/src/components/pagination/Pagination.vue +0 -317
- package/src/components/pagination/index.js +0 -7
- package/src/components/pagination/pageButton.vue +0 -31
- package/src/components/progress/Progress.vue +0 -139
- package/src/components/progress/index.js +0 -7
- package/src/components/radio/Radio.vue +0 -159
- package/src/components/radio/index.js +0 -7
- package/src/components/radioGroup/RadioGroup.vue +0 -41
- package/src/components/radioGroup/index.js +0 -7
- package/src/components/scheduler/Scheduler.vue +0 -149
- package/src/components/scheduler/index.js +0 -7
- package/src/components/scheduler/uses.js +0 -183
- package/src/components/select/Select.vue +0 -556
- package/src/components/select/index.js +0 -7
- package/src/components/select/uses.js +0 -379
- package/src/components/slider/Slider.vue +0 -505
- package/src/components/slider/index.js +0 -7
- package/src/components/slider/uses.js +0 -391
- package/src/components/tabPanel/TabPanel.vue +0 -74
- package/src/components/tabPanel/index.js +0 -7
- package/src/components/tabs/Tabs.vue +0 -517
- package/src/components/tabs/index.js +0 -7
- package/src/components/textField/TextField.vue +0 -399
- package/src/components/textField/index.js +0 -7
- package/src/components/timePicker/TimePicker.vue +0 -364
- package/src/components/timePicker/index.js +0 -7
- package/src/components/toggle/Toggle.vue +0 -115
- package/src/components/toggle/index.js +0 -7
- package/src/components/tree/Tree.vue +0 -338
- package/src/components/tree/TreeNode.vue +0 -293
- package/src/components/tree/index.js +0 -7
- package/src/components/treeGrid/TreeGrid.vue +0 -1074
- package/src/components/treeGrid/TreeGridNode.vue +0 -349
- package/src/components/treeGrid/TreeGridToolbar.vue +0 -35
- package/src/components/treeGrid/icon/icon-tree.png +0 -0
- package/src/components/treeGrid/index.js +0 -9
- package/src/components/treeGrid/style/treeGrid.scss +0 -277
- package/src/components/treeGrid/uses.js +0 -1178
- package/src/components/window/Window.vue +0 -329
- package/src/components/window/index.js +0 -7
- package/src/components/window/uses.js +0 -908
- package/src/directives/clickoutside.js +0 -90
- package/src/main.js +0 -120
- package/src/style/components/input.scss +0 -108
- package/src/style/functions.scss +0 -3
- package/src/style/index.scss +0 -6
- package/src/style/lib/fonts/EVUI.eot +0 -0
- package/src/style/lib/fonts/EVUI.svg +0 -293
- package/src/style/lib/fonts/EVUI.ttf +0 -0
- package/src/style/lib/fonts/EVUI.woff +0 -0
- package/src/style/lib/icon.css +0 -888
- package/src/style/mixins.scss +0 -94
- package/src/style/themes.scss +0 -69
- package/src/style/variables.scss +0 -22
|
@@ -1,540 +0,0 @@
|
|
|
1
|
-
export default class EvChartZoom {
|
|
2
|
-
constructor(
|
|
3
|
-
evChartInfo,
|
|
4
|
-
evChartClone,
|
|
5
|
-
evChartZoomOptions,
|
|
6
|
-
evChartToolbarRef,
|
|
7
|
-
isExecuteZoom,
|
|
8
|
-
brushIdx,
|
|
9
|
-
emitFunc,
|
|
10
|
-
) {
|
|
11
|
-
this.isExecuteZoom = isExecuteZoom;
|
|
12
|
-
this.evChartProps = evChartInfo.props;
|
|
13
|
-
this.evChartCloneData = evChartClone.data;
|
|
14
|
-
this.brushIdx = brushIdx;
|
|
15
|
-
|
|
16
|
-
const zoomOptions = evChartZoomOptions.zoom;
|
|
17
|
-
this.setEvChartZoomOptions(zoomOptions);
|
|
18
|
-
this.setIcon(evChartToolbarRef);
|
|
19
|
-
|
|
20
|
-
const cloneLabelsLastIdx = evChartClone.data[0].labels.length - 1;
|
|
21
|
-
this.cloneLabelsLastIdx = cloneLabelsLastIdx;
|
|
22
|
-
|
|
23
|
-
this.isAnimationFinish = true;
|
|
24
|
-
|
|
25
|
-
this.zoomAreaMemory = {
|
|
26
|
-
previous: [],
|
|
27
|
-
current: [[0, cloneLabelsLastIdx]],
|
|
28
|
-
latest: [],
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
if (emitFunc) {
|
|
32
|
-
this.emitFunc = emitFunc;
|
|
33
|
-
|
|
34
|
-
emitFunc.updateZoomStartIdx(0);
|
|
35
|
-
emitFunc.updateZoomEndIdx(cloneLabelsLastIdx);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (zoomOptions.useWheelMove) {
|
|
40
|
-
this.wrapWheelMoveZoomArea = this.wheelMoveZoomArea.bind(this);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.evChartDomContainers = zoomOptions.useAnimation
|
|
44
|
-
? this.drawAnimationCanvas(evChartInfo.dom) : evChartInfo.dom;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
setEvChartZoomOptions(options) {
|
|
48
|
-
this.evChartZoomOptions = options;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
setIcon(evChartToolbarRef) {
|
|
52
|
-
if (!evChartToolbarRef) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const dragZoomIcon = evChartToolbarRef.querySelector('.dragZoom');
|
|
57
|
-
|
|
58
|
-
this.resetIcon = evChartToolbarRef.querySelector('.reset');
|
|
59
|
-
this.previousIcon = evChartToolbarRef.querySelector('.previous');
|
|
60
|
-
this.latestIcon = evChartToolbarRef.querySelector('.latest');
|
|
61
|
-
this.dragZoomIcon = dragZoomIcon;
|
|
62
|
-
|
|
63
|
-
this.iconStyle(dragZoomIcon, 'enable');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
drawAnimationCanvas(evChartDom) {
|
|
67
|
-
evChartDom.forEach((dom) => {
|
|
68
|
-
const animationCanvas = document.createElement('canvas');
|
|
69
|
-
animationCanvas.setAttribute('style', 'display: block;');
|
|
70
|
-
animationCanvas.setAttribute('class', 'animation-canvas');
|
|
71
|
-
animationCanvas.style.position = 'absolute';
|
|
72
|
-
|
|
73
|
-
dom.appendChild(animationCanvas);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
return evChartDom;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
setEventListener(isUseZoomMode) {
|
|
80
|
-
const toggleEventListener = isUseZoomMode ? 'addEventListener' : 'removeEventListener';
|
|
81
|
-
this.isUseZoomMode = isUseZoomMode;
|
|
82
|
-
|
|
83
|
-
this.evChartDomContainers.forEach((dom) => {
|
|
84
|
-
dom[toggleEventListener]('wheel', this.wrapWheelMoveZoomArea);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
wheelMoveZoomArea(e) {
|
|
89
|
-
e.preventDefault();
|
|
90
|
-
const [zoomStartIdx, zoomEndIdx] = this.zoomAreaMemory.current[0];
|
|
91
|
-
|
|
92
|
-
if (zoomStartIdx === zoomEndIdx) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
let zoomMoveStartIdx;
|
|
97
|
-
let zoomMoveEndIdx;
|
|
98
|
-
if (e.deltaY > 0) {
|
|
99
|
-
if (!zoomStartIdx) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
zoomMoveStartIdx = zoomStartIdx - 1;
|
|
104
|
-
zoomMoveEndIdx = zoomEndIdx - 1;
|
|
105
|
-
} else {
|
|
106
|
-
if (zoomEndIdx === this.cloneLabelsLastIdx) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
zoomMoveStartIdx = zoomStartIdx + 1;
|
|
111
|
-
zoomMoveEndIdx = zoomEndIdx + 1;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
this.isUseToolbar = true;
|
|
115
|
-
this.executeZoom(zoomMoveStartIdx, zoomMoveEndIdx);
|
|
116
|
-
this.zoomAreaMemory.current[0] = [zoomMoveStartIdx, zoomMoveEndIdx];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
clickMoveZoomArea(direction) {
|
|
120
|
-
if (!this.zoomAreaMemory[direction].length) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const [zoomStartIdx, zoomEndIdx] = this.zoomAreaMemory[direction].pop();
|
|
125
|
-
|
|
126
|
-
this.isUseToolbar = true;
|
|
127
|
-
this.executeZoom(zoomStartIdx, zoomEndIdx);
|
|
128
|
-
this.setZoomAreaMemory(zoomStartIdx, zoomEndIdx, direction === 'previous' ? 'latest' : 'previous');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
dragZoom({ data: zoomInfoData, range: { dragSelectionInfo } }) {
|
|
132
|
-
const {
|
|
133
|
-
dragXsp,
|
|
134
|
-
dragXep,
|
|
135
|
-
exceptAxesYChartWidth,
|
|
136
|
-
chartTitle,
|
|
137
|
-
} = dragSelectionInfo;
|
|
138
|
-
const { options: evChartOptions, data: evChartData } = this.evChartProps;
|
|
139
|
-
|
|
140
|
-
const dragChartIdx = evChartOptions.length > 1 ? evChartOptions.findIndex(
|
|
141
|
-
option => (option?.title?.text ?? '') === chartTitle,
|
|
142
|
-
) : 0;
|
|
143
|
-
|
|
144
|
-
if (evChartOptions[dragChartIdx].axesX[0].type === 'time') {
|
|
145
|
-
const zoomSeries = zoomInfoData[0].items;
|
|
146
|
-
const zoomStartDate = zoomSeries[0].x;
|
|
147
|
-
const zoomEndDate = zoomSeries[zoomSeries.length - 1].x;
|
|
148
|
-
const currentChartDataLabels = evChartData[dragChartIdx].labels;
|
|
149
|
-
const cloneChartDataLabels = this.evChartCloneData[dragChartIdx].labels;
|
|
150
|
-
const [currentZoomStartIdx, currentZoomEndIdx] = this.zoomAreaMemory.current[0];
|
|
151
|
-
|
|
152
|
-
let newZoomStartIdx = cloneChartDataLabels.findIndex(
|
|
153
|
-
label => +label.$d === +zoomStartDate.$d,
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
let newZoomEndIdx = cloneChartDataLabels.findLastIndex(
|
|
157
|
-
label => +label.$d === +zoomEndDate.$d,
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
const calculateAxesXPosition = (zoomIdx) => {
|
|
161
|
-
const axesXInterval = exceptAxesYChartWidth / (currentChartDataLabels.length - 1);
|
|
162
|
-
|
|
163
|
-
return axesXInterval * (zoomIdx - currentZoomStartIdx);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
let newDragStartAxesX = calculateAxesXPosition(newZoomStartIdx);
|
|
167
|
-
|
|
168
|
-
if (newZoomStartIdx === newZoomEndIdx) {
|
|
169
|
-
// drag 영역에 한 포인트만 있을 경우
|
|
170
|
-
if (newDragStartAxesX - dragXsp >= dragXep - newDragStartAxesX) {
|
|
171
|
-
newZoomStartIdx -= 1;
|
|
172
|
-
} else {
|
|
173
|
-
newZoomEndIdx += 1;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (newZoomStartIdx === currentZoomStartIdx && newZoomEndIdx === currentZoomEndIdx) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (newZoomStartIdx - newZoomEndIdx === -1) {
|
|
182
|
-
newDragStartAxesX = calculateAxesXPosition(newZoomStartIdx);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const newDragEndAxesX = calculateAxesXPosition(newZoomEndIdx);
|
|
186
|
-
|
|
187
|
-
if (this.evChartZoomOptions.useAnimation) {
|
|
188
|
-
this.dragZoomAnimation(
|
|
189
|
-
dragSelectionInfo,
|
|
190
|
-
newZoomStartIdx,
|
|
191
|
-
newZoomEndIdx,
|
|
192
|
-
newDragStartAxesX,
|
|
193
|
-
newDragEndAxesX,
|
|
194
|
-
);
|
|
195
|
-
} else {
|
|
196
|
-
this.executeZoom(newZoomStartIdx, newZoomEndIdx);
|
|
197
|
-
this.setZoomAreaMemory(newZoomStartIdx, newZoomEndIdx);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
dragZoomAnimation(
|
|
203
|
-
dragSelectionInfo,
|
|
204
|
-
newZoomStartIdx,
|
|
205
|
-
newZoomEndIdx,
|
|
206
|
-
newDragStartAxesX,
|
|
207
|
-
newDragEndAxesX,
|
|
208
|
-
) {
|
|
209
|
-
const {
|
|
210
|
-
chartRange,
|
|
211
|
-
exceptAxesYChartWidth,
|
|
212
|
-
exceptAxesXChartHeight,
|
|
213
|
-
} = dragSelectionInfo;
|
|
214
|
-
const pixelRatio = window.devicePixelRatio || 1;
|
|
215
|
-
|
|
216
|
-
const displayAnimaionCanvas = Array.from(this.evChartDomContainers).map((container) => {
|
|
217
|
-
const animationCanvas = container.querySelector('.animation-canvas');
|
|
218
|
-
const displayCanvas = container.children[0];
|
|
219
|
-
|
|
220
|
-
return [displayCanvas, animationCanvas];
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
for (let idx = 0; idx < displayAnimaionCanvas.length; idx++) {
|
|
224
|
-
const [displayCanvas, animationCanvas] = displayAnimaionCanvas[idx];
|
|
225
|
-
|
|
226
|
-
const animationCtx = animationCanvas.getContext('2d');
|
|
227
|
-
|
|
228
|
-
animationCanvas.style.top = `${chartRange.y1}px`;
|
|
229
|
-
animationCanvas.style.left = `${chartRange.x1}px`;
|
|
230
|
-
|
|
231
|
-
animationCanvas.width = exceptAxesYChartWidth * pixelRatio;
|
|
232
|
-
animationCanvas.style.width = `${exceptAxesYChartWidth}px`;
|
|
233
|
-
animationCanvas.height = exceptAxesXChartHeight * pixelRatio;
|
|
234
|
-
animationCanvas.style.height = `${exceptAxesXChartHeight}px`;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (animationCanvas.style.display === 'none') {
|
|
238
|
-
animationCanvas.style.display = 'block';
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
this.isAnimationFinish = false;
|
|
242
|
-
this.isUseToolbar = true;
|
|
243
|
-
this.executeDragZoomAnimation(
|
|
244
|
-
displayCanvas,
|
|
245
|
-
animationCtx,
|
|
246
|
-
dragSelectionInfo,
|
|
247
|
-
newDragStartAxesX,
|
|
248
|
-
newDragEndAxesX,
|
|
249
|
-
).then((isAnimationFinish) => {
|
|
250
|
-
animationCanvas.style.display = 'none';
|
|
251
|
-
|
|
252
|
-
if (isAnimationFinish && idx === displayAnimaionCanvas.length - 1) {
|
|
253
|
-
this.isAnimationFinish = isAnimationFinish;
|
|
254
|
-
this.executeZoom(newZoomStartIdx, newZoomEndIdx);
|
|
255
|
-
this.setZoomAreaMemory(newZoomStartIdx, newZoomEndIdx);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
executeZoom(zoomStartIdx, zoomEndIdx) {
|
|
262
|
-
if (this.isExecuteZoom) {
|
|
263
|
-
this.isExecuteZoom.value = true;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
for (let idx = 0; idx < this.evChartCloneData.length; idx++) {
|
|
267
|
-
const {
|
|
268
|
-
data: cloneData,
|
|
269
|
-
labels: cloneLabels,
|
|
270
|
-
series: cloneSeries,
|
|
271
|
-
} = this.evChartCloneData[idx];
|
|
272
|
-
const evChartData = this.evChartProps.data[idx];
|
|
273
|
-
|
|
274
|
-
const cloneSeriesNames = Object.keys(cloneSeries);
|
|
275
|
-
|
|
276
|
-
for (let jdx = 0; jdx < cloneSeriesNames.length; jdx++) {
|
|
277
|
-
const cloneSeriesName = cloneSeriesNames[jdx];
|
|
278
|
-
|
|
279
|
-
evChartData.data[cloneSeriesName] = cloneData[cloneSeriesName].filter(
|
|
280
|
-
(d, dataIdx) => zoomStartIdx <= dataIdx && zoomEndIdx >= dataIdx,
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
evChartData.labels = cloneLabels.filter(
|
|
285
|
-
(l, labelIdx) => zoomStartIdx <= labelIdx && zoomEndIdx >= labelIdx,
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (!this.brushIdx.isUseButton && !this.brushIdx.isUseScroll) {
|
|
290
|
-
this.brushIdx.start = zoomStartIdx;
|
|
291
|
-
this.brushIdx.end = zoomEndIdx;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (this.emitFunc) {
|
|
295
|
-
this.emitFunc.updateZoomStartIdx(zoomStartIdx);
|
|
296
|
-
this.emitFunc.updateZoomEndIdx(zoomEndIdx);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
setBrushIdx(evChartClone, brushChartIdx) {
|
|
301
|
-
this.brushIdx.end = -1;
|
|
302
|
-
for (let i = 0; i < brushChartIdx.value.length; i++) {
|
|
303
|
-
const data = evChartClone.data[brushChartIdx.value[i]];
|
|
304
|
-
|
|
305
|
-
if (data.labels.length) {
|
|
306
|
-
this.brushIdx.start = 0;
|
|
307
|
-
this.brushIdx.end = data.labels.length - 1;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
updateEvChartCloneData(
|
|
313
|
-
evChartClone,
|
|
314
|
-
brushChartIdx,
|
|
315
|
-
isUseZoomMode,
|
|
316
|
-
isKeepZoomStatus,
|
|
317
|
-
) {
|
|
318
|
-
const cloneLabelsLastIdx = evChartClone.data[0].labels.length - 1;
|
|
319
|
-
this.cloneLabelsLastIdx = cloneLabelsLastIdx;
|
|
320
|
-
this.evChartCloneData = evChartClone.data;
|
|
321
|
-
|
|
322
|
-
if (isKeepZoomStatus) {
|
|
323
|
-
const curZoomMemory = this.zoomAreaMemory.current[0];
|
|
324
|
-
let zoomStartIdx = curZoomMemory[0];
|
|
325
|
-
let zoomEndIdx = curZoomMemory[1];
|
|
326
|
-
|
|
327
|
-
if (zoomStartIdx === 0 && zoomEndIdx === -1) {
|
|
328
|
-
zoomStartIdx = 0;
|
|
329
|
-
zoomEndIdx = cloneLabelsLastIdx;
|
|
330
|
-
|
|
331
|
-
this.zoomAreaMemory = {
|
|
332
|
-
previous: [],
|
|
333
|
-
current: [[zoomStartIdx, zoomEndIdx]],
|
|
334
|
-
latest: [],
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (this.emitFunc) {
|
|
339
|
-
this.emitFunc.updateZoomStartIdx(zoomStartIdx);
|
|
340
|
-
this.emitFunc.updateZoomEndIdx(zoomEndIdx);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
this.executeZoom(zoomStartIdx, zoomEndIdx);
|
|
344
|
-
} else {
|
|
345
|
-
if (this.dragZoomIcon) {
|
|
346
|
-
this.dragZoomIcon.classList.remove('active');
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
this.zoomAreaMemory = {
|
|
350
|
-
previous: [],
|
|
351
|
-
current: [[0, cloneLabelsLastIdx]],
|
|
352
|
-
latest: [],
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
if (this.emitFunc) {
|
|
356
|
-
this.emitFunc.updateZoomStartIdx(0);
|
|
357
|
-
this.emitFunc.updateZoomEndIdx(cloneLabelsLastIdx);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
this.setIconStyle(isUseZoomMode);
|
|
361
|
-
this.setBrushIdx(evChartClone, brushChartIdx);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
setZoomAreaMemory(zoomStartIdx, zoomEndIdx, direction) {
|
|
366
|
-
if (zoomStartIdx < 0 || zoomEndIdx <= 0) {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
const { previous, current, latest } = this.zoomAreaMemory;
|
|
371
|
-
const currentZoomArea = current.pop();
|
|
372
|
-
const { bufferMemoryCnt } = this.evChartZoomOptions;
|
|
373
|
-
|
|
374
|
-
if (direction) {
|
|
375
|
-
if (previous.length >= bufferMemoryCnt) {
|
|
376
|
-
previous.splice(0, previous.length - bufferMemoryCnt + 1);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
this.zoomAreaMemory[direction].push(currentZoomArea);
|
|
380
|
-
} else if (zoomStartIdx !== currentZoomArea[0] || zoomEndIdx !== currentZoomArea[1]) {
|
|
381
|
-
if (currentZoomArea[0] === 0 && currentZoomArea[1] === -1) {
|
|
382
|
-
previous.push([0, this.cloneLabelsLastIdx]);
|
|
383
|
-
} else {
|
|
384
|
-
previous.push(currentZoomArea);
|
|
385
|
-
}
|
|
386
|
-
latest.length = 0;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
current.push([zoomStartIdx, zoomEndIdx]);
|
|
390
|
-
|
|
391
|
-
this.setIconStyle(this.isUseZoomMode);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
executeDragZoomAnimation(
|
|
395
|
-
displayCanvas,
|
|
396
|
-
animationCtx,
|
|
397
|
-
dragSelectionInfo,
|
|
398
|
-
newDragStartAxesX,
|
|
399
|
-
newDragEndAxesX,
|
|
400
|
-
) {
|
|
401
|
-
const {
|
|
402
|
-
chartRange,
|
|
403
|
-
exceptAxesYChartWidth,
|
|
404
|
-
exceptAxesXChartHeight,
|
|
405
|
-
} = dragSelectionInfo;
|
|
406
|
-
|
|
407
|
-
let leftDx = 0;
|
|
408
|
-
let centerDx = newDragStartAxesX;
|
|
409
|
-
let centerDWidth = newDragEndAxesX - newDragStartAxesX;
|
|
410
|
-
let rightDx = newDragEndAxesX;
|
|
411
|
-
|
|
412
|
-
let globalAlpha = 1;
|
|
413
|
-
const globalAlphaSensitivity = 0.0015;
|
|
414
|
-
|
|
415
|
-
let evChartOpacity = 0.5;
|
|
416
|
-
const evChartMinOpacity = 0.1;
|
|
417
|
-
const evChartOpacitySensitivity = 0.05;
|
|
418
|
-
|
|
419
|
-
const zoomSpeed = 50;
|
|
420
|
-
const leftSpeed = Math.ceil(
|
|
421
|
-
zoomSpeed * (newDragStartAxesX / exceptAxesYChartWidth),
|
|
422
|
-
);
|
|
423
|
-
const rightSpeed = Math.ceil(
|
|
424
|
-
zoomSpeed * ((exceptAxesYChartWidth - newDragEndAxesX) / exceptAxesYChartWidth),
|
|
425
|
-
);
|
|
426
|
-
|
|
427
|
-
const animate = (responseFinishStatus) => {
|
|
428
|
-
animationCtx.clearRect(0, 0, exceptAxesYChartWidth, exceptAxesXChartHeight);
|
|
429
|
-
|
|
430
|
-
if (centerDx <= 0 && centerDWidth >= exceptAxesYChartWidth) {
|
|
431
|
-
displayCanvas.style.opacity = 'initial';
|
|
432
|
-
return responseFinishStatus(true);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (evChartOpacity >= evChartMinOpacity) {
|
|
436
|
-
displayCanvas.style.opacity = evChartOpacity;
|
|
437
|
-
evChartOpacity -= evChartOpacitySensitivity;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
animationCtx.globalAlpha = globalAlpha;
|
|
441
|
-
|
|
442
|
-
// 줌 영역 왼쪽
|
|
443
|
-
animationCtx.drawImage(
|
|
444
|
-
displayCanvas,
|
|
445
|
-
chartRange.x1,
|
|
446
|
-
chartRange.y1,
|
|
447
|
-
newDragStartAxesX,
|
|
448
|
-
exceptAxesXChartHeight,
|
|
449
|
-
leftDx,
|
|
450
|
-
0,
|
|
451
|
-
newDragStartAxesX,
|
|
452
|
-
exceptAxesXChartHeight,
|
|
453
|
-
);
|
|
454
|
-
|
|
455
|
-
// 줌 영역
|
|
456
|
-
animationCtx.drawImage(
|
|
457
|
-
displayCanvas,
|
|
458
|
-
chartRange.x1 + newDragStartAxesX,
|
|
459
|
-
chartRange.y1,
|
|
460
|
-
newDragEndAxesX - newDragStartAxesX,
|
|
461
|
-
exceptAxesXChartHeight,
|
|
462
|
-
centerDx,
|
|
463
|
-
0,
|
|
464
|
-
centerDWidth,
|
|
465
|
-
exceptAxesXChartHeight,
|
|
466
|
-
);
|
|
467
|
-
|
|
468
|
-
// 줌 영역 오른쪽
|
|
469
|
-
animationCtx.drawImage(
|
|
470
|
-
displayCanvas,
|
|
471
|
-
chartRange.x1 + newDragEndAxesX,
|
|
472
|
-
chartRange.y1,
|
|
473
|
-
exceptAxesYChartWidth,
|
|
474
|
-
exceptAxesXChartHeight,
|
|
475
|
-
rightDx,
|
|
476
|
-
0,
|
|
477
|
-
exceptAxesYChartWidth,
|
|
478
|
-
exceptAxesXChartHeight,
|
|
479
|
-
);
|
|
480
|
-
|
|
481
|
-
globalAlpha -= globalAlphaSensitivity;
|
|
482
|
-
leftDx -= leftSpeed;
|
|
483
|
-
centerDx -= leftSpeed;
|
|
484
|
-
centerDWidth += (leftSpeed + rightSpeed);
|
|
485
|
-
rightDx += rightSpeed;
|
|
486
|
-
|
|
487
|
-
return requestAnimationFrame(() => animate(responseFinishStatus));
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
return new Promise(response => animate(response));
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
setIconStyle(isUseZoomMode) {
|
|
494
|
-
const toggleIconStyle = (icon, condition) => {
|
|
495
|
-
if (condition) {
|
|
496
|
-
this.iconStyle(icon, 'enable');
|
|
497
|
-
} else {
|
|
498
|
-
this.iconStyle(icon, 'disable');
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
if (isUseZoomMode && this.dragZoomIcon.classList.contains('active')) {
|
|
503
|
-
const { previous, latest } = this.zoomAreaMemory;
|
|
504
|
-
|
|
505
|
-
toggleIconStyle(this.previousIcon, previous.length);
|
|
506
|
-
toggleIconStyle(this.latestIcon, latest.length);
|
|
507
|
-
this.iconStyle(this.resetIcon, 'enable');
|
|
508
|
-
} else {
|
|
509
|
-
toggleIconStyle(this.resetIcon);
|
|
510
|
-
toggleIconStyle(this.previousIcon);
|
|
511
|
-
toggleIconStyle(this.latestIcon);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
iconStyle(icon, mode) {
|
|
516
|
-
if (!icon) {
|
|
517
|
-
return;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
const [opacity, pointerEvents] = mode === 'enable' ? [1, 'initial'] : [0.5, 'none'];
|
|
521
|
-
|
|
522
|
-
icon.style.opacity = opacity;
|
|
523
|
-
icon.style.pointerEvents = pointerEvents;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
initZoom() {
|
|
527
|
-
if (!this.isAnimationFinish) {
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
const [currentZoomStartIdx, currentZoomEndIdx] = this.zoomAreaMemory.current[0];
|
|
532
|
-
const cloneLabelsLastIdx = this.cloneLabelsLastIdx;
|
|
533
|
-
|
|
534
|
-
if (currentZoomStartIdx !== 0 || currentZoomEndIdx !== cloneLabelsLastIdx) {
|
|
535
|
-
this.isUseToolbar = true;
|
|
536
|
-
this.executeZoom(0, cloneLabelsLastIdx);
|
|
537
|
-
this.setZoomAreaMemory(0, cloneLabelsLastIdx);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|