# dagre: 6.7 out of 10

Reasonable, with limits. 7th of 9 in [Diagrams and node graphs](https://elestia.ai/opensource/diagrams/index.md).

dagre is a small, fast layout engine. It works out x/y positions for nodes and edges in a directed graph, and you draw them yourself or through React Flow or Cytoscape.js. It was revived in 2025–2026 with a TypeScript rewrite (v3), and it is a solid simple choice for tree-like and hierarchical layouts. elkjs is the better pick when you need edge routing, sub-flows or fine control.

**Best for:** Developers who need quick top-down or left-right layouts for flowcharts and trees in React Flow, Cytoscape.js or their own SVG.

## Scores

- **Overall: 6.7** (likely 5.6 to 7.8)
  - Claude Opus 5.5 (6.0): A good, light pick for simple layered layouts, and now maintained again with modern TypeScript packaging. It only does layout, and elkjs does that job better for anything beyond trees and plain flowcharts. Its upkeep rests on one person. The range stays moderate because the revival is recent and its track record is short.
  - GPT-6.2 Sol (7.4): Dagre is a strong choice when a new project needs automatic layout for a straightforward directed graph and already has a renderer. The current release has modern packaging and active maintenance, but recent ordering and cluster issues make the recommendation depend on graph structure. ELK.js is a better choice for advanced routing and nested groups, while Mermaid and React Flow cover text-authored diagrams and interactive graph interfaces respectively.
- **Needed by many: 3.6** (likely 2.5 to 4.9)
  - Claude Opus 5.5 (3.5): It only computes layered graph layouts. It draws nothing and does not let people sketch. Developers who build node editors, flowcharts or dependency graphs need it, but that is a clear niche within the category.
  - GPT-6.2 Sol (3.6): Automatic directed layout solves a recurring problem in workflow builders, dependency viewers, and tree diagrams. Dagre can work with any renderer, but it covers only the layout step of diagramming. The share of JavaScript and TypeScript projects that need this step is uncertain.
- **Helps a lot: 6.9** (likely 5.7 to 7.8)
  - Claude Opus 5.5 (6.0): It is fast and easy for hierarchical layouts, and v3 adds native TypeScript types and per-cluster settings. It has few options and no edge routing, has a known sub-flow bug, and blocks the main thread on large graphs. elkjs and d3-dag give better layouts for complex graphs. Its long history means AI agents write working code for it, though they sometimes pick the old unscoped package.
  - GPT-6.2 Sol (7.7): Version 3.1.3 gives teams a straightforward typed API for laying out directed graphs with varying node sizes. React Flow's comparison favors Dagre for simple trees and shows that ELK.js offers more routing control. The wiki's older import example can mislead developers and coding agents, and users have reproduced cluster boundary and sibling ordering problems on 3.1.3. How much those problems matter depends on the structure of the graph.
- **Holds up over time: 6.4** (likely 4.9 to 7.8)
  - Claude Opus 5.5 (6.0): After years of little activity, the project shipped 117 commits and 8 npm versions in the last year, including v3 and v3.1.3 in October 2026. The work seems to rest mostly on one maintainer with no visible funding. There are 171 open issues against 176 closed. The CJS file rename in 3.1.3 shows that small breaking changes can still happen.
  - GPT-6.2 Sol (6.8): Dagre had 117 commits and eight npm versions in the past year, and the October patch fixed packaging and layout bugs. The TypeScript migration changed some exported types, users reported ordering changes in 3.1, and Mermaid moved its default flowchart layout to ELK. The open issue backlog and limited visibility into who can publish or fund the work make the two-year outlook less certain.
- **Used widely: 5.4** (likely 4.2 to 6.9)
  - Claude Opus 5.5 (6.0): 34M downloads in 4 weeks, up 10.6x on a year ago, which beats the 4.1 median. Peers like elkjs (21x) and React Flow (14x) grew faster. Much of the volume comes through other tools, such as cytoscape-dagre, which bundles it, and React Flow setups. The old unscoped dagre package also still takes a share. The ecosyste.ms dependents count (13 packages) looks far too low and is not reliable here.
  - GPT-6.2 Sol (4.8): Four-week downloads rose from 3.23 million to 34.17 million, or 10.6× year over year. That beats the 4.1× catalog baseline and trails ELK.js at 21.2×. Automated and transitive installs raise the download count, while bundled copies can escape it. npm lists 526 dependent packages and ecosyste.ms found just one repository and 13 packages, so the scale of direct adoption is hard to pin down.
- **Vouched for: 6.8** (likely 5.4 to 7.9)
  - Claude Opus 5.5 (6.0): React Flow's docs recommend it, and Cytoscape.js's official dagre extension builds on it. Mermaid uses a fork (dagre-d3-es). It has no survey data, no HN discussion and almost no Bluesky attention. Independent write-ups tend to describe it as the simple option and point to ELK for quality.
  - GPT-6.2 Sol (7.6): Apache Flink adopted Dagre 3 for its job graph dashboard, and the Cytoscape.js extension ships Dagre 3 for layered layouts. React Flow recommends it for simple trees and provides a working example. These are current endorsements for specific uses, with little survey evidence on satisfaction across projects.
- **Safe: 6.9** (likely 5.7 to 8.0)
  - Claude Opus 5.5 (7.0): It has no known advisories, one runtime dependency (its sister package graphlib), an MIT licence and no history of supply-chain incidents. The OpenSSF Scorecard is weak at 4.4: no security policy, unpinned dependencies, broad token permissions and little code review. Releases appear to come from a single maintainer.
  - GPT-6.2 Sol (6.8): Dagre uses the permissive MIT license, has one pinned runtime dependency, and has no recorded OSV advisories for the scoped package. Its OpenSSF Scorecard is 4.4, with weak branch protection and review and zero scores for token permissions, dependency pinning in workflows, and a security policy. The checked-in release script calls npm publish directly, and the number of authorized publishers is unverified.

## Good

- Simple, synchronous API that returns positions you can render in any style, about 25 KB with one dependency.
- Version 3 is written in TypeScript and ships its own types, ESM and CJS builds.
- React Flow's layout guide recommends it as the easy default for tree-shaped flows.
- Releases became active again in 2026, adding per-cluster settings and bug fixes for nested clusters.

## Bad

- No real edge routing, and sub-flow layout breaks when sub-flow nodes connect to nodes outside it.
- Few options, and layout quality is lower than ELK or d3-dag on complex graphs.
- The scoped and unscoped package names, plus forks like dagre-d3-es, confuse users and AI agents.
- Releases appear to rest mostly on one maintainer, and open issues equal closed ones.

## The numbers

- Downloads, 4 weeks: 34M
- In a year: ×11
- GitHub stars: 5.9k
- Commits, 12 months: 117
- Last npm release: Oct 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/dagrejs/dagre
- npm: https://www.npmjs.com/package/@dagrejs/dagre

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.
