Skip to main content

AbstractLayout

Abstract base class for all layouts.

Extended by

Type Parameters

P

P extends LayoutParameters

Methods

begin()

abstract begin(dataSource, positionGetter, positionSetter, sizes, parameters): void

This is an abstract function that subclasses may implement if they wish. It will be called at the beginning of a layout.

Parameters

dataSource

DataSource

The associated dataSource

positionGetter

(id) => PointXY

Function to get position for some element

positionSetter

(id, x, y) => void

Function to set position for some element. Updates current extents as it sets the position.

sizes

Record<string, Size>

Map of element sizes.

parameters

P

Parameters configured for the layout.

Returns

void


end()

abstract end(dataSource, positionGetter, positionSetter, sizes, parameters): void

This is an abstract function that subclasses may implement if they wish. It will be called at the end of a layout.

Parameters

dataSource

DataSource

The associated VisuallyJs model

positionGetter

(id) => PointXY

Function to get position for some element

positionSetter

(id, x, y) => void

Function to set position for some element. Updates current extents as it sets the position.

sizes

Record<string, Size>

Map of element sizes.

parameters

P

Parameters configured for the layout.

Returns

void


step()

abstract step(dataSource, positionGetter, positionSetter, sizes, parameters): void

Step through the layout. For some layouts there is only a single step, but others continue stepping until some condition is met. Once the condition is met, the subclass must set this.done = true, or the layout will continue looping indefinitely.

Parameters

dataSource

DataSource

The associated VisuallyJs model

positionGetter

(id) => PointXY

positionSetter

(id, x, y) => void

sizes

Record<string, Size>

parameters

P

Parameters configured for the layout.

Returns

void