Skip to content

[AdvancedLayouts] Add width to st.vega_lite_chart#12517

Merged
sfc-gh-lwilby merged 8 commits intodevelopfrom
feature/add-width-vega-lite-chart
Sep 19, 2025
Merged

[AdvancedLayouts] Add width to st.vega_lite_chart#12517
sfc-gh-lwilby merged 8 commits intodevelopfrom
feature/add-width-vega-lite-chart

Conversation

@sfc-gh-lwilby
Copy link
Copy Markdown
Collaborator

@sfc-gh-lwilby sfc-gh-lwilby commented Sep 12, 2025

Describe your changes

This PR is part of the [AdvancedLayouts] project and introduces a new width parameter to the st.vega_lite_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-12 at 6 33 52 PM Screenshot 2025-09-12 at 5 13 36 PM

If you use width in the spec and also provide the width parameter, the parameter takes precedence. Use width="content" if you want to use width in the spec.

Screenshot 2025-09-12 at 4 48 11 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 12, 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 12, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12517/streamlit-1.49.1-py3-none-any.whl
🕹️ Preview app pr-12517.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 12, 2025
@sfc-gh-lwilby sfc-gh-lwilby changed the title [WIP][AdvancedLayouts] Add width to st.vega_lite_chart [AdvancedLayouts] Add width to st.vega_lite_chart Sep 18, 2025
@sfc-gh-lwilby sfc-gh-lwilby marked this pull request as ready for review September 18, 2025 11:14
vega_chart: Locator,
expected_width: int,
description: str | None = None,
tolerance: int = 0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question: Can you leave some comments at the callsites as to why using a tolerance value is necessary for certain cases?

@sfc-gh-lwilby sfc-gh-lwilby merged commit c97a044 into develop Sep 19, 2025
38 checks passed
@sfc-gh-lwilby sfc-gh-lwilby deleted the feature/add-width-vega-lite-chart branch September 19, 2025 12:09
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.

2 participants