Source File
herding.go
Belonging Package
github.com/pancsta/d2/d2layouts/d2talalayout/internal/layoutgraph
package layoutgraphimport ()// HerdAssignment records the side of a container toward which a node should// be placed, together with the uncles paired on the same and opposite sides.// The proximity package owns the algorithms that produce and synchronize// these assignments.type HerdAssignment struct {// The whole point of herding to one side is so another herd can pair on the// opposite side. Keep unique counts of connected uncles on each side.oppositeSidePaired map[*Node]struct{}sameSidePaired map[*Node]struct{}// Orientation is the side to herd to: TOP, LEFT, BOTTOM, or RIGHT.Orientation geo.Orientation// Val is the y-axis coordinate for TOP/BOTTOM and the x-axis coordinate for// LEFT/RIGHT.Val float64}func () *HerdAssignment {return &HerdAssignment{oppositeSidePaired: make(map[*Node]struct{}),sameSidePaired: make(map[*Node]struct{}),}}func ( *HerdAssignment) () *HerdAssignment {return &HerdAssignment{oppositeSidePaired: maps.Clone(.oppositeSidePaired),sameSidePaired: maps.Clone(.sameSidePaired),Orientation: .Orientation,Val: .Val,}}
![]() |
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. |