Skip to main content

minmax

Function minmax 

Source
pub fn minmax(
    samples: &[Sample],
    x_window: (f64, f64),
    buckets: usize,
) -> Vec<Sample>
Expand description

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.