qfes / rdeck

Deck.gl widget for R
https://qfes.github.io/rdeck
MIT License
98 stars 0 forks source link

Client-side filter #48

Open anthonynorth opened 2 years ago

anthonynorth commented 2 years ago

Add support for client-side data filtering, using DataFilter layer extension, allowing for performant filtering of layer data already available on the client.

Each filter should support multiple layers and multiple fields per layer; example: a single date-range filter can be applied to many layers with each layer specifying one or more fields.

Limitations:

Possible api

add_range_filter <- function(rdeck, name, min, max, ...) {}
add_set_filter <- function(rdeck, name, values, ...) {}
add_value_filter <- function(rdeck, name, value, ...) {}

rdeck(...) |>
  # layer-1 filtered by the foo column, layer-2 filtered by the bar column
  add_range_filter(name = "range filter", min = 0, max = 1, "layer-1" = foo, "layer-2" = bar) |>
  add_scatterplot_layer(id = "layer-1", ...) |>
  add_polygon_layer(id = "layer-2", ...)