Based on http://bl.ocks.org/mbostock/3057239