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

Add a visual UI distinction for anndata experiments in the gene search results #136

Merged
Show file tree
Hide file tree
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 @@ -21,6 +21,12 @@ const CardContainerDiv = styled.div`
}
`

const SmallIconDiv = styled.div`
width: 5%;
text-align: center;
font-size: 3rem;
`

const IconDiv = styled.div`
width: 15%;
text-align: center;
Expand Down Expand Up @@ -48,6 +54,8 @@ const CountDiv = styled.div`
text-align: center;
`

const ANNDATA = `E-ANND`

class ExperimentCard extends React.Component {
constructor(props) {
super(props)
Expand All @@ -58,7 +66,7 @@ class ExperimentCard extends React.Component {
}

render() {
const {url, species, experimentDescription, markerGenes, numberOfAssays, factors} = this.props
const {url, species, experimentDescription, markerGenes, numberOfAssays, experimentAccession, type, factors} = this.props
Copy link
Contributor

@ke4 ke4 Feb 6, 2023

Choose a reason for hiding this comment

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

I might miss something, but I can't see that the experimentAccession and type is being added to the propTypes. Am I wrong?


const markerGeneLinks = markerGenes ? markerGenes.map((markerGene) =>
<li key={`marker-gene-${markerGene.k}`}>
Expand All @@ -68,6 +76,16 @@ class ExperimentCard extends React.Component {

return (
<CardContainerDiv onClick={this._goToExperiment.bind(this, url)}>
<SmallIconDiv>
<span data-tip={type} data-html={true} className={`icon icon-functional`}>
{
experimentAccession.substring(0,6) === ANNDATA ?
//tbc
<img src={`https://user-images.githubusercontent.com/33519183/203308460-aee477fa-c8ab-4561-be46-34254bfa1731.png`} /> :
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the final icon, right?
I think @alfonsomunozpomer has the final one. We should probably put @alfonsomunozpomer 's one into the resources folder and use it.

<img src={`https://www.ebi.ac.uk/gxa/resources/images/expression-atlas.png`} />
}
</span>
</SmallIconDiv>
<IconDiv>
<EbiSpeciesIcon species={species}/>
<h6>{species}</h6>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ const CardContainerDiv = styled.div`
font-size: 0.9rem;
`

const SmallIconDiv = styled.div`
width: 5%;
text-align: center;
cursor: pointer;
opacity: 0.6;
transition: 0.3s;
:hover {opacity: 1};
`

const IconDiv = styled.div`
width: 15%;
text-align: center;
Expand Down Expand Up @@ -57,9 +66,9 @@ const CountDiv = styled.div`

const ExperimentTableHeaderBasic = () =>
({
'titles': [`Species`, `Marker genes`, `Title`, `Experimental variables`, `Number of assays`],
'styles': [IconDiv, MarkerDiv, TitleDiv, VariableDiv, CountDiv],
'attributes': [`species`, `markerGenes`, `experimentDescription`, null, `numberOfAssays`]
'titles': [`Experiment type`, `Species`, `Marker genes`, `Title`, `Experimental variables`, `Number of assays`],
'styles': [SmallIconDiv, IconDiv, MarkerDiv, TitleDiv, VariableDiv, CountDiv],
'attributes': [`experimentAccession`, `species`, `markerGenes`, `experimentDescription`, null, `numberOfAssays`]
})


Expand Down