RanksBlock

RanksBlock screenshot

When to use

When comparing a few named items (e.g. ablation masks) on a single scalar metric, and the visual ordering matters. Each row renders a bar whose width encodes a fraction in [0, 1]. Sanity-check rows can be visually distinguished.

Example

import RanksBlock from '../../components/widgets/RanksBlock.astro';

<RanksBlock rows={[
  { mask: "full model", value: "0.93", fraction: 0.93, bold: true },
  { mask: "no layer 5", value: "0.71", fraction: 0.71 },
  { mask: "no layer 9", value: "0.42", fraction: 0.42 },
  { mask: "random ablate", value: "0.05", fraction: 0.05, sanity: true },
]} />

Props

PropTypeRequiredNotes
rowsRow[]yesOne bar per row.

Row shape:

FieldTypeRequiredNotes
maskstringyesLeft-aligned row label.
valuestringyesRight-aligned printed value (any units).
fractionnumberyesBar width as a fraction in [0, 1]. Clamped.
boldbooleannoRenders the value cell bold (e.g. the “main” row).
sanitybooleannoAdds a sanity class for downweighted styling.

When not to use