Source File
cluster_connections.go
Belonging Package
github.com/pancsta/d2/d2layouts/d2talalayout/internal/placement
package placementimport// clusterExternalConnectedNodes returns the positioned endpoints outside the// cluster that remain in the cluster nodes' current placement graph. The// edge-abduction order is significant: callers use the stable first-seen order// when comparing opposite-side placements.func clusterExternalConnectedNodes( *layoutgraph.Cluster) []*layoutgraph.Node {:= .Nodes[0].Graph:= make(map[*layoutgraph.Node]struct{}):= make([]*layoutgraph.Node, 0)for , := range .EdgeAbductions {switch {case .OriginallyFrom == nil && .OriginallyTo != nil:if .CurrentFrom.TopLeft != nil && .CurrentFrom.Graph == {if , := [.CurrentFrom]; ! {= append(, .CurrentFrom)[.CurrentFrom] = struct{}{}}}case .OriginallyTo == nil && .OriginallyFrom != nil:if .CurrentTo.TopLeft != nil && .CurrentTo.Graph == {if , := [.CurrentTo]; ! {= append(, .CurrentTo)[.CurrentTo] = struct{}{}}}}}return}
![]() |
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. |