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';Learn about the difference by reading this guide on minimizing bundle size.
Orchestrates the data providers for the sankey chart components and hooks.
Use this component if you have custom HTML components that need to access the chart data.
| Name | Type | Default | Description |
|---|---|---|---|
| colors | Array<string> | func | rainbowSurgePalette | Color palette used to colorize multiple series. |
| desc | string | - | The description of the chart. Used to provide an accessible description for the chart. |
| disableKeyboardNavigation | bool | - | If |
| experimentalFeatures | object | - | Options to enable features planned for the next major. |
| height | number | - | 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. |
| id | string | - | 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. |
| localeText | object | - | Localized text for chart components. |
| margin | number | { 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. |
| onHighlightChange | func | - | The callback fired when the highlighted item changes. Signature: function(highlightedItem: HighlightItemIdentifierWithType<SeriesType> | null) => void
|
| onTooltipItemChange | func | - | The callback fired when the tooltip item changes. Signature: function(tooltipItem: SeriesItemIdentifier<SeriesType> | null) => void
|
| seriesConfig | object | - | The configuration for the series types. This is used to define how each series type should be processed, colored, and displayed. |
| title | string | - | 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. |
| width | number | - | The width of the chart in px. If not defined, it takes the width of the parent element. |
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.