import * as React from 'react'; import _ from 'lodash'; import styles from './tables.module.scss'; import classnames from 'classnames'; import { DefaultTooltip, EllipsisTextTooltip, } from 'cbioportal-frontend-commons'; import { FreqColumnTypeEnum, getGeneColumnCellOverlaySimple, } from '../TableUtils'; import { action, makeObservable, observable } from 'mobx'; import { observer } from 'mobx-react'; import { Else, If, Then } from 'react-if'; import GisticAnnotation from 'shared/components/annotation/Gistic'; import MutSigAnnotation from 'shared/components/annotation/MutSig'; export type IGeneCellProps = { tableType: FreqColumnTypeEnum; selectedGenes: string[]; hugoGeneSymbol: string; qValue: number; isCancerGene: boolean; oncokbAnnotated: boolean; isOncogene: boolean; isTumorSuppressorGene: boolean; onGeneSelect: (hugoGeneSymbol: string) => void; }; @observer export class GeneCell extends React.Component { @observable isVisible: boolean = false; constructor(props: IGeneCellProps) { super(props); makeObservable(this); } @action.bound onVisibleChange(isVisible: boolean) { this.isVisible = isVisible; } render() { const geneIsSelected = _.includes( this.props.selectedGenes, this.props.hugoGeneSymbol ); let iconStyle = { marginLeft: 2, marginTop: 2, }; return (
this.onVisibleChange(true)} onMouseLeave={() => this.onVisibleChange(false)} onClick={() => this.props.onGeneSelect(this.props.hugoGeneSymbol) } >
); } }