add_column_layer: Add a column layer to the deckgl widget

View source: R/layers_column-layer.R

add_column_layerR Documentation

Add a column layer to the deckgl widget

Description

The ColumnLayer can be used to render a heatmap of vertical cylinders. It renders a tesselated regular polygon centered at each given position (a "disk"), and extrude it in 3d.

Usage

add_column_layer(
  deckgl,
  data = NULL,
  properties = list(),
  ...,
  id = "column-layer"
)

Arguments

deckgl

A deckgl widget object.

data

The url to fetch data from or a data object.

properties

A named list of properties with names corresponding to the properties defined in the deckgl-api-reference for the given layer class. The properties parameter can also be an empty list. In this case all props must be passed as named arguments.

...

Named arguments that will be added to the properties object. Identical parameters are overwritten.

id

The unique id of the layer.

See Also

https://deck.gl/#/documentation/deckgl-api-reference/layers/column-layer

Examples

hexagon_centroids <- system.file("sample-data/centroids.csv", package = "deckgl") %>%
  read.csv()

deck <- deckgl(zoom = 11, pitch = 35) %>%
  add_column_layer(
    data = hexagon_centroids,
    diskResolution = 12,
    getPosition = ~lng + lat,
    getElevation = ~value,
    getFillColor = "@=[48, 128, value * 255, 255]",
    elevationScale = 5000,
    radius = 250,
    extruded = TRUE,
    tooltip = "Value: {{value}}"
  ) %>%
  add_control("Column Layer", "bottom-left") %>%
  add_basemap()

if (interactive()) deck

deckgl documentation built on March 7, 2023, 5:37 p.m.