Sankey
Examples
API Reference
Types come from the public API. A dash indicates no default is documented here.
SankeyChart props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<K, Ends> | undefined | '' | The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "HoverChanged"; readonly kind: "link" | "none" | "node"; readonly index: number | null; }) => NoInfer<Msg> | undefined) | { readonly HoverChanged: (event: { readonly _tag: "HoverChanged"; readonly kind: "link" | "none" | "node"; readonly index: number | null; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.data | Show type{ readonly nodes: readonly { readonly name: string; readonly color?: string; readonly category?: "source" | "landing" | "outcome"; readonly tooltipTitle?: string; readonly tooltipValue?: string; }[]; readonly links: readonly { readonly source: number; readonly value: number; readonly target: number; readonly label?: string; readonly color?: string; readonly tooltipValue?: string; }[]; } | Required | |
props.id | string | Required | |
props.link | Show type{ readonly stroke?: string; readonly strokeOpacity?: number; readonly fadedOpacity?: number; readonly useGradient?: boolean; } | — | |
props.animationDuration | number | — | |
props.aspectRatio | string | '2 / 1' | |
props.height | number | 360 | |
props.margin | Show type{ readonly bottom?: number; readonly left?: number; readonly right?: number; readonly top?: number; } | — | |
props.width | number | 720 | |
props.className | string | — | |
props.ariaLabel | string | 'Sankey chart' | |
props.tooltip | { readonly className?: string; } | {} | |
props.ariaDescription | string | — | |
props.revealSignature | string | — | |
props.enterTransition | Show type{ readonly delay?: number; readonly duration?: number; readonly ease?: string | readonly number[] | readonly (string | readonly number[])[]; readonly type?: unknown; readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly bounce?: number; } | — | |
props.node | Show type{ readonly fill?: string; readonly fadedOpacity?: number; readonly lineCap?: number; readonly showLabels?: boolean; readonly showValueLabels?: boolean; readonly labelOrientation?: "horizontal" | "vertical"; } | — | |
props.hoveredNodeIndex | number | null | null | |
props.nodeWidth | number | — | |
props.nodePadding | number | — | |
props.valueFormat | Show type{ readonly prefix?: string; readonly options?: { readonly style?: "decimal" | "percent" | "currency"; readonly currency?: string; readonly unit?: string; readonly maximumFractionDigits?: number; readonly notation?: "compact" | "standard"; readonly compactDisplay?: "long" | "short"; readonly minimumFractionDigits?: number; readonly minimumIntegerDigits?: number; readonly minimumSignificantDigits?: number; readonly maximumSignificantDigits?: number; readonly currencyDisplay?: "symbol" | "code" | "name" | "narrowSymbol"; readonly unitDisplay?: "long" | "short" | "narrow"; }; readonly suffix?: string; } | — |