Hi,
my app is built around a central Plotly graph which I always want to be as large as possible.
It does seem that the plot size adapts to browser window resizes but not to toggling of the sidebar.
I’d like to redraw the plotly area whenever the sidebar is either shown or hidden when a user clicks the “hamburger” menu, to ensure the plot size is adapted.
Intuitively, I thought that the show and hide events of the sidebar’s FlowPanel would be triggered when said panel is shown or hidden, but I guess it’s a different meaning of show/hide.
I have written a minimal app where I can manually redraw/rebuild the plot by clicking a butt on (top right corner). Is there a way to trigger this behaviour automatically when the sidebar is shown or hidden?
[Anvil | Login](https://Link to app)
The sidebar hamburger toggle is implemented in javascript and so it doesn’t play as nicely as you’re hoping with anvil components.
As far as the flow panel is concerned, it’s on the screen, and toggling the sidebar doesn’t change that.
If you did want to implement such a mechanism, then you’d probably want to use anvil.call inside the standard-form.html javascript code when the toggle functions are executed.
Hi @stucork , thanks a lot for the answer!
Ok, so let’s see if we can get it to resize itself automatically then I should indeed not need this - but glad to know that this is how it would have worked, and maybe it helps someone else. Much appreciated!!