Dcc graph width randomly not resized properly

Hi !
Since updating to Dash 3.0.0, I have some graphs width that do not resize properly.

    for CHf, (color, color_seq) in zip(range(1,8),led_colors.items()):
        y1 = [f"actual current - correction 1_CH{CHf}",f"corrected current - correction 1_CH{CHf}",f"corrected current - correction 2_CH{CHf}"]
        y1 = [c for c in y1 if c in df_flat.columns]
        y2 = [f"correction 1 CH{CHf}",f"correction 2 CH{CHf}"]
        y2 = [c for c in y2 if c in df_flat.columns]
        figures_1.append(px.scatter(df_flat.dropna(subset=y1,how="all"),"SN QC test", y1, color_discrete_sequence=color_seq, title=color).update_yaxes(title="current (mA)"))
        figures_2.append(px.histogram(df_flat.dropna(subset=y2,how="all"),"SN QC test",y2, color_discrete_sequence=color_seq).update_yaxes(ticksuffix="%"))
    
    children = dbc.Accordion(
            [
                dbc.AccordionItem(
                    [   
                        dcc.Graph(figure=f) for f in figures_1
                    ],
                    title="Scatter",
                ),
                dbc.AccordionItem(
                    [   
                        dcc.Graph(figure=f) for f in figures_2
                    ],
                    title="Histogram",
                ),
            ])

Here the Scatters in first AccordionItem are ok and Histogram in second AccordionItem are all smaller except the last one which is fine. Zooming in a the graph sometimes actualizes the CSS and make it big again.



My guess is that it has something to do with CSS competing with each other but removing .css from assets or commenting out load_figure_template from dash_bootstrap_templates didn’t change a thing.

Any idea on what to look for ?

dash==3.0.0
dash-ag-grid==2.3.0
dash-bootstrap-components==2.0.0
dash-bootstrap-templates==2.1.0
dash-core-components==2.0.0
dash-extensions==1.0.20
dash-html-components==2.0.0
dash-table==5.0.0
dash_daq==0.6.0
plotly==6.0.1

Hi @Terry

It might be a bug – looks like the same one as this one? Dash 3 not properly rendering initially hidden plotly figures · Issue #3236 · plotly/dash · GitHub

1 Like

It looks very much like my issue.
I’ll tag this post and follow the thread.

Thank you !