Skip to content

Instantly share code, notes, and snippets.

@Andrew-Reid
Created June 16, 2020 00:35
Show Gist options
  • Save Andrew-Reid/b8aee0f6a6c0cfaf5e516bed5e004f0d to your computer and use it in GitHub Desktop.
Save Andrew-Reid/b8aee0f6a6c0cfaf5e516bed5e004f0d to your computer and use it in GitHub Desktop.
<!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 path = d3.geoPath()
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)
svg.append("path")
.datum(geojson)
.attr("d", path)
.attr("fill","none")
.attr("stroke","black")
.attr("stroke-width",1);
});
</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