-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
282 lines (253 loc) · 8.32 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<html lang="en">
<head>
<script src="//unpkg.com/d3"></script>
<script src="//unpkg.com/globe.gl"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@<version>/build/three.module.js",
"three/addons/": "https://unpkg.com/three@<version>/examples/jsm/"
}
}
</script>
<meta charset="utf-8" />
</head>
<body>
<div id="visualization-container">
<div id="globeViz"></div>
<div id="unshownData-container">
<div class="modal-overlay"></div>
<table class="table-col">
<tr>
<th> </th>
<th>Total Cases</th>
<th>Total Deaths</th>
</tr>
<tr>
<td>Andorra</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Antigua and Barbuda</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Bahrain</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Barbados</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Cabo Verde</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Comoros</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Dominica</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Grenada</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Holy See</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Kiribati</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Liechtenstein</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Maldives</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Malta</td>
<td>0</td>
<td>0</td>
</tr>
<td>Marshall Islands</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Mauritius</td>
<td>0</td>
<td>0</td>
</tr>
</table>
<table class="table-col">
<tr>
<th> </th>
<th>Total Cases</th>
<th>Total Deaths</th>
</tr>
<tr>
<td>Micronesia</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Monaco</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Nauru</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Palau</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Saint Kitts and Nevis</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Saint Lucia</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Saint Vincent and the Grenadines</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Samoa</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>San Marino</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Sao Tome and Principe</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Seychelles</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Singapore</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Tonga</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>Tuvalu</td>
<td>0</td>
<td>0</td>
</tr>
</table>
</div>
<div id="slider-container">
<span id="dateDisplay">2020-01-22</span>
<input class="range" type="range" id="dateSlider" min="0" max="1142" value="0">
</div>
<button id="showTableBtn">Show Table</button>
<button id="InfoBtn">Project Info</button>
<div id="projectInfo">
PROJECT INFO<br /><br />
This project is a 3D Globe visualization of country-wide COVID-19 total cases and total deaths from 2020-01-22 to 2023-03-09.<br /><br />
Considering the GPU capacity and performance of computers, some countries are not indicated on the globe.
They are indicated in the table. <br /><br />
The framework and geoJson file used are from <a href="https://globe.gl/" target="_blank">Globe GL</a>module.The dataset used is <a href="https://github.com/EP-Visual-Design/COVID-19-parsed-data/tree/main" target="_blank">parsed data</a> by John Henry Thompson, whose data source is <a href="https://github.com/CSSEGISandData/COVID-19" target="_blank">CSSE at Johns Hopkins University</a>.
The full project documentation can be accessed <a href="https://pastoral-galliform-f42.notion.site/Documentation-of-Globe-Viz-7ff04b815f3e4d99b3e5d4e9a543a913?pvs=4" target="_blank">Here</a>. <br /><br />
For clarification, the height of the country polygons are mapped based on the total cases of the countries.<br /><br />
This project is contributed to <a href="https://covid19impactproject.com/" target="_blank">The Covid Impact Project</a> by John Henry Thompson & Shindy Johnson.<br /><br />
Cara Cai 2023.12
</div>
</div>
<script type="module" src="sketch.js"></script>
<script> // script for the show table button
document.addEventListener('DOMContentLoaded', (event) => {
document.getElementById('unshownData-container').style.display = 'none'; // Hide the table
document.getElementById('showTableBtn').textContent = 'Show Table'; // Set button text to 'Show Table'
});
document.getElementById('showTableBtn').addEventListener('click', function() {
var container = document.getElementById('unshownData-container');
var overlay = document.querySelector('.modal-overlay');
if (container.style.display === 'none' || container.style.display === '') {
container.style.display = 'flex'; // Show the table
this.textContent = 'Close Table'; // Change button text to 'Close Table'
if (!overlay) {
container.insertAdjacentHTML('beforeend', '<div class="modal-overlay"></div>');
}
overlay.style.display = 'block'; // Ensure the overlay is shown
} else {
container.style.display = 'none'; // Hide the table
this.textContent = 'Show Table'; // Change button text to 'Show Table'
if (overlay) {
overlay.style.display = 'none'; // Hide the overlay
}
}
});
// document.addEventListener('click', function(event) {
// var container = document.getElementById('unshownData-container');
// var overlay = document.querySelector('.modal-overlay');
// var btn = document.getElementById('showTableBtn');
// // Close the table if the click is outside the container and not on the button
// if (!container.contains(event.target) && event.target !== btn && container.style.display === 'flex') {
// container.style.display = 'none';
// if (overlay) {
// overlay.style.display = 'none'; // Hide the overlay
// }
// }
// });
</script>
<script>//for the show project info
document.getElementById('projectInfo').style.display = 'none';
document.getElementById('InfoBtn').addEventListener('click', function() {
var infoDiv = document.getElementById('projectInfo');
// Toggle the display of the projectInfo div
infoDiv.style.display = (infoDiv.style.display === 'none' || infoDiv.style.display === '') ? 'block' : 'none';
});
document.addEventListener('click', function(event) {
var infoDiv = document.getElementById('projectInfo');
var btn = document.getElementById('InfoBtn');
// Close the infoDiv when clicking outside
if (!infoDiv.contains(event.target) && !btn.contains(event.target) && infoDiv.style.display === 'block') {
infoDiv.style.display = 'none';
}
});
</script>
</body>
</html>