Route connectors around shapes automatically
From version 30.1.13 onwards, draw.io can automatically route connectors around the shapes in your diagram. An auto-routed connector takes a path with right-angled bends that doesn't cross other shapes.
Auto-route a connector
- Select one or more connectors.
- Click Waypoints in the Style tab of the format panel.
- Select Auto-route around shapes.
Auto-routed connectors automatically find new paths whenever you:
- move or resize one of its connected shapes.
- move or add a shape on its path, or move a shape away from its path.
- connect it to a different shape.
From version 31.6.2 onwards, auto-routed connectors will also be routed again when you align, distribute or rotate shapes, change their position or size in the Arrange tab, or apply a layout from Arrange > Layout.
While dragging a shape to reposition it, you will see the new path of each auto-routed connector.
Tip: To auto-route all newly added connectors, select an auto-routed connector, then click Set as Default Style in the Style tab.
Turn auto-routing off
- Select a different style in the Waypoints list.
- Or drag the connector to add your own waypoints and manually change its path. The connector will remember the path you set and not be routed automatically from that point onwards.
Note: Auto-routing has no effect on connectors inside containers that arranges contents automatically, such as a list shape or layout shape.
Route connectors around shapes once
Use the Orthogonal Routing layout to route connectors around shapes a single time. The shapes don't move, and the connectors will not be auto-routed afterwards.
- Select the connectors you want to route. All connectors will be routed if nothing is selected.
- Select Arrange > Layout > Orthogonal Routing from the menu.
- Enter the Spacing between the connectors and the shapes, then click OK.
The connector style will be changed to orthogonal connectors with waypoints that go around the shapes.
Related
- JSON layout specification - use the
libavoidshorthand to auto-route connectors in a layout specification.