8000 How to achieve `Page` persistence in Vizro? · Issue #1211 · mckinsey/vizro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to achieve Page persistence in Vizro? #1211
Open
@gtauzin

Description

@gtauzin

Have you already looked into this topic?

  • I've reviewed the Vizro documentation for any relevant information
  • I've searched through existing issues for similar questions
  • I've already searched online (e.g., Dash documentation) but couldn’t find anything helpful

Question

Hi! 👋

I am trying to have all of my dashboard pages persistent so that moving back and forth between pages, I always see the state of a page prior to moving to the next one.

I understand this could be achieved with quite some work using a collection of dcc.Store living in vm.Dashboard so that they are accessible across pages.

As I wanted to avoid the large amount of work required to set this up, I found that dash-extensions has a "magical" function, setup_page_components, that once called within your dash_app.layout will make page persistent as long as all components ids are different (which I believe is enforced by the vizro model manager anyways).

Code/Examples

Unfortunately, after calling the function in CustomDashboard.build the magic did not happen 😆

class CustomDashboard(vm.Dashboard)
    def build(self):
        super_build_obj = super().build()
        super_build_obj.children.append(setup_page_components())
        return super_build_obj

Am I thinking about this wrong?

Thanks a lot for your help :)

Which package?

vizro

Code of Conduct

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0