Skip to content

Commit

Permalink
fix geom args (histogram)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Apr 19, 2024
1 parent fbf0149 commit ed84bc8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: esquisse
Type: Package
Title: Explore and Visualize Your Data Interactively
Version: 1.2.0.9000
Version: 1.2.0.9100
Authors@R: c(person("Fanny", "Meyer", role = c("aut")),
person("Victor", "Perrier", email = "[email protected]", role = c("aut", "cre")),
person("Ian", "Carroll", comment = "Faceting support", role = "ctb"),
Expand Down
8 changes: 8 additions & 0 deletions R/geometries.R
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,16 @@ match_geom_args <- function(geom,
geom_args <- c(geom_args, stat_args)
}
}
# browser()
if (isTRUE(add_aes)) {
GeomFun <- paste0("Geom", capitalize(gsub("geom_", "", geom)))
GeomFun <- try(get(GeomFun, envir = pkg_envir), silent = TRUE)
if (inherits(GeomFun, "try-error")) {
GeomFun <- try({
fun <- get(geom, envir = pkg_envir)
fun()$geom
}, silent = TRUE)
}
if (inherits(GeomFun, "try-error") & !is.null(geom_args$geom)) {
GeomFun <- paste0("Geom", capitalize(geom_args$geom))
GeomFun <- try(get(GeomFun, envir = pkg_envir), silent = TRUE)
Expand All @@ -246,6 +253,7 @@ match_geom_args <- function(geom,
geom_args <- c(geom_args, setNames(aes_args, aes_args))
}
}
# browser()
args <- args[names(args) %in% setdiff(names(geom_args), exclude_args)]
if (isTRUE(add_mapping) & length(mapping) > 0)
args <- c(list(expr(aes(!!!syms2(mapping)))), args)
Expand Down
3 changes: 2 additions & 1 deletion R/module-controls-geoms.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ controls_geoms_server <- function(id,
span = if (!identical(input$span, 0.75)) input$span,
level = if (!identical(input$level, 0.95)) input$level,
method = if (!identical(input$method, "loess")) input$method,
se = input$se
se = input$se,
bins = input$bins
))
})

Expand Down

0 comments on commit ed84bc8

Please sign in to comment.