Skip to content

[AdvancedLayouts] Add width to st.plotly_chart#12559

Merged
sfc-gh-lwilby merged 6 commits intodevelopfrom
feature/add-width-to-plotly-charts
Sep 19, 2025
Merged

[AdvancedLayouts] Add width to st.plotly_chart#12559
sfc-gh-lwilby merged 6 commits intodevelopfrom
feature/add-width-to-plotly-charts

Conversation

@sfc-gh-lwilby
Copy link
Copy Markdown
Collaborator

Describe your changes

This PR is part of the [AdvancedLayouts] project and introduces a new height parameter to the st.graphviz_chart.

This PR also begins the process of deprecating use_container_width. The default is updated to None, and width will be used instead. If the user explicitly passes a value for use_container_width then that will take precedence. use_container_width=True is equivalent to width="stretch" and use_container_width=False is equivalent to width="content". The user will be given a warning and suggestion to use width instead. We will remove use_container_width after 12-31-2025`.

Screenshot 2025-09-17 at 5 59 34 PM

GitHub Issue Link (if applicable)

Testing Plan

  • Unit Tests (JS and/or Python) ✅
  • E2E Tests ✅

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Sep 17, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 17, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12559/streamlit-1.49.1-py3-none-any.whl
🕹️ Preview app pr-12559.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-lwilby sfc-gh-lwilby added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Sep 17, 2025
@sfc-gh-lwilby sfc-gh-lwilby marked this pull request as ready for review September 18, 2025 10:07
@sfc-gh-lwilby sfc-gh-lwilby requested a review from a team as a code owner September 18, 2025 10:07
@sfc-gh-lwilby sfc-gh-lwilby changed the title [WIP][AdvancedLayouts] Add width to st.plotly_chart [AdvancedLayouts] Add width to st.plotly_chart Sep 18, 2025
@sfc-gh-lwilby sfc-gh-lwilby changed the title [AdvancedLayouts] Add width to st.plotly_chart [AdvancedLayouts] Add width to st.plotly_chart Sep 18, 2025
How to size the chart's width. Can be one of:

- ``"stretch"`` (default): Expand to the width of the parent container.
- ``"content"``: Size the chart to fit its contents, up to the width
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @sfc-gh-dmatthews not sure if we want to highlight that this will be based on explicit dimensions provided in the plotly figure, otherwise we just use the default of 700px.

@sfc-gh-lwilby sfc-gh-lwilby merged commit f6d75cd into develop Sep 19, 2025
37 checks passed
@sfc-gh-lwilby sfc-gh-lwilby deleted the feature/add-width-to-plotly-charts branch September 19, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants