hydroxy

Alluvial chart

How members move between categories across ordered steps. Each step stacks its categories in the same order, and ribbons carry the members from one step's category to the next's, coloured by where they came from. Hover a category to light its ribbons.

Plan moves

Accounts that signed up in Q1, by plan at each quarter's end. Most churn leaves from Free in the first quarter.

Q1 2025Q2 2025Q3 2025Q4 2025Free1770Starter520Pro270Free1280Starter585Pro385Churned310Free860Starter665Pro450Churned585Free820Starter535Pro580Churned625
Q1 2025 sign-ups by plan, quarter by quarter
StepsFromToMembers
Q1 2025 → Q2 2025FreeFree1240
Q1 2025 → Q2 2025FreeStarter220
Q1 2025 → Q2 2025FreeChurned310
Q1 2025 → Q2 2025StarterFree40
Q1 2025 → Q2 2025StarterStarter330
Q1 2025 → Q2 2025StarterPro150
Q1 2025 → Q2 2025ProStarter35
Q1 2025 → Q2 2025ProPro235
Q2 2025 → Q3 2025FreeFree860
Q2 2025 → Q3 2025FreeStarter240
Q2 2025 → Q3 2025FreeChurned180
Q2 2025 → Q3 2025StarterStarter425
Q2 2025 → Q3 2025StarterPro90
Q2 2025 → Q3 2025StarterChurned70
Q2 2025 → Q3 2025ProPro360
Q2 2025 → Q3 2025ProChurned25
Q2 2025 → Q3 2025ChurnedChurned310
Q3 2025 → Q4 2025FreeFree820
Q3 2025 → Q4 2025FreeChurned40
Q3 2025 → Q4 2025StarterStarter535
Q3 2025 → Q4 2025StarterPro130
Q3 2025 → Q4 2025ProPro450
Q3 2025 → Q4 2025ChurnedChurned585

Usage

use hydroxy_leptos::alluvial_chart::*;
use hydroxy_leptos::chart_frame::ChartFrame;
use leptos::prelude::*;

pub fn demo() -> AnyView {
    let quarters: Vec<String> = ["Q1", "Q2", "Q3", "Q4"].iter().map(|q| format!("{q} 2025")).collect();
    // Accounts that signed up in Q1, by plan at the end of each quarter.
    let accounts = vec![
        Cohort::new(["Free", "Free", "Free", "Free"], 820.0),
        Cohort::new(["Free", "Free", "Starter", "Starter"], 240.0),
        Cohort::new(["Free", "Starter", "Starter", "Pro"], 130.0),
        Cohort::new(["Free", "Starter", "Pro", "Pro"], 90.0),
        Cohort::new(["Free", "Churned", "Churned", "Churned"], 310.0),
        Cohort::new(["Free", "Free", "Churned", "Churned"], 180.0),
        Cohort::new(["Starter", "Starter", "Starter", "Starter"], 260.0),
        Cohort::new(["Starter", "Pro", "Pro", "Pro"], 150.0),
        Cohort::new(["Starter", "Starter", "Churned", "Churned"], 70.0),
        Cohort::new(["Starter", "Free", "Free", "Churned"], 40.0),
        Cohort::new(["Pro", "Pro", "Pro", "Pro"], 210.0),
        Cohort::new(["Pro", "Starter", "Starter", "Starter"], 35.0),
        Cohort::new(["Pro", "Pro", "Churned", "Churned"], 25.0),
    ];

    view! {
        <ChartFrame title="Plan moves" description="Accounts that signed up in Q1, by plan at each quarter's end. Most churn leaves from Free in the first quarter.">
            <AlluvialChart data=accounts steps=quarters label="Q1 2025 sign-ups by plan, quarter by quarter" />
        </ChartFrame>
    }
    .into_any()
}

Anatomy

Componentdata-partRenders
AlluvialChartrootfigure; `data-active` while a category or ribbon is picked
stepA step's name above its column
flowThe ribbons and nodes, revealed left to right
nodeA category at one step; `data-highlighted` when lit, `data-selected` when picked
ribbonMembers moving between two categories; `data-highlighted` when lit
node-labelCategory name and count, beside nodes tall enough for them
tooltipMembers and shares for the picked category or ribbon
sr-tableEvery ribbon with its steps, categories and count, for screen readers and CSV export

Keyboard

KeyDoes
Arrow keysStep through the categories, then the ribbons
Home / EndFirst or last mark
EscapeClear the picked mark

Props

