This page contains various technical documentation for the library, starting with a set of Feature Tests.
These tests can be used to confirm that any given version of the chart is behaving as expected. The first example page or CAT can be used for testing unless otherwise noted.
Feature tests for the main chart.
Feature tests for the participant details section which appears when clicking a point in the main chart.
Feature tests for the Messages section in the sidebar.
Feature tests for the filters section in the sidebar.
Feature tests for the settings section in the sidebar
Confirm that 'rRatio' has been added as an option under points size, and that the points are sized appropriately when it is clicked.
Confirm that a new 'R Ratio by Visit' chart is visible in the participant details when the point is clicked. The chart should have the following features:
Filter to id = 5090-02 and confirm that R ratio values (shown on point mouseover) are correct for each plot type. Use the clinical-trials\renderer-specific\allQuads.csv dataset and this settings object: { "maxwidth": 600, "valuecol": "LBORRES", "measurecol": "TESTNAM", "visitcol": "VISIT", "studydaycol": "STUDYDAY", "normalcollow": "LBORRESLO", "normalcolhigh": "LBORRESHI", "idcol": "SUBJID", "groupcols": [ "TRTA", "SEX" ], "filters": [ { "valuecol": "TRTA", "label": "Treatment" }, { "valuecol": "SEX", "label": "Sex" }, { "valuecol": "SUBJID", "label": "ID" } ], "measurevalues": { "ALT": "ALT (SGPT)", "AST": "AST (SGOT)", "TB": "Total Bilirubin", "ALP": "Alkaline Phosphatase" }, "baseline": { "valuecol": "STUDYDAY", "values": [ 1 ] } }
R ratio should be calculated based on the selected study day for the "by study day" view. Using the "R Ratio by Visit" chart as a guide, confirm that the R ratio value updates when study day changes.
R ratio should be calculated using the timepoint when AST is maximized on the "max values view". This can be confirmed using id = 5090-02 in \example 2. For that participant, the summary R Ratio value (shown hovering over the point) should be 6.09 - from study day 84, when max ALT occurred. Note that this is not the maximal R Ratio, which was 9.12 from study day 14.
The Safety eDish chart is initialized with JSON data files that match the format created by d3.csv(). The chart is specifically designed for clinical trial safety monitoring, and requires a datasets that contains one row per participant per time point per measure and includes the required columns and fields specified below.
The chart expects an SDTM-esque data structure by default but also easily supports the ADaM data standard (Example : Settings, eDish Graphic). Other, non standard data can also be as long as the data is structured correctly.
Required and optional columns and fields for the SDTM and ADaM data standard are given in the tables below
Six variables are required to create an eDish plot: ID, Measure, Value, high and low normal range values and study day. Details and suggested values for ADaM and SDTM are given below.
Settings Variable | Description (type) | SDTM (Default) | ADaM | Required? |
---|---|---|---|---|
id_col | Unique Subject Identifier (char) | USUBJID | USUBJID | Y |
measure_col | Name of Measure or Test (chart) | TEST | PARAM | Y |
value_col | Result or Finding (numeric) | STRESN | AVAL | Y |
normalcolhigh | Upper Limit of Normal (numeric) | STNRHI | ANRHI | Y |
normalcollow | Lower Limit of Normal (numeric) | STNRLO | ANRLO | Y |
studyday_col | Study Day (numeric) | DY | ADY | Y |
Users may customize the chart with the additional data mappings given below. Note that these are not specified by default, and must be defined by the user. Some suggested mappings for SDTM and ADaM are provided below for reference. See the settings object here for an example of a customized chart.
Settings Variable | Description | SDTM | ADaM | Required? |
---|---|---|---|---|
visitn_col | Visit Number | VISITNUM | VISITNUM | N |
visit_col | Visit Name | VISIT | VISIT | N |
filter[].value_col | Visit-level filter(s) | SEX, RACE, etc* | N | |
details[].value_col | Person-level descriptive(s) | N | ||
groupcols[].valuecol | Grouping variable(s) | ACTARM* | TRTA | N |
baseline.value_col | Baseline Visit definition | DY | ADY | N |
analysisFlag.value_col | Analysis Visit Flag | EPOCH | ANL01FL | N |
Field level data is used for identifying key measures for the eDish plot (see settings.measure_details
) and identifying baseline visits (see settings.baseline
). Suggested values (including the default SDTM values) are shown below, but the user should note that these are very likely to change from study to study.
Usage | SDTM Column/Value (default) | ADaM Column/Field Value |
---|---|---|
Define ALT key measure | TEST / 'Aminotransferase, alanine (ALT)' | PARAM / 'Alanine Aminotransferase (U/L)' |
Define AST key measure | TEST / 'Aminotransferase, aspartate (AST)' | PARAM / 'Aspartate Aminotransferase (U/L)' |
Define TB key measure | TEST / 'Total Bilirubin' | PARAM / 'Bilirubin (umol/L)' |
Define ALP key measure | TEST / 'Alkaline phosphatase (ALP)' | PARAM / 'Alkaline Phosphatase (U/L)' |
Define Baseline visit | DY / 0 | ADY / 0 |
a factory to create a custom Webcharts chart object
returns: chart
Param | Type | Description |
---|---|---|
element | string |
CSS selector identifying the element in which to create the chart |
settings | object |
settings object specifying options for how the chart is to appear and behave. Options defined here overwrite default values; see Configuration |
The custom participantsSelected
event is dispatched to the overall chart wrapper (chart.wrap
) whenever the details for a given participant are viewed (or cleared) by clicking on a point in the chart. The event has a custom data
property holding an array with the selected ID when a new participant is selected (["123-456-7"]
) or an empty array when participant details are cleared.
The most straightforward way to customize the Safety Outlier Explorer is by using a configuration object whose properties describe the behavior and appearance of the chart. Since the safety eDish is a Webcharts chart
object, many default Webcharts settings are set in the defaultSettings.js file as described below. Refer to the Webcharts documentation for more details on these settings.
In addition to the standard Webcharts settings several custom settings not available in the base Webcharts library have been added to facilitate data mapping and other custom functionality. These custom settings are described in detail below. All defaults can be overwritten by users.
string
Unique subject identifier variable name
default: "USUBJID"
string
result variable name
default: "STRESN"
string
measure variable name
default: "TEST"
string
measure unit variable name
default: "STRESU"
string
LLN variable name
default: "STNRLO"
string
ULN variable name
default: "STNRHI"
string
Study day variable name
default: "DY"
string
Visit variable name
default: null
string
Visit number variable name
default: null
string
Exposure start day variable name. Note: setting is ignored if exposure data domain is not provided.
default: 'EXSTDY'
string
Exposure end day variable name. Note: setting is ignored if exposure data domain is not provided.
default: 'EXENDY'
string
Exposure treatment name variable name. Note: setting is ignored if exposure data domain is not provided.
default: 'EXTRT'
string
Exposure dose variable name. Note: setting is ignored if exposure data domain is not provided.
default: 'EXDOSE'
string
Exposure dose variable name. Note: setting is ignored if exposure data domain is not provided.
default: 'EXDOSU'
object
Object defining the baseline visit of the study.
string
Column containing the baseline visit data
default: "DY"
array
One or more values found in settings.baseline.value_col
indicating that the record represents the baseline visit.
default: [0]
array
an array of filter variables and associated metadata
default: none
string
Variable name
default: none
string
Variable label
default: none
boolean
If true
filters are set up to allow multiple selections.
default: true
array
an array of ID-level variables and associated metadata
default: Automatically uses values specified in settings.id_col
, settings.group_cols
and
settings.filters
string
Variable name
default: Automatically uses values specified in settings.id_col
, settings.group_cols
and
settings.filters
string
Variable label
default: Automatically uses values specified in settings.id_col
, settings.group_cols
and
settings.filters
array
an array of grouping variables and associated metadata
default: none
string
Variable name
default: none
string
Variable label
default: none
object
Flags records for use in the eDish and mDish calculations.
default: none
string
Indicates which column should be used to flag rows for inclusion eDish and mDish analysis
default: none
array
or string
Indicates which values should be used to flag rows for inclusion eDish and mDish analysis
default: none
object
Indicates whether PALT should be calculated for participants flagged using settings.paltFlag
.
default: none
object
Flags records for use in the PALT calculations. Only used if settings.calculate_palt
is true
.
default: none
string
Indicates which column should be used to flag rows for PALT analysis.
default: none
array
or string
Indicates which values should be used to flag rows for for PALT analysis.
default: none
object
An object defining the data values from measure_col
for the lab measures used in eDish evaluations.
default:
{
ALT: 'Aminotransferase, alanine (ALT)',
AST: 'Aminotransferase, aspartate (AST)',
TB: 'Total Bilirubin',
ALP: 'Alkaline phosphatase (ALP)'
},
boolean
If true
, all unique values from settings.measure_col
are automatically added to the settings.measure_values
object. Can be paired with the "all"
option for settings.x_options
, settings.y_options
and settings.point_size_options
to allow for flexible interactive axis controls using all available data. Added in v1.2.
default: false
array
or string
Specifies variable options for the x-axis using the key values from settings.measure_values
(e.g. "ALT"). When multiple options are specified, a control allowing the user to interactively change the x variable is shown. Specifying 'all'
(added in v1.2) uses all options from measure_values
.
default: 'all'
string
String indicating the starting value for the x-axis when the chart is loaded. Must be an option from the settings.x_options
array. First item in the settings.x_options
array is used if an invalid option is specified.
default: 'ALT'
array
or string
See settings.x_options
.
default: ['TB']
string
See settings.x_default
.
default: 'TB'
array
or string
See settings.x_options
. For point size, options for 'Uniform' (the default) and 'rRatio' are automatically added to the control in addition to the users selections.
default: 'all'
string
See settings.x_default
.
default: "Uniform"
array
of string
Specifies how data should be imputed for each measure specified in config.measure_values
. Valid options are:
"data-driven"
is the default and it takes 0 values and sets them to 0.5 times the minimum value for the measure across all participants/time points"user-defined"
takes all values less than config[key].imputation_value
and sets then to 0.5 times config[key].imputation_value
. (The config.imputation_value
option is ignored otherwise)"drop"
means all 0 values are dropped. default:
{
ALT: 'data-driven',
AST: 'data-driven',
TB: 'data-driven',
ALP: 'data-driven'
}
number
used as described above when config.imputation_method
is set to "user-defined"
default: none
object
Object defining default cut-points for each measure defined in config.measure_values
for each of the different types of supported eDish displays defined in config.display
. If config.measure_values
is customized to add additional key measures, then values from cuts.defaults
are used unless the user provides values using the format shown below.
default:
{
TB: {
relative_baseline: 4.8,
relative_uln: 2
},
ALP: {
relative_baseline: 3.8,
relative_uln: 1
}
}
object
Default cut values to be used when no user settings are provided. Added in v1.2.
default:
{
relative_baseline: 3.8,
relative_uln: 3
}
"string"
Defines the display type used on the eDish scatter plot on initial view. Can be changed by the user once the chart is rendered. Valid options are:
"relative_uln"
which shows the standard eDish view where values are scaled relative to the Upper Limit or Normal"relative_baseline"
which shows the mDish view where values are scaled relative to the participants baseline valueNote: Support for an "absolute"
option used to show the raw values for the measure was removed prior to the v1 release.
array
Defines nice labels for the different display options.
default:
display_options: [
{ label: 'Upper limit of normal adjusted (eDish)', value: 'relative_uln' },
{ label: 'Baseline adjusted (mDish)', value: 'relative_baseline' }
]
array
of number
Sets upper and lower percentiles used for defining outlier in the "Lab Summary Table" in the participant details section.
default: [0.01,0.99]
string
URL linking to additional charts related to population level analysis
default: none
string
URL linking to additional charts related to population level analysis. Will need an update in a future release to allow dynamic links for different participants.
default: none
number
Default visit window used to highlight eDish points where x and y measures occurred within the specified number of days. Editable by user after render.
default: 30
boolean
Specifies whether the R Ratio filter should be shown. R ratio is defined as: (ALT value/ULN for ALT) / (ALP value/ULN for ALP).
default: true
numeric
Default cut point for R Ratio filter. Ignored when r_ratio_filter
is false
. User can update this setting via the UI when r_ratio_filter
is true
.
default: 0
character
Title to be drawn above the controls. Use an empty string or NULL
if no title is desired.
default: "Hepatic Safety Explorer"
string
Informational text to be displayed near the top of the controls (beneath the title, if any). No warning is displayed if warningText
is false-y.
default: 'Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures.'
The object below contains the default Webcharts settings for the display.
x: {
column: null, //set in onPreprocess/updateAxisSettings
label: null, // set in onPreprocess/updateAxisSettings,
type: 'linear',
behavior: 'raw',
format: '.2f'
//domain: [0, null]
},
y: {
column: null, // set in onPreprocess/updateAxisSettings,
label: null, // set in onPreprocess/updateAxisSettings,
type: 'linear',
behavior: 'raw',
format: '.2f'
//domain: [0, null]
},
marks: [
{
per: [], // set in syncSettings()
type: 'circle',
summarizeY: 'mean',
summarizeX: 'mean',
attributes: { 'fill-opacity': 0 }
}
],
gridlines: 'xy',
color_by: null, //set in syncSettings
max_width: 900,
aspect: 1,
legend: { location: 'top' },
margin: { right: 25, top: 25, bottom: 75 }
Not Found |
---|