--- ## Sankey Flow diagram (Sankey) for visualizing multi-stage data or value pipelines. Nodes are split into layers; paths are rendered as cubic Bezier curves with value-proportional width. The layout algorithm is embedded (no d3-sankey dependency, ISC license attributed). Hovering/focusing a node or path highlights the connected paths and neighboring nodes. A ResizeObserver adapts the width responsively. An sr-only table provides a screen-reader fallback with source/target/value. **Import:** `import { Sankey } from '@urbicon-ui/blocks';` ### Examples ```svelte formatCurrency(v)} height={400} /> ``` ### Variants - intent: danger, neutral, primary, secondary, success, warning (default: neutral) ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | links | `SankeyLink[]` | yes | | Links property for the Sankey component | | nodes | `SankeyNode[]` | yes | | Nodes property for the Sankey component | | ...HTMLAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children') | | ...SankeyVariants | `VariantProps` | no | | Styling variants from SankeyVariants | | class | `string` | no | | Extra classes merged onto the wrapper. | | defaultOpacity | `number` | no | 0.45 | Default stroke opacity of paths without hover. | | dimmedOpacity | `number` | no | 0.25 | Hover opacity of the non-focused paths. | | formatPercent | `(percent: number) => string` | no | | Format function for percentages (tooltip). | | formatValue | `(value: number) => string` | no | | Format function for values (tooltip + sr-only table). | | height | `number | 'auto'` | no | 400 | Height of the diagram. Accepts a fixed pixel number or `'auto'`. `'auto'` scales with the node count: roughly `nodes.length × (12 + nodePadding)`, clamped to `[280, 800]`. Useful when the number of nodes varies at runtime and a fixed pixel value would be too small or too large. | | highlightedOpacity | `number` | no | 0.7 | Stroke opacity of the highlighted paths. | | highlightOnHover | `boolean` | no | true | Hover highlight (paths + connected nodes). | | intent | `SankeyIntent` | no | 'neutral' | Default intent for nodes without their own `intent`. | | iterations | `number` | no | 6 | Number of relaxation iterations in the layout. | | linkContent | `Snippet<[link: SankeyLaidOutLinkWithMeta]>` | no | | Custom snippet for path rendering (instead of the default cubic Bezier). | | nodeAlign | `'left' | 'right' | 'center' | 'justify'` | no | 'justify' | NodeAlign property for the Sankey component | | nodeContent | `Snippet<[node: SankeyLaidOutNodeWithMeta]>` | no | | Custom snippet for node content (inside the SVG, instead of the label). | | nodePadding | `number` | no | 16 | Vertical gap between nodes within a layer. | | nodeWidth | `number` | no | 24 | Pixel width of a node. | | onLinkClick | `(link: SankeyLaidOutLinkWithMeta) => void` | no | | Click callback for a path. | | onNodeClick | `(node: SankeyLaidOutNodeWithMeta) => void` | no | | Click callback for a node. | | preset | `string` | no | | Preset property for the Sankey component | | showValues | `boolean` | no | false | Persistently display values next to node labels (instead of only in the hover tooltip). Useful for print, PDF attachments, static screenshots, or tenant- and client-facing statements where hovering is not possible. Uses `formatValue` for formatting. | | slotClasses | `Partial>` | no | | Per-slot class overrides. | | tooltip | `Snippet<[datum: SankeyLaidOutNodeWithMeta | SankeyLaidOutLinkWithMeta, kind: 'node' | 'link']>` | no | | Custom tooltip content for node or path. | | unstyled | `boolean` | no | | Remove default classes. | | width | `number` | no | | Optional fixed width. Default: derived from the container via ResizeObserver. Set a value only if you need SSR-stable layouts and are willing to give up responsiveness. | Inherited from: - Omit (omit-pattern) - Omit, 'children'> (omit-pattern)