-
Notifications
You must be signed in to change notification settings - Fork 157
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
[Feat] Dynamic data parameters automatically refresh the relevant dynamic filters #1051
Conversation
… api
for more information, see https://pre-commit.ci
…com/mckinsey/vizro into feat/update-dynamic-filter-from-dfp
View the example dashboards of the current commit live on PyCafe ☕ 🚀Updated on: 2025-03-18 10:59:15 UTC Compare the examples using the commit's wheel file vs the latest released version: vizro-core/examples/scratch_devView with commit's wheel vs View with latest release vizro-core/examples/dev/View with commit's wheel vs View with latest release vizro-core/examples/visual-vocabulary/View with commit's wheel vs View with latest release vizro-core/examples/tutorial/View with commit's wheel vs View with latest release vizro-ai/examples/dashboard_ui/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
vizro-core/changelog.d/20250305_151541_petar_pejovic_update_dynamic_filter_from_dfp.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great from a docs perspective, but I won't approve as there isn't any technical review from me. Thanks for keeping the docs updated though 🏆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work! The whole flow is getting pretty confusing now 😅 data_frame parameter can affect a figure, which affects data loading, which affects a filter, which affects target figures. Hopefully at some point we can simplify this whole scheme so it's much more linear. But for now this is great and should work well in practice even if it's kind of convoluted.
I suggested one possible simplification. I wonder if we should add an example to the docs also - let's discuss briefly in our 1-1.
vizro-core/changelog.d/20250305_151541_petar_pejovic_update_dynamic_filter_from_dfp.md
Outdated
Show resolved
Hide resolved
vizro-core/src/vizro/actions/_callback_mapping/_callback_mapping_utils.py
Show resolved
Hide resolved
…date-dynamic-filter-from-dfp
…date-dynamic-filter-from-dfp
Was not going to review, but wanted to understand what this is about. Could we ensure to have a bit better PR description for PRs that do not change obvious things? |
Thanks for the input, you're definitely right. I'll take care of that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work, thank you for all the updates!
Description
This PR enables the automatic refreshing of the relevant dynamic filters and their targets when the data_frame parameter is changed.
Currently (on the main branch) our dynamic filters can only be updated when the page is refreshed.
With this change, dynamic filters will be updated even if the "relevant" dynamic data parameter changes.
So from the implementation point of view we extend
Parameter.targets
with dynamic filters linked to the same figure.Also, we include dynamic filter targets to ensure that the new filter options are correctly calculated. This also ensures that the dynamic filter target is updated which is necessary if the filter value dynamically changes.
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":