source: Dev/trunk/d3/examples/choropleth/choropleth-bounds.html @ 76

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

d3

File size: 900 bytes
Line 
1<!DOCTYPE html>
2<html>
3  <head>
4    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
5    <script type="text/javascript" src="../../d3.js"></script>
6    <script type="text/javascript" src="../../d3.geo.js"></script>
7    <style type="text/css">
8
9svg {
10  background: #eee;
11  width: 960px;
12  height: 500px;
13}
14
15#counties path {
16  stroke: steelblue;
17}
18
19    </style>
20  </head>
21  <body>
22    <script type="text/javascript">
23
24var svg = d3.select("body")
25  .append("svg:svg");
26
27var counties = svg.append("svg:g")
28    .attr("id", "counties");
29
30var path = d3.geo.path();
31
32d3.json("../data/us-counties.json", function(json) {
33  counties.selectAll("path")
34      .data(json.features)
35    .enter().append("svg:path")
36      .attr("d", function(d) {
37        return path({
38          type: "LineString",
39          coordinates: d3.geo.bounds(d)
40        });
41      });
42});
43
44    </script>
45  </body>
46</html>
Note: See TracBrowser for help on using the repository browser.