Data Visualization
Generate Sankey diagrams to visualize flow distributions and energy transfers between different nodes
Call this tool from your code in three languages.
curl -X POST 'https://api.elysiatools.com/en/api/tools/sankey-diagram-generator' \
-H 'Content-Type: application/json' \
-d '{"chartData":"Simple example (2 nodes):\n{\n "nodes": [{"id": "source", "name": "Source", "value": 100}, {"id": "target", "name": "Target", "value": 100}],\n "links": [{"source": "source", "target": "target", "value": 100}]\n}\n\nOr 3 nodes:\n{\n "nodes": [{"id": "input", "name": "Input", "value": 100}, {"id": "process", "name": "Process", "value": 75}, {"id": "output", "name": "Output", "value": 75}],\n "links": [{"source": "input", "target": "process", "value": 75}, {"source": "process", "target": "output", "value": 75}]\n}","chartTitle":"Enter chart title...","nodeColors":"#1e40af,#dc2626,#16a34a,#ca8a04,#7c3aed,#0891b2","linkColors":"#3b82f6,#ef4444,#22c55e,#eab308,#a855f7,#06b6d4","chartWidth":"800","chartHeight":"500","nodeWidth":"30","nodePadding":"30","backgroundColor":"#ffffff","showValues":true,"showLabels":true,"animated":true}'Send a POST request with your inputs as JSON. File parameters require a separate upload first.
POST https://api.elysiatools.com/en/api/tools/sankey-diagram-generator| Name | Type | Required | Description |
|---|---|---|---|
| chartData | textarea | Yes | Data for the Sankey diagram in JSON format with nodes and links arrays |
| chartTitle | text | No | Title that will be displayed above the chart |
| nodeColors | text | No | Colors for nodes (comma-separated hex colors) |
| linkColors | text | No | Colors for flow links (comma-separated hex colors) |
| chartWidth | number | No | Width of the chart in pixels |
| chartHeight | number | No | Height of the chart in pixels |
| nodeWidth | number | No | Width of each node in pixels |
| nodePadding | number | No | Vertical spacing between nodes in pixels |
| backgroundColor | color | No | Background color for the chart container |
| showValues | checkbox | No | Display flow values on the diagram |
| showLabels | checkbox | No | Display node names on the diagram |
| animated | checkbox | No | Animate the diagram when it loads |
HTML result
{
"result": "<div>Processed HTML content</div>",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}Add this tool to your Model Context Protocol server so AI agents can list and call it.
Add this block to your MCP client configuration:
{
"mcpServers": {
"elysiatools-sankey-diagram-generator": {
"name": "sankey-diagram-generator",
"description": "Generate Sankey diagrams to visualize flow distributions and energy transfers between different nodes",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=sankey-diagram-generator",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}After connecting to the SSE endpoint, list the exposed tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoke the tool by its id, passing arguments built from its parameters:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "sankey-diagram-generator",
"arguments": {
"chartData": "Simple example (2 nodes):\n{\n "nodes": [{"id": "source", "name": "Source", "value": 100}, {"id": "target", "name": "Target", "value": 100}],\n "links": [{"source": "source", "target": "target", "value": 100}]\n}\n\nOr 3 nodes:\n{\n "nodes": [{"id": "input", "name": "Input", "value": 100}, {"id": "process", "name": "Process", "value": 75}, {"id": "output", "name": "Output", "value": 75}],\n "links": [{"source": "input", "target": "process", "value": 75}, {"source": "process", "target": "output", "value": 75}]\n}",
"chartTitle": "Enter chart title...",
"nodeColors": "#1e40af,#dc2626,#16a34a,#ca8a04,#7c3aed,#0891b2",
"linkColors": "#3b82f6,#ef4444,#22c55e,#eab308,#a855f7,#06b6d4",
"chartWidth": "800",
"chartHeight": "500",
"nodeWidth": "30",
"nodePadding": "30",
"backgroundColor": "#ffffff",
"showValues": true,
"showLabels": true,
"animated": true
}
}
}Questions or issues? Contact [email protected]