Matplotlib and plotly can render on github from inside notebooks when they are pushed, creating impressive outputs directly available in the browser on github. It would be great if hvplot charts could be rendered inline in jupyter notebooks on github as well.
Hey @LinuxIsCool, this is actually a limitation of Github that doesn’t render HTML/CSS/Javascript for security reasons, you can read more on their site Working with non-code files - GitHub Docs (funnily their example of what notebooks can’t be rendered well on Github is a Bokeh example). They advise using nbviewer when trying to visualize a notebook with interactive content.
Plotly offers ways to pick a different renderer (e.g. png, svg) and that can be used as a work around to save notebooks that can be visualized on Github, you can read more about it in this issue How to display plotly outputs on Github? · Issue #931 · plotly/plotly.py · GitHub. But I don’t think you can render an interactive Plotly plot on Github?
As for setting HoloViews to generate static Bokeh plots:
if I remember correctly producing PNG requires Selenium, I don’t think I’ve ever tried that but I guess the experience isn’t great (probably quite slow!)
I find bokeh to be the most aesthetic and useful backend to work with. I really look forward to a day where I can embed static bokeh outputs into github. I’m not concerned with interactive functionality, just getting a static display would be really nice.
It’s a little surprising since the bokeh widgets have the ‘save’ tool which exports as png. I would think that would imply that there is an easy way to set outputs to be png in the notebook? I believe this is how plotly achieves rendering.
I believe the Bokeh ‘save’ tool relies on some browser capabilities and doesn’t involve Python, while what we’re trying to achieve is to create static plots running Python. Bokeh plots can be produced as PNG but you need Selenium + some browser drivers, so in the end it does rely on the browser but it’s all driven by Python. Plotly plots are generated thanks to GitHub - plotly/Kaleido: Fast static image export for web-based visualization libraries with zero dependencies that look like an interesting project. In general it’d be very cool for someone to explore that space and list the options available, and ideally do the work to improve Bokeh!