tracking-code-which-will-go-to-the-HEAD CustomLayout

Class

CustomLayout

CustomLayout()

Custom implementation of DefaultLayout.
Constructor

# new CustomLayout()

View Source draw/layout/CustomLayout.js, line 6

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

View Source draw/layout/CustomLayout.js, line 229

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.

View Source draw/layout/CustomLayout.js, line 108

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.

View Source draw/layout/CustomLayout.js, line 15

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.

View Source draw/layout/CustomLayout.js, line 155

# generateHorizontalWorkflowLayout(nodes, container)

Generate layout of horizontal workflow container.
Parameters:
Name Type Description
nodes Map.<string, object> Layout nodes.
container object Container.

View Source draw/layout/CustomLayout.js, line 309

# 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.

View Source draw/layout/CustomLayout.js, line 137

# generateVerticalWorkflowLayout(nodes, container)

Generate layout of vertical workflow container.
Parameters:
Name Type Description
nodes Map.<string, object> Layout nodes.
container object Container.

View Source draw/layout/CustomLayout.js, line 340

# generateWorkflowLayout(nodes, container)

Generate layout of workflow container.
Parameters:
Name Type Description
nodes Map.<string, object> Layout nodes.
container object Container.

View Source draw/layout/CustomLayout.js, line 296

# getNodes() → {Map.<string, object>}

Initializes all nodes of a layout.

View Source draw/layout/CustomLayout.js, line 74

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.

View Source draw/layout/CustomLayout.js, line 254

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.

View Source draw/layout/CustomLayout.js, line 371

Return true on successful resizing.
boolean