GithubHelp home page GithubHelp logo

barisbora / downsample-lttb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pingec/downsample-lttb

0.0 0.0 0.0 32 KB

Largest Triangle Three Buckets downsample algorithm by Sveinn Steinarsson reshaped into a node.js module

License: MIT License

JavaScript 100.00%

downsample-lttb's Introduction

downsample-lttb

Largest Triangle Three Buckets downsample algorithm by Sveinn Steinarsson reshaped into a node.js module.

This is useful for downsampling large dataseries in order to be able to plot a representative chart shape with a manageable amount of data points.

Instructions

Install with

npm install git+https://github.com/pingec/downsample-lttb.git

Usage example

var downsampler = require("downsample-lttb");

//provide a series as an array of [x,y] pairs
var dummyDataSeries = [[1,2],[2,2],[3,3],[4,3],[5,6],[6,3],[7,3],[8,5],[9,4],[10,4],[11,1],[12,2]];

//pass the series and number of desired datapoints
var downsampledSeries = downsampler.processData(dummyDataSeries, 3);

console.log(downsampledSeries);	
//outputs [ [ 1, 2 ], [ 5, 6 ], [ 12, 2 ] ]

Downsampled chart series examples

#### of samples: 8614 downsampled to: 500 500 datapoints

# of samples: 8614 downsampled to: 200

200 datapoints

# of samples: 8614 downsampled to: 100

100 datapoints

# of samples: 8614 downsampled to: 50

50 datapoints

downsample-lttb's People

Contributors

pingec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.