8000 Add Panel DeckGL example by philippjfr · Pull Request #27 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content
8000

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

Merged
merged 3 commits into from
Apr 19, 2022
Merged

Add Panel DeckGL example #27

merged 3 commits into from
Apr 19, 2022

Conversation

philippjfr
Copy link
Contributor

deck_gl_interactive
hover_arcs

@mcg1969
Copy link
mcg1969 commented Apr 17, 2022

If you want, add these three meta lines to your head, and you can get a full-screen web app experience on iOS.

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="theme-color" content="#0072b5">

@philippjfr
Copy link
Contributor Author

Thanks @mcg1969! Added that and made a few changes:

  • Now reveals arcs on click (not hover)
  • Updates arcs when the current view changes

Copy link
Contributor
@fpliger fpliger left a comment

Choose a reason for hiding this comment

The reason will be display 10000 ed 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):

Copy link
Contributor

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
Copy link
Contributor

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'])
Copy link
Contributor

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>?

Copy link
Contributor Author

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.

Copy link
Contributor

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'])
Copy link
Contributor

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>?

@fpliger fpliger merged commit 956de2a into main Apr 19, 2022
@fpliger fpliger deleted the panel_deckgl branch April 19, 2022 16:20
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

Successfully merging this pull request may close these issues.

3 participants
0