Exoplanets
A circle-packing visualization displays the relative sizes of planets in our solar system alongside hundreds of confirmed exoplanets, with each circle’s area proportional to its radius. A quantized color scale encodes planet radius, while a tooltip reveals the exoplanet’s name, radius, and distance from its star. The data comes from the Planetary Habitability Laboratory, and the layout is computed using d3.pack with padding, rendered as SVG circles. The code filters the CSV data to separate solar-system planets from exoplanets and uses d3.scaleQuantize for color mapping.
AI-generated descriptionThis 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.