path

The shortest route through the network, visiting the vertices through: names in turn: path(through: #a, #f) is the shortest path from a to f, and path(through: #a, #c, #f) the shortest from a to c and on to f. Weighted when the network's edges carry weights, and one-way on a directed network. Drawn as a broad stroke over the edges it takes and under the vertices it visits; under cue.draw it strokes in hop by hop. Where some leg has no route, nothing is drawn and nothing is derived.

pathNode
A grid of nine vertices with the shortest path from the top-left corner to the bottom-right laid over it in orange, passing through the centre.A grid of nine vertices with the shortest path from the top-left corner to the bottom-right laid over it in orange, passing through the centre.

#Attributes

throughRequiredImplicit
The vertices visited, in order, as #ids: at least two.
network-refs
Can be written as shorthand: path:value
colourAnimatable
The stroke's hue.
bluelight-bluedark-blueredlight-reddark-redorangelight-orangedark-orangeyellowlight-yellowdark-yellowteallight-tealdark-tealgreenlight-greendark-greenpinklight-pinkdark-pinkpurplelight-purpledark-purplegreylight-greydark-greyneutralhex(…)rgb(…)
Also written: color
Defaultorange
hiddenAnimatable
Declared but not drawn. It still derives its length. Animatable.
Defaultfalse

#Derived attributes

Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.

lengthDerived
The summed weight of the edges taken — the hop count on an unweighted network.
hopsDerived
How many edges the path takes.

#Allowed in

#Examples

path#route(through: #a, #f)
cue.draw{
    path(through: #london, #paris, #rome; colour: teal)
}(
    in: 2
)

Last updated