Skip to main content

Connections

Connections define relationships between shapes.

Basics

Hyphens/arrows in between shapes define a connection.

If you reference an undeclared shape in a connection, it's created (as shown in the hello world example).

info

There are 4 valid ways to define a connection:

  • --
  • ->
  • <-
  • <->

Connection labels

Connections must reference a shape's key, not its label.

Example

Write Replica CanadaWrite Replica AustraliaRead ReplicaMasterxysuper long shape id heresuper long shape id even longer here

Repeated connections

Repeated connections do not override existing connections. They declare new ones.

DatabaseS3 backupbackup

Connection chaining

For readability, it may look more natural to define multiple connection in a single line.

High Mem InstanceEC2High CPU Instance Hosted By Hosted By

Cycles are okay

Stage OneStage TwoStage ThreeStage Four repeat

Arrowheads

To override the default arrowhead shape or give a label next to arrowheads, define a special shape on connections named source-arrowhead and/or target-arrowhead.

The best way to avoid responsibility is to say, "I've got responsibilities"Whether weary or unweary, O man, do not restI still maintain the point that designing a monolithic kernel in 1991 is aA black cat crossing your path signifies that the animal is going somewhere To err is human, to moo bovine1* Reality is just a crutch for people who can't handle science fiction1*
Arrowhead options
  • triangle (default)
    • Can be further styled as style.filled: false.
  • arrow (like triangle but pointier)
  • diamond
    • Can be further styled as style.filled: true.
  • circle
    • Can be further styled as style.filled: true.
  • box
    • Can be further styled as style.filled: true.
  • cf-one, cf-one-required (cf stands for crows foot)
  • cf-many, cf-many-required
info

It's recommended the arrowhead labels be kept short. They do not go through autolayout for optimal positioning like regular labels do, so long arrowhead labels are more likely to collide with surrounding objects.

caution

If the connection does not have an endpoint, arrowheads won't do anything.

For example, the following will do nothing, because there is no source arrowhead.

Referencing connections

You can reference a connection by specifying the original ID followed by its index.

xy hi hello