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,732 +0,0 @@
|
|
|
1
|
-
import { defaultsDeep, isEqual, throttle } from 'lodash-es';
|
|
2
|
-
import { truthyNumber } from '@/common/utils';
|
|
3
|
-
import { AXIS_OPTION } from '../helpers/helpers.constant';
|
|
4
|
-
import { checkNullAndUndefined } from '../../../common/utils';
|
|
5
|
-
|
|
6
|
-
const module = {
|
|
7
|
-
/**
|
|
8
|
-
* init scrollbar information
|
|
9
|
-
*/
|
|
10
|
-
initScrollbar() {
|
|
11
|
-
if (this.options.axesX?.[0]?.scrollbar?.use) {
|
|
12
|
-
this.initScrollbarInfo(this.options.axesX, 'x');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (this.options.axesY?.[0]?.scrollbar?.use) {
|
|
16
|
-
this.initScrollbarInfo(this.options.axesY, 'y');
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* init scrollbar information with axis information
|
|
22
|
-
* @param axisOpt axis option
|
|
23
|
-
* @param dir axis direction (x | y)
|
|
24
|
-
*/
|
|
25
|
-
initScrollbarInfo(axisOpt, dir) {
|
|
26
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
27
|
-
const merged = defaultsDeep({}, axisOpt?.[0]?.scrollbar, AXIS_OPTION.scrollbar);
|
|
28
|
-
Object.keys(merged).forEach((key) => {
|
|
29
|
-
scrollbarOpt[key] = merged[key];
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
if (!scrollbarOpt.isInit) {
|
|
33
|
-
scrollbarOpt.type = axisOpt?.[0]?.type;
|
|
34
|
-
scrollbarOpt.range = axisOpt?.[0]?.range?.length ? [...axisOpt?.[0]?.range] : null;
|
|
35
|
-
|
|
36
|
-
this.initScrollbarRange(dir);
|
|
37
|
-
this.createScrollbarLayout(dir);
|
|
38
|
-
this.createScrollbar(dir);
|
|
39
|
-
this.createScrollEvent(dir);
|
|
40
|
-
scrollbarOpt.isInit = true;
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
initScrollbarRange(dir) {
|
|
45
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
46
|
-
const axesType = scrollbarOpt.type;
|
|
47
|
-
const labels = this.options.type === 'heatMap' ? this.data.labels[dir] : this.data.labels;
|
|
48
|
-
|
|
49
|
-
if (scrollbarOpt.range?.length && labels.length) {
|
|
50
|
-
const [min, max] = scrollbarOpt.range;
|
|
51
|
-
let limitMin;
|
|
52
|
-
let limitMax;
|
|
53
|
-
|
|
54
|
-
if ((truthyNumber(min) && truthyNumber(max))) {
|
|
55
|
-
if (axesType === 'step') {
|
|
56
|
-
limitMin = 0;
|
|
57
|
-
limitMax = labels.length - 1;
|
|
58
|
-
} else {
|
|
59
|
-
const minMax = this.minMax[dir]?.[0];
|
|
60
|
-
limitMin = +minMax.min;
|
|
61
|
-
limitMax = +minMax.max;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const originalWidth = max - min;
|
|
65
|
-
const availableWidth = limitMax - limitMin;
|
|
66
|
-
|
|
67
|
-
if (originalWidth >= availableWidth) {
|
|
68
|
-
scrollbarOpt.range[0] = limitMin;
|
|
69
|
-
scrollbarOpt.range[1] = limitMax;
|
|
70
|
-
} else {
|
|
71
|
-
scrollbarOpt.range[0] = +min < limitMin ? limitMin : +min;
|
|
72
|
-
scrollbarOpt.range[1] = +max > limitMax ? limitMax : +max;
|
|
73
|
-
|
|
74
|
-
if (scrollbarOpt.range[1] - scrollbarOpt.range[0] < originalWidth) {
|
|
75
|
-
scrollbarOpt.range[0] = scrollbarOpt.range[1] - originalWidth;
|
|
76
|
-
|
|
77
|
-
if (scrollbarOpt.range[0] < limitMin) {
|
|
78
|
-
scrollbarOpt.range[0] = limitMin;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* update scrollbar information
|
|
88
|
-
*/
|
|
89
|
-
updateScrollbar(updateData) {
|
|
90
|
-
this.updateScrollbarInfo('x', updateData);
|
|
91
|
-
this.updateScrollbarInfo('y', updateData);
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Updated scrollbar information with updated axis information
|
|
96
|
-
* @param dir axis direction (x | y)
|
|
97
|
-
* @param updateData is update data
|
|
98
|
-
*/
|
|
99
|
-
updateScrollbarInfo(dir, updateData) {
|
|
100
|
-
const { axesX, axesY } = this.options;
|
|
101
|
-
const newOpt = dir === 'x' ? axesX : axesY;
|
|
102
|
-
if (!this.scrollbar[dir].isInit && newOpt?.[0]?.scrollbar?.use && newOpt?.[0]?.range) {
|
|
103
|
-
this.initScrollbarInfo(newOpt, dir);
|
|
104
|
-
return;
|
|
105
|
-
} else if (!newOpt?.[0].scrollbar?.use || checkNullAndUndefined(newOpt?.[0]?.range)) {
|
|
106
|
-
this.destroyScrollbar(dir);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const axisOpt = dir === 'x' ? this.axesX : this.axesY;
|
|
111
|
-
const isUpdateAxesRange = !isEqual(newOpt?.[0]?.range, axisOpt?.[0]?.range);
|
|
112
|
-
if (isUpdateAxesRange || updateData) {
|
|
113
|
-
const isResetPosition = dir === 'x' ? this.options.axesX?.[0]?.scrollbar?.resetPosition : this.options.axesY?.[0]?.scrollbar?.resetPosition;
|
|
114
|
-
if (isUpdateAxesRange || isResetPosition) {
|
|
115
|
-
this.scrollbar[dir].range = newOpt?.[0]?.range?.length ? [...newOpt?.[0]?.range] : null;
|
|
116
|
-
// range가 업데이트되면 저장된 스크롤 위치를 초기화
|
|
117
|
-
delete this.scrollbar[dir].savedPosition;
|
|
118
|
-
} else if (updateData) {
|
|
119
|
-
// 데이터가 업데이트되면 저장된 픽셀 위치는 더 이상 유효하지 않으므로 삭제하여
|
|
120
|
-
// 논리적 범위에 따라 다시 계산하도록 합니다.
|
|
121
|
-
delete this.scrollbar[dir].savedPosition;
|
|
122
|
-
}
|
|
123
|
-
this.initScrollbarRange(dir);
|
|
124
|
-
}
|
|
125
|
-
this.scrollbar[dir].use = !!newOpt?.[0].scrollbar?.use;
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* update scrollbar position
|
|
130
|
-
*/
|
|
131
|
-
updateScrollbarPosition() {
|
|
132
|
-
if (this.scrollbar.x?.use && this.scrollbar.x?.isInit) {
|
|
133
|
-
// resetPosition 옵션에 따라 preservePosition 결정
|
|
134
|
-
const preservePosition = !this.options.axesX?.[0]?.scrollbar?.resetPosition;
|
|
135
|
-
this.setScrollbarPosition('x', preservePosition);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (this.scrollbar.y?.use && this.scrollbar.y?.isInit) {
|
|
139
|
-
// resetPosition 옵션에 따라 preservePosition 결정
|
|
140
|
-
const preservePosition = !this.options.axesY?.[0]?.scrollbar?.resetPosition;
|
|
141
|
-
this.setScrollbarPosition('y', preservePosition);
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* create scrollbar layout
|
|
147
|
-
* @param dir axis direction ('x' | 'y')
|
|
148
|
-
*/
|
|
149
|
-
createScrollbarLayout(dir) {
|
|
150
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
151
|
-
scrollbarOpt.dom = document.createElement('div');
|
|
152
|
-
scrollbarOpt.dom.className = 'ev-chart-scrollbar';
|
|
153
|
-
scrollbarOpt.dom.dataset.type = 'scrollbar';
|
|
154
|
-
|
|
155
|
-
const containerDOM = document.createElement('div');
|
|
156
|
-
containerDOM.className = 'ev-chart-scrollbar-container';
|
|
157
|
-
containerDOM.dataset.type = dir;
|
|
158
|
-
|
|
159
|
-
scrollbarOpt.dom.appendChild(containerDOM);
|
|
160
|
-
this.wrapperDOM.appendChild(scrollbarOpt.dom);
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* create scrollbar
|
|
165
|
-
* @param dir axis direction ('x' | 'y')
|
|
166
|
-
*/
|
|
167
|
-
createScrollbar(dir) {
|
|
168
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
169
|
-
const containerDOM = scrollbarOpt.dom.children[0];
|
|
170
|
-
this.createScrollbarTrack(containerDOM);
|
|
171
|
-
this.createScrollbarThumb(containerDOM);
|
|
172
|
-
|
|
173
|
-
if (scrollbarOpt.showButton) {
|
|
174
|
-
this.createScrollbarButton(containerDOM);
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* create scrollbar track
|
|
180
|
-
* @param containerDOM
|
|
181
|
-
*/
|
|
182
|
-
createScrollbarTrack(containerDOM) {
|
|
183
|
-
const trackDOM = document.createElement('div');
|
|
184
|
-
trackDOM.className = 'ev-chart-scrollbar-track';
|
|
185
|
-
trackDOM.dataset.type = 'track';
|
|
186
|
-
containerDOM.appendChild(trackDOM);
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* create scrollbar thumb
|
|
191
|
-
* @param containerDOM
|
|
192
|
-
*/
|
|
193
|
-
createScrollbarThumb(containerDOM) {
|
|
194
|
-
const thumbDOM = document.createElement('div');
|
|
195
|
-
thumbDOM.className = 'ev-chart-scrollbar-thumb';
|
|
196
|
-
thumbDOM.dataset.type = 'thumb';
|
|
197
|
-
containerDOM.appendChild(thumbDOM);
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* create scrollbar up, down button
|
|
202
|
-
* @param containerDOM
|
|
203
|
-
*/
|
|
204
|
-
createScrollbarButton(containerDOM) {
|
|
205
|
-
const upBtnDOM = document.createElement('div');
|
|
206
|
-
upBtnDOM.className = 'ev-chart-scrollbar-button ev-chart-scrollbar-button-up';
|
|
207
|
-
upBtnDOM.dataset.type = 'button';
|
|
208
|
-
const iconUpBtn = document.createElement('i');
|
|
209
|
-
iconUpBtn.className = 'ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon';
|
|
210
|
-
iconUpBtn.dataset.type = 'button-icon';
|
|
211
|
-
upBtnDOM.appendChild(iconUpBtn);
|
|
212
|
-
|
|
213
|
-
const downBtnDOM = document.createElement('div');
|
|
214
|
-
downBtnDOM.className = 'ev-chart-scrollbar-button ev-chart-scrollbar-button-down';
|
|
215
|
-
downBtnDOM.dataset.type = 'button';
|
|
216
|
-
const iconDownBtn = document.createElement('i');
|
|
217
|
-
iconDownBtn.className = 'ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon';
|
|
218
|
-
iconDownBtn.dataset.type = 'button-icon';
|
|
219
|
-
downBtnDOM.appendChild(iconDownBtn);
|
|
220
|
-
|
|
221
|
-
containerDOM.appendChild(upBtnDOM);
|
|
222
|
-
containerDOM.appendChild(downBtnDOM);
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* set scrollbar position
|
|
227
|
-
* @param dir axis direction ('x' | 'y')
|
|
228
|
-
* @param preservePosition 기존 위치를 유지할지 여부
|
|
229
|
-
*/
|
|
230
|
-
setScrollbarPosition(dir, preservePosition = false) {
|
|
231
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
232
|
-
if (!scrollbarOpt.use || !scrollbarOpt.range) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const scrollbarDOM = scrollbarOpt.dom;
|
|
237
|
-
const chartRect = this.chartRect;
|
|
238
|
-
const labelOffset = this.labelOffset;
|
|
239
|
-
const aPos = {
|
|
240
|
-
x1: chartRect.x1 + labelOffset.left,
|
|
241
|
-
x2: chartRect.x2 - labelOffset.right,
|
|
242
|
-
y1: chartRect.y1 + labelOffset.top,
|
|
243
|
-
y2: chartRect.y2 - labelOffset.bottom,
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const titleHeight = this.options.title?.show ? this.options.title?.height : 0;
|
|
247
|
-
const isXScroll = dir === 'x';
|
|
248
|
-
const scrollHeight = isXScroll ? scrollbarOpt.height : scrollbarOpt.width;
|
|
249
|
-
const fullSize = isXScroll ? (aPos.x2 - aPos.x1) : (aPos.y2 - aPos.y1);
|
|
250
|
-
const buttonSize = scrollbarOpt.showButton ? scrollHeight : 0;
|
|
251
|
-
const trackSize = fullSize - (buttonSize * 2);
|
|
252
|
-
|
|
253
|
-
// 현재 위치를 보존해야 하는 경우 기존 위치를 저장
|
|
254
|
-
let savedThumbPosition = null;
|
|
255
|
-
if (preservePosition && scrollbarOpt.savedPosition !== undefined) {
|
|
256
|
-
savedThumbPosition = scrollbarOpt.savedPosition;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
const thumbSize = this.getScrollbarThumbSize(dir, trackSize, savedThumbPosition);
|
|
260
|
-
|
|
261
|
-
// 새로 계산된 위치를 저장
|
|
262
|
-
scrollbarOpt.savedPosition = thumbSize.position;
|
|
263
|
-
|
|
264
|
-
let scrollbarStyle = 'display: block;';
|
|
265
|
-
let scrollbarTrackStyle;
|
|
266
|
-
let scrollbarThumbStyle;
|
|
267
|
-
let upBtnStyle;
|
|
268
|
-
let downBtnStyle;
|
|
269
|
-
let commonBtnStyle = `width:${buttonSize}px;height:${buttonSize}px;`;
|
|
270
|
-
if (isXScroll) {
|
|
271
|
-
scrollbarStyle = `top: ${chartRect.y2 + titleHeight + labelOffset.top}px;`;
|
|
272
|
-
scrollbarStyle += `left: ${aPos.x1}px;`;
|
|
273
|
-
scrollbarStyle += `width: ${fullSize}px;`;
|
|
274
|
-
scrollbarStyle += ` height: ${scrollHeight}px;`;
|
|
275
|
-
|
|
276
|
-
scrollbarTrackStyle = 'top: 0;';
|
|
277
|
-
scrollbarTrackStyle += `left: ${buttonSize}px;`;
|
|
278
|
-
scrollbarTrackStyle += `width: ${trackSize}px;`;
|
|
279
|
-
scrollbarTrackStyle += 'height: 100%;';
|
|
280
|
-
|
|
281
|
-
scrollbarThumbStyle = `width: ${thumbSize.size}px;`;
|
|
282
|
-
scrollbarThumbStyle += 'height: 100%;';
|
|
283
|
-
scrollbarThumbStyle += `left: ${thumbSize.position + buttonSize}px`;
|
|
284
|
-
|
|
285
|
-
commonBtnStyle += 'transform:rotate(90deg);top: 0;';
|
|
286
|
-
|
|
287
|
-
upBtnStyle = `${commonBtnStyle}right:0;`;
|
|
288
|
-
downBtnStyle = `${commonBtnStyle}left:0;`;
|
|
289
|
-
} else {
|
|
290
|
-
scrollbarStyle = `top: ${aPos.y1 + titleHeight}px;`;
|
|
291
|
-
scrollbarStyle += `left: ${aPos.x2 + 10}px;`;
|
|
292
|
-
scrollbarStyle += `width: ${scrollHeight}px;`;
|
|
293
|
-
scrollbarStyle += `height: ${fullSize}px;`;
|
|
294
|
-
|
|
295
|
-
scrollbarTrackStyle = `top: ${buttonSize}px;`;
|
|
296
|
-
scrollbarTrackStyle += 'left: 0;';
|
|
297
|
-
scrollbarTrackStyle += 'width: 100%;';
|
|
298
|
-
scrollbarTrackStyle += `height: ${trackSize}px;`;
|
|
299
|
-
|
|
300
|
-
scrollbarThumbStyle = 'width: 100%;';
|
|
301
|
-
scrollbarThumbStyle += `height: ${thumbSize.size}px;`;
|
|
302
|
-
scrollbarThumbStyle += `bottom: ${thumbSize.position + buttonSize}px`;
|
|
303
|
-
|
|
304
|
-
commonBtnStyle += 'left:0;';
|
|
305
|
-
upBtnStyle = `${commonBtnStyle}top: 0;`;
|
|
306
|
-
downBtnStyle = `${commonBtnStyle}bottom: 0;`;
|
|
307
|
-
}
|
|
308
|
-
scrollbarDOM.style.cssText = scrollbarStyle;
|
|
309
|
-
|
|
310
|
-
const scrollbarTrackDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-track');
|
|
311
|
-
scrollbarTrackDOM[0].style.cssText = scrollbarTrackStyle;
|
|
312
|
-
scrollbarTrackDOM[0].style.backgroundColor = scrollbarOpt.background;
|
|
313
|
-
|
|
314
|
-
const scrollbarThumbDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-thumb');
|
|
315
|
-
scrollbarThumbDOM[0].style.cssText = scrollbarThumbStyle;
|
|
316
|
-
scrollbarThumbDOM[0].style.backgroundColor = scrollbarOpt.thumbStyle.background;
|
|
317
|
-
scrollbarThumbDOM[0].style.borderRadius = `${scrollbarOpt.thumbStyle.radius}px`;
|
|
318
|
-
|
|
319
|
-
if (scrollbarOpt.showButton) {
|
|
320
|
-
const upBtnDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-button-up');
|
|
321
|
-
const endPosition = Math.floor(trackSize - thumbSize.size);
|
|
322
|
-
const upBtnOpacity = Math.floor(thumbSize.position) > endPosition ? 0.5 : 1;
|
|
323
|
-
upBtnDOM[0].style.cssText = `background-color: ${scrollbarOpt.background};${upBtnStyle}`;
|
|
324
|
-
upBtnDOM[0].style.opacity = upBtnOpacity;
|
|
325
|
-
upBtnDOM[0].children[0].style.display = 'block';
|
|
326
|
-
const downBtnDOM = scrollbarDOM.getElementsByClassName('ev-chart-scrollbar-button-down');
|
|
327
|
-
downBtnDOM[0].style.cssText = `background-color: ${scrollbarOpt.background};${downBtnStyle}`;
|
|
328
|
-
downBtnDOM[0].style.opacity = Math.floor(thumbSize.position) < 0 ? 0.5 : 1;
|
|
329
|
-
downBtnDOM[0].children[0].style.display = 'block';
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* get scrollbar thumb size
|
|
335
|
-
* @param dir axis direction ('x' | 'y')
|
|
336
|
-
* @param trackSize scrollbar track size
|
|
337
|
-
* @param savedThumbPosition 기존 위치를 보존해야 하는 경우 저장된 위치
|
|
338
|
-
*/
|
|
339
|
-
getScrollbarThumbSize(dir, trackSize, savedThumbPosition) {
|
|
340
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
341
|
-
const [min, max] = scrollbarOpt.range;
|
|
342
|
-
const axesType = scrollbarOpt.type;
|
|
343
|
-
|
|
344
|
-
let thumbSize;
|
|
345
|
-
let steps;
|
|
346
|
-
let interval = 1;
|
|
347
|
-
let startValue = 0;
|
|
348
|
-
let thumbPosition = 0;
|
|
349
|
-
if (axesType === 'step') {
|
|
350
|
-
const labels = this.options.type === 'heatMap' ? this.data.labels[dir] : this.data.labels;
|
|
351
|
-
const range = (max - min) + 1;
|
|
352
|
-
steps = labels.length;
|
|
353
|
-
|
|
354
|
-
const intervalSize = trackSize / steps;
|
|
355
|
-
thumbSize = intervalSize * range;
|
|
356
|
-
thumbPosition = intervalSize * min;
|
|
357
|
-
} else {
|
|
358
|
-
const axisOpt = dir === 'x' ? this.axesX : this.axesY;
|
|
359
|
-
const minMax = this.minMax[dir]?.[0];
|
|
360
|
-
const graphRange = (+minMax.max) - (+minMax.min);
|
|
361
|
-
const range = (+max) - (+min);
|
|
362
|
-
if (axesType === 'time') {
|
|
363
|
-
interval = axisOpt?.[0]?.getInterval({
|
|
364
|
-
minValue: minMax.min,
|
|
365
|
-
maxValue: minMax.max,
|
|
366
|
-
maxSteps: this.labelRange[dir]?.[0]?.max,
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
steps = Math.ceil(graphRange / interval) + 1;
|
|
370
|
-
startValue = +minMax.min;
|
|
371
|
-
|
|
372
|
-
const intervalSize = trackSize / steps;
|
|
373
|
-
const count = (range / interval) + 1;
|
|
374
|
-
const point = (+min - startValue);
|
|
375
|
-
thumbSize = intervalSize * count;
|
|
376
|
-
thumbPosition = intervalSize * (point / interval);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
scrollbarOpt.startValue = startValue;
|
|
380
|
-
scrollbarOpt.steps = steps;
|
|
381
|
-
scrollbarOpt.interval = interval;
|
|
382
|
-
|
|
383
|
-
// 기존 위치를 보존해야 하는 경우 저장된 위치를 사용
|
|
384
|
-
if (savedThumbPosition !== null) {
|
|
385
|
-
thumbPosition = savedThumbPosition;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
return {
|
|
389
|
-
size: thumbSize,
|
|
390
|
-
position: thumbPosition,
|
|
391
|
-
};
|
|
392
|
-
},
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* get scrollbar containerDOM
|
|
396
|
-
* @param targetDOM event target dom
|
|
397
|
-
* @returns {HTMLElement|Element|*}
|
|
398
|
-
*/
|
|
399
|
-
getScrollbarContainerDOM(targetDOM) {
|
|
400
|
-
const childTypes = ['track', 'thumb', 'button'];
|
|
401
|
-
|
|
402
|
-
const type = targetDOM.dataset.type;
|
|
403
|
-
if (childTypes.includes(type)) {
|
|
404
|
-
return targetDOM.parentElement;
|
|
405
|
-
} else if (type === 'button-icon') {
|
|
406
|
-
return targetDOM.parentElement.parentElement;
|
|
407
|
-
} else if (type === 'scrollbar') {
|
|
408
|
-
return targetDOM.getElementsByClassName('ev-chart-scrollbar-container')[0];
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return targetDOM;
|
|
412
|
-
},
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* update scrollbar option range
|
|
416
|
-
* @param dir axis direction ('x' | 'y')
|
|
417
|
-
* @param isUp
|
|
418
|
-
*/
|
|
419
|
-
updateScrollbarRange(dir, isUp) {
|
|
420
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
421
|
-
const { startValue, range, interval, steps } = scrollbarOpt;
|
|
422
|
-
const endValue = startValue + (interval * steps);
|
|
423
|
-
const axisOpt = dir === 'x' ? this.axesX[0] : this.axesY[0];
|
|
424
|
-
const [min, max] = range ?? [];
|
|
425
|
-
|
|
426
|
-
if (!truthyNumber(min) || !truthyNumber(max)) {
|
|
427
|
-
scrollbarOpt.range = axisOpt?.range || null;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
let minValue;
|
|
431
|
-
let maxValue;
|
|
432
|
-
let isOutOfRange = false;
|
|
433
|
-
if (isUp) {
|
|
434
|
-
minValue = min + interval;
|
|
435
|
-
maxValue = max + interval;
|
|
436
|
-
isOutOfRange = maxValue >= endValue;
|
|
437
|
-
} else {
|
|
438
|
-
minValue = min - interval;
|
|
439
|
-
maxValue = max - interval;
|
|
440
|
-
isOutOfRange = minValue < startValue;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (!isOutOfRange) {
|
|
444
|
-
scrollbarOpt.range = [minValue, maxValue];
|
|
445
|
-
|
|
446
|
-
// 사용자가 스크롤할 때는 저장된 위치를 초기화
|
|
447
|
-
delete scrollbarOpt.savedPosition;
|
|
448
|
-
|
|
449
|
-
this.update({
|
|
450
|
-
updateSeries: false,
|
|
451
|
-
updateSelTip: { update: false, keepDomain: false },
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* create scroll event
|
|
458
|
-
*/
|
|
459
|
-
createScrollEvent() {
|
|
460
|
-
this.onScrollbarClick = (e) => {
|
|
461
|
-
e.preventDefault();
|
|
462
|
-
|
|
463
|
-
const type = e.target.dataset.type;
|
|
464
|
-
const containerDOM = this.getScrollbarContainerDOM(e.target);
|
|
465
|
-
const buttonTypes = ['button', 'button-icon'];
|
|
466
|
-
const dir = containerDOM.dataset.type;
|
|
467
|
-
|
|
468
|
-
let isUp;
|
|
469
|
-
if (buttonTypes.includes(type)) {
|
|
470
|
-
let buttonDOM;
|
|
471
|
-
if (type === 'button') {
|
|
472
|
-
buttonDOM = e.target;
|
|
473
|
-
} else if (type === 'button-icon') {
|
|
474
|
-
buttonDOM = e.target.parentElement;
|
|
475
|
-
}
|
|
476
|
-
isUp = buttonDOM.className.includes('up');
|
|
477
|
-
} else if (type === 'track') {
|
|
478
|
-
const thumbDOM = containerDOM.getElementsByClassName('ev-chart-scrollbar-thumb');
|
|
479
|
-
const { x, y } = thumbDOM[0].getBoundingClientRect();
|
|
480
|
-
const isXScroll = dir === 'x';
|
|
481
|
-
const clickPoint = isXScroll ? e.clientX : -e.clientY;
|
|
482
|
-
const thumbPosition = isXScroll ? x : -y;
|
|
483
|
-
isUp = (clickPoint > thumbPosition);
|
|
484
|
-
} else {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
this.updateScrollbarRange(dir, isUp);
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
this.onScrollbarDown = (e) => {
|
|
491
|
-
e.preventDefault();
|
|
492
|
-
|
|
493
|
-
if (e.target.dataset.type !== 'thumb') {
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
const containerDOM = this.getScrollbarContainerDOM(e.target);
|
|
498
|
-
const dir = containerDOM.dataset.type;
|
|
499
|
-
const thumbDOM = containerDOM.getElementsByClassName('ev-chart-scrollbar-thumb');
|
|
500
|
-
const { x, y, height } = thumbDOM[0].getBoundingClientRect();
|
|
501
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
502
|
-
scrollbarOpt.scrolling = true;
|
|
503
|
-
if (dir === 'x') {
|
|
504
|
-
scrollbarOpt.pointInThumb = e.clientX - x;
|
|
505
|
-
} else {
|
|
506
|
-
scrollbarOpt.pointInThumb = y + height - e.clientY;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
const scrollbarDOM = scrollbarOpt.dom;
|
|
510
|
-
scrollbarDOM.addEventListener('mousemove', this.onScrollbarMove);
|
|
511
|
-
scrollbarDOM.addEventListener('mouseup', this.onScrollbarUp);
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
const onScrollbarMove = (e) => {
|
|
515
|
-
this.scrolling(e);
|
|
516
|
-
};
|
|
517
|
-
|
|
518
|
-
this.onScrollbarMove = throttle(onScrollbarMove, 5);
|
|
519
|
-
|
|
520
|
-
this.onScrollbarUp = (e) => {
|
|
521
|
-
e.preventDefault();
|
|
522
|
-
|
|
523
|
-
this.stopScrolling(e);
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
this.onScrollbarLeave = (e) => {
|
|
527
|
-
e.preventDefault();
|
|
528
|
-
|
|
529
|
-
this.scrolling(e);
|
|
530
|
-
this.stopScrolling(e);
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
this.onScrollbarWheel = (e) => {
|
|
534
|
-
const isTooltipVisible = this.tooltipDOM?.style?.display === 'block';
|
|
535
|
-
const tooltipBodyDOM = this.tooltipBodyDOM
|
|
536
|
-
|| this.tooltipDOM?.querySelector(this.options.tooltip.htmlScrollTarget);
|
|
537
|
-
|
|
538
|
-
if (isTooltipVisible && tooltipBodyDOM) {
|
|
539
|
-
const { scrollTop, scrollHeight, clientHeight } = tooltipBodyDOM;
|
|
540
|
-
const isAtTop = scrollTop <= 0;
|
|
541
|
-
const isAtBottom = scrollTop + clientHeight >= scrollHeight;
|
|
542
|
-
|
|
543
|
-
const isScrollingUp = e.deltaY < 0;
|
|
544
|
-
const isScrollingDown = e.deltaY > 0;
|
|
545
|
-
|
|
546
|
-
if ((isAtTop && isScrollingUp) || (isAtBottom && isScrollingDown)) {
|
|
547
|
-
// 툴팁의 스크롤이 맨 위나 맨 아래에 닿았는데 스크롤 하면 차트 스크롤 허용
|
|
548
|
-
} else {
|
|
549
|
-
// 툴팁 내부 스크롤만 수행
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
e.preventDefault();
|
|
555
|
-
|
|
556
|
-
const threshold = 1; // 최소 스크롤 임계값
|
|
557
|
-
|
|
558
|
-
// Shift + 휠: 가로 스크롤 (일반 마우스 휠 지원)
|
|
559
|
-
if (this.scrollbar.x?.use && e.shiftKey && Math.abs(e.deltaY) > threshold) {
|
|
560
|
-
this.updateScrollbarRange('x', e.deltaY > 0);
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// 대각선 스크롤 처리: 더 큰 방향을 우선으로 처리
|
|
565
|
-
const absX = Math.abs(e.deltaX);
|
|
566
|
-
const absY = Math.abs(e.deltaY);
|
|
567
|
-
|
|
568
|
-
if (absX > threshold && absY > threshold) {
|
|
569
|
-
// 두 방향 모두 임계값 이상일 때: 더 큰 방향을 우선 처리
|
|
570
|
-
if (absX > absY && this.scrollbar.x?.use) {
|
|
571
|
-
this.updateScrollbarRange('x', e.deltaX > 0);
|
|
572
|
-
} else if (absY > absX && this.scrollbar.y?.use) {
|
|
573
|
-
this.updateScrollbarRange('y', e.deltaY < 0);
|
|
574
|
-
}
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
// 가로 스크롤 처리 (deltaX - 트랙패드 좌우 스크롤)
|
|
579
|
-
if (this.scrollbar.x?.use && absX > threshold) {
|
|
580
|
-
this.updateScrollbarRange('x', e.deltaX > 0);
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
// 세로 스크롤 처리 (deltaY)
|
|
585
|
-
if (this.scrollbar.y?.use && absY > threshold) {
|
|
586
|
-
this.updateScrollbarRange('y', e.deltaY < 0);
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
|
|
590
|
-
if (this.scrollbar.x.use && !this.scrollbar.x.isInit) {
|
|
591
|
-
const scrollbarXDOM = this.scrollbar.x.dom;
|
|
592
|
-
scrollbarXDOM.addEventListener('click', this.onScrollbarClick);
|
|
593
|
-
scrollbarXDOM.addEventListener('mousedown', this.onScrollbarDown);
|
|
594
|
-
scrollbarXDOM.addEventListener('mouseleave', this.onScrollbarLeave);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
if (this.scrollbar.y.use && !this.scrollbar.y.isInit) {
|
|
598
|
-
const scrollbarYDOM = this.scrollbar.y.dom;
|
|
599
|
-
scrollbarYDOM.addEventListener('click', this.onScrollbarClick);
|
|
600
|
-
scrollbarYDOM.addEventListener('mousedown', this.onScrollbarDown);
|
|
601
|
-
scrollbarYDOM.addEventListener('mouseleave', this.onScrollbarLeave);
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
// 가로 또는 세로 스크롤바가 있으면 휠 이벤트 등록
|
|
605
|
-
if (this.scrollbar.x?.use || this.scrollbar.y?.use) {
|
|
606
|
-
this.overlayCanvas?.addEventListener('wheel', this.onScrollbarWheel, { passive: false });
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
* Update scroll information by move event
|
|
612
|
-
* @param e Event
|
|
613
|
-
*/
|
|
614
|
-
scrolling(e) {
|
|
615
|
-
const containerDOM = this.getScrollbarContainerDOM(e.target);
|
|
616
|
-
const dir = containerDOM.dataset.type;
|
|
617
|
-
if (!this.scrollbar[dir].scrolling) {
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
const {
|
|
622
|
-
steps, range, pointInThumb,
|
|
623
|
-
startValue, interval,
|
|
624
|
-
} = this.scrollbar[dir];
|
|
625
|
-
|
|
626
|
-
const trackDOM = containerDOM.getElementsByClassName('ev-chart-scrollbar-track');
|
|
627
|
-
const { x, y, width, height } = trackDOM[0].getBoundingClientRect();
|
|
628
|
-
|
|
629
|
-
const isXScroll = dir === 'x';
|
|
630
|
-
const sp = isXScroll ? x : y;
|
|
631
|
-
const trackSize = isXScroll ? width : height;
|
|
632
|
-
const intervalSize = trackSize / steps;
|
|
633
|
-
const endValue = (startValue + ((steps - 1) * interval));
|
|
634
|
-
|
|
635
|
-
let movePoint = isXScroll ? e.clientX : e.clientY;
|
|
636
|
-
if (movePoint < sp) {
|
|
637
|
-
movePoint = sp;
|
|
638
|
-
} else if (movePoint > sp + trackSize) {
|
|
639
|
-
movePoint = sp + trackSize;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
let move;
|
|
643
|
-
if (isXScroll) {
|
|
644
|
-
move = movePoint - sp - pointInThumb;
|
|
645
|
-
} else {
|
|
646
|
-
move = (sp + trackSize) - movePoint - pointInThumb;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
if (move <= 0) {
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
let movedMin;
|
|
654
|
-
let movedMax;
|
|
655
|
-
const currValue = (Math.round(Math.abs(move) / intervalSize) * interval);
|
|
656
|
-
const [min, max] = range;
|
|
657
|
-
if (move > 0) {
|
|
658
|
-
const incrementValue = startValue + (currValue - +min);
|
|
659
|
-
movedMin = +min + incrementValue;
|
|
660
|
-
movedMax = movedMin + (+max - +min);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
if (movedMin < startValue || movedMax > endValue) {
|
|
664
|
-
return;
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
this.scrollbar[dir].range = [movedMin, movedMax];
|
|
668
|
-
|
|
669
|
-
// 사용자가 드래그로 스크롤할 때는 저장된 위치를 초기화
|
|
670
|
-
delete this.scrollbar[dir].savedPosition;
|
|
671
|
-
|
|
672
|
-
this.update({
|
|
673
|
-
updateSeries: false,
|
|
674
|
-
updateSelTip: { update: false, keepDomain: false },
|
|
675
|
-
});
|
|
676
|
-
},
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* init scrolling event
|
|
680
|
-
* @param e
|
|
681
|
-
*/
|
|
682
|
-
stopScrolling(e) {
|
|
683
|
-
const containerDOM = this.getScrollbarContainerDOM(e.target);
|
|
684
|
-
const dir = containerDOM.dataset.type;
|
|
685
|
-
const scrollbarOpt = this.scrollbar[dir];
|
|
686
|
-
|
|
687
|
-
if (scrollbarOpt.scrolling) {
|
|
688
|
-
scrollbarOpt.scrolling = false;
|
|
689
|
-
|
|
690
|
-
const scrollbarDOM = scrollbarOpt.dom;
|
|
691
|
-
scrollbarDOM.removeEventListener('mousemove', this.onScrollbarMove, false);
|
|
692
|
-
scrollbarDOM.removeEventListener('mouseup', this.onScrollbarUp, false);
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* hide scrollbar dom
|
|
698
|
-
* @param dir axis direction ('x' | 'y')
|
|
699
|
-
*/
|
|
700
|
-
hideScrollbar(dir) {
|
|
701
|
-
const scrollbarDOM = this.scrollbar[dir].dom;
|
|
702
|
-
|
|
703
|
-
if (!scrollbarDOM) {
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
const scrollbarStyle = scrollbarDOM?.style;
|
|
708
|
-
scrollbarStyle.display = 'none';
|
|
709
|
-
scrollbarStyle.width = '0';
|
|
710
|
-
scrollbarStyle.height = '0';
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* destroy scrollbar dom
|
|
715
|
-
* @param dir axis direction ('x' | 'y')
|
|
716
|
-
*/
|
|
717
|
-
destroyScrollbar(dir) {
|
|
718
|
-
const scrollbarDOM = this.scrollbar[dir].dom;
|
|
719
|
-
|
|
720
|
-
if (scrollbarDOM) {
|
|
721
|
-
scrollbarDOM.remove();
|
|
722
|
-
this.scrollbar[dir] = { isInit: false };
|
|
723
|
-
|
|
724
|
-
// 가로, 세로 스크롤바 모두 없어지면 휠 이벤트 제거
|
|
725
|
-
if (!this.scrollbar.x?.use && !this.scrollbar.y?.use) {
|
|
726
|
-
this.overlayCanvas?.removeEventListener('wheel', this.onScrollbarWheel, { passive: false });
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
export default module;
|