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§
- Axis
Element - One of the four axes — the axis line plus its tick band.
- Axis
Label Element - One axis’s tick-value labels — the band the numeric labels live in, between the tick ends and the outer chart edge.
- Axis
Title Element - One axis title (rotated 90° on Left/Right sides).
- Chart
Title Element - The chart title in the top band.
- Color
BarAxis Element - The colourbar axis line plus its major/minor tick band.
- Color
BarElement - The colourbar strip.
- Color
BarLabel Element - The colourbar’s tick-value label band.
- Color
BarTitle Element - The colourbar title, rotated on vertical bars.
- Data
Area Element - 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.
- Legend
Element - The legend box in one corner of the data area.
- Selection
Box - 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.