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

ink-pie-chart

v0.1.0

Published

A pie/donut chart component for the Ink CLI framework

Readme

ink-pie-chart

A pie / donut chart component for Ink, the React renderer for CLIs.

Slices are rasterized onto a square pixel grid and rendered two pixels per terminal row using Unicode half-block characters (▀ ▄ █), so the chart reads as an actual circle rather than a bar-chart substitute.

      ▄▄▄▄▄▄
   ▄▄████████▄▄        ■ Chrome    65.0%
  ██████████████       ■ Firefox   20.0%
  ██████████░░██       ■ Safari    10.0%
  ██████████░░░░       ■ Other      5.0%
   ▀▀██████░░▀▀
      ▀▀▀▀▀▀

Install

npm install ink-pie-chart ink react

ink (>=6) and react (>=19) are peer dependencies.

Usage

import React from 'react';
import { render } from 'ink';
import { PieChart } from 'ink-pie-chart';

render(
  <PieChart
    data={[
      { label: 'Chrome', value: 65 },
      { label: 'Firefox', value: 20 },
      { label: 'Safari', value: 10 },
      { label: 'Other', value: 5 },
    ]}
  />
);

Donut chart

<PieChart
  donut
  radius={6}
  data={[
    { label: 'Pass', value: 92, color: 'green' },
    { label: 'Fail', value: 8, color: 'red' },
  ]}
  format={(value, percent) => `${value} (${percent.toFixed(0)}%)`}
/>

Props

| Prop | Type | Default | Description | | ---------------- | -------------------------------------------------- | --------- | ------------------------------------------------------------------------ | | data | { label: string; value: number; color?: string }[] | — | Slices to render. Non-positive values are skipped. | | radius | number | 8 | Chart radius in terminal rows. | | donut | boolean | false | Renders a ring instead of a filled pie. | | innerRadius | number | 0.5 | Donut hole size as a fraction of radius (0-1). Only used when donut. | | startAngle | number | 0 | Degrees clockwise from the top where the first slice begins. | | clockwise | boolean | true | Direction slices are laid out in. | | showLegend | boolean | true | Whether to render the legend. | | legendPosition | 'right' \| 'bottom' | 'right' | Where the legend is placed relative to the chart. | | format | (value: number, percent: number) => string | ${percent.toFixed(1)}% | Formats each legend row's value. | | colors | string[] | built-in palette | Categorical colors used in data order for slices without their own color. |

Each data point may set its own color (hex code or Ink color name), which takes precedence over colors and the built-in palette.

Development

npm install
npm run build     # compile to dist/
npm run demo      # build and run bin/demo.tsx
npm test          # jest unit + component tests
npm run lint

License

MIT