Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

downsample-lttb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downsample-lttb

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

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.6K
increased by88.28%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 12 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc