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

unipept-visualizations

v3.0.0

Published

The Unipept visualisation library

Readme

Unipept Visualizations

npm CI license

Stand-alone, reusable versions of the visualizations built for Unipept: a treeview, a treemap, a sunburst, a heatmap and a barplot. Written in TypeScript on top of D3 7 and aimed at rendering large datasets quickly — SVG and plain DOM where that is fast enough, an HTML canvas where it is not.

Try them in your browser →

| | | | --- | --- | | treeview | sunburst | | treemap | barplot |

heatmap

Installation

npm install unipept-visualizations

D3 is bundled into the published file, so you do not need to load it separately.

Usage

Every visualization is a class that renders into an element you give it, and takes an optional settings object:

import { Treeview } from "unipept-visualizations";

new Treeview(document.getElementById("example"), data, {
    width: 900,
    height: 600,
    colorProviderLevels: 3,
});

Treeview, Treemap and Sunburst all take the same hierarchical data — a tree of nodes carrying at least a count and a selfCount, with id, name and children filled in for you when they are missing:

const data = {
    id: 1,
    name: "root",
    count: 12,
    selfCount: 0,
    children: [
        { id: 2759, name: "Eukaryota", count: 7, selfCount: 2, children: [] },
        { id: 2, name: "Bacteria", count: 5, selfCount: 5 },
    ],
};

Barplot takes an array of bars, each with a label and its items:

import { Barplot } from "unipept-visualizations";

new Barplot(document.getElementById("example"), [
    { label: "Sample 7", items: [{ label: "Blautia obeum", counts: 1 }] },
    { label: "Sample 8", items: [{ label: "Blautia obeum", counts: 4 }] },
]);

Heatmap takes a matrix and its labels:

import { Heatmap } from "unipept-visualizations";

new Heatmap(document.getElementById("example"), values, rowLabels, columnLabels);

Without a bundler, import the package from a CDN as an ES module:

<div id="example"></div>
<script type="module">
    import { Treeview } from "https://cdn.jsdelivr.net/npm/unipept-visualizations/+esm";
    new Treeview(document.getElementById("example"), data);
</script>

Documentation

The settings for each visualization are documented on the wiki. The examples/ directory has a working page per visualization, and those are what the live examples are built from.

Development

npm install
npm run build      # bundle and type declarations into dist/
npm test           # unit tests plus visual regression tests in a real browser
npm run lint
npm run typecheck

npm run dev serves the repository so the pages in examples/ can be opened against your working copy; see examples/README.md.

The visual regression tests screenshot the visualizations in Chromium and compare against test/snapshots. When a change is meant to alter what is drawn, delete the affected snapshot and let the next run record it, then check the new image before committing it.

Releasing

Bump the version in package.json, commit, then push a matching tag:

git tag v2.2.6
git push origin v2.2.6

That runs publish.yml, which reruns CI, checks the tag against package.json, publishes to npm with provenance and creates the GitHub release. A prerelease tag such as v3.0.0-rc.1 is published under the next dist-tag instead of latest.

Citing

If you use this library in published work, please cite Unipept Visualizations: an interactive visualization library for biological data (Bioinformatics, 2021). CITATION.cff has the machine-readable version.

License

MIT