Could geom_*_interactive support trailing comma's?
davidhodge931 opened this issue · comments
Great package!
It'd be nice, if the geom_*_interactive functions could be okay with trailing comma's. This is because making a plot is so iterative, you never know when you are finished adding arguments - and it makes it easier to incrementally add arguments if you can always finish each argument with a comma.
You might be able to do this by replacing any list calls in the functions with rlang::list2
library(tidyverse)
library(ggiraph)
#you can do this
diamonds |>
ggplot() +
geom_bar_interactive(
mapping = aes(x = color)
)
#I would like this code with a trailing comma on the end to work
diamonds |>
ggplot() +
geom_bar_interactive(
mapping = aes(x = color),
)
#> Error in layer_interactive(geom_bar, ...): argument is missing, with no default
Created on 2024-01-15 with reprex v2.1.0
Implemented thanks to @lgaborini