Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Clear selectedData when an Input changes state

$
0
0

I have a dash app with a bar-chart representing Counts over Dates (days). The bar chart is linked to a map (scattermapbox). Users can filter which dates show on the map by selecting (e.g. via box or lasso) on the bar chart which date/date ranges they are interested in.

The chart and map are fed by a dataframe. There is a dropdown element which subsets the dataframe by a categorical variable.

Whenever I “select dates” on the plot it successfully filters the map, but when I change the drop down category, the selectedData is retained, thus pre-filtering the map undesirably.

Which brings me to two questions:

  1. How would you go about fixing this specific issue?

  2. In general is there some general technique in dash to compare the apps present state with a past state? A way to track when a certain input changes?

EDIT:

I tried following along with this post but after formatting it for my app - my version of the example’s def update_selection(data, selected_data, state) was not working … the arguments were empty

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images