This is a simple demo to show you how I integrate React and d3 force layout.
React + D3 exploration with the force layout:
- React in charge of everything except location
- D3 only care about location
Pro:
- Able to do large scale of data.
- React's data is immutable.
- Force mutates the location data and update location directly (no React diff check required).
- Dragging behavior is possible.
Reference ###Sally Wu's 3 approaches
The original using only D3: Enter-Update-Exit in Force Layout
The Force with React + D3, Approach #1
The Force with React + D3, Approach #2
The Force with React + D3, Approach #3
###Uber's React Force Vis react-vis-force
###Formidable Force Layout formidable