Methods
addLayerGroup(htmlElement) → {LayerGroup}
Add a layer group to the list.
The new layer group will be marked as the active layer group.
Name | Type | Description |
---|---|---|
htmlElement | object | The HTML element of the layer group. |
- Source
The newly created layer group.
- Type:
- LayerGroup
bindLayerGroups()
Bind the layer groups of the stage.
- Source
draw()
Draw the stage: calls draw on all layer groups.
- Source
empty()
Empty the layer group list.
- Source
fitToContainer()
Fit to container: synchronise the div to world size ratio of the group layers.
- Source
getActiveLayerGroup() → {LayerGroup|undefined}
Get the active layer group.
- Source
The layer group.
- Type:
- LayerGroup |
undefined
getDrawLayers(callbackFnopt) → {Array.<DrawLayer>}
Get a list of draw layers according to an input callback function.
Name | Type | Attributes | Description |
---|---|---|---|
callbackFn | function | <optional> | A function that takes a DrawLayer as input and returns a boolean. If undefined, returns all draw layers. |
- Source
The layers that satisfy the callbackFn.
- Type:
- Array.<DrawLayer>
getDrawLayersByDataId(dataId) → {Array.<DrawLayer>}
Get the draw layers associated to a data id.
Name | Type | Description |
---|---|---|
dataId | string | The data id. |
- Source
The layers.
- Type:
- Array.<DrawLayer>
getLayerGroup(index) → {LayerGroup|undefined}
Get the layer group at the given index.
Name | Type | Description |
---|---|---|
index | number | The index. |
- Source
The layer group.
- Type:
- LayerGroup |
undefined
getLayerGroupByDivId(id) → {LayerGroup}
Get a layer group from an HTML element id.
Name | Type | Description |
---|---|---|
id | string | The element id to find. |
- Source
The layer group.
- Type:
- LayerGroup
getNumberOfLayerGroups() → {number}
Get the number of layer groups that form the stage.
- Source
The number of layer groups.
- Type:
- number
getViewLayers(callbackFnopt) → {Array.<ViewLayer>}
Get a list of view layers according to an input callback function.
Name | Type | Attributes | Description |
---|---|---|---|
callbackFn | function | <optional> | A function that takes a ViewLayer as input and returns a boolean. If undefined, returns all view layers. |
- Source
The layers that satisfy the callbackFn.
- Type:
- Array.<ViewLayer>
getViewLayersByDataId(dataId) → {Array.<ViewLayer>}
Get the view layers associated to a data id.
Name | Type | Description |
---|---|---|
dataId | string | The data id. |
- Source
The layers.
- Type:
- Array.<ViewLayer>
removeLayerGroup(layerGroup)
Remove a layer group from this stage.
Name | Type | Description |
---|---|---|
layerGroup | LayerGroup | The layer group to remove. |
- Source
removeLayersByDataId(dataId)
Remove all layers for a specific data.
Name | Type | Description |
---|---|---|
dataId | string | The data to remove its layers. |
- Source
reset()
Reset the stage: calls reset on all layer groups.
- Source
setActiveLayerGroup(index)
Set the active layer group.
Name | Type | Description |
---|---|---|
index | number | The layer group index. |
- Source
setBinders(list)
Set the layer groups binders.
Name | Type | Description |
---|---|---|
list | Array | The list of binder objects. |
- Source
setImageSmoothing(flag)
Set the imageSmoothing flag value.
Name | Type | Description |
---|---|---|
flag | boolean | True to enable smoothing. |
- Source
unbindLayerGroups()
Unbind the layer groups of the stage.
- Source