-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: eval column * deps: mis node-fetch
- Loading branch information
Showing
8 changed files
with
1,160 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
## 角色 | ||
|
||
你是一个 mock 图表数据生成器,生成柱形图相关的可视化问答对数据。 | ||
|
||
## 任务 | ||
|
||
1. 随机结合可视化场景,生成柱形图相关的可视化问题,用自然语言纯文本描述,主要内容为数据描述和用什么可视化图表,比如: “用堆叠柱形图可视化我不同城市的客户数量,数据如下:{ 'City A': { '2020': 1000, '2021': 1200 }, 'City B': { '2020': 1500, '2021': 1800 }, 'City C': { '2020': 2000, '2021': 2500 } }” | ||
2. 根据可视化相关问题,生成柱形图图表的配置 | ||
3. 以 JSON 格式归纳为一条问答对数据,{"question": <可视化问题>,"answer": <图表的配置>} | ||
|
||
## 柱形图图表知识库 | ||
|
||
### 图表属性 | ||
|
||
```typescript | ||
type Column = { | ||
type: 'column'; | ||
data: { category: string; value: number; group?: string }[]; | ||
group?: boolean; | ||
stack?: boolean; | ||
title?: string; | ||
axisXTitle?: string; | ||
axisYTitle?: string; | ||
}; | ||
``` | ||
|
||
### 数据要求 | ||
|
||
- type:图表的类型,必填,文本类型,值必须为 "column"。 | ||
- data:图表的数据,必填,数组对象类型; | ||
- category:数据分类名称,必填,文本或数值类型; | ||
- value:数据分类值,必填,数值类型; | ||
- group: 数据分组名称,选填,文本类型; | ||
- group:是否开启分组,开启分组柱形图需数据中含有 group 字段 ,选填,布尔类型。 | ||
- stack:是否开启堆叠,开启堆叠柱形图需数据中含有 group 字段,选填,布尔类型。 | ||
- title: 图表的标题,选填,文本类型 | ||
- axisXTitle:x 轴的标题,选填,文本类型 | ||
- axisYTitle:y 轴的标题,选填,文本类型 | ||
|
||
## 参考例子 | ||
|
||
```json | ||
[ | ||
{ | ||
"type": "text2chart", | ||
"question": "用堆叠柱形图可视化我不同城市的客户数量,数据如下:{ 'City A': { '2020': 1000, '2021': 1200 }, 'City B': { '2020': 1500, '2021': 1800 }, 'City C': { '2020': 2000, '2021': 2500 } }", | ||
"answer": { | ||
"type": "column", | ||
"data": [ | ||
{ "category": "2020", "value": 1000, "group": "City A" }, | ||
{ "category": "2021", "value": 1200, "group": "City A" }, | ||
{ "category": "2020", "value": 1500, "group": "City B" }, | ||
{ "category": "2021", "value": 1800, "group": "City B" }, | ||
{ "category": "2020", "value": 2000, "group": "City C" }, | ||
{ "category": "2021", "value": 2500, "group": "City C" } | ||
], | ||
"stack": true, | ||
"axisXTitle": "年份", | ||
"axisYTitle": "客户数量" | ||
} | ||
}, | ||
{ | ||
"type": "text2chart", | ||
"question": "用分组柱形图可视化我不同季度的销售数据,数据如下:{ 'Q1': { '2020': 10000, '2021': 12000 }, 'Q2': { '2020': 15000, '2021': 18000 }, 'Q3': { '2020': 20000, '2021': 25000 }, 'Q4': { '2020': 25000, '2021': 30000 } }", | ||
"answer": { | ||
"type": "column", | ||
"data": [ | ||
{ "category": "2020", "value": 10000, "group": "Q1" }, | ||
{ "category": "2021", "value": 12000, "group": "Q1" }, | ||
{ "category": "2020", "value": 15000, "group": "Q2" }, | ||
{ "category": "2021", "value": 18000, "group": "Q2" }, | ||
{ "category": "2020", "value": 20000, "group": "Q3" }, | ||
{ "category": "2021", "value": 25000, "group": "Q3" }, | ||
{ "category": "2020", "value": 25000, "group": "Q4" }, | ||
{ "category": "2021", "value": 30000, "group": "Q4" } | ||
], | ||
"group": true, | ||
"axisXTitle": "年份", | ||
"axisYTitle": "售量" | ||
} | ||
} | ||
] | ||
``` | ||
|
||
## 要求 | ||
|
||
- 请生成 5 条这样的记录,并以 JSON 格式输出。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## 角色 | ||
|
||
你是一个 mock 图表数据生成器,生成柱形图相关的可视化问答对数据。 | ||
|
||
## 任务 | ||
|
||
1. 随机结合可视化场景,生成柱形图相关的可视化问题,用自然语言纯文本描述,主要内容为数据描述和用什么可视化图表,比如: “海底捞公司外卖收入的变化,2015 年收入金额 80 百万元,2016 年收入金额 140 百万元,2017 年收入金额 220 百万元。用柱形图可视化” | ||
2. 根据可视化相关问题,生成柱形图图表的配置 | ||
3. 以 JSON 格式归纳为一条问答对数据,{"question": <可视化问题>,"answer": <图表的配置>} | ||
|
||
## 柱形图图表知识库 | ||
|
||
### 图表属性 | ||
|
||
```typescript | ||
type Column = { | ||
type: 'column'; | ||
data: { category: string; value: number; group?: string }[]; | ||
group?: boolean; | ||
stack?: boolean; | ||
title?: string; | ||
axisXTitle?: string; | ||
axisYTitle?: string; | ||
}; | ||
``` | ||
|
||
### 数据要求 | ||
|
||
- type:图表的类型,必填,文本类型,值必须为 "column"。 | ||
- data:图表的数据,必填,数组对象类型; | ||
- category:数据分类名称,必填,文本或数值类型; | ||
- value:数据分类值,必填,数值类型; | ||
- group: 数据分组名称,选填,文本类型; | ||
- group:是否开启分组,开启分组柱形图需数据中含有 group 字段 ,选填,布尔类型。 | ||
- stack:是否开启堆叠,开启堆叠柱形图需数据中含有 group 字段,选填,布尔类型。 | ||
- title: 图表的标题,选填,文本类型 | ||
- axisXTitle:x 轴的标题,选填,文本类型 | ||
- axisYTitle:y 轴的标题,选填,文本类型 | ||
|
||
## 参考例子 | ||
|
||
```json | ||
[ | ||
{ | ||
"type": "text2chart", | ||
"question": "海底捞公司外卖收入的变化,2015 年收入金额 80 百万元,2016 年收入金额 140 百万元,2017 年收入金额 220 百万元。用柱形图可视化", | ||
"answer": { | ||
"type": "column", | ||
"data": [ | ||
{ "category": "2015 年", "value": 80 }, | ||
{ "category": "2016 年", "value": 140 }, | ||
{ "category": "2017 年", "value": 220 } | ||
], | ||
"title": "海底捞公司外卖收入", | ||
"axisXTitle": "年份", | ||
"axisYTitle": "金额 (百万元)" | ||
} | ||
} | ||
] | ||
``` | ||
|
||
## 要求 | ||
|
||
- 请生成 5 条这样的记录,并以 JSON 格式输出。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
## 图表属性 | ||
|
||
- 名称:柱形图 | ||
- 别名:柱状图,英文名:Column Chart | ||
- 形状:柱形 | ||
- 图表类别:统计图表 | ||
- 图表功能:比较、分布、排名 | ||
|
||
## 基础概念 | ||
|
||
柱状图,是一种使用柱形条,对不同类别进行数值比较的统计图表。最基础的柱形图,需要一个分类变量和一个数值变量。在柱状图上,分类变量的每个实体都被表示为一个矩形(通俗讲即为“柱子”),而数值则决定了柱子的高度。 | ||
|
||
## 适用场景 | ||
|
||
柱状图最适合对分类的数据进行比较。尤其是当数值比较接近时,由于人眼对于高度的感知优于其他视觉元素(如面积、角度等),因此,使用柱状图更加合适。 | ||
|
||
## 不适用场景 | ||
|
||
柱状图要求至少一个分类变量,它们之间是离散的,不能是连续型变量。 | ||
|
||
## 图表用法 | ||
|
||
### 图表属性 | ||
|
||
```typescript | ||
type Column = { | ||
type: 'column'; | ||
data: { category: string; value: number; group?: string }[]; | ||
group?: boolean; | ||
stack?: boolean; | ||
title?: string; | ||
axisXTitle?: string; | ||
axisYTitle?: string; | ||
}; | ||
``` | ||
|
||
### 数据要求 | ||
|
||
- type:图表的类型,必填,文本类型,值必须为 "column"。 | ||
- data:图表的数据,必填,数组对象类型; | ||
- category:数据分类名称,必填,文本类型; | ||
- value:数据分类值,必填,数值类型; | ||
- group: 数据分组名称,选填,文本类型; | ||
- group:是否开启分组,开启分组柱形图需数据中含有 group 字段 ,选填,布尔类型。 | ||
- stack:是否开启堆叠,开启堆叠柱形图需数据中含有 group 字段,选填,布尔类型。 | ||
- title: 图表的标题,选填,文本类型。 | ||
- axisXTitle:x 轴的标题,选填,文本类型。 | ||
- axisYTitle:y 轴的标题,选填,文本类型。 | ||
|
||
## 使用示例 | ||
|
||
1. 海底捞公司外卖收入的变化,2015 年收入金额 80 百万元,2016 年收入金额 140 百万元,2017 年收入金额 220 百万元。用柱形图可视化。 | ||
|
||
```json | ||
{ | ||
"type": "column", | ||
"data": [ | ||
{ "category": "2015 年", "value": 80 }, | ||
{ "category": "2016 年", "value": 140 }, | ||
{ "category": "2017 年", "value": 220 } | ||
], | ||
"title": "海底捞公司外卖收入", | ||
"axisXTitle": "年份", | ||
"axisYTitle": "金额 (百万元)" | ||
} | ||
``` | ||
|
||
2. 用柱形图可视化我的数据 [{ "title": "第一产业","industrial": 7200.0 },{ "title": "第二产业", "industrial": 36600.0 },{ "title": "第三产业" ,"industrial": 41000.0 }]。 | ||
|
||
```json | ||
{ | ||
"type": "column", | ||
"data": [ | ||
{ "category": "第一产业", "value": 7200.0 }, | ||
{ "category": "第二产业", "value": 36600.0 }, | ||
{ "category": "第三产业", "value": 41000.0 } | ||
], | ||
"axisXTitle": "title", | ||
"axisYTitle": "industrial" | ||
} | ||
``` | ||
|
||
3. 主要城市油车与新能源汽车的售卖量对比,北京分别是 825.6 万辆 与 60.2 万辆,上海分别是 450 万辆 与 95 万辆,深圳分别是 506 万辆 与 76.7 万辆,广州分别是 976.6 万辆 与 97.2 万辆,杭州分别是 651.2 万辆 与 62 万辆。用分组柱形图可视化。 | ||
|
||
```json | ||
{ | ||
"type": "column", | ||
"data": [ | ||
{ "category": "北京", "value": 825.6, "group": "油车" }, | ||
{ "category": "北京", "value": 60.2, "group": "新能源汽车" }, | ||
{ "category": "上海", "value": 450, "group": "油车" }, | ||
{ "category": "上海", "value": 95, "group": "新能源汽车" }, | ||
{ "category": "深圳", "value": 506, "group": "油车" }, | ||
{ "category": "深圳", "value": 76.7, "group": "新能源汽车" }, | ||
{ "category": "广州", "value": 976.6, "group": "油车" }, | ||
{ "category": "广州", "value": 97.2, "group": "新能源汽车" }, | ||
{ "category": "杭州", "value": 651.2, "group": "油车" }, | ||
{ "category": "杭州", "value": 62, "group": "新能源汽车" } | ||
], | ||
"group": true, | ||
"title": "油车与新能源汽车售卖量", | ||
"axisXTitle": "城市", | ||
"axisYTitle": "售卖量 (万辆)" | ||
} | ||
``` | ||
|
||
4. 主要城市油车与新能源汽车的售卖量对比,北京分别是 825.6 万辆 与 60.2 万辆,上海分别是 450 万辆 与 95 万辆,深圳分别是 506 万辆 与 76.7 万辆,广州分别是 976.6 万辆 与 97.2 万辆,杭州分别是 651.2 万辆 与 62 万辆。用堆叠柱形图可视化。 | ||
|
||
```json | ||
{ | ||
"type": "column", | ||
"data": [ | ||
{ "category": "北京", "value": 825.6, "group": "油车" }, | ||
{ "category": "北京", "value": 60.2, "group": "新能源汽车" }, | ||
{ "category": "上海", "value": 450, "group": "油车" }, | ||
{ "category": "上海", "value": 95, "group": "新能源汽车" }, | ||
{ "category": "深圳", "value": 506, "group": "油车" }, | ||
{ "category": "深圳", "value": 76.7, "group": "新能源汽车" }, | ||
{ "category": "广州", "value": 976.6, "group": "油车" }, | ||
{ "category": "广州", "value": 97.2, "group": "新能源汽车" }, | ||
{ "category": "杭州", "value": 651.2, "group": "油车" }, | ||
{ "category": "杭州", "value": 62, "group": "新能源汽车" } | ||
], | ||
"stack": true, | ||
"title": "油车与新能源汽的售卖量", | ||
"axisXTitle": "城市", | ||
"axisYTitle": "售卖量 (万辆)" | ||
} | ||
``` |