Skip to content

[AdvancedLayouts] Modernize width/height parameters for st.scatter_chart#12659

Merged
sfc-gh-lwilby merged 2 commits intodevelopfrom
fix/update-scatter-chart-width-height
Sep 30, 2025
Merged

[AdvancedLayouts] Modernize width/height parameters for st.scatter_chart#12659
sfc-gh-lwilby merged 2 commits intodevelopfrom
fix/update-scatter-chart-width-height

Conversation

@sfc-gh-lwilby
Copy link
Copy Markdown
Collaborator

Describe your changes

Modernizes st.scatter_chart width/height parameters to use the new Width/Height type system ("stretch", "content", or pixel values) for consistency with other chart elements.

Changes Made:

  • Updated parameter signature: width: Width = "stretch" and height: Height = "content" (previously int | None = None)
  • Deprecated use_container_width: Changed from bool = True to bool | None = None with deprecation warnings
  • Preserved backward compatibility: Existing integer values and use_container_width behavior still work
  • Updated documentation: New parameter descriptions explaining the Width/Height type system

Deprecation Details:

  • use_container_width will be removed after 2025-12-31
  • When explicitly set, use_container_width takes precedence over width
  • Users receive deprecation warnings with migration guidance

GitHub Issue Link (if applicable)

Testing Plan

  • Unit Tests (Python) - Width/height parameter functionality and backward compatibility
  • Unit Tests (Python) - use_container_width deprecation warnings and behavior
  • E2E Tests - Testing for width/height behavior across different values (covered by existing tests, new tests for height="content" and height="stretch")
  • Manual testing completed

Additional Notes:

Part of the AdvancedLayouts initiative to provide consistent width/height APIs across all chart elements.


Contribution License Agreement

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

Modernizes st.scatter_chart width/height parameters to use the new Width/Height type system and deprecates use_container_width with backward compatibility.
@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 29, 2025
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Sep 29, 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 29, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12659/streamlit-1.50.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-12659.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-lwilby sfc-gh-lwilby merged commit beaec88 into develop Sep 30, 2025
39 checks passed
@sfc-gh-lwilby sfc-gh-lwilby deleted the fix/update-scatter-chart-width-height branch September 30, 2025 06: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.

2 participants