qt-explorer API reference Experimental

Generated from the module's JSDoc and JSON-Schema data contract โ€” npm run docs:api fails on undocumented surface.

Overview

Every safety.viz renderer is one factory call. qtExplorer(element, settings) empties the container, renders the shared control shell, and returns a chart instance; pass data to setData (or init) and the module validates it against its data contract, structures it, and draws. Settings are merged onto the module's defaults, so callers supply only overrides โ€” column mappings follow ADaM naming out of the box. The same lifecycle (renderShellDom, init, setData, setSettings, validateAndCleanData, buildControls, postBaselineVisits, destroyCharts, render, showQtcOnlyNote, drawLegend, renderCentral, drawIchCallout, setCentralFootnote, renderOutlier, renderCategorical, resize, destroy) is shared by every module and consumed unchanged by the gsm.safety R bindings. See Architecture for how the pieces fit together.

Factory

qtExplorer([element], [settings])

Create a QT Safety Explorer bound to a target element.

ParamTypeDefaultDescription
element (optional)string | HTMLElement'body'Target selector or element.
settings (optional)QtExplorerSettings{}Setting overrides.

Returns: SafetyQtExplorer โ€” The instance.

Methods

renderShellDom()

Build the shell + module-owned slots (legend, note, table, ICH callout). @private

init(data)

Load data and render โ€” an alias for setData keeping the two-step create-then-init call shape (QT-API-001).

ParamTypeDefaultDescription
dataArray.<Object>โ€”Long-format ECG records matching the qt-explorer data contract.

Returns: SafetyQtExplorer โ€” The instance, for chaining.

setData(data)

Replace the bound data and re-render: validate (throwing and rendering the message into the target when required columns are missing), clean, rebuild controls, and render the active view.

ParamTypeDefaultDescription
dataArray.<Object>โ€”Long-format ECG records matching the qt-explorer data contract.

Returns: SafetyQtExplorer โ€” The instance, for chaining.

setSettings(settings)

Merge setting overrides, re-normalize (same rules as the factory), rebuild controls, and re-render.

ParamTypeDefaultDescription
settingsQtExplorerSettingsโ€”Setting overrides to merge.

Returns: SafetyQtExplorer โ€” The instance, for chaining.

validateAndCleanData()

Validate + clean; resolve measures, arms, placebo, visits, and prune stale state. @private

buildControls()

Build the sidebar controls for the active view. @private

postBaselineVisits()

Post-baseline visit labels for the current measure. @private

destroyCharts()

Destroy live charts before re-rendering into the shared canvas. @private

render()

Render the active view into the shared canvas: destroy prior charts, apply the filters, and dispatch to the central-tendency, outlier, or categorical renderer.

Returns: void โ€”

showQtcOnlyNote()

Show a "select a QTc correction" note and hide chart/table (HR, QTc-only views). @private

drawLegend()

Draw the "Treatments" arm legend (color swatch per arm). @private

renderCentral()

Render the central-tendency view. @private

drawIchCallout()

ICH-E14 metric callout (mean + ฮ”ฮ” + QTc only). @private

setCentralFootnote()

Central-tendency footnote: method + mode caveats. @private

renderOutlier()

Render the outlier-scatter view. @private

renderCategorical()

Render the categorical-exceedance view. @private

resize()

Resize the live charts (e.g. after the sidebar collapses).

Returns: void โ€”

destroy()

Destroy the charts and empty the target element.

Returns: void โ€”

Settings

SettingTypeDefaultDescription
id_colstring'USUBJID'Participant identifier column; one scatter point per participant and the exceedance denominators (QT-DATA-001).
measure_colstring'TEST'Column holding the ECG parameter name; required in the data. Matched to the correction options (QT-DATA-002).
value_colstring'STRESN'Column holding the numeric analysis value; required in the data. Missing / non-numeric rows are removed with a console warning (QT-DATA-003).
baseline_colstring'BASE'Baseline-value column; required in the data โ€” the scatter x-axis and the absolute-threshold diagonals anchor to it (QT-OUT-001).
change_colstring | null'CHG'Optional source change-from-baseline column; when blank for a row, change is derived as value โˆ’ baseline (QT-DATA-004).
unit_colstring | null'STRESU'Optional unit column, appended to the parameter label.
arm_colstring'ARM'Treatment-arm column; required in the data. Drives per-arm lines, point colors, ฮ”ฮ” correction, and the exceedance columns (QT-CT-001, QT-OUT-004, QT-CAT-001).
placebo_armstring | nullnullArm treated as placebo for ฮ”ฮ” and the ICH-E14 metric; when null, /placebo/i is auto-detected (QT-CT-004).
visit_colstring'VISIT'Categorical visit column; the central-tendency x-axis and the scatter timepoint selector (QT-CT-001, QT-OUT-002).
visitn_colstring | null'VISITNUM'Optional numeric visit column ordering the visits; falls back to first-seen order.
baseline_flag_colstring | null'ABLFL'Optional 'Y'-flagged baseline-record column; excludes the baseline visit from post-baseline extremes and the change series (QT-DATA-005).
measuresArray.<string>['QTcF','QTcB','Heart Rate']Correction / parameter options offered by the Correction control (QT-CTRL-002).
qtc_measuresArray.<string>['QTcF','QTcB']Which measures are QTc corrections; absolute cut-lines/rows apply only to these (QT-OUT-003).
start_measurestring | null'QTcF'Correction selected on first render; falls back to the first available measure (QT-CTRL-002).
absolute_thresholdsArray.<number>[450,480,500]Absolute QTc cut-lines (msec) โ€” scatter diagonals + categorical absolute rows (QT-OUT-003, QT-CAT-002).
change_thresholdsArray.<number>[30,60]Change-from-baseline cut-lines (msec) โ€” scatter horizontals + categorical change rows (QT-OUT-003, QT-CAT-003).
reference_thresholdnumber10Central-tendency reference line (msec): the ICH-E14 threshold of concern (QT-CT-003).
ci_levelnumber0.9Confidence level for the CI on the mean change and the mean difference; the ICH-E14 metric reads its upper bound (QT-CT-005).
filtersArray.<(string|Object)>[]Filter controls: column names or { value_col, label } specs (QT-CTRL-003).
widthstring'100%'Widget width, carried over for the R widget bindings.
heightnumber460Chart-area height in pixels, carried over for the R widget bindings.

