title: Potential issue with move for Compound Graph [cytoscape.js]?
body: <p>I've been experimenting Compound Graph editor based on Cytoscape.js.</p>
  <p>I created a function for adding a compound node for a set of selected nodes with the same parent.</p>
  <p>Roughly, it is first tested if the selected nodes have the same parent. If the case, a new node is create, as a child of the parent, and all the selected nodes are moved to this new node.</p>
  <p>It seems to work well.</p>
  <p>E.g. I created a set of nodes, and grouped them with two levels of decomposition the following way.</p>
  <p><a href="https://i.stack.imgur.com/gigHO.png" rel="nofollow noreferrer">A hierarchy of compound nodes created with the created functions</a></p>
  <p>However, when trying to apply the function on a set of nodes at layer 2 as illustrated in the next figure:
  <a href="https://i.stack.imgur.com/HNSxQ.png" rel="nofollow noreferrer">Initiating grouping for a set of nodes layer 2</a></p>
  <p>The result is quite surprising, as illustrated in the next figure. The hierarchy of compound nodes is fully changed, while applying exactly the same algorithm than previously.
  <a href="https://i.stack.imgur.com/9YrpC.png" rel="nofollow noreferrer">result of using the function</a></p>
  <p>So I'm wondering if somebody already faced this, and if any idea concerning the reason of this behavior.</p>
  <p>In order to debug, I tried to identify the place where the move function is defined in the code (but I didn't succeed yet) in order to put a breakpoint on the call to the move function and to identify which part of the code could cause the unexpected change of parents.</p>
  <p>So if someone know where I can find this piece of code, it will also be helpful for understanding where the issue is coming from.</p>