Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding annotations #139

Open
ThomUK opened this issue Dec 11, 2021 · 2 comments
Open

Consider adding annotations #139

ThomUK opened this issue Dec 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@ThomUK
Copy link
Collaborator

ThomUK commented Dec 11, 2021

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.

@tomjemmett
Copy link
Member

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})

@tomjemmett tomjemmett added the enhancement New feature or request label Jul 14, 2023
@ThomUK
Copy link
Collaborator Author

ThomUK commented Jul 18, 2023

Yes, annotating the plots was the original question. Along these lines (from the excel tool):
DPQiGIxX0AAt1qx~2.jpg

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants