I was trying to find similar issues in the forum, but none of the suggested solutions worked. The problem I have is, when expanding the group, I want it’s subgraph to appear in the front of all other nodes, which can be done easily by setting any included child layerName to be Foreground, but the incoming or outgoing links then appear behind it, which is not right in my case.
What I did is added a new layer ExpandedGroups, which is behind the Foreground:
And whenever we expand the subgraph I move related parts into appropriate layers - incoming and outgoing links into Foreground, group with it’s contents into ExpandedGroups. Links, which were temporary moved to the Foreground layer does not appear on top of the expanded group… I’ve also tried zOrder, but that didn’t worked.
The event listener which I’ve attached to the group:
I think you want to call Group | GoJS API instead of only looking at the links directly connected with the group or that are members of the group. A link connecting a member node with a node that is not a member, is not a member of the group.
That would only actually give me an iterator with combination of group.findLinksOutOf() and group.findLinksInto(). However, this does not solve the problem, neither a new version (tried it just now).
Does this demonstrate what you want? The details of the templates do not matter for this discussion, of course – just the behavior when the part is selected or deselected. Note that it does not depend on an additional Layer, although you are welcome to use one if you like.