Dynamically creating pages in Dash

Hey,

I’m working on app where my team can view reports, consisting of multiple Plotly figures, and comment on them so that we have a centralized place to discuss results.
I need the user to be able to change the report that is on screen in a reasonable time, and there are two approaches I’m considering and would love to get your recommendations on how to go about this

One option is to have one page that dynamically updates each time a user changes the current report. For this I need to somehow store many Plotly figures as HTML (in a DB?) and load them.

The other option, which I’m not sure is possible, is to save a pre-rendered version of each report as a page and some how dynamically add them as pages to the app, accessed via different links.

Any help would be appreciated :slightly_smiling_face:

I’ve seen your question on discord, could you respond here?

Sure, this is what you asked on Discord

For much time does it take to render the page? Storing figures as html is quite unusual and I would not recommend to do so. It sounds that you could use tabs on a single page.

I’m not sure about rendering time since I haven’t tried full data yet, but we’re talking about potentially 10 plots with tens of thousands of points each. Plotly has native support for HTML, which is how it remains interactive even without a Python kernel (if I’m not mistaken).
Tabs won’t work since we can eventually have hundreds of reports.

I’m currently saving everything as JSON - the comments and the figures - and then when needed, load them and replace the current elements on the same page. This works ok for now, is there a way to ilnk to a specific report this way? Can I use the Flask server and define it such that when accessing a certain link it will know which report to load?

For the other option, Is there a way to add HTML pages to a Dash app dynamically and not have to define each one in code manually?