Search code examples
vega-litegoogle-colaboratory

Using vega-lite and vega3 in Google Colaboratory


I follow the instruction to install the module here.

It seems to install fine. No errors.

But when I follow the example notebook. Nothing is displayed.

Can vega-lite be use with Colab? Or did I make a mistake somewhere?

Update: Thanks to blois, I create an example of interactive visualization in only a few lines. See this notebook.


Solution

  • Vega requires the same initialization that Altair uses, see the Altair example in the charts sample notebook: https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/charts.ipynb&scrollTo=beTgCbVa_wFA

    A complete repro of the example notebook: https://colab.research.google.com/notebook#fileId=1UHVm-vm5VXgOmT10t0eIYDa8_XPkvqui