encodePlot {shinylight} | R Documentation |
Renders a plot as a base64-encoded image
Description
Renders a plot as a base64-encoded image
Usage
encodePlot(device, mimeType, width, height, plotFn)
Arguments
device |
Graphics device function, such as
|
mimeType |
Mime type for the data produced by |
width |
Width of the plot in units applicable to |
height |
Height of the plot in units applicable to |
plotFn |
Function to call to perform the plot |
Value
list with two keys, whose values can each be NULL:
'plot'
is a plot in HTML img src form and 'data'
is a
data frame or other non-plot result.
Examples
pdf <- encodePlot(grDevices::png, "image/png", 200, 300, function() {
barplot(c(1, 2, 3, 4))
})
grDevices::png() # workaround; you do not have to do this
[Package shinylight version 1.2 Index]