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

react-scale-break-chart

v0.1.0

Published

A React SVG bar chart that compresses dominant values behind a zigzag break indicator, keeping small and large values readable side by side.

Readme

react-scale-break-chart

A zero-dependency React SVG bar chart that automatically compresses extreme value ranges behind a zigzag break indicator so both small and large values remain readable side-by-side.

CI npm

Features

  • Automatic scale break — detects when one series dominates others by an order of magnitude and compresses the upper region behind a styled zigzag indicator
  • Upper-region zoom — when dominant values are tightly clustered (< 10% variance), the chart zooms into the top of the Y-axis so small differences are still visible
  • Non-break zoom — when all values are clustered (e.g. 8.029M – 8.068M), the Y-axis automatically narrows around the data range rather than starting at 0
  • Transition zone — series that cross the break but fall below the zoomed region get proportional height above the break band
  • Responsive — auto-sizes to container width via ResizeObserver; supports height="auto" for container-driven height
  • Tooltips & hover — built-in hover effects with a clean tooltip; no external charting library needed
  • Tree-shakeable — ships ESM + CJS with TypeScript declarations
  • Minimal footprint — ~28 KB min (no D3, no Recharts)

Install

npm install react-scale-break-chart

Quick Start

import { ScaleBreakBarChart } from 'react-scale-break-chart';

const data = [
  { name: 'Jan', otc: 158_000, voice: 2_711_000, fbb: 7_286_000 },
  { name: 'Feb', otc: 146_000, voice: 2_673_000, fbb: 7_297_000 },
  { name: 'Mar', otc: 152_000, voice: 2_650_000, fbb: 7_310_000 },
];

const series = [
  { dataKey: 'otc',   label: 'OTC',             color: '#F5A623' },
  { dataKey: 'voice', label: 'Voice',            color: '#E74C3C' },
  { dataKey: 'fbb',   label: 'Fixed Broadband',  color: '#5B9BD5' },
];

function App() {
  return (
    <ScaleBreakBarChart
      data={data}
      series={series}
      height={400}
      breakThreshold={5}
      formatValue={(v) => v.toLocaleString('id-ID')}
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | ScaleBreakDataPoint[] | — | Array of data points; one per bar group | | series | SeriesConfig[] | — | Series definitions (dataKey, label, color) | | height | number \| 'auto' | 350 | Fixed px height or 'auto' for container-driven | | breakThreshold | number | 5 | Ratio above which the dominant series triggers a scale break | | formatValue | (n: number) => string | String | Formatter for value labels & tooltip | | className | string | — | Additional className on root wrapper |

How the Scale Break Works

┌────────────────────────────────────┐
│          Upper region              │  ← zoomed scale for dominant series
│  ╱╲╱╲╱╲╱╲╱╲╱╲╱╲  break indicator  │
│          Lower region              │  ← proportional scale for all series
│──────────────────────────── 0 ─────│
└────────────────────────────────────┘
  1. Break detection: When max(series₁) / max(series₂) > breakThreshold, the chart splits the Y-axis
  2. Lower region (40%): Shows small values proportionally
  3. Upper region (60%): Shows large values in a compressed (or zoomed) scale
  4. Transition zone: If the upper region is zoomed, bars between lowerMax and upperMin get sqrt-scaled height in a reserved 15% transition area

Development

npm install
npm run build       # tsup → dist/
npm run typecheck   # tsc --noEmit
npm test            # vitest
npm run dev         # tsup --watch

License

MIT © Angga Fardana