question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New bokeh-static package

See original GitHub issue

This may not be the right place for this issue, but we can move it as appropriate. I was considering again today my annoyances with getting static plots (in particular so i can readily share static views of notebooks on github)

Additionally, firefox is now available as a conda package (https://github.com/conda-forge/firefox-feedstock). This will provide us much nicer rendering than what phantomjs spits out by default.

I’m imagining a workflow like:

conda install bokeh-export   # install selenium, pillow, phantomjs, firefox, geckodriver

# In a notebook
from bokeh_export import (
    initialize_driver,
    notebook_show as show
)
initialize_driver('firefox')  # set-up a single driver instance for faster rendering, pick your driver. use this to pass in options that are passed into a typical webdriver setup

p = figure().....
show(p)  # does the work of Ipython.display.Image(export_png(p)) with driver globally scoped to be the one setup

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
bryevdvcommented, Jul 31, 2020

We are definitely interested to look at kaleido, it’s just a matter of someone finding the time. Assuming it works as well as the complicated selenium process we have how, I’d be in favor of just taking it on as a hard dependency since (AFAIK) it is widely available on pip and conda.

1reaction
joelostblomcommented, Jul 31, 2020

@birdsarah @bryevdv You might have seen it already, but I just stumbled across the recently announced Kaleido library from plotly, which is a new library for static export of web-based graphics, with the specific goal to make this functionality widely available.

The goal of the Kaleido project is to make static image export of web-based visualization libraries as universally available and reliable as it is in matplotlib and ggplot2.

I am excited about this because I would love to see better support for this functionality across several libraries. While I don’t know how this would fit with bokeh technically, it might be something to consider instead of developing a separate library for static export. In the blog post linked above, they mention briefly how to integrate it with other libraries:

While the development of Kaleido has been motivated by the needs of the plotly.py community, we know we’re not unique in facing these challenges. We’ve designed the C++ and Python portions of Kaleido using a basic plugin architecture (Kaleido plugins are called Scopes) with the goal of making it possible to support image export for other web-based visualization libraries. If you’re interested in adding support to Kaleido for another web-based visualization library, check out the Scope (Plugin) Architecture wiki page and let us know how we can help!

Also relevant for #9169

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running a Bokeh server
The Bokeh server executes the application code with every new connection and creates a new Bokeh document, syncing it to the browser.
Read more >
Access static directory when using Bokeh as a library
Run with python main.py , but I cannot access the static directory /myapp/static . If I instead do: self.make_document(curdoc()). And start ...
Read more >
Bokeh - Quick Guide - Tutorialspoint
Bokeh package Application class which is a lightweight factory for creating Bokeh Documents. A Document is a container for Bokeh Models to be...
Read more >
Bokeh for Smarties - | notebook.community
Bokeh is a Python package that generates interactive plots for notebooks and web ... 'y0', source=source) # create another new plot and add...
Read more >
Deploying Bokeh Apps — HoloViews v1.15.3
Unfortunately, a static approach like this cannot support any HoloViews object that ... Starting a server interactively and open it in a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found