Documentation
¶
Overview ¶
The dot package contains utilities for working with DOT graphs.
Index ¶
- type Edge
- type Graph
- func (g *Graph) AddAttr(k, v string)
- func (g *Graph) AddEdge(e *Edge)
- func (g *Graph) AddEdgeBetween(src, dst string, attrs map[string]string) error
- func (g *Graph) AddNode(n *Node)
- func (g *Graph) AddSubgraph(name string) *Subgraph
- func (g *Graph) GetNode(name string) (*Node, error)
- func (g *Graph) String() string
- type Node
- type Subgraph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶
type Edge struct {
// Name of source node.
Source string
// Name of dest node.
Dest string
// List of K/V attributes for this edge.
Attrs map[string]string
}
An Edge in a DOT graph, as expressed by recording the Name of the Node at each end.
type Graph ¶
type Graph struct {
// Whether this is a "digraph" or just a "graph"
Directed bool
// Used for K/V settings in the DOT
Attrs map[string]string
Nodes []*Node
Edges []*Edge
Subgraphs []*Subgraph
// contains filtered or unexported fields
}
Graph is a representation of a drawable DOT graph.
func NewGraph ¶
func NewGraph(attrs map[string]string) *Graph
Creates a properly initialized DOT Graph.
func (*Graph) AddEdgeBetween ¶
func (g *Graph) AddEdgeBetween(src, dst string, attrs map[string]string) error
Adds an edge between two Nodes.
Note this does not do any verification of the existence of these nodes, which means that any strings you provide that are not existing nodes will result in extra auto-defined nodes in your resulting DOT.
func (*Graph) AddSubgraph ¶
func (g *Graph) AddSubgraph(name string) *Subgraph
Initializes a Subgraph with the provided name, attaches is to this Graph, and returns it.
Click to show internal directories.
Click to hide internal directories.