evui 2.1.0 → 2.1.1
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/{adac9fa4f723f9d2cb5b6640517114a9.png → 0b8d1200e71cae8d747dce4e69c4efb6.png} +0 -0
- package/dist/1.css +4 -0
- package/dist/1.css.map +1 -0
- package/dist/1.evui.min.js +2 -0
- package/dist/1.evui.min.js.map +1 -0
- package/dist/1ba679c05036b34bf359aa2e6c450faa.ttf +0 -0
- package/dist/2.css +4 -0
- package/dist/2.css.map +1 -0
- package/dist/2.evui.min.js +2 -0
- package/dist/2.evui.min.js.map +1 -0
- package/dist/{e8c322de9658cbeb8a774b6624167c2c.woff2 → 278156e41e0ad908cf7f841b17130502.woff2} +0 -0
- package/dist/3.evui.min.js +2 -0
- package/dist/3.evui.min.js.map +1 -0
- package/dist/32be89b11725274cd3e801192ba88361.ttf +0 -0
- package/dist/{0ab54153eeeca0ce03978cc463b257f7.woff2 → 38c6d8bab26db77d8c806813e1497763.woff2} +0 -0
- package/dist/4.evui.min.js +2 -0
- package/dist/4.evui.min.js.map +1 -0
- package/dist/{faff92145777a3cbaf8e7367b4807987.woff → 425399f81e4ce7cbd967685402ba0260.woff} +0 -0
- package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
- package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
- package/dist/{ad97afd3337e8cda302d10ff5a4026b8.ttf → 5367103510b27b78482794590e1ce3b0.ttf} +0 -0
- package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → 57e963e3d6dd0a9cf05150b40eebf69b.svg} +0 -0
- package/dist/{c5ebe0b32dc1b5cc449a76c4204d13bb.ttf → 65a2fb6d9aaa164b41a039302093995b.ttf} +0 -0
- package/dist/{cd6c777f1945164224dee082abaea03a.woff2 → 687a4990ea22bb1a49d469a5d9319790.woff2} +0 -0
- package/dist/{7583da5c07275cd5eb364507616f998f.ttf → 6c1d906bf5ba48676f65b2d65e935e1a.ttf} +0 -0
- package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
- package/dist/{701ae6abd4719e9c2ada3535a497b341.eot → 752905fa5edf21fc52a10a0c1ca9c7a4.eot} +0 -0
- package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
- package/dist/{b551b554a67e86a840bc80cbb8066c30.svg → 7d62eb50e7bb05eedb2a4656f7fe8f3b.svg} +0 -0
- package/dist/{8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot → a01e3f2d6c83dc3aee175e2482b3f777.eot} +0 -0
- package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → b30fd8419d7e6d5918856c7531d33482.svg} +0 -0
- package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
- package/dist/{b87b9ba532ace76ae9f6edfe9f72ded2.ttf → c656b8caa454ed19b9a2ef7f4f5b8fea.ttf} +0 -0
- package/dist/{a046592bac8f2fd96e994733faf3858c.woff → cac87dc00c87a5d74711d0276713808a.woff} +0 -0
- package/dist/{13db00b7a34fee4d819ab7f9838cc428.eot → d68fa3e67dbb653a13cec44b1bcabcfe.eot} +0 -0
- package/dist/{ef60a4f6c25ef7f39f2d25a748dbecfe.woff → ddae9b1ba9b0b42f58809904b0b21349.woff} +0 -0
- package/dist/evui.min.js +6 -86054
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -1
- package/dist/main.css +43 -5541
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -1
- package/package.json +56 -76
- package/src/common/emitter.js +20 -0
- package/src/common/utils.debounce.js +223 -0
- package/src/common/utils.js +51 -17
- package/src/common/utils.throttle.js +83 -0
- package/src/common/utils.tree.js +18 -0
- package/src/components/button/button.vue +316 -241
- package/src/components/chart/chart.core.js +378 -85
- package/src/components/chart/chart.vue +133 -115
- package/src/components/chart/element/element.bar.js +219 -25
- package/src/components/chart/element/element.bar.time.js +115 -0
- package/src/components/chart/element/element.line.js +172 -21
- package/src/components/chart/element/element.pie.js +86 -0
- package/src/components/chart/element/element.scatter.js +9 -2
- package/src/components/chart/element/element.tip.js +356 -0
- package/src/components/chart/helpers/helpers.canvas.js +94 -0
- package/src/components/chart/helpers/helpers.constant.js +25 -6
- package/src/components/chart/helpers/helpers.util.js +83 -38
- package/src/components/chart/index.js +0 -1
- package/src/components/chart/model/model.series.js +43 -14
- package/src/components/chart/model/model.store.js +440 -46
- package/src/components/chart/plugins/plugins.interaction.js +324 -0
- package/src/components/chart/plugins/plugins.legend.js +233 -91
- package/src/components/chart/plugins/plugins.pie.js +179 -0
- package/src/components/chart/plugins/plugins.title.js +25 -2
- package/src/components/chart/plugins/plugins.tooltip.js +384 -0
- package/src/components/chart/scale/scale.js +91 -29
- package/src/components/chart/scale/scale.linear.js +12 -0
- package/src/components/chart/scale/scale.logarithmic.js +25 -0
- package/src/components/chart/scale/scale.step.js +89 -52
- package/src/components/chart/scale/scale.time.category.js +204 -0
- package/src/components/chart/scale/scale.time.js +19 -1
- package/src/components/checkbox/checkbox-group.vue +15 -11
- package/src/components/checkbox/checkbox.vue +210 -138
- package/src/components/codeview/code.vue +42 -29
- package/src/components/contextmenu/contextmenu.child.vue +79 -0
- package/src/components/contextmenu/contextmenu.vue +276 -0
- package/src/components/contextmenu/contextmenu.wrap.vue +189 -0
- package/src/components/contextmenu/index.js +3 -0
- package/src/components/datepicker/calendar.core.js +588 -492
- package/src/components/datepicker/calendar.vue +0 -3
- package/src/components/datepicker/datepicker.vue +43 -15
- package/src/components/datepicker/index.js +5 -1
- package/src/components/grid/grid.filter.vue +290 -0
- package/src/components/grid/grid.filter.window.vue +411 -0
- package/src/components/grid/grid.render.vue +45 -0
- package/src/components/grid/grid.vue +1338 -0
- package/src/components/icon/icon.vue +22 -7
- package/src/components/input/input.number.vue +309 -277
- package/src/components/label/label.vue +2 -2
- package/src/components/loadingmask/loadingmask.vue +6 -13
- package/src/components/loginfield/loginfield.vue +46 -37
- package/src/components/markdown/index.js +3 -0
- package/src/components/markdown/markdown.vue +1001 -0
- package/src/components/menu/index.js +1 -3
- package/src/components/menu/menu.nav.item.vue +115 -0
- package/src/components/menu/menu.nav.sub.vue +42 -0
- package/src/components/menu/menu.nav.vue +71 -98
- package/src/components/message/index.js +3 -0
- package/src/components/message/message.js +63 -0
- package/src/components/message/message.vue +191 -0
- package/src/components/message-box/index.js +3 -0
- package/src/components/message-box/message-box.js +31 -0
- package/src/components/message-box/message-box.vue +298 -0
- package/src/components/notification/index.js +3 -0
- package/src/components/notification/notification.js +75 -0
- package/src/components/notification/notification.vue +242 -0
- package/src/components/radio/radio-group.vue +6 -2
- package/src/components/radio/radio.vue +156 -76
- package/src/components/selectbox/dropdown.vue +86 -40
- package/src/components/selectbox/listbox.vue +47 -18
- package/src/components/selectbox/option.vue +1 -1
- package/src/components/selectbox/selectbox.vue +304 -316
- package/src/components/slider/slider-tooltip.vue +7 -7
- package/src/components/slider/slider.vue +20 -25
- package/src/components/splitter/splitter.vue +104 -94
- package/src/components/table/table.black.css +1 -1
- package/src/components/table/table.filter.lite.vue +7 -7
- package/src/components/table/table.filter.vue +1 -1
- package/src/components/table/table.grey.css +5 -6
- package/src/components/table/table.navy.css +1 -1
- package/src/components/table/table.vue +55 -48
- package/src/components/tabs/tab-panel.vue +19 -5
- package/src/components/tabs/tabs.vue +182 -87
- package/src/components/textfield/textfield.vue +110 -87
- package/src/components/timepicker/index.js +2 -2
- package/src/components/timepicker/spinner.vue +15 -17
- package/src/components/timepicker/timepicker.vue +98 -53
- package/src/components/toggle/toggle.vue +148 -109
- package/src/components/tree/index.js +2 -6
- package/src/components/tree/render.js +17 -0
- package/src/components/tree/tree-node.vue +214 -0
- package/src/components/tree/tree.vue +296 -0
- package/src/components/tree-table/index.js +7 -0
- package/src/components/{tree → tree-table}/tree.table.black.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.grey.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.vue +36 -41
- package/src/components/{tree → tree-table}/tree.util.js +0 -0
- package/src/components/window/window.vue +238 -191
- package/src/index.js +25 -12
- package/src/styles/base/base.scss +50 -0
- package/src/styles/base/index.scss +1 -0
- package/src/styles/default.scss +5 -0
- package/src/styles/{codemirror.css → lib/codemirror.css} +0 -0
- package/src/styles/{all.css → lib/fontawesome.css} +1 -1
- package/src/styles/lib/icon.css +792 -0
- package/src/styles/themes/index.scss +2 -0
- package/src/styles/themes/mixin.scss +33 -0
- package/src/styles/themes/variables.scss +206 -0
- package/src/styles/utils/colors.scss +222 -0
- package/src/styles/utils/index.scss +2 -0
- package/src/styles/utils/mixins.scss +34 -0
- package/src/styles/utils/variables.scss +27 -0
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.svg +251 -173
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/Roboto-Bold.ttf +0 -0
- package/src/webfonts/Roboto-Medium.ttf +0 -0
- package/src/webfonts/Roboto-Regular.ttf +0 -0
- package/dist/3c9453211570a4ede66a4b4954a32bbb.ttf +0 -0
- package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
- package/dist/b9e64d9b5fa6b500eb5df6fa980d3e5b.eot +0 -0
- package/dist/f0ac0c8b3c9cd3ef9002749985ae546f.woff +0 -0
- package/src/components/chart/charts/chart.bar.js +0 -334
- package/src/components/chart/charts/chart.base.js +0 -1075
- package/src/components/chart/charts/chart.line.js +0 -262
- package/src/components/chart/charts/chart.pie.js +0 -383
- package/src/components/chart/charts/chart.scatter.js +0 -349
- package/src/components/chart/charts/chart.sunburst.js +0 -193
- package/src/components/chart/core/axis/axis.js +0 -217
- package/src/components/chart/core/axis/axis.scale.auto.js +0 -69
- package/src/components/chart/core/axis/axis.scale.fixed.js +0 -65
- package/src/components/chart/core/axis/axis.scale.steps.js +0 -149
- package/src/components/chart/core/core.constant.js +0 -116
- package/src/components/chart/core/core.legend.js +0 -473
- package/src/components/chart/core/core.util.js +0 -66
- package/src/components/chart/core/data/data.js +0 -412
- package/src/components/chart/core/data/data.pie.js +0 -70
- package/src/components/chart/core/data/data.stack.js +0 -222
- package/src/components/chart/core/data/data.sunburst.js +0 -172
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
|
@@ -1,473 +0,0 @@
|
|
|
1
|
-
export default class ChartLegend {
|
|
2
|
-
constructor(props) {
|
|
3
|
-
Object.keys(props).forEach((key) => {
|
|
4
|
-
this[key] = props[key];
|
|
5
|
-
});
|
|
6
|
-
// false일 경우 생성 안됨.
|
|
7
|
-
this.isShow = true;
|
|
8
|
-
|
|
9
|
-
this.legendDOM = document.createElement('div');
|
|
10
|
-
this.legendDOM.className = 'ev-chart-legend';
|
|
11
|
-
this.resizeDOM = document.createElement('div');
|
|
12
|
-
this.resizeDOM.className = 'ev-chart-resize-bar';
|
|
13
|
-
this.resizeDOM.onmousedown = this.onMouseDown.bind(this);
|
|
14
|
-
|
|
15
|
-
this.ghostDOM = document.createElement('div');
|
|
16
|
-
this.ghostDOM.className = 'ev-chart-resize-ghost';
|
|
17
|
-
|
|
18
|
-
this.mouseUp = this.onMouseUp.bind(this); // resizing function
|
|
19
|
-
this.mouseMove = this.onMouseMove.bind(this); // resizing function
|
|
20
|
-
|
|
21
|
-
this.resizeDOMSize = 4;
|
|
22
|
-
this.resizePad = 2; // resize bar와 legend의 padding px
|
|
23
|
-
|
|
24
|
-
this.legendWidth = 0;
|
|
25
|
-
this.legendHeight = 20;
|
|
26
|
-
|
|
27
|
-
this.legendCount = 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
updateLegend() {
|
|
31
|
-
const legend = this.legendDOM;
|
|
32
|
-
|
|
33
|
-
while (legend.firstChild) {
|
|
34
|
-
legend.firstChild.remove();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
this.createLegend();
|
|
38
|
-
if (!this.isShow) {
|
|
39
|
-
this.resizeDOM.style.display = 'none';
|
|
40
|
-
this.legendDOM.style.display = 'none';
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.setLegendPosition(this.chartOptions.legend.position);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
init() {
|
|
47
|
-
this.createLegend();
|
|
48
|
-
if (!this.isShow) {
|
|
49
|
-
this.resizeDOM.style.display = 'none';
|
|
50
|
-
this.legendDOM.style.display = 'none';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
this.wrapperDOM.appendChild(this.resizeDOM);
|
|
54
|
-
this.wrapperDOM.appendChild(this.legendDOM);
|
|
55
|
-
|
|
56
|
-
this.setLegendPosition(this.chartOptions.legend.position);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
createLegend() {
|
|
60
|
-
const groups = this.groups;
|
|
61
|
-
const seriesList = this.seriesList;
|
|
62
|
-
const skey = Object.keys(seriesList);
|
|
63
|
-
|
|
64
|
-
const calcSeriesWidthDOM = document.createElement('span');
|
|
65
|
-
|
|
66
|
-
calcSeriesWidthDOM.setAttribute('style', 'visibility:hidden; position:absolute; top:-10000;');
|
|
67
|
-
this.wrapperDOM.appendChild(calcSeriesWidthDOM);
|
|
68
|
-
|
|
69
|
-
let series;
|
|
70
|
-
|
|
71
|
-
if (groups.length) {
|
|
72
|
-
for (let ix = 0, ixLen = groups.length; ix < ixLen; ix++) {
|
|
73
|
-
const group = groups[ix];
|
|
74
|
-
for (let jx = group.length - 1; jx >= 0; jx--) {
|
|
75
|
-
series = seriesList[group[jx]];
|
|
76
|
-
|
|
77
|
-
if (series.show) {
|
|
78
|
-
this.createLegendDOM(series, group[jx], calcSeriesWidthDOM);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
for (let ix = 0, ixLen = skey.length; ix < ixLen; ix++) {
|
|
85
|
-
series = seriesList[skey[ix]];
|
|
86
|
-
|
|
87
|
-
if (!series.isExistGrp && series.show) {
|
|
88
|
-
this.createLegendDOM(series, skey[ix], calcSeriesWidthDOM);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
calcSeriesWidthDOM.remove();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
createLegendDOM(seriesObj, sId, widthDOM) {
|
|
96
|
-
const chartOpt = this.chartOptions;
|
|
97
|
-
|
|
98
|
-
const legendOpt = chartOpt.legend;
|
|
99
|
-
const position = legendOpt.position;
|
|
100
|
-
const series = seriesObj;
|
|
101
|
-
const calcSeriesWidthDOM = widthDOM;
|
|
102
|
-
|
|
103
|
-
calcSeriesWidthDOM.textContent = series.name;
|
|
104
|
-
const width = calcSeriesWidthDOM.clientWidth + 26; // 26 = color margin value.
|
|
105
|
-
|
|
106
|
-
const legend = {
|
|
107
|
-
containerDOM: document.createElement('div'),
|
|
108
|
-
colorDOM: document.createElement('span'),
|
|
109
|
-
nameDOM: document.createElement('div'),
|
|
110
|
-
valueDOM: document.createElement('span'),
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
legend.containerDOM.className = 'ev-chart-legend-container';
|
|
114
|
-
legend.colorDOM.className = 'ev-chart-legend-color';
|
|
115
|
-
legend.nameDOM.className = 'ev-chart-legend-name';
|
|
116
|
-
legend.nameDOM.style.color = legendOpt.color;
|
|
117
|
-
legend.valueDOM.className = 'ev-chart-legend-value';
|
|
118
|
-
legend.colorDOM.style.backgroundColor = series.color;
|
|
119
|
-
|
|
120
|
-
legend.nameDOM.textContent = series.name;
|
|
121
|
-
|
|
122
|
-
legend.nameDOM.setAttribute('title', series.name);
|
|
123
|
-
|
|
124
|
-
legend.containerDOM.appendChild(legend.colorDOM);
|
|
125
|
-
legend.containerDOM.appendChild(legend.nameDOM);
|
|
126
|
-
legend.containerDOM.appendChild(legend.valueDOM);
|
|
127
|
-
|
|
128
|
-
series.labelObj = legend;
|
|
129
|
-
|
|
130
|
-
if (!series.show) {
|
|
131
|
-
legend.containerDOM.style.display = 'none';
|
|
132
|
-
} else {
|
|
133
|
-
this.legendCount += 1;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
this.legendWidth = Math.min(Math.max(width, this.legendWidth), 140);
|
|
137
|
-
legend.containerDOM.style.lineHeight = `${this.legendHeight}px`;
|
|
138
|
-
legend.containerDOM.style.cursor = this.chartOptions.type !== 'sunburst' ? 'pointer' : '';
|
|
139
|
-
legend.containerDOM.addEventListener('click', this.onClickLegend.bind(this));
|
|
140
|
-
legend.containerDOM.addEventListener('mouseover', this.onMouseOverLegend.bind(this));
|
|
141
|
-
legend.containerDOM.addEventListener('mouseout', this.onMouseOutLegend.bind(this));
|
|
142
|
-
legend.containerDOM.seriesId = sId;
|
|
143
|
-
|
|
144
|
-
if (position === 'top' || position === 'bottom') {
|
|
145
|
-
legend.containerDOM.style.display = 'inline-block';
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
this.legendDOM.appendChild(legend.containerDOM);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
setLegendPosition(position) {
|
|
152
|
-
const wrapperStyle = this.wrapperDOM.style;
|
|
153
|
-
const chartDOMStyle = this.chartDOM.style;
|
|
154
|
-
const legendDOMStyle = this.legendDOM.style;
|
|
155
|
-
const resizeDOMStyle = this.resizeDOM.style;
|
|
156
|
-
const titleHeight = this.chartOptions.title.show ? this.chartOptions.title.height : 0;
|
|
157
|
-
const resizeTick = this.resizeDOMSize + this.resizePad;
|
|
158
|
-
|
|
159
|
-
let topPadding;
|
|
160
|
-
|
|
161
|
-
switch (position) {
|
|
162
|
-
case 'top':
|
|
163
|
-
topPadding = this.chartOptions.title.show ? `${titleHeight}px` : `${this.legendHeight}px`;
|
|
164
|
-
wrapperStyle.padding = `${topPadding + resizeTick + 8}px 0 0 0`;
|
|
165
|
-
|
|
166
|
-
chartDOMStyle.padding = `${this.legendHeight + resizeTick + 8}px 0 0 0`;
|
|
167
|
-
this.overlayCanvas.style.top = `${this.legendHeight + resizeTick + 8}px`;
|
|
168
|
-
|
|
169
|
-
legendDOMStyle.top = `${titleHeight}px`;
|
|
170
|
-
legendDOMStyle.left = '0';
|
|
171
|
-
legendDOMStyle.bottom = '';
|
|
172
|
-
legendDOMStyle.right = '';
|
|
173
|
-
legendDOMStyle.height = `${this.legendHeight + 8}px`;
|
|
174
|
-
legendDOMStyle.lineHeight = `${this.legendHeight}px`;
|
|
175
|
-
legendDOMStyle.width = '100%';
|
|
176
|
-
legendDOMStyle.padding = '0 0 0 10px';
|
|
177
|
-
|
|
178
|
-
resizeDOMStyle.width = '100%';
|
|
179
|
-
resizeDOMStyle.height = `${this.resizeDOMSize}px`;
|
|
180
|
-
resizeDOMStyle.left = '0';
|
|
181
|
-
resizeDOMStyle.top = `${titleHeight + this.legendHeight + this.resizePad}px`;
|
|
182
|
-
resizeDOMStyle.bottom = '';
|
|
183
|
-
resizeDOMStyle.right = '';
|
|
184
|
-
resizeDOMStyle.cursor = 'row-resize';
|
|
185
|
-
break;
|
|
186
|
-
case 'bottom':
|
|
187
|
-
wrapperStyle.padding = `${titleHeight}px 0 0 0`;
|
|
188
|
-
|
|
189
|
-
chartDOMStyle.padding = `0 0 ${this.legendHeight}px 0`;
|
|
190
|
-
|
|
191
|
-
legendDOMStyle.top = '';
|
|
192
|
-
legendDOMStyle.bottom = '0';
|
|
193
|
-
legendDOMStyle.right = '';
|
|
194
|
-
legendDOMStyle.left = '0';
|
|
195
|
-
legendDOMStyle.height = `${this.legendHeight}px`;
|
|
196
|
-
legendDOMStyle.lineHeight = `${this.legendHeight}px`;
|
|
197
|
-
legendDOMStyle.width = '100%';
|
|
198
|
-
legendDOMStyle.padding = '0 0 0 10px';
|
|
199
|
-
|
|
200
|
-
resizeDOMStyle.width = '100%';
|
|
201
|
-
resizeDOMStyle.height = `${this.resizeDOMSize}px`;
|
|
202
|
-
resizeDOMStyle.left = '0';
|
|
203
|
-
resizeDOMStyle.top = '';
|
|
204
|
-
resizeDOMStyle.right = '';
|
|
205
|
-
resizeDOMStyle.bottom = `${this.legendHeight}px`;
|
|
206
|
-
resizeDOMStyle.cursor = 'row-resize';
|
|
207
|
-
break;
|
|
208
|
-
case 'left':
|
|
209
|
-
chartDOMStyle.padding = `0 0 0 ${this.legendWidth}px`;
|
|
210
|
-
this.overlayCanvas.style.left = `${this.legendWidth}px`;
|
|
211
|
-
|
|
212
|
-
legendDOMStyle.top = `${titleHeight}px`;
|
|
213
|
-
legendDOMStyle.bottom = '0';
|
|
214
|
-
legendDOMStyle.right = '';
|
|
215
|
-
legendDOMStyle.left = '0';
|
|
216
|
-
legendDOMStyle.height = '100%';
|
|
217
|
-
legendDOMStyle.width = `${this.legendWidth}px`;
|
|
218
|
-
legendDOMStyle.padding = '0 0 0 10px';
|
|
219
|
-
|
|
220
|
-
resizeDOMStyle.width = `${this.resizeDOMSize}px`;
|
|
221
|
-
resizeDOMStyle.height = '100%';
|
|
222
|
-
resizeDOMStyle.left = `${this.legendWidth + this.resizePad}px`;
|
|
223
|
-
resizeDOMStyle.top = `${titleHeight}px`;
|
|
224
|
-
resizeDOMStyle.cursor = 'col-resize';
|
|
225
|
-
break;
|
|
226
|
-
case 'right':
|
|
227
|
-
chartDOMStyle.padding = `0 ${this.legendWidth + resizeTick}px 0 0`;
|
|
228
|
-
|
|
229
|
-
legendDOMStyle.top = `${titleHeight}px`;
|
|
230
|
-
legendDOMStyle.bottom = '';
|
|
231
|
-
legendDOMStyle.right = '0';
|
|
232
|
-
legendDOMStyle.left = '';
|
|
233
|
-
legendDOMStyle.height = '100%';
|
|
234
|
-
legendDOMStyle.width = `${this.legendWidth}px`;
|
|
235
|
-
legendDOMStyle.padding = '0 0 0 0';
|
|
236
|
-
legendDOMStyle.marginLeft = '2px';
|
|
237
|
-
|
|
238
|
-
resizeDOMStyle.width = `${this.resizeDOMSize}px`;
|
|
239
|
-
resizeDOMStyle.height = '100%';
|
|
240
|
-
resizeDOMStyle.left =
|
|
241
|
-
`${this.wrapperDOM.offsetWidth - this.legendWidth - resizeTick}px`;
|
|
242
|
-
resizeDOMStyle.top = `${titleHeight}px`;
|
|
243
|
-
resizeDOMStyle.cursor = 'col-resize';
|
|
244
|
-
break;
|
|
245
|
-
default:
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
show() {
|
|
251
|
-
this.isShow = true;
|
|
252
|
-
this.legendDOM.style.display = 'block';
|
|
253
|
-
this.setLegendPosition(this.chartOptions.legend.position);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
hide() {
|
|
257
|
-
this.isShow = false;
|
|
258
|
-
this.legendDOM.style.display = 'none';
|
|
259
|
-
this.legendDOM.style.paddingRight = '0';
|
|
260
|
-
this.legendDOM.style.paddingTop = '0';
|
|
261
|
-
this.legendDOM.style.paddingBottom = '0';
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
onMouseDown(e) {
|
|
265
|
-
e.stopPropagation();
|
|
266
|
-
e.preventDefault();
|
|
267
|
-
|
|
268
|
-
const position = this.chartOptions.legend.position;
|
|
269
|
-
const ghostDOM = this.ghostDOM;
|
|
270
|
-
|
|
271
|
-
const titleHeight = this.chartOptions.title.show ? this.chartOptions.title.height : 0;
|
|
272
|
-
|
|
273
|
-
this.resizeDOM.style.display = 'none';
|
|
274
|
-
this.wrapperDOM.appendChild(ghostDOM);
|
|
275
|
-
|
|
276
|
-
// mouse down 시, resizeDOM의 위치를 기반으로 ghostDOM의 위치를 세팅
|
|
277
|
-
if (position === 'left' || position === 'right') {
|
|
278
|
-
ghostDOM.style.top = `${titleHeight}px`;
|
|
279
|
-
ghostDOM.style.left = this.resizeDOM.style.left;
|
|
280
|
-
ghostDOM.style.height = this.resizeDOM.style.height;
|
|
281
|
-
} else {
|
|
282
|
-
ghostDOM.classList.add('horizontal');
|
|
283
|
-
|
|
284
|
-
if (position === 'top') {
|
|
285
|
-
ghostDOM.style.top = this.resizeDOM.style.top;
|
|
286
|
-
} else if (position === 'bottom') {
|
|
287
|
-
ghostDOM.style.bottom = this.resizeDOM.style.bottom;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
this.wrapperDOM.addEventListener('mousemove', this.mouseMove, false);
|
|
292
|
-
this.wrapperDOM.addEventListener('mouseup', this.mouseUp, false);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
onMouseMove(e) {
|
|
296
|
-
e.stopPropagation();
|
|
297
|
-
e.preventDefault();
|
|
298
|
-
|
|
299
|
-
const offset = this.wrapperDOM.getBoundingClientRect();
|
|
300
|
-
const offsetWidth = this.wrapperDOM.offsetWidth;
|
|
301
|
-
const offsetHeight = this.wrapperDOM.offsetHeight;
|
|
302
|
-
|
|
303
|
-
const titleHeight = this.chartOptions.title.show ? this.chartOptions.title.height : 0;
|
|
304
|
-
const position = this.chartOptions.legend.position;
|
|
305
|
-
|
|
306
|
-
const chartMinWidth = 150;
|
|
307
|
-
const chartMinHeight = 70;
|
|
308
|
-
|
|
309
|
-
const legendMinWidth = 80;
|
|
310
|
-
const legendMinHeight = 20;
|
|
311
|
-
|
|
312
|
-
let move;
|
|
313
|
-
|
|
314
|
-
switch (position) {
|
|
315
|
-
case 'left':
|
|
316
|
-
move = e.clientX - offset.left;
|
|
317
|
-
if (move < legendMinWidth) {
|
|
318
|
-
move = legendMinWidth;
|
|
319
|
-
} else if (move > offsetWidth - chartMinWidth) {
|
|
320
|
-
move = offsetWidth - chartMinWidth;
|
|
321
|
-
}
|
|
322
|
-
this.ghostDOM.style.left = `${move}px`;
|
|
323
|
-
break;
|
|
324
|
-
case 'right':
|
|
325
|
-
move = e.clientX - offset.left;
|
|
326
|
-
if (move < chartMinWidth) {
|
|
327
|
-
move = chartMinWidth;
|
|
328
|
-
} else if (move > offsetWidth - legendMinWidth) {
|
|
329
|
-
move = offsetWidth - legendMinWidth;
|
|
330
|
-
}
|
|
331
|
-
this.ghostDOM.style.left = `${move}px`;
|
|
332
|
-
break;
|
|
333
|
-
case 'top':
|
|
334
|
-
move = e.clientY - offset.top;
|
|
335
|
-
if (move < legendMinHeight + titleHeight) {
|
|
336
|
-
move = legendMinHeight + titleHeight;
|
|
337
|
-
} else if (move > offsetHeight - chartMinHeight) {
|
|
338
|
-
move = offsetHeight - chartMinHeight;
|
|
339
|
-
}
|
|
340
|
-
this.ghostDOM.style.top = `${move}px`;
|
|
341
|
-
break;
|
|
342
|
-
case 'bottom':
|
|
343
|
-
move = e.clientY - offset.top;
|
|
344
|
-
if (move < chartMinHeight + titleHeight) {
|
|
345
|
-
move = chartMinHeight + titleHeight;
|
|
346
|
-
} else if (move > offsetHeight - legendMinHeight) {
|
|
347
|
-
move = offsetHeight - legendMinHeight;
|
|
348
|
-
}
|
|
349
|
-
this.ghostDOM.style.bottom = `${this.wrapperDOM.offsetHeight - move}px`;
|
|
350
|
-
break;
|
|
351
|
-
default:
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
onMouseUp(e) {
|
|
357
|
-
e.stopPropagation();
|
|
358
|
-
e.preventDefault();
|
|
359
|
-
|
|
360
|
-
this.wrapperDOM.removeEventListener('mousemove', this.mouseMove, false);
|
|
361
|
-
this.wrapperDOM.removeEventListener('mouseup', this.mouseUp, false);
|
|
362
|
-
|
|
363
|
-
const position = this.chartOptions.legend.position;
|
|
364
|
-
const resizeDOM = this.resizeDOM;
|
|
365
|
-
const resizeDOMStyle = resizeDOM.style;
|
|
366
|
-
const legendDOMStyle = this.legendDOM.style;
|
|
367
|
-
const ghostDOM = this.ghostDOM;
|
|
368
|
-
const chartDOMStyle = this.chartDOM.style;
|
|
369
|
-
const resizeTick = this.resizeDOMSize + this.resizePad;
|
|
370
|
-
const titleHeight = this.chartOptions.title.show ? this.chartOptions.title.height : 0;
|
|
371
|
-
|
|
372
|
-
let move;
|
|
373
|
-
|
|
374
|
-
switch (position) {
|
|
375
|
-
case 'left':
|
|
376
|
-
resizeDOMStyle.left = ghostDOM.style.left;
|
|
377
|
-
move = +ghostDOM.style.left.replace('px', '');
|
|
378
|
-
legendDOMStyle.width = `${move}px`;
|
|
379
|
-
this.legendWidth = move;
|
|
380
|
-
chartDOMStyle.padding = `0 0 0 ${move - this.resizePad}px`;
|
|
381
|
-
break;
|
|
382
|
-
case 'right':
|
|
383
|
-
resizeDOMStyle.left = ghostDOM.style.left;
|
|
384
|
-
move = +ghostDOM.style.left.replace('px', '');
|
|
385
|
-
legendDOMStyle.width = `${(this.wrapperDOM.offsetWidth - move - resizeTick)}px`;
|
|
386
|
-
this.legendWidth = this.wrapperDOM.offsetWidth - move - resizeTick;
|
|
387
|
-
chartDOMStyle.padding = `0 ${this.wrapperDOM.offsetWidth - move}px 0 0`;
|
|
388
|
-
break;
|
|
389
|
-
case 'top':
|
|
390
|
-
resizeDOMStyle.top = ghostDOM.style.top;
|
|
391
|
-
move = +ghostDOM.style.top.replace('px', '');
|
|
392
|
-
legendDOMStyle.height = `${move - titleHeight}px`;
|
|
393
|
-
this.legendHeight = move - titleHeight - this.resizePad;
|
|
394
|
-
chartDOMStyle.padding = `${(move - titleHeight) + this.resizeDOMSize}px 0 0 0`;
|
|
395
|
-
break;
|
|
396
|
-
case 'bottom':
|
|
397
|
-
resizeDOMStyle.bottom = ghostDOM.style.bottom;
|
|
398
|
-
move = this.wrapperDOM.offsetHeight - (+ghostDOM.style.bottom.replace('px', ''));
|
|
399
|
-
legendDOMStyle.height = `${this.wrapperDOM.offsetHeight - move}px`;
|
|
400
|
-
this.legendHeight = this.wrapperDOM.offsetHeight - move;
|
|
401
|
-
chartDOMStyle.padding = `0 0 ${this.wrapperDOM.offsetHeight - move}px 0`;
|
|
402
|
-
break;
|
|
403
|
-
default:
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
this.resizeDOM.style.display = 'block';
|
|
408
|
-
ghostDOM.remove();
|
|
409
|
-
this.resize();
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
onClickLegend(e) {
|
|
413
|
-
if (this.chartOptions.type === 'sunburst') {
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
const options = this.chartOptions.legend;
|
|
417
|
-
const eventTargetDOM = e.currentTarget;
|
|
418
|
-
const sId = eventTargetDOM.seriesId;
|
|
419
|
-
const series = this.seriesList[sId];
|
|
420
|
-
const colorDOM = eventTargetDOM.getElementsByClassName('ev-chart-legend-color')[0];
|
|
421
|
-
const nameDOM = eventTargetDOM.getElementsByClassName('ev-chart-legend-name')[0];
|
|
422
|
-
|
|
423
|
-
const isActive = !colorDOM.className.includes('inactive');
|
|
424
|
-
|
|
425
|
-
if (isActive && this.legendCount === 1) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
if (isActive) {
|
|
430
|
-
this.legendCount -= 1;
|
|
431
|
-
colorDOM.style.backgroundColor = options.inactive;
|
|
432
|
-
nameDOM.style.color = options.inactive;
|
|
433
|
-
} else {
|
|
434
|
-
this.legendCount += 1;
|
|
435
|
-
colorDOM.style.backgroundColor = series.color;
|
|
436
|
-
nameDOM.style.color = options.color;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
colorDOM.classList.toggle('inactive');
|
|
440
|
-
nameDOM.classList.toggle('inactive');
|
|
441
|
-
series.show = !series.show;
|
|
442
|
-
// series.highlight.show = !series.highlight.show;
|
|
443
|
-
// this.overlayClear();
|
|
444
|
-
this.updateChart();
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
onMouseOverLegend(e) {
|
|
448
|
-
if (this.chartOptions.type !== 'sunburst') {
|
|
449
|
-
e.target.style.fontWeight = 'bold';
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
const eventTargetDOM = e.currentTarget;
|
|
453
|
-
const sId = eventTargetDOM.seriesId;
|
|
454
|
-
const series = this.seriesList[sId];
|
|
455
|
-
|
|
456
|
-
if (series.show && this.chartOptions.seriesHighlight) {
|
|
457
|
-
this.overlayClear();
|
|
458
|
-
this.seriesHighlight(sId);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
onMouseOutLegend(e) {
|
|
463
|
-
if (this.chartOptions.type !== 'sunburst') {
|
|
464
|
-
e.target.style.fontWeight = '';
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
this.overlayClear();
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
updateLegendPosition() {
|
|
471
|
-
this.setLegendPosition(this.chartOptions.legend.position);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
defaultColor: ['#2b99f0', '#8ac449', '#009697', '#959c2c', '#004ae7', '#01cc00', '#15679a',
|
|
3
|
-
'#43bcd7', '#e76627', '#5C8558', '#A8A5A3', '#498700', '#832C2D', '#C98C5A', '#3478BE',
|
|
4
|
-
'#BCF061', '#B26600', '#27358F', '#A4534D', '#B89630', '#A865B4', '#254763', '#536859',
|
|
5
|
-
'#E9F378', '#888A79', '#D67D4B', '#2BEC69', '#4A2BEC', '#2BBEEC', '#DDACDF'],
|
|
6
|
-
|
|
7
|
-
extraColor: [],
|
|
8
|
-
|
|
9
|
-
hexToRgb(hex) {
|
|
10
|
-
if (!hex) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
15
|
-
|
|
16
|
-
const r = parseInt(result[1], 16);
|
|
17
|
-
const g = parseInt(result[2], 16);
|
|
18
|
-
const b = parseInt(result[3], 16);
|
|
19
|
-
|
|
20
|
-
return `${r},${g},${b}`;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
calculateMagnitude(val) {
|
|
24
|
-
return Math.floor(Math.log(val) / Math.LN10);
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
aliasPixel(pixelWidth) {
|
|
28
|
-
return (pixelWidth % 2 === 0) ? 0 : 0.5;
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
getLabelStyle(axis) {
|
|
32
|
-
const style = axis.labelStyle;
|
|
33
|
-
return `normal ${style.fontSize}px ${style.fontFamily}`;
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
labelFormat(value) {
|
|
37
|
-
let label;
|
|
38
|
-
if (typeof value === 'number') {
|
|
39
|
-
if (value >= 1000000000) {
|
|
40
|
-
if (value % 1000000000 === 0) {
|
|
41
|
-
label = `${(value / 1000000000).toFixed(1)}G`;
|
|
42
|
-
} else {
|
|
43
|
-
label = `${(value / 1000000000).toFixed(1)}G`;
|
|
44
|
-
}
|
|
45
|
-
} else if (value >= 1000000) {
|
|
46
|
-
if (value % 1000000 === 0) {
|
|
47
|
-
label = `${(value / 1000000).toFixed(1)}M`;
|
|
48
|
-
} else {
|
|
49
|
-
label = `${(value / 1000000).toFixed(1)}M`;
|
|
50
|
-
}
|
|
51
|
-
} else if (value >= 1000) {
|
|
52
|
-
if (value % 1000 === 0) {
|
|
53
|
-
label = `${(value / 1000).toFixed(1)}k`;
|
|
54
|
-
} else {
|
|
55
|
-
label = `${(value / 1000).toFixed(1)}k`;
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
label = value.toFixed(1);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
label = value;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return label;
|
|
65
|
-
},
|
|
66
|
-
};
|