Skip to content

Commit

Permalink
export geom table
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Apr 5, 2024
1 parent 41974ec commit 6dd8519
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export(match_geom_args)
export(palettePicker)
export(ph)
export(potential_geoms)
export(potential_geoms_ref)
export(render_ggplot)
export(safe_ggplot)
export(save_ggplot_modal)
Expand Down
23 changes: 18 additions & 5 deletions R/geometries.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

#' Potential geometries according to the data
#' @title Potential geometries according to the data
#'
#' @description
#' From the data and variable used in aesthetics, decide which geometry can be used and which one is used by default.
#'
#'
#' @param data A \code{data.frame}
#' @param mapping List of aesthetic mappings to use with data.
Expand All @@ -8,6 +12,8 @@
#' @return A \code{character} vector
#' @export
#'
#' @name geoms
#'
#' @examples
#'
#' library(ggplot2)
Expand Down Expand Up @@ -83,10 +89,17 @@ potential_geoms <- function(data, mapping, auto = FALSE) {




#' @export
#'
#' @rdname geoms
#' @importFrom ggplot2 geom_histogram geom_density geom_bar geom_sf
#' geom_boxplot geom_bar geom_point geom_line geom_tile geom_violin
#' geom_area geom_smooth geom_col
#'
#' @examples
#' # Reference used by esquisse to select available geoms
#' # and decide which one to use by default
#' potential_geoms_ref()
potential_geoms_ref <- function() {
x <- matrix(
data = c(
Expand Down Expand Up @@ -148,7 +161,7 @@ potential_geoms_ref <- function() {
#' @param add_mapping Add the mapping as an argument.
#' @param envir Package environment to search in.
#'
#' @return a \code{list}
#' @return a `list()`.
#' @export
#'
#' @examples
Expand Down Expand Up @@ -243,7 +256,7 @@ geomIcons <- function() {
list(inputId = x, img = sprintf(fmt = href, x), label = capitalize(x))
}
)

geomsChoicesNames <- lapply(
X = geomsChoices,
FUN = function(x) {
Expand All @@ -254,7 +267,7 @@ geomIcons <- function() {
)
}
)

list(names = geomsChoicesNames, values = geoms)
}

6 changes: 6 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ template:
bslib:
base_font: {google: "Poppins"}
primary: "#112446"
navbar-dark-color: "#FFFFFF"
secondary-color: "#DFDFDF"
navbar-dark-active-color: "#DFDFDF"

navbar:
bg: primary

navbar:
bg: primary
Expand Down
11 changes: 9 additions & 2 deletions man/potential_geoms.Rd → man/geoms.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/match_geom_args.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6dd8519

Please sign in to comment.