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

Ipyvolume #15

Open
scrgiorgio opened this issue Feb 22, 2023 · 0 comments
Open

Ipyvolume #15

scrgiorgio opened this issue Feb 22, 2023 · 0 comments

Comments

@scrgiorgio
Copy link

Would this work with ipyvolume?

I have this app.py:

import panel as pn
pn.extension(sizing_mode="stretch_width", template="fast")

pn.state.template.param.update(
    site_url="https://awesome-panel.org",
    site="Awesome Panel",
    title="Hello World",
    favicon="https://raw.githubusercontent.com/MarcSkovMadsen/awesome-panel-assets/320297ccb92773da099f6b97d267cc0433b67c23/favicon/ap-1f77b4.ico",
)

import ipyvolume as ipv
import numpy as np
pn.config.css_files.append("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css")

import ipyvolume as ipv
fig = ipv.figure()
V = np.zeros((128,128,128)) 
V[30:-30,30:-30,30:-30] = 0.75
V[35:-35,35:-35,35:-35] = 0.0
V[50:-50,50:-50,50:-50] = 0.25
V[55:-55,55:-55,55:-55] = 0.0
ipv.volshow(V, level=[0.25, 0.75], opacity=0.03, level_width=0.1, data_min=0, data_max=1)
ipv.view(90, 0)

pn.panel(fig).servable()

With requirements:

awesome-panel-extensions
black
invoke
isort
mypy
pandas
panel~=0.14
pylint
numpy
scikit-image
ipyvolume==0.6.0
ipython_genutils
ipywidgets_bokeh

I did:

python3 -m pip install -r requirements.txt -U
panel convert src/myapp/app.py --to pyodide-worker --out docs/myapp
# NO ERRORS so far
python3 -m http.server
#  open this in Chrome http://localhost:8000/docs/myapp/app.html

But it's saying it Can't find a pure Python 3 wheel for 'tornado>=6.1'..
I think I made it work on JupyterLite (by patching ipyvolume) but I cannot make it work as a Panel serverless dashboard.

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

1 participant