graph

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const WebAdditionFooter = `
</g>
`
View Source
const WebAdditionHeader = `` /* 8046-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	From *Node
	To   *Node

	Styles EdgeStyles
}

func NewEdge

func NewEdge(g *Graph, from, to string, styles EdgeStyles) (*Edge, error)

func (Edge) String

func (n Edge) String() string

type EdgeStyles

type EdgeStyles struct {
	ArrowTail string
	Style     string
	Color     string
	FontColor string
	Width     float64
	Label     string
	ToolTip   string
}

func (EdgeStyles) String

func (s EdgeStyles) String() string

type Edges

type Edges map[string]*Edge

func (Edges) String

func (n Edges) String() string

type Graph

type Graph struct {
	Name string

	IsSubgraph bool

	GraphStyle Styles
	NodeStyle  NodeStyles
	EdgeStyle  EdgeStyles

	SubGraphs SubGraphs
	Nodes     Nodes
	Edges     Edges
}

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to string, styles EdgeStyles) error

func (*Graph) AddEdgeByNode

func (g *Graph) AddEdgeByNode(from, to *Node, styles EdgeStyles) error

func (*Graph) AddNode

func (g *Graph) AddNode(node *Node) (*Node, error)

func (*Graph) AddSubGraph

func (g *Graph) AddSubGraph(subgraph *Graph) *Graph

func (*Graph) GetNode

func (g *Graph) GetNode(name string) (*Node, bool)

func (*Graph) GetNodeInSubgraphs

func (g *Graph) GetNodeInSubgraphs(name string) (*Node, bool)

func (*Graph) GetOrCreateSubGraph

func (g *Graph) GetOrCreateSubGraph(nsName string) *Graph

func (*Graph) GetSubGraph

func (g *Graph) GetSubGraph(name string) (*Graph, bool)

func (*Graph) String

func (g *Graph) String() string

type Node

type Node struct {
	Name string

	Edges  Edges
	Styles NodeStyles
}

func (*Node) ForceScale added in v1.0.0

func (n *Node) ForceScale(val float64)

func (*Node) Scale

func (n *Node) Scale(val float64)

func (*Node) String

func (n *Node) String() string

type NodeStyles

type NodeStyles struct {
	Label string

	Shape      string
	FillColor  string
	EdgeColor  string
	Style      string
	FontSize   int64
	FontFamily string
	FontColor  string
}

func (NodeStyles) String

func (s NodeStyles) String() string

type Nodes

type Nodes map[string]*Node

func (Nodes) AddNode

func (n Nodes) AddNode(node *Node)

func (Nodes) DeleteNode

func (n Nodes) DeleteNode(node *Node)

func (Nodes) String

func (n Nodes) String() string

type Styles

type Styles struct {
	Label       string
	Padding     float64
	NodeMargin  float64
	GraphMargin float64
	Style       string
	FontColor   string
	BorderColor string
}

func (Styles) String

func (s Styles) String() string

type SubGraphs

type SubGraphs map[string]*Graph

func (SubGraphs) String

func (g SubGraphs) String() string

Jump to

Keyboard shortcuts

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