Skip to content

Commit

Permalink
[ML] Add padding to percent value
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Dec 15, 2020
1 parent 4bbcbf0 commit c16d60d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@

.mlFieldDataCard__codeContent {
@include euiCodeFont;
font-family: $euiCodeFontFamily;
}

.mlFieldDataCard__stats {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

.mlTopValuesLabelContainer {
.mlTopValuesValueLabelContainer {
padding-right: $euiSizeM;

&.mlTopValuesLabelContainer--small {
width: 50px !important;
&.mlTopValuesValueLabelContainer--small {
width:70px;
}

&.mlTopValuesLabelContainer--large {
width: 200px !important;
&.mlTopValuesValueLabelContainer--large {
width: 200px;
}
}

.mlTopValuesPercentLabelContainer {
padding-left: $euiSizeM;
width:70px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const TopValues: FC<Props> = ({ stats, fieldFormat, barColor, compressed
grow={false}
className={classNames(
'eui-textTruncate',
'mlTopValuesLabelContainer',
`mlTopValuesLabelContainer--${compressed === true ? 'small' : 'large'}`
'mlTopValuesValueLabelContainer',
`mlTopValuesValueLabelContainer--${compressed === true ? 'small' : 'large'}`
)}
>
<EuiToolTip content={kibanaFieldFormat(value.key, fieldFormat)} position="right">
Expand All @@ -67,7 +67,10 @@ export const TopValues: FC<Props> = ({ stats, fieldFormat, barColor, compressed
<EuiFlexItem data-test-subj="mlFieldDataCardTopValueBar">
<EuiProgress value={value.doc_count} max={progressBarMax} color={barColor} size="m" />
</EuiFlexItem>
<EuiFlexItem grow={false} style={{ width: 70 }} className="eui-textTruncate">
<EuiFlexItem
grow={false}
className={classNames('eui-textTruncate', 'mlTopValuesPercentLabelContainer')}
>
<EuiText size="xs" textAlign="left" color="subdued">
{getPercentLabel(value.doc_count, progressBarMax)}
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
}
.mlFieldDataCard__codeContent {
@include euiCodeFont;
font-family: $euiCodeFontFamily;
}
}

Expand Down

0 comments on commit c16d60d

Please sign in to comment.