package orthogonal
Import Path
github.com/d2lang/elk-go/internal/layered/p5edges/orthogonal (on go.dev)
Dependency Relation
imports 6 packages, and imported by 3 packages
Involved Source Files
cycle_detector.go
dependency.go
direction.go
generator.go
segment.go
splitter.go
Package-Level Type Names (total 5)
DependencyType is ELK 0.8.1's HyperEdgeSegmentDependency.DependencyType.
const CriticalDependency
const RegularDependency
Generator is ELK 0.8.1's direction-independent orthogonal routing
generator. One instance is reused for every adjacent layer pair in phase 5.
CreateDependencyIfNecessary ports the conflict and crossing comparison used
both during graph construction and after a critical segment split.
RouteEdges routes the connected components formed by output ports on the
selected sides of two adjacent layers. A nil node slice represents a graph
boundary, just like a null Java iterable.
func NewGenerator(direction RoutingDirection, edgeSpacing float64) *Generator
HyperEdgeSegment is the trunk of an ELK orthogonal hyperedge. Coordinate
lists are kept sorted and duplicate-free exactly as in ELK 0.8.1.
CriticalInWeight int
CriticalOutWeight int
End float64
InWeight int
IncomingCoordinates []float64
IncomingDependencies []*HyperEdgeSegmentDependency
Mark int
OutWeight int
OutgoingCoordinates []float64
OutgoingDependencies []*HyperEdgeSegmentDependency
Ports []layered.LPortID
RoutingSlot int
SplitBy *HyperEdgeSegment
SplitPartner *HyperEdgeSegment
Start float64
(*HyperEdgeSegment) IsDummy() bool
(*HyperEdgeSegment) Length() float64
(*HyperEdgeSegment) RecomputeExtent()
(*HyperEdgeSegment) RepresentsHyperedge() bool
func NewBareSegment() *HyperEdgeSegment
func NewTestSegment(incoming, outgoing []float64) *HyperEdgeSegment
func AddCriticalDependency(source, target *HyperEdgeSegment) *HyperEdgeSegmentDependency
func AddRegularDependency(source, target *HyperEdgeSegment, weight int) *HyperEdgeSegmentDependency
func BreakNonCriticalCycles(segments []*HyperEdgeSegment, random *javacompat.Random)
func DetectCycles(segments []*HyperEdgeSegment, criticalOnly bool, random *javacompat.Random) []*HyperEdgeSegmentDependency
func TopologicalNumbering(segments []*HyperEdgeSegment)
func (*Generator).CreateDependencyIfNecessary(first, second *HyperEdgeSegment) int
HyperEdgeSegmentDependency says that Source wants a lower routing slot than
Target. Critical dependencies prevent overlaps; regular dependencies carry
the crossing/conflict cost of ignoring them.
Source *HyperEdgeSegment
Target *HyperEdgeSegment
Type DependencyType
Weight int
(*HyperEdgeSegmentDependency) Remove()
(*HyperEdgeSegmentDependency) Reverse()
func AddCriticalDependency(source, target *HyperEdgeSegment) *HyperEdgeSegmentDependency
func AddRegularDependency(source, target *HyperEdgeSegment, weight int) *HyperEdgeSegmentDependency
func DetectCycles(segments []*HyperEdgeSegment, criticalOnly bool, random *javacompat.Random) []*HyperEdgeSegmentDependency
RoutingDirection is distinct from a graph direction because routing around
northern and southern external ports changes direction within one graph.
func NewGenerator(direction RoutingDirection, edgeSpacing float64) *Generator
const NorthToSouth
const SouthToNorth
const WestToEast
Package-Level Functions (total 9)
func AddCriticalDependency(source, target *HyperEdgeSegment) *HyperEdgeSegmentDependency func AddRegularDependency(source, target *HyperEdgeSegment, weight int) *HyperEdgeSegmentDependency
BreakNonCriticalCycles removes zero-weight two-cycle arcs and reverses all
other feedback arcs selected by ELK's cycle detector.
func CountCrossings(positions []float64, start, end float64) int
DetectCycles ports HyperEdgeCycleDetector.detectCycles. When criticalOnly
is false, critical arcs are still protected from reversal.
NewBareSegment is new HyperEdgeSegment(null), used by ELK's self-loop
RoutingSlotAssigner to reuse the weighted dependency cycle breaker.
func NewGenerator(direction RoutingDirection, edgeSpacing float64) *Generator
NewTestSegment creates a source-shaped segment without graph ports. It is
exported for white-box conformance tests and cycle-routing helpers.
TopologicalNumbering assigns routing slots and then pushes purely
right-pointing targets as far toward their target layer as possible.
Package-Level Constants (total 6)
const CriticalDependency DependencyType = 1 const NorthToSouth RoutingDirection = 1 const RegularDependency DependencyType = 0 const SouthToNorth RoutingDirection = 2 const Tolerance = 0.001 const WestToEast RoutingDirection = 0
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |