-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout doesn't run if all nodes share the same position #14
Comments
@metincansiper Any idea why this would be happening? Thanks! |
Regular layout starts with random positions; so this can only happen when all nodes are at the same position and incremental layout is enabled. One shouldn't run incremental layout when nodes don't really have any initial positions (all are at the same location). One way to avoid this is to randomly move nodes at least a little bit. |
I tried to enable see http://jsbin.com/yuremezoma/1/edit?html,output , try to collapse and then expand some compound node |
Interesting. Why do you apply layout on child content upon expand? Why not just break the parent-child relations upon collapse but keep the child nodes around with their locations and restore them upon expand? Here is an example, where we do exactly that: http://cs.bilkent.edu.tr/~ivis/SBGNViz.js_editor/sample-app/ |
Maybe it's because the layout call is on a collection of nodes with no edges? |
Because user wants to be able to move around collapsed node. In your example when node is expanded it will be moved back to the initial position, but we want to expand it in place. |
@aindlq @maxkfranz |
@metincansiper That sounds right. |
Starting to create l level nodes from the top most nodes instead of orphan nodes
I have created a function returning the list of top most nodes in a node list. Then I used this method where I was using nodes.oprhans() previously. The problem seems to be solved now. |
@aindlq could you please confirm your problem is fixed and close this issue if so? |
@metincansiper @ugurdogrusoz If this change fixes it, then it can be |
Hm, maybe I'm doing something wrong but the only change that I can observe is that compound node is fit to viewport. see http://jsbin.com/qimecaxose/edit?html,output @metincansiper Thank you for the suggestion, I really like the way you're doing it. This way layout of nodes inside compound after expand will be the same as before +1 |
@aindlq Thanks for noticing the bug. I made some corrections and it seems to be working now. I have also tried your fiddle and see that upon expand operation layout is being performed now. However, compound node still fits to viewport in your fiddle if you do not want this, you can specify the fit option of the layout as false. Could you please confirm that your problem is fixed. If it is fixed we can publish 1.3.1. |
@metincansiper thank you! works fine. |
Fixed a layout actually related to tilling bug emerged while fixing the bugs related to this issue
@aindlq we realized that while I was fixing this bug I made a logical mistake and something went wrong in version 1.3.1. Then I corrected that mistake and published version 1.3.2. We wanted to inform you about this. You may want to upgrade to cose-bilkent version 1.3.2. |
Changed getTopMostNodes function (Covered an uncovered case)
Refer to cytoscape/cytoscape.js#1372
The text was updated successfully, but these errors were encountered: