Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reactlog_module

Reactlog Shiny Module


Description

Displays an iframe of the reactlog in the given application.

Usage

reactlog_module_ui(include_refresh = TRUE, id = "reactlog_module")

reactlog_module_server(
  id = "reactlog_module",
  width = "100%",
  height = 600,
  ...
)

Arguments

include_refresh

should the iframe refresh button be included?

id

shiny module id to use

width, height

HTML attributes to be applied to the reactlog iframe

...

parameters passed to shiny::actionButton()

Details

State will not be preserved between refreshes. To open the reactlog at a particular step, be sure to mark your time points with Cmd+Shift+F3 (Windows: Ctrl+Shift+F3)

See Also

Examples

if (!require("shiny")) {
  message("`shiny` required to run example")
  return()
}

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
)

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()
  })

### start server module
  reactlog_module_server()
### end server module

}

if (interactive()) {
  shinyApp(ui = ui, server = server)
}

reactlog

Reactivity Visualizer for 'shiny'

v1.1.0
GPL-3 | file LICENSE
Authors
Barret Schloerke [aut, cre] (<https://orcid.org/0000-0001-9986-114X>), Joe Cheng [ctb], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.