grunwaldlab / grunwaldlab/metacoder
Thoughts on heat_tree argument formats
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 148
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
heat_tree has too many arguments for one function (>50) and there are still others I would like to add. Although this does not affect how it works, it is not great UI design. Making the arguments more modular, would give me more freedom to add things. I was thinking about different ways to split up the arguments and I came up with the following options:
Don't change
This is the easiest!
heat_tree(obj,
node_size = n_obs,
node_size_interval = c(5, 50),
node_size_range = c(0.01, 0.02),
node_size_trans = "linear",
make_node_legend = FALSE,
node_size_axis_label = "# OTUS",
layout = "fr",
initial_layout = "re",
title = "my plot",
title_size = 0.01,
output_file = "my_plot.pdf")
Imitate ggpllot2's syntax somewhat
Probably the hardest to implement, but takes the least typing for the user. Documentation would be a bit harder to find and people might confuse it with ggplot2 and try to add ggplot2 things like theme (which would sometimes work, if added to the end, making it more confusing).
heat_tree(obj) +
node_size(n_obs, interval = c(5, 50), range = c(0.01, 0.02), trans = "linear", legend = FALSE, label = "# OTUS") +
ht_layout("fr", initial = "re") +
ht_title("my_plot", size = 0.01) +
ht_output("my_plot.pdf")
Using helper functions
This would be easier to implement, and be more straight-forward to document and discover the documentation.
heat_tree(
node_size = ht_aes(n_obs, interval = c(5, 50), range = c(0.01, 0.02), trans = "linear", legend = FALSE, label = "# OTUS"),
layout = "fr",
initial_layout = "re",
title = "my plot",
title_size = 0.01,
output_file = "my_plot.pdf")
Any thoughts @grunwald, @knausb, @Neato-Nick, @grabear? Thanks!
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 reviewing the heat_tree entry point and its existing arguments, then compare the three proposed API formats in the issue. Done requires a decided modular argument design and an implementation that preserves current behavior while allowing additional options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100