safety.viz
safety.viz is a charting library for monitoring clinical trial safety. It's an agent-assisted update of the safetyGraphics framework.
Available renderers 13 of 15 migrated

Safety Histogram
Distribution of a chosen lab or vital-sign measure with filters, grouping, normal-range overlay, and a linked participant listing.

Safety Outlier Explorer
Participant-level results over time: one line per participant for the selected measure against a population normal-range band, with filters, x-axis and y-limit controls, color-by grouping, and click-to-select participant detail.

Safety Results Over Time
Population-level distribution of a measure at each study visit as box-and-whisker marks, with grouping, an outlier overlay, and linear/log y-axis controls.

Safety Shift Plot
Baseline versus comparison-visit values for a measure on a scatter with an identity line, measure and visit controls, filters, and a brush selection that opens a linked participant listing.

Safety Delta-Delta
Paired change-from-baseline comparison of two measures on one scatter — quadrant reference lines, an optional regression line, measure and visit pickers, and a linked per-measure detail table with sparklines.

Hepatic Safety Explorer
eDISH scatter of peak ALT vs peak total bilirubin (×ULN) with Hy's-Law quadrant cut-lines, a quadrant summary table, eDISH/mDISH display modes, R-Ratio and timing controls, and click-to-inspect participant visit paths — plus a baseline-referenced composite plot (Tesfaldet et al., Drug Safety 2024) for subjects with abnormal baseline liver tests, with pretreatment/on-treatment eDISH panels, a four-panel ×Baseline shift plot, and a migration table.

Hepatic ALT Waterfall Prototype
For trials that enrol participants with elevated baseline ALT but normal baseline bilirubin, where eDISH's ×ULN quadrants lose their meaning — a floating bar per participant from their own baseline ALT to their maximum on-treatment ALT in absolute U/L, ranked by baseline so the two arms' highest baselines meet at the seam, blue for placebo and bronze for active drug with new-onset jaundice in green, flanked by a box-and-whisker summary per arm (Amirzadegan et al., Drug Safety 2025, Figure 5).

Participant Profile Experimental
The standardized-lab participant drill-down as a chart-agnostic module: a demographics header with R Ratio and a templated record link-out, a labs-over-time spaghetti with reference cut-lines, and a per-measure summary table with sparklines that expand to an inset chart — stepping worst-first through a multi-participant cohort in a rail beside the Hepatic Safety Explorer, or mounted standalone against any chart that dispatches participantsSelected.

Nephrotoxicity Explorer Experimental
KDIGO acute-kidney-injury screening: one point per participant at their maximum post-baseline fold change in serum creatinine against their maximum absolute change, over the L-shaped KDIGO stage zones, with a distinct mark for the ≥ 4.0 mg/dL Stage-3 rule, per-record mg/dL unit resolution, counted and exportable dropped records, and a stage summary table counting the population by fold change, by absolute change, and by the combined stage.

Time-to-Event Explorer Experimental
Kaplan–Meier time-to-event display: step curves by treatment group with censoring tick marks, pointwise 95% confidence bands (Greenwood, log-log — matching survival::survfit), and the at-risk / cumulative-events strip table beneath the time axis, all derived from one estimator pass so the table cannot disagree with the curve. The endpoint is composed live from flexible multiselect filters over the event data — time to first qualifying event, censored at end of follow-up — with cumulative-incidence orientation by default and the estimator named on the axis.

Adverse Event Explorer
Hierarchical adverse-event incidence table — System Organ Class rows expandable to Preferred Terms — with per-arm rates, an inline rate dot plot, group-difference confidence intervals, prevalence/search/characteristic filters, and drill-down to the underlying records.

Adverse Event Timelines
Participant-level adverse-event timelines by severity and onset relative to study start, with serious-event marks and click-through participant detail.

QT Safety Explorer Experimental
ECG QT/QTc safety review: per-arm central-tendency change over time (Δ / placebo-corrected ΔΔ) with a 90% CI band and the ICH-E14 metric, the flagship outlier scatter of change vs baseline with the 450/480/500 ms absolute diagonals and 30/60 ms change lines, and a by-arm categorical exceedance table — QTcF / QTcB corrections plus heart rate.
In the queue: Paneled Outlier Explorer · Web Codebook — each already has a reviewed requirement matrix in this repo.