Sha256: 722045bc8ac1f22569d4d98102875b89e8b87e06849f6cbda21b5b1a8b16e537

Contents?: true

Size: 1.17 KB

Versions: 25

Compression:

Stored size: 1.17 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")
    .call(d3.behavior.zoom()
    .on("zoom", redraw))
  .append("g");

var counties = svg.append("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("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

25 entries across 25 versions & 1 rubygems

Version Path
picky-statistics-4.5.0 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.4.2 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.4.1 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.4.0 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.3.2 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.3.1 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.3.0 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.2.4 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.2.3 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.2.2 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.2.1 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.2.0 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.1.0 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.9 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.8 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.7 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.6 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.5 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.4 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html
picky-statistics-4.0.3 lib/picky-statistics/application/javascripts/d3/examples/choropleth/choropleth-area.html