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

Pyscript - templates and Perspective pane not working #7660

Open
niko86 opened this issue Jan 23, 2025 · 0 comments
Open

Pyscript - templates and Perspective pane not working #7660

niko86 opened this issue Jan 23, 2025 · 0 comments

Comments

@niko86
Copy link

niko86 commented Jan 23, 2025

Software Version Info

Installing the wheels recommended by the Panel website:

import micropip
await micropip.install("https://cdn.holoviz.org/panel/1.5.5/dist/wheels/bokeh-3.6.2-py3-none-any.whl")
await micropip.install("https://cdn.holoviz.org/panel/1.5.5/dist/wheels/panel-1.5.5-py3-none-any.whl")

Relevant header tag contents:

<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-3.6.2.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.6.2.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.6.2.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.6.2.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/[email protected]/dist/panel.min.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@finos/[email protected]/dist/cdn/perspective.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@finos/[email protected]/dist/cdn/perspective.min.js"></script>

<link rel="stylesheet" href="https://pyscript.net/releases/2024.11.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.11.1/core.js"></script>

Running my app in pyscript works using specific panes and widgets when served. But when serving a template it doesnt show things like collapsing the side bar etc.

import micropip
await micropip.install("https://cdn.holoviz.org/panel/1.5.5/dist/wheels/bokeh-3.6.2-py3-none-any.whl")
await micropip.install("https://cdn.holoviz.org/panel/1.5.5/dist/wheels/panel-1.5.5-py3-none-any.whl")

import panel as pn

template = pn.template.BootstrapTemplate(title="AGS Viewer")
template.sidebar.append(pn.pane.Markdown("SIDE PANEL"))
template.main.append(pn.pane.Markdown("PLOT"))
template.main.append(pn.pane.Markdown("TABLE"))
await pn.io.pyodide.write("app", template)

In the same way a perspective pane doesn't work when served.

EDIT: I have ran this with pyscript version 2024.8.1 as shown on the panel website and it also doesnt work. https://panel.holoviz.org/how_to/wasm/standalone.html

EDIT: Perspective when written using pyodide.io.write() I got the following error:
pyodide.ffi.JsException: TypeError: Cannot read properties of undefined (reading 'worker')
But with servable() I got no output.

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