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. Pass it when the period has no data.

  • 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, says so quietly and offers Try again. Errors are toasts, so the value isn't shown; toast the message where the request fails.

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

    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 shows a quiet loading bar.

  • 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.