Skip to content

non-png output #4

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

Closed
tobyhodges opened this issue Jun 26, 2017 · 6 comments
Closed

non-png output #4

tobyhodges opened this issue Jun 26, 2017 · 6 comments

Comments

@tobyhodges
Copy link

tobyhodges commented Jun 26, 2017

This is a really nice idea, and a good start. After reading the note about Bokeh in the Readme, my immediate thought was that I could contribute some examples using bokeh.charts or bokeh.plotting.

Unfortunately, this is limited by the requirement for plots to be output as png from the code cells in the notebook. Bokeh output is typically HTML, which can be rendered inline in a Jupyter notebook with bokeh.io.output_notebook() (docs). With the latest release, it became possible to output as png and svg but these options either require additional dependencies, or are incompatible with output into a notebook. For more, see here and here.

If you are happy to accept examples that either don't output png into the notebook, or that do output png but not inline and with additional dependencies on selenium, I would like to contribute.

@tdhopper
Copy link
Owner

@tobyhodges PNG definitely isn't a hard requirement.

Currently this works by extracting the PNG from the notebook and saving it to disk. The filename gets passed down into the Jinja template.

I can easily modify this.

Can you submit a PR with a single Bokeh example that either renders a SVG or a PNG? I can figure out how to integrate it and we can go from there.

@tdhopper tdhopper mentioned this issue Jun 26, 2017
@tdhopper
Copy link
Owner

The most important thing to me right now is that the plots are rendered in a way that I can display responsively using Bootstrap. PNG is nice because I can just use the img-fluid class. That should work with SVGs too.

@tdhopper
Copy link
Owner

@tobyhodges: I created a way to display Bokeh plots: http://pythonplot.com/index.html#simple-histogram

The notebook is just running Image(export_png(p)) to render the bokeh png (via selenium) to the output cell.

@tdhopper
Copy link
Owner

For some reason, I'm able to render these locally (on my Mac), but it's failing on travis https://travis-ci.org/tdhopper/pythonplot.com/builds/247215019

@tdhopper
Copy link
Owner

Given this, I think I'm going to give up on using Bokeh charts for the time being.

tdhopper added a commit that referenced this issue Jun 26, 2017
@tobyhodges
Copy link
Author

Ok, thanks for investigating. I'll keep an eye on the issue discussion in the bokeh project and submit a simple bokeh example once the problem has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants