Constructor
# new Action(pluginData, viewport, layout)
Default constructor.
Parameters:
Name | Type | Description |
---|---|---|
pluginData |
DefaultData
|
Plugin data storage. |
viewport |
object
|
D3 selection of the view port. |
layout |
DefaultLayout
|
Layout to organise components. |
Members
Methods
# applySceneTransform()
Applies the scene transformation based on the plugin data.
# execute(event) → {boolean}
Executes the action.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event triggering the action. |
Indicates whether the scene needs to be redrawn.
boolean
# finalize(event) → {boolean}
Finalizes the action.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event triggering the action. |
Indicates whether the scene needs to be redrawn.
boolean
# getSourcePosition(sourceId) → {object}
Gets the position of the source.
Parameters:
Name | Type | Description |
---|---|---|
sourceId |
string
|
The ID of the source. |
The position of the source.
object
# getSourcesId(event) → {Array.<string>}
Gets the source IDs from the event.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event containing the source information. |
The array of source IDs.
Array.<string>
# getTargetId(event) → {string}
Gets the primary target ID from the event.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event containing the target information. |
The primary target ID.
string
# getTargetsByDepth(event) → {Array.<Array.<string>>}
Gets the targets by depth from the event.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event containing the target information. |
An array of target IDs grouped by depth.
Array.<Array.<string>>
# getTargetsId(event) → {Array.<string>}
Gets the target IDs from the event. Ids are ordered by depth, from the deepest to the
shallowest.
Parameters:
Name | Type | Description |
---|---|---|
event |
object
|
The event containing the target information. |
An array of target IDs.
Array.<string>
# getTransform(selector1, selector2) → {object}
Gets the transformation between two selectors.
Parameters:
Name | Type | Description |
---|---|---|
selector1 |
string
|
The first selector. |
selector2 |
string
|
The second selector. |
The transformation between the two selectors.
object