Skip to content

Instantly share code, notes, and snippets.

Forked from anonymous/options.json
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;
.state {
fill: #e7e7e7;
stroke: #fff;
stroke-width: 2px;
.state:hover {
fill: steelblue;
<div id="vis"></div>
var width = 760,
height = 500;
var us = livecoding.json.geometry;
var stats = livecoding.json.stats;
function findExtent() {
var ratios = [];
Object.keys(stats).forEach(function(state) {
return d3.extent(ratios);
var colorScale = d3.scale.linear()
.range(["#E3EEFF", "#6C9EF0"]);
var svg ='#vis').append('svg')
.attr('width', width)
.attr('height', height);
var projection = d3.geo.albersUsa()
.translate([width / 2, height / 2]);
var path = d3.geo.path()
.data(topojson.feature(us, us.objects.usStates).features)
.attr('d', path)
.attr('class', 'state')
.style("fill", function(d) {
return colorScale(stats[].water_to_land_ratio);
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