# pi-asciichart

> Pi extension that renders line charts in the tool-result UI using asciichart

Latest version **0.1.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install pi-asciichart
pnpm add pi-asciichart
yarn add pi-asciichart
bun add pi-asciichart
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2026-09-24 |
| First published | 2026-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22.19.0 |
| Dependencies | 1 |
| Unpacked size | 16 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dustin Fox |
| Maintainers | unrelentingfox |
| Keywords | pi-package, pi, asciichart, chart, ascii, line-chart |

## Links

- npm: https://www.npmjs.com/package/pi-asciichart
- Repository: https://github.com/unrelentingfox/pi-asciichart
- Homepage: https://github.com/unrelentingfox/pi-asciichart#readme
- Issues: https://github.com/unrelentingfox/pi-asciichart/issues
- npm.io page: https://npm.io/package/pi-asciichart

## Dependencies (1)

- [asciichart](https://npm.io/package/asciichart.md) 1.5.25

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2026-09-24

## README

# pi-asciichart

[![npm version](https://img.shields.io/npm/v/pi-asciichart)](https://www.npmjs.com/package/pi-asciichart)
[![npm downloads](https://img.shields.io/npm/dm/pi-asciichart)](https://www.npmjs.com/package/pi-asciichart)
[![CI](https://img.shields.io/github/actions/workflow/status/unrelentingfox/pi-asciichart/ci.yml?branch=mainline&label=CI)](https://github.com/unrelentingfox/pi-asciichart/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/unrelentingfox/pi-asciichart/graph/badge.svg)](https://app.codecov.io/gh/unrelentingfox/pi-asciichart)
[![Node.js](https://img.shields.io/node/v/pi-asciichart)](https://www.npmjs.com/package/pi-asciichart)
[![License](https://img.shields.io/github/license/unrelentingfox/pi-asciichart)](https://github.com/unrelentingfox/pi-asciichart/blob/mainline/LICENSE)

Pi extension that registers `render_chart`, a tool that displays plain-text line
charts in the tool-result UI using
[asciichart](https://github.com/kroitor/asciichart).

Charts render in the tool-result interface only and do not enter model context.
The agent receives a short status line instead of the chart text.

## Install

Add the package to your Pi settings:

```json
{
  "packages": [
    "git:github.com/unrelentingfox/pi-asciichart"
  ]
}
```

For local development, use the path directly:

```json
{
  "packages": [
    "~/workplace/pi/pi-asciichart"
  ]
}
```

## Features

- Up to 12 series with distinct ANSI colors and legend symbols
- Responsive width: charts use the full pane width and redraw after resize
- Configurable trailing resize debounce (default 1000 ms)
- Linear interpolation when the pane is wider than the data
- Peak-preserving downsampling when narrower
- Scientific notation for overflow y-axis labels
- Renderer registry designed for future chart types

## Configuration

Place `config.json` next to the extension entry point:

```json
{
  "resizeDebounceMs": 1000
}
```

Non-negative integer values are accepted. Missing or invalid values use 1000 ms.

## Limits

- 12 series maximum (one distinct color/symbol pair each)
- 11-character y-axis label field (overflows switch to scientific notation)

Values per series and chart height are unconstrained.

## Example

```json
{
  "type": "line",
  "caption": "Weekly requests",
  "series": [
    { "name": "success", "values": [12, 18, 15, 24] },
    { "name": "failure", "values": [3, 2, 5, 1] }
  ],
  "height": 8,
  "precision": 0
}
```

## Development

```bash
npm install
npm test
npm run typecheck
```

## License

MIT

---
_Source: https://npm.io/package/pi-asciichart · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
