You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pyvista as pv
import streamlit as st
from stpyvista import stpyvista
st.title("A cube")
st.info("""Code adapted from https://docs.pyvista.org/user-guide/jupyter/pythreejs.html#scalars-support""")
## Initialize a plotter object
plotter = pv.Plotter(window_size=[400,400])
## Create a mesh with a cube
mesh = pv.Cube(center=(0,0,0))
## Add some scalar field associated to the mesh
mesh['myscalar'] = mesh.points[:, 2] * mesh.points[:, 0]
## Add mesh to the plotter
plotter.add_mesh(mesh, scalars='myscalar', cmap='bwr')
## Final touches
plotter.view_isometric()
plotter.background_color = 'white'
## Send to streamlit
stpyvista(plotter, key="pv_cube")
Any guidance on resolving this issue would be greatly appreciated :)
Additional Information:
python version: 3.9.13
pyvista version: 0.43.4
Streamlit version: 1.32.2
stpyvista version: 0.0.14
panel version: 0.13.1
The text was updated successfully, but these errors were encountered:
stpyvista 0.0.14 was tested for python>=3.10 only. Upgrading should take care of your issue. The other option is to upgrade stpyvista to version 0.0.16 where I fixed that type hint to work with python 3.9.
Any guidance on resolving this issue would be greatly appreciated :)
Additional Information:
python version: 3.9.13
pyvista version: 0.43.4
Streamlit version: 1.32.2
stpyvista version: 0.0.14
panel version: 0.13.1
The text was updated successfully, but these errors were encountered: