Last active
September 12, 2016 02:04
-
-
Save pstuffa/a5c4fc4beb7e2590149da29b6924bbef to your computer and use it in GitHub Desktop.
NYC Neighborhoods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment