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'; /** * Visibility mode of the node labels. * @internal */ export type SankeyLabelsDisplay = 'all' | 'none' | 'auto'; /** * 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 edge values. `0` for a node with no inflow. */ totalInflow: number; /** * The sum of all outgoing edge 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 edge topology has * no such row, so only the generated `id` and `label` are present. */ data: ChartDatapoint | undefined; } /** * Data provided to the `seriesActions` callback for an edge. * @public */ export interface SankeyEdgeSeriesActionsPayload { type: 'edge'; /** * The id of the edge's start node. */ fromId: string; /** * The label of the edge's start node. */ fromLabel: string; /** * The id of the edge's end node. */ toId: string; /** * The label of the edge's end node. */ toLabel: string; /** * The raw edge value. */ value: number; /** * The consumer's datapoint for this edge, carrying every field of the * corresponding row of the `edges` prop. */ data: ChartDatapoint; } /** * Discriminated union of the payloads passed to the `seriesActions` callback. * Switch on `type` to narrow to the node or edge variant. * @public */ export type SankeySeriesActionsPayload = SankeyNodeSeriesActionsPayload | SankeyEdgeSeriesActionsPayload; /** * Builds the actions offered for the node or edge the tooltip is pinned to. * @public */ export type SankeySeriesActions = (payload: SankeySeriesActionsPayload) => SeriesActionsTemplate; export type { SankeyChartTooltipProps, SankeyEdgeTooltipPayload, SankeyNeighborEntry, SankeyNodeTooltipPayload, SankeyTooltipPayload, } from './sankey-internal.js'; //# sourceMappingURL=sankey.d.ts.map