Skip to main content

Apply layouts to rearrange a diagram

Layouts allow you to quickly rearrange the shapes and connectors on the drawing canvas in the draw.io editor. Your diagram is reorganised following the specific rules and spacing information defined by the layout you choose.

This is different to inserting a layout (where you build your diagram inside the Layouts dialog) or using an automated layout container shape. When you apply a layout via Arrange > Layout, it will rearrange the existing shapes on the drawing canvas.

Select Arrange > Layout from the draw.io editor, then select the layout you want to use.
Apply a layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io

Note: Some of these layouts are quite specific, and will only work for certain diagram types. If you apply a layout that you don't like, press Ctrl+Z on Windows or Cmd+Z on macOS to undo that change.

Layouts are calculated from your diagram's current state - applying a layout after you have applied another layout will not result consistently in the same diagram structure.

Flow layouts

Flow layouts work well for visualising processes, mind maps, or any typs of diagram where there is some flow-like structure or movement. For example, using one of the map templates from the template library in draw.io, both the horizontal and vertical flow layouts are clear and readable.

Apply a flow layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io
_Horizontal flow_ Apply a flow layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io
_Vertical flow_

Tree layouts

The previous example has flows in both directions, toward and away from the root node. The tree layouts applied that that particular diagram have poor readability. Using a simpler map from the template library, with all connectors moving outward from the root, the horizontal, vertical and radial tree layouts work well.

When you select one of the tree layouts, enter a number for the spacing between shapes, then click Apply.

|----|------|----|------|----| |Apply a tree layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io |     | Apply a tree layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io |     | Apply a tree layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io |

Horizontal tree, vertical tree, and radial tree layouts

Circle layout

Rearranging shapes into a circle is useful when you are designing graphic components for slides or infographics. If shapes are connected, the resulting diagram looks like a social graph.
Apply a layout via Arrange /> Layout > Circle to automatically rearrange the shapes and connectors into an evenly spaced circle

Organic layout

This works well for mindmaps and networks where devices are organised into clusters. For example, the organic layout below is applied to one of the network templates in the draw.io template library with a spacing.
Apply a layout via Arrange /> Layout > Organic to automatically rearrange the shapes and connectors

Org chart layouts

There are several different types of org chart layouts for tree diagrams: linear, hanger, fishbone, single columns, and smart.

  1. After selecting the Org chart layout from the menu, select the Org Chart Type from the list. Available types include: linear, hanger, fishbone, single column, and smart org chart layouts.
    Select an org chart layout via Arrange /> Layout > Org Chart to automatically rearrange the shapes and connectors into various org charts
  2. Enter different values to change the space between parent and child nodes, or between sibling nodes.
Apply a layout via Arrange /> Layout > Org Chart to automatically rearrange the shapes and connectors in various common org charts

To get the Orgchart config description for the Custom Layout dialog, click on the Custom button.

Parallels layout

Apply the parallels layout to expose and separate overlapping connectors between shapes.
Apply a layout via Arrange /> Layout > Parallels to automatically rearrange and expose overlapping connectors

Custom layouts

You can customise a layout by specifying a variety of layout parameters.

  1. Select Arrange > Layout > Apply.
  2. Use the Add dropdown to pick a layout from the same list as the Arrange > Layout menu — its config dialog opens, and clicking Apply appends a JSON entry to the textarea. Repeat to compose multiple layouts that run in order. The textarea is editable on top so you can tweak options that the per-layout dialog doesn't expose.
  3. Click Apply to run the composed layout.
    Apply a layout via Arrange /> Layout to automatically rearrange the shapes and connectors in draw.io

The full JSON format — every supported layout name, every option, and the CSV shorthand vocabulary — is documented in the JSON layout specification on GitHub Discussions.