Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Layout hints

drumlin places everything for you. When you want a different arrangement, a layout hint adjusts the result. Hints describe relations, never coordinates, so the source stays readable. They work in component, package and state diagrams; sequence and activity diagrams take their order from the file. Most diagrams need no hints: add one only when the drawing needs help.

HintEffect
a left-of b, a right-of bHorizontal order
a above b, a below bVertical order
align a b cPlaces elements in the same rank

Same rank

Connectors normally give each element its own rank. align overrides that and places elements in one rank, which shortens a wide diagram.

diagram component "Without align"
component Gateway
component Auth
component Orders
Gateway --> Auth
Auth --> Orders
Without align Gateway Auth Orders
diagram component "With align"
component Gateway
component Auth
component Orders
Gateway --> Auth
Auth --> Orders
align Auth Orders
With align Gateway Auth Orders

Forcing order

With direction right, above and below order elements within a rank.

diagram component "Metrics above Logs"
component App
component Logs
component Metrics
App --> Logs
App --> Metrics
Metrics above Logs
Metrics above Logs App Logs Metrics

Along the diagram direction, a hint forces a rank order even with no connector.

diagram component "Order without connectors"
component Boot
component Init
component Run
Boot left-of Init
Init left-of Run
Order without connectors Boot Init Run

Hints across containers

A hint between elements in different containers applies to the containers that hold them. Here Reader left-of Query places the Ingest package left of Serve.

package "Ingest" { component Reader }
package "Serve" { component Query }
package "Admin" { component Console }
Reader left-of Query
Console left-of Query
Ingest Reader Serve Query Admin Console

See also

Hints win over the layout’s own choices: see Honour hints over heuristics. Package and state diagrams use the same hints as the examples above: see Package diagrams and State diagrams.