Technical Documentation - SafetyGraphics/hep-explorer GitHub Wiki

Technical Documentation

This page contains various technical documentation for the library, starting with a set of Feature Tests.

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.

Chart

Feature tests for the main chart.

  • Confirm that you can drag horizontal and vertical dotted reference lines, and that the Quadrant table below the chart, the percentages in the annotations in the corners of the chart, and the Reference Line controls update according to the new placement of the chart lines
  • Confirm that hovering on a data point brings up a (1) tooltip that displays participant details (ID, Visit milestones, r ratio) and (2) small ticks on the x- and y-axis representing the participants measures at each visit. The circle shows the maximum value across all visits should be positioned accordingly relative to the ticks.
  • Confirm that clicking on a data point makes the circle bold and draws a line between one or more points, depending on how many visits the participant has completed. Each new point has it’s own tool tip with visit-level details.
  • Confirm that there is a button in the upper left corner, beside the Safety eDish header, labeled Raw Data; and that clicking the button allows you to download the dataset used for the chart
  • Confirm that boxplots summarizing the distribution of the are drawn to the top and right of the chart, and that hovering over each boxplot shows a tooltip with details.

Participant Details

Feature tests for the participant details section which appears when clicking a point in the main chart.

  • Confirm that clicking a data point in the chart opens the Participant Details for the selected participant. Three new sections should appear:
    • Participant Details – horizontal text-based list or participant characteristics
    • Standardized Lab Values by Visit – Line chart showing key measures
    • Raw Lab Values Summary Table – Table with small charts summarizing lab values
    • R Ratio by Visit - Line chart showing R Ratio values for Study Day
  • Confirm that the Standardized Lab Values by Visit chart has a Select Labs filter that is a multi-select box of labs. Confirm that all labs are selected by default and you can control click to select or deselect labs. Confirm that the chart only shows lines that correspond to the selected labs in the filter.
  • Confirm that there is a Y-axis Display Type filter that is a drop down that allows you to select between different baseline or upper limit y-axis values.
  • Confirm that hovering over a line in the Standardized Lab Values by Visit chart displays a reference line for that lab as a dotted line in the chart.
  • Confirm that each measure in the Raw Lab Values Summary Table section has a sparkline (small chart) that can be clicked on to see an expanded view.
  • Confirm that clicking the Clear button at the top of the Participant Details section closes the Participant Details view and the Quadrant table is again shown below the main chart.
  • Using example 3, confirm that an exposure timeline is shown under the "Standardized Lab Values by Visit" chart when data is provided.

Messages

Feature tests for the Messages section in the sidebar.

  • Confirm that there is a Message section at the top left of the chart, just under the header and download Raw Data button.
  • Confirm that any relevant messages, such as a Caution message about how many rows were removed from the dataset sue to missing or non-numeric data; or a general caution message against using the chart as the sole determiner for clinical recommendations.
  • Confirm that shorter summaries for each message are shown by default and that clicking the 3 white dots expands to show the whole message.
  • Confirm that links to download csv data in messages indicating that data was excluded from the chart work as expected.
  • Confirm that there is a Clear button that allows the user to clear the messages from display.

Filters

Feature tests for the filters section in the sidebar.

  • Confirm that there is a filter for R Ratio that includes minimum and maximum values along with a reset button.
    • Confirm that the range is initially set between 0 and the maximum value found in the data.
    • Confirm that increasing or decreasing the numbers in the boxes updates the chart accordingly to only display points that match the filter.
    • Confirm that the values automatically sort when entering a min value greater than the max value (or vice versa)
    • Confirm that the reset button returns the values to the default.
    • Confirm that an warning is displayed in place of the chart when no participants are selected (e.g. when setting both values greater than the default max)
  • Confirm that additional data-driven filters appear as specified, and show-hide points as expected.
  • Confirm that the participant count (“xxx of xxx participants shown”) in the Filters header updates as expected.
  • Confirm that the Filters section appears on the left side of the chart, below the Messages section

Settings

