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

Jupyter notebook is not displaying charts inline #412

Open
dove88 opened this issue Apr 22, 2022 · 10 comments
Open

Jupyter notebook is not displaying charts inline #412

dove88 opened this issue Apr 22, 2022 · 10 comments

Comments

@dove88
Copy link

dove88 commented Apr 22, 2022

Hello, I am trying to render Altair charts in jupyter notebook, but I am getting only blank inline output.
I am using "alt.renderers.enable('notebook')" renderer option in my jupyter notebook.
'Mimetype' renderer is working fine in jupyter lab.

I have attached browser console for more details, kindly advise me to how can I solve the issue?

Altair version - 4.2.0
Vega version - 3.6.0
Jupyter notebook version - 6.4.10
ipykernel 6.4.1
ipython 8.2.0
ipywidgets 7.6.5
Browser Mozilla Firefox

Please do the needful
Thank you
IMG_20220421_201827

@jakevdp
Copy link
Contributor

jakevdp commented Apr 22, 2022

Can you paste the code you executed that resulted in this console log? A minimal reproduction if possible.

@jakevdp
Copy link
Contributor

jakevdp commented Apr 22, 2022

(the actual code text rather than a screenshot, please)

@jakevdp
Copy link
Contributor

jakevdp commented Apr 22, 2022

The mention of nosniff may be a clue - it could be your local browser/firewall configuration (similar to this issue: https://stackoverflow.com/a/53062522)

@dove88
Copy link
Author

dove88 commented Apr 22, 2022

This is working fine with jupyter lab, only issue is with jupyter notebook.
However I turned to jupyterlab while working with Altair charts.

I just noticed jupyter-vega.js is not loading in the browser, infact I saved 'jupyter-vega.js' on my desktop and found no script was in the file i.e, it was a blank file.

@dove88
Copy link
Author

dove88 commented Apr 22, 2022

(the actual code text rather than a screenshot, please)

import altair as alt
from vega_datasets import data
alt.renderers.enable('notebook')

source = data.seattle_weather()

alt.Chart(source).mark_bar(
    cornerRadiusTopLeft=3,
    cornerRadiusTopRight=3
).encode(
    x='month(date):O',
    y='count():Q',
    color='weather:N'
)

@jakevdp
Copy link
Contributor

jakevdp commented Apr 22, 2022

Thanks. My current guess is it's a browser configuration/firewall issue as I mentioned above. I'm not sure I'm going to be able to help beyond giving you that bread-crumb trail to follow.

I suggest you look into your local browser/firewall configuration to try and figure out why it's blocking the page from loading the javascript associated with the ipyvega nbextension. Unfortunately, that's not something that's easy to help with from afar.

@dove88
Copy link
Author

dove88 commented Apr 22, 2022

Thank you for your great help and suggestion. I will look into your comments and figure it out if possible with me. Meantime I have jupyter lab, and will progress with it.

@kavodsky
Copy link

kavodsky commented Oct 13, 2022

I have the same issue using vega example notebook, except no error is displayed in the web developer console.

Screenshot 2022-10-13 at 13 41 57

Altair in the same notebook renders perfectly.

Screenshot 2022-10-13 at 13 42 10

@kavodsky
Copy link

With widget receive next errors:

Screenshot 2022-10-13 at 14 49 42

@domoritz
Copy link
Member

Can you try again with the latest master?

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

4 participants