-
-
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
Save Bokeh Plot as Bokeh Plot #5231
Comments
This is something we are tried/trying to jerry rig. Some of the issues we ran into were (1) legend placement (2) combining multiple widgets with widgets that were not on a canvas (3) data tables.
That was trivial, since ColumnDataSource (for us) originates as a dataframe. Personally not a fan of msgpack for this user case. We ran into datetime datatype issues when we wanted to read the file back for debugging.
Yes! I for one would love to have all three functions proposed by @mrocklin |
As part of "whatever" we could consider CSV as proposed in PR #4228. Allowing JSON could be useful as well. |
Using the Bokeh stock example as a simple use case to illustrate some problems we encountered. Problem(s)There are plenty of times where the user may want to save only certain widgets/figures.
Since every Bokeh doc is unique it becomes hard to generalize what the user wants saved or not. Proposed SolutionCreating a
|
@mrocklin Would |
Probably not, no |
All the current tools apply only to the plot they are on, and I don't think that should change. That is, an export tool that was on a particular plot should save information only for recreating that particular plot. If the intent is to save an entire layout or document, I think that should be handled differently. For example, a button, outside of any particular plot, could be configured with what to save. Although, I think no-configuration would be easier for users and developing alike: a button callback that just exports the current document as-is in its current state would be my definite preference. |
There are two possible routes to go that I can think of:
|
Personally I care more about saving single plots than entire documents. |
That's probably actually a fairly harder case. Basically individual models can't be meaningfully or faithfully serialized outside the context of the entire document they inhabit. What if the plot has a CustomJS callback and the callback is configured with models or data sources for/from other plots? Things can't really be taken in isolation like that. The more I think about it, for a general tool, "whole-document" export is probably the only realistic option. @mrocklin this is another reason I think you might be better off with a custom tool. A custom tool can bake in simplifying assumptions (in your case about the structure of the Dask dashboard app, and what is the exact and "minimum" set of things that could be surgically exported) that a general tool can't make. |
OK, sounds like I should pursue this through a custom tool. There is really just one major plot that I care about. I'm ok to close this. |
Here is a reference implementation of whole document export:
|
This would be a nice feature ! One user working on a bokeh standalone html file with widgets may want to share his analysis with an other user. Currently, he has to say to the other user how to adjust sliders, etc ... to have the same plots. Currently, using browser 'save as' feature produce an half working html. From the slider example, if One change sliders, and save the page to html, the document is duplicated in two parts:
|
@mrocklin, I am trying to export bokeh plots from dask dashboard to html, and I was wondering if you could share the method you use to save plots (like the ones you have in your blog articles) in static html files? For instance, http://matthewrocklin.com/blog/work/2017/03/22/dask-glm-1. Thanks! |
FYI I am soon working on making "export to JSON, load from JSON" simpler to do. It is possible to do this now:
Now the above only specifically concerned exporting to JSON from python more easily from python but the JS "embed" function needs to be made simpler too, and I will see about rounding things out with an easy way to also export from BokehJS. Combined with the new I will use this issue for this work. |
Noting that as part of this work, |
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. |
I would like to save a snapshot of Bokeh plot created by a Bokeh server application in all of the following ways:
Dask's use case
For example with Dask.distributed, the current best way to have a discussion about performance is by referring to our task-stream diagnostic Bokeh plot. This occurs when I write blogposts discussing algorithms and when users have performance questions. If there was a Bokeh Tool that let users publish a static view of their task-stream plot as a gist from within the Dask Dashboard then it would elevate the level of conversation significantly (and produce a lot of cool looking Bokeh images). As a pleasant side effect, I would start including Bokeh plots way more often when writing blogposts and documentation.
How to do this?
When I briefly mentioned this to @birdsarah she recommended building a custom tool like the current
SaveTool
for Dask which would dump to one of the above forms rather than to png. However, looking at this a bit more I don't think that this functionality necessarily needs to be Dask-specific. This may be of general utility and would, I think, encourage people to embed Bokeh plots more often within broadcast publications. For example if they built a Bokeh plot in a notebook but wanted to include it in a blogpost then this might help.The text was updated successfully, but these errors were encountered: