Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

Displaying already plotted figures (exported as html) on Dash, figures won't fit inside the html.Iframe?

I have a Dash webpage where I’m trying to display a figure that I plotted earlier with Plotly and exported as “basic-line-offline.html”. I found that html.Iframe could be used for this. However, the figure doesn’t fit inside the iframe and there are scrollbars around it because of this.

Here’s the code I’m trying to do this with:

html.Div([                
                html.Iframe(
                    src="http://XXXXX/basic-line-offline.html",
                    style={'border': 'none', 'width': '100%'})
             ], className="row ")

Can I make the figure fit inside the Iframe without going back to plotting it again as smaller size?

Is html.Iframe actually even the best way to show these offline-created plots? Thank you for any help!

edit: also, how can I remove the buttons in the top right corner? Same way as config={‘displayModeBar’: False} in dcc.Graph?

1 Like

If html.Iframe isn’t a common way to display already plotted interactive figures, I’d be interested in how people typically do it? I want to keep app.py as clean as possible and do the plotting elsewhere to not clutter the app.py with the plotting stuff in dcc.Graphs.

1 Like