-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Conversation
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. |
Support for multiple display output formats in the notebook
Great! |
Just tested it using Atom and Hydrogen, with both 'png' and 'svg', it displays plots nicely! Even the magics work. 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. |
@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). |
Neat! |
what would it take for hydrogen to display the ipython widgets? |
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... |
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. |
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. |
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:
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:
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).