The demo data and the charts will carry both visit and study day. Every chart that shows change over time gets the same control to switch between them, as the original safetyGraphics outlier explorer did. Clinicians then only need to choose which view each chart opens on.
The proposed default is our starting point. The clinicians' one question is whether each default is right.
| Chart | Toggle | Proposed default | What switches |
|---|---|---|---|
| Participant profile, on its own | Yes | Visit | The labs, vitals and ECG lines, the axis title and the tooltips. The adverse-event track shows only in Study day view. |
| Participant profile as the side panel, in the histogram, outlier explorer, shift plot, delta-delta, hep-explorer, QT explorer, AE explorer and AE timelines | Yes | Opens on the host chart's current view. For hosts with no toggle, Visit, except Study day beside the AE explorer and AE timelines, whose panels show adverse events only | As above. The panel has its own toggle, so switching it doesn't change the host chart. |
| Outlier explorer | Yes | Visit | The main x-axis. The toggle is already built (time_cols, as in the original chart); the gallery and demo app don't turn it on yet, so it shows a measurement sequence today. That sequence axis goes: with neither column the chart shows a message. |
| hep-explorer | Yes | Study day | The time slider and animation step by visit or by day. The listing shows both columns. The 30-day timing test always uses study days and says "not evaluated" when there are none. |
| QT explorer (its profile drill-down) | Yes | Visit | Several ECGs on one day separate in Visit view and stack in Study day view. |
| nep-explorer (the Phase 2 profile drill-down) | Later | Visit | The drill-down isn't built yet; it takes the toggle when it is. The scatter's tooltip shows both now. |
| Results over time | Visit only | – | Box plots need groups, so it stays by visit. Its tooltip gains the median study day for each visit. |
| Shift plot, delta-delta | Visit only | – | No time axis: they compare two chosen visits. Their listings show both columns. |
| hep-waterfall, histogram | None | – | No time axis. The waterfall listing shows both columns; the histogram reaches time only through its side panel. |
| AE timelines, time to event, Patient Journey | Study day only | – | Adverse events and time to event have no visits. The Patient Journey lines everything up on one day axis, and its lab tooltips show the visit. |
Visits are evenly spaced in visit-number order, with tick labels from the visit name. Unscheduled visits sit right after the visit they follow.
A linear axis in days. Pre-dose records have negative days, day 1 is the first dose, and there is no day 0 (CDISC). Baseline records are marked.
The axis title is "Visit" or "Study day", never one over the other's data. Tooltips show both: Week 8 · Day 57.
With no study day, the Study day option greys out and says "No study day in this data". With no visit, the Visit option does the same. With neither, the participant profile and the outlier explorer show a message instead of a chart.
The profile opens on the host chart's current view and keeps its own toggle after that.
Checks measured in days, like hep-explorer's 30-day timing, always use study days, whatever the view. Without study days they say "not evaluated" and why.
In the demo app, each chart remembers the last view while the page is open. In R, the widget takes the same default.
Every chart takes the same settings, so the gsm.safety widgets and the demo app pass the same thing. The host names each column and gives its label beside it.
x_axis: {
options: [
{ key: "visit", col: "VISITNUM", label_col: "VISIT", type: "ordinal", title: "Visit" },
{ key: "day", col: "DY", type: "linear", title: "Study day" }
],
default: "visit" // per chart; the one thing clinicians choose
}
Labs, vitals and ECGs carry VISIT, VISITNUM and DY (from ADY), plus ABLFL. Adverse events keep ASTDY and AENDY.
Today labs number Week 26 as 13 while vitals use 26, and Screening sorts after Baseline. The demo data, the synthetic cohorts and gsm.safety's bundled data move to one numbering.
The source ADaM data already has ADY, and the Patient Journey extract already maps it. The demo build keeps it for every domain.
Questions 1, 5 and 6 are answered by having both views. Question 2 is a rule: day-based checks need days.
The data, the toggle, hep-explorer's timing, gsm.safety. The toggle stays one requirement, about five days of work.
Visit and study day on every record, and a toggle between them on charts that show change over time.
The participant profile and the outlier explorer show a message instead of a chart. No "Measurement" axis.
The shared baseline rule reads the dataset's baseline flag, as a third task in the data requirement.
studyday_col, visit_col, visitn_col and time_cols keep working as shorthand when x_axis is not given.
The histogram, outlier explorer, shift plot and delta-delta default the day option to DY; noted in the release notes.
scripts/build-demo-data.mjs keeps ADY as DY and ABLFL on labs, vital signs and ECGs; the three synthetic cohorts get DY from their schedule; one visit numbering (Baseline 0, Week N = N, Screening negative, unscheduled 0.1 after the visit it follows); pje-lb.csv gains the visit. deriveBaseline in src/hep-core/rows.js reads baseline_col.
src/x-axis.js, beside src/axis-limits.js: normalises x_axis, resolves each option against the data, gives an unavailable option its reason, picks the default, and builds x_axis from the old settings. The control renders through the shell's controls, labelled "X-axis".
structureData.js gives each point an x for each view; spaghetti.js, inset.js and measureTable.js read the active view; aeTracks.js draws the track in Study day view only and lists the events otherwise; a day-1 line in Study day view.
The eight hosts forward x_axis and their current view through profileSettings(). The QT drill-down stops passing the visit number as a study day. The outlier explorer's "Plot by" control becomes the shared control.
animation.js and views/scatter.js step the slider by visit or by day; structureData.js runs the timing test on study days only and marks it not evaluated otherwise.
The app's chart recipes pass x_axis and drop the "visit order" fallback. The gsm.safety widgets pass lSettings through unchanged, so x_axis needs no R code; examples, report workflows and tests follow the vendored v1.12.0.
| Order | Requirement | Files | Size |
|---|---|---|---|
| 1 | Both visit and study day in the demo data | scripts/build-demo-data.mjs, scripts/demo-data-lib.mjs, the three cohort scripts, site/demo/*.js, site/data/*.csv, scripts/check-demo-data.mjs, src/hep-core/rows.js | 2 to 3 days |
| 2 | One x-axis toggle | src/x-axis.js (new), src/participant-profile/*, src/profile-host.js, the eight hosts and their configure.js and schemas, src/outlier-explorer/*, src/qt-explorer.js, src/results-over-time/getPlugins.js, src/app/charts.js, requirements/*.md | about 5 days |
| 3 | hep-explorer's slider and timing | src/hep-explorer/{animation,structureData,getPlugins}.js, views/scatter.js, src/hep-explorer.js, src/hep-waterfall.js | 2 days |
| 4 | gsm.safety takes the toggle | the vendored bundle and inst/extdata/, R/Widget_*.R docs and examples, five 4_modules/*.yaml, their tests | 1 day |