Problems collapsing a Graph

Hi all,

While evaluating, I intend to build a GraphLinksModel with lots of nodes (about 200) which is not organized in a tree structure. Therefore, I have nodes that receive arrows from more than one node.
The graph looks very good. However, when I collapse parts of my graph, things start to get a little strange. Some links that are not children of the one being collapse disappear which leads to undesirable reorganization of the tree.

Examples of my problem (code below):

  1. Observing the following link structure:
    17 > 11
    16 > 11
    27 > 11
    If I collapse node 16, node 11 disappears even having links from 17 and 27. In this case, 27 turns to a standalone node and the Expand button shows with a “-” symbol, leaving no clue that it has a child that is collapsed.

  2. Observing the following link structure:
    15 > 5 > 9
    18 > 5 > 9

If I click on the collapse button of node 18, the link 15 > 5 is still shown (seems right to me), but node 9 disappears (seems wrong to me).

Any advice on solving this problem?

Thanks

Can you reproduce this problem in a codepen so we can take a look?