-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiran2.js
43 lines (36 loc) · 922 Bytes
/
iran2.js
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
function IranGeo() {
var height=300,
width=300;
function my(selection) {
iran(selection);
}
function iran(selection) {
selection.each(function(data, i) {
// plot iran here
var projection = d3.geo.albers();
var path = d3.geo.path().projection(projection);
var element = d3.select(this);
var svg = element.selectAll('svg').data([data]);
//Enter
var svgEnter = svg.enter()
.append('svg')
.append('g')
.attr('class', 'graph')
.attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');
svg.attr('width', width)
.attr('height', height);
});
}
my.width = function(_) {
if(!arguments.length) return width;
width = _;
return my;
}
my.height = function(_) {
if(!arguments.length) return height;
height = _;
return my;
}
return my;
var irantop =
}