Stage

Stage: controls a list of layer groups and their synchronisation.

Constructor

new Stage()

Methods

addLayerGroup(htmlElement) → {LayerGroup}

Add a layer group to the list.

Parameters:
NameTypeDescription
htmlElementobject

The HTML element of the layer group.

Returns:

The newly created layer group.

Type: 
LayerGroup

bindLayerGroups()

Bind the layer groups of the stage.

draw()

Draw the stage: calls draw on all layer groups.

empty()

Empty the layer group list.

getActiveLayerGroup() → {LayerGroup}

Get the active layer group.

Returns:

The layer group.

Type: 
LayerGroup

getDrawLayersByDataIndex(index) → {Array}

Get the draw layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

getLayerGroup(index) → {LayerGroup}

Get the layer group at the given index.

Parameters:
NameTypeDescription
indexnumber

The index.

Returns:

The layer group.

Type: 
LayerGroup

getLayerGroupByDivId(id) → {LayerGroup}

Get a layer group from an HTML element id.

Parameters:
NameTypeDescription
idstring

The element id to find.

Returns:

The layer group.

Type: 
LayerGroup

getNumberOfLayerGroups() → {number}

Get the number of layer groups that form the stage.

Returns:

The number of layer groups.

Type: 
number

getViewLayersByDataIndex(index) → {Array}

Get the view layers associated to a data index.

Parameters:
NameTypeDescription
indexnumber

The data index.

Returns:

The layers.

Type: 
Array

reset()

Reset the stage: calls reset on all layer groups.

setBinders(list)

Set the layer groups binders.

Parameters:
NameTypeDescription
listArray

The list of binder objects.

syncLayerGroupScale()

Synchronise the fit scale of the group layers.

unbindLayerGroups()

Unbind the layer groups of the stage.