I’m trying to use Dash Multi-Page Apps (great stuff!) with query strings. The problem I have is that the generated page needs data that is loaded during the application start. I’m wondering what is the best way to have the layout function with the loaded data available(e.g. as class properties), and then use it with the dash.page_container.
The example here shows only this way of declaring the layout function for the page when using query strings:
import dash
from dash import html
dash.register_page(__name__)
def layout(report_id=None, **other_unknown_query_strings):
return html.Div(
children=[
html.H1(children='This is our Archive page'),
html.Div(children=f'''
This is report: {report_id}.
'''),
])
where I need to be able something more like:
page_obj = Page1(data1, data2)
dash.page_container.add_page(page_obj.layout, name..)