This example has been archived.

This example is no longer maintained. You can still access the code below, but it may use an old version of D3, have bugs, lack comments, or otherwise not represent current best practices.

The D3 team now maintains examples and tutorials on Observable, the best place to collaborate on visualization. Observable makes it easy to play with, fork, import, and share code on the web. You can download or embed whatever you make on Observable so it can live anywhere on the web (or off of it).

Observable uses dataflow, so you may not be able to copy-paste Observable code directly into vanilla JavaScript, but once you know the differences you can port if desired. Or use it directly in your application with Observable’s lightweight open-source runtime. Either way, dataflow makes code more approachable and helps you spend more time “thinking with data” instead of programming. You can find thousands of notebooks on Observable to help you learn and get inspired.

See this example on Observable. →
See my notebooks on Observable. →
See the D3 gallery. →

Hide this message.

Mike Bostock’s Block 3734322
Updated February 26, 2019

Eckert I




Released under the GNU General Public License, version 3.