mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
First implementation of plotCache
This commit is contained in:
53
man/plotCache.Rd
Normal file
53
man/plotCache.Rd
Normal file
@@ -0,0 +1,53 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/render-plot.R
|
||||
\name{plotCache}
|
||||
\alias{plotCache}
|
||||
\title{Disk-based plot cache}
|
||||
\usage{
|
||||
plotCache(cacheId, invalidationExpr, width, height, res = 72, plotFunc,
|
||||
cachePath = file.path(tempdir(), cacheId),
|
||||
invalidation.env = parent.frame(), invalidation.quoted = FALSE)
|
||||
}
|
||||
\arguments{
|
||||
\item{cacheId}{An identifier for this cache; by default, will be incorporated
|
||||
into the cache directory path.}
|
||||
|
||||
\item{invalidationExpr}{Any expression or block of code that accesses any
|
||||
reactives whose invalidation should cause cache invalidation. This
|
||||
typically would be an expression that indicates that the source data has
|
||||
changed. Use \code{NULL} if you don't want to cause cache invalidation.}
|
||||
|
||||
\item{width, height}{The dimensions of the plot. (Use double the user
|
||||
width/height for retina/hi-dpi compatibility.)}
|
||||
|
||||
\item{res}{The resolution of the PNG. Use 72 for normal screens, 144 for
|
||||
retina/hi-dpi.}
|
||||
|
||||
\item{plotFunc}{Plotting logic, provided as a function that takes zero or
|
||||
more arguments. Don't worry about setting up a graphics device or creating
|
||||
a PNG; just write to the graphics device (you must call \code{print()} on
|
||||
ggplot2 objects).}
|
||||
|
||||
\item{cachePath}{The location on disk where the cache will be stored. By
|
||||
default, uses a temp directory, which is generally cleaned up during a
|
||||
normal shutdown of the R process.}
|
||||
|
||||
\item{invalidation.env}{The environment where the \code{invalidationExpr} is
|
||||
evaluated.}
|
||||
|
||||
\item{invalidation.quoted}{Is \code{invalidationExpr} expression quoted? By
|
||||
default, this is FALSE. This is useful when you want to use an expression
|
||||
that is stored in a variable; to do so, it must be quoted with
|
||||
\code{quote()}.}
|
||||
}
|
||||
\description{
|
||||
Creates a read-through cache for plots. The plotting logic is provided as
|
||||
plotFunc, a function that can have any number/combination of arguments; the
|
||||
return value of plotCache is a function that should be used in the place of
|
||||
plotFunc. Each unique combination of inputs will be cached to disk in the
|
||||
location specified by cachePath.
|
||||
}
|
||||
\details{
|
||||
The invalidationExpr expression will be monitored and whenever it is
|
||||
invalidated, so too is the cache invalidated (the contents are erased).
|
||||
}
|
||||
Reference in New Issue
Block a user