Skip to content
InsightCharts

Search

Search guides and components

Fan flow

One solid block that splits into curved ribbons, each as thick as its value, ending at an aligned column of names, values and shares.

Use when
One total divided among 4 to about 14 destinations (or collected from that many origins, with direction: "in") when the picture of the split is the point: where a budget goes, what a day's water is used for, which sources feed one total.
Avoid when
Flows with more than one stage or several sources (use sankey chart); precise comparison of the parts (use bar chart); 2 to 4 parts (use segmented bar or donut chart); values that can be negative (use bar chart).

Preview

Composition

Used in

1 infographic uses fan flow.

Infographics

1

A portrait poster of where something comes from and where it goes, in three stacked bands painted in one colour: the producers as large labelled tiles, the leading producer's output fanning out as ribbons to an aligned column of destinations, and the destinations as bubbles on a scale of how much each depends on that producer.

Installation

$ pnpm dlx shadcn@latest add @insightcharts/fan-flow

The CLI copies the source into your project and needs the @insightcharts registry in components.json; see installation. With the package, import it by name:

import { FanFlow } from "insightcharts";

Examples

Many into one, with highlight

One colour

Ten destinations, one colour each

Stress: 18 destinations, long names, very uneven values

Props

PropTypeDefaultDescription
namerequiredstringDestination field: one ribbon per distinct value.
valuerequiredstringValue field: ribbon thickness. Rows sharing a name are summed; non-positive values are dropped.
trunkstringLabel printed in the single block, with the total.
direction"out" | "in""out"out: one block fans out to many labels on the right. in: many labels on the left flow into one block.
maxItemsnumber12Ribbons to keep; the rest are summed into the remainder ribbon.
otherLabelstring"Other"Name of the remainder ribbon, drawn in the context colour. A row with this name is treated as the remainder.
taggedstring[]Destinations marked with a dotted outline around the name.
tagLabelstringWhat the dotted outline means, printed in the key. Needed for tagged to be drawn.
sharebooleantruePrint each ribbon's share of the total. Dropped on narrow screens.
colorBy"series" | "none"series: one colour per destination; past the size of the theme's palette the extra colours are derived from the theme's own. none: every ribbon in the accent. Default: series while the destinations fit the palette (at most 8), none beyond.
sort"value" | "none""value"Largest first, or the data order.
Common chart props 29

Every chart built with defineChart accepts these on top of its own props.

PropTypeDescription
dataDataInputRows, CSV text, a URL, { url, path }, an async function, or an Arrow-style table. Omit inside <InsightData>.
transformTransform | Transform[]A pipeline of transforms applied before drawing.
titlestringThe title. One plain statement of what the data shows, with the number and the period ("Monthly churn fell from 4.2% to 2.1% in 2024"), or a plain label ("Monthly churn, 2024"). One clause, no figures of speech.
subtitlestringMeasure, unit, population, period.
sourcestringData source, shown as "Source: ...".
notestringMethod notes or caveats.
heightnumber | stringCSS height of the plot. Default 360.
aspectnumberWidth / height. Overrides height.
highlightstring | string[]The entity (or entities) the title is about. Every other series is drawn in grey.
annotationsAnnotation[]Reference lines, shaded bands and callouts, in data coordinates.
formatFormatSpecHow to print values: "compact", "percent", "currency:USD", "{value} kg", Intl options, or a function.
legendbooleanShow the legend. Default: shown when there are two or more series.
selectboolean | stringMake marks clickable to filter. Inside <InsightData> the selection filters every other chart. Pass a field name, or true to use the chart's category field.
onSelect(values: string[], field: string) => voidCalled with the selected values whenever the selection changes.
optionEChartsOption | ((option: EChartsOption, ctx: BuildContext) => EChartsOption)Deep-merged over the generated ECharts option, or a function that receives and returns it. Use it for ECharts settings no prop covers.
themeThemeInputA theme, or a partial set of tokens merged over the surrounding theme, for this chart only.
modeModeInput"auto" (default) follows the page, "system" follows the OS, or force "light" / "dark".
rendererRendererInput"auto" (default) uses SVG for light charts and canvas for heavy ones.
animatebooleanSet false to disable animation. Reduced-motion preferences are always respected.
lazybooleanMount the chart only when it scrolls near the viewport. Default true.
groupstringLink tooltips with other charts sharing this group id.
exportableboolean | ExportFormat[]Show an export menu: true or a list of formats from png, jpeg, svg, pdf, csv, json.
tablebooleanShow a collapsible "View data" table under the chart.
altstringAccessible description: the chart type and measures, then the main pattern and the notable values.
idstringStable id for this chart's selection in the shared store.
onEventsRecord<string, ChartEventHandler>ECharts event handlers, e.g. { click: (params, chart) => {} }. Prefix a name with zr: to bind to the canvas itself.
onReady(chart: EChartsInstance) => voidCalled with the ECharts instance once it is created.
classNamestringClass name for the outer <figure>.
styleCSSPropertiesInline style for the outer <figure>.