I am trying to add styling to cytoscape.js nodes based on their level/rank in the graph.
For example, the root node is rank 1, the children of the root node are of rank 2, and so on. Is there a function that returns the node's rank or return a collection of all the nodes with a given rank? Here is an illustration:
Root (rank 1)
. .
. .
. .
child1 (rank 2) child2 (rank 2)
Thank you!