Skip to content

Commit

Permalink
Restyle Microtrait and Biolog tooltips.
Browse files Browse the repository at this point in the history
  • Loading branch information
dakotablair committed May 6, 2024
1 parent 38d1743 commit d6a9295
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 30 deletions.
46 changes: 32 additions & 14 deletions src/features/collections/data_products/Biolog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,41 @@ export const Biolog: FC<{
} else {
return (
<>
Type: {column.columnDef.meta?.type}
<hr />
Row: (
<DataViewLink identifier={row.kbase_id}>
{row.kbase_id}
</DataViewLink>) {row.kbase_display_name}
<br />
Col: {column.columnDef.header}
<br />
Val: {`${cell.val}`}
<br />
Media: {`${cell.meta?.growth_media}`}
<>
<table>
<tr>
<th>KBase ID</th>
<td>
<DataViewLink identifier={row.kbase_id}>
{row.kbase_id}
</DataViewLink>
) {row.kbase_display_name}
</td>
</tr>
<tr>
<th>Treatment</th>
<td>{`${column.columnDef.header}`}</td>
</tr>
<tr>
<td colSpan={2}>
<hr />
</td>
</tr>
<tr>
<th>Type</th>
<td>{column.columnDef.meta?.type}</td>
</tr>
<tr>
<th>Value</th>
<td> {`${cell.val}`}</td>
</tr>
<tr>
<th>Media</th>
<td>{cell.meta?.growth_media}</td>
</tr>
{data.values.map(({ id, val }) => (
<div key={id}>{`- ${id}:${val}`}</div>
))}
</>
</table>
</>
);
}
Expand Down
14 changes: 14 additions & 0 deletions src/features/collections/data_products/HeatMap.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ See the mouseout handler in the <HeatMap /> component.
color: use-color("white");
font-size: 0.667rem;
font-weight: bold;
max-width: 250px;
padding: 4px 8px;
position: fixed;
z-index: 1;
Expand All @@ -113,6 +114,19 @@ See the mouseout handler in the <HeatMap /> 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;
Expand Down
70 changes: 54 additions & 16 deletions src/features/collections/data_products/Microtrait.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,60 @@ export const Microtrait: FC<{
} else {
return (
<>
Type: {column.columnDef.meta?.type}
<hr />
Row: (
<DataViewLink identifier={getUPAFromEncoded(row.kbase_id)}>
{getUPAFromEncoded(row.kbase_id)}
</DataViewLink>
) {row.kbase_display_name}
<br />
Col: {column.columnDef.header}
<br />
Val: {`${cell.val}`}
<>
{data.values.map(({ id, val }) => (
<div key={id}>{`- ${id}:${val}`}</div>
))}
</>
<table>
<tr>
<th>KBase ID</th>
<td>
(
<DataViewLink identifier={getUPAFromEncoded(row.kbase_id)}>
{getUPAFromEncoded(row.kbase_id)}
</DataViewLink>
) {row.kbase_display_name}
</td>
</tr>
<tr>
<th>Trait</th>
<td>{`${column.columnDef.header}`}</td>
</tr>
<tr>
<td colSpan={2}>
<hr />
</td>
</tr>
<tr>
<th>Type</th>
<td>{column.columnDef.meta?.type}</td>
</tr>
<tr>
<th>Value</th>
<td> {`${cell.val}`}</td>
</tr>
{data.values.length > 0 ? (
<>
<tr>
<td colSpan={2}>
<hr />
</td>
</tr>
<tr>
<th>Genes Detected</th>
<th>
<abbr title="Trusted Cutoff">TC</abbr> value
</th>
</tr>
<>
{data.values.map(({ id, val }) => (
<tr key={id}>
<td>{id}</td>
<td>{val}</td>
</tr>
))}
</>
</>
) : (
<></>
)}
</table>
</>
);
}
Expand Down

0 comments on commit d6a9295

Please sign in to comment.