forked from cytoscape/cytoscape.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Layout
maxkfranz edited this page May 1, 2012
·
5 revisions
Constructor to initialise the layout
options : The layout options to initialise with
- Automatically populated by the core
- options.cy : A reference to the core
- options.renderer : A reference to the renderer
- options.name : The name of the layout
- Customary options
- options.ready : Customarily a callback function triggered when the layout fires
layoutready- options.stop : Customarily a callback function triggered when the layout fires
layoutstop- options.fit : Customary option to fit the viewport to the graph (given that the layout may move nodes outside of the current viewport)
Runs the layout;
layoutreadyandlayoutstopevents should be triggered at the relevant times
Stops the layout if it's currently running (used for layouts that have live updating of node positions)
A layout must trigger the layoutready event on the core when each node has been assigned a position by the layout. When the layout has finished or is otherwise stopped, it must trigger the layoutstop event on the core. This facilitates layouts that run continuously.
See the random layout.