Skip to main content

Home > @jsplumbtoolkit/layout-spring > SpringLayout

SpringLayout class

Warning: This API is now obsolete.

As of 5.7.0 the ForceDirected layout is now available, which is a rewrite of this layout with several placement improvements and a shorter run time.

A layout that treats edges as springs, and places each vertex in proximity to other vertices to which it is connected.

Signature:

export declare class SpringLayout extends AbsoluteBackedLayout<SpringLayoutParameters> 

Extends: AbsoluteBackedLayout<SpringLayoutParameters>

Constructors

ConstructorModifiersDescription
(constructor)(params)Constructs a new instance of the SpringLayout class

Properties

PropertyModifiersTypeDescription
_cacheArray<ElementRecord>
_elementsRecord<string, ElementRecord>
_moveCountnumber
currentParametersSpringLayoutParameters
defaultMagnetizedboolean
maxxnumber
maxynumber
minxnumber
minynumber
typestring
typestaticstring
xScalenumber
yScalenumber

Methods

MethodModifiersDescription
_magnetizerFilter(id)
_vertexAdded(params, eventInfo)
_vertexMoved(id, x, y)
_vertexRemoved(obj)
begin(toolkit, parameters)
end(toolkit, parameters, wasMagnetized)
getDefaultParameters()
reset()
step(toolkit, parameters)