Search code examples
angularnetwork-programminglayoutgraph-theorycytoscape

Cytoscape.js Breathfirst layout


My requirement is to create a Breadth-First graph with root node at the center. When I use center=true option, Edges are getting overlap.

Is there any solution for this?


Solution

  • Mmm.... breadthfirst have not a center property, may you refer to circle??

    enter image description here

    However, i think that for your purpose you can use concentric layout (https://js.cytoscape.org/#layouts) specifying a root.

    If you want to use the breadthfirst and the algorithm producing crossing edges you can

    1. Open an issue to improve this aesthetic criterion
    2. Try to generate a tweek from the algorithm result

    you can change nodes coordinates with node.position({ x: ...., y: .... })