plotly/dash-renderer

Interactive plots lose callbacks with tabs

nite opened this issue · 1 comments

nite commented

Hi, I've got a typical interactive plotting app with crossfilters on plots in multiple tabs - if I switch to plots with the exact same layout & structure on a subsequent tab, the plot interaction callbacks on the first will be lost when I switch back to it, however if I switch to a tab with layout even slightly changed (eg. just add a div in before the plot), callbacks will resume.

No callbacks (or redux actions) are fired from the javascript side when interaction is lost, so I'm assuming this is some issue in the js of dash-renderer - possibly some sort of optimisation/assumption that the plots are the same based on plot layout ...?

I started by looking at https://community.plot.ly/t/interactive-graphing-not-working-with-dcc-tab/13852, but the last comment there didnt quite replicate the bug, so I tweaked it as follows:
https://gist.github.com/nite/7b7811b2432991824edfb30c1b5a783f

I've also created a forum post here:
https://community.plot.ly/t/interactive-plots-lose-callbacks-with-tabs/15585

Hi @nite - Apologies that nobody responded to this when you posted it. What you're describing does indeed sound like a bug, but when I try it now it seems to work correctly - when I switch back to "Tab one" the callbacks fire again. Perhaps we fixed it in the course of some other work?

I'm going to close this issue, because we're merging dash-renderer into the dash repo. But if you're still seeing this bug please open a new issue in the main dash repo.