Skip to content
D
Documentation

LayoutOptions

reference
1 min readUpdated

Import it from @grafloria/engine.

Base options for all layout adapters

ts
interface LayoutOptions

Properties

NameTypeDefaultDescription
seed?numberSeed for any algorithm that uses randomness (force, spectral, community).
animate?booleanWhether to animate to new positions
animationDuration?numberAnimation duration in milliseconds
fit?booleanWhether to fit viewport to content after layout
padding?numberPadding around content when fitting
constraints?LayoutConstraintsLayout constraints for pinning/fixing nodes
calculateQuality?booleanWhether to calculate quality metrics after layout
canvasDimensions?{ width: number; height: number }Canvas dimensions for quality assessment
portAware?PortAwareLayoutOptionsPort-aware layout options
subgraph?SubgraphLayoutOptionsSubgraph/group layout options
edgeBundling?EdgeBundlingOptionsEdge bundling options
portConstraints?PortConstraintModeHow much freedom the layout engine has over declared ports. 'auto' (default): FIXED_SIDE for nodes with author-declared ports, FREE for the rest. So an edge leaving a right port will not force the layout to put the target on the left.
labelAware?booleanReserve space for edge labels at LAYOUT time (default true).
orthogonalRouting?booleanAsk the layout engine for orthogonal edge routes (default true for ELK).

Was this page helpful?

LayoutOptions — Grafloria