Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: viewer container size base on the root iframe in streamlit #535

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,13 @@ function ChartPreviewApp(props: IChartPreviewProps, id: string) {

function GraphicRendererApp(props: IAppProps) {
const computationCallback = getComputationCallback(props);
const containerSize = props["containerSize"] ?? [null, null];
const globalProps = {
rawFields: props.rawFields,
containerStyle: { height: "700px", width: "60%" },
containerStyle: {
height: containerSize[1] ? `${containerSize[1]-200}px` : "700px",
width: containerSize[0] ? `${containerSize[0]-20}px` : "60%"
},
themeKey:props.themeKey,
dark: useContext(darkModeContext),
}
Expand Down
2 changes: 1 addition & 1 deletion pygwalker/api/streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def viewer(
scrolling: bool = False,
) -> "DeltaGenerator":
"""Render filter renderer UI"""
html = self._get_html(mode="filter_renderer")
html = self._get_html(mode="filter_renderer", **{"containerSize": [width, height]})
return components.html(html, height=height, width=width, scrolling=scrolling)

@deprecated("render_filter_renderer is deprecated, use viewer instead.")
Expand Down
Loading