Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active March 2, 2018 20:12
State Icons
license: gpl-3.0
@hanbzu
hanbzu / README.md
Last active August 29, 2015 13:57
Exponential water tank

This example aims to demonstrate our inability to fully grasp [exponential functions][wikg]. As [Albert Bartlett][barl] once said, "The greatest shortcoming of the human race is our inability to understand the exponential function." This little D3 animation is based on a paper by Dr Bartlett.

Our action hero, a pixelated version of [Chris Martenson][chrs], stands on a platform inside an empty 4000 litre water tank. At the very bottom of the tank lies a magic drop of water. Invisible to the eye now, it doubles in size every 10 seconds.

Although the growth rate is constant, for a long time we see no change. But there's a well known limit, the capacity of the tank. Once he realises that water is rising exponentially, poor pixellated Chris has no time left to react.

Our brains are wired to predict future behaviour based on past behaviour (see [here][psyc]). But what happens when something growths exponentially? For a long time, the numbers are so little in relation to the scale that we hardly see the ch

@yaph
yaph / README.md
Last active August 29, 2015 13:57 — forked from mbostock/.block
Fork of mbostock's coastal counties map

This map shows the graph distance of each county from the Pacific or Atlantic coast; it is a recreation of a map posted to /r/dataisbeautiful using TopoJSON. Coastal counties are dark blue, while counties nine or more counties away from the coast are light yellow. (I opted not to reuse the original’s cycling color scale.)

See also the underlying graph.

@mbostock
mbostock / .block
Last active December 24, 2019 04:51
Coastal Graph Distance
license: gpl-3.0
height: 600
border: no
redirect: https://observablehq.com/@mbostock/coastal-graph-distance
@vicapow
vicapow / README.md
Last active August 29, 2015 13:57
Responsive visualizations using Angular directives
@yaph
yaph / arachni-basic-usage.sh
Created January 22, 2014 11:59
Basic arachni usage commands
# scan up to 1000 URLs
arachni --link-count=1000 --report=afr:outfile=domain.tld.html http://domain.tld
# convert existing afr report to html
arachni --repload=domain.tld.afr --report=html:outfile=domain.tld.html
@yaph
yaph / wikicsv.sh
Last active December 30, 2015 15:49
DBpedia/Wikipedia CSV manipulation
# DBpedia table
csvcut -c 2 Film.csv | sed -e 's/(.*)$//' > film-titles.txt
# wikitables CSV
csvcut -c 1 List_of_Academy_Award-winning_films.csv | sed -e 's/(.*)//' | sed -e 's/\"//g' > film-titles.txt
# fix names
sed -e 's/|.*}//g' -e 's/{//' -i datasets/populated-places-locations.csv
@cingraham
cingraham / README.md
Last active March 11, 2022 20:02
State migration flows, 2012

Interactive graphic by Christopher Ingraham. More at wonkviz.tumblr.com.

Source: American Community Survey 2012.

Last week this graphic of migration flows by Chris Walker made the rounds. Many commenters noted how beautiful the graphic is, and rightly so.

I always have a bit of a hard time parsing exactly what's going on within these Circos-style visualizations. Walker's graphic allows you to hover over a given state to highlight only those migrations, which helps quite a bit.

I thought there might be a better way to display these data, but I wasn't right. I stuck with a map, drawing circles for each state sized by net migration (comings minus goings) and colored according to whether the state gained or lost residents overall. To get at individual state fl

@mariusGundersen
mariusGundersen / gist:6925246
Last active May 8, 2022 20:38
Programmer collective nouns
@mbostock
mbostock / .block
Last active March 31, 2016 20:09
See-Through Globe
license: gpl-3.0