Closed mcguinlu closed 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?
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!
Notes to future Luke:
Did not change to using guide_legend()
. May at some point in the future, but current system works well, and other things should take priority.
Considered allowing users to specify text size as part of "Generic" template. This was almost implemented in #107. However, this messed with a lot of the auto-sizing, and started to venture close to just building the plot from scratch in ggplot2
. In the end, I decided that robvis
is an opiniated framework for producing these plots, and so have not implemented this functionality.
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
andkeyheight
arguments ofguide_legend()
.Text size
At present, there is no control over text size in the resulting plot. Users have previously requested this functionality:
@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.