Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Depends:
R (>= 3.0.2)
Imports:
jsonlite (>= 0.9.16),
rmarkdown,
Suggests:
shiny (>= 1.5.0),
fontawesome (>= 0.3.0),
knitr,
rmarkdown,
htmltools,
testthat
License: GPL-3 | file LICENSE
Expand Down
63 changes: 30 additions & 33 deletions R/shinyModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,41 @@
#' @rdname reactlog_module
#' @export
#' @examples
#' if (!require("shiny")) {
#' message("`shiny` required to run example")
#' return()
#' }
#'
#' library(shiny)
#' # Enable reactlog
#' reactlog_enable()
#' if (requireNamespace("shiny", quietly = TRUE)) {
#' library(shiny)
#' # Enable reactlog
#' reactlog_enable()
#'
#' # Define UI for app that draws a histogram ----
#' ui <- fluidPage(
#' tags$h1("Pythagorean theorem"),
#' numericInput("a", "A", 3),
#' numericInput("b", "B", 4),
#' "C:", verbatimTextOutput("c"),
#' ### start ui module
#' reactlog_module_ui()
#' ### end ui module
#' )
#' # Define UI for app that draws a histogram ----
#' ui <- fluidPage(
#' tags$h1("Pythagorean theorem"),
#' numericInput("a", "A", 3),
#' numericInput("b", "B", 4),
#' "C:", verbatimTextOutput("c"),
#' ### start ui module
#' reactlog_module_ui()
#' ### end ui module
#' )
#'
#' server <- function(input, output, session) {
#' a2 <- reactive({a <- input$a; req(a); a * a}, label = "a^2")
#' b2 <- reactive({b <- input$b; req(b); b * b}, label = "b^2")
#' c2 <- reactive({a2() + b2()}, label = "c^2")
#' c_val <- reactive({sqrt(c2())}, label = "c")
#' server <- function(input, output, session) {
#' a2 <- reactive({a <- input$a; req(a); a * a}, label = "a^2")
#' b2 <- reactive({b <- input$b; req(b); b * b}, label = "b^2")
#' c2 <- reactive({a2() + b2()}, label = "c^2")
#' c_val <- reactive({sqrt(c2())}, label = "c")
#'
#' output$c <- renderText({
#' c_val()
#' })
#' output$c <- renderText({
#' c_val()
#' })
#'
#' ### start server module
#' reactlog_module_server()
#' ### end server module
#' ### start server module
#' reactlog_module_server()
#' ### end server module
#'
#' }
#' }
#'
#' if (interactive()) {
#' shinyApp(ui = ui, server = server)
#' if (interactive()) {
#' shinyApp(ui = ui, server = server)
#' }
#' }
reactlog_module_ui <- function(include_refresh = TRUE, id = "reactlog_module") {
ns <- shiny::NS(id)
Expand Down Expand Up @@ -135,7 +132,7 @@ shiny_version_required <- function() {
test_shiny_version <- function() {
tryCatch({
utils::packageVersion("shiny") >= shiny_version_required()
}, error = function() {
}, error = function(e) {
# package not found
FALSE
})
Expand Down
61 changes: 29 additions & 32 deletions man/reactlog_module.Rd

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

Loading