% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shiny.R
\name{renderDeckgl}
\alias{renderDeckgl}
\title{Shiny render function for Deck.gl}
\usage{
renderDeckgl(expr, env = parent.frame(), quoted = FALSE)
}
\arguments{
\item{expr}{An expression that generates a call to \code{\link{deckgl}()}.}

\item{env}{The environment in which to evaluate \code{expr}.}

\item{quoted}{Is \code{expr} a quoted expression (with \code{quote()})? This
is useful if you want to save an expression in a variable.}
}
\value{
A Shiny render function for use in the server.
}
\description{
Use this in the server to render the Deck.gl visualization to the output.
}
\examples{
if (interactive()) {
  library(shiny)
  library(rDeckgl)

  ui <- fluidPage(
    deckglOutput("myDeckgl")
  )

  server <- function(input, output, session) {
    output$myDeckgl <- renderDeckgl({
      spec <- list(
        `@type` = "DeckGL",
        initialViewState = list(longitude = -122.4, latitude = 37.76, zoom = 12),
        layers = list(
          list(
            `@type` = "ScatterplotLayer",
            id = "points",
            data = list(type = "duckdb", query = "SELECT * FROM points"),
            getPosition = "@=[lon, lat]",
            getRadius = 100,
            getFillColor = c(255, 0, 0)
          )
        )
      )
      deckgl(spec = spec, data = list(points = data.frame(lon = -122.4, lat = 37.76)))
    })
  }

  shinyApp(ui, server)
}

}
