Skip to content

Commit c06f7a0

Browse files
authored
Merge pull request #78 from stonebig/master
update
2 parents fdbe650 + 56b92cc commit c06f7a0

11 files changed

+1801
-27
lines changed

docs/jupyterlite_xeus/demo_jupyterlite_xeus_matplotlib_request_api.ipynb

Lines changed: 323 additions & 0 deletions
Large diffs are not rendered by default.

docs/pyscript/panel_kmeans.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
4343
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
44+
<link rel="stylesheet" href="./assets/css/examples.css" />
45+
<link rel="stylesheet" href="./assets/prism/prism.css" />
46+
<script defer src="./assets/prism/prism.js"></script>
4447
</head>
4548

4649
<body>

docs/pyscript/test.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-2.4.2.js"></script>
77
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.2.min.js"></script>
88
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.2.min.js"></script>
9-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/[email protected].0/dist/panel.min.js"></script>
9+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/[email protected].2/dist/panel.min.js"></script>
1010
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
1111
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
1212
</head>
@@ -15,17 +15,19 @@
1515
packages = [
1616
"bokeh",
1717
"numpy",
18-
"panel==0.14.0",
18+
"panel==0.14.2",
1919
"altair",
2020
"pandas",
2121
"vega_datasets"
2222
]
2323
</py-config>
2424

2525
<h1>Basic Example</h1>
26-
<div id="myapp"></div>
27-
<py-script output="myapp">
28-
# was ok with https://pyscript.net/2022.06.1/pyscript.js
26+
<div>
27+
<py-terminal>
28+
</div>
29+
<py-script>
30+
# was ok with https://pyscript.net/2022.12.1/pyscript.js
2931
# you can try last official release: https://pyscript.net/latest/pyscript.js and css
3032
# or current unstable master: https://pyscript.net/unstable/pyscript.js and css
3133

@@ -42,7 +44,7 @@ <h1>Panel Example</h1>
4244

4345

4446

45-
<py-script output="simple_app">
47+
<py-script>
4648
import panel as pn
4749

4850
slider = pn.widgets.FloatSlider(start=0, end=10, name='Amplitude')
@@ -58,7 +60,7 @@ <h1>Altair Example</h1>
5860
<div id="altair"></div>
5961

6062

61-
<py-script output="altair">
63+
<py-script>
6264
import altair as alt
6365
from vega_datasets import data
6466

@@ -93,13 +95,13 @@ <h1>Altair Example</h1>
9395
height=200
9496
).add_selection(pts)
9597

96-
alt.vconcat(
98+
display(alt.vconcat(
9799
rect + circ,
98100
bar
99101
).resolve_legend(
100102
color="independent",
101103
size="independent"
102-
)
104+
), target="altair")
103105
</py-script>
104106
</body>
105107
</html>

docs/pyscript/test_baresql.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.13.1/dist/panel.min.js"></script>
3+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.14.2/dist/panel.min.js"></script>
44

55
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
66
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
@@ -13,9 +13,12 @@
1313
]
1414
</py-config>
1515
<h1>baresql Example</h1>
16-
<div id="myplot"></div>
16+
<div id="Test baresql"></div>
17+
<div>
18+
<py-terminal>
19+
</div>
1720
<py-script>
18-
# was ok with https://pyscript.net/2022.06.1/pyscript.js
21+
# was ok with https://pyscript.net/2022.12.1/pyscript.js
1922
# you can try last official release: https://pyscript.net/latest/pyscript.js and css
2023
# or current unstable master: https://pyscript.net/unstable/pyscript.js and cssfrom __future__ import print_function, unicode_literals, division # if Python2.7
2124

@@ -26,7 +29,7 @@ <h1>baresql Example</h1>
2629
users = ['Alexander', 'Bernard', 'Charly', 'Danielle', 'Esmeralda', 'Franz']
2730
# We use the python 'users' list like a SQL table
2831
sql = "select 'Welcome ! ' , c0 from users$$"
29-
bsqldf(sql)
32+
print(bsqldf(sql))
3033
</py-script>
3134
</body>
3235
</html>

