Methods
# canBePlaced(existingNodes, node, position) → {boolean}
Indicate if node can be placed at position. Check if node not overriding existing node at
position.
Parameters:
Name | Type | Description |
---|---|---|
existingNodes |
Array.<object>
|
Existing nodes to check position overriding. |
node |
object
|
Node to check. |
position |
object
|
x, y position to check |
True if node can be placed at given position, otherwise false.
boolean
# createNode(component) → {object}
Convert component to a node with needed properties.
Parameters:
Name | Type | Description |
---|---|---|
component |
Component
|
Component. |
Node of component.
object
# generateComponentsLayout(id, keepPosition) → {boolean}
Generate layout of a container.
Will update all component drawOption with new position and size.
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
Container id, null for root container. |
keepPosition |
boolean
|
If true, rearrange only components without a specified position; otherwise, rearrange all components. |
Return true on successful generation.
boolean
# generateDefaultLayout(container, keepPosition)
Generate layout of default container.
Parameters:
Name | Type | Description |
---|---|---|
container |
object
|
Container. |
keepPosition |
boolean
|
If true, rearrange only components without a specified position; otherwise, rearrange all components. |
# generateHorizontalWorkflowLayout(nodes, container)
Generate layout of horizontal workflow container.
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Map.<string, object>
|
Layout nodes. |
container |
object
|
Container. |
# generateLayout(nodes, node, keepPosition)
Recursive method to generate layout of a container. Generate layout of container children.
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Map.<string, object>
|
Layout nodes. |
node |
object
|
Node to generate layout. |
keepPosition |
boolean
|
If true, rearrange only components without a specified position; otherwise, rearrange all components. |
# generateVerticalWorkflowLayout(nodes, container)
Generate layout of vertical workflow container.
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Map.<string, object>
|
Layout nodes. |
container |
object
|
Container. |
# generateWorkflowLayout(nodes, container)
Generate layout of workflow container.
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Map.<string, object>
|
Layout nodes. |
container |
object
|
Container. |
# getNodes() → {Map.<string, object>}
Initializes all nodes of a layout.
Initialized nodes.
Map.<string, object>
# getPoints(i, margin, gap) → {Array.<object>}
Generates a list of points forming a path along the edges of a square grid of a given size.
Only give points on right and bottom edge.
Parameters:
Name | Type | Description |
---|---|---|
i |
number
|
The number of segments to create (determines the square size). Square are always a multiple of margin. If i = 0, return default position. |
margin |
number
|
The margin from the origin (0,0) to start the grid. |
gap |
number
|
The distance between consecutive points. |
An array of points along the edges of the square grid.
Array.<object>
# resize(id) → {boolean}
Resize component to its minimum size.
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
Id of component to resize. |
Return true on successful resizing.
boolean