Sankey

Requests from keys to models to providers; hover a node to follow its path.

View source
Requests from keys to models to providers
FromToRequests
checkout-webgpt-54,200
checkout-webclaude-sonnet-4-52,100
checkout-workergpt-5-mini3,600
checkout-workerclaude-sonnet-4-5900
ci-runnergpt-5-mini700
gpt-5OpenAI4,200
gpt-5-miniOpenAI4,300
claude-sonnet-4-5Anthropic3,000
import { Sankey } from "@logicplanes/kaeso-ui";

Props

  • aria-label
    string

    The chart's accessible name ("Requests by model").

  • empty
    boolean

    Shows the empty state (emptyText) in place of the data. By default it shows when no link carries a value.

  • emptyText
    ReactNode

    What the empty state says. Defaults to "No data for this period" in the provider's language.

  • error
    ReactNode

    The data failed to load: the chart keeps its height, hides its legend and table toggle, and says so quietly, with Try again when there is onRetry and otherwise a hint to reload the page. Errors are toasts, so the value isn't shown; pass true and toast the message where the request fails.

  • formatValue
    ((v: number) => string)

    Formats the values beside the nodes and in the data table. Defaults to formatNumber.

  • height
    number = 320

    The diagram's height in px (320 by default).

  • links
    SankeyLinkIn[]

    The flows, each with a source and a target node id and a value.

  • loading
    boolean

    The data is loading: the chart keeps its height and is marked busy; data already on screen dims and breathes, and with none yet the plot is a skeleton.

  • nodes
    SankeyNodeIn[]

    The nodes, each with an id and a label. Columns follow from the links.

  • onRetry
    (() => void)

    Called when Try again is pressed after error; without it, the button doesn't show.