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

@particle-academy/react-echarts

v1.0.1

Published

React component library wrapping Apache ECharts with typed components for every chart type

Readme

@particle-academy/react-echarts

React component library wrapping Apache ECharts with typed components for every chart type — 2D, 3D, and graphic layers.

Installation

# npm
npm install @particle-academy/react-echarts echarts

# pnpm
pnpm add @particle-academy/react-echarts echarts

# yarn
yarn add @particle-academy/react-echarts echarts

For 3D charts (globe, surface, scatter3D, bar3D):

npm install echarts-gl

Peer dependencies: react >= 18, react-dom >= 18, echarts >= 5.5

Quick Start

import { EChart, registerAll } from "@particle-academy/react-echarts";

// Register all chart types (convenience for quick start)
registerAll();

function App() {
  return (
    <EChart
      option={{
        xAxis: { type: "category", data: ["Mon", "Tue", "Wed", "Thu", "Fri"] },
        yAxis: { type: "value" },
        series: [{ type: "bar", data: [120, 200, 150, 80, 70] }],
      }}
    />
  );
}

Components

<EChart> — Base Component

Accepts any ECharts option object. Full power of ECharts with React lifecycle management.

<EChart
  option={echartsOption}
  theme="dark"
  renderer="canvas"
  autoResize={true}
  onEvents={{ click: (params) => console.log(params) }}
  style={{ height: 500 }}
/>

| Prop | Type | Default | Description | |------|------|---------|-------------| | option | EChartsOption | — | ECharts option object | | theme | string \| object | auto | Theme name or object. Auto-detects dark mode if omitted | | renderer | "canvas" \| "svg" | "canvas" | Rendering engine | | notMerge | boolean | false | Replace option instead of merging | | lazyUpdate | boolean | false | Delay chart update | | showLoading | boolean | false | Show loading animation | | loadingOption | object | — | Loading animation config | | onEvents | Record<string, Function> | — | Event handlers (click, mouseover, etc.) | | autoResize | boolean | true | Auto-resize on container change | | style | CSSProperties | { width: "100%", height: 400 } | Container style |

<EChart3D> — 3D Charts

Separate component that automatically loads echarts-gl before rendering. Shows a loading placeholder until the 3D engine is ready.

import { EChart3D } from "@particle-academy/react-echarts";

<EChart3D
  option={{
    globe: {
      baseColor: "#1a3b5c",
      shading: "color",
      atmosphere: { show: true },
      viewControl: { autoRotate: true },
    },
  }}
  style={{ height: 500 }}
/>

<EChartGraphic> — Graphic Layer

For custom drawing with the ECharts graphic API.

import { EChartGraphic } from "@particle-academy/react-echarts";

<EChartGraphic
  elements={[
    { type: "circle", shape: { cx: 100, cy: 100, r: 50 }, style: { fill: "#5470c6" } },
    { type: "text", style: { text: "Hello", x: 100, y: 100, fill: "#fff" } },
  ]}
/>

Hooks

useECharts

Core hook for custom integrations:

import { useECharts } from "@particle-academy/react-echarts";

function CustomChart() {
  const { chartRef, instance } = useECharts({
    option: { /* ... */ },
    autoResize: true,
  });

  return <div ref={chartRef} style={{ width: "100%", height: 400 }} />;
}

Dark Mode

Dark mode is automatic. When no theme prop is provided, the component detects prefers-color-scheme: dark and applies ECharts' built-in dark theme with a transparent background (so charts blend with your page's dark background). The theme updates reactively when the user toggles their system preference.

To override, pass a specific theme prop:

<EChart option={option} theme="dark" />    {/* Always dark */}
<EChart option={option} theme="vintage" /> {/* Always vintage */}
<EChart option={option} />                 {/* Auto dark/light */}

Tree Shaking

For production bundle optimization, use registerCharts to register only the chart types you need instead of registerAll:

import { registerCharts, BarChart, LineChart, GridComponent, TooltipComponent, CanvasRenderer } from "@particle-academy/react-echarts";

registerCharts([BarChart, LineChart, GridComponent, TooltipComponent, CanvasRenderer]);

Themes

Built-in theme presets:

import { registerBuiltinThemes } from "@particle-academy/react-echarts";

registerBuiltinThemes(); // Registers "dark-preset", "vintage", "pastel"

<EChart option={option} theme="vintage" />

Supported Chart Types

2D Charts: Line, Bar, Pie, Scatter, Radar, Heatmap, Candlestick, Boxplot, Treemap, Sunburst, Funnel, Gauge, Sankey, Graph, Parallel, ThemeRiver, Calendar, PictorialBar, Map, Custom, EffectScatter

3D Charts: Bar3D, Scatter3D, Line3D, Surface, Globe

Graphic: Rect, Circle, Ring, Arc, Polygon, Polyline, Path, Image, Text, Group — with keyframe animation support

License

MIT