Docs
katalyx.bio

Pie charts

Every pie and donut from shadcn's gallery in Nelumbo's Material style: slices parted by even gaps with rounded ends, a slice that grows on a spring when it is in focus, labels on inverse chips and a big readout in the middle of a donut. The demos show blood immune cells by type from a flow panel, and reads per library in a pooled run, with illustrative numbers.

Simple and Separator None

Slices are rounded and parted by even gaps: a stroke in the card's color, so a gap keeps its width from rim to center, around a small hole so the slices never meet in a point. Drop the stroke, the hole and the corners for one continuous disc.

Pie Chart
PBMCs by cell type, from a flow panel
50,000 cellslive single cells, one donor
Pie Chart - Separator None
No gaps: one continuous disc

Label, Custom Label and Label List

Labels are small inverse chips, never bare numbers. piePillLabel draws them outside on a round-capped leader line (the value, or a name and value with a slice-colored dot) or inside the slice.

Pie Chart - Label
Each cell type’s share, on a chip
Pie Chart - Custom Label
Name and value in a chip outside the pie
Pie Chart - Label List
Each slice carries its own name

Legend and Donut

The legend is the chip row used across Nelumbo charts. A donut keeps the same gaps and pill ends around a hollow center.

Pie Chart - Legend
Chips name the slices
Pie Chart - Donut
PBMCs by cell type, from a flow panel
50,000 cellslive single cells, one donor

Donut Active and Donut with Text

The active slice grows outward on a spring (PieActiveSector). Hover or tap to pick one, or tab to the chart: it is a single slider stop, the arrow keys move between slices and the value is read out. The center of a donut holds a readout (PieCenter).

Pie Chart - Donut Active
Hover or tap a slice, or tab to the chart and use the arrow keys
Pie Chart - Donut with Text
Live single cells after gating
50,000 cellslive single cells, one donor

Stacked

Two Pie series with different radii make concentric rings. The tooltip names the donor through labelFormatter.

Pie Chart - Stacked
Donor A on the inside, donor B on the outside

Interactive

A connected switcher picks the library. The chart, the selector and the arrow keys share one useChartFocus selection, so the grown slice, the pressed library and the center value always agree.

Pie Chart - Interactive
Pick a library; its slice grows and the center shows its reads

Helpers

PropTypeDefaultNotes
Pie paddingAngle, cornerRadiusnumber4, 12Gaps and pill ends. Use 0 and 0 with stroke none for Separator None
piePillLabel(options)label rendererPie label as an inverse pill. position outside (leader line) or inside; text(value, name); dot; offset
PieActiveSectoractiveShapeThe slice grown by grow px (default 12), settling on a spring. Use with a controlled activeIndex
PieCenter value, labelcomponentBig readout centered over a donut; place it in a relative wrapper beside the ChartContainer
ChartContainer focusChartFocusFrom useChartFocus: the chart is one slider stop; arrow keys move the active slice