Skip to main content

Module decimate

Module decimate 

Source
Expand description

Down-sampling an over-dense series to the pixel budget — the library-side half of the data-density story (the plan’s decision 5).

A virtual app resamples its own source and never needs this; a dump-everything app hands the whole series and opts into a Decimation so the plot stays fast. minmax keeps the visual envelope (spikes survive) by emitting the min and max sample of each pixel-column bucket — the right default for monitoring / TSDB data, where a dropped spike is a dropped incident.

Enums§

Decimation
How the plot reduces an over-dense series to the pixel budget.

Functions§

minmax
Reduce samples (assumed ascending in x, as a time series is) to at most 2 * buckets points across the visible x_window, keeping the min and max y of each column. Samples outside the window are dropped. Returns the input unchanged when it is already within budget or the window is degenerate.