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

[Tidy] Replace dmc.Switch with dbc.Switch #907

Merged
merged 12 commits into from
Dec 2, 2024
Merged

Conversation

huong-li-nguyen
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen commented Nov 29, 2024

Description

Screenshot

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.

Copy link
Contributor

github-actions bot commented Nov 29, 2024

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

Updated on: 2024-12-02 11:38:05 UTC
Commit: 758c0fe

Link: vizro-core/examples/dev/

Link: vizro-core/examples/scratch_dev

Link: vizro-core/examples/visual-vocabulary/

Link: vizro-ai/examples/dashboard_ui/

@huong-li-nguyen huong-li-nguyen self-assigned this Nov 29, 2024
Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

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

This looks good! 👍

If you find it useful, extract the creation of the dbc.Switch in a separate helper function (and reuse it in two places) in the dashboard.py.
You can also change the variable names in the dashboard.js (but also not necessary 😄).

vizro-core/src/vizro/models/_dashboard.py Show resolved Hide resolved
@huong-li-nguyen
Copy link
Contributor Author

huong-li-nguyen commented Dec 2, 2024

This looks good! 👍

If you find it useful, extract the creation of the dbc.Switch in a separate helper function (and reuse it in two places) in the dashboard.py. You can also change the variable names in the dashboard.js (but also not necessary 😄).

Thanks for the quick review! 🙏 For now, I think it's easier to stick with the duplication. Normally, we only need to insert the theme-switch once for all dashboard pages, but the 404 page is an exception since it gets rendered separately and we want it to match. If we come across more cases like the 404 page, we can definitely reconsider. 👍 For now, I find the duplication clearer because having a helper function outside the Dashboard class would make it harder to overwrite, and it doesn't quite qualify as a separate method within the Dashboard class, as it's already part of the output _get_page_divs method.

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.

⭐ 🌟 ⭐ 🌟 ⭐ 🌟 ⭐ So nice to see everything being consolidated into bootstrap here!

Now the only dmc component left is the date picker?

vizro-core/src/vizro/models/_dashboard.py Show resolved Hide resolved
@huong-li-nguyen
Copy link
Contributor Author

⭐ 🌟 ⭐ 🌟 ⭐ 🌟 ⭐ So nice to see everything being consolidated into bootstrap here!

Now the only dmc component left is the date picker?

Yeees!

@huong-li-nguyen huong-li-nguyen enabled auto-merge (squash) December 2, 2024 12:25
@huong-li-nguyen huong-li-nguyen merged commit 57faa1e into main Dec 2, 2024
36 checks passed
@huong-li-nguyen huong-li-nguyen deleted the tidy/replace-switch branch December 2, 2024 12:31
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.

3 participants