/* eslint-disable @typescript-eslint/no-explicit-any */ import { LegendOrdinal, LegendItem, LegendLabel } from "@visx/legend"; import { scaleOrdinal } from "@visx/scale"; import { ReactElement } from "react"; type LegendProps = { colorRange: string[]; dataKeyArray: string[]; }; export const Legend = ({ colorRange, dataKeyArray, }: LegendProps): ReactElement => { const legendGlyphSize = 15; const ordinalColorScale = scaleOrdinal({ domain: dataKeyArray, range: colorRange, }); return (
`${label.toUpperCase()}`} > {(labels: any) => (
{labels.map((label: any, i: number) => ( {label.text} ))}
)}
); }; export default Legend;