Function: calculateLayout()
calculateLayout(
params
):Promise
<CalculatedLayout
>
Computes a layout on the specified diagram elements using specified graph layout algorithm function (LayoutFunction).
Example:
const layout = await calculateLayout({
layoutFunction: defaultLayout,
model,
sizeProvider: canvas.renderingState,
});
await canvas.animateGraph(() => {
applyLayout(layout, model);
});
Parameters
Parameter | Type | Description |
---|---|---|
|
| ‐ |
|
| Set of elements which should not be moved by layout algorithm (if supported). |
| Graph layout algorithm function. | |
| Model of a diagram to calculate layout for. | |
|
| Subset of elements from the diagram to layout. |
|
| Cancellation signal. |
| Size provider for the elements. | |
| Additional metadata provider for the elements. |
Returns
Promise
<CalculatedLayout
>