Versions in this module Expand all Collapse all v0 v0.0.0 Apr 20, 2024 Changes in this version + type Connector interface + Connect func(start, end *Node, opts ...EdgeOption) Connector + ConnectByID func(start, end string, opts ...EdgeOption) Connector + type Diagram struct + func New(opts ...Option) (*Diagram, error) + func (d *Diagram) Add(ns ...*Node) *Diagram + func (d *Diagram) Close() error + func (d *Diagram) Connect(start, end *Node, opts ...EdgeOption) *Diagram + func (d *Diagram) ConnectByID(start, end string, opts ...EdgeOption) *Diagram + func (d *Diagram) Edges() []*Edge + func (d *Diagram) Group(g *Group) *Diagram + func (d *Diagram) Groups() []*Group + func (d *Diagram) Nodes() []*Node + func (d *Diagram) Render() error + type DiagramDirection string + const BottomToTop + const LeftToRight + const RightToLeft + const TopToBottom + func Directions() []DiagramDirection + type Edge struct + Options EdgeOptions + func NewEdge(start, end string, opts ...EdgeOption) *Edge + func (e *Edge) End() string + func (e *Edge) ID() string + func (e *Edge) Start() string + type EdgeOption func(*EdgeOptions) + func Bidirectional() EdgeOption + func Forward() EdgeOption + func Reverse() EdgeOption + type EdgeOptions struct + Attributes map[string]string + Color string + Font Font + Forward bool + Label string + Reverse bool + Style string + func DefaultEdgeOptions(opts ...EdgeOption) EdgeOptions + type Font struct + Color string + Name string + Size float64 + type Group struct + func NewGroup(name string, opts ...GroupOption) *Group + func (g *Group) Add(nodes ...*Node) *Group + func (g *Group) BackgroundColor(c string) *Group + func (g *Group) Children() []*Group + func (g *Group) Connect(start, end *Node, opts ...EdgeOption) *Group + func (g *Group) ConnectAllFrom(start string, opts ...EdgeOption) *Group + func (g *Group) ConnectAllTo(end string, opts ...EdgeOption) *Group + func (g *Group) ConnectByID(start, end string, opts ...EdgeOption) *Group + func (g *Group) Edges() []*Edge + func (g *Group) Group(ng *Group) *Group + func (g *Group) ID() string + func (g *Group) Label(l string) *Group + func (g *Group) NewGroup(name string, opts ...GroupOption) *Group + func (g *Group) Nodes() []*Node + type GroupOption func(*GroupOptions) + func BackgroundColor(c string) GroupOption + func GroupLabel(l string) GroupOption + func IndexedBackground(idx int) GroupOption + type GroupOptions struct + Attributes map[string]string + BackgroundColor string + Direction string + Font Font + Label string + LabelJustify string + PenColor string + Shape string + Style string + func DefaultGroupOptions(opts ...GroupOption) GroupOptions + type Node struct + Options NodeOptions + func NewNode(opts ...NodeOption) *Node + func (n *Node) ID() string + func (n *Node) Label(l string) *Node + type NodeOption func(*NodeOptions) + func FixedSize(b bool) NodeOption + func Height(h float64) NodeOption + func Icon(i string) NodeOption + func ImageScale(b bool) NodeOption + func LabelLocation(l string) NodeOption + func Name(n string) NodeOption + func NodeLabel(l string) NodeOption + func NodeShape(s string) NodeOption + func NodeStyle(s string) NodeOption + func Provider(p string) NodeOption + func SetFontOptions(f Font) NodeOption + func Width(w float64) NodeOption + type NodeOptions struct + Attributes map[string]string + FixedSize bool + Font Font + Height float64 + Image string + ImageScale bool + Label string + LabelLocation string + Name string + Provider string + Shape string + Style string + Width float64 + func DefaultNodeOptions(opts ...NodeOption) NodeOptions + type Option func(*Options) + func Direction(d string) Option + func Filename(f string) Option + func Label(l string) Option + func LabelJustify(j string) Option + func PenColor(c string) Option + func Shape(s string) Option + func Style(s string) Option + func WithAttribute(name, value string) Option + func WithAttributes(attrs map[string]string) Option + type OptionSet []NodeOption + func MergeOptionSets(sets ...OptionSet) OptionSet + type Options struct + Attributes map[string]string + CurveStyle string + Direction string + FileName string + Font Font + Label string + Name string + NodeSep float64 + OutFormat string + Pad float64 + RankSep float64 + Show bool + Splines string + func DefaultOptions(opts ...Option) Options