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:
-
How would you go about fixing this specific issue?
-
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