-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Panel DeckGL example #27
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
Conversation
If you want, add these three meta lines to your head, and you can get a full-screen web app experience on iOS.
|
Thanks @mcg1969! Added that and made a few changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments but overall lgtm. THIS DEMO IS AMAZING!!
MAPBOX_KEY = "pk.eyJ1IjoicGFuZWxvcmciLCJhIjoiY2s1enA3ejhyMWhmZjNobjM1NXhtbWRrMyJ9.B_frQsAVepGIe-HiOJeqvQ" | ||
|
||
class App(pn.viewable.Viewer): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these line spaces intentional? Perhaps some editor weirdness? I think it could make sense to actually do <pyscript ="panel_deckgl.py">
so it's a little cleaner and easier to edit?
import micropip | ||
|
||
from io import StringIO | ||
from js import fetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also use:
from pyodide.http import pyfetch
that is a wrapper already provided by pyodide. Longer term, imho, we should provide a common shared API/Modules that are not runtime specific (like this one)
@@ -72,7 +71,7 @@ | |||
import asyncio | |||
import micropip | |||
|
|||
await micropip.install(['panel==0.13.0rc11', 'altair']) | |||
await micropip.install(['panel']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you install it in the context of <py-env>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I get:
Uncaught (in promise) Error: No known package with name 'panel'
I think this is because <py-env>
only looks at the pyodide package repository which only contains packages explicitly compiled for pyodide. I was hoping to submit a PR that allows <py-env>
to fall back to PyPI but haven't had a chance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooooooh... my bad lol. In my head I was sure I fixed that (was a known thing). I'll fix that and then change the example later, if that works for you.
In that case, are you ok to merge this?
@@ -20,7 +20,7 @@ <h1>Panel Example</h1> | |||
import asyncio | |||
import micropip | |||
|
|||
await micropip.install(['panel==0.13.0rc10']) | |||
await micropip.install(['panel']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you add this in <py-env>
?