# elkjs: 7.4 out of 10

A strong pick. 4th of 9 in [Diagrams and node graphs](https://elestia.ai/opensource/diagrams/index.md).

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

- **Overall: 7.4** (likely 6.4 to 8.4)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (7.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.
- **Needed by many: 3.7** (likely 2.6 to 5.0)
  - Claude Opus 5.5 (3.5): 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.
  - GPT-6.2 Sol (3.8): 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.
- **Helps a lot: 8.0** (likely 6.9 to 9.0)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (8.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.
- **Holds up over time: 7.2** (likely 6.1 to 8.3)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (7.4): 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.
- **Used widely: 5.4** (likely 4.3 to 6.6)
  - Claude Opus 5.5 (6.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.
  - GPT-6.2 Sol (4.8): 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.
- **Vouched for: 7.6** (likely 6.5 to 8.6)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (8.2): 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.
- **Safe: 7.0** (likely 5.9 to 8.1)
  - Claude Opus 5.5 (7.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.
  - GPT-6.2 Sol (7.0): 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.

## 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

- Downloads, 4 weeks: 78M
- In a year: ×21
- GitHub stars: 2.9k
- Commits, 12 months: 77
- Last npm release: Oct 2026
- Advisories, 24 months: 0
- Licence: EPL-2.0 OR GPL-3.0-or-later
- GitHub: https://github.com/kieler/elkjs
- npm: https://www.npmjs.com/package/elkjs

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
