Graph annotations¶
A graph carries its annotations as options of its own, which Options reads
back:
AnnotationValue and PropertyValue name one vertex or edge to read the
value it carries; a property the graph does not have gives $Failed:
An item named by a rule reads back the bare value the rule gives it:
AnnotationKeys lists the annotations a graph, or one of its vertices or
edges, offers:
$ wo 'AnnotationKeys[{Graph[{1 -> 2, 2 -> 3}], 1}]'
{VertexCoordinates, VertexShapeFunction, VertexShape, VertexSize, VertexStyle}
AnnotationDelete drops a whole annotation, or just one item's share of it —
a weight spelled out per item falls back to 1 rather than losing the key:
$ wo 'Options[AnnotationDelete[{Graph[{1 <-> 2, 2 <-> 3}, EdgeWeight -> {5, 7}], 1 <-> 2}, EdgeWeight]]'
{EdgeWeight -> {1, 7}}
SetProperty writes one:
The weight predicates say what kind of weights a graph carries:
In an EdgeTaggedGraph every edge carries a tag; one written without a tag
is tagged by how many copies of it came before: