Gilead-BioStats / gsm

Good Statistical Monitoring R Package
https://gilead-biostats.github.io/gsm/
Apache License 2.0
39 stars 9 forks source link

Feature: Prevent horizontal scrollbar in Flags Over Time table. #1882

Closed samussiah closed 1 week ago

samussiah commented 1 month ago

Feature Details

Display full width of table so user doens't have to scroll to the bottom to scroll to the right.

Example Code

Possible Implementation

Or freeze the first three columns and add a scroll bar at the top, but that seems difficult.

Additional Comments

image

lauramaxwell commented 1 month ago

in situations where there are a lot of periods, would it make sense to default to showing only the last 12 periods, with a toggle that allows people to show the entire history? or is it important to always have the entire history always displayed?

jonthegeek commented 1 month ago

gt's interactive mode doesn't break grouped columns anymore, so I'll bet we can leverage a lot from there. They MIGHT have horizontal pagination similar to DT, I'm not sure.

samussiah commented 1 month ago

in situations where there are a lot of periods, would it make sense to default to showing only the last 12 periods, with a toggle that allows people to show the entire history? or is it important to always have the entire history always displayed?

This would work - unlikely users will want to view more than the past year of data.

jwildfire commented 1 month ago

Agree that showing last year by default, with an option to expand is a good idea.

zdz2101 commented 3 weeks ago

@jonthegeek Do you know if gt::opt_interactive() supports column wise pagination as well? I thought it was only row-based and I'm not sure how friendly the interactive aspect plays into the Widget_FlagOverTime() JS wrapper we have too

@samussiah I'd love to give it a try but if I had to guess, do we need an additional JS script that supports this toggle functionality that gets called in such as addGroupSubsetLongitudinal(el) and addGroupSubsetLongitudinalListener(el) are also already in the script?

samussiah commented 2 weeks ago

@zdz2101 with a default subset of the 12 most recent snapshots we can hopefully avoid custom .js and just handle this on the data side.

jonthegeek commented 2 weeks ago

@jonthegeek Do you know if gt::opt_interactive() supports column wise pagination as well? I thought it was only row-based and I'm not sure how friendly the interactive aspect plays into the Widget_FlagOverTime() JS wrapper we have too

It doesn't looks like reactable::reactable() support column-pagination, so it'd be a pain to add to gt. Definitely doesn't seem worth it!