portaljs-add-chart

Featured

Add a chart (line, bar, area, pie, or scatter) to a dataset's showcase in a PortalJS portal. Installs recharts, writes a reusable Chart component, and renders it in the showcase Views section. Use when visualizing a dataset already registered in datasets.json.

AI & Automation 2,343 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# PortalJS — Add Chart ## Overview Add a visualization to a dataset's **showcase** in a PortalJS portal. The skill installs `recharts` (added directly — never `@portaljs/components`), writes a reusable client-side `Chart` component into `components/`, and renders a `<Chart />` into the **Views** section of the showcase route `pages/[owner]/[slug].tsx` for one chosen dataset. The chart reads the same `/public/data/<file>` the showcase `<Table />` already uses, so no data is duplicated. Five chart types are supported: line, bar, area, pie, and scatter. ## Prerequisites - A scaffolded PortalJS portal (see `portaljs-new-portal`). - The target dataset already registered in `datasets.json` (see `portaljs-add-dataset`). - `components/ui/parseCsv.ts` present (ships with the template). - Node 18+ and npm available in the portal directory. ## Instructions The canonical, full step-by-step workflow is [`.claude/commands/portaljs-add-chart.md`](https://github.com/datopian/portaljs/blob/main/.claude/commands/portaljs-add-chart.md) — the single source of truth. Read and follow it when executing. Summary: 1. Gather input — dataset slug, X column, Y column(s), chart type (default `line`), portal directory. If any is missing, interview the user; never dead-end on a missing value. 2. Resolve the dataset from `datasets.json` (`namespace`, `file`, `format`). 3. Validate that the X and every Y column exist in the data file's header; warn on non-numeric Y columns (values are coerced wi...

Details

Author
datopian
Repository
datopian/portaljs
Created
14 years ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category