PropTypeNotes
dataVec<Cohort>Required. Members sharing a path, one category per step
stepsVec<String>Required. Step names in order
labelStringRequired. What the chart shows; the accessible name
widthu16Drawing width in px. Default 720
heightu16Drawing height in px. Default 360
formatFn(f64) -> StringFormats counts in labels, the tooltip and the table

Events

PropTypeNotes
on_hoverCallback<Option<Datum>>The mark under the pointer or keyboard focus changes, or is left. Fires only on a change
on_selectCallback<Datum>Click, tap or Enter on a mark
Actions
Button
Icon button
Toolbar
Theme menu
Display
Avatar
Badge
Card
Chip
Code block
Markdown
Doc card
Due pill
Kbd
Priority mark
Source chip
Space icon
Status diamond
Tag
Value diff
Carousel
Reveal
Media timeline
QR code
Transcript viewer
Audio waveform
Audio player
Forms
Calendar
Checkbox
Combobox
Date picker
Color picker
Cron builder
Theme editor
Mention input
Signature pad
Image cropper
Date field
Date range picker
Duration field
Quantity stepper
Filter chip
Input
Markdown editor
Radio group
Search field
Segmented control
Select
Slider
Range slider
Rating
Toggle button
File dropzone
Upload queue
Attachment
Switch
Tags input
Number field
Money field
Phone field
Time field
OTP input
Password field
Questionnaire
Availability picker
Voice input
Recording control
Inline edit
Async validated input
Shortcut recorder
Data
Spreadsheet grid
Week scheduler
Virtual list
Stat card
Step track
Kanban board
Sortable list
Filter builder
Data table
Grid
Access editor
File manager
Gantt chart
Log stream
Diff viewer
JSON inspector
Terminal
Node editor
Whiteboard
Navigation
Table of contents
Breadcrumb
Tabs
Wizard
Nav item
Nav section
Tree view
Pagination
Menubar
Navigation menu
Saved views
Layout
Master detail
App shell
Sidebar layout
Resizable panels
Dashboard layout
Dock layout
Feedback
Callout
Check list
Empty state
Progress bar
Toast
Approval card
Skeleton
Notification center
Bars
Bar chart
Diverging bar chart
Span chart
Pictogram chart
Stacked bar chart
Funnel chart
Bullet chart
Waffle chart
Marimekko chart
Dot plot chart
Error bar chart
Pareto chart
Waterfall chart
Lollipop chart
Grouped bar chart
Bar race chart
KPIs and frames
Chart frame
Metric card
Sparkline
Points
Scatter chart
Smith chart
Strip plot
Beeswarm chart
Parallel coordinates
Ternary chart
Bland-Altman chart
Quiver chart
Connected scatter chart
Grids and tables
Heatmap chart
Chart table
Cohort chart
Radial
Radial charts
Radar chart
Polar area chart
Stat ring
Clock chart
Spiral chart
Lines and areas
Bump chart
Slope chart
Line chart
Composed chart
Small multiples
Cycle plot chart
Horizon chart
Stacked area chart
Threshold chart
Split line chart
Linked charts
Confidence band chart
Forecast fan chart
Step chart
Range area chart
Distributions
Contour chart
Histogram
Box plot
Density chart
Ridgeline chart
Violin chart
Q-Q chart
Survival chart
ECDF chart
Raincloud plot
Forest plot
Maps
Geo map
Bubble map
Hexbin map
Cartogram
Flow map
Parts of a whole
Donut chart
Voronoi treemap
Nested donut chart
Treemap chart
Sunburst chart
Bubble pack chart
Icicle chart
Flame graph chart
Pie chart
Word cloud
Relationships
Sankey chart
Network chart
Chord chart
UpSet chart
Venn chart
Alluvial chart
Adjacency matrix chart
Dependency graph chart
Tree chart
Arc diagram
Hive plot
Edge bundling
Finance
Candlestick chart
OHLC chart
Depth chart
Renko chart
Time
Timeline chart
Calendar heatmap chart
Spectrogram chart
Marey chart
Overlays
Tour
Lightbox
Alert dialog
Command palette
Dialog
Menu
Popover
Tooltip
Sheet
Hover card
Context menu
Utilities
Pacer
Hotkeys
Disclosure
Accordion
Collapsible
Chat
Chat bubble
Voice session
Composer
Thread
Thread list
Assistant composer
Assistant MCP
Assistant modal
Assistant thread
Assistant thread list
Message scroller
Insight note
Emoji picker
Tool trace
Model picker
Citation popover
Activity
Activity feed
Comment thread
Timeline
Presence bar
Live cursors
Reaction bar
Guides
Getting started
All components
All charts