Documentation ¶
Index ¶
- type Connector
- type Diagram
- 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
- type Edge
- type EdgeOption
- type EdgeOptions
- type Font
- type 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
- type GroupOptions
- type Node
- type NodeOption
- 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
- type Option
- 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
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { Connect(start, end *Node, opts ...EdgeOption) Connector ConnectByID(start, end string, opts ...EdgeOption) Connector }
type Diagram ¶
type Diagram struct {
// contains filtered or unexported fields
}
func (*Diagram) ConnectByID ¶
func (d *Diagram) ConnectByID(start, end string, opts ...EdgeOption) *Diagram
type DiagramDirection ¶
type DiagramDirection string
const ( TopToBottom DiagramDirection = "TB" BottomToTop DiagramDirection = "BT" LeftToRight DiagramDirection = "LR" RightToLeft DiagramDirection = "RL" )
func Directions ¶
func Directions() []DiagramDirection
type Edge ¶
type Edge struct { Options EdgeOptions // contains filtered or unexported fields }
func NewEdge ¶
func NewEdge(start, end string, opts ...EdgeOption) *Edge
type EdgeOption ¶
type EdgeOption func(*EdgeOptions)
func Bidirectional ¶
func Bidirectional() EdgeOption
func Forward ¶
func Forward() EdgeOption
func Reverse ¶
func Reverse() EdgeOption
type EdgeOptions ¶
type EdgeOptions struct { Label string Color string Forward bool Reverse bool Font Font Style string Attributes map[string]string }
func DefaultEdgeOptions ¶
func DefaultEdgeOptions(opts ...EdgeOption) EdgeOptions
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(name string, opts ...GroupOption) *Group
func (*Group) BackgroundColor ¶
func (*Group) ConnectAllFrom ¶
func (g *Group) ConnectAllFrom(start string, opts ...EdgeOption) *Group
func (*Group) ConnectAllTo ¶
func (g *Group) ConnectAllTo(end string, opts ...EdgeOption) *Group
func (*Group) ConnectByID ¶
func (g *Group) ConnectByID(start, end string, opts ...EdgeOption) *Group
type GroupOption ¶
type GroupOption func(*GroupOptions)
func BackgroundColor ¶
func BackgroundColor(c string) GroupOption
func GroupLabel ¶
func GroupLabel(l string) GroupOption
func IndexedBackground ¶
func IndexedBackground(idx int) GroupOption
type GroupOptions ¶
type GroupOptions struct { Label string LabelJustify string Direction string PenColor string BackgroundColor string Shape string Style string Font Font Attributes map[string]string }
func DefaultGroupOptions ¶
func DefaultGroupOptions(opts ...GroupOption) GroupOptions
type Node ¶
type Node struct { Options NodeOptions // contains filtered or unexported fields }
func NewNode ¶
func NewNode(opts ...NodeOption) *Node
type NodeOption ¶
type NodeOption func(*NodeOptions)
func FixedSize ¶
func FixedSize(b bool) NodeOption
func Height ¶
func Height(h float64) NodeOption
func Icon ¶
func Icon(i string) NodeOption
func ImageScale ¶
func ImageScale(b bool) NodeOption
func LabelLocation ¶
func LabelLocation(l string) NodeOption
func Name ¶
func Name(n string) NodeOption
func NodeLabel ¶
func NodeLabel(l string) NodeOption
func NodeShape ¶
func NodeShape(s string) NodeOption
func NodeStyle ¶
func NodeStyle(s string) NodeOption
func Provider ¶
func Provider(p string) NodeOption
func SetFontOptions ¶
func SetFontOptions(f Font) NodeOption
func Width ¶
func Width(w float64) NodeOption
type NodeOptions ¶
type NodeOptions struct { Name string Label string Provider string Image string ImageScale bool Shape string Style string FixedSize bool Width float64 Height float64 LabelLocation string Font Font Attributes map[string]string }
func DefaultNodeOptions ¶
func DefaultNodeOptions(opts ...NodeOption) NodeOptions
type Option ¶
type Option func(*Options)
func LabelJustify ¶
func WithAttribute ¶
func WithAttributes ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.