Streamlit component that allows you to show PyVista 3d visualizations
Project description
🧊 stpyvista
Streamlit component to show PyVista 3D visualizations
Installation instructions
pip install stpyvista
Usage instructions
import streamlit as st
import pyvista as pv
from stpyvista import stpyvista
# pythreejs does not support scalar bars :(
pv.global_theme.show_scalar_bar = False
## 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', line_width=1)
## Final touches
plotter.view_isometric()
plotter.background_color = 'white'
## Pass a key to avoid re-rendering at each time something changes in the page
stpyvista(plotter, key="pv_cube")
Log changes
v 0.0.6
- Replaced pythreejs backend for panel backend. This is a temporary solution as pyvista will remove panel support in favor of trame.v 0.0.5
- Support transparent backgrounds to blend with streamlit's web app theme. - Add a control to spin along a certain axis the first mesh passed to the plotter.v 0.0.4
- Pass a key to the stpyvista component to avoid re-rendering at every streamlit interaction - Using ipywidgets `embed_minimal_html` directly instead of pyvista `export_html`. - Update examples as a multipage streamlit appProject details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stpyvista-0.0.6.tar.gz
(19.0 kB
view hashes)
Built Distribution
stpyvista-0.0.6-py3-none-any.whl
(18.8 kB
view hashes)
Close
Hashes for stpyvista-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 015cf8fd2b40c15049bc220f080f537e9579b526e20a92f7445d2a60c9d2337f |
|
MD5 | dad5b38e423dea85e556bfd42aaf6a77 |
|
BLAKE2b-256 | 29eb5eb7e4c7095c6ea904e2d9afc1c422bee44fd97e0e9978ad942df1b20b81 |