Skip to content
Closed
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
55 changes: 26 additions & 29 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 (require("shiny")) {
#' 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"),
#' # 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()
#' 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()
#' 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(cond) {
# package not found
FALSE
})
Expand Down
3 changes: 2 additions & 1 deletion bin/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# do not create stubs from missing libraries
# ignore dev dependencies
yarn flow-typed install --skip true --ignoreDeps dev
# Allow failure: flow-typed may fail if the GitHub API is unavailable
yarn flow-typed install --skip true --ignoreDeps dev || true

yarn build-only
53 changes: 25 additions & 28 deletions man/reactlog_module.Rd

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