@antv/gpt-vis 1.0.0-beta.1 → 1.0.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.
Files changed (159) hide show
  1. package/README.md +223 -47
  2. package/README.zh-CN.md +227 -51
  3. package/dist/cjs/gpt-vis/index.d.ts +8 -1
  4. package/dist/cjs/gpt-vis/index.js +43 -20
  5. package/dist/cjs/index.d.ts +15 -2
  6. package/dist/cjs/index.js +22 -2
  7. package/dist/cjs/syntax/parser.d.ts +17 -2
  8. package/dist/cjs/syntax/parser.js +151 -38
  9. package/dist/cjs/util/container.d.ts +5 -0
  10. package/dist/cjs/util/container.js +43 -0
  11. package/dist/cjs/util/theme.d.ts +5 -0
  12. package/dist/cjs/util/theme.js +9 -2
  13. package/dist/cjs/vis/area/index.js +2 -1
  14. package/dist/cjs/vis/bar/index.js +5 -4
  15. package/dist/cjs/vis/boxplot/index.js +7 -2
  16. package/dist/cjs/vis/column/index.js +5 -4
  17. package/dist/cjs/vis/dual-axes/index.js +3 -3
  18. package/dist/cjs/vis/fishbone-diagram/index.d.ts +35 -0
  19. package/dist/cjs/vis/fishbone-diagram/index.js +191 -0
  20. package/dist/cjs/vis/flow-diagram/index.d.ts +27 -0
  21. package/dist/cjs/vis/flow-diagram/index.js +287 -0
  22. package/dist/cjs/vis/funnel/index.js +2 -1
  23. package/dist/cjs/vis/histogram/index.js +3 -7
  24. package/dist/cjs/vis/indented-tree/index.d.ts +40 -0
  25. package/dist/cjs/vis/indented-tree/index.js +385 -0
  26. package/dist/cjs/vis/line/index.js +2 -1
  27. package/dist/cjs/vis/liquid/index.js +2 -1
  28. package/dist/cjs/vis/mindmap/index.d.ts +32 -0
  29. package/dist/cjs/vis/mindmap/index.js +222 -0
  30. package/dist/cjs/vis/network-graph/index.d.ts +59 -0
  31. package/dist/cjs/vis/network-graph/index.js +175 -0
  32. package/dist/cjs/vis/organization-chart/index.d.ts +64 -0
  33. package/dist/cjs/vis/organization-chart/index.js +200 -0
  34. package/dist/cjs/vis/pie/index.js +3 -3
  35. package/dist/cjs/vis/radar/index.d.ts +1 -0
  36. package/dist/cjs/vis/radar/index.js +10 -9
  37. package/dist/cjs/vis/sankey/index.js +2 -1
  38. package/dist/cjs/vis/scatter/index.d.ts +2 -0
  39. package/dist/cjs/vis/scatter/index.js +9 -4
  40. package/dist/cjs/vis/summary/index.js +17 -3
  41. package/dist/cjs/vis/table/index.d.ts +1 -0
  42. package/dist/cjs/vis/table/index.js +37 -1
  43. package/dist/cjs/vis/treemap/index.js +2 -1
  44. package/dist/cjs/vis/venn/index.d.ts +2 -1
  45. package/dist/cjs/vis/venn/index.js +18 -3
  46. package/dist/cjs/vis/violin/index.js +2 -1
  47. package/dist/cjs/vis/waterfall/index.d.ts +6 -9
  48. package/dist/cjs/vis/waterfall/index.js +29 -6
  49. package/dist/cjs/vis/word-cloud/index.js +2 -1
  50. package/dist/cjs/vis-wrapper/icons.js +2 -2
  51. package/dist/cjs/vis-wrapper/index.d.ts +1 -0
  52. package/dist/cjs/vis-wrapper/index.js +27 -16
  53. package/dist/cjs/vis-wrapper/styles.d.ts +1 -1
  54. package/dist/cjs/vis-wrapper/styles.js +8 -1
  55. package/dist/esm/gpt-vis/index.d.ts +8 -1
  56. package/dist/esm/gpt-vis/index.js +47 -26
  57. package/dist/esm/index.d.ts +15 -2
  58. package/dist/esm/index.js +7 -1
  59. package/dist/esm/syntax/parser.d.ts +17 -2
  60. package/dist/esm/syntax/parser.js +248 -90
  61. package/dist/esm/util/container.d.ts +5 -0
  62. package/dist/esm/util/container.js +20 -0
  63. package/dist/esm/util/theme.d.ts +5 -0
  64. package/dist/esm/util/theme.js +9 -0
  65. package/dist/esm/vis/area/index.js +3 -2
  66. package/dist/esm/vis/bar/index.js +7 -6
  67. package/dist/esm/vis/boxplot/index.js +17 -4
  68. package/dist/esm/vis/column/index.js +7 -6
  69. package/dist/esm/vis/dual-axes/index.js +13 -5
  70. package/dist/esm/vis/fishbone-diagram/index.d.ts +35 -0
  71. package/dist/esm/vis/fishbone-diagram/index.js +219 -0
  72. package/dist/esm/vis/flow-diagram/index.d.ts +27 -0
  73. package/dist/esm/vis/flow-diagram/index.js +349 -0
  74. package/dist/esm/vis/funnel/index.js +3 -2
  75. package/dist/esm/vis/histogram/index.js +6 -7
  76. package/dist/esm/vis/indented-tree/index.d.ts +40 -0
  77. package/dist/esm/vis/indented-tree/index.js +569 -0
  78. package/dist/esm/vis/line/index.js +3 -2
  79. package/dist/esm/vis/liquid/index.js +3 -2
  80. package/dist/esm/vis/mindmap/index.d.ts +32 -0
  81. package/dist/esm/vis/mindmap/index.js +316 -0
  82. package/dist/esm/vis/network-graph/index.d.ts +59 -0
  83. package/dist/esm/vis/network-graph/index.js +242 -0
  84. package/dist/esm/vis/organization-chart/index.d.ts +64 -0
  85. package/dist/esm/vis/organization-chart/index.js +271 -0
  86. package/dist/esm/vis/pie/index.js +4 -8
  87. package/dist/esm/vis/radar/index.d.ts +1 -0
  88. package/dist/esm/vis/radar/index.js +20 -4
  89. package/dist/esm/vis/sankey/index.js +3 -2
  90. package/dist/esm/vis/scatter/index.d.ts +2 -0
  91. package/dist/esm/vis/scatter/index.js +15 -4
  92. package/dist/esm/vis/summary/index.js +25 -4
  93. package/dist/esm/vis/table/index.d.ts +1 -0
  94. package/dist/esm/vis/table/index.js +9 -2
  95. package/dist/esm/vis/treemap/index.js +3 -2
  96. package/dist/esm/vis/venn/index.d.ts +2 -1
  97. package/dist/esm/vis/venn/index.js +29 -4
  98. package/dist/esm/vis/violin/index.js +3 -2
  99. package/dist/esm/vis/waterfall/index.d.ts +6 -9
  100. package/dist/esm/vis/waterfall/index.js +33 -13
  101. package/dist/esm/vis/word-cloud/index.js +3 -2
  102. package/dist/esm/vis-wrapper/icons.js +2 -2
  103. package/dist/esm/vis-wrapper/index.d.ts +1 -0
  104. package/dist/esm/vis-wrapper/index.js +15 -10
  105. package/dist/esm/vis-wrapper/styles.d.ts +1 -1
  106. package/dist/esm/vis-wrapper/styles.js +1 -1
  107. package/dist/umd/index.min.js +1 -1
  108. package/package.json +17 -21
  109. package/src/gpt-vis/index.ts +0 -283
  110. package/src/index.ts +0 -44
  111. package/src/readme.md +0 -37
  112. package/src/syntax/index.ts +0 -2
  113. package/src/syntax/parser.ts +0 -411
  114. package/src/types/index.ts +0 -29
  115. package/src/util/theme.ts +0 -167
  116. package/src/vis/area/README.md +0 -143
  117. package/src/vis/area/index.ts +0 -212
  118. package/src/vis/bar/README.md +0 -158
  119. package/src/vis/bar/index.ts +0 -186
  120. package/src/vis/boxplot/README.md +0 -168
  121. package/src/vis/boxplot/index.ts +0 -162
  122. package/src/vis/column/README.md +0 -158
  123. package/src/vis/column/index.ts +0 -185
  124. package/src/vis/dual-axes/README.md +0 -191
  125. package/src/vis/dual-axes/index.ts +0 -218
  126. package/src/vis/funnel/README.md +0 -143
  127. package/src/vis/funnel/index.ts +0 -238
  128. package/src/vis/histogram/README.md +0 -130
  129. package/src/vis/histogram/index.ts +0 -153
  130. package/src/vis/line/README.md +0 -138
  131. package/src/vis/line/index.ts +0 -159
  132. package/src/vis/liquid/README.md +0 -150
  133. package/src/vis/liquid/index.ts +0 -130
  134. package/src/vis/pie/README.md +0 -127
  135. package/src/vis/pie/index.ts +0 -163
  136. package/src/vis/radar/README.md +0 -184
  137. package/src/vis/radar/index.ts +0 -214
  138. package/src/vis/sankey/README.md +0 -144
  139. package/src/vis/sankey/index.ts +0 -144
  140. package/src/vis/scatter/README.md +0 -145
  141. package/src/vis/scatter/index.ts +0 -147
  142. package/src/vis/summary/README.md +0 -272
  143. package/src/vis/summary/index.ts +0 -91
  144. package/src/vis/table/README.md +0 -174
  145. package/src/vis/table/index.ts +0 -241
  146. package/src/vis/treemap/README.md +0 -199
  147. package/src/vis/treemap/index.ts +0 -167
  148. package/src/vis/venn/README.md +0 -153
  149. package/src/vis/venn/index.ts +0 -149
  150. package/src/vis/violin/README.md +0 -168
  151. package/src/vis/violin/index.ts +0 -216
  152. package/src/vis/waterfall/README.md +0 -178
  153. package/src/vis/waterfall/index.ts +0 -258
  154. package/src/vis/word-cloud/README.md +0 -137
  155. package/src/vis/word-cloud/index.ts +0 -137
  156. package/src/vis-wrapper/README.md +0 -159
  157. package/src/vis-wrapper/icons.ts +0 -35
  158. package/src/vis-wrapper/index.ts +0 -276
  159. package/src/vis-wrapper/styles.ts +0 -195
