Fix traffic light plot rendering for single-study reviews with many domains#167
Fix traffic light plot rendering for single-study reviews with many domains#167Copilot wants to merge 4 commits into
Conversation
… y-axis limits When scale_y_continuous(limits = c(1, 1)) was combined with facet_grid(space = "free"), the zero y-range caused the single panel to receive zero height for a 1-study dataset, making all data points invisible. Changing to c(0.5, 1.5) ensures a non-zero range so space="free" correctly allocates positive panel height for any number of studies. Agent-Logs-Url: https://github.com/mcguinlu/robvis/sessions/b156e993-19e3-46bd-a3b7-e5cb7337bcd0 Co-authored-by: mcguinlu <41202585+mcguinlu@users.noreply.github.com>
|
@copilot I actually think the issue here is that the data uploaded in the issue has >20 domains, which means that the legends is very large and so the actual plot is squished by the autosizing function. Can you take a look and see if I am right, and if so, add some code to handle very large numbers of domains? |
The caption lists every domain name on its own line. For 21+ domains this can exceed the fixed 200px/2.5in base overhead, leaving no vertical space for the actual data circles. Add max(0, ncols-9)*14px (screen) / *0.15in (file) per extra domain column in nrowspx, nrowsin (app.R) and get_height (helpers.R). Agent-Logs-Url: https://github.com/mcguinlu/robvis/sessions/bb9d4318-a9a3-4cc3-ba00-78235bba2da3 Co-authored-by: mcguinlu <41202585+mcguinlu@users.noreply.github.com>
You're right — with 21+ domains the caption (which lists every domain by name, one per line) exceeds the fixed Fixed in commit
The baseline of 9 columns and 0.15 in/14 px per extra domain are kept consistent across all three locations and commented with the pixel↔inch relationship. |
|
@copilot - this seems to be working now for the in-app version, but the downloaded version of the image is still squashed (no data circles) |
nrowsin was defined (and updated to include per-domain height adjustment) but was never passed to rob_save(). The download handler was relying solely on rob_object$rec_height. Now passes height = nrowsin() explicitly so the domain-count-aware height is applied when saving the downloaded plot. Agent-Logs-Url: https://github.com/mcguinlu/robvis/sessions/ba4a35e8-c33c-40af-a228-56524664a5bf Co-authored-by: mcguinlu <41202585+mcguinlu@users.noreply.github.com>
Found it — Fixed in commit |
facet_grid(space = "free")+ degenerate y-axislimits = c(1, 1)→ zero-height panels for single-study plotsscale_y_continuouslimits fromc(1, 1)toc(0.5, 1.5)intheme_rob_tf(R/helpers.R)get_height(R/helpers.R) to addmax(0, ncol(data) - 9) * 0.15 inper extra domain for Generic/ROB1nrowspx(app.R) to addmax(0, ncol(trafficdf) - 9) * 14 pxper extra domain for on-screen displaynrowsin(app.R) to add same proportional adjustment for download heightnrowsin()into thedownloadtrafficlightplothandler — it was computed but never passed torob_save(), so the download was still using the old unpaddedrec_height