-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with interactions between widgets and plots using bokeh server #4764
Comments
I was hoping this might be a workaround but unfortunately not:
@troianow Is it the same kind of plot (glyphs, etc) but just the data is changing? A current workaround would be to update the data in the plot, instead of the plot itself, as demonstrated in most of the existing examples |
Aso FWIW I don't think the widgets are relevant I think it is just the replacement of a child plot at all that is problematic. |
@bryevdv Unfortunately, for my application, most of the plot changes: the widget might control the way the data is sliced, thus impacting the glyphs, axes, legend, ... so I don't think I can get away with changes in the data source alone. Is there a good way to replace everything in the figure without replacing the figure itself? |
OK, we will make a priority of it, but the best person to try and fix this is out for another week or so, so it will probably not be able to be fixed until after SciPy. |
Is someone looking at this? |
Not that I'm aware of. Are you experiencing the same issue with 0.12.1? |
Yes, the behavior is the same |
I am having the same issue. Also with column if I define multiple rows. The usage of row was my workaround and with only one row it's working for me (or one column). So troianow, this may be the solution for you. As I need a grid like structure with a toolbar per plot I do need this fixed. |
I've been bumping my head against this bug today also. Discussion group post here, which contains a link to a Gist of code to reproduce the problem. Just in case a second example is helpful. |
Facing the same problem. I thought using the layout(...) function to create the grid might solve it, but no luck. My current workaround is to add my "real" layout inside a one element column which acts as the root. When I want to update, I remove the real layout, then add the updated on back into the root. Has the downside of noticeably clearing the whole page when it happens, but works for now. (As a side note that I discovered while working around this, is there a reported bug for curdoc().clear() not clearing the page? My first attempt was to clear it then add a new root, but it just duplicated everything. Or is this behaviour intentional?) |
I think this and #5518 may be related or possibly the same root cause |
Good news is that his isn't a server issue. Any The core issue here is that updating a layout, even if the model tree after update is the same and just ids are different, results in a smaller set of layout constraints. Usually 2 or 3 constraints are missing per plot. Those 2 constraints are most likely related to width and height as those are set to 0 for some of plots after update. It's a bit worrying that it can be 2 or 3, which is undeterministic, but not unexpected knowing how constraints are "collected". This and events triggering left and right explains also why initialization is so slow and layouts with many plots pretty much unresponsive. I did some preliminary work to fix this in PR #5976. |
Hello everyone! First time commenting but I've been closely following development, I'm a big supporter of the bokeh package, fantastic job done. I am having problems as well with updating multiple plots with a callback function arranged with the layout function. I was getting DeserializationErrors in version 0.12.2, bokeh serve was hanging in 0.12.5. However, the plots are updating with the callback in dev version 0.12.6 but I had to nest each plot separately in column functions. It works but I see multiple RuntimeErrors in the console. I can help with testing if needed. Thanks |
@mattpap I think this is the same issue (or related to #4810) basically, adding new models that have references to other models (such as new plots) results in
In this case, the plots render, but the toolbar does not. My guess is that patches are not being handled carefully enough in the presence of object graphs. I think it's trying to patch sub objects like new toolbar before they are actually instantiated (speculation) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When creating two plots, each one with select box acting on the data and try to replace the plot in the "on_change" callback, the change in one select box updates the corresponding plot and messes up the other (the plot disappears or some text appears behind, ...).
To reproduce the issue, simply run the code below as server and change the selection of the first select box. The first graph will update and the second will get affected. Then, changing the second select box fixes the display of the second plot and affects the first one.
Output of
bokeh info
:The text was updated successfully, but these errors were encountered: