import type { ReactNode } from 'react'; import type { ConvertibleUnit, FormatOptions, Unit } from '@dynatrace-sdk/units'; import type { AriaLabelingProps } from '../../../core/types/a11y-props.js'; import type { BehaviorTrackingProps } from '../../../core/types/behavior-tracking-props.js'; import type { DataTestId } from '../../../core/types/data-props.js'; import type { MaskingProps } from '../../../core/types/masking-props.js'; import type { StylingProps } from '../../../core/types/styling-props.js'; import type { TruncationMode } from '../../../typography/text-ellipsis/TextEllipsis.js'; import type { ChartData } from '../../core/types/chart-data.js'; import type { ChartUnit } from '../../core/types/chart-unit.js'; import type { ColorPalette, CustomColorPalette } from '../../core/types/color-palette.js'; import type { Formatter } from '../../core/types/formatter.js'; import type { SankeyNodeAlignment, SankeySeriesActions } from './sankey.js'; /** * @internal */ export interface SankeyChartBaseProps extends MaskingProps, StylingProps, DataTestId, BehaviorTrackingProps, AriaLabelingProps { /** Link dataset. Each row is one directed edge. */ data: ChartData; /** Field in `data` rows that holds the source node id. */ sourceAccessor: string; /** Field in `data` rows that holds the target node id. */ targetAccessor: string; /** Field in `data` rows that holds the link volume (numeric). */ valueAccessor: string; /** * The width of the chart. If a number is passed, it will be treated as px. */ width?: number | string; /** * The height of the chart. If a number is passed, it will be treated as px. */ height?: number | string; /** Show the loading indicator when set to true. */ loading?: boolean; /** * The truncation mode to be used as start, middle or end in long node labels. * @defaultValue 'middle' */ truncationMode?: TruncationMode; /** * The color palette used for node coloring. * @defaultValue 'categorical' */ colorPalette?: ColorPalette | CustomColorPalette; /** * Custom formatter for numeric volume values. */ formatter?: Formatter | FormatOptions; /** * Unit for numeric volume values. */ unit?: ChartUnit; /** * Custom actions offered for the node or link the tooltip is pinned to. */ seriesActions?: SankeySeriesActions; children?: ReactNode; } /** * Constrains column-related props: `columnLabels` is only valid when * `columnAccessor` is also provided. * @internal */ export type SankeyColumnProps = { columnAccessor?: undefined; columnLabels?: never; } | { /** Field in `nodes` rows that holds the column index. Topology-inferred when omitted. */ columnAccessor: string; /** * Labels to display above each column, keyed by zero-based column index. */ columnLabels?: Record; }; /** * Node-metadata accessors. Enforces that `nodeIdAccessor` is required when * `nodes` is provided, and composes with `SankeyColumnProps` to gate * `columnLabels` behind `columnAccessor`. * @internal */ export type SankeyNodeProps = { /** No node metadata — nodes are inferred from link topology. */ nodes?: undefined; nodeIdAccessor?: never; nodeLabelAccessor?: never; columnAccessor?: never; columnLabels?: never; } | ({ /** Node metadata. Each row adds labels and column placement to one node. */ nodes: ChartData; /** Field in `nodes` rows that uniquely identifies the node. */ nodeIdAccessor: string; /** Field in `nodes` rows that holds the display label. */ nodeLabelAccessor?: string; } & SankeyColumnProps); /** * @internal */ export type SankeyChartProps = SankeyChartBaseProps & SankeyNodeProps; /** * Props for the `SankeyChart.Nodes` slot. `remainderColor` is only valid when * `remainder` is `'exit'` (enforced via the discriminated union). * @internal */ export type SankeyChartNodesProps = { /** Width of each node rectangle in pixels. */ width?: number; /** Horizontal node alignment within columns. */ alignment?: SankeyNodeAlignment; } & ({ remainder?: 'hidden'; } | { remainder: 'exit'; remainderColor?: string; }); //# sourceMappingURL=sankey-props.d.ts.map