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

Interactive plot with selection does not render #44

Open
akshayka opened this issue Oct 15, 2024 · 3 comments
Open

Interactive plot with selection does not render #44

akshayka opened this issue Oct 15, 2024 · 3 comments

Comments

@akshayka
Copy link

I attempted the tutorial on creating a plot with selection, but was met with an infinitely spinning spinner.

Here is a Colab notebook that demonstrates the issue. I am using datamapplot==0.4.2:

https://colab.research.google.com/drive/14Taj65FefFboB-7Ipi-RAZ1ADVeZWvpc?usp=sharing

I encountered the same issue in a local marimo notebook. I did not try in a local Jupyter notebook.

@lmcinnes
Copy link
Contributor

lmcinnes commented Oct 15, 2024

I believe this is specific to having inline_data=False, since it saves separate data files off which the HTML then fetches and parses. This works fine for general serving of webpages, but gets trickier when going through an iframe srcdoc inside of a notebook.

There is some special code that hacks the html so that things work within Jupyter. I believe colab has slightly different paths/properties. I'm sure Marimo doesn't have Jupyter's convolutions. We may need to have similar contortions specific to colab, and then other handling for Marimo. Let me see if I can work out colab. For your reference the handling is here, and amounts to working around the fact that you can't actually fetch files via jupyters web address because jupyter intercepts the requests, so it rewrites what works for ordinarily served web-pages to work within jupyter, as well as trying to handle the fact that we are buried in a srcdoc, so some other wrangling needs to be done to get the server address.

@lmcinnes
Copy link
Contributor

So inline_data=False is simply not going to work with colab unfortunately, since it doesn't save files in a way that you can fetch them without integrati8ng with google drive (which I can understand people not wanting to do). What I can hopefully do is detect if it is being run in google colab and providing a warning that things won't work as intended.

@akshayka
Copy link
Author

Thanks for the source pointer. I can see if I can get it working in marimo

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

2 participants