reactlog

Reactivity Visualizer for 'shiny'


License
GPL-3.0

Documentation

reactlog

Travis Build Status Coverage status CRAN version

Shiny is an R package from RStudio that makes it incredibly easy to build interactive web applications with R. The complexity of the reactive elements within a shiny application can quickly become complicated and are difficult to debug. reactlog provides a visual debugger for shiny reactivity. After logging the reactive interactions of a shiny application, reactlog visualizes the shiny reaction state at any time point in the record.

The reactlog dependency graph provides users with the ability to visually see if reactive elements are:

  • not utilized (never retrieved)
  • over utilized (called independently many times)
  • interacting with unexpected elements
  • invalidating all expected dependencies
  • freezing (and thawing), preventing triggering of future reactivity

If you have general questions about using reactlog, please use the RStudio Community website. For bug reports, please use the reactlog issue tracker.

Features

  • Display the reactivity dependency graph of your shiny applications
  • See how often elements of your shiny application are being processed
  • Move throughout your reactive history to replay element interactions
  • Highlight family trees within the reactive graph
  • Filter on family trees within the reactive graph

Installation

For the latest version:

devtools::install_github("rstudio/reactlog")

Usage

library(shiny)
library(reactlog)

# tell shiny to log reactivity
options("shiny.reactlog" = TRUE)

# run a shiny app
app <- system.file("examples/01_hello", package = "shiny")
runApp(app)

# once app has closed, display reactlog
show_reactlog()

Or while your shiny app is running, press the key combination Ctrl+F3 (Mac: Cmd+F3) to launch the reactlog application.

To mark a specific execution time point within your shiny app, press the key combination Ctrl+F4 (Mac: Cmd+F4). This will highlight a specific point in time in your reactlog.

Development

Please make sure you have Node.js and yarn installed.

Installation script:

# install dependencies and build javascript
yarn install

# build on file change
yarn watch

By changing the file './inst/defaultLog.js' with the contents of any log file in './inst/log-files/', different default log files can be loaded. Once the local js ('./inst/reactlogAsset/reactlog.js') has been built with yarn build or yarn watch, refresh './inst/reactlog.html' to avoid constantly spawning shiny applications for testing.

Guidelines for contributing

We welcome contributions to the reactlog package. Please see our CONTRIBUTING.md file for detailed guidelines of how to contribute.

Please note that the 'reactlog' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.