@antv/infographic 0.2.3 → 0.2.5

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 (41) hide show
  1. package/README.md +43 -7
  2. package/README.zh-CN.md +43 -7
  3. package/dist/infographic.min.js +117 -107
  4. package/dist/infographic.min.js.map +1 -1
  5. package/esm/designs/structures/chart-wordcloud.js +1 -1
  6. package/esm/designs/structures/hierarchy-structure.d.ts +45 -0
  7. package/esm/designs/structures/hierarchy-structure.js +266 -0
  8. package/esm/designs/structures/index.d.ts +1 -0
  9. package/esm/designs/structures/index.js +1 -0
  10. package/esm/index.d.ts +2 -2
  11. package/esm/index.js +2 -2
  12. package/esm/templates/built-in.js +2 -0
  13. package/esm/templates/hierarchy-structure.d.ts +2 -0
  14. package/esm/templates/hierarchy-structure.js +21 -0
  15. package/esm/utils/is-browser.d.ts +1 -0
  16. package/esm/utils/is-browser.js +68 -0
  17. package/esm/utils/measure-text.d.ts +1 -0
  18. package/esm/utils/measure-text.js +9 -7
  19. package/lib/designs/structures/chart-wordcloud.js +1 -1
  20. package/lib/designs/structures/hierarchy-structure.d.ts +45 -0
  21. package/lib/designs/structures/hierarchy-structure.js +270 -0
  22. package/lib/designs/structures/index.d.ts +1 -0
  23. package/lib/designs/structures/index.js +1 -0
  24. package/lib/index.d.ts +2 -2
  25. package/lib/index.js +4 -3
  26. package/lib/templates/built-in.js +2 -0
  27. package/lib/templates/hierarchy-structure.d.ts +2 -0
  28. package/lib/templates/hierarchy-structure.js +24 -0
  29. package/lib/utils/is-browser.d.ts +1 -0
  30. package/lib/utils/is-browser.js +71 -0
  31. package/lib/utils/measure-text.d.ts +1 -0
  32. package/lib/utils/measure-text.js +11 -7
  33. package/package.json +1 -1
  34. package/src/designs/structures/chart-wordcloud.tsx +1 -1
  35. package/src/designs/structures/hierarchy-structure.tsx +658 -0
  36. package/src/designs/structures/index.ts +1 -0
  37. package/src/index.ts +2 -3
  38. package/src/templates/built-in.ts +2 -0
  39. package/src/templates/hierarchy-structure.ts +23 -0
  40. package/src/utils/is-browser.ts +79 -0
  41. package/src/utils/measure-text.ts +11 -7
package/README.md CHANGED
@@ -79,13 +79,13 @@ const infographic = new Infographic({
79
79
  infographic.render(`
80
80
  infographic list-row-simple-horizontal-arrow
81
81
  data
82
- items:
83
- - label: Step 1
84
- desc: Start
85
- - label: Step 2
86
- desc: In Progress
87
- - label: Step 3
88
- desc: Complete
82
+ items
83
+ - label Step 1
84
+ desc Start
85
+ - label Step 2
86
+ desc In Progress
87
+ - label Step 3
88
+ desc Complete
89
89
  `);
90
90
  ```
91
91
 
@@ -109,6 +109,42 @@ for (const chunk of chunks) {
109
109
 
110
110
  <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*e_PFSZrR9AQAAAAASdAAAAgAemJ7AQ/original" width="480" alt="AntV Infographic Streaming Rendering">
111
111
 
112
+ ## 🔧 Skills Integration
113
+
114
+ AntV Infographic provides skills to integrate with AI agents:
115
+
116
+ - **infographic-creator**: Create an HTML file that renders an infographic
117
+ - **infographic-syntax-creator**: Generate infographic syntax from descriptions
118
+ - **infographic-structure-creator**: Generate custom structure designs
119
+ - **infographic-item-creator**: Generate custom item designs
120
+ - **infographic-template-updater**: (For developers) update the template library
121
+
122
+ ### Claude Code
123
+
124
+ > We don't have a Claude marketplace entry yet, so install manually.
125
+
126
+ ```bash
127
+ set -e
128
+
129
+ VERSION=0.2.4 # Replace with the latest tag, e.g. 0.2.4
130
+ BASE_URL=https://github.com/antvis/Infographic/releases/download
131
+ mkdir -p .claude/skills
132
+
133
+ curl -L --fail -o skills.zip "$BASE_URL/$VERSION/skills.zip"
134
+ unzip -q -o skills.zip -d .claude/skills
135
+ rm -f skills.zip
136
+ ```
137
+
138
+ ### Codex
139
+
140
+ > Enter codex
141
+
142
+ ```codex
143
+ # Replace <SKILL> with the skill name, e.g. infographic-creator
144
+ # https://github.com/antvis/Infographic/tree/main/.skills/<SKILL>
145
+ $skill-installer install https://github.com/antvis/Infographic/tree/main/.skills/infographic-creator
146
+ ```
147
+
112
148
  ## 💬 Community & Communication
113
149
 
114
150
  - Submit your questions or suggestions on GitHub
package/README.zh-CN.md CHANGED
@@ -79,13 +79,13 @@ const infographic = new Infographic({
79
79
  infographic.render(`
80
80
  infographic list-row-simple-horizontal-arrow
81
81
  data
82
- items:
83
- - label: Step 1
84
- desc: Start
85
- - label: Step 2
86
- desc: In Progress
87
- - label: Step 3
88
- desc: Complete
82
+ items
83
+ - label Step 1
84
+ desc Start
85
+ - label Step 2
86
+ desc In Progress
87
+ - label Step 3
88
+ desc Complete
89
89
  `);
90
90
  ```
91
91
 
@@ -109,6 +109,42 @@ for (const chunk of chunks) {
109
109
 
110
110
  <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*e_PFSZrR9AQAAAAASdAAAAgAemJ7AQ/original" width="480" alt="AntV Infographic 流式渲染">
111
111
 
112
+ ## 🔧 Skills 集成
113
+
114
+ AntV Infographic 提供了多项能力,便于与 AI 大模型集成:
115
+
116
+ - **infographic-creator**:创建一个渲染信息图的 HTML 文件
117
+ - **infographic-syntax-creator**:根据描述生成信息图语法
118
+ - **infographic-structure-creator**:生成自定义的结构设计
119
+ - **infographic-item-creator**:生成自定义的数据项设计
120
+ - **infographic-template-updater**:(开发者使用)用于更新信息图模板库
121
+
122
+ ### Claude Code
123
+
124
+ > 我们暂未提供 claude marketplace,因此需要手动集成。
125
+
126
+ ```bash
127
+ set -e
128
+
129
+ VERSION=0.2.4 # 替换为最新版本号,例如 0.2.4
130
+ BASE_URL=https://github.com/antvis/Infographic/releases/download
131
+ mkdir -p .claude/skills
132
+
133
+ curl -L --fail -o skills.zip "$BASE_URL/$VERSION/skills.zip"
134
+ unzip -q -o skills.zip -d .claude/skills
135
+ rm -f skills.zip
136
+ ```
137
+
138
+ ### Codex
139
+
140
+ > 进入 codex
141
+
142
+ ```codex
143
+ # 将 <SKILL> 替换为需要安装的 skill 名称,例如 infographic-creator
144
+ # https://github.com/antvis/Infographic/tree/main/.skills/<SKILL>
145
+ $skill-installer install https://github.com/antvis/Infographic/tree/main/.skills/infographic-creator
146
+ ```
147
+
112
148
  ## 💬 社区与交流
113
149
 
114
150
  - 在 GitHub 提交你的问题或建议