Elysia Tools Docs
EN
Language
ZHESPTRUFRDEEN
Back to site
Browse tools

Data Visualization

Sankey Diagram Generator

Generate Sankey diagrams to visualize flow distributions and energy transfers between different nodes

html· HTML resultOpen tool

Quick start

Call this tool from your code in three languages.

cURL
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}'

© 2026 Elysia Tools. Developer documentation.

Back to siteBrowse tools

API reference

Send a POST request with your inputs as JSON. File parameters require a separate upload first.

Endpoint

HTTP
POST https://api.elysiatools.com/en/api/tools/sankey-diagram-generator

Parameters

NameTypeRequiredDescription
chartDatatextareaYesData for the Sankey diagram in JSON format with nodes and links arrays
chartTitletextNoTitle that will be displayed above the chart
nodeColorstextNoColors for nodes (comma-separated hex colors)
linkColorstextNoColors for flow links (comma-separated hex colors)
chartWidthnumberNoWidth of the chart in pixels
chartHeightnumberNoHeight of the chart in pixels
nodeWidthnumberNoWidth of each node in pixels
nodePaddingnumberNoVertical spacing between nodes in pixels
backgroundColorcolorNoBackground color for the chart container
showValuescheckboxNoDisplay flow values on the diagram
showLabelscheckboxNoDisplay node names on the diagram
animatedcheckboxNoAnimate the diagram when it loads

Response format

HTML result

JSON
{
  "result": "<div>Processed HTML content</div>",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}

MCP integration

Add this tool to your Model Context Protocol server so AI agents can list and call it.

Server configuration

Add this block to your MCP client configuration:

mcp.json
{
  "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"
    }
  }
}

List available tools

After connecting to the SSE endpoint, list the exposed tools:

tools/list
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Call this tool

Invoke the tool by its id, passing arguments built from its parameters:

tools/call
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "sankey-diagram-generator",
    "arguments": {
  "chartData": "Simple example (2 nodes):\n{\n  &quot;nodes&quot;: [{&quot;id&quot;: &quot;source&quot;, &quot;name&quot;: &quot;Source&quot;, &quot;value&quot;: 100}, {&quot;id&quot;: &quot;target&quot;, &quot;name&quot;: &quot;Target&quot;, &quot;value&quot;: 100}],\n  &quot;links&quot;: [{&quot;source&quot;: &quot;source&quot;, &quot;target&quot;: &quot;target&quot;, &quot;value&quot;: 100}]\n}\n\nOr 3 nodes:\n{\n  &quot;nodes&quot;: [{&quot;id&quot;: &quot;input&quot;, &quot;name&quot;: &quot;Input&quot;, &quot;value&quot;: 100}, {&quot;id&quot;: &quot;process&quot;, &quot;name&quot;: &quot;Process&quot;, &quot;value&quot;: 75}, {&quot;id&quot;: &quot;output&quot;, &quot;name&quot;: &quot;Output&quot;, &quot;value&quot;: 75}],\n  &quot;links&quot;: [{&quot;source&quot;: &quot;input&quot;, &quot;target&quot;: &quot;process&quot;, &quot;value&quot;: 75}, {&quot;source&quot;: &quot;process&quot;, &quot;target&quot;: &quot;output&quot;, &quot;value&quot;: 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
}
  }
}
Chain multiple tools in one session with a comma-separated toolId list, e.g. /mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp (max 20).

Questions or issues? Contact [email protected]

Browse tools
Open tool