block by mbostock 5996232

New York Block Groups

Full Screen

13,837 census block groups; 13,866 polygons. 2.1M TopoJSON, 620K gzipped. Made by customizing the makefile in the U.S. Atlas project:

topojson \
    -o ny.json \
    --projection 'd3.geo.mercator().center([-75.819, 42.795]).scale(6193).translate([480, 350]).precision(0)' \
    -q 1e5 \
    -s .5 \
    -- blockgroups=shp/ny/blockgroups.shp

index.html

<!DOCTYPE html>
<meta charset="utf-8">
<style>

path {
  fill: none;
  stroke: #000;
  stroke-width: .5px;
  stroke-linejoin: round;
  stroke-linecap: round;
}

</style>
<body>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script>

var width = 960,
    height = 700;

var path = d3.geo.path()
    .projection(null);

var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height);

d3.json("ny.json", function(error, ny) {
  if (error) throw error;

  svg.append("path")
      .datum(topojson.mesh(ny))
      .attr("d", path);
});

d3.select(self.frameElement).style("height", height + "px");

</script>