HeadlinesBriefing favicon HeadlinesBriefing.com

TALA Auto Layout Algorithm 开源

Hacker News •
×

TALA (Terrastruct's Auto Layout Algorithm), a novel orthogonal layout engine designed for software architecture diagrams, is now open-source under the MPL-2.0 license, the same license as D2. Unlike traditional DAG-based layout engines like Dagre and ELK, TALA produces diagrams that more closely match what you might find on whiteboards. It blends ideas from multiple graph-drawing research papers along with original techniques to optimize for aesthetic objectives including symmetry, median distance, flow, and clustering.

The first batch of examples compares TALA against Dagre and ELK using public D2 files from GitHub. The second batch demonstrates TALA's unique support for custom node positioning and sizes, including locked coordinates, which is especially useful for agentic use cases where models can place nodes in 2D space but still need help with routing. The third batch shows hybrid layouts where some nodes specify coordinates while others are handled by the engine.

TALA has tradeoffs: it uses randomness with a default of 3 seeds, meaning adding a node can significantly change the layout. It also struggles with DAGs and scales nonlinearly for larger diagrams. TALA is bundled into D2 v0.9.0 and can be used with --layout=tala, or tried at play.d2lang.com. Special thanks go to Gavin Nishizawa and Júlio César Batista for their contributions.