-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from edsaac/panel_backend
Panel backend
- Loading branch information
Showing
9 changed files
with
100 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "stpyvista" | ||
version = "0.0.5" | ||
version = "0.0.6" | ||
authors = [ | ||
{ name="Edwin S", email="[email protected]" }, | ||
] | ||
|
@@ -20,9 +20,9 @@ classifiers = [ | |
dependencies = [ | ||
"streamlit", | ||
"pyvista", | ||
"pythreejs", | ||
"ipywidgets==7.7.1", | ||
"ipython==8.4.0" | ||
"bokeh", | ||
"panel", | ||
"ipython" | ||
] | ||
|
||
[project.urls] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
streamlit | ||
pyvista | ||
pythreejs==2.3.0 | ||
ipywidgets==7.7.1 | ||
ipython==8.4.0 | ||
ipython | ||
bokeh | ||
panel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
setuptools.setup( | ||
name="stpyvista", | ||
version="0.0.5", | ||
version="0.0.6", | ||
author="Edwin S", | ||
author_email="[email protected]", | ||
description="Streamlit component that allows you to visualize pyvista 3D visualizations", | ||
|
@@ -17,6 +17,6 @@ | |
package_data={'stpyvista': ['frontend/*']}, | ||
include_package_data=True, | ||
classifiers=[], | ||
python_requires=">=3.7", | ||
install_requires=["streamlit>=1.2", "jinja2"], | ||
python_requires=">=3.8", | ||
install_requires=["streamlit>=1.18", "jinja2", "panel"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import streamlit as st | ||
import pyvista as pv | ||
from stpyvista import stpyvista | ||
|
||
st.set_page_config(page_icon="🧊", layout="wide") | ||
st.title("🧊 `stpyvista`") | ||
st.sidebar.header("Show PyVista 3D visualizations in Streamlit") | ||
|
||
# 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") |