Skip to content

Instantly share code, notes, and snippets.

@pstuffa
Last active September 12, 2016 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pstuffa/a5c4fc4beb7e2590149da29b6924bbef to your computer and use it in GitHub Desktop.
Save pstuffa/a5c4fc4beb7e2590149da29b6924bbef to your computer and use it in GitHub Desktop.
NYC Neighborhoods
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
stroke: #fff;
stroke-width: .5;
stroke-dasharray: 1;
fill: #afafaf;
}
</style>
<svg width="960" height="720"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://d3js.org/topojson.v1.min.js"></script>
<script>
var svg = d3.select("svg"),
width = +svg.attr("width"),
height = +svg.attr("height");
d3.json("nyc.json", function(error, us) {
if (error) throw error;
// ESRI:102004
var path = d3.geoPath()
.projection(d3.geoConicConformal()
.parallels([33, 45])
.rotate([96, -39])
.fitSize([width, height], us));
svg.append("path")
.datum(us)
.attr("d", path);
});
</script>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment