Data Visualization
从数据生成可自定义的热力图,非常适合可视化数据密度、相关性和模式
用三种语言从你的代码中调用此工具。
curl -X POST 'https://api.elysiatools.com/zh/api/tools/heatmap-generator' \
-H 'Content-Type: application/json' \
-d '{"chartData":"JSON format:\n{\n "rows": ["Mon", "Tue", "Wed", "Thu", "Fri"],\n "columns": ["Week 1", "Week 2", "Week 3", "Week 4"],\n "data": [\n [65, 59, 80, 81],\n [28, 48, 40, 19],\n [45, 67, 89, 90],\n [81, 59, 67, 88],\n [56, 78, 98, 87]\n ]\n}\n\nor CSV format:\nWeek 1,Week 2,Week 3,Week 4\n65,59,80,81\n28,48,40,19\n45,67,89,90\n81,59,67,88\n56,78,98,87","chartTitle":"输入图表标题...","colorScheme":"default","customColors":"#3b82f6,#10b981,#f59e0b,#ef4444","cellSize":"50","cellPadding":"2","minValue":0,"maxValue":0,"backgroundColor":"#ffffff","showValues":true,"showLabels":true,"roundValues":false,"showColorScale":true}'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/heatmap-generator| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| chartData | textarea | 是 | 热力图数据。支持包含行/列/数据的JSON对象或CSV格式 |
| chartTitle | text | 否 | 显示在图表上方的标题 |
| colorScheme | select | 否 | — |
| customColors | text | 否 | 自定义颜色渐变(逗号分隔的十六进制颜色,需要选择自定义方案) |
| cellSize | number | 否 | 每个热力图单元格的像素大小 |
| cellPadding | number | 否 | 单元格之间的间距(像素) |
| minValue | number | 否 | 颜色刻度的最小值(留空自动) |
| maxValue | number | 否 | 颜色刻度的最大值(留空自动) |
| backgroundColor | color | 否 | 图表容器的背景颜色 |
| showValues | checkbox | 否 | 在热力图单元格内显示数值 |
| showLabels | checkbox | 否 | 显示行和列的标签 |
| roundValues | checkbox | 否 | 将数值四舍五入为整数显示 |
| showColorScale | 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-heatmap-generator": {
"name": "heatmap-generator",
"description": "从数据生成可自定义的热力图,非常适合可视化数据密度、相关性和模式",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=heatmap-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": "heatmap-generator",
"arguments": {
"chartData": "JSON format:\n{\n "rows": ["Mon", "Tue", "Wed", "Thu", "Fri"],\n "columns": ["Week 1", "Week 2", "Week 3", "Week 4"],\n "data": [\n [65, 59, 80, 81],\n [28, 48, 40, 19],\n [45, 67, 89, 90],\n [81, 59, 67, 88],\n [56, 78, 98, 87]\n ]\n}\n\nor CSV format:\nWeek 1,Week 2,Week 3,Week 4\n65,59,80,81\n28,48,40,19\n45,67,89,90\n81,59,67,88\n56,78,98,87",
"chartTitle": "输入图表标题...",
"colorScheme": "default",
"customColors": "#3b82f6,#10b981,#f59e0b,#ef4444",
"cellSize": "50",
"cellPadding": "2",
"minValue": 0,
"maxValue": 0,
"backgroundColor": "#ffffff",
"showValues": true,
"showLabels": true,
"roundValues": false,
"showColorScale": true
}
}
}有问题或反馈?请联系 [email protected]