Skip to main content

Module layout

Module layout 

Source
Available on crate feature layout only.
Expand description

Deterministic hypergraph layout: node positions + per-hyperedge geometry.

All strategies are hand-rolled — rustworkx-core 0.18 exposes NO layout functions (empirically confirmed 2026-07-18). Randomised layouts seed rand_pcg::Pcg64Mcg; non-randomised layouts (Bipartite, Radial) are pure placement functions. Positions/geometries are emitted in the hypergraph’s insertion order (Constitution III.7 parity).

Re-exports§

pub use hull::convex_hull;
pub use orderings::levi_ego_tree;
pub use orderings::paoh_ordering;
pub use orderings::LeviKind;
pub use orderings::LeviNode;
pub use place::bipartite_layout;
pub use place::radial_layout;
pub use spring::hyperedge_aware_layout;
pub use spring::spring_layout;

Modules§

hull
Convex hull via Andrew’s monotone chain (replaces XGI’s scipy ConvexHull).
orderings
Ordering providers for babylon’s topology render lane (design canon S9): surfaces consume orderings, never force layouts. paoh_ordering mirrors src/babylon/projection/topology/paoh.py’s SHAPE (nodes, sorted edges) — with one declared deviation: node order here is insertion order (III.7 determinism via node_ids()), not paoh.py’s lexicographic sorted(set); callers wanting the lexicographic view sort the returned vec. Edge sort-by-attr-with-missing-last matches paoh.py exactly. levi_ego_tree mirrors levi.py, modeled on this crate’s own bipartite (agent/hyperedge) representation. Both are re-expressions of existing structure — no new mathematics.
place
Deterministic placement layouts (no RNG): bipartite two-column and radial.
spring
Fruchterman–Reingold spring layout on the 1-skeleton, plus the hyperedge-aware variant. Hand-rolled (no rustworkx-core layout exists) and seeded by rand_pcg::Pcg64Mcg for Constitution III.7 determinism.

Structs§

LayoutResult
The result of a layout computation: insertion-ordered node positions and per-hyperedge geometry, plus the overall bounding box (min_x, min_y, max_x, max_y).

Enums§

BipartiteAlign
Column/row alignment for the bipartite layout.
HyperedgeGeometry
The geometry of a single hyperedge in a laid-out scene.
LayoutStrategy
The four layout strategies (spec §5.2).

Constants§

DEFAULT_LAYOUT_SEED
The default deterministic seed used when a strategy provides no explicit seed (or seed = None). XGI’s seed=None is non-deterministic (numpy global RNG); we substitute a fixed seed for Constitution III.7 determinism.

Functions§

compute_layout
Dispatch a LayoutStrategy to its implementation (spec §5.2).