package placement
Import Path
github.com/pancsta/d2/d2layouts/d2talalayout/internal/placement (on go.dev)
Dependency Relation
imports 21 packages, and imported by one package
Involved Source Files
alignment.go
axis.go
candidate_movement.go
cluster_connections.go
cluster_optimization.go
compaction.go
container_orientation.go
dejitter.go
direct.go
edge_abduction_scratch.go
equidistance.go
gapreduction.go
initialize.go
metrics.go
moves.go
node_placement.go
optimization_guard.go
optimizer_spatial_index.go
sized_optimizer.go
sizeless_optimizer.go
stages.go
stress_initialize.go
swap.go
symmetry.go
transpose.go
tuning.go
Package placement positions nodes and refines their geometry before routing.
Package-Level Functions (total 14)
BalanceSymmetry centers simple nodes among neighbors aligned on one side.
dejitter performs micro-movements on nodes to remove the jittery connections that can be straightened out with slight adjustments in one direction
E.g. jittery line:
. +--------->
. +-----------+
Equidistance centers nodes between aligned neighbors.
A ---------------- B ------ C
Move B to the midpoint of A and C.
func Normalize(graph *layoutgraph.Graph) func NormalizeGaps(ctx context.Context, graph *layoutgraph.Graph) (bool, error)
make clusters horizontal if cluster connections are above or below cluster
func Pad(graph *layoutgraph.Graph) func PlaceChildrenOrder(ctx context.Context, nodes []*layoutgraph.Node, edgeAbductions []*layoutgraph.EdgeAbduction) ([]*layoutgraph.Node, error) func Prepare(graph *layoutgraph.Graph) func Prescale(graph *layoutgraph.Graph) func TransposeAll(ctx context.Context, graph *layoutgraph.Graph) error
![]() |
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. |