From 7b01e9e67b3f47a7e9b95edd51d529bc13fa8cab Mon Sep 17 00:00:00 2001 From: Colin Megill Date: Mon, 5 Jul 2021 02:53:36 -0700 Subject: [PATCH] remove hardcoded geneset --- client/src/components/dotplot/index.js | 95 ++++++++++++++------------ 1 file changed, 53 insertions(+), 42 deletions(-) diff --git a/client/src/components/dotplot/index.js b/client/src/components/dotplot/index.js index e23e9315..a24b75eb 100644 --- a/client/src/components/dotplot/index.js +++ b/client/src/components/dotplot/index.js @@ -6,7 +6,7 @@ import Column from "./column"; @connect((state) => ({ layoutChoice: state.layoutChoice, genesets: state.genesets.genesets, - colors: state.colors, + dotplot: state.dotplot, })) class Dotplot extends React.Component { constructor(props) { @@ -39,15 +39,15 @@ class Dotplot extends React.Component { render() { const { viewport } = this.state; - const { genesets } = this.props; + const { genesets, dotplot } = this.props; - const _TESTgeneset = genesets.get("bladder urothelial"); - const _TESTmetadatField = "tissue"; + let _geneset = null; + let _genes = null; - /* TODO(colinmegill) #632 componetize */ - if (!_TESTgeneset) return null; - - const _genes = Array.from(_TESTgeneset.genes.keys()); + if (dotplot.column) { + _geneset = genesets.get(dotplot.column); + _genes = Array.from(_geneset.genes.keys()); + } return (
- {/* Acaa1b, Mal, Foxq1 ... across the top of the dotplot */} - - {_genes.map((_geneSymbol, _geneIndexInGeneset) => { - return ( - - {_geneSymbol} - - ); - })} - - {/* loop over genes in the geneset, */} - - {_genes.map((_geneSymbol, _geneIndexInGeneset) => { - return ( - - ); - })} - + + {!dotplot.row && "Select a row"}{" "} + {!dotplot.column && "Select a column"} + + {dotplot.row && dotplot.column && ( + + {/* Acaa1b, Mal, Foxq1 ... across the top of the dotplot */} + + {_genes.map((_geneSymbol, _geneIndexInGeneset) => { + return ( + + {_geneSymbol} + + ); + })} + + {/* loop over genes in the geneset, */} + + {_genes.map((_geneSymbol, _geneIndexInGeneset) => { + return ( + + ); + })} + + + )}
);