#series #time-series

lttb

An implementation of the Largest Triangle Three Buckets algorithm

3 unstable releases

Uses old Rust 2015

0.2.0 May 27, 2020
0.1.1 Jan 2, 2018
0.1.0 Jan 2, 2018

#1544 in Algorithms

Download history 91/week @ 2024-07-20 38/week @ 2024-07-27 6/week @ 2024-08-03 14/week @ 2024-08-10 1/week @ 2024-08-17 10/week @ 2024-08-24 3/week @ 2024-08-31 61/week @ 2024-09-14 80/week @ 2024-09-21 25/week @ 2024-09-28 6/week @ 2024-10-05 16/week @ 2024-10-12 17/week @ 2024-10-19 41/week @ 2024-10-26 15/week @ 2024-11-02

89 downloads per month

MIT license

8KB
76 lines

Largest Triangle Three Buckets

Build Status codecov crates.io docs.rs License

Documentation

An implementation of the largest triangle three buckets (lttb) algorithm for time series downsampling as described in Downsampling Time Series for Visual Representation. This is a Rust port of the original Javascript implementation.

Example

extern crate lttb;

use lttb::{DataPoint,lttb};

fn main() {
  let mut raw = vec!();
  raw.push(DataPoint::new(0.0, 10.0));
  raw.push(DataPoint::new(1.0, 12.0));
  raw.push(DataPoint::new(2.0, 8.0));
  raw.push(DataPoint::new(3.0, 10.0));
  raw.push(DataPoint::new(4.0, 12.0));

  // Downsample the raw data to use just three datapoints.
  let downsampled = lttb(raw, 3);
}

No runtime deps