# TALA, the Diagram Layout Engine Behind D2, Goes Open Source

Original title: TALA Is Open-Source

> Hacker News story 49604150 · language: en · submitted 2026-09-07
> Web version: https://zeli.app/story/49604150
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 315 · by [alixanderwang](<https://news.ycombinator.com/user?id=alixanderwang>) · 💬 23
[original](<https://d2lang.com/blog/tala-is-open-source/>) · [HN discussion](<https://news.ycombinator.com/item?id=49604150>)

## Summary

Terrastruct has open-sourced TALA, its autolayout algorithm for D2 diagrams, under the permissive MPL-2.0 license. TALA is designed for software architecture diagrams, producing orthogonal layouts that resemble whiteboard sketches rather than the one-directional flows of DAG-based engines. It balances multiple aesthetic objectives—symmetry, median distance, flow, clustering—and uniquely allows locking node positions and sizes while the engine handles routing, a boon for AI-generated diagrams. The author notes tradeoffs: randomness means layouts can change dramatically with small input changes, and it's slower on large diagrams. TALA is bundled in D2 v0.9.0 and can be tried via `--layout=tala` or the D2 Playground.

## Key quote

> This lends itself especially well to agentic use cases, where models can draw in 2d space well, but TALA still takes care of routing, which models still struggle with.

## HN discussion (23 comments)

### [ricardobeat](<https://news.ycombinator.com/item?id=49604567>)

> The first few graphs are impressive, it does a much tidier job. The Go queue one is objectively worse - the other versions keep services and users grouped together, as well as a left-to-right flow. The TALA version makes it look more complicated than it is.

### [aidenn0](<https://news.ycombinator.com/item?id=49605287>)

> That's nice; my first impressions of D2 were much worse than they should have been since the default layout engine is pretty terrible for some types of graphs; ELK is a big improvement, and when I tried TALA it was sometimes a big improvement over ELK.
>
> I never purchased TALA though because I don't use D2 at work, and the costs of buying TALA were above my "fun money" amount.

### [ashiban](<https://news.ycombinator.com/item?id=49604254>)

> Thanks for that. What do you think are the key heuristics / concepts that made it standout or be more appropriate for architecture diagrams?

---

## Cite

- Page: https://zeli.app/story/49604150
- Date: 2026-09-07
- Source: d2lang.com (https://d2lang.com/blog/tala-is-open-source/)
- Hacker News: https://news.ycombinator.com/item?id=49604150

## Other languages

- zh: https://zeli.app/zh/story/49604150 · markdown: https://zeli.app/zh/story/49604150.md
- ja: https://zeli.app/ja/story/49604150 · markdown: https://zeli.app/ja/story/49604150.md
- ko: https://zeli.app/ko/story/49604150 · markdown: https://zeli.app/ko/story/49604150.md
- de: https://zeli.app/de/story/49604150 · markdown: https://zeli.app/de/story/49604150.md
- es: https://zeli.app/es/story/49604150 · markdown: https://zeli.app/es/story/49604150.md
- ru: https://zeli.app/ru/story/49604150 · markdown: https://zeli.app/ru/story/49604150.md
