lttb

Crates.iolttb
lib.rslttb
version0.2.0
sourcesrc
created_at2018-01-02 02:56:30.51015
updated_at2020-05-27 23:15:15.263928
descriptionAn implementation of the Largest Triangle Three Buckets algorithm
homepagehttps://github.com/jeromefroe/lttb-rs
repositoryhttps://github.com/jeromefroe/lttb-rs.git
max_upload_size
id45170
size10,931
Jerome Froelich (jeromefroe)

documentation

https://docs.rs/lttb/

README

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);
}
Commit count: 23

cargo fmt