-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
479 lines (391 loc) · 22.7 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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>FRBSTATS | HeRTA</title>
<link rel="shortcut icon" href="favicon.ico" />
<!-- JS -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Fonts-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<script src="script.js"></script>
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet">
<!-- Styles-->
<link href="css/style_overview.min.css" rel="stylesheet">
</head>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">
<!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href=".">
<div class="sidebar-brand-icon rotate-n-0">
<i class="fas fa-database"></i>
</div>
<div style="font-size: 18px;" class="sidebar-brand-text mx-2">FRBSTATS</div>
</a>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item -->
<li class="nav-item active">
<a class="nav-link" href=".">
<i style="font-size:15px" class="fas fa-fw fa-info-circle"></i>
<span style="font-size:15px">Overview</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider">
<!-- Nav Item -->
<li class="nav-item">
<a class="nav-link" href="catalogue">
<i style="font-size:15px" class="fas fa-fw fa-clipboard-list"></i>
<span style="font-size:15px">Catalogue</span></a>
</li>
<!-- Nav Item -->
<li class="nav-item">
<a class="nav-link" href="repeaters">
<i style="font-size:15px" class="fas fa-fw fa-sync-alt"></i>
<span style="font-size:15px">Repeaters</span></a>
</li>
<!-- Nav Item -->
<li class="nav-item">
<a class="nav-link" href="plots">
<i style="font-size:15px" class="fas fa-fw fa-chart-line"></i>
<span style="font-size:15px">Plots</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider my-0">
<!-- Nav Item -->
<li class="nav-item">
<a class="nav-link" href="api">
<i style="font-size:15px" class="fas fa-fw fa-cog"></i>
<span style="font-size:15px">API</span></a>
</li>
<!-- Divider -->
<hr class="sidebar-divider d-none d-md-block">
<!-- Sidebar Toggler (Sidebar) -->
<div class="text-center d-none d-md-inline">
<button class="rounded-circle border-0" id="sidebarToggle"></button>
</div>
</ul>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
<!-- Sidebar Toggle (Topbar) -->
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<!-- Topbar Navbar -->
<ul class="navbar-nav">
<a style="font-size:28px;color:#4e73df">HeRTA:</a>
<a style="font-size:28px;color:#5a5c69;white-space: pre"> FRBSTATS</a>
</ul>
</nav>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Overview</h1>
<a href="https://github.com/HeRTA/FRBSTATS" target="_blank" style="font-size:18px" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i
class="fab fa-github fa-lg text-white-50"></i> Contribute</a>
</div>
<!-- Content Row -->
<div class="row">
<!-- Events Observed -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div style="font-size: 0.82rem;" class="text-sm font-weight-bold text-primary text-uppercase mb-1">
Events Observed (Sources)</div>
<div id="events" class="h5 mb-0 font-weight-bold text-gray-800"></div>
</div>
<div class="col-auto">
<i class="fas fa-clipboard-list fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- FRB Repeaters -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div style="font-size: 0.82rem;" class="text-sm font-weight-bold text-success text-uppercase mb-1">
FRB Repeaters</div>
<div id="repeaters" class="h5 mb-0 font-weight-bold text-gray-800"></div>
</div>
<div class="col-auto">
<i class="fas fa-sync-alt fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Galactic Sources -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-warning shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div style="font-size: 0.82rem;" class="text-sm font-weight-bold text-warning text-uppercase mb-1">
Galactic Sources</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">1</div>
</div>
<div class="col-auto">
<i class="fad fa-galaxy fa-2x text-gray-400"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Event Coverage -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div style="font-size: 0.82rem;" class="text-sm font-weight-bold text-info text-uppercase mb-1">
Event Coverage
</div>
<div class="row no-gutters align-items-center">
<div class="col-auto">
<div id="coverage" class="h5 mb-0 mr-3 font-weight-bold text-gray-800"></div>
</div>
<div class="col">
<div class="progress progress-sm mr-2">
<div id="coverage_progressbar" class="progress-bar bg-info" role="progressbar"
style="width: 0%" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100"></div>
</div>
</div>
</div>
</div>
<div class="col-auto">
<i class="fas fa-user-check fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<!-- Line Chart -->
<div class="col-xl-8 col-lg-7">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 style="font-size:19px" class="font-weight-bold text-primary">Event Count</h6>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-area">
<canvas id="myAreaChart"></canvas>
</div>
</div>
</div>
</div>
<!-- Pie Chart -->
<div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div
class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 style="font-size:19px" class="font-weight-bold text-primary">FRB Class</h6>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChart"></canvas>
</div>
<div class="mt-4 text-center small">
<span class="mr-2">
<i class="fas fa-circle text-primary"></i> One-off events
</span>
<span class="mr-2">
<i class="fas fa-circle text-success"></i> Repeaters
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Content Row -->
<div class="row">
<div class="col-lg-12 mb-4">
<!-- Overview -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 style="font-size:19px" class="font-weight-bold text-primary">About FRBSTATS</h6>
</div>
<div class="card-body">
<img class="img-fluid px-3 px-sm-4 mt-3 mb-4" style="width: 20rem;"
src="img/undraw_hologram.svg" alt="" align="left">
<p>Accessible via a user-friendly web interface, <strong>FRBSTATS</strong> includes
an open-access <a href="catalogue">catalogue</a> of Fast Radio Bursts (FRBs)
published up to date, along with a statistical overview of the observed events.
In addition to the ability of obtaining FRB data directly through the
<a href="api">FRBSTATS API</a>, the platform supports the plotting of parameter
distributions for a variety of visualizations.</p>
<p>FRBSTATS is a fully <strong>open-source</strong> platform. Anyone is welcome to
<a href="https://github.com/HeRTA/FRBSTATS/issues">contribute</a> with code, data
and ideas for improvement.</p>
<p>If the FRBSTATS platform contributes to work that leads to publication, please acknowledge the project by <a href="https://ascl.net/2106.028" target="_blank"><b>citing it</b></a>.</p>
<center>
<a href="catalogue" style="display:inline-block;margin-bottom:6px;" class="d-none d-sm-inline-block btn btn-lg btn-primary shadow-sm"><i
class="fas fa-clipboard-list fa-lg text-white-50"></i> View Catalogue</a>
<a href="repeaters" style="display:inline-block;margin-bottom:6px;" class="d-none d-sm-inline-block btn btn-lg btn-danger shadow-sm"><i
class="fas fa-sync-alt fa-lg text-white-50" aria-hidden="true"></i> Repeater Tree</a>
<a href="plots" style="display:inline-block;margin-bottom:6px;" class="d-none d-sm-inline-block btn btn-lg btn-success shadow-sm"><i
class="far fa-chart-line fa-lg text-white-50"></i> Plot Parameters</a>
</center>
</div>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>© HeRTA 2021</span>
</div>
</div>
</footer>
<!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<script type="text/javascript">
// Last update
$( document ).ready(function() {
fetch("https://api.github.com/repos/HeRTA/FRBSTATS/commits?path=catalogue.csv&page=1&per_page=1")
.then(response => response.text())
.then(jsonString => {
const obj = JSON.parse(jsonString);
let arr = obj[0];
parsed = JSON.stringify(arr, null, 1);
var commit_date = parsed.split("\n");
commit_date = commit_date[12].substring(12, 22);
//console.log(commit_date);
});
// Events observed
fetch("catalogue.csv")
.then(response => response.text())
.then(csvString => {
// Split the csv into rows
const rows = csvString.split("\n");
lines = -1 // Skip CSV catalogue header
for (row of rows) {
lines = lines + 1
}
}).then(function (response){
fetch("repeaters.json")
.then(response => response.text())
.then(jsonString => {
var temp = jsonString;
var count_all = (temp.match(/parent/g) || []).length - 1;
var count = (temp.match(/children/g) || []).length - 1;
document.getElementById("events").innerHTML = lines.toString() + " (" + (lines-count_all+count).toString() + ")";
document.getElementById("repeaters").innerHTML = count;
});
}).then(function (response){
fetch("catalogue.json")
.then(response => response.text())
.then(jsonString => {
var temp = jsonString;
function round(value, precision) {
var multiplier = Math.pow(10, precision || 0);
return Math.round(value * multiplier) / multiplier;
}
var missing_frb = (temp.match(/"frb": "-"/g) || []).length;
var total_frb = (temp.match(/"frb":/g) || []).length;
var percentage_frb = round(100*(1-(missing_frb/total_frb)),1);
var missing_utc = (temp.match(/"utc": "-"/g) || []).length;
var total_utc = (temp.match(/"utc":/g) || []).length;
var percentage_utc = round(100*(1-(missing_utc/total_utc)),1);
var missing_mjd = (temp.match(/"mjd": "-"/g) || []).length;
var total_mjd = (temp.match(/"mjd":/g) || []).length;
var percentage_mjd = round(100*(1-(missing_mjd/total_mjd)),1);
var missing_telescope = (temp.match(/"telescope": "-"/g) || []).length;
var total_telescope = (temp.match(/"telescope":/g) || []).length;
var percentage_telescope = round(100*(1-(missing_telescope/total_telescope)),1);
var missing_ra = (temp.match(/"ra": "-"/g) || []).length;
var total_ra = (temp.match(/"ra":/g) || []).length;
var percentage_ra = round(100*(1-(missing_ra/total_ra)),1);
var missing_dec = (temp.match(/"dec": "-"/g) || []).length;
var total_dec = (temp.match(/"dec":/g) || []).length;
var percentage_dec = round(100*(1-(missing_dec/total_dec)),1);
var missing_l = (temp.match(/"l": "-"/g) || []).length;
var total_l = (temp.match(/"l":/g) || []).length;
var percentage_l = round(100*(1-(missing_l/total_l)),1);
var missing_b = (temp.match(/"b": "-"/g) || []).length;
var total_b = (temp.match(/"b":/g) || []).length;
var percentage_b = round(100*(1-(missing_b/total_b)),1);
var missing_frequency = (temp.match(/"frequency": "-"/g) || []).length;
var total_frequency = (temp.match(/"frequency":/g) || []).length;
var percentage_frequency = round(100*(1-(missing_frequency/total_frequency)),1);
var missing_dm = (temp.match(/"dm": "-"/g) || []).length;
var total_dm = (temp.match(/"dm":/g) || []).length;
var percentage_dm = round(100*(1-(missing_dm/total_dm)),1);
var missing_flux = (temp.match(/"flux": "-"/g) || []).length;
var total_flux = (temp.match(/"flux":/g) || []).length;
var percentage_flux = round(100*(1-(missing_flux/total_flux)),1);
var missing_width = (temp.match(/"width": "-"/g) || []).length;
var total_width = (temp.match(/"width":/g) || []).length;
var percentage_width = round(100*(1-(missing_width/total_width)),1);
var missing_fluence = (temp.match(/"fluence": "-"/g) || []).length;
var total_fluence = (temp.match(/"fluence":/g) || []).length;
var percentage_fluence = round(100*(1-(missing_fluence/total_fluence)),1);
var missing_snr = (temp.match(/"snr": "-"/g) || []).length;
var total_snr = (temp.match(/"snr":/g) || []).length;
var percentage_snr = round(100*(1-(missing_snr/total_snr)),1);
var missing_ref = (temp.match(/"ref": "-"/g) || []).length;
var total_ref = (temp.match(/"ref":/g) || []).length;
var percentage_ref = round(100*(1-(missing_ref/total_ref)),1);
var coverage = round(100*(percentage_frb+percentage_utc+percentage_mjd+percentage_telescope+percentage_ra+percentage_dec+percentage_l+percentage_b+percentage_frequency+percentage_dm+percentage_flux+percentage_width+percentage_fluence+percentage_snr+percentage_ref)/(15*100), 1);
document.getElementById("coverage").innerHTML = coverage + "%";
$('#coverage_progressbar').attr('aria-valuenow', coverage).css('width', coverage+'%');
})
});
});
</script>
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<!-- Custom scripts for all pages-->
<script src="js/style.min.js"></script>
<!-- Page level plugins -->
<script src="vendor/chart.js/chart.min.js"></script>
<!-- Page level custom scripts -->
<script src="js/demo/chart-area-demo.js"></script>
<script src="js/demo/chart-pie-demo.js"></script>
</body>
</html>