You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do we want to annotate the data frame, or the plots? I think the latter.
I would argue against adding additional arguments where possible as it starts to bloat the api and makes it harder for a new user to get orientated.
That said, for ggplot objects, you could simply call p + annotate(...). But this won't work for plotly (#126/#176) though. Not sure what the plotly equivalent would be, but we could figure that out and add into a vignette how to annotate.
Or, we could add an argument to the plot functions that takes a data frame containing the dates of interventions (+ facet columns?) and draws these for you.
I would more be in favour of using a more manual approach for one key reason: how do you make the code generic enough to handle any type of annotation that the user might want to add in? (thinking what happens if they want to label a point, or label a line, or dodge multiple labels so text doesn't overlap). I feel like that is something that if you want to do it, manually use annotate or other ggplot constructs (e.g. geom_text_repel from {ggrepel})
Yes, annotating the plots was the original question. Along these lines (from the excel tool):
I agree it's difficult to do in a generic way. I like the dataframe read with dates and comments, but how to manage positioning to avoid overlapping adjacent comments or points, etc.
It is almost out of scope (given that it's possible manually from the ggplot object). We handle this differently in the reporting in our trust, by including a text description of rebase or change points alongside and separate to the charts. Still automated, but not included in the chart itself.
Based on a question in slack:
How do you annotate 2 or more points in the charts (let's say 2 QI interventions)?
Potential for an "annotations" argument, which would be a list of dates and annotation comments.
The text was updated successfully, but these errors were encountered: