Docs
katalyx.bio

Line charts

Every line chart from shadcn's gallery in Material 3 Expressive: 3px round lines, a big readout that follows the point in focus, a ring and a line to mark it, and the value axis on the right with a reference value called out. The demos follow an E. coli culture. Hover to preview, click or tap to select, or tab to a chart and use the arrow keys.

Default, Linear and Step

The three curve types. Default is monotone: smooth, and never overshoots a point. Linear joins the points with straight segments, Step holds each value until the next. The readout gives the fold change since the previous reading.

Line Chart

E. coli growth, OD600 every two hours. The dotted line is OD600 0.6, where you would induce.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Line Chart - Linear

Straight segments between readings.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Line Chart - Step

Each reading holds until the next.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Multiple

With two series a readout cannot say everything, so the inverse tooltip stays. It replaces the gray cursor with the focus line and a ring on each series.

Line Chart - Multiple

Wild type and a slow-growing mutant, OD600 every two hours. Illustrative.

Wild type 1.5× denser at 10 h

Dots, Custom Dots and Dots Colors

Dots are ringed in the card surface. Custom dots can be any shape: here the induction point is a scalloped cookie with a bolt. Dots Colors takes each dot's color from a band in the config, here the growth phase, and the legend names the bands.

Line Chart - Dots

Every reading marked with a ringed dot.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Line Chart - Custom Dots

The reading where you would induce wears a scalloped bolt.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Line Chart - Dots Colors

Each reading takes the color of its growth phase.

1.93OD600, 10 h after inoculation
1.1× since 8 h

Label and Custom Label

Value labels are small pills above their points, inverse for values and tonal for names, never bare floating numbers.

Line Chart - Label

E. coli growth, with each OD600 reading on its point.

Line Chart - Custom Label

E. coli doubling time on each carbon source, each point named in a chip. Illustrative.

Interactive

The series switcher shows each series' total for the period; the connected toggle changes the period. The readout, the dotted average and the focus all follow the choice.

Line Chart - Interactive

Samples received by a sequencing core each day, DNA and RNA. Pick a series and a period; the chart follows.

20samples, Today
DNA, last 30 days. Average 43 a day.

Usage

const focus = useChartFocus({ count: data.length, describe: (i) => `${data[i].hour}: OD600 ${data[i].od}` })​<ChartContainer config={config} focus={focus} aria-label="E. coli growth curve, OD600 every two hours">  <LineChart data={data} {...focus.chartProps}>    <XAxis dataKey="hour" tickLine={false} axisLine={false} />    <YAxis orientation="right" tickLine={false} axisLine={false} tick={chartTicks()} />    <ChartTooltip cursor={false} content={() => null} />    <Line {...chartLine("od")} dot={chartCookieDot("od", { when: (d) => d.induced })} />    <ReferenceLine x={data[focus.index].hour} {...chartFocusLine} />  </LineChart></ChartContainer>

Line helpers

PropTypeDefaultNotes
chartLine(key)props3px round line, monotone, no resting dots. Override type for linear or step
chartColorDot(colorOf, { r })Line dotA dot whose color comes from the data point, ringed in the surface
chartCookieDot(key, { when, glyph, r })Line dotPoints where when is true become a scalloped cookie with an optional SVG path glyph; the rest a small dot
chartPillLabel(key, { text, tone, offset })LabelList contentA value or name as a pill above its point: inverse or tonal
chartCookiePath(cx, cy, r)stringThe scalloped cookie outline as an SVG path