Documentation ¶
Index ¶
- func RenderMermaid[K comparable, T any](w io.Writer, g *Graph[K, T]) error
- func RenderText[K comparable, T any](w io.Writer, g *Graph[K, T]) error
- type Graph
- func (g *Graph[K, T]) Add(v T) (node *Node[T], added bool)
- func (g *Graph[K, T]) LinkTo(prev *Node[T], node *Node[T]) (added bool)
- func (g *Graph[K, T]) Madd(v T) *Node[T]
- func (g *Graph[K, T]) SortedByFrom(nodes []*Node[T]) []*Node[T]
- func (g *Graph[K, T]) SortedByTo(nodes []*Node[T]) []*Node[T]
- func (g *Graph[K, T]) Walk(fn func(*Node[T]))
- func (g *Graph[K, T]) WalkPath(fn func([]*Node[T]), nodes []*Node[T])
- type Node
- type RenderFunc
- type Shape
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMermaid ¶
func RenderText ¶
Types ¶
type Graph ¶
type Graph[K comparable, T any] struct { Nodes []*Node[T] KeyFunc func(T) K // contains filtered or unexported fields }
func New ¶
func New[K comparable, T any](keyFunc func(T) K, values ...T) *Graph[K, T]
func (*Graph[K, T]) SortedByFrom ¶ added in v0.2.0
topological sort
func (*Graph[K, T]) SortedByTo ¶ added in v0.2.0
topological sort
type Node ¶
type RenderFunc ¶
Click to show internal directories.
Click to hide internal directories.