docs/pyscript/test_fetch.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
4+
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
5+
</head>
6+
<body>
7+
<py-config>
8+
packages = [ "sqlite-utils"]
9+
# this runs if we launch fetch.html from 'http://127.0.0.1:8000/fetch.html'
10+
# error is : PyScript: Access to local files (using "Paths:" in <py-config>) is not available when directly opening a HTML file
11+
[[fetch]]
12+
#from = 'http://127.0.0.1:8000/'
13+
from = 'http://localhost:8000/'
14+
files = ['readme.txt']
15+
to_folder = './here'
16+
[[fetch]]
17+
from = "https://pyscript.net/examples/"
18+
files = ["utils.py"]
19+
to_folder = "docs"
20+
[[fetch]]
21+
from = "https://gist.githubusercontent.com/FabioRosado/faba0b7f6ad4438b07c9ac567c73b864/raw/37603b76dc7ef7997bf36781ea0116150f727f44/"
22+
files = ["todo.py"]
23+
to_folder = "docs"
24+
</py-config>
25+
<h1>Fetch Example</h1>
26+
<div id="myplot"></div>
27+
<div>
28+
<py-terminal>
29+
</div>
30+
<py-script>
31+
import os
32+
for d in os.walk('.'):
33+
for file in d[2]:
34+
print(f'{d[0]}/{file}')
35+
36+
37+
with open('./here/readme.txt', 'r') as fp:
38+
print(fp.read())
39+
40+
</py-script>
41+
</body>
42+
</html>

docs/pyscript/test_pygad.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
<html>
22
<head>
3-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.13.1/dist/panel.min.js"></script>
3+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@holoviz/panel@0.14.1/dist/panel.min.js"></script>
44

55
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
66
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
77

88
</head>
99
<body>
10-
</py-script>
10+
1111
<py-config>
1212
packages = [
1313
"sqlite-utils", "pygad"
1414
]
1515
</py-config>
16-
<h1>Sqlite-utils Example</h1>
16+
<h1>Pygad Example</h1>
1717
<div id="myplot"></div>
18+
<div>
19+
<py-terminal>
20+
</div>
1821
<py-script>
19-
# was ok with https://pyscript.net/2022.06.1/pyscript.js
22+
# was ok with https://pyscript.net/2022.12.1/pyscript.js
2023
# you can try last official release: https://pyscript.net/latest/pyscript.js and css
2124
# or current unstable master: https://pyscript.net/unstable/pyscript.js and css
2225

@@ -96,11 +99,5 @@ <h1>Sqlite-utils Example</h1>
9699
loaded_ga_instance = pygad.load(filename=filename)
97100
loaded_ga_instance.plot_fitness()
98101

99-
100-
101-
db = sqlite_utils.Database(memory=True)
102-
print(list(db.query("select 3 * 5")))
103-
print('sqlite-version', list(db.query("select sqlite_version()")))
104-
</py-script>
105-
</py-script>
102+
</py-script>
106103
</html>

docs/pyscript/test_pyscript_altair.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"vega_datasets"
1616
]
1717
</py-config>
18-
<py-script output="altair">
18+
<py-script>
1919
import altair as alt
2020
from vega_datasets import data
2121

@@ -50,13 +50,13 @@
5050
height=200
5151
).add_selection(pts)
5252

53-
alt.vconcat(
53+
display(alt.vconcat(
5454
rect + circ,
5555
bar
5656
).resolve_legend(
5757
color="independent",
5858
size="independent"
59-
)
59+
), target="altair")
6060
</py-script>
6161
</body>
6262
</html>

docs/pyscript/test_sqlite.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
</py-config>
1212
<h1>Sqlite-utils Example</h1>
1313
<div id="myplot"></div>
14+
<div>
15+
<py-terminal>
16+
</div>
1417
<py-script>
1518

1619
# was ok with https://pyscript.net/2022.06.1/pyscript.js

0 commit comments

Comments
 (0)