block by mbostock 3007180

Exoplanets

Full Screen

This is a recreation (for the purpose of tinkering with a simplified version) of Lane Harrison’s Exoplanets interactive, which was inspired by Randall Munroe’s XKCD comic. The data is from the Planetary Habitability Laboratory.

D3’s pack layout places circles so that they touch by default. The XKCD version however uses padding, which is more aesthetically pleasing. Fortunately, D3 2.10’s pack layout now supports padding. You could achieve a similar result through collision detection, but the pack layout is faster to compute. My implementation uses a quantize scale for color, which is my best guess to what’s used in the original, but I can’t know for sure. I make no guarantees to the accuracy of this chart. I also removed extra dimensions to reduce the size of the data file, but as a consequence I can’t show additional details on mouseover.

Updated Example →

index.html

Makefile

planets.csv