forked from rstudio/shiny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
130 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,19 @@ | ||
\name{reactivePlot} | ||
\alias{reactivePlot} | ||
\title{Plot Output} | ||
\title{Plot output (deprecated)} | ||
\usage{ | ||
reactivePlot(func, width = "auto", height = "auto", ...) | ||
} | ||
\arguments{ | ||
\item{func}{A function that generates a plot.} | ||
\item{func}{A function.} | ||
|
||
\item{width}{The width of the rendered plot, in pixels; | ||
or \code{'auto'} to use the \code{offsetWidth} of the | ||
HTML element that is bound to this plot. You can also | ||
pass in a function that returns the width in pixels or | ||
\code{'auto'}; in the body of the function you may | ||
reference reactive values and functions.} | ||
\item{width}{Width.} | ||
|
||
\item{height}{The height of the rendered plot, in pixels; | ||
or \code{'auto'} to use the \code{offsetHeight} of the | ||
HTML element that is bound to this plot. You can also | ||
pass in a function that returns the width in pixels or | ||
\code{'auto'}; in the body of the function you may | ||
reference reactive values and functions.} | ||
\item{height}{Height.} | ||
|
||
\item{...}{Arguments to be passed through to | ||
\code{\link[grDevices]{png}}. These can be used to set | ||
the width, height, background color, etc.} | ||
\item{...}{Other arguments to pass on.} | ||
} | ||
\description{ | ||
Creates a reactive plot that is suitable for assigning to | ||
an \code{output} slot. | ||
} | ||
\details{ | ||
The corresponding HTML output tag should be \code{div} or | ||
\code{img} and have the CSS class name | ||
\code{shiny-plot-output}. | ||
|
||
For output, it will try to use the following devices, in | ||
this order: quartz (via \code{\link[grDevices]{png}}), | ||
then \code{\link[Cairo]{CairoPNG}}, and finally | ||
\code{\link[grDevices]{png}}. This is in order of quality | ||
of output. Notably, plain \code{png} output on Linux and | ||
Windows may not antialias some point shapes, resulting in | ||
poor quality output. | ||
See \code{\link{renderPlot}}. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,13 @@ | ||
\name{reactivePrint} | ||
\alias{reactivePrint} | ||
\title{Printable Output} | ||
\title{Print output (deprecated)} | ||
\usage{ | ||
reactivePrint(func) | ||
} | ||
\arguments{ | ||
\item{func}{A function that may print output and/or | ||
return a printable R object.} | ||
\item{func}{A function.} | ||
} | ||
\description{ | ||
Makes a reactive version of the given function that | ||
captures any printed output, and also captures its | ||
printable result (unless \code{\link{invisible}}), into a | ||
string. The resulting function is suitable for assigning | ||
to an \code{output} slot. | ||
} | ||
\details{ | ||
The corresponding HTML output tag can be anything (though | ||
\code{pre} is recommended if you need a monospace font | ||
and whitespace preserved) and should have the CSS class | ||
name \code{shiny-text-output}. | ||
|
||
The result of executing \code{func} will be printed | ||
inside a \code{\link[utils]{capture.output}} call. | ||
|
||
Note that unlike most other Shiny output functions, if | ||
the given function returns \code{NULL} then \code{NULL} | ||
will actually be visible in the output. To display | ||
nothing, make your function return | ||
\code{\link{invisible}()}. | ||
} | ||
\examples{ | ||
isolate({ | ||
|
||
# reactivePrint captures any print output, converts it to a string, and | ||
# returns it | ||
visFun <- reactivePrint(function() "foo") | ||
visFun() | ||
# '[1] "foo"' | ||
|
||
invisFun <- reactivePrint(function() invisible("foo")) | ||
invisFun() | ||
# '' | ||
|
||
multiprintFun <- reactivePrint(function() { | ||
print("foo"); | ||
"bar" | ||
}) | ||
multiprintFun() | ||
# '[1] "foo"\\n[1] "bar"' | ||
|
||
nullFun <- reactivePrint(function() NULL) | ||
nullFun() | ||
# 'NULL' | ||
|
||
invisNullFun <- reactivePrint(function() invisible(NULL)) | ||
invisNullFun() | ||
# '' | ||
|
||
vecFun <- reactivePrint(function() 1:5) | ||
vecFun() | ||
# '[1] 1 2 3 4 5' | ||
|
||
|
||
# Contrast with reactiveText, which takes the value returned from the function | ||
# and uses cat() to convert it to a string | ||
visFun <- reactiveText(function() "foo") | ||
visFun() | ||
# 'foo' | ||
|
||
invisFun <- reactiveText(function() invisible("foo")) | ||
invisFun() | ||
# 'foo' | ||
|
||
multiprintFun <- reactiveText(function() { | ||
print("foo"); | ||
"bar" | ||
}) | ||
multiprintFun() | ||
# 'bar' | ||
|
||
nullFun <- reactiveText(function() NULL) | ||
nullFun() | ||
# '' | ||
|
||
invisNullFun <- reactiveText(function() invisible(NULL)) | ||
invisNullFun() | ||
# '' | ||
|
||
vecFun <- reactiveText(function() 1:5) | ||
vecFun() | ||
# '1 2 3 4 5' | ||
|
||
}) | ||
} | ||
\seealso{ | ||
\code{\link{reactiveText}} for displaying the value | ||
returned from a function, instead of the printed output. | ||
See \code{\link{renderPrint}}. | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
\name{reactiveTable} | ||
\alias{reactiveTable} | ||
\title{Table Output} | ||
\title{Table output (deprecated)} | ||
\usage{ | ||
reactiveTable(func, ...) | ||
} | ||
\arguments{ | ||
\item{func}{A function that returns an R object that can | ||
be used with \code{\link[xtable]{xtable}}.} | ||
\item{func}{A function.} | ||
|
||
\item{...}{Arguments to be passed through to | ||
\code{\link[xtable]{xtable}} and | ||
\code{\link[xtable]{print.xtable}}.} | ||
\item{...}{Other arguments to pass on.} | ||
} | ||
\description{ | ||
Creates a reactive table that is suitable for assigning | ||
to an \code{output} slot. | ||
} | ||
\details{ | ||
The corresponding HTML output tag should be \code{div} | ||
and have the CSS class name \code{shiny-html-output}. | ||
See \code{\link{renderTable}}. | ||
} | ||
|
Oops, something went wrong.