title: How to separate nodes by color and shape using Cola through Cytoscape.js
body: <p>I have a system of large biological networks that have a mix of directed and undirected edges. Within these networks we have three key node shapes: triangle, ellipse, and rectangle. The nodes are either gray or colored. <strong>I am trying to see if, with cytoscape-cola, I am able to separate the shapes out quickly and consistently, regardless of graph size, such that triangles are at the top of the graph and that rectangles are at the bottom, with ellipses in between.</strong> Ideally, I would like to also be able to separate them by color, as shown by this <a href="https://i.stack.imgur.com/14EFA.png" rel="nofollow noreferrer">example</a></p>
  
  <p>Thus far, I have had limited success. I have tried adding in source and sink nodes that connect to all of the triangles and rectangles, respectively, then apply a flow. This however, does not work as the graph seems to be overconstrained. I can directly align each node, but this is slow and ineffective for a general solution. I have also tried compound nodes, which gets me closer, but it is difficult to set the location of the compound node as it relies upon the location of its children, which brings me back to step one. Finally, I have had the best luck with applying cola to subgraphs, however, it requires me to calculate the location of bounding boxes for every subgraph, which becomes more difficult with increasing colors.</p>
  
  <p>Any assistance will be greatly appreciated.</p>