Skip to content

Commit eb2b3bb

Browse files
authored
Merge pull request #26 from edsaac/fix-panel
Fix panel bug and Python typing versions
2 parents 197ad6b + 17e2810 commit eb2b3bb

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
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.3] - 2024-10-09
4+
- Fix width bug while using panel backend
5+
- Add support for Python < 3.11 for `Required` and `NotRequired` types in `stpyvista.panel_backend`
6+
37
## [v 0.1.2] - 2024-10-09
48
- Implement trame backend using `st.components.declare_component`; it was implemented using `st.components.html`
59
- Trame backend accepts a `key` to avoid remounting of the component at every interaction.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "stpyvista"
7-
version = "0.1.2"
7+
version = "0.1.3"
88
authors = [
99
{ name = "Edwin Saavedra C.", email = "esaavedrac@u.northwestern.edu" },
1010
]

src/stpyvista/panel_backend.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
Optional,
44
Literal,
55
TypedDict,
6-
Required,
7-
NotRequired,
86
)
97

8+
try:
9+
# Available from Python 3.11
10+
from typing import Required, NotRequired
11+
12+
except ImportError:
13+
# Fallback for older Python versions.
14+
# typing_extensions is not a dependency of stpyvista but it
15+
# is a dependency of streamlit, so it should be available.
16+
from typing_extensions import Required, NotRequired
17+
1018
import panel as pn
1119
import streamlit.components.v1 as components
1220

src/stpyvista/panel_based/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ function onRender(event) {
3737
}
3838

3939
if (Boolean(use_container_width)) {
40+
updateFrameWidth();
41+
4042
window.onresize = function (event) {
4143
updateFrameWidth();
4244
}

0 commit comments

Comments
 (0)