0

I have 3 compound(parent) nodes. In every compound node there are 3 child nodes. I want the layout to be exactly like this:

COMPOUND1     COMPOUND2     COMPOUND3
node1.type1   node4.type2   node4.type3
node2.type1   node4.type2   node4.type3  
node3.type1   node4.type2   node4.type3

so I want to have 3 compound nodes in one row and in each of them one column of nodes each on top of each other. There are edges between different child nodes but I guess this is irrelevant.

paul_n
  • 191
  • 1
  • 6

1 Answers1

0

Use the grid layout: http://js.cytoscape.org/#layouts/grid

Specify the columns for the child nodes. If you don't set rows, the rows will be automatic.

Compound parents are always automatically positioned for you.

maxkfranz
  • 11,896
  • 1
  • 27
  • 36
  • hello @maxkfranz, thanks for reply, I've tried this but there is a strange behavior: when you put different number of child nodes per on compound node, then the compound nodes change its place. So for example I want 2 child nodes in Compound1 and 4 nodes in Compound2, then the order is not Compound1, Compound2, Compound3 but something else.. – paul_n Feb 03 '16 at 16:22
  • The positions of the parents are based on the children. Set your child positions appropriately for the effect you want. – maxkfranz Feb 08 '16 at 15:41
  • @maxkfranz is there a way to apply grid layout for component nodes, like splitting columns inside a component nodes, – Rishi0405 Dec 17 '18 at 13:24