2.8k stars · EPL-2.0 · 0.12.0 (2026-07-17)
Eclipse Layout Kernel in JavaScript — the automatic graph layout React Flow does not ship, and the reason a 40-node map reads instead of tangling.
▶Repo detailsthe review · specs · pros & cons · install
What it is
A JavaScript build of the Eclipse Layout Kernel, a mature research-grade collection of automatic graph-layout algorithms. You hand it nodes, edges and sizes; it hands back coordinates. Layered, tree, force, radial and rectangle-packing layouts are all included.
Why it matters
Edition 1 recommended React Flow for Grasppy's canvas and noted, in a single line, that it ships no layout algorithm. That line matters more than its length suggests. React Flow will faithfully draw whatever coordinates you give it — and if you have not solved layout, a subtopic map with forty nodes looks like spilled pasta, which is the fastest way to make a clever product look unfinished. ELK's layered algorithm is what draws readable hierarchies with the fewest crossing edges; it is the engine behind the good-looking diagrams in tools you already admire. Compute it in a Web Worker, feed the coordinates to React Flow, and the map arranges itself the moment it loads. This is a small, unglamorous dependency that changes how the product feels more than most features would.
- Decades of algorithm work from a university research group — this is not a weekend force simulation
- Runs in a Web Worker off the main thread, so laying out a large map never freezes the browser
- Pairs directly with React Flow; the official React Flow examples use it, so Claude Code has good material to work from
- EPL-2.0 — fine inside a commercial product, but it is a weak-copyleft licence worth five minutes of reading
- The bundle is a compiled Java-to-JavaScript build: it is large, and when it goes wrong the stack traces are useless
- Dozens of layout options with terse names. Expect one session of trial and error before it looks the way you want
Compute it in a Web Worker, feed the coordinates to React Flow, and the map arranges itself the moment it loads.
npm install elkjs