Inside Fiwkdrsga Mjdemg Plotly_chart Kwargs Deprecation

by Jule 56 views
Inside Fiwkdrsga Mjdemg Plotly_chart Kwargs Deprecation

When Plotly’s “width” keyword goes silent

The deprecation warning warninging about width="content" in st.plotly_chart is back - but now more insistent. Even when only width=500 or height=360 is used, users still get a nagging alert. This isn’t a bug - it’s a hangover from how Streamlit and Plotly rewired their argument parsing.

Recent fixes shifted from hiding the warning behind kwargs to a direct alert when deprecated width-like params appear. The fix works - but only when the config argument takes over. Using width=500 now triggers: show_deprecation_warning(...) with a clear message: “Use config instead of width” - exactly what docs now demand.

Still, hidden risks linger. If code relies on old width syntax, it may silently fail or misbehave. And while Streamlit shows the alert, the full fix requires explicit config usage - no shortcuts.

Is this a regression? Yes - but one that reflects a necessary upgrade.

The bottom line: Switch from width=content to config now. It’s not optional. Your charts need clarity - and future-proofing. Stop hiding the warning. Use width=500 with fig.update_layout(...), and embrace the config path. The map is clear - your code stays ahead.