pgleeson commited on
Commit
920471a
·
1 Parent(s): ce64868

Better...

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. app.py +10 -7
  3. requirements.txt +1 -1
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.8.9
2
 
3
  WORKDIR /app
4
 
 
1
+ FROM python:3.11
2
 
3
  WORKDIR /app
4
 
app.py CHANGED
@@ -1,17 +1,19 @@
1
 
2
- import pyvista as pv
3
  import streamlit as st
4
- from stpyvista import stpyvista
5
 
6
- st.title("A cube")
7
- st.info("""Code adapted from https://docs.pyvista.org/user-guide/jupyter/pythreejs.html#scalars-support""")
8
 
9
- from stpyvista.utils import start_xvfb
10
 
11
  if "IS_XVFB_RUNNING" not in st.session_state:
12
- start_xvfb()
13
  st.session_state.IS_XVFB_RUNNING = True
14
 
 
 
 
 
 
15
  ## Initialize a plotter object
16
  plotter = pv.Plotter(window_size=[400,400])
17
 
@@ -28,6 +30,7 @@ plotter.add_mesh(mesh, scalars='myscalar', cmap='bwr')
28
  plotter.view_isometric()
29
  plotter.background_color = 'white'
30
 
 
31
  ## Send to streamlit
32
- stpyvista(plotter, key="pv_cube")
33
 
 
1
 
2
+
3
  import streamlit as st
 
4
 
 
 
5
 
6
+ import stpyvista.utils
7
 
8
  if "IS_XVFB_RUNNING" not in st.session_state:
9
+ stpyvista.utils.start_xvfb()
10
  st.session_state.IS_XVFB_RUNNING = True
11
 
12
+ st.title("A nice cube")
13
+ st.info("""Code adapted from https://docs.pyvista.org/user-guide/jupyter/pythreejs.html#scalars-support""")
14
+
15
+ import pyvista as pv
16
+
17
  ## Initialize a plotter object
18
  plotter = pv.Plotter(window_size=[400,400])
19
 
 
30
  plotter.view_isometric()
31
  plotter.background_color = 'white'
32
 
33
+ from stpyvista import stpyvista as spv
34
  ## Send to streamlit
35
+ spv(plotter, key="pv_cube")
36
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- fastapi
2
  streamlit
3
  pyneuroml
 
4
  stpyvista
 
 
1
  streamlit
2
  pyneuroml
3
+ pyvista
4
  stpyvista