The grid design space: a GAPLESS lattice of nominal 25px square cells.
A layout's cols × rows is exactly one screenful of STANDARD cells —
nothing ever scrolls. The fit hook stretches per-axis only to absorb the
last ~4% (a fitted screen fills exactly edge-to-edge); otherwise the
intact artboard shrinks into a smaller pane, or floats centered at natural
size in a bigger one — never blown up (a bigger display wants its own
fitted layout). Widget cards carry a small internal margin instead of grid
gaps, and content self-fits via container-query type scaling. All widget
sizes (default, min, per-view minimums) are declared in lattice units.
Summary
Functions
The nominal square cell size in design px.
Clamp an integer into [lo, hi] — the single clamp shared across the module.
A non-integer value (tampered/legacy JSONB) collapses to lo rather than
raising in downstream cell arithmetic.
Design-space canvas height for a row count.
Design-space canvas width for a column count.
Absolute hard cap for a free/pixel-canvas position (px).
Maximum free/pixel-canvas widget size in px (also the per-move growth budget).
Minimum free/pixel-canvas widget size in px.
Hard upper bound for layout dimensions and widget spans.
Hard lower bound for layout dimensions.
Per-axis stretch tolerance (see moduledoc).
Coerce a stored geometry value to an integer — the single coercion for
tampered/legacy JSONB that may carry a string or float where an int is
expected. Floats truncate; numeric strings parse; anything else falls back to
default.
Functions
@spec cell() :: pos_integer()
The nominal square cell size in design px.
Clamp an integer into [lo, hi] — the single clamp shared across the module.
A non-integer value (tampered/legacy JSONB) collapses to lo rather than
raising in downstream cell arithmetic.
@spec design_height(pos_integer()) :: pos_integer()
Design-space canvas height for a row count.
@spec design_width(pos_integer()) :: pos_integer()
Design-space canvas width for a column count.
@spec free_max_pos() :: pos_integer()
Absolute hard cap for a free/pixel-canvas position (px).
@spec free_max_px() :: pos_integer()
Maximum free/pixel-canvas widget size in px (also the per-move growth budget).
@spec free_min_px() :: pos_integer()
Minimum free/pixel-canvas widget size in px.
@spec max_dim() :: pos_integer()
Hard upper bound for layout dimensions and widget spans.
@spec min_dim() :: pos_integer()
Hard lower bound for layout dimensions.
@spec stretch_tolerance() :: float()
Per-axis stretch tolerance (see moduledoc).
Coerce a stored geometry value to an integer — the single coercion for
tampered/legacy JSONB that may carry a string or float where an int is
expected. Floats truncate; numeric strings parse; anything else falls back to
default.