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.

Default renderer in Altair 4 does not render plots in a Jupyter notebook on GitHub.com

See original GitHub issue

Pre-v4, Altair plots inside a Jupyter notebook rendered very nicely on Github.com - this allowed our TAs to mark the HTML rendering of Jupyter notebooks on GH.

However since upgrading to Altair 4, this handy feature is now broken - likely because the renderer changed.

Here’s an example in my repo.

I have found a workaround by switching to the png renderer, but of course this has the consequence of disabling the nice interactive features in Altair.

Could you suggest which renderer we should switch to so that we can still have interactive features in our notebook, and have it render as an image on GH ?

Screen Shot 2020-02-29 at 6 19 01 PM

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jakevdpcommented, Mar 1, 2020

Great! Note one other difference: with the default renderer, charts on nbviewer will be interactive. With the mimetype renderer, they will be static (because nbviewer doesn’t have the frontend extension necessary to render vega-lite mimetypes).

1reaction
jakevdpcommented, Mar 1, 2020

You can open the notebook in nbviewer if you want to be able to view Altair charts in a notebook from GitHub. I use the Open in nbviewer browser extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Troubleshooting — Altair 4.2.0 documentation
If you are using Altair outside of a Jupyter notebook environment (such as a Python or IPython terminal) charts will be displayed as...
Read more >
Why are my Altair Data Visualizations not showing up in Github?
Github's notebook viewer does not execute any embedded Javascript code, presumably for security reasons. Altair charts are rendered via ...
Read more >
Working with Jupyter Notebooks in Visual Studio Code
Note: There is support for rendering plots created with matplotlib and Altair. Custom notebook diffing. Under the hood, Jupyter Notebooks are JSON files....
Read more >
Interactive data visualizations - Jupyter Book
If you are trying to include both plotly plots and mathematical notation within the same page, and finding that plotly plots are not...
Read more >
Creating Choropleth Visualizations with Altair
In order to render Altair plots in Jupyter Notebook, you must enable the "alt.renderers.enable('notebook')." If you're interested in saving your maps or any ......
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