package hierarchy
Import Path
github.com/pancsta/d2/d2layouts/d2talalayout/internal/hierarchy (on go.dev)
Dependency Relation
imports 14 packages, and imported by 2 packages
Involved Source Files
brandes_kopf.go
compound.go
crossing.go
discovery.go
Package hierarchy discovers DAG-like subgraphs, ranks their nodes, and
places them in layers.
eligibility.go
orientation.go
placement.go
rank.go
rank_graph.go
rank_queue.go
rank_simplex.go
sifting.go
Package-Level Functions (total 6)
AssignNodeHierarchy identifies hierarchical structures within the subgraphs of this graph
Candidates identifies the graph nodes that may participate in hierarchy
discovery. Existing hierarchy membership is derived state and deliberately
does not disqualify a node, so repeated layouts can reconsider topology and
edge-direction changes.
IsHorizontal reports the orientation shared by hierarchy placement and
hierarchy-aware routing. Entity-relationship diagrams use horizontal
hierarchy placement regardless of the container direction.
func Place(ctx context.Context, g *layoutgraph.Graph, root *layoutgraph.Node, randGenerator *rand.Rand) (err error)
PlaceCompound lays out the outer flow of detailed containers after their
interiors have been placed and rescaled, but before edge routing. It preserves
every interior coordinate relative to its container, including local directions
and specialized inner layouts. The caller compares this complete candidate
against ordinary placement; this stage is not an unconditional improvement.
RemoveIsolatedMemberships removes leaf nodes that inherited a container's
hierarchy but have no edges of their own. They remain ordinary routing
obstacles after hierarchy placement.
![]() |
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. |