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 playground
Q1Q2Q3Q41231Atlas2112Boreal3323Cinder4444Dune

About

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

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
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