---
title: "Dark Sankey Diagram API — Flow diagrams on dark | Imejis"
description: "Generate dark-mode Sankey diagram images — vivid gradient flows on a dark card for social and dashboards. Fresh flows per API call. Try Imejis free."
url: "https://www.imejis.io/components/sankey/dark"
---

# Dark Sankey Diagram API — Flow diagrams on dark | Imejis

A vivid flow diagram on a dark card for social and dashboards.

## Use cases

- Dark-theme growth / journey cards
- Dashboard flow exports on dark backgrounds
- Social graphics for funnels & budgets

## Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `links` | `object[]` | `[]` | Flows: array of { source, target, value } — names reference the nodes. |
| `nodes` | `object[]` | `[]` | Optional node colors/order: [{ name, color }]; derived from links otherwise. |
| `colors` | `color[]` | `[]` | Node palette (cycled) when a node has no explicit color. |
| `nodeWidth` | `number` (min 1) | `14` | Width of the node bars (px). |
| `nodePadding` | `number` (min 0) | `12` | Vertical gap between nodes in a column (px). |
| `linkColorMode` | `'gradient' \| 'source' \| 'target'` | `"gradient"` | Band color: gradient (source→target), source, or target. |
| `linkOpacity` | `number` (min 0, max 1) | `0.45` | Opacity of the flow bands. |
| `nodeLabelColor` | `color` | `"#334155"` | Node label text color. |
| `showValues` | `boolean` | `false` | Append each node's total flow to its label. |
| `valueFormat` | `'number' \| 'compact' \| 'percent' \| 'currency'` | `"compact"` | How printed values are formatted (1,200 / 1.2K / $1,200). |
| `currencySymbol` | `string` | `"$"` | Symbol used with the 'currency' format. |
| `opacity` | `number` | `1` | Overall component opacity from 0 (transparent) to 1 (opaque). |
| `borderWidth` | `number` | `0` | Border thickness in pixels around the component. |
| `borderColor` | `color` | `"transparent"` | Border color (any CSS color). |
| `borderStyle` | `'solid' \| 'dashed' \| 'dotted' \| 'double' \| 'none'` | `"solid"` | Border line style. |
| `borderRadius` | `number` | `0` | Corner radius in pixels. |
| `boxShadow` | `string` | — | CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)". |

## Design JSON (this variant)

```json
{
  "title": "Sankey sample",
  "description": "A signup-to-paid user-flow diagram",
  "dimensions": {
    "width": 820,
    "height": 440
  },
  "background": {
    "color": "#0f172a"
  },
  "components": [
    {
      "id": "sample-sankey",
      "key": "sankey",
      "type": "sankey",
      "position": {
        "x": 40,
        "y": 40
      },
      "rotation": 0,
      "size": {
        "width": 740,
        "height": 360
      },
      "dynamic": true,
      "properties": {
        "links": [
          {
            "source": "Visits",
            "target": "Signup",
            "value": 620
          },
          {
            "source": "Visits",
            "target": "Bounce",
            "value": 380
          },
          {
            "source": "Signup",
            "target": "Activated",
            "value": 410
          },
          {
            "source": "Signup",
            "target": "Dormant",
            "value": 210
          },
          {
            "source": "Activated",
            "target": "Paid",
            "value": 180
          },
          {
            "source": "Activated",
            "target": "Free",
            "value": 230
          }
        ],
        "linkColorMode": "gradient",
        "showValues": true,
        "valueFormat": "compact",
        "opacity": 1,
        "nodeLabelColor": "#e2e8f0",
        "linkOpacity": 0.55
      }
    }
  ]
}
```

## Examples

### Dark user flow

A signup-to-paid journey on slate with gradient bands.

API overrides that reproduce this example:

