Describe the bug
A gr.Plot that shows a Plotly figure with no explicit height in its layout (so it relies on Plotly autosize) renders with zero height in Gradio 6.18.0. The plot area is blank. Giving the figure a fixed height with fig.update_layout(height=...) avoids the problem, but that loses responsive height.
This is a regression. The same code renders correctly in 6.17.3.
Have you searched existing issues? 🔎
Reproduction
import gradio as gr
import plotly.express as px
df = px.data.gapminder().query("country == 'Canada'")
with gr.Blocks() as demo:
# No layout height set, so Plotly autosize is used. Renders blank on 6.18.0.
gr.Plot(px.line(df, x="year", y="lifeExp", title="autosize"))
# Works on 6.18.0 because the height is fixed.
fig = px.line(df, x="year", y="lifeExp", title="fixed height")
fig.update_layout(height=320)
gr.Plot(fig)
if __name__ == "__main__":
demo.launch()
Screenshot
gradio==6.17.3
gradio==6.18.0
Logs
System Info
Severity
I can work around it
Describe the bug
A
gr.Plotthat shows a Plotly figure with no explicitheightin its layout (so it relies on Plotly autosize) renders with zero height in Gradio 6.18.0. The plot area is blank. Giving the figure a fixed height withfig.update_layout(height=...)avoids the problem, but that loses responsive height.This is a regression. The same code renders correctly in 6.17.3.
Have you searched existing issues? 🔎
Reproduction
Screenshot
gradio==6.17.3
gradio==6.18.0
Logs
System Info
Severity
I can work around it