chartcn

json-render

Map registry item names to components for Vercel Labs–style dynamic trees.

Pattern

Agents emit JSON; the client looks up type in a component map keyed by registry item name:

const chartcnComponentMap = {
  "chart-area-basic": ChartAreaBasic,
  "chart-area-stacked": ChartAreaStacked,
  "chart-bar-basic": ChartBarBasic,
  "chart-bar-grouped": ChartBarGrouped,
  "chart-line-basic": ChartLineBasic,
  "chart-line-multi": ChartLineMulti,
}

Example node:

{
  "type": "chart-line-multi",
  "props": {}
}

Live demo

{
  "type": "chart-line-multi",
  "props": {}
}
Line Chart — Multi-series
Sessions by device

Unknown registry names resolve to a friendly fallback message in the demo map.

Implementation reference: apps/web/components/registry-demos/json-render-demo.tsx and skills/chartcn/SKILL.md.

On this page