components
tit.reporting.html.components ¶
Report design system: page shell, components, SVG charts and the QC-check record.
One module and one stylesheet (report.css) for every TI-Toolbox report built on it
(ARCHITECTURE.md §14). A page makes no network request: CSS, the widget script below, the IBM
Plex fonts (fonts/, embedded once) and every image are inline, which is what the in-app
iframe CSP (tit/server/routes/files.py::REPORT_CSP) allows. No template engine, no library.
A pipeline reports QC as :class:Check rows whose role comes from tit.reporting.qc_rules:
gate and internal rows block the output, advisory rows warn, report rows show a value
against a reference. A blocking row's status must come from the pipeline's own failure list
(:func:gate_status), so a table can never disagree with the verdict.
Cites ¶
Check
dataclass
¶
Check(id: str, label: str, description: str, shown: str, threshold: str, status: str, role: str = 'gate', value: float | None = None, rail: tuple[float, float, float, float] | None = None, cite: tuple[str, ...] | list[str] = (), note: str = '')
One QC row: what was measured, against which rule, why, and whether it passed.
role is the rule's role (gate, internal, advisory, report); description is
its plain-text sentence (backticks mark code), cite its DOIs and note where the value is
TI-Toolbox's own. rail is (lo, hi, ok_lo, ok_hi) for the gate rail, or None.
inline ¶
Escape plain text for HTML; backticks become <code>. For text stored in QC records.
img ¶
An inline image. alt is required: every report image says what it shows.
Source code in tit/reporting/html/components.py
status ¶
Status as icon + word, never colour alone.
Source code in tit/reporting/html/components.py
page ¶
page(*, title: str, kind: str, subject: str, toc: list[tuple[str, str, str | None]], body: str, footer: str = '', description: str = '', generator: str = 'TI-Toolbox', extra_css: str = '') -> str
The whole document. toc rows are (anchor, label, status kind or None).
Source code in tit/reporting/html/components.py
masthead ¶
Title block with a definition list of facts; meta values are trusted HTML.
Source code in tit/reporting/html/components.py
figure ¶
figure(num: int, title: str, content: str, caption: str, controls: str = '', cls: str = '', attrs: str = '') -> str
A numbered figure; every figure has a caption that says what good looks like.
Source code in tit/reporting/html/components.py
label ¶
A small label positioned over a lightbox image (style is CSS for its position).
tile_labels ¶
tile_labels(labels: list[str], cols: int, tile: tuple[int, int], shape: tuple[int, int], gap: int = 4) -> str
Labels at the top-left of each mosaic tile, placed in percent of the mosaic.
Source code in tit/reporting/html/components.py
flicker ¶
Two stacked images of one view on the dark imaging surround; the page flickers between them.
Source code in tit/reporting/html/components.py
segmented ¶
A row of toggle buttons: attr="data-mode" drives a flicker, "data-tab" panel tabs.
Source code in tit/reporting/html/components.py
scrubber ¶
scrubber(num: int, frames: list[bytes], labels: list[str], start: int, alt: str, extra: str = '') -> str
One image and a slider; the frames live in a JSON block and are swapped by the page script.
Source code in tit/reporting/html/components.py
table ¶
table(head: list[str], rows: list[list[str | tuple[str, float]]], caption: str = '', right: set[int] = frozenset(), cls: str = '', sortable: bool = False) -> str
A data table; cells are trusted HTML. Columns in right are right-aligned and tabular.
sortable makes every header sort the rows (click or Enter); a cell given as
(html, value) sorts by value instead of its text.
Source code in tit/reporting/html/components.py
stats ¶
The key-number strip: (label, value HTML, note) per tile.
Source code in tit/reporting/html/components.py
verdict_section ¶
The first section: seal, headline, lede (trusted HTML) and whatever follows (extra).
Source code in tit/reporting/html/components.py
kv ¶
A definition list; values are trusted HTML.
references ¶
Reference list from tit.reporting.references entries (label, citation, doi).
Source code in tit/reporting/html/components.py
hist_chart ¶
hist_chart(series: list[dict], bins: list[float], *, xlabel: str, band: tuple[float, float, str] | None = None, xlim: tuple[float, float] | None = None) -> str
Density outlines (step lines + 10 % wash) with one hover band per bin.
series: {label, values (fraction per bin), var ('--s1' ...)}; band: (lo, hi, label).
Source code in tit/reporting/html/components.py
legend ¶
Inline key: (label, css var).
Source code in tit/reporting/html/components.py
gate_scale ¶
The gate rail: track, accepted range, threshold ticks and the value dot, clamped to the track.
Source code in tit/reporting/html/components.py
gate_status ¶
A blocking check fails if and only if the pipeline listed it in its failures.
verdict ¶
(seal kind, headline) in what the page shows: the quality gate, the failed checks by name,
and how many advisories need attention. Software checks are named only when one failed.
Source code in tit/reporting/html/components.py
checks_table ¶
Status, name with its role badge, plain-text rule and citations, value, rule and (for gates) the rail.
cite turns a row's DOIs into citation links (the caller owns the reference list).