-
Notifications
You must be signed in to change notification settings - Fork 1
/
d3lol.html
67 lines (43 loc) · 977 Bytes
/
d3lol.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
<script src="http://d3js.org/d3.v3.min.js"></script>
<h1>d3lol</h1>
<geomap>
</geomap>
<script>
globaalidata = [
{
latlng: [ 51.508, -0.11 ]
},
{
latlng: [51.507, -0.10]
},
{
latlng: [51.509, -0.12]
}
];
smurrffiliikkuu = function() {
globaalidata[0].latlng[0] += 0.001;
paivitaSmurffit(globaalidata);
}
paivitaSmurffit = function(data) {
d3map = d3.select("geomap")
console.log("d3map", d3map)
var smurffit = d3map.selectAll("smurffi")
.data(data)
smurffit
.enter()
.append("smurffi")
// .each(angular.element(document.querySelector("map")).scope().compileri);
smurffit
.text(function(d, i){return i;})
.attr("lat", function(d) {
return d.latlng[0];
})
.attr("lon", function(d) {
return d.latlng[1];
})
// .each(angular.element(document.querySelector("map")).scope().updateri);
}
window.addEventListener("DOMContentLoaded", function() {
paivitaSmurffit(globaalidata);
});
</script>