source: Dev/trunk/d3/examples/azimuthal/azimuthal.js @ 76

Last change on this file since 76 was 76, checked in by fpvanagthoven, 14 years ago

d3

File size: 773 bytes
RevLine 
[76]1var xy = d3.geo.azimuthal().scale(240).mode("stereographic"),
2    path = d3.geo.path().projection(xy),
3    svg = d3.select("body").append("svg:svg");
4
5d3.json("../data/world-countries.json", function(collection) {
6  svg.selectAll("path")
7      .data(collection.features)
8    .enter().append("svg:path")
9      .attr("d", path)
10    .append("svg:title")
11      .text(function(d) { return d.properties.name; });
12});
13
14function refresh() {
15  svg.selectAll("path")
16      .attr("d", path);
17  d3.select("#lon span")
18      .text(xy.origin()[0]);
19  d3.select("#lat span")
20      .text(xy.origin()[1]);
21  d3.select("#scale span")
22      .text(xy.scale());
23  d3.select("#translate-x span")
24      .text(xy.translate()[0]);
25  d3.select("#translate-y span")
26      .text(xy.translate()[1]);
27}
Note: See TracBrowser for help on using the repository browser.