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

@miclivs/pi-charts

v0.1.5

Published

Pi extension for rendering charts — powered by charts-cli SDK

Readme

pi-charts

Chart rendering for pi. Powered by charts-cli SDK and ECharts.

Ask pi to "chart this data" and get a rendered PNG, inline in the conversation and saved to disk. Bar, line, pie, scatter, radar, funnel, gauge, treemap, boxplot, heatmap, candlestick, sankey. All 12 ECharts series types, plus full component support.

pi-charts demo

Install

pi install npm:@miclivs/pi-charts

Usage

Just ask pi to visualize data. The extension adds two tools the LLM calls automatically:

  • "Plot monthly revenue as a bar chart" → grouped bar chart with legend
  • "Show a pie chart of browser market share" → pie with labeled segments
  • "Heatmap of commits by day and hour" → color-scaled grid
  • "Radar chart comparing Alice and Bob's skills" → overlaid radar polygons

The LLM fetches the schema first (chart_schema), builds a valid ECharts config, then renders it (render_chart).

Tools

chart_schema

Get the JSON schema for any chart type or component. The LLM uses this to build valid configs.

chart_schema({ type: "list" })     # list all available types
chart_schema({ type: "bar" })      # schema for bar series
chart_schema({ type: "xAxis" })    # schema for xAxis component
chart_schema({ type: "full" })     # complete EChartsOption schema

Series: bar, line, pie, scatter, radar, funnel, gauge, treemap, boxplot, heatmap, candlestick, sankey

Components: title, tooltip, grid, xAxis, yAxis, legend, dataZoom, visualMap, toolbox, dataset, radar-coord, polar, geo

render_chart

Render an ECharts JSON configuration to PNG.

render_chart({
  option: '{"xAxis":{...},"series":[...]}',
  width: 1200,
  height: 600,
  theme: "dark",
  filename: "revenue"
})

The image renders inline in the conversation via a custom renderResult component. If saveToDisk is enabled (default), it's also written to .charts/output/.

Settings

On first render, .charts/settings.json is created with defaults:

{
  "saveToDisk": true,
  "width": 1200,
  "height": 600,
  "defaultTheme": "dark",
  "maxWidthCells": 90
}

| Setting | Default | Description | |---------|---------|-------------| | saveToDisk | true | Save rendered PNGs to .charts/output/ | | width | 1200 | Default image width in pixels | | height | 600 | Default image height in pixels | | defaultTheme | "dark" | Default ECharts theme (dark, vintage, or null for light) | | maxWidthCells | 90 | Max terminal cell width for inline image display |

How it works

  1. LLM calls chart_schema to get the JSON schema for the chart type it needs
  2. LLM builds a valid ECharts option object using the schema
  3. LLM calls render_chart with the option JSON
  4. Extension calls charts-cli SDK → ECharts server-side render → SVG → resvg → PNG
  5. PNG is returned inline as a base64 image (rendered via pi-tui Image component)
  6. PNG is also saved to .charts/output/ if saveToDisk is enabled

No browser. No GUI. No network requests. Everything runs locally via ECharts SSR.

License

MIT