Cose layout not working properly
See original GitHub issueI recently upgraded from 2.5.1 to 2.7.10 and I’m now running into two issues that previously weren’t there with the cose layout.
- Specifying the cose layout in the initialization options seems to break the layout completely.
- See this fiddle: http://jsbin.com/qeyozivipo/edit?js,output
- Adding nodes to the graph and calling
cy.layout({name:'cose'});
also does not apply the layout properly, I am getting overlapping nodes.- Here is a fiddle for this one: http://jsbin.com/sevefoyatu/1/edit?js,output
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cytoscape.js - layout() doesn't work in Firefox, works in Chrome
I have a page showing a graph with Cytoscape.js, but .layout() does not work for me in Firefox, however it does in Chrome....
Read more >Build a Responsive UI with ConstraintLayout
ConstraintLayout allows you to create large and complex layouts with a flat view hierarchy (no nested view groups). It's similar to RelativeLayout in...
Read more >Using layouts - Cytoscape.js
A discrete layout is synchronous: The resultant positions are synchronously set such that you can access those resultant node positions on the ...
Read more >CSS Grid Layout - CSS: Cascading Style Sheets | MDN
Like tables, grid layout enables an author to align elements into columns and rows. However, many more layouts are either possible or easier ......
Read more >Drawing elements do not show within a layout viewport in ...
If it is close to or the same as the background display of the layout (thus not showing), change it. Note: For linework...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Force-directed / physics simulation layouts generally need unique initial positions to work properly, or you get invalid forces (0 distance) and all the nodes don’t move. You need to either specify nodes with initial positions or tell the layout to set some for you with
randomize: true
: http://jsbin.com/pekotesuno/2/edit?js,outputSame for your second case: http://jsbin.com/gukeqiyuqe/1/edit?js,output
See also https://github.com/cytoscape/cytoscape.js/issues/1520 which should automatically mitigate this issue for CoSE