BumpChart
Who was ahead of whom, step by step. Lines swap places the way rankings do; point at one and it comes forward. Charts.
Open playgroundAbout
BumpChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { BumpChart } from "@ashutoshswamy/smoui" and set series, labels, height.
Install
npm i @ashutoshswamy/smouiUsage
import { BumpChart } from "@ashutoshswamy/smoui";
<BumpChart labels={["Q1", "Q2"]} series={[{ name: "Atlas", ranks: [1, 2] }]} />Props 3
- series
Rank per step, 1 is the top.
{ name; ranks: number[] }[]- labels
One label per step.
string[]- height
Default 280.
number
More charts components
- AreaChartDraws itself in. A guide, dot and tooltip follow the pointer on springs.
- BarChartBars grow in a wave. The pointed bar lights up and its value pops above it.
- BulletChartProgress against a goal. The bar fills on a spring, a tick marks the target, and rows that beat it turn solid.
- ContributionGraphA calendar of days as squares, darker for busier ones. They pop in column by column; point at one for its date and count.
- DonutChartRing sweeps in segment by segment. Hover swells a segment and swaps the center.
- DumbbellChartBefore and after per row. The bar stretches between the dots, then the change lands in green or red.