Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DGraph ¶
func (*DGraph) ConnectedComponents ¶ added in v0.10.0
type Edge ¶
type Edge struct {
// contains filtered or unexported fields
}
func (*Edge) ConnectedNode ¶
type EdgeIntMap ¶
type EdgeType ¶ added in v0.9.0
type EdgeType uint8
EdgeType encodes information about the nodes adjacent to an edge,
const ( // EdgeTypeConcrete indicates a type 0 edge whose adjacent nodes are both non-virtual. EdgeTypeConcrete EdgeType = iota // EdgeTypeHybrid indicates a type 1 edge whose adjacent nodes are one virtual and one non-virtual. EdgeTypeHybrid // EdgeTypeVirtual indicates a type 2 edge whose adjacent nodes are both virtual. EdgeTypeVirtual )
type Layer ¶
type Node ¶
type Node struct {
ID string
In, Out EdgeList
Layer int
LayerPos int
IsVirtual bool
// Size stores the dimensions of the node and its computed (x,y) coordinates.
// The point (x,y) is the top-left corner of the node, and (0,0) is the top-left corner of the drawing plane.
Size
// contains filtered or unexported fields
}
func (*Node) VisitEdges ¶
type NodeFloatMap ¶
type NodeIntMap ¶
type OptionNsBalance ¶
type OptionNsBalance uint8
OptionNsBalance controls which balancing strategy to use in the network simplex layerer.
const ( // OptionNsBalanceV represents vertical balancing in network simplex solver. Default value used in phase 2. OptionNsBalanceV OptionNsBalance = iota + 1 // OptionNsBalanceH represents horizontal balancing in network simplex solver. Used in phase 4 NetworkSimplex positioner. OptionNsBalanceH )
type Params ¶
type Params struct {
// Sets the same width and height to all non-virtual nodes
NodeFixedSizeFunc func(n *Node)
// Sets a width and height to individual non-virtual nodes
NodeSizeFunc func(n *Node)
// Controls whether the next maximum outflow node in the greedy cycle breaker is picked at random.
// When this option is true, the greedy cycle breaker behaves non-deterministically.
GreedyCycleBreakerRandomNodeChoice bool
// Factor used in to determine the maximum number of iterations.
NetworkSimplexThoroughness uint
// If positive, factor by which thoroughness is multiplied to determine the maximum number of iterations.
// Otherwise, ignored.
NetworkSimplexMaxIterFactor int
// Controls which balancing strategy to use in the network simplex layering by moving nodes to less crowded layers.
NetworkSimplexBalance OptionNsBalance
// Size of virtual nodes (NxN). Defaults to zero, i.e. virtual nodes are treated as points.
VirtualNodeFixedSize float64
// Maximum number of iterations of the WMedian orderer.
WMedianMaxIter uint
// Spacing between layers (above and below).
LayerSpacing float64
// Spacing between nodes (left and right).
NodeSpacing float64
// Weight factor for edges in the network simplex positioner.
NetworkSimplexAuxiliaryGraphWeightFactor int
// Allows choosing one of the four B&K layouts. The accepted values are: 0: bottom-right, 1: bottom-left, 2: top-right, 3: top-left.
// The directions refer to the direction in which the algorithm sweeps layers and nodes. Different directions
// result in different aligmnent priorities, and therefore in different positioning.
// In case the inequality 0 <= v < 4 doesn't hold, the default balanced layout is used instead.
BrandesKoepfLayout int
}
Params holds parameters and options that are used by the layout algorithms and don't strictly belong to the graph itself
Click to show internal directories.
Click to hide internal directories.