AvoidsNodes for nodes within a subgraph


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?


In my application avoid nodes within subgraph is not working.
The difference is that in my appliation, I am adding links between
nodes to an instance of custom GoSubgraphBase derived class
and not to the document. Is this causing the observed behavior.
However I observed that If I add nodes directly to a document
instead of a subgraph "avoidnodes" is working very fine.


"Avoidsnodes" within Subgraph feature is very important for us. Please let us know if this is not supported in current version and
which future version of GoDiagram will have this feature.
If possible, how to go about implementing this feature with the current version if this feature will not be available in near future.

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.


With AoidsNodes property set, Is it possible to prevent overlapping
of links even if they originate from same port. They can intersect
but should not overlap. All the links should remain distinct.

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.


Could you tell me do you have plans to support the following as part of avoid nodes.
"There is some routing code that offsets links (depending on the type of port / link etc) but it isn't part of AvoidsNodes support."
Which version and by when this will be available?

No, we don’t have any plans to make any changes in link routing.