Skip to content

An implementation of the largest triangle three buckets (lttb) algorithm for time series downsampling

License

Notifications You must be signed in to change notification settings

jeromefroe/lttb-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
}

About

An implementation of the largest triangle three buckets (lttb) algorithm for time series downsampling

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages