You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do some ad-hock collapse/expand feature for compound nodes.
Collapse is done with changing position of all compound node children to one point: elem.descendants().positions(elem.position());
And then, on expand, I'm trying to re-run layout over all node children: elem.descendants().layout({name: 'cose-bilkent'});
Reading the http://js.cytoscape.org/#eles.layout it seems that it should be possible to layout only some collection of nodes. But it seems this doesn't work for compound node children.
@aindlq In the meantime, I suspect you could just run the random layout before cose-bilkent and it would work OK as a workaround. You can use the boundingBox to constrain the layout bounds.
@aindlq Or rather than running a layout to expand, you could save the relative positions of each child before collapsing. Then you can restore that relative position on the expand action.
I'm trying to do some ad-hock collapse/expand feature for compound nodes.
Collapse is done with changing position of all compound node children to one point:
elem.descendants().positions(elem.position());
And then, on expand, I'm trying to re-run layout over all node children:
elem.descendants().layout({name: 'cose-bilkent'});
Reading the http://js.cytoscape.org/#eles.layout it seems that it should be possible to layout only some collection of nodes. But it seems this doesn't work for compound node children.
See http://jsbin.com/didunafota/1/edit?html,output
The text was updated successfully, but these errors were encountered: