Skip to content

Commit

Permalink
esquisse server: return ggobj
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Jan 29, 2025
1 parent 6c011c0 commit 2f39b0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions R/esquisse-server.R
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ esquisse_server <- function(id,
output_module <- reactiveValues(code_plot = NULL, code_filters = NULL, data = NULL)
observeEvent(ggplotCall$code, {
output_module$code_plot <- ggplotCall$code
output_module$ggobj <- ggplotCall$ggobj$plot
}, ignoreInit = TRUE)
observeEvent(controls_rv$data, {
output_module$code_filters <- controls_rv$code
Expand Down
9 changes: 5 additions & 4 deletions R/esquisse-ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
#' @param downloads Export options available or `NULL` for no export. See [downloads_labels()].
#' @param n_geoms Number of geoms the user can use.
#'
#' @return A `reactiveValues` with 3 slots :
#' * **code_plot** : code to generate plot.
#' * **code_filters** : a list of length two with code to reproduce filters.
#' * **data** : `data.frame` used in plot (with filters applied).
#' @return A `reactiveValues` with 4 slots :
#' * **ggobj**: the ggplot object
#' * **code_plot**: code to generate plot.
#' * **code_filters**: a list of length two with code to reproduce filters.
#' * **data**: `data.frame` used in plot (with filters applied).
#'
#'
#' @export
Expand Down
9 changes: 5 additions & 4 deletions man/esquisse-module.Rd

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

0 comments on commit 2f39b0d

Please sign in to comment.