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

unplot

v0.0.1

Published

Read curves off a vector PDF — calibrated data + QA. Browser/TS port of the unplot Python package.

Readme

unplot (TypeScript port)

A browser-native TS port so unplot can run on a static page (e.g. GitHub Pages) with no Python, no server, no Pyodide. PDF vector geometry comes from pdf.js (pdfjs-dist, Apache-2.0); everything else is dependency-free array math.

Status. The full vector extract pipeline is ported and tested end-to-end: pdf.js → vector-path adapter (src/io/vector.ts) → axis calibration (src/axes/calibrate.ts, incl. folded ±-axis sign recovery) → de-fan / chain / split (src/curves/vectorpaths.ts, with the valley-join guard) → crossing separation (src/separate.ts) → shape QA + confidence (src/qa/*.ts, src/priors.ts) → extract() (src/extract.ts). Everything but pdf.js is dependency-free array math. Raster ingest is not yet ported.

bun test runs the suite: the pdf.js adapter recovery, the curve-geometry guards, an end-to-end extract() on a synthetic colour-keyed fixture, and folded-axis calibration parity.

bun install
bun test

Usage

import { extract, lobe } from "./src/index.ts";

const data = new Uint8Array(await (await fetch("plot.pdf")).arrayBuffer());
const cs = await extract(data, { expectedCurves: 3, prior: lobe(0.08), orderBy: "peak-x" });

for (const c of cs.curves) {
  console.log(c.id, c.style.color, c.qa.confidence, c.points); // points are [x, y] in DATA space
}
// The library assigns neutral handles c0, c1, ...; the caller maps order -> meaning:
// const named = labeled(cs, { 0: "blue", 1: "green", 2: "red" });

Demo

A static demo (demo/) runs the whole thing in the browser: drop a vector PDF, it renders the page with pdf.js, overlays the recovered curves on the render, shows per-curve QA/confidence, and exports CSV. For multi-page PDFs you can page through (each page extracts independently) or "Extract all pages" for a per-page summary and a combined CSV. For a page with several plots, drag a box around one plot's axes to extract just that plot (the auto-frame would otherwise span every plot on the page). No server, no upload — the bytes never leave the page. The bundled sample is a 4-page synthetic set, the last page two plots side by side (demo/make_sample.py).

bun run build:demo      # bundles app + pdf.js worker into demo/dist/ (GitHub Pages-ready)
bun run serve:demo      # serves demo/dist/ at http://localhost:8099

demo/dist/ is a build artifact (git-ignored); rebuild it on deploy. The bundled pdf.worker.js is large (~2 MB) — that's pdf.js, the only runtime dependency.