Skip to contentSkip to content

SankeyDataProvider API

API reference docs for the React SankeyDataProvider component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { SankeyDataProvider } from '@mui/x-charts-pro/SankeyChart';
// or
import { SankeyDataProvider } from '@mui/x-charts-pro';
// or
import { SankeyDataProvider } from '@mui/x-charts-premium/SankeyChart';
// or
import { SankeyDataProvider } from '@mui/x-charts-premium';

Learn about the difference by reading this guide on minimizing bundle size.

Props

NameTypeDefaultDescription
series*Array<SankeySeriesType>-
colorsArray<string>
| func
rainbowSurgePalette

Color palette used to colorize multiple series.

descstring-

The description of the chart. Used to provide an accessible description for the chart.

disableKeyboardNavigationbool-

If true, disables keyboard navigation for the chart.

experimentalFeatures{}-

Options to enable features planned for the next major.

heightnumber-

The height of the chart in px. If not defined, it takes the height of the parent element.

highlightedItem{ nodeId: number
| string, seriesId: string, subType: 'node' }
| { nodeId: number
| string, seriesId: string, subType: 'node', type: 'sankey' }
| { seriesId: string, sourceId: number
| string, subType: 'link', targetId: number
| string }
| { seriesId: string, sourceId: number
| string, subType: 'link', targetId: number
| string, type: 'sankey' }
-

The highlighted item. Used when the highlight is controlled.

idstring-

This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id.

localeTextPartial-

Localized text for chart components.

marginnumber
| { bottom?: number, left?: number, right?: number, top?: number }
-

The margin between the SVG and the drawing area. It's used for leaving some space for extra information such as the x- and y-axis or legend.

Accepts a number to be used on all sides or an object with the optional properties: top, bottom, left, and right.

onHighlightChangefunc-

The callback fired when the highlighted item changes.

Signature:function(highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null) => void
  • highlightedItem The newly highlighted item.
onTooltipItemChangefunc-

The callback fired when the tooltip item changes.

Signature:function(tooltipItem: SeriesItemIdentifier<SeriesType> | null) => void
  • tooltipItem The newly highlighted item.
seriesConfigChartSeriesConfig & ChartSeriesConfig<'sankey'>-

The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed.

titlestring-

The title of the chart. Used to provide an accessible label for the chart.

tooltipItem{ nodeId: number
| string, seriesId: string, subType: 'node' }
| { nodeId: number
| string, seriesId: string, subType: 'node', type: 'sankey' }
| { seriesId: string, sourceId: number
| string, subType: 'link', targetId: number
| string }
| { seriesId: string, sourceId: number
| string, subType: 'link', targetId: number
| string, type: 'sankey' }
-

The tooltip item. Used when the tooltip is controlled.

widthnumber-

The width of the chart in px. If not defined, it takes the width of the parent element.

The component cannot hold a ref.

Source code

If you did not find the information in this page, consider having a look at the implementation of the component for more detail.