Skip to content

Commit

Permalink
feat: increase tooltip width to 500px and truncate items to 2 lines (#…
Browse files Browse the repository at this point in the history
…2261)

feat: truncate to 2 + width 500
  • Loading branch information
mbondyra authored Nov 29, 2023
1 parent 4703681 commit afdef1c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
@mixin lineClamp($maxLines) {
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $maxLines; /* number of lines to show */
line-clamp: $maxLines;
-webkit-box-orient: vertical;
overflow: hidden;
}

.echMetricText {
position: relative;
padding: 8px;
Expand Down
9 changes: 9 additions & 0 deletions packages/charts/src/components/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
overflow: hidden;
min-width: 1px;
}

@mixin lineClamp($maxLines) {
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $maxLines; /* number of lines to show */
line-clamp: $maxLines;
-webkit-box-orient: vertical;
overflow: hidden;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ $transitionTime: 200ms;
}

.echTooltip__tableCell--truncate {
@include euiTextTruncate;
@include lineClamp(2);
}

&__metricRow {
Expand Down
8 changes: 4 additions & 4 deletions packages/charts/src/components/tooltip/placement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getStylesFromPlacement(
case 'top-end':
case 'bottom-end':
return {
width: maxWidth,
maxWidth,
justifyContent: 'flex-end',
};
case 'right':
Expand All @@ -34,21 +34,21 @@ export function getStylesFromPlacement(
case 'top-start':
case 'bottom-start':
return {
width: maxWidth,
maxWidth,
justifyContent: 'flex-start',
};
case 'top':
case 'bottom':
return {
width: maxWidth,
maxWidth,
justifyContent: 'center',
};
case 'auto':
case 'auto-start':
case 'auto-end':
default:
return {
width: maxWidth,
maxWidth,
};
}
}
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/dark_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export const DARK_THEME: Theme = {
},
bulletGraph: DARK_THEME_BULLET_STYLE,
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.White.keyword,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/legacy_dark_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export const LEGACY_DARK_THEME: Theme = {
},
bulletGraph: DARK_THEME_BULLET_STYLE,
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.White.keyword,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/legacy_light_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export const LEGACY_LIGHT_THEME: Theme = {
},
bulletGraph: LIGHT_THEME_BULLET_STYLE,
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.Black.keyword,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/utils/themes/light_theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export const LIGHT_THEME: Theme = {
},
bulletGraph: LIGHT_THEME_BULLET_STYLE,
tooltip: {
maxWidth: 260,
maxWidth: 500,
maxTableHeight: 120,
defaultDotColor: Colors.Black.keyword,
},
Expand Down

0 comments on commit afdef1c

Please sign in to comment.