Sha256: a3c95d7621a9cb6ecdc7c7f07d779045a77ac349afbea50bd79780766853864e

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <script type="text/javascript" src="../../d3.js"></script>
    <script type="text/javascript" src="../../d3.geo.js"></script>
    <script type="text/javascript" src="../../d3.geom.js"></script>
    <script type="text/javascript" src="../../d3.behavior.js"></script>
    <style type="text/css">

svg {
  background: #eee;
  width: 960px;
  height: 500px;
}

    </style>
  </head>
  <body>
    <script type="text/javascript">

var svg = d3.select("body")
  .append("svg:svg")
    .call(d3.behavior.zoom()
    .on("zoom", redraw))
  .append("svg:g");

var counties = svg.append("svg:g")
    .attr("id", "counties");

var path = d3.geo.path();

var fill = d3.scale.log()
    .domain([10, 500])
    .range(["brown", "steelblue"]);

d3.json("../data/us-counties.json", function(json) {
  counties.selectAll("path")
      .data(json.features)
    .enter().append("svg:path")
      .attr("d", path)
      .attr("fill", function(d) { return fill(path.area(d)); });
});

function redraw() {
  svg.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
}

    </script>
  </body>
</html>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bum-0.0.17 public/d3/examples/choropleth/choropleth-area.html
bum-0.0.16 public/d3/examples/choropleth/choropleth-area.html
bum-0.0.15 public/d3/examples/choropleth/choropleth-area.html
bum-0.0.14 public/d3/examples/choropleth/choropleth-area.html
bum-0.0.13 public/d3/examples/choropleth/choropleth-area.html
bum-0.0.12 public/d3/examples/choropleth/choropleth-area.html