npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

js-lttb

v1.0.0

Published

Largest Triangle Three Buckets (LTTB) 下采样算法的 TypeScript 实现,用于减少图表节点数量并保留数据的视觉形状。

Downloads

8

Readme

js-lttb

English | 中文


English

Introduction

lttb is a TypeScript implementation of the Largest Triangle Three Buckets (LTTB) downsampling algorithm. It reduces the number of data points while preserving the visual shape of the data, making it ideal for time-series visualization or large dataset processing.

Features

  • Efficiently downsamples large datasets.
  • Preserves the visual characteristics of the original data.
  • Written in TypeScript for type safety and better development experience.
  • Easy to integrate into existing projects.

Installation

npm install js-lttb

Usage

import lttb from 'js-lttb';

const originalData = [
  [0, 1],
  [1, 5],
  [2, 3],
  // ... more data points
];

const downsampledData = lttb(originalData, 100); // Downsample to 100 points
console.log(downsampledData);

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.

中文

简介

lttb 是 最大三角形三桶(Largest Triangle Three Buckets, LTTB) 下采样算法的 TypeScript 实现。它可以在减少数据点数量的同时保留数据的视觉形状,非常适合用于时间序列可视化或大数据集处理。

特性

  • 高效地对大数据集进行下采样。
  • 保留原始数据的视觉特征。
  • 使用 TypeScript 编写,提供类型安全和更好的开发体验。
  • 易于集成到现有项目中。

安装

npm install js-lttb

使用方法

import lttb from 'js-lttb';

const originalData = [
  [0, 1],
  [1, 5],
  [2, 3],
  // ... 更多数据点
];

const downsampledData = lttb(originalData, 100); // 下采样至 100 个点
console.log(downsampledData);

贡献

欢迎贡献!如果你有任何建议或改进,请提交问题或拉取请求。