Hello everyone,
I do have some previous experience with R/Shiny, but now want to use Dash for a project I’m currently working on. However, there seem to be some differences how global state is handled and I struggle to find a good way to do what I want.
What I want to do is the following:
- Create a multipage app.
- On one page of the multipage app I want the user to set some parameters which are then used to create (and show) some (more or less random) mock data in the form of a Pandas dataframe.
- On the other pages of the app I want to make use of the previously created mock data.
- When I switch back to the page where I created the mock data, I want to see the data, which was created the last time, until the user generates new data deliberately.
Points 1&2 work very well and I can set up my mock data in the way I want easily.
However, I’m not sure, how to handle points 3 and 4. The canonical way to handle point 3 seems to be dcc.Store
, but this is subject to severe size constraints, according to the documentation. Is there another way to make data items, like, e.g., the aforementioned dataframe accessible from several pages?
And when it comes to point 4, I did not find a way to leave the generated mock data as it is. I was able to fix the previously selected settings of the different components by means of the persistence
parameter, but based on these settings, upon calling the page again, my mock data is created again, randomly.
Please apologize, if my question is too unspecific, but at the current point for me it seems like I’m seeking for an overall approach, how to making data accessible to multiple pages. Please let me know, if you need more specific information or code.
Thanks very much in advance for your help!
Regards,
Thomas