import type { ChartDatapoint } from '../../core/types/chart-data.js'; import type { SeriesActionsTemplate } from '../../core/types/series-actions-template.js'; /** * Horizontal alignment of nodes within their columns. * @internal */ export type SankeyNodeAlignment = 'left' | 'right' | 'justify'; /** * Data provided to the `seriesActions` callback for a node. * @public */ export interface SankeyNodeSeriesActionsPayload { type: 'node'; /** * The node's unique identifier. */ id: string; /** * The node's display label. */ label: string; /** * The sum of all incoming link values. `0` for a node with no inflow. */ totalInflow: number; /** * The sum of all outgoing link values. `0` for a node with no outflow. */ totalOutflow: number; /** * The consumer's datapoint for this node, carrying every field of the row * supplied via the `nodes` prop. A node inferred from the link topology has * no such row, so only the generated `id` and `label` are present. */ data: ChartDatapoint | undefined; } /** * Data provided to the `seriesActions` callback for a link. * @public */ export interface SankeyLinkSeriesActionsPayload { type: 'link'; /** * The id of the link's source node. */ sourceId: string; /** * The label of the link's source node. */ sourceLabel: string; /** * The id of the link's target node. */ targetId: string; /** * The label of the link's target node. */ targetLabel: string; /** * The raw link value. */ value: number; /** * The consumer's datapoint for this link, carrying every field of the * corresponding row of the `data` prop. */ data: ChartDatapoint; } /** * Discriminated union of the payloads passed to the `seriesActions` callback. * Switch on `type` to narrow to the node or link variant. * @public */ export type SankeySeriesActionsPayload = SankeyNodeSeriesActionsPayload | SankeyLinkSeriesActionsPayload; /** * Builds the actions offered for the node or link the tooltip is pinned to. * @public */ export type SankeySeriesActions = (payload: SankeySeriesActionsPayload) => SeriesActionsTemplate; export type { SankeyChartTooltipProps, SankeyLinkTooltipPayload, SankeyNeighborEntry, SankeyNodeTooltipPayload, SankeyTooltipPayload, } from './sankey-internal.js'; //# sourceMappingURL=sankey.d.ts.map