API reference: @salmonui/charts/sankey-chart
SankeyChartcomponent
import { SankeyChart } from '@salmonui/charts/sankey-chart';function SankeyChart(props: SankeyChartProps): ReactNode;
Props: SankeyChartProps
| Name | Signature | Description |
|---|---|---|
nodes | readonly nodes: readonly SankeyNode[]; | |
links | readonly links: readonly SankeyLink[]; | |
orientationoptional | readonly orientation?: 'horizontal' | 'vertical' | undefined; | |
nodeWidthoptional | readonly nodeWidth?: number | undefined; | Node thickness across the flow, px. Default 16. |
nodePaddingoptional | readonly nodePadding?: number | undefined; | Gap between nodes in a column, px. Default 12. |
linkColoroptional | readonly linkColor?: 'source' | 'target' | 'gradient' | undefined; | Link color: the source or target node color, or a gradient between them. Default |
curvatureoptional | readonly curvature?: number | undefined; | 0 (straight) .. 1. Default 0.5. |
labelsoptional | readonly labels?: boolean | {
readonly position?: 'inside' | 'outside' | undefined;
} | undefined; | |
legendoptional | readonly legend?: boolean | {
readonly position?: 'top' | 'bottom' | 'start' | 'end' | undefined;
readonly title?: string | undefined;
} | undefined; | |
tooltipoptional | readonly tooltip?: boolean | {
readonly renderNode?: ((node: SankeyNodeInfo) => ReactNode) | undefined;
readonly renderLink?: ((link: SankeyLinkInfo) => ReactNode) | undefined;
} | undefined; | |
highlightoptional | readonly highlight?: 'adjacent' | false | undefined; | Dim everything not connected to the hovered or focused node or link. Default |
onNodeClickoptional | readonly onNodeClick?: ((node: SankeyNodeInfo, event: SankeyEvent) => void) | undefined; | |
onLinkClickoptional | readonly onLinkClick?: ((link: SankeyLinkInfo, event: SankeyEvent) => void) | undefined; | |
onNodeHoveroptional | readonly onNodeHover?: ((node: SankeyNodeInfo | null) => void) | undefined; | |
onLinkHoveroptional | readonly onLinkHover?: ((link: SankeyLinkInfo | null) => void) | undefined; | |
getNodeStyleoptional | readonly getNodeStyle?: ((node: SankeyNodeInfo) => {
readonly color?: string | undefined;
} | undefined) | undefined; | |
getLinkStyleoptional | readonly getLinkStyle?: ((link: SankeyLinkInfo) => {
readonly color?: string | undefined;
readonly opacity?: number | undefined;
} | undefined) | undefined; | |
formatLabeloptional | readonly formatLabel?: ((node: SankeyNodeInfo) => string) | undefined; | |
formatoptional | readonly format?: Intl.NumberFormatOptions | ((value: number) => string) | undefined; | |
localeoptional | readonly locale?: string | undefined; | |
textoptional | readonly text?: Partial<SankeyChartText> | undefined; | Built-in text (over the nearest |
widthoptional | readonly width?: number | undefined; | |
heightoptional | readonly height?: number | undefined; | |
titleoptional | readonly title?: string | undefined; | |
subtitleoptional | readonly subtitle?: string | undefined; | |
descriptionoptional | readonly description?: string | undefined; | |
showDataTableoptional | readonly showDataTable?: boolean | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
idoptional | readonly id?: string | undefined; | |
refoptional | readonly ref?: Ref<SankeyChartApi> | undefined; | |
onResizeoptional | readonly onResize?: ((size: {
readonly width: number;
readonly height: number;
}) => void) | undefined; | |
animatedoptional | readonly animated?: boolean | undefined; | Entrance and update transitions, default |