Elestia Open Source Ratings
6.7

dagre

Reasonable, with limits. 7th of 9 diagrams and node graphs.

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.

GitHubnpm

Scores

Overall6.7

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 6.0, likely 5.0 to 7.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.

  • reactflow.dev/learn/layouting/layouting: Recommended for simple trees; ELK for complex needs
  • npm latestPublishedAt: Release in October 2026
  • peers elkjs: elkjs has faster growth and more dependent repos

GPT-6.2 Sol: 7.4, likely 6.2 to 8.5

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 many3.6

How many developers need a tool for this job?

Claude Opus 5.5: 3.5, likely 2.5 to 5.0

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, likely 2.5 to 4.8

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 lot6.9

How well does it do the job for those who need it?

Claude Opus 5.5: 6.0, likely 5.0 to 7.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, likely 6.3 to 8.6

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 time6.4

Will it still be a good choice in two years?

Claude Opus 5.5: 6.0, likely 4.5 to 7.5

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.

  • github commitsLastYear: 117 commits, last push October 2026
  • npm versionsLastYear: 8 versions, latest 3.1.3
  • github.com/dagrejs/dagre/releases: Recent GitHub releases published by one maintainer (rustedgrail)
  • github openIssues: 171 open vs 176 closed

GPT-6.2 Sol: 6.8, likely 5.3 to 8.0

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 widely5.4

How many use it, and is that growing?

Claude Opus 5.5: 6.0, likely 5.0 to 7.5

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, likely 3.3 to 6.3

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 for6.8

Who stands behind it being good?

Claude Opus 5.5: 6.0, likely 4.5 to 7.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, likely 6.3 to 8.7

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.

Safe6.9

How safe is it to depend on?

Claude Opus 5.5: 7.0, likely 6.0 to 8.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.

  • advisories total: 0 advisories
  • npm dependencies: 1 dependency
  • scorecard score: 4.4; Security-Policy, Pinned-Dependencies and Token-Permissions score 0
  • github license: MIT

GPT-6.2 Sol: 6.8, likely 5.4 to 8.0

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

npm downloads, 4 weeks
34M ×11 in a year
GitHub stars
5.9k
Commits, 12 months
117
npm version
3.1.3 Oct 2026
Versions, 12 months
8
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
4.4 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (dagrejs/dagre), npm (@dagrejs/dagre), OSV and the OpenSSF Scorecard.

Diagrams and node graphs

  1. 8.6React Flow
  2. 8.5Mermaid
  3. 7.6Cytoscape.js
  4. 7.4elkjs
  5. 7.4sigma.js
  6. 7.3Excalidraw
  7. 6.7dagre
  8. 6.7JointJS
  9. 6.3vis-network
Compare all 9 on six scores