forked from nizantz/India
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (31 loc) · 796 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<title>India States</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="UTF-8">
<meta content="utf-8" http-equiv="encoding">
</head>
<body>
<script>
var width = 2000,
height = 1160;
var indCanvas = d3.select("body").append("svg")
.attr('width',width)
.attr('height',height);
d3.json('data/IND0.geojson', function(err, data) {
// if (err) return console.error(err);
var group = indCanvas.selectAll('g')
.data(data.features)
.enter()
.append('g');
var projection = d3.geo.mercator().scale(500).translate([width / 2, height / 2]);
var path = d3.geo.path().projection(projection);
var areas = group.append('path')
.attr('d',path)
.attr('class','area')
.attr('fill','steelblue');
});
</script>
</body>
</html>