Open this example in the interactive library
Live preview
Source code
// components/ZeroBaselineNormalizer.tsx
export default function ZeroBaselineNormalizer({
values = [2, 3, 3, 6, 11],
}: { values?: number[] } = {}) {
const min = Math.min(...values);
return (
<table>
<tbody>
{values.map((v, i) => (
<tr key={i}>
<th>{v}</th>
<td>{v - min} above minimum</td>
</tr>
))}
</tbody>
</table>
);
}
