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_orderingmirrorssrc/babylon/projection/topology/paoh.py’s SHAPE (nodes, sorted edges) — with one declared deviation: node order here is insertion order (III.7 determinism vianode_ids()), not paoh.py’s lexicographicsorted(set); callers wanting the lexicographic view sort the returned vec. Edge sort-by-attr-with-missing-last matches paoh.py exactly.levi_ego_treemirrorslevi.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::Pcg64Mcgfor Constitution III.7 determinism.
Structs§
- Layout
Result - 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§
- Bipartite
Align - Column/row alignment for the bipartite layout.
- Hyperedge
Geometry - The geometry of a single hyperedge in a laid-out scene.
- Layout
Strategy - 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’sseed=Noneis non-deterministic (numpy global RNG); we substitute a fixed seed for Constitution III.7 determinism.
Functions§
- compute_
layout - Dispatch a
LayoutStrategyto its implementation (spec §5.2).