Skip to content

Auto layout

Shin Sterneck edited this page Nov 14, 2026 · 2 revisions

Layout ▾ in the toolbar (Ctrl+L). Pick an arrangement and it applies at once; the menu stays open to try another, and Ctrl+Z undoes each one.

It works on the selected devices when two or more are selected, otherwise on all shown, unlocked devices. Separate groups are laid out side by side, and the result stays where the devices were. Free connection points move with their device.

Arrangements

Hierarchy ↓ / →: layers from the most upstream device (internet or cloud, then firewall, router, load balancer, switch, access point, servers and clients) downward or to the right, ordered to avoid crossing lines.

  • Devices of the same type that share a neighbor, like the two firewalls of an HA pair on one switch, are treated as peers: they share a row and stay side by side, and what they both connect to is centered between them.
  • Tiers of one type stay apart: two access switches on the same core switches are peers, and so is a core pair linked to each other with the same other neighbors, but a core switch and an access switch below it are not.
  • Diagram layers set the rows too: devices on different layers never share a row, later layers (lower in the layer list) go below earlier ones, and the top of the hierarchy comes from the first layer. A sub-layer goes with the layer it is under, unless it (or a layer between) has a background: then it is a group of its own, so the devices of one NetBox location, say, stay together and its background does not reach into another's.

Radial: rings around that device, each branch in its own wedge.

Circle, Grid: neighbors placed next to each other.

Force-directed: an organic layout where linked devices pull together. It starts from the current positions, so running it again refines it.

Tidy: cleans up the arrangement you have without redoing it. Devices move only a little, and the arrangement stays where it is:

  • devices at nearly one height share a row, devices nearly above each other a column;
  • a device linked to several in the row below (or above) is centered over them when that is a short move;
  • overlaps are pushed apart, keeping the order, with room for line labels;
  • the ports on each side are spread evenly (one in the middle, two at the thirds, and so on, in their order), so lines between devices that line up run straight; where two facing devices still do not line up, a lone port moves off the middle to keep its line straight.

Settings

All three are remembered.

Spacing sets the gap. Lines with a label (or a type tag) get more where they need it: each line's Label margin (in the link panel, 24 by default) is kept free on both sides of its label. So the gap between rows (or columns) grows for the labels crossing it (stacked where they would sit side by side), devices in one row move apart for a labeled line between them, force-directed lengthens such lines, and radial, circle and grid keep that much room overall.

Move ports to face their links puts each linked port on the side toward the other end, spread out so lines do not cross.

Route lines around objects (on by default) makes sure no line runs through a device or text afterwards: a line that would gets the first routing that keeps it clear (its own, straight, orthogonal, else around objects). Lines that are already clear keep their style.

Untangling

When a layout leaves lines crossing, Stratagram tries to untangle them: it flips the side a line leaves its socket, tries other routings, and swaps neighbors in a row.

From scripts, stratagram --layout runs the same layouts; see Command line.

Clone this wiki locally