-
-
Save Andrew-Reid/8c9b087b39925ededaae268c856be977 to your computer and use it in GitHub Desktop.
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> | |
/* CSS goes here. */ | |
</style> | |
<body> | |
<script src="//d3js.org/d3.v4.min.js" charset="utf-8"></script></script> | |
<script src="//d3js.org/topojson.v1.min.js"></script> | |
<script> | |
var width = 960, | |
height = 1160; | |
var identity = d3.geoIdentity() | |
var path = d3.geoPath(identity) | |
var svg = d3.select("body").append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
d3.json("topojson.json", function(error, uk) { | |
var geojson = topojson.feature(uk, uk.objects.test) | |
identity.fitSize([width,height],geojson) | |
svg.append("path") | |
.datum(geojson) | |
.attr("d", path) | |
.attr("fill","none") | |
.attr("stroke","black") | |
.attr("stroke-width",1); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment