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

[Feat] Dynamic data parameters automatically refresh the relevant dynamic filters #1051

Merged
merged 22 commits into from
Mar 18, 2025

Conversation

petar-qb
Copy link
Contributor

@petar-qb petar-qb commented Mar 5, 2025

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":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

Sorry, something went wrong.

petar-qb and others added 4 commits March 5, 2025 15:09
for more information, see https://pre-commit.ci
…com/mckinsey/vizro into feat/update-dynamic-filter-from-dfp
Copy link
Contributor

github-actions bot commented Mar 5, 2025

View the example dashboards of the current commit live on PyCafe ☕ 🚀

Updated on: 2025-03-18 10:59:15 UTC
Commit: c94f216

Compare the examples using the commit's wheel file vs the latest released version:

vizro-core/examples/scratch_dev

View 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/

View with commit's wheel vs View with latest release

petar-qb and others added 3 commits March 5, 2025 15:13
for more information, see https://pre-commit.ci
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@stichbury stichbury left a 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 🏆

Copy link
Contributor

@antonymilne antonymilne left a 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.

…date-dynamic-filter-from-dfp
…date-dynamic-filter-from-dfp
@maxschulz-COL
Copy link
Contributor

Description

This PR enables the automatic refreshing of the relevant dynamic filters and their targets when the data_frame parameter is changed.

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?

@petar-qb
Copy link
Contributor Author

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.

@petar-qb petar-qb requested a review from antonymilne March 18, 2025 09:30
Copy link
Contributor

@antonymilne antonymilne left a 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!

@petar-qb petar-qb changed the title [Feat] Enable dynamic filter to be updated from data_frame parameters - implicit configuration API [Feat] Dynamic data parameters automatically refresh the relevant dynamic filters. Mar 18, 2025
@petar-qb petar-qb changed the title [Feat] Dynamic data parameters automatically refresh the relevant dynamic filters. [Feat] Dynamic data parameters automatically refresh the relevant dynamic filters Mar 18, 2025
@petar-qb petar-qb merged commit 4b94744 into main Mar 18, 2025
41 checks passed
@petar-qb petar-qb deleted the feat/update-dynamic-filter-from-dfp branch March 18, 2025 11:41
nadijagraca pushed a commit that referenced this pull request Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants