Link Routing when connections come from a node inside a group to a node inside a different group

Hi there,

I’m running into an issue with the link routing. I’m currently using AvoidNodes on links; it works great on nodes that are all inside the same group and connected. It also works great on groups and nodes on the diagram level.

However, when a link originates on a node inside a group and goes to a node inside another group, the AvoidNodes routing doesn’t seem to apply and the links just blast across nodes inside the second group. Is this expected behavior?

I can share screenshots showing this behavior by email if that helps.

Thanks,

  • Tim

You could try setting Node.avoidable to false on the Group (and only on the Group):

    $(go.Group, . . .,
        { avoidable: false },
        . . .

Thanks for the quick response!

Sadly, that did not work. Any other ideas?

Well, to be specific, that DID actually fix the problem. However, now the links route on top of the groups on the diagram, so that is another problem.

I was about to refer you to this sample: Partition GoJS Sample, but now I guess I don’t have to.

For a link that connects one member node with a node that is a member of a different group, the link really has to cross over a group in order to get to each of the nodes, as long as the nodes are inside their respective container groups.

But you’re probably now asking about a different case, where links can go through a group, without crossing over any simple nodes, when not connecting to a node in the group. I’m not sure there’s a good and easy answer for you.

Yeah, it doesn’t seem trivial.

The partition sample has the same issue I’m seeing now - a collapsed group with a link routed on top of it. It’s fine if the group is expanded, as long as the links avoid nodes, but I want the links to avoid collapsed groups as well.

This is the behavior I do not want. Do you know of any way to accomplish this?

Ah, well, I’m glad that you are being specific. The answer is yes:

      $(go.Group, go.Panel.Auto,
        {
          avoidable: false,
          subGraphExpandedChanged: function(g) { g.avoidable = !g.isSubGraphExpanded; }
        },
        . . .)

That works great!

Thanks for your help, Walter!