Data contract

safety.viz qt-explorer data contract

Long-format ECG-interval data: one record per participant per ECG parameter (QTcF / QTcB / Heart Rate) per visit (QT-DATA-001). Column names are supplied by the settings mapping. The qt-explorer reads a heart-rate-corrected QTc value, its baseline, and its change-from-baseline (taken from the change column, or derived value โˆ’ baseline) to drive three views: central-tendency change over time by arm (ฮ” / placebo-corrected ฮ”ฮ”) with a 90% CI and the ICH-E14 metric, an outlier scatter of change vs baseline with absolute (450/480/500 ms) and change (30/60 ms) cut-lines, and a categorical by-arm exceedance table. Missing / non-numeric results are removed with a reported count (QT-DATA-003).

FieldTypeRequiredDefaultDescription
dataarrayyesโ€”d3.csv()-style records; every row carries the parameter, result, baseline, participant, arm, and visit columns named in settings, one row per participant per parameter per visit.
settingsobjectyesโ€”Column mappings and rendering options; merged onto the module's DEFAULT_SETTINGS, so only overrides need to be supplied (QT-DATA-003).
settings.id_colstringnoUSUBJIDParticipant identifier column; one point per participant in the scatter and the exceedance denominators (QT-DATA-001).
settings.measure_colstringyesTESTColumn holding the ECG parameter name; required in data. Matched to the correction options (QTcF/QTcB/Heart Rate) (QT-DATA-002).
settings.value_colstringyesSTRESNColumn holding the numeric analysis value; required in data. Non-numeric results are removed with a logged count (QT-DATA-003).
settings.baseline_colstringyesBASEColumn holding the participant's baseline value; required in data โ€” the scatter's x-axis and the absolute-threshold diagonals are anchored to it (QT-OUT-001).
settings.change_colstring,nullnoCHGOptional column holding the source change-from-baseline. When absent or blank for a row, change is derived as value โˆ’ baseline (QT-DATA-004).
settings.unit_colstring,nullnoSTRESUOptional unit column, appended to the parameter label.
settings.arm_colstringyesARMTreatment-arm column; required in data. Drives the per-arm central-tendency lines, point colors, ฮ”ฮ” placebo correction, and the exceedance table columns (QT-CT-001, QT-OUT-004, QT-CAT-001).
settings.placebo_armstring,nullnoโ€”The arm treated as placebo for the ฮ”ฮ” (placebo-corrected) central-tendency mode and the ICH-E14 metric. When null, the arm whose name matches /placebo/i is auto-detected (QT-CT-004).
settings.visit_colstringnoVISITCategorical visit column; the central-tendency x-axis and the outlier-scatter timepoint selector (QT-CT-001, QT-OUT-002).
settings.visitn_colstring,nullnoVISITNUMOptional numeric visit column ordering the visits; falls back to first-seen order when absent.
settings.baseline_flag_colstring,nullnoABLFLOptional 'Y'-flagged baseline-record column; when present the baseline visit is excluded from the post-baseline extremes and the central-tendency change series (QT-DATA-005).
settings.measuresarraynoQTcF,QTcB,Heart RateThe correction / parameter options offered by the Correction control, in order (QT-CTRL-002).
settings.qtc_measuresarraynoQTcF,QTcBWhich measures are QTc corrections; the outlier scatter's absolute-threshold diagonals and the categorical absolute rows apply only to these (Heart Rate has no QTc cut-lines) (QT-OUT-003).
settings.start_measurestring,nullnoQTcFCorrection selected on first render; falls back to the first available measure (QT-CTRL-002).
settings.absolute_thresholdsarrayno450,480,500Absolute QTc cut-lines (msec) for the outlier-scatter diagonals and the categorical absolute rows (QT-OUT-003, QT-CAT-002; workflow step 3a).
settings.change_thresholdsarrayno30,60Change-from-baseline cut-lines (msec) for the outlier-scatter horizontals and the categorical change rows (QT-OUT-003, QT-CAT-003; workflow step 3b).
settings.reference_thresholdnumberno10Central-tendency reference line (msec): the ICH-E14 threshold of regulatory concern for the mean/ฮ”ฮ” change (QT-CT-003; workflow step 1a).
settings.ci_levelnumberno0.9Confidence level for the two-sided CI on the mean change and the mean difference; the ICH-E14 metric reads the upper bound of this interval (QT-CT-005).
settings.filtersarraynoโ€”Optional filter columns rendered as controls (QT-CTRL-003).