Skip to content

Commit 197ad6b

Browse files
committed
Update changelog; add type hints
1 parent cfa26db commit 197ad6b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v 0.1.2] - 2024-10-09
4+
- Implement trame backend using `st.components.declare_component`; it was implemented using `st.components.html`
5+
- Trame backend accepts a `key` to avoid remounting of the component at every interaction.
6+
37
## [v 0.1.1] - 2024-10-08
48
- Capture kwargs for trame_backend
59
- Update docstrings and add TypeDicts for panel options

src/stpyvista/trame_backend.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from multiprocessing import Process, Queue
22
from warnings import warn
33
from pathlib import Path
4-
import streamlit.components.v1 as components
4+
from typing import Optional
55

6+
import streamlit.components.v1 as components
67
from pyvista.plotting import Plotter
78

89

@@ -50,7 +51,12 @@ def _as_html(plotter: Plotter, **kwargs) -> None:
5051
)
5152

5253

53-
def stpyvista(plotter: Plotter, use_container_width=True, key=None, **kwargs) -> None:
54+
def stpyvista(
55+
plotter: Plotter,
56+
use_container_width: bool = True,
57+
key: Optional[str] = None,
58+
**kwargs,
59+
) -> None:
5460
"""
5561
Renders an interactive Pyvista Plotter in streamlit using the
5662
trame backend.

0 commit comments

Comments
 (0)