Description Usage Arguments Details Value Author(s) Examples
These functions allow an rgl scene to be embedded in a Shiny app.
1 2 3 4 5 | rglwidgetOutput(outputId, width = "512px", height = "512px")
renderRglwidget(expr, env = parent.frame(), quoted = FALSE, outputArgs = list())
playwidgetOutput(outputId, width = "0px", height = "0px")
renderPlaywidget(expr, env = parent.frame(), quoted = FALSE, outputArgs = list())
|
outputId |
The name for the control. |
width, height |
Width and height to display the control. |
expr |
An R expression returning
a |
env |
The environment in which to evaluate |
quoted |
Is the expression already quoted? |
outputArgs |
A list containing arguments; see details below. |
Use rglwidgetOutput
or playwidgetOutput
as an output
object in a Shiny user
interface section; use renderRglwidget
or renderPlaywidget
as the render
function in the server section.
In a dynamic R Markdown document with runtime: shiny
, you
only call the render function, and may optionally pass width
and height
to the output function by putting them in
a list in outputArgs
. See the example below.
Used internally by Shiny.
Duncan Murdoch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# This could be used in a dynamic R Markdown document. See
# demo("shinyDemo") and demo("simpleShinyRgl") for Shiny apps.
inputPanel(
sliderInput("n", label = "n", min = 10, max = 100, value = 10, step = 10)
)
renderRglwidget({
n <- input$n
try(close3d())
plot3d(rnorm(n), rnorm(n), rnorm(n))
rglwidget()
}, outputArgs = list(width = "auto", height = "300px"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.