Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Plot is fixed 100px height after going changing display from none to something else

Hey all,

I’ve been having this problem recently: I have a plot that shows without problem if I don’t mess with style. But if I set the div’s in which the plot is inside’s style to {'display': 'none'} and then change it to block or inline inside a callback, I’m getting a fixed 100px plot:

I tried changing height in the plot’s layout and the div’s height in the callback, but I’m getting the same result anyways. What am I missing? is this expected?

I can share a reproducible example if needed. Thanks !

Edit: After explicitly adding the height in dcc.Graph's style I managed to make the plots show properly. Is this the recommended way?

Hi @Juanouo,

Yes, this is the proper way to set change a plot’s height.

You can also adjust the margin, if you want additional space without increased the size of the actual graph, like this:

fig.update_layout(
    autosize=False,
    width=500,
    height=500,
    margin=dict(
        l=50,
        r=50,
        b=100,
        t=100,
        pad=4
    )
)

Have a look here for more information.

Welcome to the board. :slight_smile: