MultiPage app: Pages + Dcc.Store + layout?

I have a multi-page app that uses pattern-matching callbacks on each page to update filters, add plots, etc. I am looking for a SIMPLE way to ‘store’ the ‘layout’ of each page as they change. So when I’m navigating between pages and when I restart my app it represents the latest state.

I know I need a ‘store_layout’ and ‘get_layout’ callback within each page. To keep the code simple, I’d like the callbacks to be same across all pages (ie. not explicitly callout all ‘inputs’ by page). If the layout changes, update the ‘stored’ layout.

Is it possible to ‘store’ the dash.page_registry object which contains the ‘layout’ for each page.

Hello @mrwills,

I actually utilize something similar to this, I pull the filters and figures from a database and build the layout based upon the criteria in the figures.

The stored data would just need to be in a way that you can parse it out in order to be able to iterate through it. Then on the callback to cater your pages, you pass the state of the dcc.Store and compare something about it to the desired layout’s page. If the page is newer than the dcc.Store, then you’d cater it, but if the layout is the same then you’d cater your stored layout.