Skip to content

Commit

Permalink
fix: plot module crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kolomanski committed Dec 12, 2024
1 parent 829e664 commit d0ac1f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inst/shiny/modules/tlg_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ tlg_plot_server <- function(id, render_plot, options = NULL, data = NULL) {


plot_list <- reactive({
plot_options <- purrr::list_modify(list(data = data()), !!!reactiveValuesToList(opts))
plot_options <- purrr::list_modify(list(data = data()), !!!reactiveValuesToList(options_))

purrr::iwalk(plot_options, \(value, name) {
if (isTRUE(value %in% c(NULL, "", 0)))
Expand All @@ -73,11 +73,10 @@ tlg_plot_server <- function(id, render_plot, options = NULL, data = NULL) {
plot_list()[[current_page()]]
})

options <- reactiveValues()

options_ <- reactiveValues()
option_widgets <- purrr::imap(options, function(opt_def, opt_id) {
observeEvent(input[[opt_id]], {
options[[opt_id]] <- input[[opt_id]]
options_[[opt_id]] <- input[[opt_id]]
})

label <- if (is.null(opt_def$label)) opt_id else opt_def$label
Expand Down

0 comments on commit d0ac1f6

Please sign in to comment.