Skip to main content

Module layout

Module layout 

Source

Structs§

ChartArea
DataArea
Margins
Rect
RectF
Float-precision pixel rect — element bounds, selection boxes, and other sub-pixel screen geometry. Rect (u32) stays the type for buffer/texture areas; this one is for visual geometry derived from f32 layout math.
TitleBand
The margin geometry an axis title is placed inside.
TitlePlacement
Draw origin and optional rotation for a chart or axis title.

Enums§

Element
FitStrategy
LayoutError
NudgeReject
NudgeResult
Side
A chart edge. Serializable because ColorBarOptions::side is part of Config; the layout-internal uses (FitStrategy::Absorb, nudge) predate that and are unaffected.

Constants§

LABEL_GAP
Minimum gap between a tick end and its label, in pixels.
LEGEND_INSET
Inset between a legend box and its data-area corner, in pixels.

Functions§

axis_anchor
Axis-line endpoints on pixel centers. Top/left use the first inside pixel; bottom/right use the last inside pixel.
axis_offset
Perpendicular screen translation for a detached axis.
axis_title_offset_to_screen
Convert an axis-title local offset to its rotated screen-space offset.
axis_title_placement
Where an axis title sits inside its side’s margin.
axis_visibility_extent
Visible reach on the inward and outward sides of an axis line.
axis_visibility_rect
Axis line/tick interaction bounds, including detached-axis translation.
chart_title_placement
colorbar_rect
The colourbar strip’s rectangle.
colorbar_title_placement
Place a colourbar title from the actual painted strip rectangle.
label_origin
Baseline origin for one measured tick label.
label_rect
Pixel rectangle occupied by a label drawn at a baseline origin.
legend_rect
point_on_rect_side
Place a fraction on one side of a rectangle. Horizontal sides run left-to-right; vertical sides run bottom-to-top, matching numeric axes. The colourbar renderer, label hit geometry, and tests all use this one mapping rather than independently deciding which screen end is low.
rect_axis_visibility_rect
Axis line/tick interaction bounds when the axis runs on one edge of an arbitrary rectangle. The colourbar uses this with its painted strip rectangle, so a shortened, aligned, or freely offset strip and its axis chrome cannot acquire different interaction geometry.
screen_offset_to_axis_title
Convert a screen-space drag delta to an axis title’s local offset frame.