edge

A relation between two vertices: edge(from: #a; to: #b; weight: 4). The endpoints are #ids of vertices in the same environment — an id no vertex declares is a compile error. On a directed: network the edge runs from from to to and carries a head. Two edges between the same pair bow apart so both stay visible, and an edge from a vertex to itself is a loop over it. cue.draw strokes it in; a dashed: edge fades instead.

edgeNode
Three vertices joined by directed edges: a pair running both ways between A and B, bowed apart, labelled lends and repays, and a red edge from B to C marked with a minus sign.Three vertices joined by directed edges: a pair running both ways between A and B, bowed apart, labelled lends and repays, and a red edge from B to C marked with a minus sign.

#Attributes

fromRequiredImplicit
#id of the vertex the edge leaves.
network-ref
Can be written as shorthand: edge:value
toRequired
#id of the vertex the edge meets.
network-ref
weight
The edge's weight: its length to a shortest path, its thickness under a nameless edges(width-by: weight), and its words under show-weights:. Never negative — a relation that opposes is sign: negative. An unweighted edge on a weighted network weighs 1.
label
Rich inline text set at the edge's midpoint.
sign
positive or negative: a + or − beside the head, the causal-loop mark for a link that reinforces or opposes.
nonepositivenegative
Defaultnone
colourAnimatable
The stroke's hue; unset, a neutral grey.
bluelight-bluedark-blueredlight-reddark-redorangelight-orangedark-orangeyellowlight-yellowdark-yellowteallight-tealdark-tealgreenlight-greendark-greenpinklight-pinkdark-pinkpurplelight-purpledark-purplegreylight-greydark-greyneutralhex(…)rgb(…)
Also written: color
dashed
A dashed stroke.
Defaultfalse
hiddenAnimatable
Declared but not drawn. It still counts in every measurement and every path. Animatable.
Defaultfalse

#Allowed in

#Examples

edge(from: #a; to: #b; weight: 4)
edge(from: #births; to: #population; sign: positive)
cue.draw{
    edge(from: #c; to: #a; label: feedback)
}(
    in: 2
)

Last updated