Skip to content

Instantly share code, notes, and snippets.

Created Apr 2, 2014
What would you like to do?
"libraries": [
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
.states {
fill: #e5e5e5;
stroke: #fff;
.states:hover {
fill: steelblue;
<svg id="map"></svg>
var width = 960,
height = 700;
var svg ="#map")
.attr("width", width)
.attr("height", height);
var geometry = livecoding.json;
var projection = d3.geo.mercator()
.translate([width * 2.16, height * 1.5]);
var path = d3.geo.path().projection(projection);
.datum(topojson.feature(geometry, geometry.objects.usStates))
.attr("d", path)
.classed("states", true);
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