Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

shiny

Functions for integration of RGL widgets into Shiny app


Description

These functions allow an RGL scene to be embedded in a Shiny app.

Usage

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())

Arguments

outputId

The name for the control.

width, height

Width and height to display the control.

expr

An R expression returning a rglwidget (for renderRglwidget) or a playwidget (for renderPlaywidget) as output.

env

The environment in which to evaluate expr.

quoted

Is the expression already quoted?

outputArgs

A list containing arguments; see details below.

Details

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.

Value

Used internally by Shiny.

Author(s)

Duncan Murdoch

Examples

## 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)

rgl

3D Visualization Using OpenGL

v0.106.8
GPL
Authors
Duncan Murdoch [aut, cre], Daniel Adler [aut], Oleg Nenadic [ctb], Simon Urbanek [ctb], Ming Chen [ctb], Albrecht Gebhardt [ctb], Ben Bolker [ctb], Gabor Csardi [ctb], Adam Strzelecki [ctb], Alexander Senger [ctb], The R Core Team [ctb, cph], Dirk Eddelbuettel [ctb], The authors of Shiny [cph], The authors of knitr [cph], Jeroen Ooms [ctb], Yohann Demont [ctb], Joshua Ulrich [ctb], Xavier Fernandez i Marin [ctb], George Helffrich [ctb], Ivan Krylov [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.