GPT-Vis
AI-native visualization library for the LLM era. Framework-agnostic, ready to use.
ยท ยท ยท

โจ Features
- ๐ Framework Agnostic โ Works with vanilla JavaScript, React, Vue, Angular, or any framework
- โ๏ธ Markdown-like Syntax โ Simple syntax that LLMs can generate directly, easy to learn and use
- ๐ Streaming Rendering โ Native support for AI model streaming output, renders as it generates
- ๐ก๏ธ Fault Tolerant โ Gracefully handles incomplete or malformed data, adapts to the uncertainty of AI-generated content
- ๐ 26 Chart Types โ Statistical charts, relationship graphs, and text visualizations covering mainstream scenarios
- ๐จ Theme System โ Built-in light, dark, and academy themes with customizable color palettes
๐ Quick Start
Installation
Basic Usage
Streaming Rendering
Charts render as the AI model generates, no need to wait for the full response:
๐ Syntax Guide
render() supports two input formats: vis syntax (ideal for LLM streaming) and JSON objects (ideal for programmatic use).
Vis Syntax
Declarative markdown-like syntax that LLMs can generate without learning complex APIs:
Pie chart:
Themes:
Three built-in themes, switchable via the theme property:
Custom Styles:
Use style to set line width, custom palettes, and more:
Quoted string values (for values with spaces):
Hierarchical data:
JSON Objects
Also supports passing JSON objects directly, ideal for programmatic use:
๐ Chart Types
26 chart types covering statistical analysis, relationship networks, and text visualization.
Statistical Charts (18)
Relationship Charts (6)
Text Visualization (2)
Explore all examples โ
๐ง Framework Integration
Vanilla JavaScript
React
Vue
Markdown Renderer (marked)
GPT-Vis syntax naturally works with Markdown code fences and integrates with any Markdown renderer. The following example uses marked + marked-highlight โ normal code blocks get syntax highlighting, while vis code blocks are rendered as interactive charts.
Install dependencies:
Complete example:
๐งฉ Shadcn/ui
Copy GPT-Vis React components directly into your project via shadcn CLI โ full source control, fully customizable.
Base Component
The universal GPTVis component accepts vis syntax strings or config objects for all 26 chart types:
Typed Chart Components
Each chart type has its own component with a typed config prop โ JSON only, chart-specific TypeScript validation:
All 26 chart types are available. Install any by name:
Each typed component automatically bundles the base GPTVis component as a dependency. Props like width, height, theme, wrapper, locale, className, and containerStyle are the same across all components.
๐ค AI Ecosystem
GPT-Vis provides a complete AI integration solution:
- โ Enable AI models to directly invoke visualization capabilities via Model Context Protocol
- โ Provide AI assistants with chart recommendation and generation capabilities, supporting both syntax mode and code mode output
๐ค Contributing
AI-Generated Code Policy: This project only merges AI-generated code.
- Submit an Issue describing the problem or feature request
- Tag @copilot to generate the implementation
- Submit a PR with AI-generated code
๐ License
ยฉ