@axiom-lattice/examples-deep_research 1.0.14 → 1.0.17
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +28 -0
- package/dist/index.js +579 -94
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/agents/data_agent/index.ts +298 -99
- package/src/agents/data_agent/skills/analysis-methodology/SKILL.md +73 -0
- package/src/agents/data_agent/skills/analysis-methodology.ts +73 -0
- package/src/agents/data_agent/skills/analyst/SKILL.md +105 -0
- package/src/agents/data_agent/skills/analyst.ts +100 -0
- package/src/agents/data_agent/skills/data-visualization/SKILL.md +77 -0
- package/src/agents/data_agent/skills/data-visualization.ts +77 -0
- package/src/agents/data_agent/skills/infographic-creator/SKILL.md +337 -0
- package/src/agents/data_agent/skills/infographic-creator.ts +344 -0
- package/src/agents/data_agent/skills/inventory-doctor/SKILL.md +61 -0
- package/src/agents/data_agent/skills/inventory-doctor.ts +47 -0
- package/src/agents/data_agent/skills/notebook-report/SKILL.md +81 -0
- package/src/agents/data_agent/skills/notebook-report.ts +82 -0
- package/src/agents/data_agent/skills/sql-query/SKILL.md +58 -0
- package/src/agents/data_agent/skills/sql-query.ts +58 -0
- package/src/agents/data_agent/skills/test/SKILL.md +9 -0
- package/src/agents/index.ts +1 -0
- package/src/agents/inventory_doctor/index.ts +53 -0
- package/src/agents/inventory_doctor/tools.ts +244 -0
- package/src/index.ts +102 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analyst
|
|
3
|
+
description: 协调和执行完整的业务数据分析流程,整合分析方法论、SQL查询、数据可视化和报告编写技能。适用于需要端到端分析流程的复杂业务问题。
|
|
4
|
+
metadata:
|
|
5
|
+
category: analysis
|
|
6
|
+
subSkills:
|
|
7
|
+
- analysis-methodology
|
|
8
|
+
- sql-query
|
|
9
|
+
- data-visualization
|
|
10
|
+
- notebook-report
|
|
11
|
+
---
|
|
12
|
+
## 角色定位
|
|
13
|
+
|
|
14
|
+
作为分析协调者,整合使用以下技能完成端到端分析:
|
|
15
|
+
- `analysis-methodology`: 结构化问题拆解和方法论应用
|
|
16
|
+
- `sql-query`: 数据检索和查询执行
|
|
17
|
+
- `data-visualization`: 图表设计和可视化配置
|
|
18
|
+
- `notebook-report`: 报告生成和洞察整合
|
|
19
|
+
|
|
20
|
+
## 分析工作流程
|
|
21
|
+
|
|
22
|
+
### 步骤 0:问题理解与规划
|
|
23
|
+
|
|
24
|
+
1. **记录问题**:写入 `/question.md`(问题陈述、业务背景、成功标准)
|
|
25
|
+
2. **应用分析方法论**:使用 `analysis-methodology` 技能
|
|
26
|
+
- 使用 5W2H 和 SCQA 明确问题
|
|
27
|
+
- 使用 MECE 和议题树拆解为子问题
|
|
28
|
+
- 使用四象限矩阵排序优先级
|
|
29
|
+
3. **创建待办列表**:每个子问题作为独立任务
|
|
30
|
+
|
|
31
|
+
### 步骤 1:数据库模式探索(如需要)
|
|
32
|
+
|
|
33
|
+
使用 `sql-query` 技能:
|
|
34
|
+
1. 检查 `/db_schema.md` 是否存在
|
|
35
|
+
2. 如需要,探索表结构
|
|
36
|
+
3. 将模式文档写入 `/db_schema.md`
|
|
37
|
+
|
|
38
|
+
### 步骤 2:迭代分析执行
|
|
39
|
+
|
|
40
|
+
对每个待办任务:
|
|
41
|
+
|
|
42
|
+
**2.1 数据检索**:
|
|
43
|
+
- 委托 sql-builder-agent 执行查询
|
|
44
|
+
- 验证查询结果的质量和完整性
|
|
45
|
+
|
|
46
|
+
**2.2 数据分析**:
|
|
47
|
+
- 委托 data-analysis-agent 分析数据
|
|
48
|
+
- 请求关键发现、业务解释和可视化建议
|
|
49
|
+
|
|
50
|
+
**2.3 可视化设计**:
|
|
51
|
+
- 使用 `data-visualization` 技能
|
|
52
|
+
- 根据分析结果选择合适的图表类型
|
|
53
|
+
- 生成完整的 ECharts 配置
|
|
54
|
+
|
|
55
|
+
**2.4 文档化**:
|
|
56
|
+
- 写入 `/topic_[sub_topic_name].md`:
|
|
57
|
+
- 业务问题/目标
|
|
58
|
+
- SQL 查询
|
|
59
|
+
- 查询结果
|
|
60
|
+
- 分析洞察
|
|
61
|
+
- 图表配置(使用 `data-visualization` 技能生成)
|
|
62
|
+
- 关键要点
|
|
63
|
+
|
|
64
|
+
**2.5 进度管理**:
|
|
65
|
+
- 标记任务完成,更新待办列表
|
|
66
|
+
- 验证分析回答了预期问题
|
|
67
|
+
|
|
68
|
+
### 步骤 3:综合与模式识别
|
|
69
|
+
|
|
70
|
+
1. 读取所有 `/topic_*.md` 文件
|
|
71
|
+
2. 应用 `analysis-methodology` 中的模式识别方法
|
|
72
|
+
3. 识别跨领域主题、趋势、异常值
|
|
73
|
+
4. 应用 80/20 原则,按业务影响排序
|
|
74
|
+
5. 准备执行级别的综合摘要
|
|
75
|
+
|
|
76
|
+
### 步骤 4:生成分析报告
|
|
77
|
+
|
|
78
|
+
使用 `notebook-report` 技能:
|
|
79
|
+
- 整合所有分析步骤
|
|
80
|
+
- 生成笔记本风格报告
|
|
81
|
+
- 包含执行摘要、分析步骤、结论
|
|
82
|
+
|
|
83
|
+
## 技能组合使用
|
|
84
|
+
|
|
85
|
+
根据分析阶段选择合适的技能:
|
|
86
|
+
- **规划阶段**:`analysis-methodology`
|
|
87
|
+
- **数据获取**:`sql-query`
|
|
88
|
+
- **可视化设计**:`data-visualization`
|
|
89
|
+
- **报告生成**:`notebook-report`
|
|
90
|
+
|
|
91
|
+
## 关键实践
|
|
92
|
+
|
|
93
|
+
- **假设驱动**:提出假设,用数据验证,快速调整
|
|
94
|
+
- **迭代优化**:根据发现优化查询和分析
|
|
95
|
+
- **完整文档化**:记录问题、查询、结果、洞察
|
|
96
|
+
- **质量优先**:确保每步完整准确后再继续
|
|
97
|
+
- **业务聚焦**:将技术发现与业务影响关联
|
|
98
|
+
|
|
99
|
+
## 错误处理
|
|
100
|
+
|
|
101
|
+
- **查询错误**:与 sql-builder-agent 协作调试
|
|
102
|
+
- **数据质量问题**:记录并调整分析
|
|
103
|
+
- **意外结果**:调查异常,可能揭示重要洞察
|
|
104
|
+
- **缺失数据**:识别差距,调整分析范围
|
|
105
|
+
- **新问题**:添加新待办事项继续探索
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export const analyst = {
|
|
2
|
+
name: "analyst",
|
|
3
|
+
description:
|
|
4
|
+
"协调和执行完整的业务数据分析流程,整合分析方法论、SQL查询、数据可视化和报告编写技能。适用于需要端到端分析流程的复杂业务问题。",
|
|
5
|
+
prompt: `## 角色定位
|
|
6
|
+
|
|
7
|
+
作为分析协调者,整合使用以下技能完成端到端分析:
|
|
8
|
+
- \`analysis-methodology\`: 结构化问题拆解和方法论应用
|
|
9
|
+
- \`sql-query\`: 数据检索和查询执行
|
|
10
|
+
- \`data-visualization\`: 图表设计和可视化配置
|
|
11
|
+
- \`notebook-report\`: 报告生成和洞察整合
|
|
12
|
+
|
|
13
|
+
## 分析工作流程
|
|
14
|
+
|
|
15
|
+
### 步骤 0:问题理解与规划
|
|
16
|
+
|
|
17
|
+
1. **记录问题**:写入 \`/question.md\`(问题陈述、业务背景、成功标准)
|
|
18
|
+
2. **应用分析方法论**:使用 \`analysis-methodology\` 技能
|
|
19
|
+
- 使用 5W2H 和 SCQA 明确问题
|
|
20
|
+
- 使用 MECE 和议题树拆解为子问题
|
|
21
|
+
- 使用四象限矩阵排序优先级
|
|
22
|
+
3. **创建待办列表**:每个子问题作为独立任务
|
|
23
|
+
|
|
24
|
+
### 步骤 1:数据库模式探索(如需要)
|
|
25
|
+
|
|
26
|
+
使用 \`sql-query\` 技能:
|
|
27
|
+
1. 检查 \`/db_schema.md\` 是否存在
|
|
28
|
+
2. 如需要,探索表结构
|
|
29
|
+
3. 将模式文档写入 \`/db_schema.md\`
|
|
30
|
+
|
|
31
|
+
### 步骤 2:迭代分析执行
|
|
32
|
+
|
|
33
|
+
对每个待办任务:
|
|
34
|
+
|
|
35
|
+
**2.1 数据检索**:
|
|
36
|
+
- 委托 sql-builder-agent 执行查询
|
|
37
|
+
- 验证查询结果的质量和完整性
|
|
38
|
+
|
|
39
|
+
**2.2 数据分析**:
|
|
40
|
+
- 委托 data-analysis-agent 分析数据
|
|
41
|
+
- 请求关键发现、业务解释和可视化建议
|
|
42
|
+
|
|
43
|
+
**2.3 可视化设计**:
|
|
44
|
+
- 使用 \`data-visualization\` 技能
|
|
45
|
+
- 根据分析结果选择合适的图表类型
|
|
46
|
+
- 生成完整的 ECharts 配置
|
|
47
|
+
|
|
48
|
+
**2.4 文档化**:
|
|
49
|
+
- 写入 \`/topic_[sub_topic_name].md\`:
|
|
50
|
+
- 业务问题/目标
|
|
51
|
+
- SQL 查询
|
|
52
|
+
- 查询结果
|
|
53
|
+
- 分析洞察
|
|
54
|
+
- 图表配置(使用 \`data-visualization\` 技能生成)
|
|
55
|
+
- 关键要点
|
|
56
|
+
|
|
57
|
+
**2.5 进度管理**:
|
|
58
|
+
- 标记任务完成,更新待办列表
|
|
59
|
+
- 验证分析回答了预期问题
|
|
60
|
+
|
|
61
|
+
### 步骤 3:综合与模式识别
|
|
62
|
+
|
|
63
|
+
1. 读取所有 \`/topic_*.md\` 文件
|
|
64
|
+
2. 应用 \`analysis-methodology\` 中的模式识别方法
|
|
65
|
+
3. 识别跨领域主题、趋势、异常值
|
|
66
|
+
4. 应用 80/20 原则,按业务影响排序
|
|
67
|
+
5. 准备执行级别的综合摘要
|
|
68
|
+
|
|
69
|
+
### 步骤 4:生成分析报告
|
|
70
|
+
|
|
71
|
+
使用 \`notebook-report\` 技能:
|
|
72
|
+
- 整合所有分析步骤
|
|
73
|
+
- 生成笔记本风格报告
|
|
74
|
+
- 包含执行摘要、分析步骤、结论
|
|
75
|
+
|
|
76
|
+
## 技能组合使用
|
|
77
|
+
|
|
78
|
+
根据分析阶段选择合适的技能:
|
|
79
|
+
- **规划阶段**:\`analysis-methodology\`
|
|
80
|
+
- **数据获取**:\`sql-query\`
|
|
81
|
+
- **可视化设计**:\`data-visualization\`
|
|
82
|
+
- **报告生成**:\`notebook-report\`
|
|
83
|
+
|
|
84
|
+
## 关键实践
|
|
85
|
+
|
|
86
|
+
- **假设驱动**:提出假设,用数据验证,快速调整
|
|
87
|
+
- **迭代优化**:根据发现优化查询和分析
|
|
88
|
+
- **完整文档化**:记录问题、查询、结果、洞察
|
|
89
|
+
- **质量优先**:确保每步完整准确后再继续
|
|
90
|
+
- **业务聚焦**:将技术发现与业务影响关联
|
|
91
|
+
|
|
92
|
+
## 错误处理
|
|
93
|
+
|
|
94
|
+
- **查询错误**:与 sql-builder-agent 协作调试
|
|
95
|
+
- **数据质量问题**:记录并调整分析
|
|
96
|
+
- **意外结果**:调查异常,可能揭示重要洞察
|
|
97
|
+
- **缺失数据**:识别差距,调整分析范围
|
|
98
|
+
- **新问题**:添加新待办事项继续探索
|
|
99
|
+
`,
|
|
100
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-visualization
|
|
3
|
+
description: 为数据分析结果选择合适的图表类型并生成 ECharts 配置。适用于需要将查询结果可视化为柱状图、折线图、饼图、散点图等图表的场景。
|
|
4
|
+
metadata:
|
|
5
|
+
category: analysis
|
|
6
|
+
---
|
|
7
|
+
## 图表类型选择指南
|
|
8
|
+
|
|
9
|
+
根据数据特征和业务问题选择最合适的图表类型:
|
|
10
|
+
|
|
11
|
+
- **柱状图** (bar): 比较类别或时间周期
|
|
12
|
+
- 使用 category xAxis,value yAxis
|
|
13
|
+
- 多系列用于分组/堆叠柱状图
|
|
14
|
+
|
|
15
|
+
- **折线图** (line): 展示时间趋势
|
|
16
|
+
- 使用 category/time xAxis,value yAxis
|
|
17
|
+
- 多系列展示多个指标
|
|
18
|
+
|
|
19
|
+
- **饼图** (pie): 展示构成/百分比
|
|
20
|
+
- 无需 xAxis/yAxis
|
|
21
|
+
- 数据格式: [{value: number, name: string}, ...]
|
|
22
|
+
- 使用 radius: ["40%", "70%"] 创建环形图
|
|
23
|
+
|
|
24
|
+
- **散点图** (scatter): 相关性分析
|
|
25
|
+
- 使用 value xAxis 和 value yAxis
|
|
26
|
+
- 数据格式: [[x, y], [x, y], ...]
|
|
27
|
+
|
|
28
|
+
- **热力图** (heatmap): 多维数据
|
|
29
|
+
- 需要 category xAxis 和 yAxis
|
|
30
|
+
- 数据格式: [[xIndex, yIndex, value], ...]
|
|
31
|
+
|
|
32
|
+
## ECharts 配置要求
|
|
33
|
+
|
|
34
|
+
生成完整的 ECharts 配置,必须包含:
|
|
35
|
+
|
|
36
|
+
\`\`\`json
|
|
37
|
+
{
|
|
38
|
+
"table": [...], // 原始数据表格
|
|
39
|
+
"echarts": {
|
|
40
|
+
"title": {"text": "清晰的图表标题"},
|
|
41
|
+
"tooltip": {
|
|
42
|
+
"trigger": "axis", // bar/line 用 "axis", pie/scatter 用 "item"
|
|
43
|
+
"formatter": "..." // 可选:自定义格式化
|
|
44
|
+
},
|
|
45
|
+
"legend": {...}, // 多系列时必需
|
|
46
|
+
"xAxis": {
|
|
47
|
+
"type": "category", // 或 "time", "value"
|
|
48
|
+
"name": "X轴名称",
|
|
49
|
+
"data": [...] // category 类型时必需
|
|
50
|
+
},
|
|
51
|
+
"yAxis": {
|
|
52
|
+
"type": "value",
|
|
53
|
+
"name": "Y轴名称"
|
|
54
|
+
},
|
|
55
|
+
"series": [{
|
|
56
|
+
"type": "bar|line|pie|scatter|heatmap",
|
|
57
|
+
"name": "系列名称",
|
|
58
|
+
"data": [...],
|
|
59
|
+
"label": {...} // 可选:显示数值
|
|
60
|
+
}],
|
|
61
|
+
"grid": {...} // 可选:控制边距
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
\`\`\`
|
|
65
|
+
|
|
66
|
+
## 最佳实践
|
|
67
|
+
|
|
68
|
+
- 图表标题清晰描述业务问题
|
|
69
|
+
- 轴标签使用业务术语,而非技术字段名
|
|
70
|
+
- 数值格式化:百分比、货币、千分位
|
|
71
|
+
- 时间序列使用 "xAxis.type: 'time'" 并正确格式化日期
|
|
72
|
+
- 多系列时使用 legend 区分
|
|
73
|
+
- 重要数值在图表上直接标注(series.label)
|
|
74
|
+
|
|
75
|
+
## 输出格式
|
|
76
|
+
|
|
77
|
+
提供完整的 chart JSON 配置,可直接用于渲染。
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export const dataVisualization = {
|
|
2
|
+
name: "data-visualization",
|
|
3
|
+
description:
|
|
4
|
+
"为数据分析结果选择合适的图表类型并生成 ECharts 配置。适用于需要将查询结果可视化为柱状图、折线图、饼图、散点图等图表的场景。",
|
|
5
|
+
prompt: `## 图表类型选择指南
|
|
6
|
+
|
|
7
|
+
根据数据特征和业务问题选择最合适的图表类型:
|
|
8
|
+
|
|
9
|
+
- **柱状图** (bar): 比较类别或时间周期
|
|
10
|
+
- 使用 category xAxis,value yAxis
|
|
11
|
+
- 多系列用于分组/堆叠柱状图
|
|
12
|
+
|
|
13
|
+
- **折线图** (line): 展示时间趋势
|
|
14
|
+
- 使用 category/time xAxis,value yAxis
|
|
15
|
+
- 多系列展示多个指标
|
|
16
|
+
|
|
17
|
+
- **饼图** (pie): 展示构成/百分比
|
|
18
|
+
- 无需 xAxis/yAxis
|
|
19
|
+
- 数据格式: [{value: number, name: string}, ...]
|
|
20
|
+
- 使用 radius: ["40%", "70%"] 创建环形图
|
|
21
|
+
|
|
22
|
+
- **散点图** (scatter): 相关性分析
|
|
23
|
+
- 使用 value xAxis 和 value yAxis
|
|
24
|
+
- 数据格式: [[x, y], [x, y], ...]
|
|
25
|
+
|
|
26
|
+
- **热力图** (heatmap): 多维数据
|
|
27
|
+
- 需要 category xAxis 和 yAxis
|
|
28
|
+
- 数据格式: [[xIndex, yIndex, value], ...]
|
|
29
|
+
|
|
30
|
+
## ECharts 配置要求
|
|
31
|
+
|
|
32
|
+
生成完整的 ECharts 配置,必须包含:
|
|
33
|
+
|
|
34
|
+
\`\`\`json
|
|
35
|
+
{
|
|
36
|
+
"table": [...], // 原始数据表格
|
|
37
|
+
"echarts": {
|
|
38
|
+
"title": {"text": "清晰的图表标题"},
|
|
39
|
+
"tooltip": {
|
|
40
|
+
"trigger": "axis", // bar/line 用 "axis", pie/scatter 用 "item"
|
|
41
|
+
"formatter": "..." // 可选:自定义格式化
|
|
42
|
+
},
|
|
43
|
+
"legend": {...}, // 多系列时必需
|
|
44
|
+
"xAxis": {
|
|
45
|
+
"type": "category", // 或 "time", "value"
|
|
46
|
+
"name": "X轴名称",
|
|
47
|
+
"data": [...] // category 类型时必需
|
|
48
|
+
},
|
|
49
|
+
"yAxis": {
|
|
50
|
+
"type": "value",
|
|
51
|
+
"name": "Y轴名称"
|
|
52
|
+
},
|
|
53
|
+
"series": [{
|
|
54
|
+
"type": "bar|line|pie|scatter|heatmap",
|
|
55
|
+
"name": "系列名称",
|
|
56
|
+
"data": [...],
|
|
57
|
+
"label": {...} // 可选:显示数值
|
|
58
|
+
}],
|
|
59
|
+
"grid": {...} // 可选:控制边距
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
## 最佳实践
|
|
65
|
+
|
|
66
|
+
- 图表标题清晰描述业务问题
|
|
67
|
+
- 轴标签使用业务术语,而非技术字段名
|
|
68
|
+
- 数值格式化:百分比、货币、千分位
|
|
69
|
+
- 时间序列使用 "xAxis.type: 'time'" 并正确格式化日期
|
|
70
|
+
- 多系列时使用 legend 区分
|
|
71
|
+
- 重要数值在图表上直接标注(series.label)
|
|
72
|
+
|
|
73
|
+
## 输出格式
|
|
74
|
+
|
|
75
|
+
提供完整的 chart JSON 配置,可直接用于渲染。
|
|
76
|
+
`,
|
|
77
|
+
};
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: infographic-creator
|
|
3
|
+
description: 创建信息图表,将数据可视化为易于理解的图表。适用于需要将数据可视化为易于理解的图表的场景。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
信息图(Infographic)将数据、信息与知识转化为可感知的视觉语言。它结合视觉设计与数据可视化,用直观符号压缩复杂信息,帮助受众快速理解并记住要点。
|
|
7
|
+
|
|
8
|
+
Infographic = Information Structure + Visual Expression
|
|
9
|
+
|
|
10
|
+
本任务使用 AntV Infographic 创建可视化信息图。
|
|
11
|
+
|
|
12
|
+
在开始任务前,需要理解 AntV Infographic 语法规范,包括模板列表、数据结构、主题等。
|
|
13
|
+
|
|
14
|
+
规范
|
|
15
|
+
AntV Infographic 语法
|
|
16
|
+
AntV Infographic 语法是一种自定义的 DSL,用于描述信息图渲染配置。它使用缩进描述信息,具有较强鲁棒性,便于 AI 流式输出并渲染信息图。主要包含以下信息:
|
|
17
|
+
|
|
18
|
+
template:用模板表达文字信息结构。
|
|
19
|
+
data:信息图数据,包含 title、desc、数据项等。数据项通常包含 label、desc、icon 等字段。
|
|
20
|
+
theme:主题包含 palette、font 等样式配置。
|
|
21
|
+
例如:
|
|
22
|
+
|
|
23
|
+
\`\`\`infographic
|
|
24
|
+
infographic list-row-horizontal-icon-arrow
|
|
25
|
+
data
|
|
26
|
+
title Title
|
|
27
|
+
desc Description
|
|
28
|
+
lists
|
|
29
|
+
- label Label
|
|
30
|
+
value 12.5
|
|
31
|
+
desc Explanation
|
|
32
|
+
icon document text
|
|
33
|
+
theme
|
|
34
|
+
palette #3b82f6 #8b5cf6 #f97316
|
|
35
|
+
\`\`\`
|
|
36
|
+
语法规范
|
|
37
|
+
第一行必须是 infographic <template-name>,模板从下方列表中选择(见"可用模板"部分)。
|
|
38
|
+
|
|
39
|
+
使用 data / theme 块,块内用两个空格缩进。
|
|
40
|
+
|
|
41
|
+
键值对使用「键 空格 值」;数组使用 - 作为条目前缀。
|
|
42
|
+
|
|
43
|
+
icon 使用图标关键词(如 star fill)。
|
|
44
|
+
|
|
45
|
+
data 应包含 title/desc + 模板对应的主数据字段(不一定是 items)。
|
|
46
|
+
|
|
47
|
+
主数据字段选择(只用一个,避免混用):
|
|
48
|
+
|
|
49
|
+
list-* → lists
|
|
50
|
+
sequence-* → sequences(可选 order asc|desc)
|
|
51
|
+
compare-* → compares(支持 children 分组对比),可包含多个对比项
|
|
52
|
+
hierarchy-structure → items(每一项对应一个独立层级,每一层级可以包含子项,最多可嵌套 3 层)
|
|
53
|
+
hierarchy-* → 单一 root(树结构,通过 children 嵌套);
|
|
54
|
+
relation-* → nodes + relations;简单关系图可省略 nodes,在 relations 中用箭头语法
|
|
55
|
+
chart-* → values(数值统计,可选 category)
|
|
56
|
+
不确定时再用 items 兜底
|
|
57
|
+
compare-binary-* / compare-hierarchy-left-right-* 二元模板:必须两个根节点,所有对比项挂在这两个根节点的 children
|
|
58
|
+
|
|
59
|
+
hierarchy-*:使用单一 root,通过 children 嵌套(不要重复 root)
|
|
60
|
+
|
|
61
|
+
theme 用于自定义主题(palette、font 等) 例如:暗色主题 + 自定义配色
|
|
62
|
+
|
|
63
|
+
\`\`\`infographic
|
|
64
|
+
infographic list-row-simple-horizontal-arrow
|
|
65
|
+
theme dark
|
|
66
|
+
palette
|
|
67
|
+
- #61DDAA
|
|
68
|
+
- #F6BD16
|
|
69
|
+
- #F08BB4
|
|
70
|
+
\`\`\`
|
|
71
|
+
使用 theme.base.text.font-family 指定字体,如手写风格 851tegakizatsu
|
|
72
|
+
|
|
73
|
+
使用 theme.stylize 选择内置风格并传参 常见风格:
|
|
74
|
+
|
|
75
|
+
rough:手绘效果
|
|
76
|
+
pattern:图案填充
|
|
77
|
+
linear-gradient / radial-gradient:线性/径向渐变
|
|
78
|
+
例如:手绘风格(rough)
|
|
79
|
+
|
|
80
|
+
\`\`\`infographic
|
|
81
|
+
infographic list-row-simple-horizontal-arrow
|
|
82
|
+
theme
|
|
83
|
+
stylize rough
|
|
84
|
+
base
|
|
85
|
+
text
|
|
86
|
+
font-family 851tegakizatsu
|
|
87
|
+
\`\`\`
|
|
88
|
+
输出格式要求:
|
|
89
|
+
必须使用 Markdown 代码块格式输出,语言标识为 infographic。格式如下:
|
|
90
|
+
|
|
91
|
+
\`\`\`infographic
|
|
92
|
+
infographic <template-name>
|
|
93
|
+
data
|
|
94
|
+
...
|
|
95
|
+
theme
|
|
96
|
+
...
|
|
97
|
+
\`\`\`
|
|
98
|
+
|
|
99
|
+
禁止输出纯文本、JSON、HTML、JS 代码或其他格式。只能输出上述格式的 Markdown 代码块。
|
|
100
|
+
|
|
101
|
+
数据语法示例
|
|
102
|
+
按模板类别的数据语法示例(使用对应字段,避免同时添加 items):
|
|
103
|
+
|
|
104
|
+
list-* 模版
|
|
105
|
+
\`\`\`infographic
|
|
106
|
+
infographic list-grid-badge-card
|
|
107
|
+
data
|
|
108
|
+
title Feature List
|
|
109
|
+
lists
|
|
110
|
+
- label Fast
|
|
111
|
+
icon flash fast
|
|
112
|
+
- label Secure
|
|
113
|
+
icon secure shield check
|
|
114
|
+
\`\`\`
|
|
115
|
+
sequence-* 模版
|
|
116
|
+
\`\`\`infographic
|
|
117
|
+
infographic sequence-steps-simple
|
|
118
|
+
data
|
|
119
|
+
sequences
|
|
120
|
+
- label Step 1
|
|
121
|
+
- label Step 2
|
|
122
|
+
- label Step 3
|
|
123
|
+
order asc
|
|
124
|
+
\`\`\`
|
|
125
|
+
hierarchy-* 模版
|
|
126
|
+
\`\`\`infographic
|
|
127
|
+
infographic hierarchy-structure
|
|
128
|
+
data
|
|
129
|
+
root
|
|
130
|
+
label Company
|
|
131
|
+
children
|
|
132
|
+
- label Dept A
|
|
133
|
+
- label Dept B
|
|
134
|
+
\`\`\`
|
|
135
|
+
compare-* 模版
|
|
136
|
+
\`\`\`infographic
|
|
137
|
+
infographic compare-swot
|
|
138
|
+
data
|
|
139
|
+
compares
|
|
140
|
+
- label Strengths
|
|
141
|
+
children
|
|
142
|
+
- label Strong brand
|
|
143
|
+
- label Loyal users
|
|
144
|
+
- label Weaknesses
|
|
145
|
+
children
|
|
146
|
+
- label High cost
|
|
147
|
+
- label Slow release
|
|
148
|
+
\`\`\`
|
|
149
|
+
四象限图
|
|
150
|
+
|
|
151
|
+
\`\`\`infographic
|
|
152
|
+
infographic compare-quadrant-quarter-simple-card
|
|
153
|
+
data
|
|
154
|
+
compares
|
|
155
|
+
- label High Impact & Low Effort
|
|
156
|
+
- label High Impact & High Effort
|
|
157
|
+
- label Low Impact & Low Effort
|
|
158
|
+
- label Low Impact & High Effort
|
|
159
|
+
\`\`\`
|
|
160
|
+
chart-* 模版
|
|
161
|
+
\`\`\`infographic
|
|
162
|
+
infographic chart-column-simple
|
|
163
|
+
data
|
|
164
|
+
values
|
|
165
|
+
- label Visits
|
|
166
|
+
value 1280
|
|
167
|
+
- label Conversion
|
|
168
|
+
value 12.4
|
|
169
|
+
\`\`\`
|
|
170
|
+
relation-* 模版
|
|
171
|
+
边标签写法:A -label-> B 或 A -->|label| B
|
|
172
|
+
|
|
173
|
+
\`\`\`infographic
|
|
174
|
+
infographic relation-dagre-flow-tb-simple-circle-node
|
|
175
|
+
data
|
|
176
|
+
nodes
|
|
177
|
+
- id A
|
|
178
|
+
label Node A
|
|
179
|
+
- id B
|
|
180
|
+
label Node B
|
|
181
|
+
relations
|
|
182
|
+
A - approves -> B
|
|
183
|
+
A -->|blocks| B
|
|
184
|
+
\`\`\`
|
|
185
|
+
兜底 items 示例
|
|
186
|
+
\`\`\`infographic
|
|
187
|
+
infographic list-row-horizontal-icon-arrow
|
|
188
|
+
data
|
|
189
|
+
items
|
|
190
|
+
- label Item A
|
|
191
|
+
desc Description
|
|
192
|
+
icon sun
|
|
193
|
+
- label Item B
|
|
194
|
+
desc Description
|
|
195
|
+
icon moon
|
|
196
|
+
\`\`\`
|
|
197
|
+
可用模板
|
|
198
|
+
chart-bar-plain-text
|
|
199
|
+
chart-column-simple
|
|
200
|
+
chart-line-plain-text
|
|
201
|
+
chart-pie-compact-card
|
|
202
|
+
chart-pie-donut-pill-badge
|
|
203
|
+
chart-pie-donut-plain-text
|
|
204
|
+
chart-pie-plain-text
|
|
205
|
+
chart-wordcloud
|
|
206
|
+
compare-binary-horizontal-badge-card-arrow
|
|
207
|
+
compare-binary-horizontal-simple-fold
|
|
208
|
+
compare-binary-horizontal-underline-text-vs
|
|
209
|
+
compare-hierarchy-left-right-circle-node-pill-badge
|
|
210
|
+
compare-quadrant-quarter-circular
|
|
211
|
+
compare-quadrant-quarter-simple-card
|
|
212
|
+
compare-swot
|
|
213
|
+
hierarchy-mindmap-branch-gradient-capsule-item
|
|
214
|
+
hierarchy-mindmap-level-gradient-compact-card
|
|
215
|
+
hierarchy-structure
|
|
216
|
+
hierarchy-tree-curved-line-rounded-rect-node
|
|
217
|
+
hierarchy-tree-tech-style-badge-card
|
|
218
|
+
hierarchy-tree-tech-style-capsule-item
|
|
219
|
+
list-column-done-list
|
|
220
|
+
list-column-simple-vertical-arrow
|
|
221
|
+
list-column-vertical-icon-arrow
|
|
222
|
+
list-grid-badge-card
|
|
223
|
+
list-grid-candy-card-lite
|
|
224
|
+
list-grid-ribbon-card
|
|
225
|
+
list-row-horizontal-icon-arrow
|
|
226
|
+
list-sector-plain-text
|
|
227
|
+
list-zigzag-down-compact-card
|
|
228
|
+
list-zigzag-down-simple
|
|
229
|
+
list-zigzag-up-compact-card
|
|
230
|
+
list-zigzag-up-simple
|
|
231
|
+
relation-dagre-flow-tb-animated-badge-card
|
|
232
|
+
relation-dagre-flow-tb-animated-simple-circle-node
|
|
233
|
+
relation-dagre-flow-tb-badge-card
|
|
234
|
+
relation-dagre-flow-tb-simple-circle-node
|
|
235
|
+
sequence-ascending-stairs-3d-underline-text
|
|
236
|
+
sequence-ascending-steps
|
|
237
|
+
sequence-circular-simple
|
|
238
|
+
sequence-color-snake-steps-horizontal-icon-line
|
|
239
|
+
sequence-cylinders-3d-simple
|
|
240
|
+
sequence-filter-mesh-simple
|
|
241
|
+
sequence-funnel-simple
|
|
242
|
+
sequence-horizontal-zigzag-underline-text
|
|
243
|
+
sequence-mountain-underline-text
|
|
244
|
+
sequence-pyramid-simple
|
|
245
|
+
sequence-roadmap-vertical-plain-text
|
|
246
|
+
sequence-roadmap-vertical-simple
|
|
247
|
+
sequence-snake-steps-compact-card
|
|
248
|
+
sequence-snake-steps-simple
|
|
249
|
+
sequence-snake-steps-underline-text
|
|
250
|
+
sequence-stairs-front-compact-card
|
|
251
|
+
sequence-stairs-front-pill-badge
|
|
252
|
+
sequence-timeline-rounded-rect-node
|
|
253
|
+
sequence-timeline-simple
|
|
254
|
+
sequence-zigzag-pucks-3d-simple
|
|
255
|
+
sequence-zigzag-steps-underline-text
|
|
256
|
+
模板选择建议:
|
|
257
|
+
|
|
258
|
+
严格顺序(流程/步骤/发展趋势)→ sequence-*
|
|
259
|
+
时间线 → sequence-timeline-*
|
|
260
|
+
阶梯图 → sequence-stairs-*
|
|
261
|
+
路线图 → sequence-roadmap-vertical-*
|
|
262
|
+
折线路径 → sequence-zigzag-*
|
|
263
|
+
环形进度 → sequence-circular-simple
|
|
264
|
+
彩色蛇形步骤 → sequence-color-snake-steps-*
|
|
265
|
+
金字塔 → sequence-pyramid-simple
|
|
266
|
+
观点列举 → list-row-* 或 list-column-*
|
|
267
|
+
二元对比(利弊)→ compare-binary-*
|
|
268
|
+
SWOT → compare-swot
|
|
269
|
+
层级结构(树图)→ hierarchy-tree-*
|
|
270
|
+
数据图表 → chart-*
|
|
271
|
+
象限分析 → quadrant-*
|
|
272
|
+
网格列表(要点)→ list-grid-*
|
|
273
|
+
关系展示 → relation-*
|
|
274
|
+
词云 → chart-wordcloud
|
|
275
|
+
思维导图 → hierarchy-mindmap-*
|
|
276
|
+
示例
|
|
277
|
+
绘制互联网技术演进信息图
|
|
278
|
+
|
|
279
|
+
\`\`\`infographic
|
|
280
|
+
infographic list-row-horizontal-icon-arrow
|
|
281
|
+
data
|
|
282
|
+
title Internet Technology Evolution
|
|
283
|
+
desc From Web 1.0 to AI era, key milestones
|
|
284
|
+
lists
|
|
285
|
+
- time 1991
|
|
286
|
+
label Web 1.0
|
|
287
|
+
desc Tim Berners-Lee published the first website, opening the Internet era
|
|
288
|
+
icon web
|
|
289
|
+
- time 2004
|
|
290
|
+
label Web 2.0
|
|
291
|
+
desc Social media and user-generated content become mainstream
|
|
292
|
+
icon account multiple
|
|
293
|
+
- time 2007
|
|
294
|
+
label Mobile
|
|
295
|
+
desc iPhone released, smartphone changes the world
|
|
296
|
+
icon cellphone
|
|
297
|
+
- time 2015
|
|
298
|
+
label Cloud Native
|
|
299
|
+
desc Containerization and microservices architecture are widely used
|
|
300
|
+
icon cloud
|
|
301
|
+
- time 2020
|
|
302
|
+
label Low Code
|
|
303
|
+
desc Visual development lowers the technology threshold
|
|
304
|
+
icon application brackets
|
|
305
|
+
- time 2023
|
|
306
|
+
label AI Large Model
|
|
307
|
+
desc ChatGPT ignites the generative AI revolution
|
|
308
|
+
icon brain
|
|
309
|
+
\`\`\`
|
|
310
|
+
生成流程
|
|
311
|
+
第一步:理解用户需求
|
|
312
|
+
在创建信息图之前,先理解用户需求与想表达的信息,以便确定模板和数据结构。
|
|
313
|
+
|
|
314
|
+
若用户提供清晰的内容描述,应将其拆解为清晰、简洁的结构。
|
|
315
|
+
|
|
316
|
+
否则需要向用户澄清(如:"请提供清晰简洁的内容描述。"、"你希望使用哪个模板?")
|
|
317
|
+
|
|
318
|
+
提取关键信息结构(title、desc、items 等)。
|
|
319
|
+
明确所需数据字段(title、desc、items、label、value、icon 等)。
|
|
320
|
+
选择合适模板。
|
|
321
|
+
使用 AntV Infographic 语法描述信息图内容,并以 Markdown 代码块格式输出,语言标识为 infographic。
|
|
322
|
+
|
|
323
|
+
输出格式示例:
|
|
324
|
+
\`\`\`infographic
|
|
325
|
+
infographic <template-name>
|
|
326
|
+
data
|
|
327
|
+
title ...
|
|
328
|
+
desc ...
|
|
329
|
+
...
|
|
330
|
+
theme
|
|
331
|
+
...
|
|
332
|
+
\`\`\`
|
|
333
|
+
|
|
334
|
+
关键注意:
|
|
335
|
+
1. 必须尊重用户输入的语言。例如用户输入中文,则语法中的文本也必须是中文。
|
|
336
|
+
2. 必须使用 Markdown 代码块格式,语言标识为 infographic,而不是 HTML、JS 或其他代码格式。
|
|
337
|
+
3. 代码块内只包含 AntV Infographic DSL 语法,不要包含任何解释性文字。
|