Skip to main content

Module select

Module select 

Source
Expand description

Selection policy — Selectable and the chart elements that implement it.

Selectable objects expose their interaction-policy pixel bounds (bounds); what selection does is fixed by the trait’s default methods so it applies uniformly to every element: a blue highlight box around the bounds (selection_box) and point hit-testing (contains). The renderer draws the box with skia (axis_render::draw_selection_boxes); the model only states the policy.

Placement formulas shared with the renderer consume glyph extents through the MeasureText contract. Tick labels intentionally use a representative strip instead of reproducing renderer-owned tick generation, formatting, pruning, or the exact union of rendered labels.

Structs§

AxisElement
One of the four axes — the axis line plus its tick band.
AxisLabelElement
One axis’s tick-value labels — the band the numeric labels live in, between the tick ends and the outer chart edge.
AxisTitleElement
One axis title (rotated 90° on Left/Right sides).
ChartTitleElement
The chart title in the top band.
ColorBarAxisElement
The colourbar axis line plus its major/minor tick band.
ColorBarElement
The colourbar strip.
ColorBarLabelElement
The colourbar’s tick-value label band.
ColorBarTitleElement
The colourbar title, rotated on vertical bars.
DataAreaElement
The data plotting area (everything inside the margins).
HitId
Id of an entry registered in a HitMap. Stable for the map’s lifetime.
HitMap
Registry of selectable elements for one chart panel + point hit-testing.
LegendElement
The legend box in one corner of the data area.
SelectionBox
The blue box drawn around a selected element. Produced by Selectable::selection_box; consumed by the renderer’s skia pass.

Constants§

SELECTION_COLOR
Selection highlight color (blue).
SELECTION_PADDING
Gap between the element bounds and the highlight box, px.
SELECTION_STROKE_WIDTH
Stroke width of the highlight box, px.

Traits§

Selectable
An object the user can select on the chart.