Sankey Flow

Category: Charts

Live preview
Where the budget goes
Revenue → Operations: 60Revenue → R&D: 25Grants → R&D: 30Operations → Shipped: 40Operations → Cash: 20R&D → Shipped: 45R&D → Cash: 10Revenue: 85Grants: 30Operations: 60R&D: 55Shipped: 85Cash: 30Revenue85Grants30Operations60R&D55Shipped85Cash30
SourceTargetValue
RevenueOperations60
RevenueR&D25
GrantsR&D30
OperationsShipped40
OperationsCash20
R&DShipped45
R&DCash10

Renders a flow diagram (Sankey flow) where nodes sit in columns from left to right and are connected by curved gradient Bezier bands whose width is the flow value. Two or more columns; columns come from each node's optional `column` hint, or from graph distance when it is absent. Layout is d3-sankey's.

Surfaces
webgoogle-meet-stagegoogle-apps-script-webmcp-appsandroid
Fields
FieldTypeRequired
nodeslist of dictionaries (e.g., [{'id': 'revenue', 'label': 'Revenue', 'column': 0, 'color': '#10b981'}, ...]); `column` is an optional hint, an integer 0..n for the left-to-right column (0 = leftmost, up to 15); without it the column is the node's distance from the sources (a node with no outgoing flow goes to the last column), so a source -> middle -> target chain gets three columns and the chart is wider by 220px per column beyond two. Flows that close a cycle, or would run backwards between columns, are not drawn and are listed in a note under the chart.optional
linkslist of dictionaries representing flows (e.g., [{'source': 'revenue', 'target': 'marketing', 'value': 25000, 'color': '#38bdf8'}, ...])required
titlestring (optional, title of the chart, e.g., 'Financial Flow Allocation')optional
keyedbool (optional, default false). True adds the build contract to the drawing so motion_build and motion_transition can move its parts: each node rectangle carries data-cb "node" and each node name data-cb "label", both with data-key = the node id, and each flow carries data-cb "link" with data-key = "sourceId>targetId" (a repeated pair gets "#2", "#3"). Use ids that another atom also keys (ISO 3166-1 alpha-3 codes against choropleth_map tiles) and a motion_transition joins the two element by element. Absent or false: the markup is unchanged, byte for byte.optional
Example payload
{
  "type": "sankey_flow",
  "links": [
    {
      "label": "GitHub",
      "url": "https://github.com/a2uicatalog/a2ui"
    }
  ]
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:sankey_flow",
  "displayName": "Sankey Flow",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/sankey_flow/",
  "capabilities": [
    "web",
    "google-meet-stage",
    "google-apps-script-web",
    "mcp-apps",
    "android"
  ],
  "description": "Renders a flow diagram (Sankey flow) where nodes sit in columns from left to right and are connected by curved gradient Bezier bands whose width is the flow value. Two or more columns; columns come from each node's optional `column` hint, or from graph distance when it is absent. Layout is d3-sankey's.",
  "representativeQueries": [
    "show a curved multi-column gradient flow diagram for financial or pipeline streams",
    "renders a flow diagram (sankey flow) where nodes sit in columns from left to right and are connected",
    "render a sankey flow"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →