Save Bokeh Plot as Bokeh Plot
See original GitHub issueI would like to save a snapshot of Bokeh plot created by a Bokeh server application in all of the following ways:
- Download the contents of the ColumnDataSource as JSON/msgpack/whatever
- Download a static HTML file of the Bokeh plot
- Publish that bokeh plot as a gist
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.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:15 (13 by maintainers)
Top GitHub Comments
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
CustomAction
custom toolbar button it would then be trivial to make a toolbar button to export to json and do whatever you liked with it.I will use this issue for this work.
Noting that as part of this work,
BOKEH_SIMPLE_IDS=1
should be made the default.