When a diagram gets messy, you usually want one of two things: either everything is nearly aligned and you just want the drift gone, or the layout never really happened and you want it computed for you. livediagram has a tool for each, both one press away on the Tidy Up button in Diagram mode, and in the command palette's Actions. They are complementary, not duplicates: one snaps the positions you already have, the other recomputes positions from how the diagram is wired together.
The two tools
- Auto-align is a grid snap. It rounds every element's size to a 10 px grid and lines shapes up by the edges and centres they nearly share, so near-aligned shapes become exactly aligned, small drift collapses, and nothing moves far. See Auto-Align.
- Auto Layout ("tidy up" in the command palette) reads the arrow graph and computes brand-new positions, laying out connected shapes into clean layers, or into a style you pick: flowchart (down or right), tree, or mindmap. It can legitimately move an element across the canvas. See Auto Layout.
How to run them
In Diagram mode, press the Tidy Up button (the broom in the bottom-right corner, just left of Layers). It opens a panel with a picture of each Auto Layout style (Smart, Flowchart Down, Flowchart Right, Tree and Mindmap) and Auto-align below them. Rest the mouse on one and the tab is laid out that way behind the panel, so you can compare styles before you commit; move away and everything goes back. Click the one you want to keep it.
You can also open the command palette (⌘K / Ctrl+K), type Auto Layout or Auto-align, and pick the tidier you want under Actions. Both run on the whole active tab as a single undoable step, so if the result isn't what you hoped, one undo puts everything back exactly as it was.
The tidiers are for editors: they aren't offered to a participant or in a view-only session, and they leave a locked tab alone, so unlock the tab first. Inside an unlocked tab, a locked element, or anything on a locked layer, stays exactly where it is.
Neither tool will trash your work. Each one is tried before it's offered, and one that would change nothing, cover a shape, or pull shapes out of their lanes is greyed out with the reason. Run one from the command palette and the same check applies: nothing moves, and a short notice says why. See When a style isn't offered.
Both tools work entirely offline and deterministically. They never call out to anything, so they're available in every deployment, including a self-hosted one.
Was this article helpful?