Skip to content

Instantly share code, notes, and snippets.

Last active January 30, 2017 16:40
What would you like to do?
England Topojson
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
svg {
background: #9ecae1;
.mesh {
stroke: white;
stroke-width: 0.5px;
.land {
fill: #41ab5d;
<script src=""></script>
<script src=""></script>
<script type="text/javascript">
var width = 400;
var height = 400;
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
var projection = d3.geoMercator()
var path = d3.geoPath().projection(projection);
var g = svg.append("g");
d3.json("map.json", function(error, england) {
g.insert("path", ".land")
.datum(topojson.feature(england, england.objects.Clinical_Commissioning_Groups_April_2016_Super_Generalised_Clipped_Boundaries_in_England))
.attr("class", "land")
.attr("d", path);
.datum(topojson.mesh(england, england.objects.Clinical_Commissioning_Groups_April_2016_Super_Generalised_Clipped_Boundaries_in_England, function(a, b) { return a !== b; }))
.attr("class", "mesh")
.attr("d", path);
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