feat(plot): the figure crosshair marks the hovered row, and the stroke is thin, dashed and configurable

This commit is contained in:
Martino Ferrari committed 2026-09-28 20:17:01 +02:00
1 parent cae672bc99
commit eee7c34dd5
12 files changed
+166 -12

No files matched your search

+15
View File
@@ -54,6 +54,21 @@ struct Style {
/// already distinct, so no dashes.
Color crosshair = Color::hex(0xE6EBF2);
/// The crosshair's stroke and dash, in logical pixels (spec §17). The crosshair is a
/// *passive* hover instrument drawn over the data, so its default **recedes**: a
/// thinner stroke than a trace's (`Trace::width`'s 1.5) so it reads as chrome rather
/// than as data, and a dash so it is distinguishable from the grid and the traces at
/// a glance.
///
/// `crosshair_dash_on` is the ink length and `crosshair_dash_off` the gap; **`off == 0`
/// means solid**, which is the value every *other* line in the library is drawn at, so
/// the one pipeline serves them unchanged (the dash is a fragment-shader discard on
/// `v_along`, so no geometry is added). A `Crosshair` may override all three for one
/// plot without touching this global style.
f32 crosshair_width = 0.75f;
f32 crosshair_dash_on = 4.0f;
f32 crosshair_dash_off = 4.0f;
// --- the scale ----------------------------------------------------------
/// Device pixels per logical unit. 1.0 is the 1x display every default here was