Christoph
SSolara
•Created by Christoph on 12/20/2023 in #questions-issues
Resizing a plotly plot based on available screen size
Hi Maarten, thanks for the reply and pointing me to the demo. You're right, it works out of the box. I set the width and height of the plotly figure layout explicitly, which was obviously preventing responsiveness.
However it still did not work correctly and I found out the problem was, that my figure was inside a solara.Row(), which seems to set a fixed width. After moving it out of the row, everything works as expected.
You can reproduce this by changing the line https://github.com/widgetti/solara/blob/6c01e51cff626535af147cfb9b0662c7e832fac7/solara/website/pages/apps/scatter.py#L93 to . The scatter plot is not resized anymore. My understanding of a row was that if there is only one element in the row, this does span the complete width.
How does this work? I did not find an explanation of the behavior in the documentation. Or did I miss it somehow?
4 replies