-
Notifications
You must be signed in to change notification settings - Fork 6
/
scatterplots.html
104 lines (89 loc) · 2.62 KB
/
scatterplots.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Map gardening scatterplots</title>
<script src="d3/d3.v3.min.js" charset="utf-8"></script>
<script src="d3/queue.v1.min.js" charset="utf-8"></script>
<link href="gardening_charts.css" rel="stylesheet" />
</head>
<body>
<h1>OSM contributor activity</h1>
<div id="chart"></div>
<script src="gardening_charts.js"></script>
<script type="text/javascript">
var places = [
"amsterdam",
"auckland",
"barcelona", // new city, needs population and area
"bayarea",
"berlin",
"boston",
"buenosaires",
"cairo",
"chicago", // new city, needs population and area
//"crimea",
//"cyprus",
//"douala",
"haiti",
"istanbul",
"jakarta",
//"jerusalem",
"kathmandu", // new city, needs population and area
"lasvegas", // new city, needs population and area
"london",
"losangeles",
"manchester",
"mexicocity",
"miami", // new city, needs population and area
"minsk",
"montevideo",
"montreal",
"moscow",
"mumbai",
"nairobi",
"newyork",
//"quebec", // There's an error in my blankspot analysis for these cities. Skip for now
//"paris", // There's an error in my blankspot analysis for these cities. Skip for now
"rio",
"santiago",
"seattle",
"seoul",
"sydney", // new city, needs population and area
//"tirana",
"tokyo",
"toronto",
"vancouver"
//"yaounde"
];
var currentlySelected = "vancouver";
var q = queue();
places.forEach(function(place) {
q.defer(d3.tsv, "userstats/outputv5_" + place + "_raster_1000m.tsv");
});
q.awaitAll(ready);
function ready(error, datasets) {
if (error) {
// Do more here
console.log("Error loading file");
} else {
setX('count-log')
setY('blankcount-log')
setR('days_active-linear');
userstats = [];
for (var i = 0; i < places.length; i++) {
// for each row, add the placename. Must be a better way to do this.
// For the "userstats" files
datasets[i].forEach(function(d) {
d.place = places[i];
userstats.push(d);
});
}
createScatters(userstats);
togglePlaces(false);
togglePlace(currentlySelected,true);
}
}
</script>
</body>
</html>