Skip to content
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

Support for multiple display output formats in the notebook #355

Merged
merged 3 commits into from Dec 13, 2015

Conversation

Projects
None yet
4 participants
@jlstevens
Copy link
Contributor

jlstevens commented Dec 13, 2015

This PR address issue #351 and makes our display system even more flexible.

You can now enable multiple display formats simultaneously (default is HTML only as before). For instance, you can now set:

hv.notebook_extension(display_formats=['html','png'])

This will display everything as normal, but also render and save PNG data (for elements) into the notebook so that it can be used by nbconvert. As extra rendering is done, running the notebook is slower and of course HoloMaps cannot be exported as PNG unless you select a single frame to display.

You can also do:

hv.notebook_extension(display_formats=['png'])

Which will force you to address HoloMaps for nbconvert and will also be faster to render. That said, your output will no longer be nicely centered due to how IPython displays images (out of our control).

The 'html' format is supported by everything but any other format is backend dependent. For instance, if you switch to Bokeh and ask for PNGs, you'll get text reprs instead (Bokeh currently doesn't export to PNG).

@philippjfr

This comment has been minimized.

Copy link
Contributor

philippjfr commented Dec 13, 2015

Looks good, great feature to have and it integrates pretty cleanly with the existing rendering and display system. Basically we now support output to different IPython backends and could easily implement implement display output to for new frontends.

philippjfr pushed a commit that referenced this pull request Dec 13, 2015

Philipp Rudiger Philipp Rudiger
Merge pull request #355 from ioam/multiple_repr
Support for multiple display output formats in the notebook

@philippjfr philippjfr merged commit abe6e6d into master Dec 13, 2015

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.1%) to 71.132%
Details
@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented Dec 13, 2015

Great!

@philippjfr

This comment has been minimized.

Copy link
Contributor

philippjfr commented Dec 13, 2015

Just tested it using Atom and Hydrogen, with both 'png' and 'svg', it displays plots nicely! Even the magics work.

screen shot 2015-12-13 at 3 38 56 am

PS: In case you're not familiar, the watch list on the right updates every time you execute code on the left. So you can watch some variable by wrapping it in a holoviews object in the watch pane.

@jlstevens

This comment has been minimized.

Copy link
Contributor Author

jlstevens commented Dec 13, 2015

@philippjfr Thanks for testing it with Hydrogen! It is really cool to see HoloViews working in something other than Jupyter Notebook. In theory, Hydrogen could even support our javascript widgets (as Hydrogen is is built on Atom, it has access to Javascript and a proper rendering engine).

@jlstevens jlstevens deleted the multiple_repr branch Dec 13, 2015

@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented Dec 14, 2015

Neat!

@majidaldo

This comment has been minimized.

Copy link

majidaldo commented May 20, 2017

what would it take for hydrogen to display the ipython widgets?

@jbednar

This comment has been minimized.

Copy link
Contributor

jbednar commented May 22, 2017

ipywidgets is a separate project, and isn't used by HoloViews. Not sure how much work it would take to get the JavaScript widgets that it does use working...

@jlstevens

This comment has been minimized.

Copy link
Contributor Author

jlstevens commented May 22, 2017

I think in this case the question is about the HoloViews widgets.

A while back I do think I got a slider working with hydrogen. I can try again but my worry is that if I do get it working, none of us use hydrogen to make sure anything we add to HoloViews stays working and supported.

@jlstevens

This comment has been minimized.

Copy link
Contributor Author

jlstevens commented May 23, 2017

I had another go at getting the widgets working with nteract but without success. When we get round to the widget Javascript code refactor we should look into some way of generating JS code that is self contained and includes all the necessary dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.