Automatic layout¶
Earlier diagrams used a mix of implicit left-to-right flow and explicit at
coordinates. For larger flow-style diagrams you can describe the structure and
hand most placement to SheepText. Declare a layout direction and connect the
shapes — they arrange themselves along that axis:
Directional layout
layout direction right
A: box "ingest"
B: box "process"
C: box "store"
arrow from A to B
arrow from B to C
layout column (and its sibling layout row) aligns a named set of shapes
into a single band. This column stacks three steps top to bottom:
layout group arranges shapes and wraps them in a labelled container in one
declaration — no coordinates required:
Layout group
layout group Svc "Services": A B C
A: box "auth"
B: box "api"
C: box "db"
Automatic layout shines for flowcharts. Combine a downward flow with a layout
row for the two branch targets so they sit side by side; style the nodes by
role and let the arrows describe the branches:
Branching flow
layout direction down
layout row Branches: Ok Bad
Start: box "start" fill #dbeafe
Check: box "valid?" fill #fef3c7
Ok: box "process" fill #dcfce7
Bad: box "reject" fill #fee2e2
arrow from Start to Check
from Check arrow "yes" to Ok
from Check arrow "no" to Bad
A second edge between the same two shapes needs no help. SheepText gives each edge its own attachment port, so a return arrow runs parallel to the outbound one rather than on top of it:
Parallel arrows
layout direction right
A: box "client"
B: box "server"
from A arrow "request" to B
from B arrow "response" to A
Use route above or route below when you want an edge on a particular
side — to keep it away from other content, or simply to match how you would draw
it. It is a choice about which way an edge goes, not a fix for overlapping lines:
Routed return
layout direction right
A: box "client"
B: box "server"
from A arrow "request" to B
from B arrow "response" to A route below
For pipeline diagrams, layout stage labels each phase and arranges its
members, much like layout group but tuned for left-to-right flow:
Pipeline stages
layout direction right
layout stage Ingest "Ingest": Collector
layout stage Store "Store": Warehouse
Collector: box "collector"
Warehouse: box "warehouse"
arrow from Collector to Warehouse
Next: bring in Icons.