Data Visualization
生成交互式弦图,可视化实体间的双向流动和关系
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/chord-diagram-generator' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON array format:\n[{"source": "北京", "target": "上海", "value": 850},\n {"source": "北京", "target": "广州", "value": 620},\n {"source": "北京", "target": "深圳", "value": 480},\n {"source": "上海", "target": "北京", "value": 780},\n {"source": "上海", "target": "广州", "value": 320},\n {"source": "广州", "target": "深圳", "value": 410},\n {"source": "深圳", "target": "北京", "value": 390}]\n\nEach connection represents a flow or relationship between two nodes. Values indicate connection strength.","chartTitle":"输入图表标题...","sortOrder":"value-desc","colorScheme":"default","backgroundColor":"#ffffff","radius":"300","innerRadius":"150","chordOpacity":"0.6","padding":"0.02","showLabels":true,"showValues":true,"showLegend":true,"showStats":true,"enableAnimation":true,"animationDuration":"1500"}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/chord-diagram-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 包含source、target和value字段的连接数组 |
| chartTitle | text | 否 | 图表上方显示的标题 |
| sortOrder | select | 否 | — |
| colorScheme | select | 否 | — |
| backgroundColor | color | 否 | 图表背景颜色 |
| radius | number | 否 | 外圆半径(像素) |
| innerRadius | number | 否 | 内圆半径(像素) |
| chordOpacity | number | 否 | 弦线透明度(0-1) |
| padding | number | 否 | 弧形之间的间距(0-0.1) |
| showLabels | checkbox | 否 | 显示实体名称 |
| showValues | checkbox | 否 | 显示总流量数值 |
| showLegend | checkbox | 否 | 显示颜色图例 |
| showStats | checkbox | 否 | 显示流量统计 |
| enableAnimation | checkbox | 否 | 加载时动画 |
| animationDuration | number | 否 | 动画时间(毫秒) |
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-chord-diagram-generator": {
"name": "chord-diagram-generator",
"description": "生成交互式弦图,可视化实体间的双向流动和关系",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=chord-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": "chord-diagram-generator",
"arguments": {
"chartData": "JSON array format:\n[{"source": "北京", "target": "上海", "value": 850},\n {"source": "北京", "target": "广州", "value": 620},\n {"source": "北京", "target": "深圳", "value": 480},\n {"source": "上海", "target": "北京", "value": 780},\n {"source": "上海", "target": "广州", "value": 320},\n {"source": "广州", "target": "深圳", "value": 410},\n {"source": "深圳", "target": "北京", "value": 390}]\n\nEach connection represents a flow or relationship between two nodes. Values indicate connection strength.",
"chartTitle": "输入图表标题...",
"sortOrder": "value-desc",
"colorScheme": "default",
"backgroundColor": "#ffffff",
"radius": "300",
"innerRadius": "150",
"chordOpacity": "0.6",
"padding": "0.02",
"showLabels": true,
"showValues": true,
"showLegend": true,
"showStats": true,
"enableAnimation": true,
"animationDuration": "1500"
}
}
}有问题或反馈?请联系 [email protected]