-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Unsubscribe deleted plots from streams #2141
Comments
I think this is a good idea though I would want to ensure a few things:
|
Until we support JupyterLab in other ways I do not think we should let this hold things up. The APIs exist in JupyterLab but without writing an extension there's no way we're going to make this work on both and that work will/should all happen in one chunk.
Can't see how it would ever break something, all the execution would be triggered on the JS end so if it fails, at worst nothing happens. Also these APIs have been stable since very early notebook versions <3.0
This would mostly be handled in the ipython extension, so I think it's perfectly reasonable to specifically handle cell ids, but some of the plot/stream cleanup can of course use general APIs, which will probably also be useful for lifecycle hooks on bokeh server. |
Implemented in #2500 and in jupyterlab_holoviews 0.3.3 |
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 you delete or clear a cell containing a HoloViews plot subscribed to streams in the notebook the plot instance sticks around and continues to be subscribed to Stream events, which can slow things down if you redisplay the same plot. This is a major annoyance that has caught me out frequently. It should be possible to keep track of which cell a plot was displayed in and delete it and unsubscribe from any streams the plot was attached to.
The relevant Jupyter.notebook machinery is this:
with other events being listed here. Every plot that uses streams would send back the cell id on initialization and whenever a cell is deleted we could send a message back across a dedicated comm to notify Python of the cell deletion.
I think something similar may be necessary for tidying up after a bokeh server session is closed.
The text was updated successfully, but these errors were encountered: