Patient Flow Sankey Diagram
This example shows patient flow through seven stages—Assignment, Admission, Transfer, Diagnose, Treatment, Recovery, and Discharge—using a Sankey diagram where link thickness encodes patient counts and loops indicate return paths. The code builds the diagram with the D3 v7 `d3.sankey()` layout and `d3.sankeyLinkHorizontal()` for curved links, rendering nodes as blue SVG rectangles with labels. Data is hardcoded as a JavaScript object, and the visualization updates interactively through D3’s data joins, with hover tooltips via `<title>` elements.