I built an application that splits up the source data according to some category and displays each category on a separate plotly express timeline in a Tab/Tabs environment. Outside the Tabs(), I have a couple of forward-backward buttons that move the displayed time window accordingly. I want the buttons to act on all tabs, so that when switching between tabs, all plots always show the same time frame. To that end, clicking the buttons updates a dcc.Store which in turn triggers updating of all plots.
All this works fine so far, but it is quite sluggish because all actions (initial load and time window buttons) trigger reload of all plots, not just the visible one. I set “prevent_initital_call=True” in the plot-generating callback but it still fires once for each tab on initial load.
If, inside the dcc.Graph updating callback, there were a way of knowing if this Graph is on a currently visible tab I could just raise a PreventUpdate exception if it ain’t. Thoughts?