We’re trying to support multiple policies for layouts. One policy involves adding all nodes that exist (even in SubGraphs) to a global layout, except for nodes that are in collapsed SubGraphs. If a SubGraph is collapsed, it participates in the layout as a node. So, if I have 10 nodes not in a SG, 5 nodes in SG-A and 2 in SG-B, and SG-B is collapsed, then SG-B will join all other 15 nodes in a global layout.
This seemed really easy for me to do, but we also need to filter out certain types of links from the layout altogether. I built a recursive algorithm that enters collections if they’re expanded, and adds nodes and links to the global layout.
public static IGoLayoutNetwork LayoutFilter(GoDocument doc, IGoLayoutNetwork net)
But this isn’t working as expected; it seems when the subgraphs are collapsed the links are still being drawn to where they would be if the subgraph is expanded.
This approach works perfectly if I force expand all subgraphs. Unfortunately, we need to support this other layout policy. I’m worried that I don’t completely understand how layouts work. Any ideas?