Hi,
I have nested groups use case.
In the attached picture, node # 12 in Group D2 is connected to node #1 in group B.
How can tell gojs to avoids the in between nodes and bypass node #11, group D1 and node #2 ?
I set the avoidNodes routing value in the link template but it bypasses only group C.
Regards,
Tany
Maybe set Group.avoidable to false? Node | GoJS API
Added to group template, got worse…
If added to node template only, almost the same.
If added to both, same…
I don’t know which route you wanted, but I hope you understand that any route connecting nested nodes is going to have to cross over the group that the node is a member of, directly and indirectly.
I haven’t had the chance to try this, but you could try setting it to false only on nested groups. In your Group template something like:
new go.Binding("avoidable", "group", function(cg) { return !!cg; }),
where "group"
is the data property referring to the containing group’s key. Leave the default value of Group.avoidable to true.
Of course that will mean that the route won’t try to avoid nested groups outside of its own group. I think it’s not smart enough to be able to figure out which groups to avoid and which ones to ignore.
Tried the code you sent. Didn’t help.
I do believe that the link should avoid group nodes or simple nodes that are not part of the route, for example, i expect that the link should skip group D2 that has no member nodes which are connected to the link or any other nodes in group D1.
There may not be a good solution at this time. It’s something we can investigate for a future improvement.
OK,
Thanks