Data Visualization
生成可自定义的文氏图,用于可视化集合关系、包含关系和层次结构
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/euler-diagram-generator' \
-H 'Content-Type: application/json' \
-d '{"chartData":"New simplified format:\n{\n "element": [\n {"name": "A", "count": 150},\n {"name": "B", "count": 120},\n {"name": "C", "count": 80}\n ],\n "Intersecting": [\n {"names": "A,B", "count": 50}\n ]\n}\n\nParent-child example (intersection equals smaller set):\n{\n "element": [\n {"name": "Animals", "count": 100},\n {"name": "Mammals", "count": 80}\n ],\n "Intersecting": [\n {"names": "Animals,Mammals", "count": 80}\n ]\n}\n\nor simple text format:\nA|150\nB|120\nC|80","chartTitle":"输入图表标题...","borderStyle":"solid","colorScheme":"default","customColors":"#3b82f6,#ef4444,#10b981","circleOpacity":"0.4","fontSize":"14","chartWidth":"700","chartHeight":"600","animationDuration":"1200","backgroundColor":"#ffffff","gridColor":"#f0f0f0","showGrid":false,"showLabels":true,"showValues":true,"showLegend":true}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/euler-diagram-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 韦恩图的简化格式。布局自动检测:交集等于较小集合→父子关系;否则为相交;3+个集合无交集→不相交。 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| borderStyle | select | 否 | — |
| colorScheme | select | 否 | — |
| customColors | text | 否 | 集合的自定义十六进制颜色(逗号分隔)。覆盖配色方案。 |
| circleOpacity | number | 否 | 圆形的透明度(0.2到1.0) |
| fontSize | number | 否 | 标签的像素字体大小 |
| chartWidth | number | 否 | 图表的像素宽度 |
| chartHeight | number | 否 | 图表的像素高度 |
| animationDuration | number | 否 | 动画的毫秒时长 |
| backgroundColor | color | 否 | 图表容器的背景颜色 |
| gridColor | color | 否 | 背景网格的颜色 |
| showGrid | checkbox | 否 | 显示背景网格以便更好定位 |
| showLabels | checkbox | 否 | 在图表上显示集合名称 |
| showValues | checkbox | 否 | 在圆形中显示元素数量 |
| showLegend | checkbox | 否 | 在图表下方显示图例 |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-euler-diagram-generator": {
"name": "euler-diagram-generator",
"description": "生成可自定义的文氏图,用于可视化集合关系、包含关系和层次结构",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=euler-diagram-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "euler-diagram-generator",
"arguments": {
"chartData": "New simplified format:\n{\n "element": [\n {"name": "A", "count": 150},\n {"name": "B", "count": 120},\n {"name": "C", "count": 80}\n ],\n "Intersecting": [\n {"names": "A,B", "count": 50}\n ]\n}\n\nParent-child example (intersection equals smaller set):\n{\n "element": [\n {"name": "Animals", "count": 100},\n {"name": "Mammals", "count": 80}\n ],\n "Intersecting": [\n {"names": "Animals,Mammals", "count": 80}\n ]\n}\n\nor simple text format:\nA|150\nB|120\nC|80",
"chartTitle": "输入图表标题...",
"borderStyle": "solid",
"colorScheme": "default",
"customColors": "#3b82f6,#ef4444,#10b981",
"circleOpacity": "0.4",
"fontSize": "14",
"chartWidth": "700",
"chartHeight": "600",
"animationDuration": "1200",
"backgroundColor": "#ffffff",
"gridColor": "#f0f0f0",
"showGrid": false,
"showLabels": true,
"showValues": true,
"showLegend": true
}
}
}有问题或反馈?请联系 [email protected]