/portaljs:portaljs-add-chart runs instead · from portaljs
Adds line, bar, area, pie, or scatter charts to a dataset's showcase in a PortalJS portal. Installs recharts, creates a reusable Chart component, and renders it in the showcase Views section.
This skill never runs in Claude Code
It ships in portaljs at skills/, but /portaljs:portaljs-add-chart (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
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.
portaljs-new-portal).datasets.json (see portaljs-add-dataset).components/ui/parseCsv.ts present (ships with the template).The canonical, full step-by-step workflow is
.claude/commands/portaljs-add-chart.md —
the single source of truth. Read and follow it when executing. Summary:
line), portal
directory. If any is missing, interview the user; never dead-end on a missing value.datasets.json (namespace, file, format).Number()).npm install recharts@^2.15.0.components/Chart.tsx (idempotent — do not overwrite a customized component).<Chart /> into the Views section, gated on the dataset's (namespace, slug) so
other showcases are unaffected. Extend an existing view-dispatch block, do not overwrite.npx tsc --noEmit.components/Chart.tsx (recharts wrapper, if absent).pages/[owner]/[slug].tsx (import + gated <Chart /> in Views);
package.json (recharts@^2.15.0).t() (lib/i18n.ts), with the
keys added to locales/en.json and every other locales/*.json; npm run i18n:check
passes.npx tsc --noEmit passes./@<namespace>/<slug> under a "Views" heading.| Symptom | Cause | Fix |
|---|---|---|
| Missing dataset/columns | Slug or column not in manifest/header | List available slugs/headers and re-prompt; do not error out. |
| Gaps in the chart | Non-numeric cells coerced to NaN | Clean the source data or pick a numeric Y column. |
tsc failure | Bad column prop or import path | Fix the first reported error before reporting success. |
| Sluggish render | Over ~2,000 SVG points | Pre-aggregate the series (e.g. yearly buckets). |
/portaljs-add-chart co2-emissions x=year y=emissions type=line
/portaljs-add-chart trade x=year y=imports,exports type=bar
/portaljs-add-chart budget x=department y=amount type=pie
.claude/commands/portaljs-add-chart.mdreferences/reference.mdportaljs-add-dataset, portaljs-add-map, portaljs-define-schemaWhat SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/arcgis-to-portaljsMigrate a whole ArcGIS Hub site into a PortalJS Arc portal end-to-end. Harvests the Hub /data.json (DCAT-US) inventory, exports every FeatureService layer through the ArcGIS REST query API with resultOffset paging, converts each to the serverless dual tier (PMTiles render + GeoParquet query) with tabular items to Parquet, pushes everything to Cloudflare R2 via Git LFS, appends dual-tier datasets.json entries, and writes a source-vs-derived parity report. Use to move a City or sector ArcGIS Hub open-data portal onto PortalJS with no server-side compute./portaljs-add-datasetAdd a dataset (CSV, TSV, JSON, or GeoJSON) to an existing PortalJS portal. Appends an entry to datasets.json so the catalog and showcase render it automatically; routes the data by source (local file vs remote URL) — R2 via Git LFS by default, remote URLs by passthrough. Use when registering a new dataset in a scaffolded portal./portaljs-add-dcatnpx claudepluginhub datopian/portaljs --plugin portaljsOther plugins' skills for the same job