Skip to content

Commit 9b45b6a

Browse files
authored
update and sort conda env (#4)
This PR updates the conda env to the latest pyvista and ipywidgets version, as well as adds additional notebooks to check pyvista threejs notebook plotting backend.
1 parent 9d080fa commit 9b45b6a

File tree

5 files changed

+123
-16
lines changed

5 files changed

+123
-16
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NVIDIA-Linux*
22
*.whl
33
*~
4-
ipynb_checkpoints/
4+
.ipynb_checkpoints
55
test_notebooks/out
66

77
# Secrets when running github actions locally with nektos/act

environment.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@ channels:
44
- cadquery
55
- plotly
66
dependencies:
7-
- jupyterlab=3.2.0
8-
- ipywidgets=7.6.5
9-
- pandas=1.2.4
10-
- ipygany=0.5.0
11-
- pyvista=0.32.1
12-
- panel=0.12.4
13-
- plotly=5.3.1
147
- cadquery=master # version 2.1 does not support python 3.9
15-
- jupyter-dash=0.4.0
16-
- networkx=2.6.3
17-
- colour=0.1.5
188
- cairo=1.16.0
19-
- ipympl=0.8.1
20-
- ipyevents=2.0.1
21-
- ipycanvas=0.9.0
9+
- colour=0.1.5
2210
- dash-bootstrap-components=1.0.0
11+
- ipycanvas=0.10.2
12+
- ipyevents=2.0.1
13+
- ipygany=0.5.0
14+
- ipympl=0.8.4
2315
- ipyvtklink==0.2.1
16+
- ipywidgets=7.6.5
17+
- jupyter-dash=0.4.0
18+
- jupyterlab=3.2.5
19+
- networkx=2.6.3
20+
- pandas=1.3.5
21+
- panel=0.12.6
2422
- pip=21.3
23+
- plotly=5.4.0
24+
- pyvista=0.32.1
25+
- pythreejs=2.3.0
2526
- pip:
2627
- jupyter-cadquery==2.2.1
2728
- dash-vtk==0.0.9
28-
- dash-treeview-antd==0.0.1
29+
- dash-treeview-antd==0.0.1

labextensions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jupyterlab-plotly@5.3.1
1+
jupyterlab-plotly@5.4.0
22
33

test_notebooks/plotly.ipynb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "92aad6bd-a984-4ca2-9a43-2bed61adcd0a",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import plotly.graph_objects as go\n",
11+
"fig = go.Figure(data=go.Bar(y=[2, 3, 1]))\n",
12+
"fig.show()"
13+
]
14+
}
15+
],
16+
"metadata": {
17+
"kernelspec": {
18+
"display_name": "Python 3 (ipykernel)",
19+
"language": "python",
20+
"name": "python3"
21+
},
22+
"language_info": {
23+
"codemirror_mode": {
24+
"name": "ipython",
25+
"version": 3
26+
},
27+
"file_extension": ".py",
28+
"mimetype": "text/x-python",
29+
"name": "python",
30+
"nbconvert_exporter": "python",
31+
"pygments_lexer": "ipython3",
32+
"version": "3.9.7"
33+
}
34+
},
35+
"nbformat": 4,
36+
"nbformat_minor": 5
37+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "366676b7-f66f-4351-907e-877f6d1817dc",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import pyvista\n",
11+
"import numpy as np\n",
12+
"\n",
13+
"pyvista.global_theme.show_scalar_bar = False\n",
14+
"pyvista.global_theme.antialiasing = True\n",
15+
"pyvista.set_jupyter_backend('pythreejs')\n",
16+
"\n",
17+
"def make_cube(center=(0, 0, 0), resolution=1):\n",
18+
" cube = pyvista.Cube(center=center)\n",
19+
" return cube.clean().triangulate().subdivide(resolution)\n",
20+
"\n",
21+
"pl = pyvista.Plotter()\n",
22+
"\n",
23+
"# test face scalars with no lighting\n",
24+
"mesh = make_cube(center=(-1, 0, -1))\n",
25+
"mesh['scalars_a'] = np.arange(mesh.n_faces)\n",
26+
"pl.add_mesh(mesh, lighting=False, cmap='jet', show_edges=True)\n",
27+
"\n",
28+
"# test point scalars on a surface mesh\n",
29+
"mesh = make_cube(center=(1, 0, 1))\n",
30+
"mesh['scalars_b'] = mesh.points[:, 2]*mesh.points[:, 0]\n",
31+
"pl.add_mesh(mesh, cmap='bwr', line_width=1)\n",
32+
"\n",
33+
"mesh = make_cube(center=(-1, 0, 1))\n",
34+
"mesh['scalars_c'] = mesh.points[:, 2]\n",
35+
"pl.add_mesh(mesh, style='points', point_size=30)\n",
36+
"\n",
37+
"# test wireframe\n",
38+
"mesh = make_cube(center=(1, 0, -1))\n",
39+
"mesh['scalars_d'] = mesh.points[:, 2]\n",
40+
"pl.add_mesh(mesh, show_edges=False, line_width=3,\n",
41+
" style='wireframe', cmap='inferno')\n",
42+
"\n",
43+
"pl.camera_position = 'xz'\n",
44+
"pl.show()"
45+
]
46+
}
47+
],
48+
"metadata": {
49+
"kernelspec": {
50+
"display_name": "Python 3 (ipykernel)",
51+
"language": "python",
52+
"name": "python3"
53+
},
54+
"language_info": {
55+
"codemirror_mode": {
56+
"name": "ipython",
57+
"version": 3
58+
},
59+
"file_extension": ".py",
60+
"mimetype": "text/x-python",
61+
"name": "python",
62+
"nbconvert_exporter": "python",
63+
"pygments_lexer": "ipython3",
64+
"version": "3.9.7"
65+
}
66+
},
67+
"nbformat": 4,
68+
"nbformat_minor": 5
69+
}

0 commit comments

Comments
 (0)