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

@samirdamle/nano-charts

v0.6.0

Published

Extremely lightweight, zero-dependency TypeScript library for tiny SVG charts.

Readme

@samirdamle/nano-charts

Extremely lightweight, zero-dependency TypeScript library for tiny SVG charts — sparklines, micro bars, donuts, bullets, scatter, and heatmaps — the kind you repeat hundreds of times across table cells and metric cards.

  • 12 kB gzipped for all 12 charts — zero runtime dependencies, pure JS + SVG.
  • Framework-agnostic scene model core (data → Scene) + a toSVG serializer.
  • SSR-safe & deterministic. Inherits text color via currentColor. Accessible by default.
  • Hover and click events; customizable and theme-able.
  • React wrapper: @samirdamle/nano-charts-react.
  • MIT licensed.

Live demo · GitHub · API reference

Install

npm i @samirdamle/nano-charts

Usage

import { line, toSVG } from '@samirdamle/nano-charts';

const scene = line([4, 9, 2, 7, 5]);
const svg = toSVG(scene); // '<svg …>…</svg>' — drop into any HTML

// Import just one chart for the smallest bundle:
import { bar } from '@samirdamle/nano-charts/bar';

Every chart is (data, options?) => Scene. scene.points exposes each data point's computed { id, label, value, x, y } so UI wrappers can attach hover/click handlers. Rendered dot circles also carry data-index/data-series attributes in the toSVG output, so hit-testing a specific point no longer requires reverse-mapping coordinates — the DOM node names its own point index.

Full API reference: docs/API.md — every chart's data shapes and options, the Scene model, toSVG, and bundle-size positioning.

Charts

| Function | Encodes | Data | |----------|---------|------| | line | trend — straight or smooth spline | number[], {id,label,value}[], or accessors | | lines | multi-series trend overlay | LineSeries[] — each series is { data, name?, color?, strokeWidth?, strokeDasharray?, strokeLinecap?, dot?, dotRadius? } | | area | filled trend | same shapes as line | | bar | magnitude — simple, stacked, grouped, or waterfall | series, or nested arrays for stacks/groups | | donut | proportion — full or partial dial | { value, max } (gauge) or segments | | gauge | dial gauge — arc/needle, zones | { value, max } | | scatter | 2D relationship — per-point colors | [x,y][], {x,y}[] (+ color), or accessors | | winLoss | direction/sign | series | | bullet | value vs target | { value, target, ranges? } | | radar | multi-axis spider | number[] (one value per axis) | | heatmap | intensity grid | number[][] (+ colorScale) | | pictogram | countable unit blocks | counts (number[]) |

License

MIT © Samir Damle