Constructor
# new DefaultDrawer(pluginData)
Default constructor
Parameters:
Name | Type | Description |
---|---|---|
pluginData |
DefaultData
|
Plugin data storage. |
Members
Methods
# arrangeComponentsPosition(id, keepPosition)
Reorganize position and size of all components.
This method does not refresh the view. You have to await it and trigger a redraw.
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
The container within which we need to organize the children, and if not specified, all components will be reorganized. |
keepPosition |
boolean
|
If true only component without position will be reorganized. |
# clearActions()
Remove all instances of actions and remove all set events.
# dropComponent(component, event)
Drop component on scene.
Parameters:
Name | Type | Description |
---|---|---|
component |
Component
|
Component to drop. |
event |
object
|
Mouse event. |
# exportSvg(id) → {string}
Export viewport as svg.
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
Viewport id. |
Svg content.
string
# getSceneData() → {object}
Format component dataset to d3 hierarchy.
- Formated component dataset.
object
# init(id, readOnly)
Initialize drawing context.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
id |
string
|
Html id of div that will be the drawing container. | |
readOnly |
boolean
|
false | Indicate if user can make action or modify the scene. |
# initActions()
Initialize actions and set event on viewport and other.
# initComponentRenderer(readOnly) → {ComponentRenderer}
Initialize component renderer and return instance of it.
Parameters:
Name | Type | Description |
---|---|---|
readOnly |
boolean
|
Indicate if user can make action or modify the scene. |
New instance of ComponentRenderer.
# initLinkRenderer(readOnly) → {LinkRenderer}
Initialize link renderer and return instance of it.
Parameters:
Name | Type | Description |
---|---|---|
readOnly |
boolean
|
Indicate if user can make action or modify the scene. |
New instance of LinkRenderer.
# initScene()
Initialize the scene, set all markers component and link groups.
# resize(id)
Resize the container to its minimum size.
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
Container id. |