/**
 * Sankey diagram type definitions
 * @countermeasure/web-components/charts/sankey/types
 */

import type { BaseChartConfig, TooltipConfig } from '../types'

export interface SankeyNode {
  id: string
  label: string
  color?: string
}

export interface SankeyLink {
  source: string
  target: string
  value: number
  color?: string
}

export interface SankeyChartConfig extends BaseChartConfig {
  /** Nodes referenced by `links.source` and `links.target`. */
  nodes: SankeyNode[]
  /** Weighted links between nodes. */
  links: SankeyLink[]
  /** Optional tooltip configuration (formatter, enabled flag). */
  tooltip?: TooltipConfig
  /**
   * Width of each node rectangle in pixels.
   * @default 12
   */
  nodeWidth?: number
  /**
   * Vertical padding between nodes within a column in pixels.
   * @default 8
   */
  nodePadding?: number
  /**
   * Opacity applied to the link ribbons, 0–1.
   * @default 0.5
   */
  linkOpacity?: number
}
