nhs-r-community / NHSRplotthedots

An SPC package to support NHSE/I 'Making Data Count' programme
https://nhs-r-community.github.io/NHSRplotthedots/
Other
47 stars 21 forks source link

Use {scales}'s built-in accuracy heuristic (instead of supplied y_axis_breaks) to set y-axis label formatting #215

Closed francisbarton closed 3 weeks ago

francisbarton commented 1 month ago

This pull request provides code that simplifies the if-else logic currently in the ptd_create_ggplot() function. It does this in two ways:

It does still allow hard-coding of accuracy = 0.1 for the secondary axis on percentage charts. Though this could also be removed in future if thought to be the right thing to do.

This PR closes issue #210 and also closes issue #211 by replacing the trans argument to sec_axis() with the new argument name transform.

There is an associated test that no longer passes with these changes. This test does not look to actually test what it says it does, however - this needs further attention perhaps.

There is also a re-formatting of the hex_logo function under inst/, but with no change in functionality. (These changes are unrelated to issues 210 or 211).

tomjemmett commented 3 weeks ago

thanks!