~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/d3/examples/choropleth/choropleth-bounds.html

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.v2.js"></script>
6
 
    <style type="text/css">
7
 
 
8
 
svg {
9
 
  background: #eee;
10
 
  width: 960px;
11
 
  height: 500px;
12
 
}
13
 
 
14
 
#counties path {
15
 
  stroke: steelblue;
16
 
}
17
 
 
18
 
    </style>
19
 
  </head>
20
 
  <body>
21
 
    <script type="text/javascript">
22
 
 
23
 
var svg = d3.select("body")
24
 
  .append("svg");
25
 
 
26
 
var counties = svg.append("g")
27
 
    .attr("id", "counties");
28
 
 
29
 
var path = d3.geo.path();
30
 
 
31
 
d3.json("../data/us-counties.json", function(json) {
32
 
  counties.selectAll("path")
33
 
      .data(json.features)
34
 
    .enter().append("path")
35
 
      .attr("d", function(d) {
36
 
        return path({
37
 
          type: "LineString",
38
 
          coordinates: d3.geo.bounds(d)
39
 
        });
40
 
      });
41
 
});
42
 
 
43
 
    </script>
44
 
  </body>
45
 
</html>