import { choroplethGradientCss } from '@/lib/choroplethColorScale' import { formatElectionNumber } from '@/lib/electionFormat' type ChoroplethLegendProps = { max: number metricLabel: string formatMax?: (max: number) => string /** What the colour means, in the caller's words. */ note: string /** Ties the note to the scale selector through `aria-describedby`. */ noteId: string } export const ChoroplethLegend = ({ max, metricLabel, formatMax = formatElectionNumber, noteId, note, }: ChoroplethLegendProps) => (
{note}