Constructor
new Viewer(target, config, options)
Parameters:
Name | Type | Description |
---|---|---|
target |
HTMLElement | string | target element to put the viewer (ID or HTMLElement) |
config |
object | string | config object or path to a viewer config file |
options |
object | additional options for the viewer class |
- Source:
Methods
addElement(id, element)
Add an element to the viewer and set the id
Parameters:
Name | Type | Description |
---|---|---|
id |
string | |
element |
UiElement | HTMLElement |
- Source:
appendElement(elementId, parentId, updateLayout)
Append an element to a parent identified by id and optionally
update the layout config of the viewer
Parameters:
Name | Type | Description |
---|---|---|
elementId |
string | |
parentId |
string | |
updateLayout |
boolean | default is false |
- Source:
dispose() → {Promise}
Clear all viewer elements
- Source:
Returns:
- Type
- Promise
getConfig(useTemplate) → {object}
Get the JSON config of the current viewer state
Parameters:
Name | Type | Default | Description |
---|---|---|---|
useTemplate |
boolean | false | convert generic config to template config (if template was used) default is false |
- Source:
Returns:
viewer config
- Type
- object
removeElement(elementId, updateLayout)
Remove and dispose an element from the viewer and optionally update the layout
Parameters:
Name | Type | Description |
---|---|---|
elementId |
string | |
updateLayout |
boolean | default is false |
- Source: