I am trying to use crosstalk
to filter a plotly
chart. I use crosstalk
's filter_select
to (un)filter a plotly
chart. When using the reprex below trying to select a flower (e.g. setosa), all works fine. But when I unselect the flower, the values are not 'returned' to the plotly
chart. Selecting '(All)' does not seem to be working either. The values reappear only when deselecting from flower filter AND ticking TRUE in the helper_select_all.
library(crosstalk)
library(plotly)
df <- iris
df$helper_select_all <- T
shared_data <- SharedData$new(df)
filter <- bscols(
list(
filter_select("flower", "Select a flower", shared_data, ~Species),
filter_checkbox(
"helper_select_all",
label = "Reset filtering as deselecting from 'Select a flower' is not working",
shared_data, ~helper_select_all)
)
)
p <- plot_ly(shared_data, x = ~Sepal.Length, y = ~Sepal.Width) %>%
add_markers()
bscols(filter, p)
This picture demonstrates the issue as no filtering value is selected, but a part of the data is missing.
This picture shows what it looks like when all datapoints are present.