-
Notifications
You must be signed in to change notification settings - Fork 147
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] Create vizro.figures.library
to enable usage in pure Dash app
#578
Conversation
for more information, see https://pre-commit.ci
…m/mckinsey/vizro into tidy/create-module-pure-functions
for more information, see https://pre-commit.ci
I like unwrapped or raw best. |
…m/mckinsey/vizro into tidy/create-module-pure-functions
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
vizro.figures.library
to enable usage of components in pure Dash app
} | ||
|
||
.card-kpi .card-body { | ||
align-items: center; | ||
color: var(--text-secondary); | ||
color: var(--bs-secondary); |
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.
Important for future reference: In case we do add new components, colors need to be taken from the bootstrap variables, otherwise the new components are not compatible with other bootstrap themes.
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.
Shall we document this in our wiki, and potentially also in our code?
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.
There is a ticket on creating a guide on an "intro to css" where we could add this in 👍
So i wouldn't add it to this PR for now. All PRs changing CSS would currently go through @nadijagraca, @pruthvip15 and/or me anyway :)
vizro.figures.library
to enable usage of components in pure Dash appvizro.figures.library
to enable usage in pure Dash app
@antonymilne - works perfectly expected! 🥳 🍾 💯 🚀 1. Vizro app with 2. Vizro app with 3. Pure dash app with 4. Pure dash app with |
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.
Wonderful work!
I'm curious: How far are we and do we actually want to support applying any bootstrap theme inside a Vizro application just by propagating the theme to the Vizro external_stylesheets argument?
It's definitely on our roadmap - there is a detailed plan written out here and we've started development a while ago if you remember. You can track the progress there as well. However, we've paused it for a while given other priorities. The main goal is to create a complete Vizro Bootstrap theme and make it open-source so that anyone using a pure Dash app can use it too. We want all our CSS to be part of this theme, with only a few tweaks for third-party libraries like Dash-Mantine and AG-Grid. Everything else should be converted to Bootstrap. This way, we have one consistent source, making it easier to add other custom components and it will be another offering of Vizro :) It was always planned that people should be able to change the "skin" of the dashboard easily. The Bootstrap theme is the most straightforward way of doing this without having lots of overwrites 👍 |
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.
😍 Wow this is super cool! Tried out a few bootstrap themes, and it's really cool to see how the cards can be used in a pure dash app, and how they work well with those themes. Really great work @antonymilne @huong-li-nguyen !! ⭐
I have almost no comments - let me know if I should test something more manual, but going through the scratch app, all seemed fine 💪
} | ||
|
||
.card-kpi .card-body { | ||
align-items: center; | ||
color: var(--text-secondary); | ||
color: var(--bs-secondary); |
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.
Shall we document this in our wiki, and potentially also in our code?
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, thanks for all your patience and perseverance seeing this through!
Description
This is the first PR to create a library for our components to be used in a standalone Dash app, independent of the Vizro framework. For context: The key performance indicator (KPI) cards are the first components eligible for use in a pure Dash app. In the future, we might add custom charts and other components as well. This PR lays the foundation for enabling these additions.
To ensure KPI components, and future components, work seamlessly outside of Vizro, we made the following adjustments:
Detailed code comments from @antonymilne explain these changes further (see changed files)
Screenshot
Vizro KPI Cards inside Vizro or with vizro-bootstrap (not public yet)
Vizro KPI Cards in pure dash app with other bootstrap themes:
dbc.themes.BOOTSTRAP
dbc.themes.SANDSTONE
dbc.themes.CYBORG
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":