forked from hunzy's block: Japan Map [GeoJSON]
Last active
November 5, 2017 23:47
-
-
Save seschultz/59cad54fec65a3190c81394513cada7b to your computer and use it in GitHub Desktop.
Allegheny Map [GeoJSON]
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
license: mit |
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> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://d3js.org/topojson.v0.min.js"></script> | |
</head> | |
<body> | |
<script> | |
var width = 960; | |
var height = 500; | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
d3.json("Allegheny_County_Census_Tracts_2016.geojson", function (error, allegheny) { | |
var projection = d3.geo.mercator() | |
.center([137, 34]) | |
.scale(900) | |
.translate([width / 2, height / 2]); | |
var path = d3.geo.path() | |
.projection(projection); | |
svg.selectAll("path") | |
.data(allegheny.features) | |
.enter() | |
.append("path") | |
.attr("stroke", "white") | |
.attr("stroke-width", "0.5") | |
.attr("d", path); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment