Skip to main content

Interface: WorkspacePerformLayoutParams

Options for WorkspaceContext.performLayout method.

See

WorkspaceContext.performLayout

Properties

PropertyTypeDescription

animate?

boolean

Whether moving elements to final layout positions should be animated.

Default

false

canvas?

CanvasApi

Target canvas to get element sizes from and perform layout algorithm on.

If not specified, uses the result from SharedCanvasState.findAnyCanvas. It is recommended to provide this value if possible for consistent multi-canvas support.

layoutFunction?

LayoutFunction

Layout function to use when computing element positions.

Default is defined by WorkspaceProps.defaultLayout.

selectedElements?

ReadonlySet<Element>

Restrict the layout application to the subset of graph elements.

signal?

AbortSignal

Signal to cancel computing and applying the layout.

zoomToFit?

boolean

Whether to fit elements into viewport after layout.

Default

true