-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph-handler.js
47 lines (35 loc) · 1.56 KB
/
graph-handler.js
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
var isInflationData = false;
var fileName = "main-data.csv";
var isManned = false;
document.addEventListener('DOMContentLoaded', function () {
var checkbox = document.querySelector('input[class="inflation-slider"]');
checkbox.addEventListener('change', function () {
if (checkbox.checked) {
isInflationData = true
fileName = "main-data-inflation.csv";
console.log('Checked');
} else {
isInflationData = false
fileName = "main-data.csv"
console.log('Not checked');
}
document.getElementById("main-graph").innerHTML = "";
document.getElementById("gradient-legend").innerHTML = "";
runMainGraph(isInflationData, fileName, isManned);
});
});
document.addEventListener('DOMContentLoaded', function () {
var checkbox = document.querySelector('input[class="apollo-slider"]');
checkbox.addEventListener('change', function () {
if (checkbox.checked) {
isManned = true
console.log('Checked');
} else {
isManned = false
console.log('Not checked');
}
document.getElementById("main-graph").innerHTML = "";
document.getElementById("gradient-legend").innerHTML = "";
runMainGraph(isInflationData, fileName, isManned);
});
});