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

@zuttora/charts

v0.3.0

Published

Zuttora's own canvas charting package: candlesticks, square corners, no runtime dependencies.

Downloads

407

Readme

chartZ (@zuttora/charts)

Zuttora's own charting package: candlesticks on an HTML canvas, square corners, no runtime dependencies. The full design is in Zuttora's docs/charting.md (section 6).

import { createChart, zuttoraTheme, INTERVAL_MS, IST_OFFSET_MS } from '@zuttora/charts';

const chart = createChart(container, {   // the container must have a height
  intervalMs: INTERVAL_MS['5m'],
  tzOffsetMs: IST_OFFSET_MS,
  priceDecimals: 2,
  minMove: 0.05,
  theme: { ...zuttoraTheme, fontFamily: resolvedFontFamily },
});

chart.setData(closedCandles, formingCandle, hasMore);   // Candle = { t, o, h, l, c }, t = slot start in epoch ms
chart.applyTick(price, serverTime);                      // live prices: the last candle moves, slots roll over
chart.on('needMore', (oldest) => { /* load older candles, then chart.prependData(older, hasMore) */ });
chart.on('liveChange', (atLive) => { /* show or hide a "Go to live" button */ });

Also: replaceClosed, setOptions, setPriceLines, setMarkers, setIndicators, setDrawingTool, setDrawings, getDrawings, updateDrawing, deleteSelected, clearDrawings, setDrawingColor, scrollToLive, fitAll, destroy.

Drawing tools (setDrawingTool(tool)): hline, trend, ray, rect, fib, note and measure (a ruler that is never saved). Tap or click to place each point, or press and drag. A finished drawing is picked; drag it to move it, drag a square to move one point, Delete removes it, Escape backs out. Drawings sit at a time and a price, so they stay in place when the candle size changes. The host owns saving: listen to drawingsChange(list), store it, and restore with setDrawings(list). drawingEdit(drawing) fires when a note needs its words (updateDrawing(id, { text })); drawProgress tells a hint line how far along the trader is; setDrawingColor(color) colours the next drawing and the picked one.

Indicators (setIndicators(specs), diffed by id): sma, ema and bollinger are drawn over the candles; rsi and macd get their own pane under the price. They are calculated from every loaded close, the forming candle included, so they move live.

chart.setIndicators([
  { id: 'sma20', type: 'sma', period: 20, color: '#FFD34D' },
  { id: 'rsi', type: 'rsi', period: 14, color: '#C792EA' },
]);

Gestures: drag to pan, wheel or pinch to zoom, press and hold (touch) or hover (mouse) for the crosshair, drag the price axis to scale it, double-click or double-tap to reset, arrow keys, +/-, Home, End.

Status

| | | |---|---| | Core, rendering, interaction (M3 to M5) | done | | Indicators (M8) | done, 0.2.0 | | Drawing tools (M9) | done, 0.3.0 | | Published to npm | after review (needs the NPM_TOKEN secret) |

Develop

yarn install
yarn typecheck && yarn lint && yarn test && yarn build && yarn size
python3 -m http.server   # then open http://localhost:8000/demo/  (after yarn build)

Demo URL options: ?type=candles|line|area|heikinAshi&interval=1m|5m|10m|1h|3h|6h|1D&tick=200 (ms between fake ticks).

Rules: no runtime dependencies, TypeScript that Node can run by stripping types (no enum, namespace or constructor parameter properties), relative imports with the .ts extension, no rounded corners, no console outside src/core/warn.ts.