elkjs

Automatic graph layout engine for node-link diagrams, ported from the Eclipse Layout Kernel (ELK).

Library
npm
v0.12.0
2,712stars
EPL-2.0 OR GPL-3.0-or-later

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
76/100Good
Development Activity84
Maintenance64
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture75
Code Quality70
Innovation80
Learning Curve62

elkjs brings the layout-computation core of the Eclipse Layout Kernel (ELK) to JavaScript, so applications can automatically compute node and edge positions for diagrams without implementing a layout algorithm themselves. Its flagship algorithm is a layered, Sugiyama-style layout well suited to node-link diagrams with an inherent direction and explicit ports (attachment points on a node’s border), the kind of structure common in flowcharts, data-flow diagrams, and dependency graphs.

elkjs is explicitly scoped to layout computation only — it does not render, style, or draw anything, leaving that to a diagramming framework such as Sprotty, D3, or a custom SVG/canvas renderer that consumes elkjs’s computed coordinates. It is the JavaScript successor to the earlier klayjs project and tracks ELK’s Java implementation, with releases loosely synchronized to upstream ELK version numbers.

What You Get

  • A layered (Sugiyama-style) automatic layout algorithm suited to directional node-link diagrams with ports
  • A pure layout API (elk-api.js) separate from the worker that performs the computation (elk-worker.js), plus a bundled browser build (elk.bundled.js)
  • Support for incremental and dynamic layout scenarios, including adding nodes/edges to an existing layout
  • Configurable layout options mirroring ELK’s Java configuration surface (direction, spacing, port constraints, edge routing)
  • A Node.js-friendly entry point (main.js) for require('elkjs')/import usage without manually composing the API and worker files
  • TypeScript typings for the layout graph input/output shapes

Common Use Cases

  • Automatically laying out flowcharts, BPMN diagrams, or state machines rendered with a separate diagramming library
  • Computing node/edge positions for dependency graphs, data-flow diagrams, or pipeline visualizations
  • Powering the layout step of interactive diagram editors (e.g. alongside Sprotty) where users can still manually adjust positions after auto-layout
  • Laying out graphs with explicit ports, such as circuit diagrams or diagrams where edges must attach to specific sides of a node
  • Providing consistent, algorithmic diagram layout in tools that previously required manually positioned nodes

Under The Hood

Architecture - elkjs separates the public layout API (src/js, compiled to elk-api.js) from the actual layout engine (elk-worker.js), which is generated from ELK’s original Java codebase (src/java, src/java-additional) via GWT (Google Web Toolkit) cross-compilation rather than being hand-written in JavaScript. This means elkjs’s core layout logic is a transpiled port of a mature, actively developed Java project (Eclipse ELK), while the thin JavaScript API layer handles calling into that generated worker and shaping the input/output graph JSON.

Tech Stack - The build pipeline spans two ecosystems: Gradle (build.gradle, gradlew) drives the Java-to-JavaScript GWT compilation of the layout engine, while Babel and Browserify (babel src/js/, browserify ... -s ELK) produce the JavaScript-facing API and bundled browser build from src/js. This dual-toolchain setup is a direct consequence of porting rather than reimplementing ELK’s algorithms.

Code Quality - Tests live under test/mocha and test/examples, run via mocha test/mocha, and the project’s README maintains an explicit, actively curated FAQ of recurring GitHub issues (module resolution errors from the GWT-generated code, poor modularization, dynamic/incremental layout requests), showing the maintainers directly track and document the rough edges inherent to the Java-to-JS porting approach.

API Design - The API takes a plain graph object (nodes, edges, ports, layout options) and returns a promise resolving to the same graph annotated with computed positions, keeping the surface framework-agnostic so any renderer can consume the output. The tradeoff of the GWT-generated worker is a less idiomatic JavaScript experience in places (documented issues like g is not defined under certain bundler configurations), which the README addresses directly rather than hiding.

Used by 14 apps in this directory

Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
89%
Other

anytype-ts

Knowledge Management · Note Taking · Collaboration

8,665

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript89%
Updated yesterday
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,936

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
64
Dependency
Built with
JavaScript100%
Updated 6 months ago
Go
52%
MIT

Bytebase

Devops

14,396

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

View details
92
Repo Health
73
Technical
69
Dependency
Built with
Go52%
TypeScript39%
Updated today
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,186

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
79
Repo Health
76
Technical
70
Dependency
Built with
TypeScript98%
Updated yesterday
Python
68%
MIT

Langflow

AI Agents · AI Development

153,450

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
66
Dependency
Built with
Python68%
TypeScript22%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search