Feature tests for the settings section in the sidebar

  • Confirm that the Settings section appears on the left side of the chart, below the Filters section
  • Confirm that there is a Group setting dropdown that allows you to change the grouping variable for the chart. When changed, the legend and point color should update accordingly. When ‘None’ is selected, all points should be the same color and the legend above the chart should be removed. (can use the settings object { "group_cols": "SEX" })
  • Confirm there is a Display Type setting, to set Relative or absolute axes, using a dropdown field that allows for the selection of either “Upper limit of normal adjusted (eDish)” (this is the default) or Baseline adjusted (mDish). Changing this setting should update the chart accordingly (test using settings object { "baseline": { "value_col": "VISIT", "values": [ "Visit 1" ] } } ).
  • Confirm there is an X-axis Measure setting dropdown field that allows the selection of either ALT, AST, or ALP, with each selection updating the x-axis of the chart, as well as the data points shown in the chart.
  • Confirm there is are “[measure] Reference Line” settings where [measure] is set to one of the key variables (typically TB, ALT, AST, or ASP) depending on the current variables used for the x- and y-axes. Confirm that this field is a box with a number that can be adjusted either by changing the number in the box, or by dragging the x-axis reference dotted line in the chart itself. Changing the number in the box should shift the line in the chart to the appropriate new spot on the x-axis, dragging the line in the chart should update the number in the box to show the axis point to which you dragged the line.
  • Confirm there is a Point Size setting drop down field that allows for the selection of different measures in the chart to have a larger point radius to make them more visible. The default selection should be Uniform, with the other options being ALT, ASP, ALP, TB.
  • Confirm there is an Axis Type setting drop down field that allows you to change the chart between linear or log Axes. The default selection should be linear.
  • Confirm there is a Highlight Points Based on Timing setting number field that updates the chart’s fill points with max values less than X days apart. As you increase the setting number, you should see more points fill in in the chart. Confirm that the footnote regarding timing is shown below the main chart and that it updates when the control is changed (including good grammar for 0 and 1 days).
  • Confirm that the x-axis measure and Point Size options show the long name, not just the three letter abbreviation, (ex.: "Aminotransferase, alanine (ALT)", "Alkaline phosphatase (ALP)", etc.)
  • Confirm there is a Reset Chart button at the bottom of the Settings section that resets the chart to its default view and default Filters and Settings.
  • Confirm that all options should be shown for x and point size, but the y-axis control should be hidden by default since TB is the only option.
  • Confirm that the add_measures setting adds additional options under the x-Axis and point size controls. settings = {add_measures:true}
  • Confirm that the new "all" option works as expected for the axes and point-size controls, including for the y-axis, so that changing settings to {x_options:["ALT","ALP"],y_options:"all", point_size_options:["TB","AST"]} adds the Y-axis Measure dropdown.
  • Confirm that the new "all" options works in tandem with {add_measures:true} as well.
  • Confirm that changing the _default settings updates the default values for the given controls on initial load, and that the controls still work as expected. {settings = {x_default:"ALP",y_options:"all", y_default:"ALT", point_size_default:"rRatio"}}
  • Confirm that updating the cuts object works as expected. With the settings below, TB should have its cut point set to 2, ALP should be 4, AST should be 5 and all other measures should be 6. { "add_measures": true, "cuts": { "ALP": { "relative_baseline": 4.8, "relative_uln": 4 }, "AST": { "relative_baseline": 5.8, "relative_uln": 5 }, "defaults": { "relative_baseline": 6.8, "relative_uln": 6 } }, "baseline": { "value_col": "DY", "values": [ 1 ] } }
  • Confirm that with the same settings in place as above, when you change Display Type to mDish, then TB should have its cut point set to 4.8, ALP should be 4.8, AST should be 5.8 and all other measures should be 6.8.
  • Confirm that a single new measure can be added to the x axis and point size controls with the settings {measure_values:{ige:"IgE"}}. Adding add_measures:true to the settings should still add all measures.

Plot Style

  • Confirm that changing the plot style control shows/hides the study day slider under the chart.
  • Confirm that changing the plot style control causes the the scatter plot points to update. Using the participants details view, confirm that the point position is correct. Selecting "Max Values" should show the point using max values across all visits, while selecting "By Study Day" should show the points using the most recent values collected on or before the selected study day.
  • Confirm the study day slider defaults to the first non-negative study day in the data.
  • Confirm that clicking a different value on the study day slider changes the position of the points
  • Confirm that all controls (filters, point size, etc) and the participant profile (clicking a point) works in the expected way on the "By Study Day" view
  • Confirm that clicking the play button starts an animation from the currently selected study day until the end of the study.
  • Confirm that while the animation is running, a square stop icon is shown instead of the triangular play button.
  • Confirm that clicking the stop button stops the animation on the current day
  • Confirm that if the last study is selected on the study day slider, the play button changes to a circular "replay" arrow, and that clicking that button plays the animation from the first study day until the end of the study.
  • Confirm that any user interaction involving control changes and point clicks while the animation is running, interrupt the animation and cause it to stop on the current date.
  • Confirm that small points are shown during the animation when the study day is before or after a given participant's study enrollment (as described by the figures footnote).
  • Confirm that footnotes regarding point size and fill change appropriately when changing plot style
  • Confirm that point size changes appropriately over the course of the animation when an option other than "Uniform" is selected

R Ratio

  • 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:

    • Reference lines at 2 and 5, which should always be visible even when no R Ratio values >2 are present
    • Exact Study day and r ratio values shown on point mouseover.
  • 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: { "max_width": 600, "value_col": "LBORRES", "measure_col": "TESTNAM", "visit_col": "VISIT", "studyday_col": "STUDYDAY", "normal_col_low": "LBORRESLO", "normal_col_high": "LBORRESHI", "id_col": "SUBJID", "group_cols": [ "TRTA", "SEX" ], "filters": [ { "value_col": "TRTA", "label": "Treatment" }, { "value_col": "SEX", "label": "Sex" }, { "value_col": "SUBJID", "label": "ID" } ], "measure_values": { "ALT": "ALT (SGPT)", "AST": "AST (SGOT)", "TB": "Total Bilirubin", "ALP": "Alkaline Phosphatase" }, "baseline": { "value_col": "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.