Skip to main content

Module composition

Module composition 

Source
Expand description

High-level plot composition layout.

Stacks on top of crate::layout to provide a patchwork-style model where every plot is the same 13×16 anatomical grid (see anatomy::Slot) and composed plots automatically align by anatomical position.

Construction is id-addressed: every Patch is created with a string id, and resolved rects are looked up via CompositionLayout::get(id, region) — flat across any nesting depth.

Re-exports§

pub use anatomy::Slot;
pub use anatomy::MARGIN_BOTTOM_ROW;
pub use anatomy::MARGIN_LEFT_COL;
pub use anatomy::MARGIN_RIGHT_COL;
pub use anatomy::MARGIN_TOP_ROW;
pub use anatomy::PADDING_BOTTOM_ROW;
pub use anatomy::PADDING_LEFT_COL;
pub use anatomy::PADDING_RIGHT_COL;
pub use anatomy::PADDING_TOP_ROW;
pub use anatomy::PANEL_COL;
pub use anatomy::PANEL_ROW;
pub use anatomy::PLOT_BOTTOM;
pub use anatomy::PLOT_LEFT;
pub use anatomy::PLOT_RIGHT;
pub use anatomy::PLOT_TOP;
pub use anatomy::TABLE_COLS;
pub use anatomy::TABLE_ROWS;

Modules§

anatomy
Anatomical layout of a single patch — the 13×16 slot grid every patch shares.

Structs§

Composition
A grid of Elements of size rows × cols. Per-panel-column widths and per-panel-row heights default to Fr(1.0); override with Composition::widths / Composition::heights.
CompositionLayout
Resolved layout for a Patch or Composition. Query rects by patch id and anatomical region.
Patch
A single plot’s content laid out into the 13×16 anatomical grid.
PatchPlacement
One slot placement inside a Patch — captures the anatomical position, the region name (used for lookups in the resolved layout), and the Cell whose measure drives sizing.
Span
A row × column span (1-indexed counts) used by Patch::place_at and Composition::place.

Enums§

CompositionError
Errors produced by Composition::try_solve.
Element
Either a Patch or a (nested) Composition.

Traits§

Region
Anything that names a region for CompositionLayout::get lookups.

Functions§

beside
Place a and b side by side in a 1×2 composition.
grid
Build a rows × cols composition from cells in row-major order. cells.len() must equal rows * cols.
spacer
An anonymous spacer patch — empty, alignment-only, not addressable.
stack
Stack a on top of b in a 2×1 composition.
wrap
A patch wrapping cell in its Panel slot. Addressable as (id, "panel").