Merge pull request #1132 from rstudio/joe/reactive-graph-data

Update reactive graph sample data to include time
This commit is contained in:
Joe Cheng
2016-03-29 09:54:15 -07:00
3 changed files with 931 additions and 144 deletions

View File

@@ -41,12 +41,15 @@ writeReactLog <- function(file=stdout(), sessionToken = NULL) {
#' enabled, it's possible for any user of your app to see at least some
#' of the source code of your reactive expressions and observers.
#'
#' @param time A boolean that specifies whether or not to display the
#' time that each reactive.
#'
#' @export
showReactLog <- function() {
utils::browseURL(renderReactLog())
showReactLog <- function(time = TRUE) {
utils::browseURL(renderReactLog(time = as.logical(time)))
}
renderReactLog <- function(sessionToken = NULL) {
renderReactLog <- function(sessionToken = NULL, time = TRUE) {
templateFile <- system.file('www/reactive-graph.html', package='shiny')
html <- paste(readLines(templateFile, warn=FALSE), collapse='\r\n')
tc <- textConnection(NULL, 'w')
@@ -55,6 +58,7 @@ renderReactLog <- function(sessionToken = NULL) {
cat('\n', file=tc)
flush(tc)
html <- sub('__DATA__', paste(textConnectionValue(tc), collapse='\r\n'), html, fixed=TRUE)
html <- sub('__TIME__', paste0('"', time, '"'), html, fixed=TRUE)
file <- tempfile(fileext = '.html')
writeLines(html, file)
return(file)

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,11 @@
\alias{showReactLog}
\title{Reactive Log Visualizer}
\usage{
showReactLog()
showReactLog(time = TRUE)
}
\arguments{
\item{time}{A boolean that specifies whether or not to display the
time that each reactive.}
}
\description{
Provides an interactive browser-based tool for visualizing reactive