This notebook demonstrates the installation and use of altair-saver. The following was tested in Colab, (and is being sanity checked in Next journal and Deepnote)
it came from here:
You can see me trying to run this on deepnote too, to see if the issue is related to nextjournal:
Off we go…
Setup Selenium + Chromedriver
Setup npm and the Vega CLI
Create and save a chart
View saved charts
Here we use a variety of IPython display mechanisms to load and display the saved charts.
Alternatively, you can enable an altair-viewer renderer and display the chart within a notebook as a specific type or set of types.
For example, the following encodes both the vega-lite custom mimetype (which is supported by JupyterLab and other frontends via custom frontend extensions), as well as a PNG fallback that will be displayed in other environments:
The content of the output can be confirmed by looking at the
_repr_mimebundle_ method, which is the special method used by IPython/Jupyter for rich rendering:
This repo is mounted by: Python