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 my notebooks on Observable. →
See the D3 gallery. →

Hide this message.

Mike Bostock’s Block 31803952846454
Updated October 17, 2017

Force Layout with Canvas

Open

index.html#

graph.json#

LICENSE#

Released under the GNU General Public License, version 3.