// Package proximity discovers layout relationships between nearby nodes.
package proximity import ( ) // AddHubs discovers nodes that have both a leaf spoke and another connection // within the same containing layout group. func ( context.Context, *layoutgraph.Graph) error { if := layoutgraph.Validate(, "AddHubs", ); != nil { return } , := limits.NewWorkGuard(, "AddHubs", limits.MaxEngineWorkUnits) if != nil { return } := make(map[*layoutgraph.Node][]*layoutgraph.Node) for , := range .Nodes { if := .Step(); != nil { return } := false var []*layoutgraph.Node for , := range .Edges { if := .Step(); != nil { return } := .Adjacent() if .OwningContainer() != .OwningContainer() { continue } if len(.Edges) == 1 { = append(, ) } else { = true } } if && len() > 0 { [] = } } if := .Finish(); != nil { return } .Hubs = return nil }