Skip to content

Commit cbee5a0

Browse files
committed
Fiddle with flex box and wrapping
1 parent ae7582c commit cbee5a0

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/legacy/core_plugins/metrics/public/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ $tvbValueColorReversed: transparentize($euiColorEmptyShade, .2);
1010
$tvbHoverBackgroundColor: transparentize($euiColorFullShade, .9);
1111
$tvbHoverBackgroundColorReversed: transparentize($euiColorEmptyShade, .9);
1212

13-
$tvbSplitBlockVisMinSize: 200px;
13+
$tvbSplitBlockVisMinSize: $euiSize * 12;
Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
.tvbSplitVis {
2+
width: 100%;
23
display: flex;
3-
flex: 1 0 auto;
4+
// Allow wrapping beyond 4 in a row
45
flex-wrap: wrap;
5-
justify-content: center;
6-
align-content: center;
7-
width: 100%;
6+
// Space out each vis instead of clumping in the center to utilize more hoizontal space
7+
justify-content: space-around;
8+
// Stretch the all the heights so that prior to wrapping the vis' take up the full panel height
9+
align-items: stretch;
10+
}
11+
12+
.tvbSplitVis__split {
13+
// This maintains that each vis will be at least 1/4 of the panel's width
14+
// but it will also grow to fill the space if there are less than 4 in a row
15+
flex: 1 0 25%;
16+
// Ensure a minimum width is acheived on smaller width panels
17+
min-width: $tvbSplitBlockVisMinSize;
18+
display: flex;
819

9-
&__split {
10-
display: flex;
11-
flex: 0 1 auto;
12-
flex-direction: row;
13-
overflow: hidden;
14-
min-width: $tvbSplitBlockVisMinSize;
15-
min-height: $tvbSplitBlockVisMinSize;
20+
> .tvbVis {
21+
// Apply the minimum height on the vis itself so it doesn't interfere with flex calculations
22+
// Gauges are not completely square, so the height is just slightly less than the width
23+
min-height: $tvbSplitBlockVisMinSize / 1.25;
1624
}
1725
}

0 commit comments

Comments
 (0)