Stack cards horizontally in distribution tab#1259
Conversation
To avoid vertical scrolling in IDEs
jeromedockes
left a comment
There was a problem hiding this comment.
thanks a lot @GaelVaroquaux ! I think this can be nice in notebooks and vs code.
the downside as you mentioned in the issue it does reduce the number of cards we can see at once and force us to scroll horizontally to see them.
when in a full page I think it makes a suboptimal use of space:
here I would rather not have to scroll
| cursor: pointer; | ||
| } | ||
|
|
||
| .float-left { |
There was a problem hiding this comment.
Vertical space.
This is the user experience, even with the button on the side

The table report takes a full screen. I cannot see the line that I have run to generate it. It's really annoying. It's a major usability problem, and TBH a reason for me not wanting to use it.
We can improve the tooltip, but it really does not matter compared the waste of vertical space
There was a problem hiding this comment.
Also, I think that the problem that you flagged cannot happen with the new code that I have committed.
|
This was meant to be a quick PR so that people told me if the idea was a good one. This tool is going to be used mostly in IDEs and notebook, so the vertical scaling is crucial (I'm not the only saying this). This is why I moved the button to the side. I'll do it in a cleaner way than the float :). Yes, we can special case the "open", but it makes the code more complicated and I wonder if we are wasting time on a feature that is almost not going to be used. |
jeromedockes
left a comment
There was a problem hiding this comment.
LGTM once the suggestion about relaxing the flex container's width is added
| .report-bottom-border { | ||
| width: calc(100% - 2 * var(--radius)); | ||
| border-bottom: var(--border-s) solid var(--color-border-secondary); | ||
| margin: var(--spacing-m) auto 0 auto; |
There was a problem hiding this comment.
to prevent cropping the shadows isn't it easier to keep the margin that used to be around the cards? (it is a bit large but we can reduce it & make it much smaller on top and left)
There was a problem hiding this comment.
I see this padding needed only the statistics and associations panel. I've added it
| margin: 0; | ||
| /* A bit of space between the bar and the buttons */ | ||
| .column-selection-buttons { | ||
| padding-left: 10pt; |
There was a problem hiding this comment.
| padding-left: 10pt; | |
| padding-left: var(--spacing-m); |
|
for the buttons, indeed there is not the issue I pointed out anymore. one drawback of having them on the side is that they move when we click them. we could also consider just removing those buttons and the bar because I don't know how many people would use them (either because they don't need it or haven't figured out what it does) |
|
Could we have the buttons and the bar appear only when the selection is not empty? Ie when clicking on the tick box of the cards?
…On Mar 20, 2025, 10:37, at 10:37, "Jérôme Dockès" ***@***.***> wrote:
jeromedockes left a comment (skrub-data/skrub#1259)
for the buttons, indeed there is not the issue I pointed out anymore.
one drawback of having them on the side is that they move when we click
them.
we could also consider just removing those buttons and the bar because
I don't know how many people would use them (either because they don't
need it or haven't figured out what it does)
--
Reply to this email directly or view it on GitHub:
#1259 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
|
For the button:
I think that what would be really cool would be to have the button and the bar visible only when the bar is not empty. Ie, clicking on the tickbox would have them show up. Do you know easily how to add this, @jeromedockes ? |
Co-authored-by: Jérôme Dockès <jerome@dockes.org>
yes that's easy to do but the card (and tickbox we are clicking) will jump when we click on the first tickbox (or uncheck the last), and selecting all columns to then remove some becomes check one to make the button appear, then select all. so all in all I'm not sure it's better than the solution in this PR. I suggest we keep as it is in this PR and experiment with that in a separate one |
I agree! :) I do like the idea of making this not visible by default. It would also decrease the visual crowding, which would be great |
|
OK, I think that this is ready for merge |
|
to prevent cropping the shadows isn't it easier to keep the margin that used to be around the cards?
That does not work, because it applies to the enclosing element and thus the shadow stop inside the enclosed element, leaving the white margin outside.
|
I'm not sure I understood 100% what you mean but I still see the shadows being cropped with the current pr's version: we can avoid it either by having a margin around the cards diff --git a/skrub/_reporting/_data/templates/column-summaries.css b/skrub/_reporting/_data/templates/column-summaries.css
index a037513a..bbcbc341 100644
--- a/skrub/_reporting/_data/templates/column-summaries.css
+++ b/skrub/_reporting/_data/templates/column-summaries.css
@@ -9,7 +9,7 @@
display: flex;
flex-direction: row;
flex-wrap: nowrap;
- gap: var(--spacing-l);
+ gap: 0;
width: max-content;
}
@@ -25,9 +25,14 @@
}
.column-summary-group > .card {
- margin: 0;
+ margin: var(--spacing-s) var(--spacing-l) var(--spacing-l) var(--spacing-l);
}
+.column-summary-group > .card + .card {
+ margin-left: 0;
+}
+
+
/* Individual column summary cards */
/* ------------------------------- */
or padding on the parent diff --git a/skrub/_reporting/_data/templates/column-summaries.css b/skrub/_reporting/_data/templates/column-summaries.css
index a037513a..7aac0e7d 100644
--- a/skrub/_reporting/_data/templates/column-summaries.css
+++ b/skrub/_reporting/_data/templates/column-summaries.css
@@ -11,6 +11,7 @@
flex-wrap: nowrap;
gap: var(--spacing-l);
width: max-content;
+ padding: var(--spacing-s) var(--spacing-l) var(--spacing-l) var(--spacing-l);
}
/* Increase the gap between buttons & columns to make it clearer the buttons are |
|
I'm fine with your proposed solution as long as it doesn't add too much vertical whitespace. Do you want to send a PR here? I'm totally out of time on this, I did this PR as a quick demo of a solution to the problem, and I'm spending why more time than I can afford on this |
|
just so we have the full discussion here: there are also some comments in |
And color the cards
|
I think we are losing some contrast (unless we also change the text), https://webaim.org/resources/contrastchecker/ complains about these (there may be more): the bar plots & background are also quite close and this is a detail but buttons don't match the background anymore, not sure if that's good or bad the background color makes it harder to have a good contrast and I'm not sure the benefit it brings makes up for that. maybe we need to tone them down or change the text color. to avoid delaying the horizontal scroll thing we can also merge it like this and revisit the colors in another pr |
|
Ok, can you take over. |
|
ok the contrast between the text and background should be ok now, @GaelVaroquaux lmk if it's ok for you |
|
(closed by mistake) |
Agreed |
| .columns-in-sample-tab .card-header { | ||
| position: relative; | ||
| background-color: var(--color-background-highlight-primary); | ||
| border-block-end: var(--border-s) solid var(--color-border-highlight); |
There was a problem hiding this comment.
@jeromedockes : do you think that this is the faulty change, regarding the border?
There was a problem hiding this comment.
no I think it is this one
if it's ok for you I'll restore the deleted rule it but making the vertical margin much smaller
There was a problem hiding this comment.
Yes, but much smaller :).
Thanks!
| /* shadows */ | ||
| --color-shadow: hsl(0, 0%, 63%); | ||
| --color-shadow-keyboard: rgb(255, 255, 255, 0.5); | ||
| --color-shadow-keyboard: var(--color-border-secondary); |
There was a problem hiding this comment.
that one is not related to this pr but I noticed it and figured let's fix it here and not do another pr for 2 lines of diff
|
@rcap107 : can you check the visuals (eg the rendered docs) and merge if happy? |
Co-authored-by: Jérôme Dockès <jerome@dockes.org>
Co-authored-by: Jérôme Dockès <jerome@dockes.org>


















To avoid vertical scrolling in IDEs.
Related to #1257