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-modern-charts

v0.1.5

Published

SVG-first React chart library with d3-scale. Line, area, bar, pie, heatmap, combo charts. Lightweight, themeable, React 18+

Readme

react-modern-charts

A small, modern SVG-first React chart library using d3-scale and d3-shape for layout and path generation. Lightweight, themeable, and built for React 18+.

Chart Gallery

Install

npm i d3-array d3-scale d3-shape
npm i react-modern-charts

Import CSS once:

import "react-modern-charts/styles.css";

Quick Start

import { scaleLinear } from "d3-scale";
import { ThemeProvider, Chart, LineSeries } from "react-modern-charts";
import "react-modern-charts/styles.css";

function App() {
  const data = [{ value: 10 }, { value: 25 }, { value: 15 }, { value: 40 }];
  const xScale = scaleLinear().domain([0, 3]).range([0, 360]);
  const yScale = scaleLinear().domain([0, 50]).range([160, 0]);

  return (
    <ThemeProvider mode="light" palette="default">
      <Chart width={400} height={200} margin={{ top: 16, right: 16, bottom: 28, left: 40 }}>
        <LineSeries data={data} x={(_, i) => i} y={(d) => d.value} xScale={xScale} yScale={yScale} />
      </Chart>
    </ThemeProvider>
  );
}

Chart Types

| Chart | Component | Description | |-------|-----------|-------------| | Vertical Bar | BarSeries | Vertical bars | | Horizontal Bar | HorizontalBarSeries | Horizontal bars | | Stacked Bar | StackedBarSeries | Horizontal or vertical stacked segments (selective corner rounding) | | Grouped Bar | GroupedBarSeries | Side-by-side bars per category | | Area | AreaSeries | Filled area under line | | Line | LineSeries | Line with optional markers | | Multiaxis Line | MultiaxisLineChart | Line chart with two Y axes | | Pie | PieChart, PieSeries | Pie with optional legend | | Doughnut | PieChart (innerRadius) | Donut chart | | Polar Area | PolarAreaChart | Variable radius by value | | Radar | RadarChart | Spider/radar chart | | Scatter | ScatterSeries | Scatter plot | | Bubble | BubbleSeries | Scatter with variable size | | Multitype | ComboChart | Bar + line combo | | Gradient | LinearGradient, RadialGradient | All charts support fill="url(#id)" or stroke="url(#id)" | | Heatmap | HeatmapSeries | Grid with color intensity |

Full chart documentation → — Props, examples, and usage for each chart type.

Theming & Palettes

<ThemeProvider mode="light" palette="default" isGradientEnabled={true}>
  <YourCharts />
</ThemeProvider>

| Prop | Description | |------|-------------| | mode | "light" | "dark" — backgrounds, text, borders | | palette | Chart series colors (--msc-s1 through --msc-s5) | | isGradientEnabled | true (default) — use gradients; false — solid fills |

Predefined Palettes

| Palette | Colors | |---------|--------| | default | #118133, #343738, #78AE81, #64B66F, #5E656E (forest) | | forest | Same as default | | sage | #a4b494, #bec5ad, #3B5249, #519872, #34252F | | periwinkle | #EDFFEC, #61E786, #5A5766, #48435C, #9792E3 | | indigo | #30343F, #FAFAFF, #E4D9FF, #273469, #1E2749 | | ocean | #75DDDD, #508991, #172A3A, #004346, #09BC8A |

Use var(--msc-s1) through var(--msc-s5) in custom series to inherit palette colors. Access theme via useTheme().

Build

npm i
npm run build

Local Demo

Run the interactive playground:

cd .playground
npm i
npm run dev

Exports

Theme: ThemeProvider, useTheme
Primitives: Chart, Grid, AxisBottom, AxisLeft, AxisRight, ThresholdLine, ChartTitle, Legend
Series: LineSeries, AreaSeries, BarSeries, HorizontalBarSeries, GroupedBarSeries, StackedBarSeries, PieSeries, PolarAreaSeries, ScatterSeries, BubbleSeries, HeatmapSeries
Components: PieChart, PolarAreaChart, ComboChart, RadarChart, MultiaxisLineChart
Gradients: LinearGradient, RadialGradient
Tooltips: TooltipPortal, DefaultTooltip
Hooks: useChart, useNearestPoint