How do you manage crossfiltering with multiple charts/filters?

I’ve been struggling with managing filters. By that, I mean that I have a data source with many fields. I have multiple charts, say, one for counts per year, another for counts per city, and another for counts per person (these are made up and I have many more in my real data). I want the user to be able to click the year bar chart to filter all the data shown to be from that year. For example, the user clicks the 2020 bar, and the city and person charts are showing data from only 2020. This works great. But then i want the user to be able to click a city, say Paris, and now only data from from 2020 in Paris is being shown in the person chart. However, when I do this, the year chart updates as well.

My questions is how do you manage crossfiltering in that way?

My current methods use a dcc.Store object to store the current filtered data, with a callback that is triggered when any of the charts are clicked. I know where my error is (clickData isn’t persistent, so when I click the city chart after the year chart, the year click is empty and thus it isn’t filtered for), but I feel like there must be an easier way?

Did you check out the generic cross filter recipe in the documentation?

I have, but in this example, the underlying data doesn’t change when you make a selection, it just changes what is highlighted. What I have are bar graphs where the counts change based on how they’re filtered.

Hello! Did you manage to make it to work? I have the same question…