-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobalInteractFunction.js
More file actions
99 lines (91 loc) · 2.78 KB
/
globalInteractFunction.js
File metadata and controls
99 lines (91 loc) · 2.78 KB
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
function countrySelect(d) {
interactPara.countrySelect.push(d);
interactPara.recentSelect=d;
mapGraph.countrySelect(interactPara.countrySelect);
updateBaseInfo(getSpecificData(d, interactPara.time));
updateTLCountry(interactPara.countrySelect);
console.log(interactPara.countrySelect);
parallelCountrySelect(interactPara.countrySelect);
d3.select('#countrySelect1').select('ul').selectAll('li').selectAll('li')
.style('background', function (d) {
if (interactPara.countrySelect.indexOf(d)!==-1){
return '#5AB1EF';
}
else{
return 'white';
}
})
}
function countryCancelSelect(d) {
var index = interactPara.countrySelect.indexOf(d);
if (index!==-1) {
interactPara.countrySelect.splice(index, 1);
}
//interactPara.recentSelect = '';
console.log(d)
parallelCountryCancelSelect(d);
mapGraph.countryCancelSelect(d);
updateTLCountry(interactPara.countrySelect);
d3.select('#countrySelect1').select('ul').selectAll('li').selectAll('li')
.style('background', function (d) {
if (interactPara.countrySelect.indexOf(d)!==-1){
return '#5AB1EF';
}
else{
return 'white';
}
})
}
function categorySelect(d) {
interactPara.category = d;
mapGraph.update(interactPara.category, interactPara.time);
drawParallel();
changeRadial();
updateTLCountry(interactPara.countrySelect);
d3.select('#categorySelect').selectAll('button')
.style('background', function (d) {
if (d===interactPara.category){
return '#5AB1EF';
}
else{
return 'white';
}
})
}
function continentSelect(d) {
var index = interactPara.continentSelect.indexOf(d);
if (index!==-1) {
interactPara.continentSelect.splice(index, 1);
}
else{
interactPara.continentSelect.push(d);
}
drawParallel();
changeRadial();
d3.select('#countrySelect2').select('ul').selectAll('li')
.style('background', function (d) {
if (interactPara.continentSelect.indexOf(d)!==-1){
return '#5AB1EF';
}
else{
return 'white';
}
})
}
function filtByTotalCase(n) {
interactPara.countryFilter[0] = n;
drawParallel();
changeRadial();
}
function filtByDeathCase(n) {
interactPara.countryFilter[1] = n;
drawParallel();
changeRadial();
}
function timeSelect(t){
interactPara.time = t;
mapGraph.update(interactPara.category, interactPara.time);
drawParallel();
changeRadial();
updateBaseInfo(getSpecificData(interactPara.recentSelect, interactPara.time));
}