Curved links to collapsed group

Hello, Walter. There are one node (A) and a group with two child nodes (B, C). Two links are created between these nodes: A - B and A - C. When we collapse group we reconnect these links from nodes B, C to that group. The purpose of this is to show links curved (links to child deviced in collapsed group remain straight). Is there any better approach to get curved links?

Could you please show a small screenshot for how it is now, and another small screenshot (or mark up the original one) showing how you want it to be?

Sure.

Does something like this Group.subGraphExpandedChanged event handler help?

    myDiagram.groupTemplate =
      $(go.Group, "Auto",
        {
          subGraphExpandedChanged: function(grp) {
            var exts = grp.findExternalLinksConnected();
            var num = exts.count;
            if (num === 0) return;
            var c = -num/2 * 10;
            if (num % 2 === 1) c += 10/2;
            exts.each(function(l) {
              l.curviness = grp.isSubGraphExpanded ? NaN : c;
              c += 10;
            });
          }
        },
        $(go.Shape, "RoundedRectangle", { fill: "white" }),
        $(go.Placeholder, { padding: 10 }),
        $("SubGraphExpanderButton", { alignment: go.Spot.TopRight })
      );

The details of the group template don’t really matter.

1 Like