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).
There are 4 valid ways to define a connection:
--
->
<-
<->
Connection labels
Connections must reference a shape's key, not its label.
Example
Repeated connections
Repeated connections do not override existing connections. They declare new ones.
Connection chaining
For readability, it may look more natural to define multiple connection in a single line.
Cycles are okay
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
.
triangle
(default)- Can be further styled as
style.filled: false
.
- Can be further styled as
arrow
(like triangle but pointier)diamond
- Can be further styled as
style.filled: true
.
- Can be further styled as
circle
- Can be further styled as
style.filled: true
.
- Can be further styled as
box
- Can be further styled as
style.filled: true
.
- Can be further styled as
cf-one
,cf-one-required
(cf stands for crows foot)cf-many
,cf-many-required
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.
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.