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

@neelansh/chartgpu

v0.1.0

Published

High-performance WebGPU charting library for finance and dashboards

Readme

ChartGPU

High-performance financial charting library powered by WebGPU. Renders candlesticks on the GPU — handles thousands of candles and high-frequency real-time feeds without frame drops.

Live Demo · Docs


Install

npm install chartgpu

Requires a WebGPU-capable browser: Chrome 113+, Edge 113+, Safari 18+.


Quick Start

<div id="chart" style="width:100%;height:500px;position:relative;"></div>
import {
  Chart,
  CandlePanel, VolumePanel, RSIPanel, MACDPanel,
  SMAIndicator, EMAIndicator,
} from 'chartgpu';

const chart = new Chart('#chart', { candles, timeframe: '1m' });

const candle = new CandlePanel();
candle.addIndicator(new SMAIndicator(20, { color: '#f59e0b' }));
candle.addIndicator(new EMAIndicator(50, { color: '#a78bfa' }));

chart
  .addPanel(candle)
  .addPanel(new VolumePanel())
  .addPanel(new RSIPanel(14))
  .addPanel(new MACDPanel(12, 26, 9));

The chart mounts itself, handles resize automatically, and begins GPU rendering. No configuration needed beyond passing your candle data.


Features

Chart types

  • Candlestick, OHLC, Line, Area, Baseline

Panels

  • Volume, RSI, MACD — each with its own Y axis and proportional height

Indicators (overlay on price panel)

  • SMA, EMA, Bollinger Bands, Volume Profile

Drawing tools

  • Trend Line, Horizontal Ray
  • Fibonacci Retracement (7 levels, color-coded)
  • Rectangle (drag to annotate a price/time region)
  • Parallel Channel (3-click tool with midline and fill)

Data & UX

  • Data decimation — pixel-aligned OHLC merge keeps render cost constant regardless of dataset size
  • Log scale — toggle between linear and logarithmic Y axis
  • Theme API — built-in dark/light themes, fully customizable
  • Multiple Y axes — overlay a second series (e.g. ETH on a BTC chart) with its own independent scale
  • Live streamingconnectStream() accepts a WebSocket or async iterable, handles append-vs-update automatically
  • Touch & pinch zoom — full mobile support

Live Streaming

// WebSocket
const disconnect = chart.connectStream(new WebSocket('wss://your-feed/candles'));

// Async iterable
const disconnect2 = chart.connectStream(myAsyncGenerator());

// Stop
disconnect();

Incoming candles with the same timestamp update the last candle in place (tick update). Newer timestamps append a new candle.


Themes

import { darkTheme, lightTheme, type ChartTheme } from 'chartgpu';

chart.setTheme(lightTheme);

// Custom theme (partial override)
chart.setTheme({ ...darkTheme, bull: '#00c087', bear: '#ff5757' });

Drawing Tools

import { FibonacciRetracement, Rectangle, ParallelChannel, TrendLine } from 'chartgpu';

const fib = new FibonacciRetracement();
chart.addTool(fib);

// Activate (only one tool active at a time)
fib.active = true;
chart.activateTool(fib);

// Deactivate
fib.active = false;
chart.activateTool(null);

Overlay Panel (Secondary Y Axis)

import { OverlayPanel } from 'chartgpu';

const eth = new OverlayPanel({ color: '#f472b6', label: 'ETH', side: 'left' });
eth.setData(ethCandles);
chart.addOverlay(eth);

Volume Profile

import { VolumeProfileIndicator } from 'chartgpu';

const vp = new VolumeProfileIndicator({ buckets: 40 });
candlePanel.addIndicator(vp);

Draws a horizontal histogram on the right edge showing volume by price level. The Point of Control (highest-volume bucket) is highlighted.


TypeScript

Fully typed. All classes, options, and events have complete declarations.

import type { Candle, ChartTheme, DrawState } from 'chartgpu';

Custom Panels & Indicators

Extend Panel or Indicator to build your own:

import { Indicator, type DrawState } from 'chartgpu';

export class VWAPIndicator extends Indicator {
  readonly legendName = 'VWAP';

  legendValue(candles: Candle[], idx: number) {
    // return string value at idx for legend display
    return null;
  }

  draw(state: DrawState): void {
    const { ctx, candles, viewport, section, chartWidth, paddingX, priceRange } = state;
    // draw on ctx using the provided coordinates
  }
}

candlePanel.addIndicator(new VWAPIndicator());

Browser Support

| Browser | Version | |---|---| | Chrome / Edge | 113+ | | Safari | 18+ | | Firefox | Nightly (WebGPU behind flag) |

Falls back gracefully — the GPU canvas is simply hidden if WebGPU is unavailable, and Canvas2D rendering still works for all panel types except CandlePanel.


License

MIT