Graph at 50% width on page load, goes to 100% when redrawing

If you’re not able to get the stackoverflow solution to work, then you could try dynamically rendering the tab content instead. I.e. write a callback that takes the active_tab property as input, then renders content in a div below the tabs. Here’s an example of that.

The issue is that dbc.Tabs sets display: none on the non-active tabs, so Plotly is unable to figure out the container size, but changing display doesn’t trigger a redraw. There’s some more details on that here and here

1 Like