cytoscape / cytoscape.js-dagre

The Dagre layout for DAGs and trees for Cytoscape.js
MIT License
246 stars 82 forks source link

Preserve old nodes' positions on layout re run, when a new set of nodes are added to the graph? #40

Closed utkarshagarwal01 closed 5 years ago

utkarshagarwal01 commented 5 years ago

I basically want to know if there is a functionality in dagre like randomize: false which is available in layouts like cose-bilkent where the old node positions are respected when the layout is re run after adding a new set of nodes(more specifically, after expanding a compound node using expand-collapse.

virmundi commented 5 years ago

I've just been playing with this for a few minutes, but I found sorting the nodes to help. In my case each node has an id. The graph appears, on a small graph of about 10 nodes, stable.

maxkfranz commented 5 years ago

This is up to how dagre itself works. If you want new dagre features, you should post issues on the dagre issue tracker.

https://github.com/dagrejs/dagre/issues