Streamlit component to render 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
## 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)
plotter.add_scalar_bar()
## 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")
Project 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.11.tar.gz
(18.8 kB
view hashes)
Built Distribution
stpyvista-0.0.11-py3-none-any.whl
(18.3 kB
view hashes)
Close
Hashes for stpyvista-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 060db13eed72f1331f8dcb8ad5bd5d10600b2727f424c384d770e3e4fb836aff |
|
MD5 | f2be0d0d576a908be782b41f67e2b478 |
|
BLAKE2b-256 | fba07ae9f5d48889eca98eea813f320987c7d1df74d0a9401c7d2b20bb87aaa4 |