Skip to content

Commit b4bfec3

Browse files
authored
Merge pull request #3 from cchaos/alexwizp-tsvb_27770/design
Fiddle with flex box and wrapping
2 parents 2dc4e8a + 6d25a3d commit b4bfec3

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
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: $euiSize * 15;
13+
$tvbSplitBlockVisMinSize: $euiSize * 12;
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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-
align-self: start;
8-
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;
910
}
1011

1112
.tvbSplitVis__split {
12-
display: flex;
13-
flex: 1 0 auto;
14-
flex-direction: row;
15-
overflow: hidden;
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
1617
min-width: $tvbSplitBlockVisMinSize;
17-
min-height: $tvbSplitBlockVisMinSize;
18+
display: flex;
19+
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;
24+
}
1825
}

0 commit comments

Comments
 (0)