elkjs
A strong pick. 4th of 9 diagrams and node graphs.
elkjs is the JavaScript build of the Eclipse Layout Kernel (ELK). It computes node positions and edge routes for graphs, and you draw them with another tool. It is the strongest open-source layout engine in JavaScript for layered diagrams with ports, nested groups and routed edges. The costs are a large GWT-generated bundle and many options to learn.
Best for: Teams that need automatic, high-quality layout of flow charts, architecture or dataflow diagrams to feed a renderer such as React Flow or Svelte Flow.
Scores
Overall7.4
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
For automatic layout of complex node graphs it is the best open-source engine in JavaScript, and Mermaid and React Flow both use or recommend it. It does not draw anything itself, it is heavy, and it takes effort to configure. For simple trees, dagre is quicker to set up. That makes it a strong pick for a named kind of project rather than the category default.
- reactflow.dev/learn/layouting/layouting: Recommended over dagre for sub-flows and edge routing
- dependents repos: Strong direct use relative to peers
- github.com/reaviz/reaflow/issues/224: Bundle size is a common complaint
GPT-6.2 Sol: 7.8, likely 6.7 to 8.8
elkjs is a strong starting point when a new graph editor needs automatic layout for nested nodes, fixed ports, or routed edges. Recent releases and use in Mermaid and Airflow support that choice, while configuration complexity and the worker size matter in a browser app. Dagre is simpler for basic directed layouts, and Mermaid or React Flow covers more of the job when the project also needs rendering or editing.
- reactflow.dev/learn/layouting/layouting: Shows where ELK’s capabilities justify more setup than Dagre.
- github.com/kieler/elkjs/releases/tag/0.12.1: Current patch follows upstream ELK and restores the DisCo algorithm.
- github.com/apache/airflow/pull/75986: Shows both real application use and a measurable bundle cost.
- mermaid.js.org/config/layouts.html: Mermaid ships ELK as part of its standard diagram renderer.
Needed by many3.7
How many developers need a tool for this job?
Claude Opus 5.5: 3.5, likely 2.5 to 5.0
Automatic graph layout is a clear niche inside the diagram category. Most developers meet it only indirectly, through Mermaid. Teams that build node editors, workflow tools or architecture views need it directly, and that group is real but not large.
- github.com/kieler/elkjs: Computes layout only; no rendering
- reactflow.dev/learn/layouting/layouting: Listed as an add-on layout engine for React Flow
GPT-6.2 Sol: 3.8, likely 2.7 to 4.9
Automatic layout solves a recurring problem in workflow editors, dependency viewers, and engineering diagrams. elkjs serves the subset of those projects that need a layout engine and can supply a renderer. State of JavaScript surveys graphics tools more broadly, so it gives little precision on the size of that subset.
- github.com/kieler/elkjs/blob/0.12.1/README.md: Defines the layout-only scope and lists browser and Node.js usage.
- 2025.stateofjs.com/en-US/other-tools/#graphics_others: Broader graphics survey provides no elkjs-specific adoption estimate.
Helps a lot8.0
How well does it do the job for those who need it?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
Its layered algorithm handles ports, nested nodes and edge routing, which is the best layout quality available in open-source JavaScript. React Flow's guide rates it above dagre on every feature it compares. The limits are a large GWT bundle, a hard-to-learn set of options, and GWT build errors that users run into. It ships TypeScript types and an async worker API.
- reactflow.dev/learn/layouting/layouting: ELK supports sub-flows and edge routing; dagre does not route edges
- github.com/reaviz/reaflow/issues/224: Users complain about bundle size
- calm.finos.org/calm-studio/adrs/use-elk-for-auto-layout: Decision record picks ELK and notes a larger binary than dagre
- npm hasTypes: Types included
GPT-6.2 Sol: 8.4, likely 7.3 to 9.4
Version 0.12.1 is particularly capable at layered layouts with explicit ports, nested groups, and routed edges. React Flow’s guide shows where those controls help and recommends Dagre for simpler trees. The reference is extensive, but string-based settings make mistakes easy for developers and coding agents to miss, and users report strict TypeScript and nested-graph failures. Airflow measured a sizable worker download, while layout speed across graph sizes is less well established.
- eclipse.dev/elk/reference/algorithms/org-eclipse-elk-layered.html: Documents port constraints, cross-hierarchy edges, and routing modes.
- reactflow.dev/learn/layouting/layouting: Compares layout engines and describes the setup trade-off with Dagre.
- github.com/kieler/elkjs/blob/0.12.1/typings/elk-api.d.ts: Declares layout settings as an unrestricted string map.
- github.com/kieler/elkjs/issues/407: Reports a strict TypeScript declaration failure on 0.12.1.
- github.com/kieler/elkjs/issues/396: Reports a layout error with a specific nested graph and compaction setting.
- github.com/apache/airflow/pull/75986: Reports a roughly 459 KB gzipped worker and documents lazy loading it.
Holds up over time7.2
Will it still be a good choice in two years?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
The KIELER group at Kiel University and the Eclipse ELK project back it. It had 77 commits and 3 releases in the last year, the newest in October 2026. Mermaid now depends on it directly, which ties it to a major tool. Releases follow ELK's slow academic pace, it is still 0.x, and 92 issues are open.
- github commitsLastYear: 77 commits, 3 releases
- github.com/kieler/elkjs/releases: Steady releases tracking ELK; 0.12.1 in Oct 2026
- cdn.jsdelivr.net/npm/mermaid@latest/package.json: Mermaid 12 lists elkjs ^0.12.0 as a dependency
GPT-6.2 Sol: 7.4, likely 6.2 to 8.5
elkjs had 77 commits and three GitHub releases in the past year, with an October patch that follows a maintained Eclipse upstream. Mermaid’s adoption gives the JavaScript port a strong reason to stay maintained. One maintainer handled the three latest GitHub releases, and some integration issues have stayed open for over a year. The size and funding of the active JavaScript maintenance team remain unclear.
- github commitsLastYear, releasesLastYear, latestRelease: 77 commits, three releases, and an October 2026 patch.
- github.com/kieler/elkjs/releases: One maintainer published the three latest releases, and an earlier release shows a second publisher.
- projects.eclipse.org/projects/modeling.elk/releases/0.12.1: Eclipse published the corresponding upstream bug-fix release.
- github.com/kieler/elkjs/issues: Several worker and module integration reports are still open.
- mermaid.js.org/config/layouts.html: Mermaid made ELK its default for several diagram types.
Used widely5.4
How many use it, and is that growing?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Downloads grew 21x in a year (78.5M against 3.7M), far above the 4.1 median. Most of that comes from Mermaid now bundling it, not from developers choosing it. The 4,433 dependent repos are a better signal: close to Cytoscape.js and well ahead of dagre, Excalidraw and vis-network in this data. That points to tens of thousands of direct users, with a growing trend.
- npm downloadsLast4Weeks: 78.5M vs 3.7M a year ago
- dependents repos: 4,433 repos and 68 packages
- github stars: 2,905 stars, low for its usage
- bluesky posts: Only 2 posts; little social attention
GPT-6.2 Sol: 4.8, likely 3.5 to 6.2
Four-week npm downloads rose from 3.7 million to 78.5 million, about 21.2 times the prior year’s count and well above the 4.1 times catalog median. Mermaid now installs elkjs as a runtime dependency, so much of that growth may come from indirect installs. Ecosyste.ms found 4,433 dependent repositories, below Mermaid and Cytoscape.js and above Excalidraw in its sample. That puts elkjs among the more established layout engines, with substantial uncertainty about how quickly direct adoption is growing.
- npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo, medianDownloadsRatio: Raw installs grew 21.2 times against a 4.1 times catalog baseline.
- github.com/mermaid-js/mermaid/blob/mermaid%4012.3.0/packages/mermaid/package.json: Mermaid 12.3.0 declares elkjs as a runtime dependency.
- dependents and peers dependentRepos: 4,433 repositories and 68 packages in a partial index.
- github stars and bluesky posts: 2,905 stars and two Bluesky links indicate modest attention relative to leading peers.
Vouched for7.6
Who stands behind it being good?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
Mermaid builds on it in its core package. React Flow and Svelte Flow document it as the full-featured layout option, and FINOS CALM chose it in a public decision record. The algorithms come from peer-reviewed graph-drawing research. No developer survey covers it, and there are few independent benchmarks.
- cdn.jsdelivr.net/npm/mermaid@latest/package.json: Mermaid ships it as a dependency
- reactflow.dev/examples/layout/elkjs: Official React Flow example
- calm.finos.org/calm-studio/adrs/use-elk-for-auto-layout: FINOS project ADR picks ELK
GPT-6.2 Sol: 8.2, likely 7.0 to 9.1
Mermaid uses ELK by default for several diagram types, and Apache Airflow uses elkjs in its graph UI. React Flow independently demonstrates where its port and edge-routing controls earn the extra setup. These are concrete integrations, although broad satisfaction data and comparative runtime benchmarks are scarce.
- mermaid.js.org/config/layouts.html: ELK is the default layout for seven diagram types in standard Mermaid builds.
- github.com/apache/airflow/pull/75986: Airflow uses elkjs and measured the cost of shipping its worker.
- reactflow.dev/learn/layouting/layouting: Independent integration guide compares ELK with other layout engines.
- 2025.stateofjs.com/en-US/other-tools: Offers broad graphics context without an elkjs satisfaction measure.
Safe7.0
How safe is it to depend on?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It has zero dependencies and no advisories on record. The Scorecard is a middling 5.1, with zeros for token permissions, pinned dependencies, security policy and SAST. The code is a large, generated bundle that is hard to audit. The EPL-2.0 or GPL-3.0 licence is weak copyleft: it allows commercial use, but some companies need a review before adopting it.
- advisories total: 0 advisories
- npm dependencies: 0 dependencies
- scorecard score: 5.1 with several zero checks
- npm license: EPL-2.0 OR GPL-3.0-or-later
GPT-6.2 Sol: 7.0, likely 5.8 to 8.2
The package has zero runtime npm dependencies, and OSV lists no advisories, though the project labelled 0.11.1 a security release. GitHub Actions publishes tagged releases to npm, while the 5.1 OpenSSF Scorecard flags weak workflow pinning and token permissions, as well as a missing security policy. The package is dual-licensed under EPL-2.0 or GPL-3.0-or-later, which permit commercial use and carry redistribution obligations. The number of people who can trigger a publish is unclear.
- npm dependencies and license, advisories total: Zero runtime dependencies, zero OSV entries, and two copyleft license options.
- scorecard score and checks: 5.1 overall, with zero scores for token permissions, dependency pinning, and security policy.
- github.com/kieler/elkjs/blob/0.12.1/.github/workflows/publish.yml: GitHub release events trigger automated npm publishing.
- github.com/kieler/elkjs/releases/tag/0.11.1: The maintainers identify 0.11.1 as a security release.
- eclipse.org/legal/epl/epl-v20.html: EPL-2.0 permits commercial use and specifies distribution obligations.
Good
- Layered layout with ports, compound (nested) nodes and orthogonal edge routing that dagre cannot match.
- Mermaid ships it as a dependency, and React Flow and Svelte Flow document it as their advanced layout option.
- Zero npm dependencies and no known advisories.
- Can run layout in a Web Worker, so large graphs do not block the UI.
Bad
- The bundle is large and hard to tree-shake because the code is generated from Java with GWT.
- There are hundreds of layout options, and the docs about them are dense and Java-centric, so getting a good result takes trial and error.
- It computes layout only; you need a separate rendering or editing library.
- The EPL-2.0 / GPL-3.0 licence is weak copyleft, which some legal teams flag. It is still 0.x after nine years.
The numbers
- npm downloads, 4 weeks
- 78M ×21 in a year
- GitHub stars
- 2.9k
- Commits, 12 months
- 77
- npm version
- 0.12.1 Oct 2026
- Versions, 12 months
- 4
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 5.1 out of 10, Nov 2026
- Licence
- EPL-2.0 OR GPL-3.0-or-later
Read on 21 November 2026 from GitHub (kieler/elkjs), npm (elkjs), OSV and the OpenSSF Scorecard.
Diagrams and node graphs
- 8.6React Flow
- 8.5Mermaid
- 7.6Cytoscape.js
- 7.4elkjs
- 7.4sigma.js
- 7.3Excalidraw
- 6.7dagre
- 6.7JointJS
- 6.3vis-network