Auto-Layout Reference
Complete reference for automatic diagram layout using ELK.js algorithms including hierarchical, force-directed, and layered layouts.
Auto-layout automatically arranges diagram elements using the ELK.js (Eclipse Layout Kernel) library. This saves time when creating or reorganising complex diagrams.
Layout Algorithms
| Algorithm | Description | Best For |
|---|---|---|
| Hierarchical (layered) | Arranges nodes in layers based on dependencies | Flowcharts and dependency graphs |
| Force-directed | Uses physics simulation to space nodes evenly | Network diagrams |
| Box | Simple grid-based arrangement | Component inventories |
| Random | Random placement | Starting point for manual adjustment |
Layout Options
| Option | Description |
|---|---|
| Direction | Top-to-bottom, left-to-right, bottom-to-top, right-to-left |
| Spacing | Distance between nodes |
| Layering | How nodes are assigned to layers |
| Node placement | How nodes are positioned within layers |
| Edge routing | How connections are routed between nodes |