edge

A relation between two vertices in a network.

edgeNode
On this page
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: 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 − set along the edge near its end, the causal-loop mark for a link that reinforces or opposes.
nonepositivenegative
Defaultnone
colourAnimatable
The stroke's hue; unset, a neutral grey.
paint
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

Two vertices joined by an edge with its weight, 4, shown on it.Two vertices joined by an edge with its weight, 4, shown on it.
network{
    vertex#a{A}
    vertex#b{B}
    edge(from: #a; to: #b; weight: 4)
}(
    show-weights: true
)
Births and Population as bare words, an arrow from Births to Population marked +.Births and Population as bare words, an arrow from Births to Population marked +.
network{
    vertex#births{Births}(shape: none)
    vertex#population{Population}(shape: none)
    edge(from: #births; to: #population; sign: positive)
}(
    directed: arrows
)
Three frames of the second step: a chain from A to B to C, then an edge labelled feedback drawing in from C back to A.Three frames of the second step: a chain from A to B to C, then an edge labelled feedback drawing in from C back to A.
network:circle{
    vertex#a{A}
    vertex#b{B}
    vertex#c{C}
    edge(from: #a; to: #b)
    edge(from: #b; to: #c)
    cue.draw{
        edge(from: #c; to: #a; label: feedback)
    }(
        in: 2
    )
}(
    directed: arrows
)

#Notes

  • The endpoints are #ids of vertices in the same environment; an id no vertex declares is a compile error.
  • On a network with direction: arrows the edge runs from from to to and carries a head.
  • Two edges between the same pair bow apart so both stay visible.
  • An edge from a vertex to itself is a loop over it.
  • cue.draw strokes an edge in; a dashed: edge fades in instead.

Last updated