graphviz

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package graphviz provides some simple types for building graphviz DOT files based on their usage for container debugging. It does not attempt to cover all of graphviz, just what is needed here.

Package graphviz

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	// contains filtered or unexported fields
}

Attributes represents a graphviz attributes map.

func NewAttributes

func NewAttributes() *Attributes

NewAttributes creates a new Attributes instance.

func (*Attributes) SetAttr

func (a *Attributes) SetAttr(name, value string)

SetAttr sets the graphviz attribute to the provided value.

func (*Attributes) SetBgColor

func (a *Attributes) SetBgColor(color string)

SetBgColor sets the bgcolor attribute.

func (*Attributes) SetColor

func (a *Attributes) SetColor(color string)

SetColor sets the color attribute.

func (*Attributes) SetComment

func (a *Attributes) SetComment(comment string)

SetComment sets the comment attribute.

func (*Attributes) SetFontColor

func (a *Attributes) SetFontColor(color string)

SetFontColor sets the fontcolor attribute.

func (*Attributes) SetFontSize

func (a *Attributes) SetFontSize(size string)

SetFontSize sets the fontsize attribute.

func (*Attributes) SetLabel

func (a *Attributes) SetLabel(label string)

SetLabel sets the label attribute.

func (*Attributes) SetPenWidth

func (a *Attributes) SetPenWidth(w string)

SetPenWidth sets the penwidth attribute.

func (*Attributes) SetShape

func (a *Attributes) SetShape(shape string)

SetShape sets the shape attribute.

func (*Attributes) SetStyle

func (a *Attributes) SetStyle(style string)

SetStyle sets the style attribute.

func (*Attributes) String

func (a *Attributes) String() string

String returns the attributes graphviz string in the format [name = "value", ...].

type Edge

type Edge struct {
	*Attributes
	// contains filtered or unexported fields
}

Edge represents a graphviz edge.

type Graph

type Graph struct {
	*Attributes
	// contains filtered or unexported fields
}

Graph represents a graphviz digraph.

func NewGraph

func NewGraph() *Graph

NewGraph creates a new Graph instance.

func (*Graph) CreateEdge

func (g *Graph) CreateEdge(from, to *Node) *Edge

CreateEdge creates a new graphviz edge.

func (*Graph) FindOrCreateNode

func (g *Graph) FindOrCreateNode(name string) (node *Node, found bool)

FindOrCreateNode finds or creates the node with the provided name.

func (*Graph) FindOrCreateSubGraph

func (g *Graph) FindOrCreateSubGraph(name string) (graph *Graph, found bool)

FindOrCreateSubGraph finds or creates the subgraph with the provided name.

func (*Graph) RenderDOT

func (g *Graph) RenderDOT(w io.Writer) error

RenderDOT renders the graph to DOT format.

func (*Graph) String

func (g *Graph) String() string

String returns the graph in DOT format.

type Node

type Node struct {
	*Attributes
	// contains filtered or unexported fields
}

Node represents a graphviz node.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL