HomeBookmarks
gpt-visgpt-vis
gpt-vis

gpt-vis

GVby gpt-vis
3components11.7Kviews32bookmarks

Installs all 26 components. Without our CLI, run instead.

Auto-indexed

gpt-vis contents

  • Column Chart

    Column Chart

  • Pie ChartPie Chart

    Pie Chart

  • Funnel Chart

    Funnel Chart

  • That's all 3 components

    About gpt-vis

    gpt-vis publishes a shadcn registry at gpt-vis.antv.vision, with 26 components installable through the shadcn CLI.

    Components
    26
    GitHub stars
    807
    Last commit
    Nov 17, 2026
    Repository
    antvis/GPT-Vis

    Also in the gpt-vis registry

    Copy a prompt for your agent, copy the install command, or open the docs that ship it.

    • GPT-Vis Area Chart

      area

      An area chart component for @antv/gpt-vis. Show data trends over time with optional stacking.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Bar Chart

      bar

      A horizontal bar chart component for @antv/gpt-vis. Compare categorical data with optional grouping and stacking.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Boxplot Chart

      boxplot

      A boxplot chart component for @antv/gpt-vis. Compare statistical distributions across categories.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Dual Axes Chart

      dual-axes

      A dual axes chart component for @antv/gpt-vis. Combine column and line charts for trend and comparison.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Fishbone Diagram

      fishbone-diagram

      A fishbone diagram component for @antv/gpt-vis. Display cause-and-effect analysis with a fish skeleton structure.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Flow Diagram

      flow-diagram

      A flow diagram component for @antv/gpt-vis. Show process steps and decision points.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Histogram Chart

      histogram

      A histogram chart component for @antv/gpt-vis. Show frequency distribution of data points within ranges.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Indented Tree

      indented-tree

      An indented tree component for @antv/gpt-vis. Display hierarchical data with indented layout.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Line Chart

      line

      A line chart component for @antv/gpt-vis. Visualize trends over time with optional multi-series grouping.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Liquid Chart

      liquid

      A liquid fill chart component for @antv/gpt-vis. Display a single percentage value with various shapes.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Mind Map

      mindmap

      A mind map component for @antv/gpt-vis. Organize hierarchical information with branches from a central topic.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Network Graph

      network-graph

      A network graph component for @antv/gpt-vis. Display relationships between entities with various layouts.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Organization Chart

      organization-chart

      An organization chart component for @antv/gpt-vis. Visualize hierarchical organizational structures.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Radar Chart

      radar

      A radar chart component for @antv/gpt-vis. Display multidimensional data across four or more axes.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Sankey Diagram

      sankey

      A sankey diagram component for @antv/gpt-vis. Show data flow between stages or categories.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Scatter Chart

      scatter

      A scatter chart component for @antv/gpt-vis. Show relationships between two variables with optional grouping.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Summary

      summary

      A summary component for @antv/gpt-vis. Render rich text narratives with T8 markdown-like syntax.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Treemap Chart

      treemap

      A treemap chart component for @antv/gpt-vis. Display hierarchical data with nested rectangles.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Venn Diagram

      venn

      A Venn diagram component for @antv/gpt-vis. Show set relationships and intersections.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Violin Chart

      violin

      A violin chart component for @antv/gpt-vis. Show data distribution density across categories.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Waterfall Chart

      waterfall

      A waterfall chart component for @antv/gpt-vis. Show cumulative effect of sequential positive and negative values.

      @antv/gpt-vis, clsx, tailwind-merge2 files
    • GPT-Vis Word Cloud Chart

      word-cloud

      A word cloud chart component for @antv/gpt-vis. Visualize word frequency by text size.

      @antv/gpt-vis, clsx, tailwind-merge2 files

    From the gpt-vis readme

    English | 简体中文

    GPT-Vis

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

    📖 Documentation · 🎨 Examples · 🔌 MCP Server · 🧩 Chart Skill

    ✨ 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
    • 🎨 Reusable Themes — Share one ThemeSpec across all chart types; preview and refine it in Theme Studio, or create it with an AI skill

    🚀 Quick Start

    Installation

    npm install @antv/gpt-vis
    

    Basic Usage

    import { GPTVis } from '@antv/gpt-vis';
    
    const gptVis = new GPTVis({
      container: 'container',
      width: 600,
      height: 400,
    });
    
    gptVis.render({
      type: 'line',
      data: [
        { time: '2020', value: 100 },
        { time: '2021', value: 120 },
        { time: '2022', value: 150 },
      ],
    });
    

    Streaming Rendering

    Charts render as the AI model generates, no need to wait for the full response:

    import { GPTVis, isVisSyntax } from '@antv/gpt-vis';
    
    const gptVis = new GPTVis({ container: 'container', width: 600, height: 400 });
    let buffer = '';
    
    function onToken(token) {
      buffer += token;
      if (isVisSyntax(buffer)) {
        gptVis.render(buffer);
      }
    }
    

    📚 Syntax Guide

    render() supports two input formats: JSON objects (ideal for programmatic use) and DSL syntax (ideal for LLM streaming).

    Object Config

    Pass JSON objects directly for programmatic chart creation:

    Line chart:

    gptVis.render({
      type: 'line',
      data: [
        { time: '2020', value: 100 },
        { time: '2021', value: 120 },
        { time: '2022', value: 150 },
      ],
    });
    

    Pie chart:

    gptVis.render({
      type: 'pie',
      data: [
        { category: 'Android', value: 72 },
        { category: 'iOS', value: 28 },
      ],
      innerRadius: 0.6,
    });
    

    Themes:

    Built-in themes are switchable via the theme property. The original base themes keep their existing appearance:

    ThemeIdentifierBackgroundPalette
    Default (Light)default#FFF#5B6CFF #2DAF9E #F2B84B #EF6A6A #55A6D9 ...
    Darkdark#141414#5B6CFF #2DAF9E #F2B84B #EF6A6A #55A6D9 ...
    Academyacademy#FFF#4e79a7 #f28e2c #e15759 #76b7b2 #59a14f ...

    The website's 10 gallery styles are also built in:

    ThemeIdentifier
    GPT-Visgpt-vis
    Midnightmidnight
    Paperpaper
    Productproduct
    Neon Circuitneon-circuit
    Terra Printterra-print
    Mono Signalmono-signal
    Candy Popcandy-pop
    Poppop
    Bauhausbauhaus

    The branded gpt-vis preset is separate from the SDK's default.

    const chart = new GPTVis({ container: '#chart', theme: 'pop' });
    

    Names work in the constructor, chart JSON, and Syntax (theme pop). Summary receives its theme through the constructor. The supported name type is BuiltinThemeName.

    gptVis.render({
      type: 'line',
      data: [
        { time: '2020', value: 100 },
        { time: '2021', value: 120 },
      ],
      theme: 'dark',
    });
    

    Reusable custom themes:

    Pass a ThemeSpec object to the constructor's theme option to share colors, typography, spacing, and mark styles across all 26 chart types, including graphs, Table, and Summary:

    import { GPTVis, type ThemeSpec } from '@antv/gpt-vis';
    
    const theme: ThemeSpec = {
      id: 'my-report',
      label: 'My report',
      tokens: { colorDefault: '#7047eb', fontFamily: 'Arial, sans-serif', radius: 6 },
    };
    const chart = new GPTVis({ container: '#chart', theme });
    

    Precedence: single-chart config > custom ThemeSpec > GPT-Vis built-in theme. Within this hierarchy: built-in defaults < tokens < global style < charts[type].style < local style. Nested objects merge; arrays replace. A chart-level theme replaces the constructor's theme selection. Summary uses a constructor theme and T8 text, without a per-render style object.

    Explore Theme Studio, read the theme documentation, or use the theme creation guide to generate a ThemeSpec from your brand references.

    Unchanged Studio presets can be used by their built-in names. After customization, pass the full object as theme; a custom id is metadata and does not register a new name.

    Custom Styles:

    gptVis.render({
      type: 'line',
      data: [
        { time: '2020', value: 100 },
        { time: '2021', value: 120 },
      ],
      style: { mark: { line: { lineWidth: 3 } }, palette: ['#5B8FF9', '#5AD8A6'] },
    });
    

    DSL Syntax

    Declarative markdown-like syntax that LLMs can generate without learning complex APIs:

    vis [chart-type]
    [property] [value]
    data
      - [field] [value]
    

    Pie chart:

    vis pie
    data
      - category Sales
        value 30
      - category Marketing
        value 25
    innerRadius 0.6
    

    Themes:

    vis line
    data
      - time 2020
        value 100
      - time 2021
        value 120
    theme dark
    

    Custom Styles:

    Use style to set line width, custom palettes, and more:

    vis line
    data
      - time 2020
        value 100
      - time 2021
        value 120
    style
      mark
        line
          lineWidth 3
      palette
        - #5B8FF9
        - #5AD8A6
    

    Quoted string values (for values with spaces):

    vis pie
    data
      - category "Q1 Sales"
        value 30
      - category "Q2 Sales"
        value 25
    

    Hierarchical data:

    vis mindmap
    data
      - name Project Plan
        children
          - name Phase 1
          - name Phase 2
    

    Render DSL syntax:

    const visSyntax = `
    vis line
    data
      - time 2020
        value 100
      - time 2021
        value 120
      - time 2022
        value 150
    `;
    
    gptVis.render(visSyntax);
    

    📊 Chart Types

    26 chart types covering statistical analysis, relationship networks, and text visualization.

    Statistical Charts (18)

    ChartType Identifier
    Lineline
    Areaarea
    Columncolumn
    Barbar
    Piepie
    Scatterscatter
    Radarradar
    Funnelfunnel
    Waterfallwaterfall
    Dual Axesdual-axes
    Histogramhistogram
    Boxplotboxplot
    Violinviolin
    Vennvenn
    Sankeysankey
    Treemaptreemap
    Word Cloudword-cloud
    Liquidliquid

    Relationship Charts (6)

    ChartType Identifier
    Flow Diagramflow-diagram
    Network Graphnetwork-graph
    Mindmapmindmap
    Indented Treeindented-tree
    Organization Chartorganization-chart
    Fishbone Diagramfishbone-diagram

    Text Visualization (2)

    ChartType Identifier
    Tabletable
    Summarysummary

    Explore all examples → Examples Gallery

    🔧 Framework Integration

    Vanilla JavaScript

    import { GPTVis } from '@antv/gpt-vis';
    
    const gptVis = new GPTVis({ container: 'chart', width: 600, height: 400 });
    gptVis.render(visSyntaxString);
    

    React

    import { GPTVis } from '@antv/gpt-vis';
    import { useEffect, useRef } from 'react';
    
    function ChartComponent({ visSyntax }) {
      const containerRef = useRef();
      const gptVisRef = useRef();
    
      useEffect(() => {
        gptVisRef.current = new GPTVis({ container: containerRef.current, width: 600, height: 400 });
        return () => gptVisRef.current?.destroy();
      }, []);
    
      useEffect(() => {
        if (gptVisRef.current && visSyntax) {
          gptVisRef.current.render(visSyntax);
        }
      }, [visSyntax]);
    
      return ;
    }
    

    Vue

    
      
    
    import { ref, watch, onUnmounted } from 'vue';
    import { GPTVis } from '@antv/gpt-vis';
    
    const props = defineProps(['visSyntax']);
    const chartRef = ref(null);
    let gptVis = null;
    
    watch(
      () => props.visSyntax,
      (syntax) => {
        if (!gptVis) {
          gptVis = new GPTVis({ container: chartRef.value, width: 600, height: 400 });
        }
        gptVis.render(syntax);
      },
      { immediate: true },
    );
    
    onUnmounted(() => gptVis?.destroy());
    
    

    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:

    npm install @antv/gpt-vis marked marked-highlight highlight.js
    

    Complete example:

    import { Marked } from 'marked';
    import { markedHighlight } from 'marked-highlight';
    import hljs from 'highlight.js';
    import { GPTVis } from '@antv/gpt-vis';
    
    class GPTVisElement extends HTMLElement {
      connectedCallback() {
        const syntax = decodeURIComponent(this.dataset.syntax);
        this._instance = new GPTVis({ container: this });
        this._instance.render(syntax);
      }
      disconnectedCallback() {
        this._instance?.destroy();
      }
    }
    if (!customElements.get('gpt-vis')) {
      customElements.define('gpt-vis', GPTVisElement);
    }
    
    const marked = new Marked(
      markedHighlight({
        langPrefix: 'hljs language-',
        highlight(code, lang) {
          if (lang?.startsWith('vis')) return code;
          const language = hljs.getLanguage(lang) ? lang : 'plaintext';
          return hljs.highlight(code, { language }).value;
        },
      }),
      {
        renderer: {
          code({ text, lang }) {
            if (lang?.startsWith('vis')) {
              const syntax = encodeURIComponent(lang + '\n' + text);
              return ``;
            }
            return false;
          },
        },
      },
    );
    
    const markdown = `# My Report
    
    \`\`\`vis bar
    data
      - category Python
        value 28.1
      - category JavaScript
        value 18.5
      - category Java
        value 15.6
      - category "C/C++"
        value 12.3
    title 2024 Programming Language Popularity
    \`\`\`
    `;
    
    document.getElementById('content').innerHTML = marked.parse(markdown);
    

    🧩 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:

    npx shadcn@latest add @gpt-vis/gpt-vis
    
    import { GPTVis } from '@/components/ui/gpt-vis';
    
    ;
    

    Typed Chart Components

    Each chart type has its own component with a typed config prop — JSON only, chart-specific TypeScript validation:

    npx shadcn@latest add @gpt-vis/line
    
    import { Line } from '@/components/ui/line';
    
    ;
    

    All 26 chart types are available. Install any by name:

    npx shadcn@latest add @gpt-vis/pie
    npx shadcn@latest add @gpt-vis/bar
    npx shadcn@latest add @gpt-vis/mindmap
    # ...and more
    

    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:

    • MCP Server — Enable AI models to directly invoke visualization capabilities via Model Context Protocol
    • Chart Skill — Help AI assistants choose charts, generate JSON, Syntax or integration code, and create reusable themes with the bundled Theme Creator reference

    🤝 Contributing

    AI-Generated Code Policy: This project only merges AI-generated code.

    1. Submit an Issue describing the problem or feature request
    2. Tag @copilot to generate the implementation
    3. Submit a PR with AI-generated code

    📄 License

    MIT © AntV

    Read the rest on GitHub →

    Hooks and utilities

    • table

    Registries like gpt-vis

    Evil Charts

    Evil Charts

    by Legion Dev

    13

    components

    Bklit

    Bklit

    by bklitai

    5

    components

    Pace UI

    Pace UI

    by Pace UI

    12

    components

    Liquid Glass

    Liquid Glass

    by Samiullah

    1

    component

    Browse every shadcn registry we track →

    1. Components
    2. /
    3. gpt-vis
    4. /
    5. gpt-vis

    Related libraries

    vizcn · by vibecoding.tech

    vizcn · by vibecoding.tech

    by Eugene Shilow

    17

    components

    Evil Charts

    Evil Charts

    by Legion Dev

    13

    components

    visx

    visx

    by Airbnb

    29

    components

    ReUI

    ReUI

    by Sean Hello

    263

    components

    Spectrum UI

    Spectrum UI

    by Arihant jain

    108

    components

    Matrix

    Matrix

    by Daiwiik Harihar

    9

    components

    About gpt-vis

    gpt-vis is a component library on 21st.dev by gpt-vis with 3 public React components. Every component ships with a live interactive preview and full TSX source — copy the code, install it through the shadcn CLI, or pull it into Cursor or Claude Code over MCP.

    All 3 gpt-vis components

    • Column Chart
    • Funnel Chart
    • Pie Chart

    Browse all component libraries →