diff --git a/immuscreen/src/common/components/umapplot.tsx b/immuscreen/src/common/components/umapplot.tsx index cc47648..dd42284 100644 --- a/immuscreen/src/common/components/umapplot.tsx +++ b/immuscreen/src/common/components/umapplot.tsx @@ -153,10 +153,10 @@ export const UmapPlot = (props) => { const maxValue = Math.max(...props.data.map(a => a.value)) const minValue = Math.min(...props.data.map(a => a.value)) - const linearScale = scaleLinear({ - domain: [minValue, maxValue], - range: ["#ffcd00", "#ff0000"], - }); + // const linearScale = scaleLinear({ + // domain: [minValue, maxValue], + // range: ["#ffcd00", "#ff0000"], + // }); let uniqcelltypes = [...new Set([...props.data].sort((a, b) => { if (!experimentInfo[a.name]?.order) console.log(a.name) //some experiments returned in gene expression umap are not in experiment list? @@ -190,7 +190,7 @@ export const UmapPlot = (props) => { numTicks={4} scale={xScale} /> - {props.data.map(point => { + {[... props.data].sort((a,b) => a.value - b.value).map(point => { return ( {point.stimulation === 'S' ? @@ -201,7 +201,7 @@ export const UmapPlot = (props) => { rotate={90} onMouseOver={(event) => handleHover(event, point)} onMouseLeave={(event) => handleLeaveHover(event, point)} - fill={(props.colorScheme === 'geneexp' || props.colorScheme === 'ZScore') ? linearScale(point.value) : getCellColor(point.celltype)} + fill={(props.colorScheme === 'geneexp' || props.colorScheme === 'ZScore') ? point.value > 1.64 ? 'red' : 'yellow' : getCellColor(point.celltype)} stroke={tooltipData && tooltipData.celltype === point.celltype ? 'black' : ''} /> : { onMouseOver={(event) => handleHover(event, point)} onMouseLeave={(event) => handleLeaveHover(event, point)} //fill= {`${linearScale(point.value)}`} - fill={(props.colorScheme === 'geneexp' || props.colorScheme === 'ZScore') ? linearScale(point.value) : getCellColor(point.celltype)} + fill={(props.colorScheme === 'geneexp' || props.colorScheme === 'ZScore') ? point.value > 1.64 ? 'red' : 'yellow' : getCellColor(point.celltype)} stroke={tooltipData && tooltipData.celltype === point.celltype ? 'black' : ''} /> } @@ -241,39 +241,40 @@ export const UmapPlot = (props) => { )}
{(props.colorScheme === 'geneexp' || props.colorScheme === 'ZScore') ? - - (+d).toFixed(2)} - > - {(labels) => - labels.sort((a, b) => b.index - a.index).map((label, i) => ( - { - //if (events) alert(`clicked: ${JSON.stringify(label)}`); - }} - > - - - - - {label.text} - - - )) - } - - + // + // (+d).toFixed(2)} + // > + // {(labels) => + // labels.sort((a, b) => b.index - a.index).map((label, i) => ( + // { + // //if (events) alert(`clicked: ${JSON.stringify(label)}`); + // }} + // > + // + // + // + // + // {label.text} + // + // + // )) + // } + // + // + <> :