package/README.md CHANGED
@@ -1,42 +1,42 @@
1
1
  <img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> English | [简体中文](./README.zh-CN.md)
2
2
 
3
- <h1 align="center">GPT-Vis, Visualization for AI Friendly!</h1>
3
+ <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
+
7
+ <h1 align="center">GPT-Vis</h1>
4
8
 
5
9
  <div align="center">
6
- <img src="https://github.com/eosphoros-ai/GPT-Vis/assets/17919400/c8804ffb-d3d6-45d3-846f-cf217681ab05" height="70">
7
10
 
8
- AI-Native Visualization Components for the LLM Era. Framework-agnostic visualization library designed for AI-powered applications.
11
+ AI-native visualization library for the LLM era. Framework-agnostic, ready to use.
9
12
 
10
13
  [![npm version](https://img.shields.io/npm/v/@antv/gpt-vis.svg)](https://www.npmjs.com/package/@antv/gpt-vis)
11
14
  [![npm downloads](https://img.shields.io/npm/dm/@antv/gpt-vis.svg)](https://www.npmjs.com/package/@antv/gpt-vis)
12
15
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
13
16
 
14
17
  <p align="center">
15
- <a href="https://gpt-vis.antv.vision" target="_blank">📖 Documentation</a>
16
- <a href="/skills/chart-visualization" target="_blank">🤖 Chart Skill</a>
17
- <a href="/knowledges" target="_blank">🧠 Knowledge Base</a>
18
- <a href="https://www.tbox.cn/share/202504APmv6c00373739?platform=WebService" target="_blank">🎮 Try Demo</a>
19
- <a href="https://github.com/antvis/mcp-server-chart" target="_blank">🔌 MCP Server</a>
18
+ <a href="https://gpt-vis.antv.vision" target="_blank">📖 Documentation</a> ·
19
+ <a href="https://gpt-vis.antv.vision/examples" target="_blank">🎨 Examples</a> ·
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>
20
22
  </p>
21
23
 
22
24
  </div>
23
25
 
24
26
  <div align="center">
25
- <video src="https://github.com/user-attachments/assets/24b0d820-ebf8-4351-bc5b-4fa607a76e17" />
27
+ <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*k21VQY6NgAwAAAAAWAAAAAgAemJ7AQ/fmt.avif" width="100%" />
26
28
  </div>
27
29
 
28
30
  <br/>
29
31
 
30
- > **📢 Version 1.0 Preview**: Reimagined architecture optimized for AI. Stable release expected **March 21, 2026**.
31
-
32
32
  ## ✨ Features
33
33
 
34
- - **🚀 Framework Agnostic**: Works with vanilla JavaScript, React, Vue, Angular, or any framework
35
- - **✍️ Natural Syntax**: Simple, markdown-like syntax that LLMs can generate effortlessly
36
- - **🌊 Streaming Support**: Built-in support for streaming output from AI models
37
- - **🛡️ Fault Tolerant**: Gracefully handles incomplete or malformed data
38
- - **📊 20+ Chart Types**: Statistical, relationship, and advanced visualization charts
39
- - **🧠 Intelligent Defaults**: Automatic data detection, smart color schemes, adaptive layouts
34
+ - 🚀 **Framework Agnostic** Works with vanilla JavaScript, React, Vue, Angular, or any framework
35
+ - ✍️ **Markdown-like Syntax** Simple syntax that LLMs can generate directly, easy to learn and use
36
+ - 🌊 **Streaming Rendering** Native support for AI model streaming output, renders as it generates
37
+ - 🛡️ **Fault Tolerant** Gracefully handles incomplete or malformed data, adapts to the uncertainty of AI-generated content
38
+ - 📊 **26 Chart Types** Statistical charts, relationship graphs, and text visualizations covering mainstream scenarios
39
+ - 🎨 **Theme System** Built-in light, dark, and academy themes with customizable color palettes
40
40
 
41
41
  ## 🚀 Quick Start
42
42
 
@@ -52,12 +52,12 @@ npm install @antv/gpt-vis
52
52
  import { GPTVis } from '@antv/gpt-vis';
53
53
 
54
54
  const gptVis = new GPTVis({
55
- container: '#container',
55
+ container: 'container',
56
56
  width: 600,
57
57
  height: 400,
58
58
  });
59
59
 
60
- // Render with markdown-like syntax
60
+ // Markdown-like visualization syntax
61
61
  const visSyntax = `
62
62
  vis line
63
63
  data
@@ -72,12 +72,16 @@ data
72
72
  gptVis.render(visSyntax);
73
73
  ```
74
74
 
75
- ### Streaming Support
75
+ ### Streaming Rendering
76
+
77
+ Charts render as the AI model generates, no need to wait for the full response:
78
+
79
+ <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_xY7Q6QyuZ4AAAAAWeAAAAgAemJ7AQ/original" width="100%" />
76
80
 
77
81
  ```javascript
78
82
  import { GPTVis, isVisSyntax } from '@antv/gpt-vis';
79
83
 
80
- const gptVis = new GPTVis({ container: '#container', width: 600, height: 400 });
84
+ const gptVis = new GPTVis({ container: 'container', width: 600, height: 400 });
81
85
  let buffer = '';
82
86
 
83
87
  function onToken(token) {
@@ -90,18 +94,20 @@ function onToken(token) {
90
94
 
91
95
  ## 📚 Syntax Guide
92
96
 
93
- ### Basic Structure
97
+ `render()` supports two input formats: vis syntax (ideal for LLM streaming) and JSON objects (ideal for programmatic use).
98
+
99
+ ### Vis Syntax
100
+
101
+ Declarative markdown-like syntax that LLMs can generate without learning complex APIs:
94
102
 
95
103
  ```
96
104
  vis [chart-type]
97
105
  [property] [value]
98
106
  data
99
- - [key] [value]
107
+ - [field] [value]
100
108
  ```
101
109
 
102
- ### Examples
103
-
104
- **Simple chart:**
110
+ **Pie chart:**
105
111
 
106
112
  ```
107
113
  vis pie
@@ -113,7 +119,29 @@ data
113
119
  innerRadius 0.6
114
120
  ```
115
121
 
116
- **With style:**
122
+ **Themes:**
123
+
124
+ Three built-in themes, switchable via the `theme` property:
125
+
126
+ | Theme | Identifier | Background | Palette |
127
+ | --------------- | ---------- | ---------- | ----------------------------------------------------- |
128
+ | Default (Light) | `default` | `#FFF` | `#1783FF` `#F08F56` `#D580FF` `#00C9C9` `#7863FF` ... |
129
+ | Dark | `dark` | `#000` | `#1783FF` `#F08F56` `#D580FF` `#00C9C9` `#7863FF` ... |
130
+ | Academy | `academy` | `#FFF` | `#4e79a7` `#f28e2c` `#e15759` `#76b7b2` `#59a14f` ... |
131
+
132
+ ```
133
+ vis line
134
+ data
135
+ - time 2020
136
+ value 100
137
+ - time 2021
138
+ value 120
139
+ theme dark
140
+ ```
141
+
142
+ **Custom Styles:**
143
+
144
+ Use `style` to set line width, custom palettes, and more:
117
145
 
118
146
  ```
119
147
  vis line
@@ -124,20 +152,94 @@ data
124
152
  value 120
125
153
  style
126
154
  lineWidth 3
127
- palette #5B8FF9 #5AD8A6
155
+ palette
156
+ - #5B8FF9
157
+ - #5AD8A6
158
+ ```
159
+
160
+ **Quoted string values (for values with spaces):**
161
+
162
+ ```
163
+ vis pie
164
+ data
165
+ - category "Q1 Sales"
166
+ value 30
167
+ - category "Q2 Sales"
168
+ value 25
128
169
  ```
129
170
 
130
171
  **Hierarchical data:**
131
172
 
132
173
  ```
133
- vis mind-map
174
+ vis mindmap
134
175
  data
135
- - name Project
176
+ - name Project Plan
136
177
  children
137
178
  - name Phase 1
138
179
  - name Phase 2
139
180
  ```
140
181
 
182
+ ### JSON Objects
183
+
184
+ Also supports passing JSON objects directly, ideal for programmatic use:
185
+
186
+ ```javascript
187
+ gptVis.render({
188
+ type: 'pie',
189
+ data: [
190
+ { category: 'Android', value: 72 },
191
+ { category: 'iOS', value: 28 },
192
+ ],
193
+ });
194
+ ```
195
+
196
+ ## 📊 Chart Types
197
+
198
+ 26 chart types covering statistical analysis, relationship networks, and text visualization.
199
+
200
+ ### Statistical Charts (18)
201
+
202
+ | Chart | Type Identifier |
203
+ | ---------- | --------------- |
204
+ | Line | `line` |
205
+ | Area | `area` |
206
+ | Column | `column` |
207
+ | Bar | `bar` |
208
+ | Pie | `pie` |
209
+ | Scatter | `scatter` |
210
+ | Radar | `radar` |
211
+ | Funnel | `funnel` |
212
+ | Waterfall | `waterfall` |
213
+ | Dual Axes | `dual-axes` |
214
+ | Histogram | `histogram` |
215
+ | Boxplot | `boxplot` |
216
+ | Violin | `violin` |
217
+ | Venn | `venn` |
218
+ | Sankey | `sankey` |
219
+ | Treemap | `treemap` |
220
+ | Word Cloud | `word-cloud` |
221
+ | Liquid | `liquid` |
222
+
223
+ ### Relationship Charts (6)
224
+
225
+ | Chart | Type Identifier |
226
+ | ------------------ | -------------------- |
227
+ | Flow Diagram | `flow-diagram` |
228
+ | Network Graph | `network-graph` |
229
+ | Mindmap | `mindmap` |
230
+ | Indented Tree | `indented-tree` |
231
+ | Organization Chart | `organization-chart` |
232
+ | Fishbone Diagram | `fishbone-diagram` |
233
+
234
+ ### Text Visualization (2)
235
+
236
+ | Chart | Type Identifier |
237
+ | ------- | --------------- |
238
+ | Table | `table` |
239
+ | Summary | `summary` |
240
+
241
+ Explore all examples → [Examples Gallery](https://gpt-vis.antv.vision/examples)
242
+
141
243
  ## 🔧 Framework Integration
142
244
 
143
245
  <details>
@@ -146,7 +248,7 @@ data
146
248
  ```javascript
147
249
  import { GPTVis } from '@antv/gpt-vis';
148
250
 
149
- const gptVis = new GPTVis({ container: '#chart', width: 600, height: 400 });
251
+ const gptVis = new GPTVis({ container: 'chart', width: 600, height: 400 });
150
252
  gptVis.render(visSyntaxString);
151
253
  ```
152
254
 
@@ -189,25 +291,22 @@ function ChartComponent({ visSyntax }) {
189
291
  </template>
190
292
 
191
293
  <script setup>
192
- import { ref, onMounted, onUnmounted, watch } from 'vue';
294
+ import { ref, watch, onUnmounted } from 'vue';
193
295
  import { GPTVis } from '@antv/gpt-vis';
194
296
 
195
297
  const props = defineProps(['visSyntax']);
196
298
  const chartRef = ref(null);
197
299
  let gptVis = null;
198
300
 
199
- onMounted(() => {
200
- gptVis = new GPTVis({ container: chartRef.value, width: 600, height: 400 });
201
- gptVis.render(props.visSyntax);
202
- });
203
-
204
301
  watch(
205
302
  () => props.visSyntax,
206
- (newSyntax) => {
207
- if (gptVis) {
208
- gptVis.render(newSyntax);
303
+ (syntax) => {
304
+ if (!gptVis) {
305
+ gptVis = new GPTVis({ container: chartRef.value, width: 600, height: 400 });
209
306
  }
307
+ gptVis.render(syntax);
210
308
  },
309
+ { immediate: true },
211
310
  );
212
311
 
213
312
  onUnmounted(() => gptVis?.destroy());
@@ -216,19 +315,96 @@ onUnmounted(() => gptVis?.destroy());
216
315
 
217
316
  </details>
218
317
 
219
- ## 🧠 Knowledge Base
318
+ <details>
319
+ <summary><strong>Markdown Renderer (marked)</strong></summary>
220
320
 
221
- GPT-Vis includes a comprehensive [knowledge base](https://github.com/antvis/GPT-Vis/tree/main/knowledges) to help LLMs understand when to use each chart type and how to structure data. Evaluated on 200+ scenarios with 90%+ accuracy.
321
+ 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.
222
322
 
223
- ## 🤝 Contributing
323
+ **Install dependencies:**
324
+
325
+ ```bash
326
+ npm install @antv/gpt-vis marked marked-highlight highlight.js
327
+ ```
328
+
329
+ **Complete example:**
330
+
331
+ ```javascript
332
+ import { Marked } from 'marked';
333
+ import { markedHighlight } from 'marked-highlight';
334
+ import hljs from 'highlight.js';
335
+ import { GPTVis } from '@antv/gpt-vis';
336
+
337
+ class GPTVisElement extends HTMLElement {
338
+ connectedCallback() {
339
+ const syntax = decodeURIComponent(this.dataset.syntax);
340
+ this._instance = new GPTVis({ container: this });
341
+ this._instance.render(syntax);
342
+ }
343
+ disconnectedCallback() {
344
+ this._instance?.destroy();
345
+ }
346
+ }
347
+ if (!customElements.get('gpt-vis')) {
348
+ customElements.define('gpt-vis', GPTVisElement);
349
+ }
350
+
351
+ const marked = new Marked(
352
+ markedHighlight({
353
+ langPrefix: 'hljs language-',
354
+ highlight(code, lang) {
355
+ if (lang?.startsWith('vis')) return code;
356
+ const language = hljs.getLanguage(lang) ? lang : 'plaintext';
357
+ return hljs.highlight(code, { language }).value;
358
+ },
359
+ }),
360
+ {
361
+ renderer: {
362
+ code({ text, lang }) {
363
+ if (lang?.startsWith('vis')) {
364
+ const syntax = encodeURIComponent(lang + '\n' + text);
365
+ return `<gpt-vis data-syntax="${syntax}" style="min-height:300px"></gpt-vis>`;
366
+ }
367
+ return false;
368
+ },
369
+ },
370
+ },
371
+ );
372
+
373
+ const markdown = `# My Report
374
+
375
+ \`\`\`vis bar
376
+ data
377
+ - category Python
378
+ value 28.1
379
+ - category JavaScript
380
+ value 18.5
381
+ - category Java
382
+ value 15.6
383
+ - category "C/C++"
384
+ value 12.3
385
+ title 2024 Programming Language Popularity
386
+ \`\`\`
387
+ `;
224
388
 
225
- > **⚠️ AI-Generated Code Policy**: This project only merges AI-generated code.
389
+ document.getElementById('content').innerHTML = marked.parse(markdown);
390
+ ```
391
+
392
+ </details>
393
+
394
+ ## 🤖 AI Ecosystem
395
+
396
+ GPT-Vis provides a complete AI integration solution:
397
+
398
+ - **[MCP Server](https://github.com/antvis/mcp-server-chart)** — Enable AI models to directly invoke visualization capabilities via Model Context Protocol
399
+ - **[Chart Skill](https://github.com/antvis/GPT-Vis/tree/main/skills/chart-visualization)** — Provide AI assistants with chart recommendation and generation capabilities, supporting both syntax mode and code mode output
400
+
401
+ ## 🤝 Contributing
226
402
 
227
- To contribute:
403
+ > **AI-Generated Code Policy**: This project only merges AI-generated code.
228
404
 
229
- 1. Submit an Issue describing the problem or feature
405
+ 1. Submit an Issue describing the problem or feature request
230
406
  2. Tag @copilot to generate the implementation
231
- 3. Submit PR with AI-generated code
407
+ 3. Submit a PR with AI-generated code
232
408
 
233
409
  ## 📄 License
234
410