SafetyGraphics / hep-explorer

Interactive Graphic for Exploring Liver Function Data in Clinical Trials
https://safetygraphics.github.io/hep-explorer/test/
MIT License
10 stars 3 forks source link

Show values by visit (with option for animation) #227

Closed jwildfire closed 4 years ago

jwildfire commented 5 years ago

Add a new setting that toggles between "Maximum value" and "Values by Visit". If values by visit is clicked, create a set of custom marks using drawVisitPath(). Idea is that all of the points will move in unison (gapminder-style) to show how the distribution of the lab values changed over the course of the study. There is of course a very relevant Mike Bostock example that should help a lot with the nitty gritty.

A few changes are needed though. First, We need to have the animations sync by study day, so i think we need to create a one record per person per study day data set that shows the most recent lab values. (although now I'm seeing Bostock uses linear interpolation ... so maybe we could just do that and stick with the raw data ...) Then we also need to figure out the best way to let the user control the animation so that they can manually change to any point in the study. Bostock uses mouseover, but I think a slider is probably better here since we already have so many event listeners on the chart elements.

Long story short, we need a onResize/drawVisitData() method that detects when the toggle is set to "Values by Visit" and draws the lines, hides the maximum value points, and sets up interactivity.

cc: @samussiah

jwildfire commented 5 years ago

Think I can get the core of this in place by adding 1 new settings and a filter on study day.

  1. plotMaxValues (default = true): This indicates that maximal values should be plotted, and the study day control should be hidden. User gets a toggle between "Show Max Values" and "Show Visit Data"
  2. Custom Study Day filter: This is a filter that will show the data on a given study day. Very likely to be implemented as a slider with some animation.
jwildfire commented 4 years ago

Here's a gif: edishAnimated