Documentation ¶
Overview ¶
Package layout implements different graph layouting functions
Index ¶
- Constants
- func Hierarchical(graphdef *Graph)
- type Color
- type Edge
- type Graph
- type HSL
- type HSLA
- type Length
- type Node
- func (node *Node) Bottom() Length
- func (node *Node) BottomCenter() Vector
- func (node *Node) BottomRight() Vector
- func (node *Node) DefaultLabel() string
- func (node *Node) Left() Length
- func (node *Node) Right() Length
- func (node *Node) String() string
- func (node *Node) Top() Length
- func (node *Node) TopCenter() Vector
- func (node *Node) TopLeft() Vector
- type RGB
- type RGBA
- type Shape
- type Vector
Constants ¶
View Source
const ( Auto Shape = "" None = "none" Box = "box" Square = "square" Circle = "circle" Ellipse = "ellipse" )
View Source
const ( Point = 1 Inch = 72 Twip = Inch / 1440 Meter = 39.3701 * Inch Centimeter = Meter * 0.01 Millimeter = Meter * 0.001 )
Variables ¶
This section is empty.
Functions ¶
func Hierarchical ¶
func Hierarchical(graphdef *Graph)
Types ¶
type Color ¶
type Color interface { // RGBA returns the non-alpha-premultiplied red, green, blue and alpha values // for the color. Each value ranges within [0, 0xff]. RGBA8() (r, g, b, a uint8) }
func ColorByName ¶
ColorByName returns RGB color based on X11 scheme
type Edge ¶
type Graph ¶
type Graph struct { ID string Directed bool // Defaults LineHeight Length FontSize Length Shape Shape NodePadding Length RowPadding Length EdgePadding Length NodeByID map[string]*Node Nodes []*Node Edges []*Edge }
func NewDigraph ¶
func NewDigraph() *Graph
func (*Graph) AddNode ¶
AddNode adds a new node.
When a node with the specified id already it will return false and the node is not added.
func (*Graph) AssignMissingValues ¶
func (graph *Graph) AssignMissingValues()
type HSL ¶
type HSL struct{ H, S, L float32 }
HSL represents an color in hue, saturation and lightness space
type HSLA ¶
type HSLA struct{ H, S, L, A float32 }
HSLA represents an color in hue, saturation and lightness space
type Node ¶
type Node struct { ID string Label string Weight float64 Tooltip string FontName string FontSize Length FontColor Color LineWidth Length LineColor Color Shape Shape FillColor Color Radius Vector // computed in layouting Center Vector }
func (*Node) BottomCenter ¶
func (*Node) BottomRight ¶
func (*Node) DefaultLabel ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.