Closed yousefamar closed 5 years ago
You haven't specified the layout bounds -- either explicitly or implicitly by a container's bounds. It doesn't make sense to run a layout within zero-area bounds.
Thanks for the pointer, I didn't know about this. Just for posterity, when I specify boundingBox
on the layout
object, I no longer have this issue.
This is related to #2253. Headless layouts simply don't work (positions all zero'd) unless a container is passed to the graph on init. With the
.layout()
function, you can't do this, so they don't work outright.Bug report
Environment info
Current (buggy) behaviour
Layout has no effect unless there's a container attached.
Desired behaviour
The opposite
Minimum steps to reproduce
The exact same behaviour can be observed in node with cytosnap. This issue is unrelated to this comment -- if you run the layout directly in PhantomJS (or non-headless in the browser) it works just fine. It simply seems to require a container for a layout to work.
Any tips or pointers much appreciated!