With Beams and Cannons — How to Spice Up D3 Graphs with a Physics Engine
summary
Combines D3.js and the Matter.js physics engine to drive graph layouts by mapping SVG paths to physics bodies and rendering them with a custom D3+Matter renderer. Demonstrates a box-office-style drop chart where bars leaving the chart spawn falling physics bodies, and implements constraints to pull circles into a packed layout. Notes performance limits—about 100 moving bodies on modest hardware—so throttling and removing old bodies is necessary to keep it responsive.
AI-written summary · about
chapters (11)
- 0:00Physics motivation
- 2:08D3.js basics
- 8:56Data binding updates
- 11:04Matter.js intro
- 13:32Matter.js with D3
- 19:15Box Office Chart physics
- 22:47New physics layout
- 27:42Forces and constraints
- 30:53Physics-based pack layout
- 35:10Demo summary
- 36:12Q&A
related talks
51mD3 js: Easy and flexible data visualisation using Web standards
12mBattle-Tested Techniques for Animation & Data Viz
45mNatural physics simulations and canvas hackery
27mVisualizing Graphs in Swift
24mBeyond the bar graph: Creative visualization with D3.js
28mGetting Started with D3.js
21mData Visualizations with React + D3
26mHooked on D3: Creating Animated Ch(art)s with D3 and React
