Allows to compose multiple layouts into a single layout. The master layout is the layout that handles move operations if another layout than the first element in layouts should be used. The master layout is not executed as the code assumes that it is part of layouts.
let first = new mxFastOrganicLayout(graph); let second = new mxParallelEdgeLayout(graph); let layout = new mxCompositeLayout(graph, [first, second], first); layout.execute(graph.getDefaultParent());
mxCompositeLayout | Allows to compose multiple layouts into a single layout. |
Functions | |
mxCompositeLayout | Constructs a new layout using the given layouts. |
Variables | |
layouts | Holds the array of mxGraphLayouts that this layout contains. |
master | Reference to the mxGraphLayouts that handles moves. |
Functions | |
moveCell | Implements mxGraphLayout.moveCell by calling move on master or the first layout in layouts. |
execute | Implements mxGraphLayout.execute by executing all layouts in a single transaction. |
function mxCompositeLayout( graph, layouts, master )
Constructs a new layout using the given layouts. The graph instance is required for creating the transaction that contains all layouts.
graph | Reference to the enclosing mxGraph. |
layouts | Array of mxGraphLayouts. |
master | Optional layout that handles moves. If no layout is given then the first layout of the above array is used to handle moves. |
mxCompositeLayout.prototype.layouts
Holds the array of mxGraphLayouts that this layout contains.
mxCompositeLayout.prototype.master
Reference to the mxGraphLayouts that handles moves. If this is null then the first layout in layouts is used.
mxCompositeLayout.prototype.moveCell = function( cell, x, y )
Implements mxGraphLayout.moveCell by calling move on master or the first layout in layouts.
mxCompositeLayout.prototype.execute = function( parent )
Implements mxGraphLayout.execute by executing all layouts in a single transaction.
Constructs a new layout using the given layouts.
function mxCompositeLayout( graph, layouts, master )
Holds the array of mxGraphLayouts that this layout contains.
mxCompositeLayout.prototype.layouts
Reference to the mxGraphLayouts that handles moves.
mxCompositeLayout.prototype.master
Implements mxGraphLayout.moveCell by calling move on master or the first layout in layouts.
mxCompositeLayout.prototype.moveCell = function( cell, x, y )
Notified when a cell is being moved in a parent that has automatic layout to update the cell state (eg.
mxGraphLayout.prototype.moveCell = function( cell, x, y )
Implements mxGraphLayout.execute by executing all layouts in a single transaction.
mxCompositeLayout.prototype.execute = function( parent )
Executes the layout algorithm for the children of the given parent.
mxGraphLayout.prototype.execute = function( parent )