From d6a929577ab04345ecf56c8918adfdd1cf39471d Mon Sep 17 00:00:00 2001 From: Dakota Blair Date: Fri, 3 May 2024 15:17:33 -0400 Subject: [PATCH] Restyle Microtrait and Biolog tooltips. --- .../collections/data_products/Biolog.tsx | 46 ++++++++---- .../data_products/HeatMap.module.scss | 14 ++++ .../collections/data_products/Microtrait.tsx | 70 ++++++++++++++----- 3 files changed, 100 insertions(+), 30 deletions(-) diff --git a/src/features/collections/data_products/Biolog.tsx b/src/features/collections/data_products/Biolog.tsx index c844c59e..ce6452ae 100644 --- a/src/features/collections/data_products/Biolog.tsx +++ b/src/features/collections/data_products/Biolog.tsx @@ -68,23 +68,41 @@ export const Biolog: FC<{ } else { return ( <> - Type: {column.columnDef.meta?.type} -
- Row: ( - - {row.kbase_id} - ) {row.kbase_display_name} -
- Col: {column.columnDef.header} -
- Val: {`${cell.val}`} -
- Media: {`${cell.meta?.growth_media}`} - <> + + + + + + + + + + + + + + + + + + + + + + + + {data.values.map(({ id, val }) => (
{`- ${id}:${val}`}
))} - +
KBase ID + + {row.kbase_id} + + ) {row.kbase_display_name} +
Treatment{`${column.columnDef.header}`}
+
+
Type{column.columnDef.meta?.type}
Value {`${cell.val}`}
Media{cell.meta?.growth_media}
); } diff --git a/src/features/collections/data_products/HeatMap.module.scss b/src/features/collections/data_products/HeatMap.module.scss index 8343883a..4ad9f972 100644 --- a/src/features/collections/data_products/HeatMap.module.scss +++ b/src/features/collections/data_products/HeatMap.module.scss @@ -100,6 +100,7 @@ See the mouseout handler in the component. color: use-color("white"); font-size: 0.667rem; font-weight: bold; + max-width: 250px; padding: 4px 8px; position: fixed; z-index: 1; @@ -113,6 +114,19 @@ See the mouseout handler in the component. color: use-color("accent-cool"); } +.tooltip th { + min-width: 4rem; + text-align: left; + vertical-align: top; + word-break: normal; + word-wrap: break-word; +} + +.tooltip td { + text-align: left; + word-break: break-all; +} + .trait-names { display: flex; flex-flow: row nowrap; diff --git a/src/features/collections/data_products/Microtrait.tsx b/src/features/collections/data_products/Microtrait.tsx index dbbb1e23..f64d30a5 100644 --- a/src/features/collections/data_products/Microtrait.tsx +++ b/src/features/collections/data_products/Microtrait.tsx @@ -70,22 +70,60 @@ export const Microtrait: FC<{ } else { return ( <> - Type: {column.columnDef.meta?.type} -
- Row: ( - - {getUPAFromEncoded(row.kbase_id)} - - ) {row.kbase_display_name} -
- Col: {column.columnDef.header} -
- Val: {`${cell.val}`} - <> - {data.values.map(({ id, val }) => ( -
{`- ${id}:${val}`}
- ))} - + + + + + + + + + + + + + + + + + + + + + {data.values.length > 0 ? ( + <> + + + + + + + + <> + {data.values.map(({ id, val }) => ( + + + + + ))} + + + ) : ( + <> + )} +
KBase ID + ( + + {getUPAFromEncoded(row.kbase_id)} + + ) {row.kbase_display_name} +
Trait{`${column.columnDef.header}`}
+
+
Type{column.columnDef.meta?.type}
Value {`${cell.val}`}
+
+
Genes Detected + TC value +
{id}{val}
); }