feat: add quick gene lookup functionality (#2250)

* add/remove gene functionality back with geneset style gene

* styling and expansion

* memo gene list to prevent re render
This commit is contained in:
Severiano Badajoz
2021-06-23 13:59:10 -04:00
committed by GitHub
parent 023ae10822
commit 82de4178d9
3 changed files with 251 additions and 21 deletions
+17 -11
View File
@@ -64,6 +64,8 @@ class Gene extends React.Component {
isColorAccessor,
isScatterplotXXaccessor,
isScatterplotYYaccessor,
quickGene,
removeGene,
} = this.props;
const { geneIsExpanded } = this.state;
const geneSymbolWidth = 60 + (geneIsExpanded ? MINI_HISTOGRAM_WIDTH : 0);
@@ -94,16 +96,18 @@ class Gene extends React.Component {
}}
>
<div>
<Icon
icon="drag-handle-horizontal"
iconSize={12}
style={{
marginRight: 7,
cursor: "grab",
position: "relative",
top: -1,
}}
/>
{!quickGene && (
<Icon
icon="drag-handle-horizontal"
iconSize={12}
style={{
marginRight: 7,
cursor: "grab",
position: "relative",
top: -1,
}}
/>
)}
<Truncate
tooltipAddendum={geneDescription && `: ${geneDescription}`}
>
@@ -132,7 +136,9 @@ class Gene extends React.Component {
minimal
small
data-testid={`delete-from-geneset-${gene}`}
onClick={this.handleDeleteGeneFromSet}
onClick={
quickGene ? removeGene(gene) : this.handleDeleteGeneFromSet
}
intent="none"
style={{ fontWeight: 700, marginRight: 2 }}
icon={<Icon icon="trash" iconSize={10} />}