Documentation
¶
Index ¶
- Constants
- func DefaultPalette() []int32
- func FontTypefaceToString(tf FontTypeface) string
- func FontWeightToString(w FontWeight) string
- type EdgeDef
- type EdgeOptions
- type FontOptions
- type FontTypeface
- type FontWeight
- type HierarchyType
- type LayerMx
- type LayerMxPermIterator
- type LayerPermutator
- func (lp *LayerPermutator) InsertIterator(insertSrcStart int, insertSrcLen int, in []int16, f func(int, []int16))
- func (lp *LayerPermutator) SwapAndInsertIterator(intervalStarts []int, intervalLengths []int, totalIntervals int, ...)
- func (lp *LayerPermutator) SwapIterator(intervalStarts []int, intervalLengths []int, totalIntervals int, in []int16, ...)
- type NodeDef
- type RectDimension
- type VizEdge
- type VizNode
- type VizNodeHierarchy
- func (vnh *VizNodeHierarchy) CalculateTotalHorizontalShift() float64
- func (vnh *VizNodeHierarchy) PopulateEdgeLabelCoords()
- func (vnh *VizNodeHierarchy) PopulateEdgeLabelDimensions()
- func (vnh *VizNodeHierarchy) PopulateNodeTotalWidth()
- func (vnh *VizNodeHierarchy) PopulateNodesXCoords()
- func (vnh *VizNodeHierarchy) PopulateNodesYCoords()
- func (vnh *VizNodeHierarchy) PopulateUpperLayerGapMap(edgeFontSizeInPixels float64)
- func (vnh *VizNodeHierarchy) RemoveDuplicateSecEdgeLabels()
- func (vnh *VizNodeHierarchy) String() string
Constants ¶
View Source
const ( SecEdgeLabelGapFromSourceInLines float64 = 5.0 PriEdgeLabelGapFromDestinatioInLines float64 = 2.0 NodeHorizontalGapInPixels float64 = 20.0 SecEdgeOffsetX float64 = 10 )
View Source
const CapillariesIcons100x100 = `` /* 18873-byte string literal not displayed */
View Source
const FakeNodeBase int16 = 10000
View Source
const FallbackAsciiCode int = 88 // 'X'
View Source
const LabelTextDimensionMargin float64 = 0.5
View Source
const MaxAllowedLayerPermutations int64 = 100000000
View Source
const MaxIntervalsInLayer int = 20 // Max parent nodes containing more than one child on this layer
View Source
const MaxLayerLen int = 200
View Source
const MaxNodesToInsert int = 10 // Cannot insert more than this amt of new roots at a layer
View Source
const MaxSupportedFact int = 6 // Max amount of pri children originating from a node
View Source
const MissingDistanceFromRootToNode int = -2
View Source
const MissingLayer int = -4
View Source
const MissingNodeId int16 = -1
View Source
const MissingRootSubtreeHeight int = -3
View Source
const NodeTextDimensionMargin float64 = 1.0
View Source
const NodeTextIconInterval float64 = 1.0
View Source
const SelectedNodeMargin float64 = 0.0
Variables ¶
This section is empty.
Functions ¶
func DefaultPalette ¶
func DefaultPalette() []int32
func FontTypefaceToString ¶
func FontTypefaceToString(tf FontTypeface) string
func FontWeightToString ¶
func FontWeightToString(w FontWeight) string
Types ¶
type EdgeOptions ¶
type EdgeOptions struct {
StrokeWidth float64
}
func DefaultEdgeOptions ¶
func DefaultEdgeOptions() EdgeOptions
type FontOptions ¶
type FontOptions struct {
Typeface FontTypeface
Weight FontWeight
SizeInPixels float64
Interval float64
}
func DefaultEdgeLabelFontOptions ¶
func DefaultEdgeLabelFontOptions() FontOptions
func DefaultNodeFontOptions ¶
func DefaultNodeFontOptions() FontOptions
type FontTypeface ¶
type FontTypeface int
const ( FontTypefaceArial FontTypeface = iota FontTypefaceCourier FontTypefaceVerdana )
type HierarchyType ¶
type HierarchyType int
const ( HierarchyPri HierarchyType = iota HierarchySec )
type LayerMxPermIterator ¶
type LayerMxPermIterator struct {
Lps []*LayerPermutator // We need separate permutator for each layer to preserve state when we do recursion between layers
IntervalStarts [][]int
IntervalLengths [][]int
SrcMx LayerMx
WorkMx LayerMx
PriParentMap []int16
PriChildrenMap [][]int16
NodeLayerMap []int
RootNodes []int16
}
func NewLayerMxPermIterator ¶
func NewLayerMxPermIterator(nodeDefs []NodeDef, srcMx LayerMx) (*LayerMxPermIterator, error)
func (*LayerMxPermIterator) MxIterator ¶
func (mxi *LayerMxPermIterator) MxIterator(f func(int, LayerMx))
func (*LayerMxPermIterator) MxIteratorCount ¶
func (mxi *LayerMxPermIterator) MxIteratorCount() int64
type LayerPermutator ¶
type LayerPermutator struct {
P [][][]int // Swap permutation strategy by permIdx: [interval size 2-6][permIdx 2!-6!][positions to swap with]
Fact []int
SrcPerm []int16
WorkPerm []int16
IntervalStarts []int
IntervalLengths []int
}
func NewLayerPermutator ¶
func NewLayerPermutator() *LayerPermutator
func (*LayerPermutator) InsertIterator ¶
func (*LayerPermutator) SwapAndInsertIterator ¶
func (*LayerPermutator) SwapIterator ¶
type RectDimension ¶
type VizNode ¶
type VizNode struct {
Def *NodeDef
IncomingVizEdges []VizEdge
RootId int16
Layer int
TotalW float64
X float64 // Total X
Y float64
NodeW float64
NodeH float64
PriChildrenAndEnclosedRoots []*VizNode
}
func DrawOptimized ¶
func DrawOptimized(nodeDefs []NodeDef, nodeFo FontOptions, edgeFo FontOptions, edgeOptions EdgeOptions, defsOverride string, cssOverride string, palette []int32) (string, []VizNode, int64, float64, float64, error)
func DrawUnoptimized ¶
func DrawUnoptimized(nodeDefs []NodeDef, nodeFo FontOptions, edgeFo FontOptions, edgeOptions EdgeOptions, defsOverride string, cssOverride string, palette []int32) (string, []VizNode, error)
type VizNodeHierarchy ¶
type VizNodeHierarchy struct {
VizNodeMap []VizNode
NodeDefs []NodeDef
PriParentMap []int16
RootMap []int16
NodeFo FontOptions
EdgeFo FontOptions
NodeDimensionMap []RectDimension
PriEdgeLabelDimMap []RectDimension
SecEdgeLabelDimMap [][]RectDimension
TotalLayers int
UpperLayerGapMap []float64
}
func NewVizNodeHierarchy ¶
func NewVizNodeHierarchy(nodeDefs []NodeDef, nodeFo FontOptions, edgeFo FontOptions) *VizNodeHierarchy
func (*VizNodeHierarchy) CalculateTotalHorizontalShift ¶
func (vnh *VizNodeHierarchy) CalculateTotalHorizontalShift() float64
func (*VizNodeHierarchy) PopulateEdgeLabelCoords ¶
func (vnh *VizNodeHierarchy) PopulateEdgeLabelCoords()
func (*VizNodeHierarchy) PopulateEdgeLabelDimensions ¶
func (vnh *VizNodeHierarchy) PopulateEdgeLabelDimensions()
Merely copies pre-calculated edge label dimensions to the hierarchy vizitems
func (*VizNodeHierarchy) PopulateNodeTotalWidth ¶
func (vnh *VizNodeHierarchy) PopulateNodeTotalWidth()
func (*VizNodeHierarchy) PopulateNodesXCoords ¶
func (vnh *VizNodeHierarchy) PopulateNodesXCoords()
func (*VizNodeHierarchy) PopulateNodesYCoords ¶
func (vnh *VizNodeHierarchy) PopulateNodesYCoords()
func (*VizNodeHierarchy) PopulateUpperLayerGapMap ¶
func (vnh *VizNodeHierarchy) PopulateUpperLayerGapMap(edgeFontSizeInPixels float64)
func (*VizNodeHierarchy) RemoveDuplicateSecEdgeLabels ¶
func (vnh *VizNodeHierarchy) RemoveDuplicateSecEdgeLabels()
func (*VizNodeHierarchy) String ¶
func (vnh *VizNodeHierarchy) String() string
Click to show internal directories.
Click to hide internal directories.