/
1.1k
Sponsor

Dither Radar Chart

Dithered radar charts for comparing multiple series across terminal-friendly radial axes

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/dither-radar-chart

Usage

import {
  Legend,
  Radar,
  RadarChart,
  Tooltip,
} from "@/components/ui/dither-radar-chart";
import type { ChartConfig } from "@/components/ui/dither-radar-chart";
const data = [
  { metric: "Speed", desktop: 82, mobile: 68 },
  { metric: "Quality", desktop: 74, mobile: 79 },
  { metric: "Reach", desktop: 66, mobile: 88 },
  { metric: "Trust", desktop: 91, mobile: 72 },
];
 
const config = {
  desktop: { color: "blue", label: "Desktop" },
  mobile: { color: "pink", label: "Mobile" },
} satisfies ChartConfig;
 
<RadarChart config={config} data={data} nameKey="metric" width={52}>
  <Radar dataKey="desktop" variant="gradient" />
  <Radar dataKey="mobile" variant="dotted" />
  <Legend align="left" />
  <Tooltip labelKey="metric" />
</RadarChart>;

Examples

Fill variants

Choose gradient, dotted, hatched, or solid polygon fills independently for each radar series.

Terminal

API Reference

PropTypeDefault
dataTData[]required
configChartConfigrequired
nameKeystringrequired
widthnumber56
heightnumber12
bloom"off" | "low" | "high" | "aura" | BloomConfig"off"
markerIndexnumber | nullnull
noColorbooleanfalse
screenReaderModebooleanfalse

The standard chart keyboard controls inspect axes, focus series, and replay enabled entrance motion.

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Arrow keys or h / j / k / l move through the chart; Enter / Space select a point; Escape clears the active point; r restarts enabled animation.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Visual output exposes its meaningful value through a textual alternative or bounded accessible summary.