widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.85k stars 136 forks source link

solara.FigurePlotly leads to empty plot in Google Colab #323

Open ramnathv opened 11 months ago

ramnathv commented 11 months ago

First off, this is an amazing project! Combines the ease of use of a framework like Streamlit, and the sophistication of Dash :clap: I tried running this plotly example in Google Colab, but it gave me an empty plot. My browser console displayed a lot of error messages, and I am happy to copy-paste them if it would help debug.

https://github.com/widgetti/solara/blob/master/solara/website/pages/examples/basics/sine.py

I tried it in a VS Code Jupyter Notebook and it works perfectly. I suspect this is a Google Colab related issue.

iisakkirotko commented 11 months ago

Hi @ramnathv!

Indeed, we have had some other difficulties with Google Colab previously. I was wondering whether the error messages were related to requirejs/require (see, for instance https://github.com/widgetti/solara/pull/292)?

ramnathv commented 11 months ago

I am not seeing requirejs errors in colab. This is what I see in the browser console.

image

Here is a minimal reproducible example in Google Colab https://colab.research.google.com/drive/1MPCrljz7BsNyd5fx8CQnMvwWBpEfTRnR?usp=sharing

tpike3 commented 3 weeks ago

I think this error or a version of it is back. Previously the Mesa tutorial rendered fine in colab but now it is not rendering.

Direct Colab link

maartenbreddels commented 3 weeks ago

I think this error or a version of it is back. Previously the Mesa tutorial rendered fine in colab but now it is not rendering.

It's a similar error indeed, but now for the GridDraggable. I'm not sure why Mesa is using that, but we should fix it anyway.

maartenbreddels commented 2 weeks ago

The error by @tpike3 is solved by https://github.com/widgetti/solara/pull/763 (Solara 1.39.0) but the plotly error is not related to this I think.

@ramnathv did you try a normal plotly figure, and a plotly figure widget?