-
Notifications
You must be signed in to change notification settings - Fork 142
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] Enable header
and footer
inside Graph
, Table
and AgGrid
#669
Conversation
for more information, see https://pre-commit.ci
…ey/vizro into feat/enable-header-footer
for more information, see https://pre-commit.ci
header
and footer
inside Graph
, Table
and AgGrid
for more information, see https://pre-commit.ci
…ey/vizro into feat/enable-header-footer
for more information, see https://pre-commit.ci
…ey/vizro into feat/enable-header-footer
for more information, see https://pre-commit.ci
@l0uden - could you create new screenshot tests based on this branch? :) You can take this config:
|
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.
Love this change, really nice to look at! Have a few comments, but approving pending the implementation of those :)
warnings.warn( | ||
"Using `fig.layout.title` in your Plotly chart may cause misalignment with other " | ||
"component titles on the screen. To ensure consistent alignment, consider using " | ||
"`Graph.title` instead." | ||
) | ||
|
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.
warnings.warn( | |
"Using `fig.layout.title` in your Plotly chart may cause misalignment with other " | |
"component titles on the screen. To ensure consistent alignment, consider using " | |
"`Graph.title` instead." | |
) | |
warnings.warn( | |
"""Using the `title` argument in your Plotly chart function may cause misalignment with other component titles on the screen. To ensure consistent alignment, consider using add a title via the `vm.Graph` model | |
instead: `vm.Graph(title=<foo>, ...).""") |
I would align the warning with the actual pre-condition, not only because that is safer to use, but also because it is probably easier to understand.
Would further use triple quotes to make this easier to read.
Lastly, why did we opt for the argument check vs the actual fig.layout.title
check? It was not to build the figure right? I think that was a good choice!
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 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.
Using the triple quotes actually makes it a bit more difficult to read (as an output), because the formatting seems off then 🤔
Took me forever to figure out why the unit tests were failing with this change 😄 But if you use parentheses, you have to change the syntax of match statement: pytest-dev/pytest#10595
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.
Ah weird, did you properly dedent? (either manually, by putting the text to the very left), or by using
from textwrap import dedent
print(dedent("""
Text for which you want to remove
leading whitespace when printed
"""))
Very nice tool :P
Not too important, but makes long strings in code really a lot easier to read (and edit after!)
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.
I really like this initiative 😍.
This also makes initial page loading much prettier as the title is introduced for the Graph component as well (and will be even more prettier when we introduce some shinning div boxes for dynamic components - similar like it's done for dash documentation).
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.
Just a reminder to update the requirements.txt for all py.cafe examples:
vizro==0.1.21
-> vizro==0.1.22
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.
Should we also consider updating Vizro version on some other examples across the hugging face, py.cafe and similar?
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.
This is something done at release, not part of this PR.
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.
I added a reminder note in the release process page for this case.
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.
Ah @petar-qb - I understood what you meant now. We do not need to update the requirements.txt
for all py.cafe examples, because these should run fine with the previous versions, especially as they do not use any of the new features. Some of the requirements.txt
in some pycafe examples we've just updated because I needed to leverage certain features from there.
What we update is our mkdocs.yml
such that our pycafe examples in the docs run on the newest version. I think that's what @maxschulz-COL also referred to, there was already a step in the release process :)
vizro-core/changelog.d/20240902_101331_huong_li_nguyen_enable_header_footer.md
Show resolved
Hide resolved
vizro-core/changelog.d/20240902_101331_huong_li_nguyen_enable_header_footer.md
Outdated
Show resolved
Hide resolved
@maxschulz-COL @petar-qb - do you guys want to take a final look? :) @stichbury - If you have some time to take a look at the docs here, that would also be great! 🙇♀️ |
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, only a couple of very minor comments 🌟
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.
Amazing work! This looks really good to me now. 🎖️
Too late to the party, but look great 😍 |
Description
header
andfooter
inGraph
,Table
andAgGrid
title
inGraph
dash_data_table
to look more similar todash_ag_grid
margin_b
in dashboard overwritesTO DO:
@l0uden
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":