mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Merge pull request #1132 from rstudio/joe/reactive-graph-data
Update reactive graph sample data to include time
This commit is contained in:
10
R/graph.R
10
R/graph.R
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user