Auto-Layout

Diagrammix3 includes a powerful auto-layout feature that automatically arranges your diagram for optimal readability. It offers several layout algorithms — from the default Sugiyama-based hierarchical layout to tree, radial, circular, force-directed, organic, and grid arrangements — so you can pick the one that best fits your diagram.

When to Use Auto-Layout

Auto-layout is helpful when:

  • You've imported a diagram from Mermaid or another format
  • Your diagram has become messy after many edits
  • You want to quickly organize a large number of elements
  • You're starting from a rough sketch and want a clean layout

Before Auto-Layout

Applying Auto-Layout

Auto-layout lives in the Inspector — there is no Arrange menu or toolbar button for it.

  1. Open the Inspector (right sidebar) and select the Arrange tab
  2. Expand the Layout section
  3. Pick an algorithm from the Layout dropdown
  4. Adjust the algorithm's options if you like (they change depending on the algorithm)
  5. Click the Layout button to arrange the diagram

The Layout button arranges the whole active diagram (every shape on the current tab), so you don't need to select anything first. Press Cmd+Z to undo if you don't like the result.

After Auto-Layout

Layout Algorithms

Choose the algorithm that matches the shape of your data from the Layout dropdown:

AlgorithmBest For
Traditional (default)Flowcharts, org charts, dependency graphs — a Sugiyama-based layered hierarchy
LayeredDirected graphs where you want explicit control over flow direction and connector style (Dagre-style)
TreeStrict parent → child hierarchies
RadialHierarchies radiating from a central root
CircularNodes arranged around a ring; good for cycles and peer networks
Force-directedOrganic, physics-based spacing for general graphs
OrganicNatural, evenly spread layouts for dense graphs
Grid / PackTidy grid or packed arrangements of loosely related elements

Tip: Try a few algorithms on the same diagram — Cmd+Z undoes each result instantly, so it's quick to compare.

Layout Options

The options shown below the algorithm dropdown change with the selected algorithm. The most useful ones:

Direction (Layered and Tree)

For the Layered and Tree algorithms, a Direction picker controls the flow of the hierarchy:

DirectionBest For
Top → BottomOrg charts, flowcharts
Bottom → TopDecision trees
Left → RightProcess flows, timelines
Right → LeftRTL diagrams

Spacing

Spacing controls are named per algorithm — for example:

  • Layered: Node spacing (between siblings) and Rank spacing (between levels)
  • Tree: level, sibling, and subtree spacing
  • Grid / Pack: number of columns plus horizontal and vertical spacing
  • Circular / Radial: radius (or level spacing) and start angle

Connector style (Layered)

The Layered algorithm also lets you choose how connectors are drawn — Straight, Orthogonal (right-angle), or Curved — and fine-tune orthogonal routing (shape buffer, segment and crossing penalties).

Live force layout (Force-directed and Organic)

For the Force-directed and Organic algorithms, a Live toggle keeps the simulation running: drag a node and the layout re-relaxes around it. Turn Live off to keep the result.

Autolayout curves

The Autolayout checkbox affects connectors, not node placement: when enabled, curved connectors automatically recalculate their shape as you move connected shapes. Turn it off for full manual control over curve handles.

Tip: The same Layout section also has a Connect selected shapes button, which wires up the selected shapes in sequence — a quick way to build a graph before laying it out.

Auto-Layout Inspector

The Traditional (Sugiyama) Algorithm

The default Traditional algorithm is a full implementation of the Sugiyama method (layered graph drawing), which:

  1. Assigns layers: Places nodes in hierarchical levels based on connections
  2. Reduces crossings: Minimizes edge crossings between layers
  3. Positions nodes: Places nodes to minimize edge lengths
  4. Routes edges: Creates clean connector paths

The separate Layered algorithm is a related Dagre-style layered layout that adds explicit direction and connector-style controls. Both are ideal for:

  • Flowcharts
  • Organization charts
  • Dependency graphs
  • UML class hierarchies
  • State machines

Tips for Better Results

Before Running Auto-Layout

  1. Delete unnecessary connections: Extra edges increase complexity
  2. Group related items: Groups are treated as single nodes
  3. Consider direction: For Layered and Tree, think about which direction makes sense for your diagram

After Running Auto-Layout

  1. Fine-tune positions: Adjust individual elements as needed
  2. Check labels: Ensure labels are readable and not overlapping
  3. Adjust spacing: Increase spacing if elements feel cramped, then click Layout again

Limitations

  • Whole-diagram only: The Layout button arranges the entire active tab, not just the current selection
  • Cyclic graphs: Diagrams with circular references may not lay out perfectly
  • Dense graphs: Very dense diagrams may still have some edge crossings
  • Custom positions: Running a layout overrides any manual positioning

Undo

If you don't like the result, press Cmd+Z to undo the layout and restore the previous positions.