mcguinlu / robvis

A package to quickly visualise risk-of-bias assessment results
https://mcguinlu.github.io/robvis/
Other
58 stars 22 forks source link

Refactor plotting code #103

Closed mcguinlu closed 3 years ago

mcguinlu commented 3 years ago

A lot of the plotting code for each template is repeated - this could definitely be brought out into its own function, which would make debugging a lot easier too! There are some additionl factors to address when doing this:

Legend key size

I think it would be worthwhile to take a second look at how the legend keys are produced. At present, because having the key size reflect the actually point size in rob_traffic_light() would make them way too big, I plot a smaller version of each point which is used for the legend and then overlay this with the proper traffic light points so it is hidden. The lines below create this hidden legend point for the ROB2 template:

https://github.com/mcguinlu/robvis/blob/64b66dfd80271ab03ad48190ec881d01c61f8fb7/R/rob_traffic_light.R#L149-L153

I recently discovered that this could be better managed with the keywidth and keyheight arguments of guide_legend().

Text size

At present, there is no control over text size in the resulting plot. Users have previously requested this functionality:

Most stuff with this plot is fine, but the key is way too small, and I can't seem to increase the font of the key.


@AJFOWLER, as you flagged this before in #97, this is yours if you want it! However, I've also tagged you in #102, which might be a bit more interesting for you.

AJFOWLER commented 3 years ago

I'm going to be very busy over next couple of months with covid response but will try to get some done as I go.

Should I branch from master or is there a dev version?

mcguinlu commented 3 years ago

Absolutely no problem - just wanted to make you aware of it as it was your suggestion!

I might try and address this myself over the coming weeks, as part of a larger overhaul of the underlying code. But very happy to have further input from you on any of the (many) other issues for this project if you have time in the future!

mcguinlu commented 3 years ago

Notes to future Luke: