Open daattali opened 1 year ago
When a filter_select() is used, the FilterHandle callback returns the keys as a string array. When a filter_slider() is used, a numeric array is returned.
filter_select()
filter_slider()
Example:
library(shiny) df <- data.frame(id = 1:5, num1 = 11:15, num2 = 21:25) shared_df <- crosstalk::SharedData$new(df, key = ~id, group = 'test') ui <- fluidPage( crosstalk::filter_select("num1", "num1", shared_df, ~num1), crosstalk::filter_slider("num2", "num2", shared_df, ~num2, step = 1), tags$script(HTML( 'ctFil = new crosstalk.FilterHandle("test"); ctFil.on("change", function(e) { console.log(e.value); });' )) ) server <- function(input, output, session) {} shinyApp(ui, server)
Make selections using either filter, and look at the javascript console.
https://www.loom.com/share/bb379b56dd2349e48b894895d15ba7c1
When a
filter_select()
is used, the FilterHandle callback returns the keys as a string array. When afilter_slider()
is used, a numeric array is returned.Example:
Make selections using either filter, and look at the javascript console.
https://www.loom.com/share/bb379b56dd2349e48b894895d15ba7c1