Spring Layout

This is a force-directed layout that models edges as springs. [[Wikipedia|http://en.wikipedia.org/wiki/Force-directedgraphdrawing]] has a good introduction to these types of layouts.

This layout is useful for unstructured data - database schemas, mind maps, graphs, etc. Force-directed algorithms initially
position nodes with a degree of randomness and so do not ever produce exactly the same result twice; for this reason it is
recommended that you read the note on refresh vs re-layout, and also familiarise yourself with
the UI state features provided by the Surface component.

Parameters

parameters

parameters.padding Optional [ x, y ] array of values to use as the padding between elements. Defaults to [50, 50], which is taken to mean 50 pixels around each individual Node.

parameters.magnetize Optional parameters for the magnetizer.

absoluteBacked By default this is set to true. See below for a discussion of this.

Example

Absolute Backing

SpringLayout extends AbsoluteLayout, which means that, by default, the layout will defer to absolute
node positions that are stored in the backing data for each node. This is a very useful feature for the majority of
applications: you do not typically want the layout to run if a human being has already taken a look at the data and perhaps
moved things around to be more to their liking.

Specifying Position

The default parameters used by AbsoluteLayout are left and top. So for instance you might have these nodes in your data:

Switching off Absolute backing

Relayout

A relayout will generate a brand new arrangement of Nodes, due to the fact that Nodes are placed randomly initially.

Refresh

A refresh of the layout locks the positions of any nodes that were positioned in a previous run of the layout, and these nodes do not move: only nodes that have not yet been positioned by the layout algorithm will move.

Magnetization

This layout switches on magnetization by default. You can suppress this behaviour by setting magnetize:false on your layout parameters:

By default, when the magnetizer runs it runs through 10 iterations. For some datasets this may not be
enough (in particular for large datasets). In that case you can specify how many iterations you'd like the
magnetizer to run for: