mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
35 lines
1.2 KiB
HTML
35 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>Panel Example</title>
|
|
<meta charset="iso-8859-1">
|
|
<link rel="icon" type="image/x-icon" href="./favicon.png">
|
|
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.js"></script>
|
|
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.13.1/dist/panel.min.js"></script>
|
|
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
|
|
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
|
|
</head>
|
|
<py-config>
|
|
packages = [
|
|
"bokeh",
|
|
"numpy",
|
|
"panel==0.13.1"
|
|
]
|
|
</py-config>
|
|
<body>
|
|
<h1>Panel Example</h1>
|
|
<div id="simple_app"></div>
|
|
<py-script>
|
|
import panel as pn
|
|
|
|
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
|
|
|
|
def callback(new):
|
|
return f'Amplitude is: {new}'
|
|
|
|
pn.Row(slider, pn.bind(callback, slider)).servable(target='simple_app');
|
|
</py-script>
|
|
</body>
|
|
</html>
|