Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/charts/area.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"required": ["time", "value"]
},
"description": "Data for area chart, such as, [{ time: '2018', value: 99.9 }]."
"description": "Data for area chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }], when stacking is needed for area, the data should contain a `group` field, such as, [{ time: '2015', value: 23, group: 'A' }, { time: '2015', value: 32, group: 'B' }]."
},
"stack": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/charts/column.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"required": ["category", "value"]
},
"description": "Data for column chart, such as, [{ category: '分类一', value: 10 }, { category: '分类二', value: 20 }], when grouping or stacking is needed for column, the data should contain a `group` field, such as, when [{ category: '北京', value: 825, group: '油车' }, { category: '北京', value: 1000, group: '电车' }]."
"description": "Data for column chart, such as, [{ category: 'Category A', value: 10 }, { category: 'Category B', value: 20 }], when grouping or stacking is needed for column, the data should contain a 'group' field, such as, [{ category: 'Beijing', value: 825, group: 'Gas Car' }, { category: 'Beijing', value: 1000, group: 'Electric Car' }]."
},
"group": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/charts/line.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"required": ["time", "value"]
},
"description": "Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }]."
"description": "Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }], when the data is grouped by time, the `group` field should be used to specify the group, such as, [{ time: '2015', value: 23, group: 'A' }, { time: '2015', value: 32, group: 'B' }]."
},
"theme": {
"default": "default",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/charts/radar.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"required": ["name", "value"]
},
"description": "Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }]."
"description": "Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }], when the data is grouped by `group`, the `group` field is required, such as, [{ name: 'Design', value: 70, group: 'Huawei' }]."
},
"style": {
"description": "Style configuration for the chart with a JSON object, optional.",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/charts/scatter.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"required": ["x", "y"]
},
"description": "Data for scatter chart, such as, [{ x: 10, y: 15 }]."
"description": "Data for scatter chart, such as, [{ x: 10, y: 15 }], when the data is grouped, the group name can be specified in the `group` field, such as, [{ x: 10, y: 15, group: 'Group A' }]."
},
"theme": {
"default": "default",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/charts/violin.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"required": ["category", "value"]
},
"minItems": 1,
"description": "Data for violin chart, such as, [{ category: '分类一', value: 10 }] or [{ category: '分类二', value: 20, group: '组别一' }]."
"description": "Data for violin chart, such as, [{ category: 'Category A', value: 10 }], when the data is grouped, the 'group' field is required, such as, [{ category: 'Category B', value: 20, group: 'Group A' }]."
},
"theme": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@antv/mcp-server-chart",
"description": "A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.",
"version": "0.9.4",
"version": "0.9.5",
"main": "build/index.js",
"types": "build/index.d.ts",
"exports": {
Expand Down
4 changes: 3 additions & 1 deletion src/charts/area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const data = z.object({
const schema = {
data: z
.array(data)
.describe("Data for area chart, such as, [{ time: '2018', value: 99.9 }].")
.describe(
"Data for area chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }], when stacking is needed for area, the data should contain a `group` field, such as, [{ time: '2015', value: 23, group: 'A' }, { time: '2015', value: 32, group: 'B' }].",
)
.nonempty({ message: "Area chart data cannot be empty." }),
stack: z
.boolean()
Expand Down
2 changes: 1 addition & 1 deletion src/charts/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const schema = {
data: z
.array(data)
.describe(
"Data for column chart, such as, [{ category: '分类一', value: 10 }, { category: '分类二', value: 20 }], when grouping or stacking is needed for column, the data should contain a `group` field, such as, when [{ category: '北京', value: 825, group: '油车' }, { category: '北京', value: 1000, group: '电车' }].",
"Data for column chart, such as, [{ category: 'Category A', value: 10 }, { category: 'Category B', value: 20 }], when grouping or stacking is needed for column, the data should contain a 'group' field, such as, [{ category: 'Beijing', value: 825, group: 'Gas Car' }, { category: 'Beijing', value: 1000, group: 'Electric Car' }].",
)
.nonempty({ message: "Column chart data cannot be empty." }),
group: z
Expand Down
2 changes: 1 addition & 1 deletion src/charts/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const schema = {
data: z
.array(data)
.describe(
"Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }].",
"Data for line chart, it should be an array of objects, each object contains a `time` field and a `value` field, such as, [{ time: '2015', value: 23 }, { time: '2016', value: 32 }], when the data is grouped by time, the `group` field should be used to specify the group, such as, [{ time: '2015', value: 23, group: 'A' }, { time: '2015', value: 32, group: 'B' }].",
)
.nonempty({ message: "Line chart data cannot be empty." }),
style: z
Expand Down
2 changes: 1 addition & 1 deletion src/charts/radar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const schema = {
data: z
.array(data)
.describe(
"Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }].",
"Data for radar chart, it should be an array of objects, each object contains a `name` field and a `value` field, such as, [{ name: 'Design', value: 70 }], when the data is grouped by `group`, the `group` field is required, such as, [{ name: 'Design', value: 70, group: 'Huawei' }].",
)
.nonempty({ message: "Radar chart data cannot be empty." }),
style: z
Expand Down
4 changes: 3 additions & 1 deletion src/charts/scatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const data = z.object({
const schema = {
data: z
.array(data)
.describe("Data for scatter chart, such as, [{ x: 10, y: 15 }].")
.describe(
"Data for scatter chart, such as, [{ x: 10, y: 15 }], when the data is grouped, the group name can be specified in the `group` field, such as, [{ x: 10, y: 15, group: 'Group A' }].",
)
.nonempty({ message: "Scatter chart data cannot be empty." }),
style: z
.object({
Expand Down
2 changes: 1 addition & 1 deletion src/charts/violin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const schema = {
data: z
.array(data)
.describe(
"Data for violin chart, such as, [{ category: '分类一', value: 10 }] or [{ category: '分类二', value: 20, group: '组别一' }].",
"Data for violin chart, such as, [{ category: 'Category A', value: 10 }], when the data is grouped, the 'group' field is required, such as, [{ category: 'Category B', value: 20, group: 'Group A' }].",
)
.nonempty({ message: "Violin chart data cannot be empty." }),
style: z
Expand Down