grantmcdermott / grantmcdermott/tinyplot
Support direct labels for `type_barplot` & co.?
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 427
- Forks
- 25
- Avg merge
- 22h 54m
- Merged PRs (30d)
- 28
Description
Follow up from #469:
I wonder if we shouldn't support a
type_barplot(label = TRUE)argument that would add these labels directly?
Apart from requiring less typing than the current, manual plt_add(type = "text", ...) approach, this would also be easier to integrate with dodged barplots where beside = TRUE. At least, in principle.
But also see @zeileis's reply:
Yes, maybe. Although one argument wouldn't be enough, would it? We would need to decide whether we want to display
- absolute and/or (conditional) relative frequencies
- ...or use some other formatter, e.g., for adding custom prefixes, suffixes, rounding, etc. (especially for other aggregation
FUNctions)- at the top or bottom or center of the box
- whether to
adjust or modify theposition- what
cexorcolto use for the text (or possibly other font properties)- ...
In short, this is not so trivial, unfortunately.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue #469 and the existing type_barplot interface, including how plt_add(type = "text", ...) is currently used with beside = TRUE. Before implementation, define the label data and formatter options, placement, adjustment, and text styling; done means those API decisions are documented and the resulting behavior is covered for the relevant barplot cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100