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.

What's the best way to get Altair plots to show up outside of jupyter/colab/etc UIs?

See original GitHub issue

I’d love to build in support for Altair plots in jupyter-book (link). However, I can’t figure out how to get Altair plots to show up there (when the notebooks are converted to markdown, instead of the display code there, the Vega 2 object output that others have reported is there).

Is there some way to make vega HTML be generated when you convert the notebook, that could then be rendered similar to how ipyleaflet works? (for example, here is an ipyleaflet output converted to markdown w/ nbconvert…it just keeps the raw HTML code). It seemed like the HTML export gets pretty close.

Or, is there a way to get nbconvert to render all the vega plots as high-res PNG when it converts them? From looking at the docs it seems like this would require selenium

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
jakevdpcommented, Nov 23, 2019

Closing the loop on this: #1793 adds an HTML renderer that works in a variety of environments, including notebook, lab, nbviewer, nbconvert, kaggle, colab, and likely others.

2reactions
ian-r-rosecommented, Feb 19, 2019

@choldgraf I did some experimenting today to make a vega (and JSON, and VDOM) preprocessor for nbconvert, allowing HTML representations to be embedded in notebooks via a CLI: https://github.com/ian-r-rose/jupyterlab-nbconvert

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displaying Altair Charts — Altair 4.2.0 documentation
Altair charts work out-of-the-box on Jupyter Notebook, JupyterLab, ... outputs a PNG representation of the plot, which is useful to view plots offline...
Read more >
Is there a good way to generate plots from a console?
The challenge is that Altair requires a Javascript engine in order to render plots, so it's a natural fit for platforms like JupyterLab,...
Read more >
How to view altair chart on non-notebook environment
See Working in non-notebook environments in Altair's documentation for information on displaying charts in non-notebook environments.
Read more >
Some Altair 3.0 Charts Are Not Displayed In Google Colab
For an overview of the different options in Python, PyViz is a great resource to explore! ... What's the best way to get...
Read more >
How to Create Interactive Plots with Altair | by Khuyen Tran
How to Create Interactive Plots with Altair. Leverage your Data Analysis in 5 Simple Lines of Python Codes. What is Altair? Have you...
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