Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AgGrid doesn't work with persistence props #389

Open
1 task done
huong-li-nguyen opened this issue Mar 26, 2024 · 2 comments
Open
1 task done

AgGrid doesn't work with persistence props #389

huong-li-nguyen opened this issue Mar 26, 2024 · 2 comments
Assignees
Labels
Issue: Bug Report 🐛 Issue/PR that report/fix a bug

Comments

@huong-li-nguyen
Copy link
Contributor

Description

Not sure if this has been discussed before, but the persistence props do not work with the AgGrid in Vizro, while they work fine in a pure dash app.

Expected behavior

I would expect the persistence props to work as expected, but currently they do not seem to have an effect e.g. when configuring the persistence props, the inserted values still get lost after refreshing the page.

On another note, I think they should also be turned on as default for the dash_ag_grid function (similar how we turn it on automatically for the other components).

Which package?

vizro

Package version

0.1.14

Python version

3.9

OS

How to Reproduce

  1. Run the code below with the latest vizro version
  2. Insert a value inside the floatingFilter
  3. Refresh the page
"""Example to show dashboard configuration."""

import vizro.models as vm
import vizro.plotly.express as px
from vizro import Vizro
from vizro.tables import dash_ag_grid

df = px.data.gapminder()

page = vm.Page(
    title="Enhanced AG Grid",
    components=[
        vm.AgGrid(
            title="Dash AG Grid",
            figure=dash_ag_grid(
                data_frame=df,
                columnDefs=[
                    {"field": "country", "floatingFilter": True, "suppressMenu": True},
                    {"field": "continent", "floatingFilter": True, "suppressMenu": True},
                    {"field": "year"},
                    {"field": "lifeExp", "cellDataType": "numeric"},
                    {"field": "pop", "cellDataType": "numeric"},
                    {"field": "gdpPercap", "cellDataType": "euro"},
                ],
                persistence=True,
                persisted_props=["filterModel"]
            ),
        ),
    ],
    controls=[vm.Filter(column="continent")],
)
dashboard = vm.Dashboard(pages=[page])

if __name__ == "__main__":
    Vizro().build(dashboard).run()

Output

No response

Code of Conduct

@huong-li-nguyen huong-li-nguyen added Issue: Bug Report 🐛 Issue/PR that report/fix a bug Status: Needs triage 🔍 Issue/PR needs triaging labels Mar 26, 2024
@maxschulz-COL
Copy link
Contributor

maxschulz-COL commented Mar 26, 2024

This is part of the backlog, but not prioritised for this sprint: https://github.com/McK-Internal/vizro-internal/issues/660. Would propose closing either due to duplication, which one is preferable?

@huong-li-nguyen
Copy link
Contributor Author

I would leave this issue open so it's visible to OS users, as I am sure some will face the same issues especially if they use options such as the floatingFilter etc.

@huong-li-nguyen huong-li-nguyen removed the Status: Needs triage 🔍 Issue/PR needs triaging label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug Report 🐛 Issue/PR that report/fix a bug
Projects
None yet
Development

No branches or pull requests

3 participants