Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altair v3 on Colab? Requires Vega 5, not Vega 4. #1464

Closed
jheer opened this issue May 1, 2019 · 4 comments
Closed

Altair v3 on Colab? Requires Vega 5, not Vega 4. #1464

jheer opened this issue May 1, 2019 · 4 comments

Comments

@jheer
Copy link
Member

jheer commented May 1, 2019

(Apologies if this is the wrong place to post this issue, but at this point I don't yet know if this is an "Altair issue", an "ipyvega issue", or a "Colab issue".)

I'm trying to use Altair 3.0 on Colab. If I run pip install --upgrade altair vega in the notebook, I can update from Colab's default of v2.4.1 to the latest 3.0.0. So far so good!

I can then start creating charts, but then I notice that some are not rendering correctly. Opening the web inspector, I can see that the generated HTML includes imports from jsdelivr for Vega-Lite@3.2.1 (good!) and Vega@4 (not good!). Vega-Lite 3+ requires Vega 5. Without it, a number of 3.x features will not work correctly.

If this is due to Altair's output, consider this a bug fix request. If not, feel free to close the issue, in which case any pointers to patch things up on the ipyvega or Colab side are welcomed! Flagging @domoritz as well.

@jakevdp
Copy link
Collaborator

jakevdp commented May 1, 2019

Yeah, that was an oversight – I fixed it in #1461.

For the time being, you can hack it by running the following after you import altair:

alt.display.colab_renderer.kwargs.update({'vega_version': '5', 'vegaembed_version': '4'})

@jheer
Copy link
Member Author

jheer commented May 1, 2019

Ok, thanks!

@jheer jheer closed this as completed May 1, 2019
@jakevdp
Copy link
Collaborator

jakevdp commented May 10, 2019

For anyone coming across this, the hack described above is no longer necessary to use Altair in Colab.

@lee-werner
Copy link

lee-werner commented Jul 21, 2020

Thanks for the closure Jake!

-- internet person coming across this post a year later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants