Skip to main content

Module layout

Module layout 

Source
Expand description

Fruchterman-Reingold force-directed graph layout.

O(n²) per iteration — acceptable for MVP with ≤2000 nodes. Runs a few steps per frame; pinned nodes are excluded from displacement.

Structs§

LayoutConfig
Configuration for the layout algorithm.

Functions§

center_graph
Center the graph at the origin after layout has converged.
layout_batch
Run multiple layout steps (for per-frame batch).
layout_step
Run one iteration of Fruchterman-Reingold layout.
reset_temperature
Reset layout: randomize positions and set temperature.