Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: marker genes unavailable for cell types <25 #3825

Merged
merged 6 commits into from
Jan 3, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,19 @@ export default memo(function YAxisChart({
isMarkerGenes &&
yAxisInfoCoords.map((coord, i) => {
const content = cellTypeMetadata[i];
const cellType = isMarkerGenes ? deserializeCellTypeMetadata(content) : null;
return (
<InfoButtonWrapper
id={content}
key={content}
left={coord[0]}
top={coord[1]}
onClick={() => {
if (isMarkerGenes) {
const cellType = deserializeCellTypeMetadata(content);
if (cellType) {
generateMarkerGenes(cellType, tissueID);
}
}}
style={cellType && cellType.total_count < 25 ? {visibility: "hidden"} : {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just return null instead of visibility: "hidden" 😄 ? hidden is good if we expect to unhide the DOM element after user interaction, but that doesn't seem to be the case here, so we can save some memory and CPU cycle on rendering unused elements 👌 !

>
<StyledImage
id={"marker-gene-button"}
Expand Down