vertices

A table of vertices bound from @data, one vertex per row.

On this page
Five countries as vertices sized by population and coloured by the language most of their people speak, joined by their shared borders.Five countries as vertices sized by population and coloured by the language most of their people speak, joined by their shared borders.

#Attributes

namesImplicit
The column naming each row's vertex, and the key an edge list's cells are matched against: names: #cities.city. A name matching an inline vertex's label or id — case and spacing aside — lends that vertex the row; any other name makes a vertex.
Can be written as shorthand: vertices:value
labels
What each vertex is labelled, where it differs from its name: names: #cities.code with labels: #cities.city.
stage
The column giving each row's stage on a flow network — numbers, the stages in numerical order, or names, the stages in the order the rows are written: stage: #voters.year. A row with an empty cell stands after the longest run of flow into it. Read by no other layout.
colour
The rows' colour: one colour, a list one per row, or a map applied to a column or to a class of the network the table publishes — #self.group (an inline vertex's own group:), #self.component (which connected piece a vertex is in) or #self.community (the densely knit clusters modularity finds): colour: #people.party -> (Labour: red; Green: green; otherwise: grey), and the names it keys are what the footer's key calls them. A measurement — #self.degree, #self.betweenness, … — or a numeric column grades the rows instead: a map bands them, colour: #self.degree -> (..<3: grey; 3..: red), and an interval then a ramp's name ramps them, colour: #self.degree -> 1..10 -> temperature. A row no key holds, in a map with no otherwise, takes the default. A vertex's own colour: wins.
vertex-colour-style
Also written: color
size
The rows' size, in multiples of the plain vertex: one size, a list one per row, or an expression from a measurement of the network — #self.degree, #self.in-degree, #self.out-degree, #self.betweenness, or #self.weight, the summed weight of a vertex's edges — or from a numeric column. size: #self.degree -> 1..10 -> 1 + 2_ draws degree 1 at 1 and degree 10 at 3, in step between; a map with a size per interval bands the readings. A vertex's own size: multiplies it.
vertex-size-style
shape
The rows' shape — circle, square, diamond, or none, the label alone — or a map applied as colour:'s is, to a column, #self.group, #self.component or #self.community: shape: #people.role -> (staff: square; otherwise: circle).
vertex-shape-style
hiddenAnimatable
Declared but not drawn, with the vertices only this table names and their edges. They still count in every measurement. Animatable.
Defaultfalse

#Derived attributes

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

groupDerived
Each governed vertex's group:, the inline vertex's own; empty for a data vertex. A style attribute follows it as #self.group: colour: #self.group -> (prey: teal; otherwise: grey).
componentDerived
Which connected piece each governed vertex is in, counted from 0, read as #self.component.
communityDerived
Which densely knit cluster modularity puts each governed vertex in, counted from 0, read as #self.community: colour: #self.community -> (0: blue; 1: orange; otherwise: grey).
degreeDerived
How many edges meet each governed vertex, read as #self.degree: size: #self.degree -> 1..10 -> 1 + 2_ draws readings 1 and 10 at one and three times the plain vertex.
in-degreeDerived
How many edges arrive at each governed vertex on a directed network — the degree on an undirected one — read as #self.in-degree.
out-degreeDerived
How many edges leave each governed vertex on a directed network — the degree on an undirected one — read as #self.out-degree.
betweennessDerived
How many shortest paths between other vertices run through each governed vertex, read as #self.betweenness.
weightDerived
The sum of the weights on each governed vertex's edges, read as #self.weight.

#Allowed in

#Examples

Six French cities as vertices sized by population and coloured by region, joined by the roads between them.Six French cities as vertices sized by population and coloured by region, joined by the roads between them.
network{
    vertices(names: #cities.city; colour: #cities.region -> (north: blue; south: orange; west: teal); size: #cities.population -> 0..2.1 -> 1 + 1.5_)
    edges(from: #roads.from; to: #roads.to)
}
A pond food web: seven species labelled by name and coloured by diet, from pike down to algae and pondweed.A pond food web: seven species labelled by name and coloured by diet, from pike down to algae and pondweed.
network:layered{
    vertices(names: #species.code; labels: #species.name; colour: #species.diet -> (carnivore: red; omnivore: orange; herbivore: teal; producer: green))
    edges(from: #eats.predator; to: #eats.prey)
}
Two tight clusters of four joined through one vertex, each vertex coloured by its community and the joining vertex drawn largest by betweenness.Two tight clusters of four joined through one vertex, each vertex coloured by its community and the joining vertex drawn largest by betweenness.
network{
    vertices(size: #self.betweenness -> 0..0.6 -> 1 + 1.5_; colour: #self.community -> (0: teal; 1: orange; otherwise: purple))
    edges(from: #pairs.a; to: #pairs.b)
}

#Notes

  • Its columns carry what the network's own measurements cannot: the data's own numbers and categories.
  • Column attributes are plural: names:, labels:.
  • A column of categories colours or shapes the rows through a map, colour: #people.team -> (design: teal; otherwise: grey); there is no separate attribute naming each row's group.
  • A listed vertex with no edges is drawn on its own.
  • The vertices' encodings, colour:, size: and shape:, live on the tables, never on the environment.
  • A table with no names: lists no rows: its rules cover every vertex no named table lists, inline vertices included — vertices(size: #self.degree -> 1..10 -> 1 + 2_).

Last updated