@ai-gui/plugin-chart
v0.29.2
Published
ECharts chart plugin for AIGUI — static SVG, interactive, and 3D (echarts-gl).
Maintainers
Readme
@ai-gui/plugin-chart
Chart plugin for AIGUI, powered by ECharts. The model emits a ```chart fenced block containing an ECharts option JSON. Charts are complete-gated: a skeleton shows while the option streams, then the full chart renders (never partial-drawn).
Install
pnpm add @ai-gui/plugin-chartInstall echarts-gl only when using chart({ gl: true }):
pnpm add echarts-glUsage
import { chart } from "@ai-gui/plugin-chart"
import { AIRenderer } from "@ai-gui/react"
<AIRenderer plugins={[chart({ interactive: true })]} />The model emits, e.g.:
```chart {"xAxis":{"type":"category","data":["A","B"]},"yAxis":{"type":"value"},"series":[{"type":"bar","data":[1,2]}]}```Options
interactive?: boolean— when true, complete options render a live ECharts instance (tooltip / dataZoom / click) via amountoutput. When false/omitted, they render a static SSR SVG.gl?: boolean— when true, render 3D charts via the optionalecharts-glpeer dependency (WebGL, live-only; implies interactive). Enables 3D series likebar3D,scatter3D,surface,line3D,globe,map3D.width?: number/height?: number— chart dimensions (default 600 × 400).
Exports
chart(options)— the plugin.chartPromptSpec()— the prompt-spec string (also folded in automatically bybuildSystemPromptwhen the plugin is passed).
See the root README for the full plugin list.
