@antv/gpt-vis 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +261 -137
- package/README.zh-CN.md +263 -116
- package/dist/cjs/annotation/components/bottom-n.d.ts +2 -0
- package/dist/cjs/annotation/components/bottom-n.js +57 -0
- package/dist/cjs/annotation/components/centroid.d.ts +2 -0
- package/dist/cjs/annotation/components/centroid.js +75 -0
- package/dist/cjs/annotation/components/connector.d.ts +25 -0
- package/dist/cjs/annotation/components/connector.js +298 -0
- package/dist/cjs/annotation/components/contribution.d.ts +3 -0
- package/dist/cjs/annotation/components/contribution.js +136 -0
- package/dist/cjs/annotation/components/crossing.d.ts +3 -0
- package/dist/cjs/annotation/components/crossing.js +504 -0
- package/dist/cjs/annotation/components/event.d.ts +2 -0
- package/dist/cjs/annotation/components/event.js +62 -0
- package/dist/cjs/annotation/components/first.d.ts +2 -0
- package/dist/cjs/annotation/components/first.js +42 -0
- package/dist/cjs/annotation/components/group.d.ts +3 -0
- package/dist/cjs/annotation/components/group.js +73 -0
- package/dist/cjs/annotation/components/highlight.d.ts +14 -0
- package/dist/cjs/annotation/components/highlight.js +552 -0
- package/dist/cjs/annotation/components/index.d.ts +34 -0
- package/dist/cjs/annotation/components/index.js +128 -0
- package/dist/cjs/annotation/components/last.d.ts +2 -0
- package/dist/cjs/annotation/components/last.js +42 -0
- package/dist/cjs/annotation/components/max-x.d.ts +2 -0
- package/dist/cjs/annotation/components/max-x.js +41 -0
- package/dist/cjs/annotation/components/max-y.d.ts +2 -0
- package/dist/cjs/annotation/components/max-y.js +41 -0
- package/dist/cjs/annotation/components/mean.d.ts +2 -0
- package/dist/cjs/annotation/components/mean.js +50 -0
- package/dist/cjs/annotation/components/median.d.ts +2 -0
- package/dist/cjs/annotation/components/median.js +49 -0
- package/dist/cjs/annotation/components/min-x.d.ts +2 -0
- package/dist/cjs/annotation/components/min-x.js +41 -0
- package/dist/cjs/annotation/components/min-y.d.ts +2 -0
- package/dist/cjs/annotation/components/min-y.js +41 -0
- package/dist/cjs/annotation/components/outlier.d.ts +3 -0
- package/dist/cjs/annotation/components/outlier.js +83 -0
- package/dist/cjs/annotation/components/path.d.ts +20 -0
- package/dist/cjs/annotation/components/path.js +147 -0
- package/dist/cjs/annotation/components/peak.d.ts +2 -0
- package/dist/cjs/annotation/components/peak.js +42 -0
- package/dist/cjs/annotation/components/point.d.ts +26 -0
- package/dist/cjs/annotation/components/point.js +241 -0
- package/dist/cjs/annotation/components/quadrant.d.ts +3 -0
- package/dist/cjs/annotation/components/quadrant.js +97 -0
- package/dist/cjs/annotation/components/quantile.d.ts +2 -0
- package/dist/cjs/annotation/components/quantile.js +49 -0
- package/dist/cjs/annotation/components/range-inside.d.ts +2 -0
- package/dist/cjs/annotation/components/range-inside.js +65 -0
- package/dist/cjs/annotation/components/range-outside.d.ts +2 -0
- package/dist/cjs/annotation/components/range-outside.js +65 -0
- package/dist/cjs/annotation/components/range-x.d.ts +2 -0
- package/dist/cjs/annotation/components/range-x.js +39 -0
- package/dist/cjs/annotation/components/range-y.d.ts +2 -0
- package/dist/cjs/annotation/components/range-y.js +39 -0
- package/dist/cjs/annotation/components/range.d.ts +15 -0
- package/dist/cjs/annotation/components/range.js +87 -0
- package/dist/cjs/annotation/components/target.d.ts +2 -0
- package/dist/cjs/annotation/components/target.js +51 -0
- package/dist/cjs/annotation/components/text.d.ts +15 -0
- package/dist/cjs/annotation/components/text.js +74 -0
- package/dist/cjs/annotation/components/threshold-highlight.d.ts +3 -0
- package/dist/cjs/annotation/components/threshold-highlight.js +223 -0
- package/dist/cjs/annotation/components/threshold-x.d.ts +2 -0
- package/dist/cjs/annotation/components/threshold-x.js +39 -0
- package/dist/cjs/annotation/components/threshold-y.d.ts +2 -0
- package/dist/cjs/annotation/components/threshold-y.js +40 -0
- package/dist/cjs/annotation/components/top-n.d.ts +2 -0
- package/dist/cjs/annotation/components/top-n.js +57 -0
- package/dist/cjs/annotation/components/valley.d.ts +2 -0
- package/dist/cjs/annotation/components/valley.js +42 -0
- package/dist/cjs/annotation/index.d.ts +1 -0
- package/dist/cjs/annotation/index.js +29 -0
- package/dist/cjs/annotation/label.d.ts +38 -0
- package/dist/cjs/annotation/label.js +347 -0
- package/dist/cjs/annotation/layout.d.ts +12 -0
- package/dist/cjs/annotation/layout.js +142 -0
- package/dist/cjs/annotation/merge.d.ts +19 -0
- package/dist/cjs/annotation/merge.js +60 -0
- package/dist/cjs/annotation/registry.d.ts +190 -0
- package/dist/cjs/annotation/registry.js +134 -0
- package/dist/cjs/annotation/runtime/g2.d.ts +90 -0
- package/dist/cjs/annotation/runtime/g2.js +521 -0
- package/dist/cjs/annotation/runtime/g6.d.ts +40 -0
- package/dist/cjs/annotation/runtime/g6.js +310 -0
- package/dist/cjs/annotation/runtime/index.d.ts +11 -0
- package/dist/cjs/annotation/runtime/index.js +41 -0
- package/dist/cjs/annotation/runtime/summary.d.ts +17 -0
- package/dist/cjs/annotation/runtime/summary.js +39 -0
- package/dist/cjs/annotation/runtime/table.d.ts +16 -0
- package/dist/cjs/annotation/runtime/table.js +39 -0
- package/dist/cjs/annotation/utils.d.ts +40 -0
- package/dist/cjs/annotation/utils.js +275 -0
- package/dist/cjs/theme/annotation.d.ts +236 -0
- package/dist/cjs/theme/annotation.js +167 -0
- package/dist/cjs/theme/g2.js +13 -15
- package/dist/cjs/theme/g6.js +2 -2
- package/dist/cjs/theme/summary.js +2 -2
- package/dist/cjs/types/annotation.d.ts +310 -0
- package/dist/cjs/types/annotation.js +17 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/util/axis.d.ts +28 -0
- package/dist/cjs/util/axis.js +184 -0
- package/dist/cjs/util/components.d.ts +0 -10
- package/dist/cjs/util/components.js +9 -64
- package/dist/cjs/util/index.d.ts +7 -4
- package/dist/cjs/util/index.js +53 -9
- package/dist/cjs/vis/area/index.d.ts +2 -0
- package/dist/cjs/vis/area/index.js +30 -13
- package/dist/cjs/vis/bar/index.d.ts +2 -0
- package/dist/cjs/vis/bar/index.js +37 -7
- package/dist/cjs/vis/boxplot/index.js +14 -3
- package/dist/cjs/vis/column/index.d.ts +2 -0
- package/dist/cjs/vis/column/index.js +28 -9
- package/dist/cjs/vis/dual-axes/index.js +9 -9
- package/dist/cjs/vis/fishbone-diagram/index.js +2 -2
- package/dist/cjs/vis/flow-diagram/index.js +2 -2
- package/dist/cjs/vis/funnel/index.js +10 -13
- package/dist/cjs/vis/histogram/index.js +2 -2
- package/dist/cjs/vis/indented-tree/index.js +2 -2
- package/dist/cjs/vis/line/index.d.ts +2 -0
- package/dist/cjs/vis/line/index.js +26 -10
- package/dist/cjs/vis/liquid/index.js +2 -2
- package/dist/cjs/vis/mindmap/index.js +2 -2
- package/dist/cjs/vis/network-graph/index.d.ts +2 -0
- package/dist/cjs/vis/network-graph/index.js +24 -3
- package/dist/cjs/vis/organization-chart/index.js +2 -2
- package/dist/cjs/vis/pie/index.d.ts +2 -0
- package/dist/cjs/vis/pie/index.js +21 -10
- package/dist/cjs/vis/radar/index.js +4 -6
- package/dist/cjs/vis/sankey/index.js +14 -1
- package/dist/cjs/vis/scatter/index.d.ts +10 -3
- package/dist/cjs/vis/scatter/index.js +18 -7
- package/dist/cjs/vis/summary/index.d.ts +9 -2
- package/dist/cjs/vis/summary/index.js +25 -8
- package/dist/cjs/vis/table/index.d.ts +2 -0
- package/dist/cjs/vis/table/index.js +48 -30
- package/dist/cjs/vis/venn/index.js +2 -2
- package/dist/cjs/vis/violin/index.js +14 -3
- package/dist/cjs/vis/waterfall/index.js +17 -9
- package/dist/cjs/vis/word-cloud/index.js +4 -6
- package/dist/cjs/vis-wrapper/index.js +2 -1
- package/dist/esm/annotation/components/bottom-n.d.ts +2 -0
- package/dist/esm/annotation/components/bottom-n.js +42 -0
- package/dist/esm/annotation/components/centroid.d.ts +2 -0
- package/dist/esm/annotation/components/centroid.js +73 -0
- package/dist/esm/annotation/components/connector.d.ts +25 -0
- package/dist/esm/annotation/components/connector.js +332 -0
- package/dist/esm/annotation/components/contribution.d.ts +3 -0
- package/dist/esm/annotation/components/contribution.js +174 -0
- package/dist/esm/annotation/components/crossing.d.ts +3 -0
- package/dist/esm/annotation/components/crossing.js +665 -0
- package/dist/esm/annotation/components/event.d.ts +2 -0
- package/dist/esm/annotation/components/event.js +46 -0
- package/dist/esm/annotation/components/first.d.ts +2 -0
- package/dist/esm/annotation/components/first.js +18 -0
- package/dist/esm/annotation/components/group.d.ts +3 -0
- package/dist/esm/annotation/components/group.js +64 -0
- package/dist/esm/annotation/components/highlight.d.ts +14 -0
- package/dist/esm/annotation/components/highlight.js +838 -0
- package/dist/esm/annotation/components/index.d.ts +34 -0
- package/dist/esm/annotation/components/index.js +34 -0
- package/dist/esm/annotation/components/last.d.ts +2 -0
- package/dist/esm/annotation/components/last.js +18 -0
- package/dist/esm/annotation/components/max-x.d.ts +2 -0
- package/dist/esm/annotation/components/max-x.js +17 -0
- package/dist/esm/annotation/components/max-y.d.ts +2 -0
- package/dist/esm/annotation/components/max-y.js +17 -0
- package/dist/esm/annotation/components/mean.d.ts +2 -0
- package/dist/esm/annotation/components/mean.js +40 -0
- package/dist/esm/annotation/components/median.d.ts +2 -0
- package/dist/esm/annotation/components/median.js +32 -0
- package/dist/esm/annotation/components/min-x.d.ts +2 -0
- package/dist/esm/annotation/components/min-x.js +17 -0
- package/dist/esm/annotation/components/min-y.d.ts +2 -0
- package/dist/esm/annotation/components/min-y.js +17 -0
- package/dist/esm/annotation/components/outlier.d.ts +3 -0
- package/dist/esm/annotation/components/outlier.js +98 -0
- package/dist/esm/annotation/components/path.d.ts +20 -0
- package/dist/esm/annotation/components/path.js +165 -0
- package/dist/esm/annotation/components/peak.d.ts +2 -0
- package/dist/esm/annotation/components/peak.js +20 -0
- package/dist/esm/annotation/components/point.d.ts +26 -0
- package/dist/esm/annotation/components/point.js +277 -0
- package/dist/esm/annotation/components/quadrant.d.ts +3 -0
- package/dist/esm/annotation/components/quadrant.js +83 -0
- package/dist/esm/annotation/components/quantile.d.ts +2 -0
- package/dist/esm/annotation/components/quantile.js +32 -0
- package/dist/esm/annotation/components/range-inside.d.ts +2 -0
- package/dist/esm/annotation/components/range-inside.js +55 -0
- package/dist/esm/annotation/components/range-outside.d.ts +2 -0
- package/dist/esm/annotation/components/range-outside.js +55 -0
- package/dist/esm/annotation/components/range-x.d.ts +2 -0
- package/dist/esm/annotation/components/range-x.js +15 -0
- package/dist/esm/annotation/components/range-y.d.ts +2 -0
- package/dist/esm/annotation/components/range-y.js +15 -0
- package/dist/esm/annotation/components/range.d.ts +15 -0
- package/dist/esm/annotation/components/range.js +92 -0
- package/dist/esm/annotation/components/target.d.ts +2 -0
- package/dist/esm/annotation/components/target.js +44 -0
- package/dist/esm/annotation/components/text.d.ts +15 -0
- package/dist/esm/annotation/components/text.js +78 -0
- package/dist/esm/annotation/components/threshold-highlight.d.ts +3 -0
- package/dist/esm/annotation/components/threshold-highlight.js +297 -0
- package/dist/esm/annotation/components/threshold-x.d.ts +2 -0
- package/dist/esm/annotation/components/threshold-x.js +23 -0
- package/dist/esm/annotation/components/threshold-y.d.ts +2 -0
- package/dist/esm/annotation/components/threshold-y.js +24 -0
- package/dist/esm/annotation/components/top-n.d.ts +2 -0
- package/dist/esm/annotation/components/top-n.js +42 -0
- package/dist/esm/annotation/components/valley.d.ts +2 -0
- package/dist/esm/annotation/components/valley.js +20 -0
- package/dist/esm/annotation/index.d.ts +1 -0
- package/dist/esm/annotation/index.js +1 -0
- package/dist/esm/annotation/label.d.ts +38 -0
- package/dist/esm/annotation/label.js +449 -0
- package/dist/esm/annotation/layout.d.ts +12 -0
- package/dist/esm/annotation/layout.js +182 -0
- package/dist/esm/annotation/merge.d.ts +19 -0
- package/dist/esm/annotation/merge.js +67 -0
- package/dist/esm/annotation/registry.d.ts +190 -0
- package/dist/esm/annotation/registry.js +220 -0
- package/dist/esm/annotation/runtime/g2.d.ts +90 -0
- package/dist/esm/annotation/runtime/g2.js +754 -0
- package/dist/esm/annotation/runtime/g6.d.ts +40 -0
- package/dist/esm/annotation/runtime/g6.js +447 -0
- package/dist/esm/annotation/runtime/index.d.ts +11 -0
- package/dist/esm/annotation/runtime/index.js +26 -0
- package/dist/esm/annotation/runtime/summary.d.ts +17 -0
- package/dist/esm/annotation/runtime/summary.js +21 -0
- package/dist/esm/annotation/runtime/table.d.ts +16 -0
- package/dist/esm/annotation/runtime/table.js +21 -0
- package/dist/esm/annotation/utils.d.ts +40 -0
- package/dist/esm/annotation/utils.js +370 -0
- package/dist/esm/theme/annotation.d.ts +236 -0
- package/dist/esm/theme/annotation.js +186 -0
- package/dist/esm/theme/g2.js +2 -10
- package/dist/esm/theme/g6.js +1 -1
- package/dist/esm/theme/summary.js +1 -1
- package/dist/esm/types/annotation.d.ts +310 -0
- package/dist/esm/types/annotation.js +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/util/axis.d.ts +28 -0
- package/dist/esm/util/axis.js +222 -0
- package/dist/esm/util/components.d.ts +0 -10
- package/dist/esm/util/components.js +24 -69
- package/dist/esm/util/index.d.ts +7 -4
- package/dist/esm/util/index.js +7 -4
- package/dist/esm/vis/area/index.d.ts +2 -0
- package/dist/esm/vis/area/index.js +32 -9
- package/dist/esm/vis/bar/index.d.ts +2 -0
- package/dist/esm/vis/bar/index.js +37 -6
- package/dist/esm/vis/boxplot/index.js +10 -2
- package/dist/esm/vis/column/index.d.ts +2 -0
- package/dist/esm/vis/column/index.js +33 -12
- package/dist/esm/vis/dual-axes/index.js +10 -10
- package/dist/esm/vis/fishbone-diagram/index.js +1 -1
- package/dist/esm/vis/flow-diagram/index.js +1 -1
- package/dist/esm/vis/funnel/index.js +2 -7
- package/dist/esm/vis/histogram/index.js +4 -3
- package/dist/esm/vis/indented-tree/index.js +1 -1
- package/dist/esm/vis/line/index.d.ts +2 -0
- package/dist/esm/vis/line/index.js +31 -9
- package/dist/esm/vis/liquid/index.js +1 -1
- package/dist/esm/vis/mindmap/index.js +1 -1
- package/dist/esm/vis/network-graph/index.d.ts +2 -0
- package/dist/esm/vis/network-graph/index.js +29 -2
- package/dist/esm/vis/organization-chart/index.js +1 -1
- package/dist/esm/vis/pie/index.d.ts +2 -0
- package/dist/esm/vis/pie/index.js +25 -8
- package/dist/esm/vis/radar/index.js +1 -3
- package/dist/esm/vis/sankey/index.js +15 -1
- package/dist/esm/vis/scatter/index.d.ts +10 -3
- package/dist/esm/vis/scatter/index.js +28 -5
- package/dist/esm/vis/summary/index.d.ts +9 -2
- package/dist/esm/vis/summary/index.js +31 -13
- package/dist/esm/vis/table/index.d.ts +2 -0
- package/dist/esm/vis/table/index.js +50 -33
- package/dist/esm/vis/venn/index.js +1 -1
- package/dist/esm/vis/violin/index.js +10 -2
- package/dist/esm/vis/waterfall/index.js +16 -13
- package/dist/esm/vis/word-cloud/index.js +1 -3
- package/dist/esm/vis-wrapper/index.js +2 -1
- package/dist/umd/index.min.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> English | [简体中文](./README.zh-CN.md)
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
|
-
<img src="https://github.com/eosphoros-ai/GPT-Vis/assets/17919400/c8804ffb-d3d6-45d3-846f-cf217681ab05" height="70" />
|
|
5
|
-
</div>
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
[English](./README.md) · [简体中文](./README.zh-CN.md)
|
|
8
4
|
|
|
9
|
-
<
|
|
5
|
+
<a href="https://gpt-vis.antv.vision/">
|
|
6
|
+
<img src="https://github.com/eosphoros-ai/GPT-Vis/assets/17919400/c8804ffb-d3d6-45d3-846f-cf217681ab05" width="169" height="70" alt="GPT-Vis logo" />
|
|
7
|
+
</a>
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
# GPT-Vis: [Turn AI answers into charts.](https://gpt-vis.antv.vision/) ✨
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[](./LICENSE)
|
|
11
|
+
An open-source visualization library for AI agents and applications.<br />
|
|
12
|
+
Render charts from JSON or Syntax, add analysis annotations, and reuse your theme everywhere.
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<a href="https://github.com/antvis/mcp-server-chart" target="_blank">🔌 MCP Server</a> ·
|
|
21
|
-
<a href="/skills/chart-visualization" target="_blank">🧩 Chart Skill</a>
|
|
22
|
-
</p>
|
|
14
|
+
[](https://www.npmjs.com/package/@antv/gpt-vis)
|
|
15
|
+
[](https://www.npmjs.com/package/@antv/gpt-vis)
|
|
16
|
+
[](./LICENSE)
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
[Website](https://gpt-vis.antv.vision/) · [Documentation](https://gpt-vis.antv.vision/docs) · [Examples](https://gpt-vis.antv.vision/examples) · [Theme Studio](https://gpt-vis.antv.vision/themes) · [Agent Skill](https://gpt-vis.antv.vision/docs/agent-skill)
|
|
25
19
|
|
|
26
|
-
<
|
|
27
|
-
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*
|
|
28
|
-
</
|
|
20
|
+
<a href="https://gpt-vis.antv.vision/">
|
|
21
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*VNswTozYmrAAAAAAcvAAAAgAemJ7AQ/original" width="100%" alt="GPT-Vis: turn AI answers into charts with 26 visualizations, analysis annotations, reusable themes, and Agent Skill. Visit the English website." />
|
|
22
|
+
</a>
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
</div>
|
|
31
25
|
|
|
32
|
-
##
|
|
26
|
+
## Features
|
|
33
27
|
|
|
34
28
|
- 🚀 **Framework Agnostic** — Works with vanilla JavaScript, React, Vue, Angular, or any framework
|
|
35
29
|
- ✍️ **Markdown-like Syntax** — Simple syntax that LLMs can generate directly, easy to learn and use
|
|
@@ -37,159 +31,191 @@ AI-native visualization library for the LLM era. Framework-agnostic, ready to us
|
|
|
37
31
|
- 🛡️ **Fault Tolerant** — Gracefully handles incomplete or malformed data, adapts to the uncertainty of AI-generated content
|
|
38
32
|
- 📊 **26 Chart Types** — Statistical charts, relationship graphs, and text visualizations covering mainstream scenarios
|
|
39
33
|
- 🎨 **Reusable Themes** — Share one ThemeSpec across all chart types; preview and refine it in Theme Studio, or create it with an AI skill
|
|
34
|
+
- **28 Analysis Capabilities** — Mark extremes, ranks, means, targets, regions, and crossings, with statistical references computed by the SDK
|
|
35
|
+
- **Agent Skill** — Give AI assistants guidance for chart selection, configuration, framework integration, and theme creation
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
Built on [G2](https://github.com/antvis/G2), [G6](https://github.com/antvis/G6), and [T8](https://github.com/antvis/T8). Works with vanilla JavaScript, React, Vue, and other browser frameworks.
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### Use with your agent
|
|
42
|
+
|
|
43
|
+
Run this command from your project directory and choose a compatible assistant:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx skills add https://github.com/antvis/GPT-Vis/tree/ai --skill chart-visualization
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Then ask your agent to create its first report:
|
|
50
|
+
|
|
51
|
+
> Use the GPT-Vis Skill to create an H1 revenue report: Jan 84, Feb 96, Mar 91, Apr 118, May 126, Jun 148, in USD 10k. Include a line chart, a table, and a short summary. Use a shared theme and save a report.html that I can open in a browser.
|
|
52
|
+
|
|
53
|
+
The Skill includes chart selection guidance, runnable configuration patterns, and a Theme Creator reference. [Read the Skill source](./skills/chart-visualization/SKILL.md).
|
|
54
|
+
|
|
55
|
+
### Build with the SDK
|
|
44
56
|
|
|
45
57
|
```bash
|
|
46
58
|
npm install @antv/gpt-vis
|
|
47
59
|
```
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
Add a container and run the following after it mounts:
|
|
50
62
|
|
|
51
|
-
```
|
|
52
|
-
|
|
63
|
+
```html
|
|
64
|
+
<div id="chart" style="width: 100%; height: 360px;"></div>
|
|
65
|
+
```
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
width: 600,
|
|
57
|
-
height: 400,
|
|
58
|
-
});
|
|
67
|
+
```typescript
|
|
68
|
+
import { GPTVis } from '@antv/gpt-vis';
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
const chart = new GPTVis({ container: '#chart', height: 360, theme: 'product' });
|
|
71
|
+
const data = [
|
|
72
|
+
{ time: 'Jan', value: 84 },
|
|
73
|
+
{ time: 'Feb', value: 96 },
|
|
74
|
+
{ time: 'Mar', value: 91 },
|
|
75
|
+
{ time: 'Apr', value: 118 },
|
|
76
|
+
{ time: 'May', value: 126 },
|
|
77
|
+
{ time: 'Jun', value: 148 },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
chart.render({
|
|
61
81
|
type: 'line',
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{ time: '2021', value: 120 },
|
|
65
|
-
{ time: '2022', value: 150 },
|
|
66
|
-
],
|
|
82
|
+
title: 'Monthly revenue (USD 10k)',
|
|
83
|
+
data,
|
|
67
84
|
});
|
|
85
|
+
|
|
86
|
+
// When the view unmounts:
|
|
87
|
+
// chart.destroy();
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>Prefer text? Render the same chart with Syntax</summary>
|
|
92
|
+
|
|
93
|
+
The same `render()` method accepts this text:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
chart.render(`vis line
|
|
97
|
+
title Monthly revenue (USD 10k)
|
|
98
|
+
data
|
|
99
|
+
- time Jan
|
|
100
|
+
value 84
|
|
101
|
+
- time Feb
|
|
102
|
+
value 96
|
|
103
|
+
- time Mar
|
|
104
|
+
value 91
|
|
105
|
+
- time Apr
|
|
106
|
+
value 118
|
|
107
|
+
- time May
|
|
108
|
+
value 126
|
|
109
|
+
- time Jun
|
|
110
|
+
value 148`);
|
|
68
111
|
```
|
|
69
112
|
|
|
70
|
-
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
[Quickstart](https://gpt-vis.antv.vision/docs/quickstart) · [Syntax guide](https://gpt-vis.antv.vision/docs/syntax) · [API reference](https://gpt-vis.antv.vision/docs/reference/api)
|
|
71
116
|
|
|
72
|
-
|
|
117
|
+
## Render as your model responds
|
|
73
118
|
|
|
74
|
-
|
|
119
|
+
Pass the accumulated output to `render()` on each update. GPT-Vis supports partial input so charts can appear before the response is complete.
|
|
120
|
+
|
|
121
|
+
<a href="https://gpt-vis.antv.vision/docs/streaming">
|
|
122
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_xY7Q6QyuZ4AAAAAWeAAAAgAemJ7AQ/original" width="100%" loading="lazy" alt="A GPT-Vis chart rendering progressively as model output arrives. Open the streaming guide." />
|
|
123
|
+
</a>
|
|
75
124
|
|
|
76
125
|
```javascript
|
|
77
126
|
import { GPTVis, isVisSyntax } from '@antv/gpt-vis';
|
|
78
127
|
|
|
79
|
-
const
|
|
128
|
+
const chart = new GPTVis({ container: '#chart', width: 600, height: 400 });
|
|
80
129
|
let buffer = '';
|
|
81
130
|
|
|
82
131
|
function onToken(token) {
|
|
83
132
|
buffer += token;
|
|
84
133
|
if (isVisSyntax(buffer)) {
|
|
85
|
-
|
|
134
|
+
chart.render(buffer);
|
|
86
135
|
}
|
|
87
136
|
}
|
|
88
137
|
```
|
|
89
138
|
|
|
90
|
-
|
|
139
|
+
[Streaming guide →](https://gpt-vis.antv.vision/docs/streaming)
|
|
91
140
|
|
|
92
|
-
|
|
141
|
+
## 28 ways to explain a finding
|
|
93
142
|
|
|
94
|
-
|
|
143
|
+
Use `annotations` to put means, targets, rankings, and outliers directly on the chart.
|
|
95
144
|
|
|
96
|
-
|
|
145
|
+
<a href="https://gpt-vis.antv.vision/examples/annotations">
|
|
146
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EyCDSqhgboEAAAAASCAAAAgAemJ7AQ/original" width="100%" loading="lazy" alt="GPT-Vis annotation comparison: revenue mean and target, response-time reference band and IQR outlier." />
|
|
147
|
+
</a>
|
|
97
148
|
|
|
98
|
-
|
|
149
|
+
Reuse the quickstart data and add a mean reference and a revenue target of 140:
|
|
99
150
|
|
|
100
|
-
```
|
|
101
|
-
|
|
151
|
+
```typescript
|
|
152
|
+
chart.render({
|
|
102
153
|
type: 'line',
|
|
103
|
-
data
|
|
104
|
-
|
|
105
|
-
{ time: '2021', value: 120 },
|
|
106
|
-
{ time: '2022', value: 150 },
|
|
107
|
-
],
|
|
154
|
+
data,
|
|
155
|
+
annotations: [{ type: 'mean' }, { type: 'thresholdY', threshold: 140, label: 'Target 140' }],
|
|
108
156
|
});
|
|
109
157
|
```
|
|
110
158
|
|
|
111
|
-
**
|
|
159
|
+
The mean is **110.5** and June's revenue of **148** exceeds the target, in USD 10k. The SDK computes the mean; your configuration supplies the target.
|
|
112
160
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
type: 'pie',
|
|
116
|
-
data: [
|
|
117
|
-
{ category: 'Android', value: 72 },
|
|
118
|
-
{ category: 'iOS', value: 28 },
|
|
119
|
-
],
|
|
120
|
-
innerRadius: 0.6,
|
|
121
|
-
});
|
|
122
|
-
```
|
|
161
|
+
<details>
|
|
162
|
+
<summary>See all 28 analysis capabilities</summary>
|
|
123
163
|
|
|
124
|
-
|
|
164
|
+
| Intent | Capabilities | `type` identifiers |
|
|
165
|
+
| ------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------- |
|
|
166
|
+
| **Extremes & observations · 8** | X/Y maximum and minimum, first and last observation, local peaks and valleys | `maxX`, `minX`, `maxY`, `minY`, `first`, `last`, `peak`, `valley` |
|
|
167
|
+
| **Ranking & contribution · 4** | Top N, Bottom N, series emphasis, contribution | `topN`, `bottomN`, `group`, `contribution` |
|
|
168
|
+
| **Statistical references · 5** | Mean, median, quantile, IQR outliers, scatter center or weighted center | `mean`, `median`, `quantile`, `outlier`, `centroid` |
|
|
169
|
+
| **Thresholds & targets · 4** | X/Y threshold lines, target or baseline, threshold emphasis | `thresholdX`, `thresholdY`, `target`, `thresholdHighlight` |
|
|
170
|
+
| **Ranges & regions · 5** | X/Y intervals, inside/outside range, quadrants | `rangeX`, `rangeY`, `rangeInside`, `rangeOutside`, `quadrant` |
|
|
171
|
+
| **Events & crossings · 2** | Event markers, threshold crossings or two-series intersections | `event`, `crossing` |
|
|
125
172
|
|
|
126
|
-
|
|
173
|
+
</details>
|
|
127
174
|
|
|
128
|
-
|
|
129
|
-
| --------------- | ---------- | ---------- | ----------------------------------------------------- |
|
|
130
|
-
| Default (Light) | `default` | `#FFF` | `#5B6CFF` `#2DAF9E` `#F2B84B` `#EF6A6A` `#55A6D9` ... |
|
|
131
|
-
| Dark | `dark` | `#141414` | `#5B6CFF` `#2DAF9E` `#F2B84B` `#EF6A6A` `#55A6D9` ... |
|
|
132
|
-
| Academy | `academy` | `#FFF` | `#4e79a7` `#f28e2c` `#e15759` `#76b7b2` `#59a14f` ... |
|
|
175
|
+
[Explore all 28 capabilities](https://gpt-vis.antv.vision/examples/annotations) · [Supported charts, selectors, and calculation rules](https://gpt-vis.antv.vision/docs/annotations)
|
|
133
176
|
|
|
134
|
-
|
|
177
|
+
These capabilities describe the current source. Check that your chosen SDK release includes the annotations you need; installing the Skill does not upgrade the rendering library.
|
|
135
178
|
|
|
136
|
-
|
|
137
|
-
| ----------------------------------------------- | -------------- |
|
|
138
|
-
| GPT-Vis | `gpt-vis` |
|
|
139
|
-
| Midnight | `midnight` |
|
|
140
|
-
| Paper | `paper` |
|
|
141
|
-
| Product | `product` |
|
|
142
|
-
| Neon Circuit | `neon-circuit` |
|
|
143
|
-
| Terra Print | `terra-print` |
|
|
144
|
-
| Mono Signal | `mono-signal` |
|
|
145
|
-
| Candy Pop | `candy-pop` |
|
|
146
|
-
| [Pop](https://github.com/microsoft/flint-chart) | `pop` |
|
|
147
|
-
| Bauhaus | `bauhaus` |
|
|
179
|
+
## Syntax Guide
|
|
148
180
|
|
|
149
|
-
|
|
181
|
+
`render()` supports two input formats: JSON objects (ideal for programmatic use) and DSL syntax (ideal for LLM streaming).
|
|
150
182
|
|
|
151
|
-
|
|
152
|
-
const chart = new GPTVis({ container: '#chart', theme: 'pop' });
|
|
153
|
-
```
|
|
183
|
+
### Object Config
|
|
154
184
|
|
|
155
|
-
|
|
185
|
+
Pass JSON objects directly for programmatic chart creation:
|
|
186
|
+
|
|
187
|
+
**Line chart:**
|
|
156
188
|
|
|
157
189
|
```javascript
|
|
158
|
-
|
|
190
|
+
chart.render({
|
|
159
191
|
type: 'line',
|
|
160
192
|
data: [
|
|
161
193
|
{ time: '2020', value: 100 },
|
|
162
194
|
{ time: '2021', value: 120 },
|
|
195
|
+
{ time: '2022', value: 150 },
|
|
163
196
|
],
|
|
164
|
-
theme: 'dark',
|
|
165
197
|
});
|
|
166
198
|
```
|
|
167
199
|
|
|
168
|
-
**
|
|
169
|
-
|
|
170
|
-
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:
|
|
171
|
-
|
|
172
|
-
```typescript
|
|
173
|
-
import { GPTVis, type ThemeSpec } from '@antv/gpt-vis';
|
|
200
|
+
**Pie chart:**
|
|
174
201
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
202
|
+
```javascript
|
|
203
|
+
chart.render({
|
|
204
|
+
type: 'pie',
|
|
205
|
+
data: [
|
|
206
|
+
{ category: 'Android', value: 72 },
|
|
207
|
+
{ category: 'iOS', value: 28 },
|
|
208
|
+
],
|
|
209
|
+
innerRadius: 0.6,
|
|
210
|
+
});
|
|
181
211
|
```
|
|
182
212
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Explore [Theme Studio](https://gpt-vis.antv.vision/themes), read the [theme documentation](https://gpt-vis.antv.vision/docs#custom-themes), or use the [theme creation guide](./skills/chart-visualization/references/theme-creator.md) to generate a ThemeSpec from your brand references.
|
|
186
|
-
|
|
187
|
-
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.
|
|
213
|
+
For theme names, custom ThemeSpec objects, and style overrides, see [Themes and styles](#themes-and-styles).
|
|
188
214
|
|
|
189
215
|
**Custom Styles:**
|
|
190
216
|
|
|
191
217
|
```javascript
|
|
192
|
-
|
|
218
|
+
chart.render({
|
|
193
219
|
type: 'line',
|
|
194
220
|
data: [
|
|
195
221
|
{ time: '2020', value: 100 },
|
|
@@ -290,10 +316,85 @@ data
|
|
|
290
316
|
value 150
|
|
291
317
|
`;
|
|
292
318
|
|
|
293
|
-
|
|
319
|
+
chart.render(visSyntax);
|
|
294
320
|
```
|
|
295
321
|
|
|
296
|
-
##
|
|
322
|
+
## Themes and styles
|
|
323
|
+
|
|
324
|
+
Share colors, typography, and styles across charts and tables. Choose from 10 gallery presets, including `gpt-vis`, `midnight`, `paper`, and `pop`, alongside the three original base themes:
|
|
325
|
+
|
|
326
|
+
<a href="https://gpt-vis.antv.vision/themes">
|
|
327
|
+
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*MjRURK8Ob4IAAAAATvAAAAgAemJ7AQ/original" width="100%" loading="lazy" alt="The same line chart and table rendered in GPT-Vis, Midnight, Paper, and Pop themes." />
|
|
328
|
+
</a>
|
|
329
|
+
|
|
330
|
+
### Built-in themes
|
|
331
|
+
|
|
332
|
+
Built-in themes are switchable via the `theme` property. The original base themes keep their existing appearance:
|
|
333
|
+
|
|
334
|
+
| Theme | Identifier | Background | Palette |
|
|
335
|
+
| --------------- | ---------- | ---------- | ----------------------------------------------------- |
|
|
336
|
+
| Default (Light) | `default` | `#FFF` | `#5B6CFF` `#2DAF9E` `#F2B84B` `#EF6A6A` `#55A6D9` ... |
|
|
337
|
+
| Dark | `dark` | `#141414` | `#5B6CFF` `#2DAF9E` `#F2B84B` `#EF6A6A` `#55A6D9` ... |
|
|
338
|
+
| Academy | `academy` | `#FFF` | `#4e79a7` `#f28e2c` `#e15759` `#76b7b2` `#59a14f` ... |
|
|
339
|
+
|
|
340
|
+
The website's 10 gallery styles are also built in:
|
|
341
|
+
|
|
342
|
+
| Theme | Identifier |
|
|
343
|
+
| ----------------------------------------------- | -------------- |
|
|
344
|
+
| GPT-Vis | `gpt-vis` |
|
|
345
|
+
| Midnight | `midnight` |
|
|
346
|
+
| Paper | `paper` |
|
|
347
|
+
| Product | `product` |
|
|
348
|
+
| Neon Circuit | `neon-circuit` |
|
|
349
|
+
| Terra Print | `terra-print` |
|
|
350
|
+
| Mono Signal | `mono-signal` |
|
|
351
|
+
| Candy Pop | `candy-pop` |
|
|
352
|
+
| [Pop](https://github.com/microsoft/flint-chart) | `pop` |
|
|
353
|
+
| Bauhaus | `bauhaus` |
|
|
354
|
+
|
|
355
|
+
The branded `gpt-vis` preset is separate from the SDK's `default`.
|
|
356
|
+
|
|
357
|
+
```typescript
|
|
358
|
+
const themedChart = new GPTVis({ container: '#chart', theme: 'pop' });
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Names work in the constructor, chart JSON, and Syntax (`theme pop`). Summary receives its theme through the constructor. The supported name type is `BuiltinThemeName`.
|
|
362
|
+
|
|
363
|
+
```javascript
|
|
364
|
+
chart.render({
|
|
365
|
+
type: 'line',
|
|
366
|
+
data: [
|
|
367
|
+
{ time: '2020', value: 100 },
|
|
368
|
+
{ time: '2021', value: 120 },
|
|
369
|
+
],
|
|
370
|
+
theme: 'dark',
|
|
371
|
+
});
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Reusable custom themes
|
|
375
|
+
|
|
376
|
+
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:
|
|
377
|
+
|
|
378
|
+
```typescript
|
|
379
|
+
import { GPTVis, type ThemeSpec } from '@antv/gpt-vis';
|
|
380
|
+
|
|
381
|
+
const theme: ThemeSpec = {
|
|
382
|
+
id: 'my-report',
|
|
383
|
+
label: 'My report',
|
|
384
|
+
tokens: { colorDefault: '#7047eb', fontFamily: 'Arial, sans-serif', radius: 6 },
|
|
385
|
+
};
|
|
386
|
+
const chart = new GPTVis({ container: '#chart', theme });
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
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.
|
|
390
|
+
|
|
391
|
+
Explore [Theme Studio](https://gpt-vis.antv.vision/themes), read the [theme documentation](https://gpt-vis.antv.vision/docs/themes), or use the [theme creation guide](./skills/chart-visualization/references/theme-creator.md) to generate a ThemeSpec from your brand references.
|
|
392
|
+
|
|
393
|
+
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.
|
|
394
|
+
|
|
395
|
+
Use a chart’s `style` to override theme colors and mark styles, as shown in the object configuration and Syntax examples above.
|
|
396
|
+
|
|
397
|
+
## Chart Types
|
|
297
398
|
|
|
298
399
|
26 chart types covering statistical analysis, relationship networks, and text visualization.
|
|
299
400
|
|
|
@@ -340,7 +441,15 @@ gptVis.render(visSyntax);
|
|
|
340
441
|
|
|
341
442
|
Explore all examples → [Examples Gallery](https://gpt-vis.antv.vision/examples)
|
|
342
443
|
|
|
343
|
-
##
|
|
444
|
+
## Framework Integration
|
|
445
|
+
|
|
446
|
+
| Integration | Starting point |
|
|
447
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
448
|
+
| **React & Vue** | [Framework lifecycle examples](https://gpt-vis.antv.vision/docs/integrations/frameworks) |
|
|
449
|
+
| **Markdown** | [Render visualization blocks in model responses](https://gpt-vis.antv.vision/docs/integrations/markdown) |
|
|
450
|
+
| **shadcn/ui** | [Copy universal or chart-specific React components into your project](https://gpt-vis.antv.vision/docs/integrations/shadcn) |
|
|
451
|
+
| **MCP** | [MCP Server Chart](https://github.com/antvis/mcp-server-chart) |
|
|
452
|
+
| **Server rendering, Streamlit & Dify** | [Explore the ecosystem](https://gpt-vis.antv.vision/docs/integrations/ecosystem) |
|
|
344
453
|
|
|
345
454
|
<details>
|
|
346
455
|
<summary><strong>Vanilla JavaScript</strong></summary>
|
|
@@ -348,8 +457,17 @@ Explore all examples → [Examples Gallery](https://gpt-vis.antv.vision/examples
|
|
|
348
457
|
```javascript
|
|
349
458
|
import { GPTVis } from '@antv/gpt-vis';
|
|
350
459
|
|
|
351
|
-
const
|
|
352
|
-
|
|
460
|
+
const chart = new GPTVis({ container: '#chart', width: 600, height: 400 });
|
|
461
|
+
chart.render({
|
|
462
|
+
type: 'line',
|
|
463
|
+
data: [
|
|
464
|
+
{ time: '2020', value: 100 },
|
|
465
|
+
{ time: '2021', value: 120 },
|
|
466
|
+
{ time: '2022', value: 150 },
|
|
467
|
+
],
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
// Call chart.destroy() when the view unmounts.
|
|
353
471
|
```
|
|
354
472
|
|
|
355
473
|
</details>
|
|
@@ -363,16 +481,16 @@ import { useEffect, useRef } from 'react';
|
|
|
363
481
|
|
|
364
482
|
function ChartComponent({ visSyntax }) {
|
|
365
483
|
const containerRef = useRef();
|
|
366
|
-
const
|
|
484
|
+
const chartRef = useRef();
|
|
367
485
|
|
|
368
486
|
useEffect(() => {
|
|
369
|
-
|
|
370
|
-
return () =>
|
|
487
|
+
chartRef.current = new GPTVis({ container: containerRef.current, width: 600, height: 400 });
|
|
488
|
+
return () => chartRef.current?.destroy();
|
|
371
489
|
}, []);
|
|
372
490
|
|
|
373
491
|
useEffect(() => {
|
|
374
|
-
if (
|
|
375
|
-
|
|
492
|
+
if (chartRef.current && visSyntax) {
|
|
493
|
+
chartRef.current.render(visSyntax);
|
|
376
494
|
}
|
|
377
495
|
}, [visSyntax]);
|
|
378
496
|
|
|
@@ -391,25 +509,26 @@ function ChartComponent({ visSyntax }) {
|
|
|
391
509
|
</template>
|
|
392
510
|
|
|
393
511
|
<script setup>
|
|
394
|
-
import { ref, watch, onUnmounted } from 'vue';
|
|
512
|
+
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
|
395
513
|
import { GPTVis } from '@antv/gpt-vis';
|
|
396
514
|
|
|
397
515
|
const props = defineProps(['visSyntax']);
|
|
398
516
|
const chartRef = ref(null);
|
|
399
|
-
let
|
|
517
|
+
let chart = null;
|
|
518
|
+
|
|
519
|
+
onMounted(() => {
|
|
520
|
+
chart = new GPTVis({ container: chartRef.value, width: 600, height: 400 });
|
|
521
|
+
if (props.visSyntax) chart.render(props.visSyntax);
|
|
522
|
+
});
|
|
400
523
|
|
|
401
524
|
watch(
|
|
402
525
|
() => props.visSyntax,
|
|
403
526
|
(syntax) => {
|
|
404
|
-
if (
|
|
405
|
-
gptVis = new GPTVis({ container: chartRef.value, width: 600, height: 400 });
|
|
406
|
-
}
|
|
407
|
-
gptVis.render(syntax);
|
|
527
|
+
if (chart && syntax) chart.render(syntax);
|
|
408
528
|
},
|
|
409
|
-
{ immediate: true },
|
|
410
529
|
);
|
|
411
530
|
|
|
412
|
-
onUnmounted(() =>
|
|
531
|
+
onUnmounted(() => chart?.destroy());
|
|
413
532
|
</script>
|
|
414
533
|
```
|
|
415
534
|
|
|
@@ -462,7 +581,7 @@ const marked = new Marked(
|
|
|
462
581
|
code({ text, lang }) {
|
|
463
582
|
if (lang?.startsWith('vis')) {
|
|
464
583
|
const syntax = encodeURIComponent(lang + '\n' + text);
|
|
465
|
-
return `<gpt-vis data-syntax="${syntax}" style="min-height:300px"></gpt-vis>`;
|
|
584
|
+
return `<gpt-vis data-syntax="${syntax}" style="display:block;min-height:300px"></gpt-vis>`;
|
|
466
585
|
}
|
|
467
586
|
return false;
|
|
468
587
|
},
|
|
@@ -486,12 +605,13 @@ title 2024 Programming Language Popularity
|
|
|
486
605
|
\`\`\`
|
|
487
606
|
`;
|
|
488
607
|
|
|
608
|
+
// Add <div id="content"></div> to your page.
|
|
489
609
|
document.getElementById('content').innerHTML = marked.parse(markdown);
|
|
490
610
|
```
|
|
491
611
|
|
|
492
612
|
</details>
|
|
493
613
|
|
|
494
|
-
##
|
|
614
|
+
## Shadcn/ui
|
|
495
615
|
|
|
496
616
|
Copy GPT-Vis React components directly into your project via shadcn CLI — full source control, fully customizable.
|
|
497
617
|
|
|
@@ -507,7 +627,7 @@ npx shadcn@latest add @gpt-vis/gpt-vis
|
|
|
507
627
|
import { GPTVis } from '@/components/ui/gpt-vis';
|
|
508
628
|
|
|
509
629
|
<GPTVis
|
|
510
|
-
content=
|
|
630
|
+
content={`vis line
|
|
511
631
|
data
|
|
512
632
|
- time 2020
|
|
513
633
|
value 100
|
|
@@ -515,7 +635,7 @@ data
|
|
|
515
635
|
value 120
|
|
516
636
|
- time 2022
|
|
517
637
|
value 150
|
|
518
|
-
title Sales Trend
|
|
638
|
+
title Sales Trend`}
|
|
519
639
|
theme="academy"
|
|
520
640
|
/>;
|
|
521
641
|
```
|
|
@@ -556,14 +676,16 @@ npx shadcn@latest add @gpt-vis/mindmap
|
|
|
556
676
|
|
|
557
677
|
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.
|
|
558
678
|
|
|
559
|
-
##
|
|
679
|
+
## AI Ecosystem
|
|
560
680
|
|
|
561
681
|
GPT-Vis provides a complete AI integration solution:
|
|
562
682
|
|
|
563
683
|
- **[MCP Server](https://github.com/antvis/mcp-server-chart)** — Enable AI models to directly invoke visualization capabilities via Model Context Protocol
|
|
564
|
-
- **[Chart Skill](
|
|
684
|
+
- **[Chart Skill](./skills/chart-visualization/SKILL.md)** — Help AI assistants choose charts, generate JSON, Syntax or integration code, and create reusable themes with the bundled Theme Creator reference
|
|
685
|
+
|
|
686
|
+
- **[Server rendering and community integrations](https://gpt-vis.antv.vision/docs/integrations/ecosystem)** — Explore server-side chart rendering, Streamlit, and Dify integrations
|
|
565
687
|
|
|
566
|
-
##
|
|
688
|
+
## Contributing
|
|
567
689
|
|
|
568
690
|
> **AI-Generated Code Policy**: This project only merges AI-generated code.
|
|
569
691
|
|
|
@@ -571,6 +693,8 @@ GPT-Vis provides a complete AI integration solution:
|
|
|
571
693
|
2. Tag @copilot to generate the implementation
|
|
572
694
|
3. Submit a PR with AI-generated code
|
|
573
695
|
|
|
574
|
-
|
|
696
|
+
[Report an issue](https://github.com/antvis/GPT-Vis/issues)
|
|
697
|
+
|
|
698
|
+
## License
|
|
575
699
|
|
|
576
700
|
[MIT](./LICENSE) © [AntV](https://antv.antgroup.com/)
|