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

FigureAltair does not render in jupyter/colab #287

Open
rlskoeser opened this issue Sep 12, 2023 · 5 comments
Open

FigureAltair does not render in jupyter/colab #287

rlskoeser opened this issue Sep 12, 2023 · 5 comments

Comments

@rlskoeser
Copy link

I'm working one some some code generating altair charts and they display just fine when I use the local solara runserver, but when I try to render them in jupyter and colab, nothing displays.

I don't see any python errors to help diagnose the problem; in the browser javascript console for Colab, I see these javascript errors:

ReferenceError: requirejs is not defined
...
TypeError: this.do_plot_debounced is not a function
...

I installed altair 5.1.1 in Colab to match the version in my local python environment.

I've done some googling for these errors but not found anything that seemed directly applicable.

Please advise on how to resolve or how else I can troubleshoot. Thank you!

@tpike3
Copy link

tpike3 commented Sep 13, 2023

I believe I am having a similar issue as @rlskoeser I can get the Altair example to render wrapping the example in code in display --

display(alt.Chart(source, title="Daily Max Temperatures (C) in Seattle, WA").mark_rect().encode( alt.X("date(date):O").title("Day").axis(format="%e", labelAngle=0), alt.Y("month(date):O").title("Month"), alt.Color("max(temp_max)").title(None), tooltip=[ alt.Tooltip("monthdate(date)", title="Date"), alt.Tooltip("max(temp_max)", title="Max Temp"), ], ).configure_view( step=13, strokeWidth=0 ).configure_axis( domain=False ))

but the chart doesn't dynamically update like with the .py files rendered in the browser. This is the same for the ipyleaflet advanced where the map is dynamic in that I can move the marker but the location does not update and then if I click the reset or zoom marker the other widgets will update (i.e. zoom level) but the map does not.

@maartenbreddels
Copy link
Contributor

maartenbreddels commented Sep 13, 2023

Hi Rebecca,

thanks for opening the issue. Are you using Jupyter Lab or notebook, and which version are you using.

@tpike3 I do not think the ipyleaflet issue is related, could you open a new issue for that and precisely describe how I can reproduce it (do you use solara server/jupyter lab/notebook, and which versions)

Regards,

Maarten

@rlskoeser
Copy link
Author

Hi @maartenbreddels, thanks for responding.

I was initially using Colab. I don't know if there's a way to see anything about version information there, do you know? When it didn't work there, I tested with a Jupyter notebook running through Jupyter Lab version 4.0.1. I could try upgrading that if you think it would help, but I do want to be able use this in Colab.

@maartenbreddels
Copy link
Contributor

Dear Rebecca,

Thank you for the additional information. The next release should have a fix for both classic notebook and Jupyter Lab via #288
Colab is a bit more complicated. A draft PR is available from #292
But we need to have a bit more information from googlecolab/colab-cdn-widget-manager#43 to be sure this is a correct fix and does not lead to new issues.

Regards,

Maarten

@rlskoeser
Copy link
Author

@maartenbreddels thanks for addressing this so quickly, that's fantastic. I appreciate knowing the status of this.

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