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 🙏

© 2026 – Pkg Stats / Ryan Hefner

chartai

v1.1.0

Published

tiny gpu powered charts

Readme

chartai

Are you looking for a simple tiny little chart library which can draw as many lines and points as you have vram? Look no further.

chartai is a library that can draw millions and millions of lines across thousands of series wickedly fast. It uses a passive rendering system that only update charts when needed. It lives in a web worker keeping the main thread free. It is fully pluggable so you only take way you need or add what's missing.

Why chartai?

This library was inspired by uplot which is likely all you need. But if you do need the performance without the bundle bloat, this may do it. With all the core charts and plugins, chartai is about the same size as uplot.

  • Tiny, unlimited line charts at ~11kb
  • Customizable with plugins
  • Lines, scatter, bar, adn candlestick out of the box
  • Chart synchronization
  • Stupid faster compute shaders
  • Passively rendered, automatic virtualization
  • Doesn't miss the spikes in data, unless you want it to
  • Typescript, No dependencies

Cool. How do I use it?

Add a line chart

import { ChartManager } from 'chartai';
import { LineChart } from 'chartai/charts/line';

ChartManager.use(LineChart);
await ChartManager.init();

const x = Array.from({ length: 100 }, (_, i) => i);
const y = x.map(v => Math.sin(v * 0.1) * 50 + 50);

const chart = ChartManager.create({
  type: 'line',
  container: document.getElementById('chart'),
  series: [{
    label: 'My Data',
    color: 'oklab(0.65 0.15 -0.2)', 
    x,
    y
  }],
});

Plugins

import { ChartManager } from 'chartai';
import { labelsPlugin } from 'chartai/plugins/labels';
import { hoverPlugin } from 'chartai/plugins/hover';

ChartManager.use(zoomPlugin);
ChartManager.use(hoverPlugin);

Agnostic

It is pure js. Add it to your favorite framework.

import { useEffect, useRef } from 'react';
import { ChartManager } from 'chartai';
import { LineChart } from 'chartai/charts/line';
import { zoomPlugin } from 'chartai/plugins/zoom';
import { hoverPlugin } from 'chartai/plugins/hover';
import { labelsPlugin } from 'chartai/plugins/labels';

function Chart() {
  const ref = useRef(null);
  const chartRef = useRef(null);
  
  useEffect(() => {
    ChartManager.use(LineChart);
    ChartManager.use(labelsPlugin);
    ChartManager.use(zoomPlugin());
    ChartManager.use(hoverPlugin);
    
    ChartManager.init().then(() => {
      const x = Array.from({ length: 100 }, (_, i) => i);
      const y = x.map(v => Math.sin(v * 0.1) * 50 + 50);
      
      chartRef.current = ChartManager.create({
        type: 'line',
        container: ref.current,
        series: [{ label: 'My Data', color: '#ffffff', x, y }],
        zoomMode: 'both',
        showTooltip: true
      });
      
      chartRef.current.configure({ zoomMode: 'x-only' });
    });
    
    return () => {
      chartRef.current?.destroy();
    };
  }, []);
  
  return <div ref={ref} style={{ width: '100%', height: '400px' }} />;
}

Design

A little layer communicates with a web worker that does all the gpu rendering. The design is pretty simple. Everything is a plugin. Both charts and well, plugins. The best way to see how to write your own plugins and charts is to look at the ones that already exist.

Yes, you can point an agent at the examples and it will understand it.

To demonstrate just how well it works there is a boids simulation chart where the chart data functions as starting locations for the boids. It is totally overkill and ridiculous and silly. It does show the power of the framework.

Some charts and plugins are AI generated without thorough review. They are listed under an /experimental folder to make it explicit they are not polished.

Gotchas

  • WebGPU - this uses it so if it isn't there it will not work. No fallback is provided as the intent is for this library to be tiny and lean.
  • Appending data - Updating data is plenty fast even with larger datasets but it could be smarter. It doesn't support having a larger buffer size and only sending updated data. It is a full update internally for now.
  • Workers - The library will try and inline bundle the worker for maximum simplicity. If it fails, it will fallback to standard es worker loading.

Contribution

I test using bun which handles most of the bundling out of the box.

You can start a server watching files by running bun server.ts.