allows ... inputs in plot models

This commit is contained in:
Andreas Gammelgaard Damsbo 2026-05-29 11:47:15 +02:00
commit f2a522dcb6
No known key found for this signature in database
10 changed files with 20 additions and 15 deletions

View file

@ -1 +1 @@
hosted_version <- function()'v26.4.2-260410'
hosted_version <- function()'v26.4.2-260528'

View file

@ -39,14 +39,14 @@ plot_bar <- function(data,
sec = sec,
style = style,
max_level = max_level,
color.palette = color.palette
color.palette = color.palette,
...
)
})
wrap_plot_list(out,
title = glue::glue(i18n$t("Grouped by {get_label(data,ter)}")),
y.axis.percentage = TRUE,
...)
y.axis.percentage = TRUE)
}

View file

@ -32,11 +32,11 @@ plot_box <- function(data, pri, sec, ter = NULL,color.palette="viridis",...) {
data = .ds,
pri = pri,
sec = sec,
color.palette=color.palette
color.palette=color.palette, ...
)
})
wrap_plot_list(out,title=glue::glue(i18n$t("Grouped by {get_label(data,ter)}")),...)
wrap_plot_list(out,title=glue::glue(i18n$t("Grouped by {get_label(data,ter)}")))
}

View file

@ -131,7 +131,7 @@ plot_euler <- function(data, pri, sec, ter = NULL, seed = 2103,color.palette="vi
#' D = sample(c(TRUE, FALSE, FALSE, FALSE), 50, TRUE)
#' ) |> plot_euler_single()
#' mtcars[c("vs", "am")] |> plot_euler_single("magma")
plot_euler_single <- function(data,color.palette="viridis") {
plot_euler_single <- function(data,color.palette="viridis", ...) {
data |>
ggeulerr(shape = "circle") +

View file

@ -15,13 +15,15 @@ plot_hbars <- function(data,
pri,
sec,
ter = NULL,
color.palette = "viridis") {
color.palette = "viridis",
...) {
vertical_stacked_bars(
data = data,
score = pri,
group = sec,
strata = ter,
color.palette = color.palette
color.palette = color.palette,
...
)
}

View file

@ -15,7 +15,8 @@ plot_likert <- function(data,
pri,
sec = NULL,
ter = NULL,
color.palette = "viridis") {
color.palette = "viridis",
...) {
if (!is.null(ter)) {
ds <- split(data, data[ter])
} else {

View file

@ -95,7 +95,8 @@ plot_sankey <- function(data,
default.color = "#2986cc",
box.color = "#1E4B66",
na.color = "grey80",
missing.level = "Missing") {
missing.level = "Missing",
...) {
if (!is.null(ter)) {
ds <- split(data, data[ter])
} else {

View file

@ -8,7 +8,7 @@
#' @examples
#' mtcars |> plot_scatter(pri = "mpg", sec = "wt")
#' mtcars |> plot_scatter(pri = "mpg", sec = "wt",ter="carb")
plot_scatter <- function(data, pri, sec, ter = NULL, color.palette="viridis") {
plot_scatter <- function(data, pri, sec, ter = NULL, color.palette="viridis", ...) {
if (is.null(ter)) {
rempsyc::nice_scatter(
data = data,

View file

@ -8,7 +8,7 @@
#' @examples
#' mtcars |> plot_violin(pri = "mpg", sec = "cyl")
#' mtcars |> plot_violin(pri = "mpg", sec = "cyl", ter = "gear", color.palette="Blues")
plot_violin <- function(data, pri, sec, ter = NULL, color.palette="viridis") {
plot_violin <- function(data, pri, sec, ter = NULL, color.palette="viridis", ...) {
if (!is.null(ter)) {
ds <- split(data, data[ter])
} else {
@ -23,7 +23,8 @@ plot_violin <- function(data, pri, sec, ter = NULL, color.palette="viridis") {
group = sec,
response = pri,
xtitle = get_label(data, var = sec),
ytitle = get_label(data, var = pri)
ytitle = get_label(data, var = pri),
...
)+
scale_fill_generate(palette=color.palette)
})

View file

@ -22,7 +22,7 @@ visuals_demo_app <- function() {
)
)
server <- function(input, output, session) {
pl <- data_visuals_server("visuals", data = shiny::reactive(default_parsing(mtcars)))
pl <- data_visuals_server("visuals", data = shiny::reactive(default_parsing(mtcars)),palettes = color_choices())
}
shiny::shinyApp(ui, server)
}