Documentation ¶
Overview ¶
Package ast declares the types used to represent abstract syntax trees of Graphviz DOT graphs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrStmt ¶
type AttrStmt struct { // Graph component kind to which the attributes are assigned. Kind Kind // Attributes. Attrs []*Attr }
An AttrStmt represents an attribute statement.
Examples.
graph [rankdir=LR] node [color=blue fillcolor=red] edge [minlen=1]
type CompassPoint ¶
type CompassPoint uint
CompassPoint specifies the set of compass points.
const ( CompassPointNone CompassPoint = iota // CompassPointNorth // n CompassPointNorthEast // ne CompassPointEast // e CompassPointSouthEast // se CompassPointSouth // s CompassPointSouthWest // sw CompassPointWest // w CompassPointNorthWest // nw CompassPointCenter // c CompassPointDefault // _ )
Compass points.
func (CompassPoint) String ¶
func (c CompassPoint) String() string
String returns the string representation of the compass point.
type Edge ¶
type Edge struct { // Directed edge. Directed bool // Destination vertex. Vertex Vertex // Outgoing edge; or nil if none. To *Edge }
An Edge represents an edge between two vertices.
type EdgeStmt ¶
type EdgeStmt struct { // Source vertex. From Vertex // Outgoing edge. To *Edge // Edge attributes. Attrs []*Attr }
An EdgeStmt represents an edge statement.
Examples.
A -> B A -> {B C} A -> B -> C
type File ¶
type File struct { // Graphs. Graphs []*Graph }
A File represents a DOT file.
Examples.
digraph G { A -> B } graph H { C - D }
type Graph ¶
type Graph struct { // Strict graph; multi-edges forbidden. Strict bool // Directed graph. Directed bool // Graph ID; or empty if anonymous. ID string // Graph statements. Stmts []Stmt }
A Graph represents a directed or an undirected graph.
Examples.
digraph G { A -> {B C} B -> C }
type Kind ¶
type Kind uint
Kind specifies the set of graph components to which attribute statements may be assigned.
type Port ¶
type Port struct { // Port ID; or empty if none. ID string // Compass point. CompassPoint CompassPoint }
A Port specifies where on a node an edge should be aimed.
type Stmt ¶
A Stmt represents a statement, and has one of the following underlying types.
*NodeStmt *EdgeStmt *AttrStmt *Attr *Subgraph