The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

rDeckgl

R bindings for deck.gl 9.2.2. The package wraps the deck.gl JSON interface inside an htmlwidget, hydrates data through DuckDB, and ships Shiny bindings so you can drop interactive WebGL maps and large-data visualizations into any R workflow.

Installation

Once on CRAN:

install.packages("rDeckgl")

Development version from GitHub:

# install.packages("remotes")
remotes::install_github("TiRizvanov/rDeckgl")

The deck.gl 9.2.2 JavaScript bundle, JSON converter, default loaders, CSS, and widget glue are pre-built and shipped under inst/htmlwidgets/, so no Node or JavaScript tooling is required at runtime.

Quick start

library(rDeckgl)

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 lon, lat, radius FROM points"),
      getPosition  = "@@=[lon, lat]",
      getRadius    = "@@=radius",
      getFillColor = c(255, 0, 0)
    )
  )
)

data <- list(
  points = data.frame(
    lon    = c(-122.40, -122.45, -122.35),
    lat    = c( 37.76,   37.78,   37.74),
    radius = c(100,      150,     200)
  )
)

deckgl(spec, data = data, width = "100%", height = "500px")

deckgl() accepts deck.gl JSON specs as R lists, JSON strings, YAML strings, or file paths; the format is auto-detected. Data passed via the data argument is registered as DuckDB tables that your type = "duckdb" data nodes can query.

Shiny integration

library(shiny)
library(rDeckgl)

ui <- fluidPage(
  deckglOutput("map", width = "100%", height = "600px")
)

server <- function(input, output, session) {
  output$map <- renderDeckgl({
    deckgl(spec, data = data)
  })
}

shinyApp(ui, server)

ggsql

ggsql() exposes the same renderer through the ggsql dialect — describe a deck.gl visualization with VISUALIZE / DRAW / PLACE / SCALE clauses instead of hand-writing JSON. See ?ggsql for the full reference.

Learning more

Contributing

Issues and pull requests are welcome on GitHub. Please report bugs to the package maintainer listed in DESCRIPTION.

License

MIT — see LICENSE for the full text, including the third-party deck.gl license bundled with the JavaScript assets.

Acknowledgements

Developed in the Dries Lab at Boston University. Funding support was provided by the Dries Lab and the Boston University Undergraduate Research Opportunities Program (UROP).

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.