Each bar is one geography's distance from the median geography{ok ? ` (${ctx.fmt(slug, med)})` : ''}. Bars grow left, in the vermilion family, below the
median and right, in the violet family, above it. The lighter step covers the distance up to the nearest quartile (the middle half of
geographies); the stronger step is the distance beyond it. The number at the end of each bar is the real distance in the metric's own unit.
Sorted {alpha ? `by name, ${ctx.sp.get('dir') === 'desc' ? 'Z to A' : 'A to Z'}` : `by value, ${ctx.sortDir === 'asc' ? 'lowest' : 'highest'} first`}; use the toggle to switch. Hover or
focus a legend chip to highlight one side; click it to hide that side.{shownNote}
>
}
controls={
ctx.setMany(v === 'name' ? { sort: 'name', dir: null } : { sort: null })}
options={[
{ value: 'value', label: 'Sort by value' },
{ value: 'name', label: 'Alphabetical' },
]}
/>
}
caption={
<>
{ctx.metricLabel}: distance of each of {vals.length} geographies from the median, {ctx.vintage} ACS 5-year; lighter bars are within the middle half
(Q1 to Q3), stronger bars beyond it. Source: ACS 5-year, {ctx.vintage}.
>
}
table={() =>
ok
? {
columns: [{ label: 'Geography' }, { label: ctx.metricLabel, numeric: true }, { label: 'Distance from median', numeric: true }],
rows: built.items.map((i) => [i.name, ctx.fmt(slug, i.v), signedChange(slug, med, i.v, ctx.metrics, ctx.fmt)]),
}
: null
}
>
{!ok ? (
No data available — at least 3 geographies with a value for {ctx.metricLabel} are needed.
) : (
within the middle half (Q1 to Q3)
beyond it
String(Math.round(v))} sub={`of ${vals.length} geographies`} reduced={ctx.reduced} />
ctx.fmt(slug, v)} sub={high?.r.name ?? 'No data available'} reduced={ctx.reduced} />
ctx.fmt(slug, v)} sub={low?.r.name ?? 'No data available'} reduced={ctx.reduced} />
)}
)
}