-
Notifications
You must be signed in to change notification settings - Fork 2
/
covidfrance.html
301 lines (280 loc) · 15.7 KB
/
covidfrance.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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<html lang="en">
<title>Covid-19 Dashboard Tracker</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/w3.css">
<link rel="stylesheet" href="css/w3-colors-metro.css">
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="css/tabulator_midnight.min.css" rel="stylesheet">
<link href="css/customcss.css" rel="stylesheet">
<body class="bg-dashboard">
<div class="w3-bar w3-top w3-large topbar-custom" style="z-index:4">
<button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey"
onclick="w3_open();"><i class="fa fa-bars"></i> Menu</button>
<a href="index.html"><span class="w3-bar-item w3-right w3-xlarge dashboardTitle"><i class="fas fa-spinner"></i>
CovidData</span></a>
</div>
<!-- Sidebar/menu -->
<nav class="w3-sidebar w3-collapse sidebar-custom w3-animate-left w3-round-large w3-card-4 w3-margin"
id="dashSidebar">
<div class="w3-container w3-margin-top">
<h5 class="sidebaritle">Covid Data Dashboard</h5>
</div>
<hr>
<div class="w3-bar-block">
<a href="#" class="w3-bar-item w3-button w3-padding-16 w3-hide-large bg-closemenu" onclick="w3_close()"
title="close menu"><i class="far fa-times-circle w3-large w3-margin-right"></i> Close Menu</a>
<a href="index.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-amber"><i
class="fas fa-pills w3-large w3-margin-right"></i>
World Overview</a>
<a href="covidvaccinations.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-green"><i
class="fas fa-syringe w3-large w3-margin-right"></i> World Vaccinations</a>
<a href="covidworldmaps.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-teal"><i
class="fas fa-globe-europe w3-large w3-margin-right"></i> World Map</a>
<a href="covidchartsdata.html"
class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-light-green"><i
class="fas fa-chart-bar w3-large w3-margin-right"></i> World Charts</a>
<a href="covidfrance.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-blue"><i
class="fas fa-flag w3-large w3-margin-right"></i> Covid France</a>
<a href="covidnews.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-cyan"><i
class="fas fa-newspaper w3-large w3-margin-right"></i> News about Covid</a>
<a href="about.html" class="w3-margin-bottom w3-bar-item w3-button w3-padding w3-hover-red"><i
class="fas fa-info-circle w3-large w3-margin-right"></i> About</a>
</div>
</nav>
<!-- Overlay effect when opening sidebar on small screens -->
<div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer"
title="close side menu" id="myOverlay"></div>
<!-- !PAGE CONTENT! -->
<div class="w3-main main-custom">
<!-- Header -->
<header class="w3-container">
<h5 class="w3-large"><i class="fas fa-chart-line w3-text-blue"></i> Cumulative & Actual French cases
COVID-19 Coronavirus Pandemic. Last update: <span id="latestUpdate" class="w3-text-blue"></span></h5>
</header>
<div class="w3-row-padding w3-margin-bottom">
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-light-blue">
<h4 class="w3-large">New hospital admissions</h4>
<div class="w3-left"><i class="fas fa-hospital w3-xxxlarge "></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-light-blue" id="new_hosp"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-blue">
<h4 class="w3-large">Actual hospitalizations</h4>
<div class="w3-left"><i class="fas fa-procedures w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-blue" id="actual_hosp"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-orange">
<h4 class="w3-large">New hospital intensive care</h4>
<div class="w3-left"><i class="fas fa-plus-square w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-orange" id="new_rea"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-deep-orange">
<h4 class="w3-large">Actual intensive care</h4>
<div class="w3-left"><i class="fas fa-exclamation-triangle w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-deep-orange" id="actual_rea"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
</div>
<div class="w3-row-padding w3-margin-bottom">
<div class="w3-quarter">
<div class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-red">
<h4 class="w3-large">Total Deaths (Hospitals & ESMS)</h4>
<div class="w3-left"><i class="far fa-hospital w3-xxxlarge "></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-red" id="tot_death"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-indigo">
<h4 class="w3-large">New Confirmed Cases</h4>
<div class="w3-left"><i class="fas fa-bed w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-indigo" id="new_conf_j1"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-purple">
<h4 class="w3-large">Total Confirmed Cases</h4>
<div class="w3-left"><i class="fas fa-head-side-virus w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-purple" id="tot_confirmed"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
<div class="w3-quarter">
<div
class="w3-container w3-padding-16 dark-element w3-round-large w3-card-4 w3-leftbar w3-border-green">
<h4 class="w3-large">Total Recovered (after hospitalization)</h4>
<div class="w3-left"><i class="fas fa-heartbeat w3-xxxlarge"></i></div>
<div class="w3-right">
<h3 class="w3-xlarge w3-text-green" id="tot_recovered"></h3>
</div>
<div class="w3-clear"></div>
</div>
</div>
</div>
<div class="w3-container" style="margin:0 -16px">
<div class="w3-panel">
<div class="w3-container" style="margin:0 -16px">
<h5 class="w3-large"><i class="fas fa-table w3-text-blue"></i> Reported French Cases by Counties and
Regions. Last update: <span id="latestUpdateTableFr" class="w3-text-blue"></span> </h5>
<div class="w3-bar">
<select id="filterField"
class="w3-bar-item w3-mobile w3-select dark-element-withfont w3-round w3-margin-right"></select>
<button id="filter-clear"
class="w3-bar-item w3-button w3-round w3-mobile w3-hover-aqua w3-border w3-border-aqua w3-margin-right">Clear
Filters</button>
<button id="pdfDownload"
class="w3-bar-item w3-button w3-round w3-mobile w3-hover-red w3-border w3-border-red w3-margin-right">Generate
PDF</button>
<button id="xlsxDownload"
class="w3-bar-item w3-button w3-round w3-mobile w3-hover-green w3-border w3-border-green">Generate
Excel</button>
</div>
</div>
<div class="w3-row w3-padding-16 ">
<div id="covidTableFrance" class="w3-col w3-round-large w3-card-4"></div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="w3-container w3-padding-16 footer-custom">
<p class="w3-right"><span class="copyrightDate"></span> Made by Maxime des Touches. <a
href="https://github.com/elreviae" target="_blank" class="footerlink">Github</a></p>
</footer>
<!-- End page content -->
</div>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/anychart/proj4.js"></script>
<script src="js/moment-with-locales.min.js"></script>
<script src="js/tabulator/tabulator.min.js"></script>
<script src="js/tabulator/jspdf.min.js"></script>
<script src="js/tabulator/autotable.js"></script>
<script src="js/tabulator/xlsx.full.min.js"></script>
<script src="js/min/maintabulatorFr.min.js"></script>
<script src="js/customsite.js"></script>
<script>
let covApiGlobalFr = 'https://coronavirusapifr.herokuapp.com/data/live/france';
$.getJSON(covApiGlobalFr, function (responseData) {
$.each(responseData, function (key, obj) {
let fieldsData = obj;
let noData = 'Not Available ...';
let latestUpdate = moment(obj.date).format('LLL');
let tot_recovered = obj.rad;
let tot_confirmed = obj.conf;
let tot_death = obj.dc_tot;
let new_conf_j1 = obj.conf_j1;
let actual_hosp = obj.hosp;
let new_rea = obj.incid_rea;
let actual_rea = obj.rea;
let new_hosp = obj.incid_hosp;
if (latestUpdate == null || latestUpdate == '') { $('#latestUpdate').html(noDataTimeline); } else { $('#latestUpdate').html(latestUpdate); }
if (tot_recovered == null || tot_recovered == '') { $('#tot_recovered').html(noData) } else { $('#tot_recovered').html(tot_recovered.toLocaleString()) }
if (tot_confirmed == null || tot_confirmed == '') { $('#tot_confirmed').html(noData) } else { $('#tot_confirmed').html(tot_confirmed.toLocaleString()) }
if (tot_death == null || tot_death == '') { $('#tot_death').html(noData) } else { $('#tot_death').html(tot_death.toLocaleString()) }
if (new_conf_j1 == null || new_conf_j1 == '') { $('#new_conf_j1').html(noData) } else { $('#new_conf_j1').html('+ ' + new_conf_j1.toLocaleString()) }
if (actual_hosp == null || actual_hosp == '') { $('#actual_hosp').html(noData) } else { $('#actual_hosp').html(actual_hosp.toLocaleString()) }
if (new_rea == null || new_rea == '') { $('#new_rea').html(noData) } else { $('#new_rea').html('+ ' + new_rea.toLocaleString()) }
if (actual_rea == null || actual_rea == '') { $('#actual_rea').html(noData) } else { $('#actual_rea').html(actual_rea.toLocaleString()) }
if (new_hosp == null || new_hosp == '') { $('#new_hosp').html(noData) } else { $('#new_hosp').html('+ ' + new_hosp.toLocaleString()) }
});
});
</script>
<script>
$.getJSON(covApiFr, function (json) {
$('#filterField').empty();
$('#filterField').append($('<option disabled selected>').text("Select an area"));
$.each(json, function (key, obj) {
$('#filterField').append($('<option>').text(obj.lib_dep).attr('value', obj.dep));
let fieldsData = obj;
let noData = 'Not Available ...';
let latestUpdateTableFr = moment(obj.date).format('LLL');
if (latestUpdateTableFr == null || latestUpdateTableFr == '') { $('#latestUpdateTableFr').html(noData); } else { $('#latestUpdateTableFr').html(latestUpdateTableFr); }
});
});
$("#filterField").change(function () {
covFranceTable.setFilter("dep", "=", $(this).val());
});
// Clear filters on click
$("#filter-clear").click(function () {
$("#filterField").val("");
covFranceTable.clearFilter();
covFranceTable.clearHeaderFilter();
});
window.addEventListener('resize', function () {
covFranceTable.redraw(true);
});
$("#pdfDownload").click(function () {
covFranceTable.downloadToTab("pdf", "CovidData-Report-France.pdf", {
orientation: "landscape",
autoTable: function (doc) {
doc.text("CovidData Report France Cases", 5, 15);
//return the autoTable config options object
return {
theme: 'striped',
tableWidth: 'auto',
pageBreak: 'auto',
rowPageBreak: 'auto',
styles: {
cellPadding: 0.5,
fontSize: 8,
},
headStyles: {
fillColor: [26, 26, 26],
},
footStyles: {
fillColor: [26, 26, 26],
},
bodyStyles: {
fillColor: [102, 102, 102],
textColor: 255,
},
alternateRowStyles: {
fillColor: [68, 68, 68],
},
margin: { top: 20, bottom: 20, left: 10, right: 10 },
};
},
});
});
$("#xlsxDownload").click(function () {
covFranceTable.download("xlsx", "covidDataFrance.xlsx", { sheetName: "CovidData France Report" });
});
</script>
</body>
</html>