wanghetommy/ichartjs
An agent-first, JSON-driven visualization runtime for interactive charts, project views, and process diagrams with Canvas and SVG support.
What it solves
iChart.js is designed to bridge the gap between AI agents and data visualization. It provides a structured, renderer-independent runtime that allows agents to move from raw data to a validated, rendered chart without guessing configuration fields or chart types.
How it works
The library provides a set of public APIs (a "planning contract") that an agent can follow to ensure accuracy. The workflow typically involves:
- Capability Discovery: The agent calls
getCapabilities()to see what the library can actually do. - Data Inspection: Using
inspectData(), the agent analyzes the dataset. - Planning: The agent uses
planChart()to determine the best chart type and encoding based on the user's intent. - Validation: The agent runs
validateSpec()to ensure the generated JSON specification is correct before rendering. - Rendering: The agent calls
createChart()to render the visualization using either SVG or Canvas. - Explanation: The agent uses
chart.explain()to describe the result to the user.
Who it’s for
- AI Agent Developers: Those building agents that need to generate professional, validated data visualizations.
- Frontend Developers: Developers integrating a visualization runtime into web applications where AI agents can operate.
- Coding Agents: Agents that can modify project code to implement charts.
Highlights
- Agent-First Design: Includes a machine-readable capability manifest and recipes for AI agents.
- Renderer Independent: Supports both SVG and Canvas rendering.
- Export Options: Capable of exporting to JSON, SVG, PNG, and JPEG.
- Broad Support: Includes foundational charts (Line, Bar, Pie, etc.), project views (Gantt, Timeline), and diagrams (Flow, Swimlane).
- Zero Production Dependencies: The runtime has no external production dependencies.
Related
- Project
- Project
- Project
- Project