Example to use triple dots (...
) to pass additional parameters that will be forwarded to deck.gl javascript
#113
-
Is there an example of how to use the triple dots to pass arguments to the JS function? For instance, I wanted to have the layers selector open by default when more than one layer is available for selection. I found that the argument |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Triple dots: There's no documented examples of passing additional params to rdeck() or layers, but I've included one below. Expanding the layer selector: There's currently no R interface for controlling expand/collapse of the {rdeck} layer selector. The stackoverflow answer is specific to leaflet. Silly example of passing additional params: library(rdeck)
symbols <- c("✵", "✰", "✷", "✭", "✧", "✸", "✡", "✮", "❂")
points <- data.frame(
position = xy(runif(100, -180, 180), runif(100, -85, 85)),
value = rnorm(100),
text = sample(symbols, 100, TRUE)
)
rdeck(initial_bounds = points) |>
add_text_layer(
data = points,
get_position = position,
get_text = text,
get_color = scale_color_linear(value),
# not in the r-api, but can still be used
character_set = symbols
) |
Beta Was this translation helpful? Give feedback.
Triple dots: There's no documented examples of passing additional params to rdeck() or layers, but I've included one below.
Expanding the layer selector: There's currently no R interface for controlling expand/collapse of the {rdeck} layer selector. The stackoverflow answer is specific to leaflet.
Silly example of passing additional params: