I have a GoSubGraph containing nodes with ports.
User can connect between nodes within as well as
across subgraphs. Here I would like to use
AvoidsNodes property for links. I learnt this
works only at document level. Could you please
suggest on how to extend this for nodes
within the subgraph.
I’m sitting here playing with SubGraphApp, which I’ve switched to using Orthogonal links temporarily… and AvoidsNodes actually does work. Any link that is being re-calculated during a drag will honor the AvoidsNodes for any nodes it sees (inside or outside the SubGraphs).
If you have two nodes 0---->1 inside a subgraph, and you drag the subgraph, the link between 0 and 1 won’t AvoidsNodes, but any links connect to 0 or 1 outside the subgraph will.
and for any subgraph with 0---->1 nodes with an extra 2 node inside the subgraph will route around 2 when you drag either 0 or 1.
Is that consistent with what you’re seeing?
As Jake has suggested, I think what you want is the default behavior.
Basically, the routing of Orthogonal links that have AvoidsNodes set to true is to pretend all GoSubGraphBase nodes don’t exist, but that their “atomic” child nodes do exist.
Do you have an override of GoDocument.IsAvoidable or GetAvoidableRectangle? That would be how to change the behavior with respect to “avoidable” objects.
AvoidsNodes has links “avoid nodes”, but not links. There is some routing code that offsets links (depending on the type of port / link etc) but it isn’t part of AvoidsNodes support.
the best link routing is probably in LayeredDigraph layout.
No, we don’t have any plans to make any changes in link routing.