Skip to content

safety.viz v1.0.0

Choose a tag to compare

@obotclaw obotclaw released this 12 Jul 02:31
dd58d69

safety.viz is a charting library for monitoring clinical trial safety. Point any of its six interactive charts at your study data and review it in the browser: filter, group, zoom, and click through from a pattern on the screen to the participant records behind it. It's an agent-assisted update of the safetyGraphics interactive renderers.

▶ Try every chart live: https://jwildfire.github.io/safety.viz/

The charts

Chart What it shows
Safety Histogram Distribution of any lab or vital-sign measure, with normal-range overlay, treatment-group small multiples, and a linked participant listing
Safety Outlier Explorer Every participant's results over time as one line each, against the population — click a line to isolate a participant
Safety Results Over Time Population distribution of a measure at each visit as box-and-whisker marks, with grouping and outlier flags
Safety Shift Plot Baseline vs. comparison-visit values on a scatter — who moved, and which direction
Safety Delta-Delta Paired change-from-baseline for two measures on one scatter (e.g. ALT change vs. AST change)
Adverse Event Timelines Each participant's AEs as timelines colored by severity, serious events marked, with click-through detail

Every chart ships with a live demo against real example data, a generated API reference, and its own test-evidence report.

Using it

Vendor the committed bundle — no build step, no npm install:

<script src="dist/safety.viz-1.0.0/safety.viz.js"></script>
<script>
  SafetyViz.histogram('#container', {
    value_col: 'STRESN',
    measure_col: 'TEST',
    filters: [{ value_col: 'ARM', label: 'Treatment Group' }]
  }).init(rows); // rows: array of records, e.g. parsed from an ADaM BDS extract
</script>

An ESM build (safety.viz.esm.js) is committed alongside. Each chart declares its expected columns in a JSON-Schema data contract and validates its inputs on init — malformed rows are removed and counted, not silently plotted. Defaults follow ADaM-style column names (USUBJID, TEST, STRESN, VISIT…) and every mapping is a setting.

Using R? gsm.safety wraps this same bundle as Widget_* htmlwidgets — the histogram widget is next on its roadmap.

Why you can trust it

These are not new chart designs: each one re-implements an interactive display built by Rho, Inc. and used in practice under the safetyGraphics project (full credits). The port is held to that standard — every chart traces to a reviewed requirement matrix from the original's documentation, with 249 unit tests and 94 browser tests keyed to requirement IDs and published as audit-style evidence reports. The histogram's binning was additionally cross-validated against the original renderer's source, 420/420 matching results across all six binning algorithms.

What's next

v1.1 lines up a refreshed README, richer example data, and the hardening backlog (#32, #33). The three remaining safetyGraphics renderers — Paneled Outlier Explorer, Adverse Event Explorer, Web Codebook — each already have a reviewed requirement matrix waiting.

Requirements delivered: obot.roadmap#1 (safety.viz consolidated library), obot.roadmap#21 (documentation site).


This release was drafted by Claude Code using Fable 5 and reviewed by @jwildfire