path
A route through a network, named by the vertices or the edges it passes.
path

#Attributes
throughThe vertices visited, in order, as
#ids: at least two. Or the edges walked, in order, each leaving from where the one before it ended; an edge is named by the id an inline edge declares. Never a mix.Can be written as shorthand:
path:valuecolourThe stroke's hue.
paintAlso written:
colorDefault
orangehiddenDeclared but not drawn. It still derives its length. Animatable.
Default
false#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
lengthThe summed weight of the edges taken — the hop count on an unweighted network.
hopsHow many edges the path takes.
#Allowed in
#Examples


network{
vertex#a{A}
vertex#b{B}
vertex#c{C}
vertex#d{D}
vertex#e{E}
vertex#f{F}
edge(from: #a; to: #b; weight: 1)
edge(from: #b; to: #c; weight: 1)
edge(from: #c; to: #f; weight: 2)
edge(from: #a; to: #d; weight: 1)
edge(from: #d; to: #e; weight: 2)
edge(from: #e; to: #f; weight: 1)
edge(from: #b; to: #e; weight: 1)
path#route(through: #a, #f)
}(
show weights
)

network{
vertex#london{London}
vertex#paris{Paris}
vertex#brussels{Brussels}
vertex#zurich{Zurich}
vertex#rome{Rome}
edge(from: #london; to: #paris)
edge(from: #london; to: #brussels)
edge(from: #brussels; to: #zurich)
edge(from: #paris; to: #zurich)
edge(from: #paris; to: #rome)
edge(from: #zurich; to: #rome)
cue.draw{
path(through: #london, #paris, #rome; colour: teal)
}(
in: 2
)
}#Notes
- Through vertices, the path is the shortest route visiting them in turn:
path(through: #a, #f)from a to f,path(through: #a, #c, #f)from a to c and on to f. - The route is weighted when the network's edges carry weights, and one-way on a directed network.
- Where several routes are equally short, the path takes one of them, the same every time; name a vertex in between, or write the walk, where the route matters.
- Through edges, the path is the walk along them exactly as written,
path(through: #e1, #e2, #e3), and can take a self-loop, one of two parallel edges, or an edge twice. - Each edge of a walk must leave from where the one before it ended:
'path.through' cannot take '#e1' after '#e2' — each edge must leave from the vertex the one before it ended at, by its from: on a directed network. - Drawn as a broad stroke over the edges it takes and under the vertices it visits.
- Under
cue.drawthe path draws along its route. - Where some leg has no route, nothing is drawn and nothing is derived.