-
Notifications
You must be signed in to change notification settings - Fork 194
ENH - Adding a parameter to select the default TableReport tab to show #1737
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
ENH - Adding a parameter to select the default TableReport tab to show #1737
Conversation
|
This would make #1476 easier to write as well |
generated_for_index/baskets.html
Outdated
| @@ -0,0 +1,30 @@ | |||
| <table border="1" class="dataframe"> | |||
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.
how are those 3 home page files changes related to the 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 am not entirely sure how those files ended up there, I removed them
skrub/_reporting/_html.py
Outdated
| standalone=True, | ||
| column_filters=None, | ||
| minimal_report_mode=False, | ||
| default_tab="table", |
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'm not sure it's really a "default" -- it is the one that is open when loading the page. not sure we can find a better name though 🤔 , maybe open_tab, selected_tab
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 think open_tab works
skrub/_reporting/_html.py
Outdated
| "default_tab": default_tab, | ||
| "default_panel_id": default_panel_id, |
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.
| "default_tab": default_tab, | |
| "default_panel_id": default_panel_id, | |
| "default_panel_id": default_panel_id, |
default_tab doesn't seem to be used in the template, and that's good because it's best not to have 2 different parameters to encode the same info
jeromedockes
left a comment
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 otherwise :)
|
I guess we could also add a test in the js test suite to check that the correct tab is actually opened when opening the report |
jeromedockes
left a comment
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.
thanks @rcap107 !
Co-authored-by: Jérôme Dockès <[email protected]>
This is a relatively small change that simplifies a lot writing examples with the TableReport.
The idea is having the parameter "default_tab" to let the user select the specific tab in the report (either the preview, stats, distributions, or associations) so that the TableReport is rendered with the given tab already pre-selected.