Documentation ¶
Index ¶
- func AbsoluteFromSVG(svg string, output OutputFunc) error
- func PythagoreanDistance(from, to dijkstra.Point) int64
- type Arc
- type Arcs
- type Config
- type ConfigEdge
- type ConfigEdges
- type ConfigNode
- type ConfigNodes
- type ConfigPath
- type ConfigStyles
- type CreateFinder
- type Diagram
- type Layout
- func (l *Layout) Draw(canvas LayoutDrawer, spacing int)
- func (l *Layout) FindPath(from, to string) (*LayoutPath, error)
- func (l *Layout) InsideAny(x, y int) bool
- func (l *Layout) IsAnyPort(x, y int) bool
- func (l *Layout) LayoutHeight() int
- func (l *Layout) LayoutWidth() int
- func (l *Layout) ShowGrid(canvas LayoutDrawer, spacing int)
- type LayoutArrangementFunc
- type LayoutDrawer
- type LayoutNode
- type LayoutNodes
- type LayoutPath
- type LayoutPaths
- type OutputFunc
- type PathFinder
- type PathStrategy
- type Point
- type Points
- type Position
- type VertexMap
- func (v *VertexMap) CountAvailable(available bool) int
- func (v *VertexMap) Get(x, y int) bool
- func (vm VertexMap) GetArcs() Arcs
- func (v VertexMap) GetVertexPoints() Points
- func (v *VertexMap) Map(m VertexStateMapper)
- func (v *VertexMap) MapAnd(m VertexMapper)
- func (v *VertexMap) MapOr(m VertexMapper)
- func (v *VertexMap) MapSet(m VertexMapper)
- func (v *VertexMap) MapUnset(m VertexMapper)
- func (v *VertexMap) Set(x, y int, val bool)
- func (v VertexMap) String() string
- type VertexMapper
- type VertexStateMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteFromSVG ¶ added in v0.0.12
func AbsoluteFromSVG(svg string, output OutputFunc) error
AbsuluteFromSVG parses a string of an SVG and turns it in to a Layli configuration with with absulute layout that can represent the same SVG
func PythagoreanDistance ¶ added in v0.0.2
Types ¶
type Config ¶ added in v0.0.1
type Config struct { Layout string `yaml:"layout,omitempty"` LayoutAttempts int `yaml:"layout-attempts,omitempty"` Path ConfigPath `yaml:"path,omitempty"` Nodes ConfigNodes `yaml:"nodes"` Edges ConfigEdges `yaml:"edges"` Spacing int `yaml:"-"` NodeWidth int `yaml:"width"` NodeHeight int `yaml:"height"` Border int `yaml:"border"` Margin int `yaml:"margin"` Styles ConfigStyles `yaml:"styles,omitempty"` }
type ConfigEdge ¶ added in v0.0.1
type ConfigEdges ¶ added in v0.0.1
type ConfigEdges []ConfigEdge
type ConfigNode ¶ added in v0.0.1
type ConfigNodes ¶ added in v0.0.1
type ConfigNodes []ConfigNode
func (ConfigNodes) ByID ¶ added in v0.0.4
func (nodes ConfigNodes) ByID(id string) *ConfigNode
type ConfigPath ¶ added in v0.0.6
type ConfigStyles ¶ added in v0.0.10
type CreateFinder ¶ added in v0.0.2
type CreateFinder func(start, end dijkstra.Point) PathFinder
type Diagram ¶ added in v0.0.1
type Diagram struct { Output OutputFunc Config Config Layout *Layout ShowGrid bool }
type Layout ¶ added in v0.0.1
type Layout struct { Nodes LayoutNodes Paths LayoutPaths CreateFinder CreateFinder // contains filtered or unexported fields }
func NewLayoutFromConfig ¶ added in v0.0.1
func NewLayoutFromConfig(finder CreateFinder, c *Config) (*Layout, error)
func (*Layout) Draw ¶ added in v0.0.1
func (l *Layout) Draw(canvas LayoutDrawer, spacing int)
func (*Layout) FindPath ¶ added in v0.0.6
func (l *Layout) FindPath(from, to string) (*LayoutPath, error)
func (*Layout) LayoutHeight ¶ added in v0.0.1
LayoutHeight is the height in path units
func (*Layout) LayoutWidth ¶ added in v0.0.1
LayoutWidth is the width in path units
func (*Layout) ShowGrid ¶ added in v0.0.1
func (l *Layout) ShowGrid(canvas LayoutDrawer, spacing int)
type LayoutArrangementFunc ¶ added in v0.0.4
type LayoutArrangementFunc func(c *Config) (LayoutNodes, error)
LayoutArrangementFunc returns a slice of nodes arranged according to the algorithm implemented
type LayoutDrawer ¶ added in v0.0.1
type LayoutNode ¶ added in v0.0.1
func NewLayoutNode ¶ added in v0.0.1
func NewLayoutNode(id, contents string, left, top, width, height int, class, style string) LayoutNode
func (*LayoutNode) Draw ¶ added in v0.0.1
func (n *LayoutNode) Draw(d LayoutDrawer, spacing, order int)
func (*LayoutNode) GetCentre ¶ added in v0.0.1
func (n *LayoutNode) GetCentre() Point
func (*LayoutNode) GetPorts ¶ added in v0.0.1
func (n *LayoutNode) GetPorts() Points
func (*LayoutNode) IsInside ¶ added in v0.0.1
func (n *LayoutNode) IsInside(x, y int) bool
func (*LayoutNode) IsPort ¶ added in v0.0.1
func (n *LayoutNode) IsPort(x, y int) bool
type LayoutNodes ¶ added in v0.0.1
type LayoutNodes []LayoutNode
func LayoutAbsolute ¶ added in v0.0.8
func LayoutAbsolute(c *Config) (LayoutNodes, error)
func LayoutFlowSquare ¶ added in v0.0.4
func LayoutFlowSquare(c *Config) (LayoutNodes, error)
func LayoutRandomShortestSquare ¶ added in v0.0.7
func LayoutRandomShortestSquare(config *Config) (LayoutNodes, error)
func LayoutTarjan ¶ added in v0.0.4
func LayoutTarjan(config *Config) (LayoutNodes, error)
LayoutTarjan arranges nodes in multiple rows according to Tarhan's algorithm
func LayoutTopologicalSort ¶ added in v0.0.4
func LayoutTopologicalSort(config *Config) (LayoutNodes, error)
LayoutTopologicalSort arranges nodes in a single row, sorted in topological order
func (LayoutNodes) ByID ¶ added in v0.0.1
func (nodes LayoutNodes) ByID(id string) *LayoutNode
func (LayoutNodes) ConnectionDistances ¶ added in v0.0.7
func (n LayoutNodes) ConnectionDistances(connections ConfigEdges) (float64, error)
func (LayoutNodes) String ¶ added in v0.0.7
func (nodes LayoutNodes) String() string
type LayoutPath ¶ added in v0.0.1
func (*LayoutPath) Draw ¶ added in v0.0.1
func (p *LayoutPath) Draw(canvas LayoutDrawer, spacing, order int)
func (*LayoutPath) Length ¶ added in v0.0.6
func (paths *LayoutPath) Length() float64
type LayoutPaths ¶ added in v0.0.1
type LayoutPaths []LayoutPath
func (*LayoutPaths) Draw ¶ added in v0.0.1
func (paths *LayoutPaths) Draw(canvas LayoutDrawer, spacing int)
func (LayoutPaths) Length ¶ added in v0.0.6
func (paths LayoutPaths) Length() float64
type OutputFunc ¶ added in v0.0.1
type PathFinder ¶ added in v0.0.2
type PathStrategy ¶ added in v0.0.6
type PathStrategy func(config Config, paths *LayoutPaths, find func(from, to string) (*LayoutPath, error)) error
type Point ¶ added in v0.0.1
func (Point) Coordinates ¶ added in v0.0.2
type VertexMap ¶ added in v0.0.1
type VertexMap struct {
// contains filtered or unexported fields
}
func BuildVertexMap ¶ added in v0.0.1
func NewVertexMap ¶ added in v0.0.1
func (*VertexMap) CountAvailable ¶ added in v0.0.1
func (VertexMap) GetVertexPoints ¶ added in v0.0.1
func (*VertexMap) Map ¶ added in v0.0.2
func (v *VertexMap) Map(m VertexStateMapper)
func (*VertexMap) MapAnd ¶ added in v0.0.1
func (v *VertexMap) MapAnd(m VertexMapper)
func (*VertexMap) MapOr ¶ added in v0.0.1
func (v *VertexMap) MapOr(m VertexMapper)
func (*VertexMap) MapSet ¶ added in v0.0.1
func (v *VertexMap) MapSet(m VertexMapper)
func (*VertexMap) MapUnset ¶ added in v0.0.1
func (v *VertexMap) MapUnset(m VertexMapper)
type VertexMapper ¶ added in v0.0.1
type VertexStateMapper ¶ added in v0.0.2
Source Files ¶
Click to show internal directories.
Click to hide internal directories.