Files
CatoandClaude 2f465e24e3 refactor(charts): draw severity, quality trend and output shares with chartkit (#383)
* refactor(charts): draw severity, quality trend and output shares with chartkit

Three charts were still drawn by hand in this app while @bitbaum/chartkit
already ships them, against the packages-first rule (every chart is
chartkit, so a fix made once reaches every product):

- SeverityBar (components/portal/Status.tsx) now draws its 0-12 bar with
  chartkit's Meter (showValue off: the number beside it still opens the
  severity method). The bar gains a meter role with its value and max.
- The quality run-history Trend (components/quality/Trend.tsx) is
  chartkit's LineChart: axis from 80% (or lower) to 100%, dated ticks,
  every run's value on hover/focus and in the hidden table. The caption
  keeps the old accessible sentence. The hand-drawn SVG's CSS is removed
  from app/styles/quality.css.
- Per-country share-of-world-output bars in the quantities profile
  module are chartkit Meters (neutral tone, stretched to the row in
  app/styles/places.css), with the same "per cent of the published world
  total" label.

package-plan.json binds the three files under the charts block.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

* fix(quality): the trend draws each day's latest run

The quality run fires every six hours and chartkit places a point by its
date, so four runs a day stacked on one x. The trend now keeps one point
per day, that day's latest run, and its caption says so.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 08:59:17 +01:00

144 lines
3.0 KiB
CSS

/* ── Data quality: /data/quality ── */
.quality-table th:first-child {
min-width: 12rem;
}
.quality-cell.is-good {
color: var(--color-status-positive);
}
.quality-cell.is-fair {
color: var(--color-status-warning);
}
.quality-cell.is-poor {
color: var(--color-status-negative);
}
.quality-na {
font-size: 0.72rem;
color: var(--color-fg-muted);
}
.quality-dataset {
padding: 1.75rem 0;
border-top: 1px solid var(--color-border-subtle);
scroll-margin-top: 5rem;
}
.quality-dataset h3 {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0.75rem;
font-size: 1.15rem;
font-weight: 600;
color: var(--color-fg-primary);
}
.quality-score {
font-family: var(--font-mono);
font-size: 0.85rem;
font-weight: 400;
}
.quality-score.is-good {
color: var(--color-status-positive);
}
.quality-score.is-fair {
color: var(--color-status-warning);
}
.quality-score.is-poor {
color: var(--color-status-negative);
}
.quality-counts {
margin: 0.75rem 0 1rem;
font-size: 0.85rem;
color: var(--color-fg-secondary);
}
.quality-criteria {
display: grid;
gap: 0.6rem 1.5rem;
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
margin-bottom: 1rem;
}
.quality-criteria dt {
font-size: 0.8rem;
font-weight: 600;
color: var(--color-fg-primary);
}
.quality-criteria dd {
font-size: 0.78rem;
line-height: 1.45;
color: var(--color-fg-tertiary);
}
.quality-note {
font-size: 0.78rem;
color: var(--color-fg-tertiary);
margin: 0.5rem 0;
}
/* The run history is chartkit's LineChart; this only bounds its width. */
.quality-trend {
margin: 0.5rem 0;
max-width: 24rem;
}
.quality-check {
margin-top: 1rem;
}
.quality-check h4 {
font-size: 0.82rem;
font-weight: 600;
color: var(--color-fg-primary);
margin-bottom: 0.4rem;
}
.quality-count {
font-family: var(--font-mono);
font-weight: 400;
font-size: 0.72rem;
color: var(--color-status-negative);
}
.quality-check summary {
cursor: pointer;
font-size: 0.78rem;
color: var(--color-fg-secondary);
padding: 0.4rem 0;
}
.quality-failure {
display: grid;
grid-template-columns: minmax(10rem, 2fr) minmax(10rem, 2fr) auto;
gap: 0.25rem 1rem;
padding: 0.45rem 0;
border-bottom: 1px solid var(--color-border-subtle);
font-size: 0.8rem;
}
.quality-row {
color: var(--color-fg-primary);
overflow-wrap: anywhere;
}
.quality-problem {
color: var(--color-fg-tertiary);
overflow-wrap: anywhere;
}
.quality-links {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
white-space: nowrap;
}
.quality-links a {
color: var(--color-accent);
text-decoration: underline;
text-underline-offset: 0.2em;
min-height: 1.5rem;
}
@media (max-width: 760px) {
.quality-failure {
grid-template-columns: 1fr;
}
}
/* Dossier completeness: the country name is the row's tap target. */
.quality-dossier .fresh-name {
display: flex;
align-items: center;
min-height: var(--size-target);
}
@media (max-width: 760px) {
/* Box names are longer than the score criteria; let the label wrap. */
.quality-dossier td {
white-space: normal;
}
}