```json
{
  "sankey.nodeLabelColor": "#e2e8f0",
  "sankey.linkColorMode": "gradient",
  "sankey.linkOpacity": 0.55,
  "sankey.links": [
    {
      "source": "Visits",
      "target": "Signup",
      "value": 620
    },
    {
      "source": "Visits",
      "target": "Bounce",
      "value": 380
    },
    {
      "source": "Signup",
      "target": "Activated",
      "value": 410
    },
    {
      "source": "Signup",
      "target": "Dormant",
      "value": 210
    },
    {
      "source": "Activated",
      "target": "Paid",
      "value": 180
    },
    {
      "source": "Activated",
      "target": "Free",
      "value": 230
    }
  ]
}
```

### Dark budget flow

Revenue into departments and costs on a near-black card.

API overrides that reproduce this example:

```json
{
  "sankey.nodeLabelColor": "#e2e8f0",
  "sankey.linkColorMode": "gradient",
  "sankey.linkOpacity": 0.55,
  "sankey.links": [
    {
      "source": "Revenue",
      "target": "R&D",
      "value": 380
    },
    {
      "source": "Revenue",
      "target": "GTM",
      "value": 300
    },
    {
      "source": "R&D",
      "target": "Salaries",
      "value": 300
    },
    {
      "source": "R&D",
      "target": "Cloud",
      "value": 80
    },
    {
      "source": "GTM",
      "target": "Salaries",
      "value": 200
    },
    {
      "source": "GTM",
      "target": "Ads",
      "value": 100
    }
  ],
  "sankey.valueFormat": "currency"
}
```

## API overrides

Push fresh flows per render with '<key>.links' (or just '<key>') as [{ source, target, value }]; node colors via '<key>.nodes'.

Flat override payload (`key.property` addressing) with the sample design's current values — send only the keys you want to change:

```json
{
  "sankey.links": [
    {
      "source": "Visits",
      "target": "Signup",
      "value": 620
    },
    {
      "source": "Visits",
      "target": "Bounce",
      "value": 380
    },
    {
      "source": "Signup",
      "target": "Activated",
      "value": 410
    },
    {
      "source": "Signup",
      "target": "Dormant",
      "value": 210
    },
    {
      "source": "Activated",
      "target": "Paid",
      "value": 180
    },
    {
      "source": "Activated",
      "target": "Free",
      "value": 230
    }
  ],
  "sankey.linkColorMode": "gradient",
  "sankey.showValues": true,
  "sankey.valueFormat": "compact",
  "sankey.opacity": 1
}
```

```bash
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "sankey.links": [
        {
            "source": "Visits",
            "target": "Signup",
            "value": 620
        },
        {
            "source": "Visits",
            "target": "Bounce",
            "value": 380
        },
        {
            "source": "Signup",
            "target": "Activated",
            "value": 410
        },
        {
            "source": "Signup",
            "target": "Dormant",
            "value": 210
        },
        {
            "source": "Activated",
            "target": "Paid",
            "value": 180
        },
        {
            "source": "Activated",
            "target": "Free",
            "value": 230
        }
    ],
    "sankey.linkColorMode": "gradient",
    "sankey.showValues": true,
    "sankey.valueFormat": "compact",
    "sankey.opacity": 1
}'
```

`{{YOUR_DESIGN_ID}}` and `{{YOUR_API_KEY}}` are placeholders: first create
the design in your account (paste the sample design JSON above into the
editor at https://app.imejis.io, or create it programmatically via the
imejis MCP server's `create_design` + `update_design` tools), then render
it with the design's id and one of your API keys.

Agents: the MCP server at https://api.imejis.io/api/mcp exposes this same
catalog as structured data via the `list_component_types` tool (property
kinds, allowed values, bounds, ready-to-use sample designs).

## Related

- [Sankey Diagram component](https://www.imejis.io/components/sankey.md) — full reference and FAQs
- [Gradient bands](https://www.imejis.io/components/sankey/gradient.md) — Flow bands blend from the source color to the target color.
- [Flat bands](https://www.imejis.io/components/sankey/flat.md) — Bands take a single source color — cleaner for dense diagrams.
