diff --git a/.lintr b/.lintr index 34473d27..0a0bb22f 100644 --- a/.lintr +++ b/.lintr @@ -1,5 +1,6 @@ linters: linters_with_defaults( line_length_linter = line_length_linter(120), cyclocomp_linter = NULL, - object_usage_linter = NULL + object_usage_linter = NULL, + indentation_linter = NULL ) diff --git a/R/plot_with_settings.R b/R/plot_with_settings.R index db77d250..aa0fabc7 100644 --- a/R/plot_with_settings.R +++ b/R/plot_with_settings.R @@ -208,13 +208,13 @@ plot_with_settings_ui <- function(id) { #' shinyApp( #' ui = fluidPage( #' useShinyjs(), +#' actionButton("button", "Show/Hide"), #' plot_with_settings_ui( #' id = "plot_with_settings" -#' ), -#' actionButton("button", "Show/Hide") +#' ) #' ), #' server = function(input, output, session) { -#' plot_r <- reactive(ggplot2::qplot(x = 1, y = 1)) +#' plot_r <- reactive(ggplot2::qplot(data = faithful, x = waiting, y = eruptions)) #' #' show_hide_signal_rv <- reactiveVal(TRUE) #' @@ -388,13 +388,13 @@ plot_with_settings_srv <- function(id, ) output$plot_out_main <- renderUI({ + req(plot_r()) div( align = graph_align, plotOutput( ns("plot_main"), - height = p_height(), - width = p_width(), - brush = `if`(brushing, brushOpts(ns("plot_brush"), resetOnNew = TRUE), NULL), + height = "100%", + brush = `if`(brushing, brushOpts(ns("plot_brush"), resetOnNew = FALSE), NULL), click = `if`(clicking, clickOpts(ns("plot_click")), NULL), dblclick = `if`(dblclicking, dblclickOpts(ns("plot_dblclick")), NULL), hover = `if`(hovering, hoverOpts(ns("plot_hover")), NULL) diff --git a/man/plot_with_settings_srv.Rd b/man/plot_with_settings_srv.Rd index 56fbca77..29afcf8e 100644 --- a/man/plot_with_settings_srv.Rd +++ b/man/plot_with_settings_srv.Rd @@ -173,13 +173,13 @@ library("shinyjs") shinyApp( ui = fluidPage( useShinyjs(), + actionButton("button", "Show/Hide"), plot_with_settings_ui( id = "plot_with_settings" - ), - actionButton("button", "Show/Hide") + ) ), server = function(input, output, session) { - plot_r <- reactive(ggplot2::qplot(x = 1, y = 1)) + plot_r <- reactive(ggplot2::qplot(data = faithful, x = waiting, y = eruptions)) show_hide_signal_rv <- reactiveVal(TRUE)