improved measuraments ,cursors, zooming and user interactions

This commit is contained in:
Martino Ferrari committed 2026-10-03 16:05:45 +02:00
1 parent 0eceaf537b
commit 02620ca946
12 files changed
+1488 -171

No files matched your search

+11 -9
View File
@@ -25,8 +25,8 @@ using plot::u64;
/// does not hold here, because x is a *streamed timestamp*, not an index: a lost
/// datagram leaves a gap and the samples either side of it are not one grid step
/// apart. `dx()` and `x0()` therefore report a nominal grid (what the LOD level
/// and the snap use), while `gather()` and `x_bounds()` report the real
/// timestamps. `reduce()`, `sum()` and `sumsq()` are the inherited ones and read
/// and the snap use), while `gather()`, `x_bounds()`, `x_at()` and `neighbours()`
/// report the real timestamps. `reduce()`, `sum()` and `sumsq()` are the inherited ones and read
/// only y, so they are exact either way.
///
/// The time ring is shared by every channel of one buffer (spec: the +1 slice);
@@ -56,13 +56,15 @@ class ChannelBuffer final : public plot::data::Series {
// --- plot::data::Series ---------------------------------------------------
u64 size() const override { return pyramid_.size(); }
f64 x0() const override;
/// The *mean* spacing of the retained window. The renderer converts a visible x
/// range into an index range with `(x - x0()) / dx()`, so this must describe the
/// samples that are actually retained: reporting the nominal `stride * dt` made
/// that index range exceed the series by the decimation factor, the gather
/// clamped to nothing, and the trace drew empty -- which is exactly what a fast
/// channel looked like next to a slow one, because only the slow one is
/// recognisable from the few samples a wrong range still happens to cover.
/// The *mean* spacing of the retained window, and a nominal quantity: the renderer
/// picks the visible index window through `neighbours()` over the real stamps, not
/// through `(x - x0()) / dx()`, precisely because this is only a local average (a
/// lost datagram moves the real spacing around it). It still has to describe the
/// samples that are actually retained: the LOD level is chosen from the window's
/// sample count divided by its pixel width, so reporting the nominal `stride * dt`
/// over a decimated window picks a level the pyramid cannot serve and the trace
/// draws empty -- which is exactly what a fast channel looked like next to a slow
/// one.
f64 dx() const override;
/// The authoritative x of a sample: the streamed timestamp, not a grid. `dx()`
/// is only the mean spacing (the LOD level and a coarse snap use it); a lost