metadata as var, maxsize todo

This commit is contained in:
Colin Megill
2021-07-23 13:28:17 -07:00
parent f0e9b1ab91
commit 2b29a152b9
3 changed files with 17 additions and 6 deletions
+10 -4
View File
@@ -30,11 +30,17 @@ class Column extends React.Component {
createCategorySummaryFromDfCol = memoize(createCategorySummaryFromDfCol); createCategorySummaryFromDfCol = memoize(createCategorySummaryFromDfCol);
fetchAsyncProps = async (props) => { fetchAsyncProps = async (props) => {
const { annoMatrix, colors, _geneSymbol, _geneIndex } = props.watchProps; const {
annoMatrix,
colors,
_geneSymbol,
_geneIndex,
metadataField,
} = props.watchProps;
const [categoryData, categorySummary, colorData] = await this.fetchData( const [categoryData, categorySummary, colorData] = await this.fetchData(
annoMatrix, annoMatrix,
"tissue", metadataField,
colors, colors,
_geneSymbol, _geneSymbol,
_geneIndex _geneIndex
@@ -131,6 +137,7 @@ class Column extends React.Component {
_geneSymbol, _geneSymbol,
_geneIndex, _geneIndex,
rowColumnSize, rowColumnSize,
metadataField,
} = this.props; } = this.props;
return ( return (
@@ -145,6 +152,7 @@ class Column extends React.Component {
viewport, viewport,
_geneSymbol, _geneSymbol,
_geneIndex, _geneIndex,
metadataField,
}} }}
> >
<Async.Pending initial> <Async.Pending initial>
@@ -173,8 +181,6 @@ class Column extends React.Component {
/* TODO(colinmegill) #632 wire to dotplot */ /* TODO(colinmegill) #632 wire to dotplot */
const metadataField = "tissue";
const groupBy = categoryData.col(metadataField); const groupBy = categoryData.col(metadataField);
const col = colorData.icol(0); const col = colorData.icol(0);
const range = col.summarize(); const range = col.summarize();
+5 -2
View File
@@ -19,7 +19,10 @@ const Dot = (props) => {
(acc, current) => acc + current (acc, current) => acc + current
); /* SUM REMAINING ELEMENTS */ ); /* SUM REMAINING ELEMENTS */
/* TODO(colinmegill) #632 colorscale */ /* TODO(colinmegill) #632 scale between correct dimensions */
const _maxSize = rowColumnSize;
const _radius =
(rest / zeros) * 10 > _maxSize ? _maxSize : (rest / zeros) * 10;
return ( return (
<g <g
@@ -38,7 +41,7 @@ const Dot = (props) => {
</text> </text>
)} )}
<circle <circle
r={(rest / zeros) * 10 > 20 ? 20 : (rest / zeros) * 10} r={_radius}
cx="11" cx="11"
cy="-3.5" cy="-3.5"
style={{ style={{
+2
View File
@@ -42,6 +42,7 @@ class Dotplot extends React.Component {
const { genesets } = this.props; const { genesets } = this.props;
const _TESTgeneset = genesets.get("bladder urothelial"); const _TESTgeneset = genesets.get("bladder urothelial");
const _TESTmetadatField = "cell_ontology_class";
/* TODO(colinmegill) #632 componetize */ /* TODO(colinmegill) #632 componetize */
if (!_TESTgeneset) return null; if (!_TESTgeneset) return null;
@@ -100,6 +101,7 @@ class Dotplot extends React.Component {
_geneIndex={_geneIndexInGeneset} _geneIndex={_geneIndexInGeneset}
viewport={viewport} viewport={viewport}
rowColumnSize={this.rowColumnSize} rowColumnSize={this.rowColumnSize}
metadataField={_TESTmetadatField}
/> />
); );
})} })}