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

File basics

A file may begin with a kind and a title, and may set a direction.

diagram component "Title"
direction right

The kinds implemented are component, package, sequence, state and activity. A file with no header is a component diagram. The default direction is right for component diagrams and down for package and state diagrams. See Package diagrams and State diagrams. direction does not apply to sequence and activity diagrams, which always run top to bottom.

Direction

direction right places dependencies left to right. It suits most component diagrams, because labels read naturally on horizontal lines.

diagram component "direction right"
direction right

component A
component B
component C
A --> B
B --> C
direction right A B C

direction down places dependencies top to bottom. It suits pipelines and layers.

diagram component "direction down"
direction down

component A
component B
component C
A --> B
B --> C
direction down A B C

Comments

# and // start a comment that runs to the end of the line.