insightdock::charts::lttb_decimate

Downsample a series to threshold points using LTTB.

Synopsis

Declared in <insightdock/decimate.h>
[[visibility]]
std::vector<DecimationPoint>
lttb_decimate(
    std::vector<DecimationPoint> const& points,
    std::size_t threshold);

Description

Picks, per bucket, the point that forms the largest triangle with the previously chosen point and the next bucket's average — this preserves visual shape (spikes, valleys) far better than naive stride sampling. Always keeps the first and last point.

Return Value

Decimated series.

Parameters

Name Description
points Input series, ordered by x.
threshold Target point count. No-op (returns points unchanged) when threshold is 0, < 3, or >= points.size().

Created with MrDocs