Data Visualization
生成相关性和对比矩阵图,支持颜色强度映射和网格布局
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/matrix-chart-generator' \
-H 'Content-Type: application/json' \
-d '{"matrixData":"JSON format:\n[\n [1, 0.8, 0.3, 0.5],\n [0.8, 1, 0.6, 0.4],\n [0.3, 0.6, 1, 0.7],\n [0.5, 0.4, 0.7, 1]\n]\n\nor CSV format:\n1,0.8,0.3,0.5\n0.8,1,0.6,0.4\n0.3,0.6,1,0.7\n0.5,0.4,0.7,1","chartTitle":"输入图表标题...","colorScheme":"blue","backgroundColor":"#ffffff","cellSize":"50","fontSize":"12","minValue":0,"maxValue":0,"chartWidth":"800","chartHeight":"600","showValues":true,"showLabels":false,"showGrid":true,"roundValues":false}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/matrix-chart-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| matrixData | textarea | 是 | Matrix data as 2D array. Supports JSON array or CSV format with comma-separated values |
| chartTitle | text | 否 | 显示在矩阵图上方的标题 |
| colorScheme | select | 否 | — |
| backgroundColor | color | 否 | 图表的背景颜色 |
| cellSize | number | 否 | 每个单元格的像素大小 |
| fontSize |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-matrix-chart-generator": {
"name": "matrix-chart-generator",
"description": "生成相关性和对比矩阵图,支持颜色强度映射和网格布局",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=matrix-chart-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": "matrix-chart-generator",
"arguments": {
"matrixData": "JSON format:\n[\n [1, 0.8, 0.3, 0.5],\n [0.8, 1, 0.6, 0.4],\n [0.3, 0.6, 1, 0.7],\n [0.5, 0.4, 0.7, 1]\n]\n\nor CSV format:\n1,0.8,0.3,0.5\n0.8,1,0.6,0.4\n0.3,0.6,1,0.7\n0.5,0.4,0.7,1",
"chartTitle": "输入图表标题...",
"colorScheme": "blue",
"backgroundColor": "#ffffff",
"cellSize": "50",
"fontSize": "12",
"minValue": 0,
"maxValue": 0,
"chartWidth": "800",
"chartHeight": "600",
"showValues": true,
"showLabels": false,
"showGrid": true,
"roundValues": false
}
}
}有问题或反馈?请联系 [email protected]
| number |
| 否 |
| 单元格值的字体大小 |
| minValue | number | 否 | 颜色刻度的最小值(留空自动) |
| maxValue | number | 否 | 颜色刻度的最大值(留空自动) |
| chartWidth | number | 否 | 图表的像素宽度 |
| chartHeight | number | 否 | 图表的像素高度 |
| showValues | checkbox | 否 | 在单元格内显示数值 |
| showLabels | checkbox | 否 | 显示行和列标签(如果可用) |
| showGrid | checkbox | 否 | 在单元格之间显示网格线 |
| roundValues | checkbox | 否 | 将数值四舍五入为整数显示 |
HTML 结果
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}