-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
83 lines (68 loc) · 2.88 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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Vizabi Testing</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="libs/VizabiSharedComponents.css" rel="stylesheet" type="text/css">
<link href="libs/bubblechart.css" rel="stylesheet" type="text/css">
<link href="libs/linechart.css" rel="stylesheet" type="text/css">
<script src="libs/d3.v6.min.js"></script>
<script src="libs/mobx.umd.js"></script>
<script src="libs/Vizabi.js"></script>
<script src="libs/VizabiSharedComponents.js"></script>
<script src="libs/bubblechart.js"></script>
<script src="libs/linechart.js"></script>
<script src="libs/reader-ddfcsv.js"></script>
<script src="libs/reader-ddfservice.js"></script>
<script src="libs/reader-ddfcsv-polyfill.js"></script>
</head>
<body>
<p id="instructions">
Y = new data, X = old data. If bubbles are on the diagonal y=x, that means no change. <br/>
Top of diagonal --> value is larger in new data <br/>
Bottom of diagonal --> value is larger in old data <br/>
<br/>
Change indicator in line chart to have it changed in the bubbles too
</p>
<!--select id="concepts_selector" onchange="update_chart();">
<option value="" selected="selected">--- pick an indicator to compare ---</option>
<option value="tb_hivplus_deaths_per_100000_estimated">tb_hivplus_deaths_per_100000_estimated</option>
<option value="tb_hivplus_number_of_deaths_estimated">tb_hivplus_number_of_deaths_estimated</option>
</select-->
<!--button id="prev_option" onclick="nextPrevOpt(-1);">PREVIOUS</button-->
<!--button id="next_option" onclick="nextPrevOpt(+1);">NEXT</button-->
<div id="placeholder-bubble" class="vzb-tool vzb-placeholder"></div>
<div id="placeholder-line" class="vzb-tool vzb-placeholder"></div>
<script src="script.js"></script>
<script>
var nextPrevOpt = function(direction) {
var sel = document.getElementById('concepts_selector');
var i = sel.selectedIndex + direction;
if (i < 0) i = sel.options.length - 1;
sel.options[i % sel.options.length].selected = true;
update_chart();
}
// window.onkeypress = function(e) {
// if (e.keyCode == 91) document.getElementById('prev_option').click();
// if (e.keyCode == 93) document.getElementById('next_option').click();
// }
var update_chart = function() {
var concept_name = document.getElementById('concepts_selector').value
if(!concept_name) return;
viz1.model.state.marker.axis_x.setWhich({
concept: concept_name,
dataSource: "data_alternative"
})
viz1.model.state.marker.axis_y.setWhich({
concept: concept_name,
dataSource: "data"
})
viz2.model.state.marker.axis_y.setWhich({
concept: concept_name,
dataSource: "data"
})
};
</script>
</body>
</html>