diff --git a/client/src/components/continuousLegend/index.js b/client/src/components/continuousLegend/index.js index b0a58d28..150cd8a4 100644 --- a/client/src/components/continuousLegend/index.js +++ b/client/src/components/continuousLegend/index.js @@ -116,6 +116,7 @@ class ContinuousLegend extends React.Component { if (colors !== prevProps?.colors || annoMatrix !== prevProps?.annoMatrix) { const { schema } = annoMatrix; const { colorMode, colorAccessor, userColors } = colors; + const colorQuery = createColorQuery( colorMode, colorAccessor, diff --git a/client/src/util/stateManager/colorHelpers.js b/client/src/util/stateManager/colorHelpers.js index d5cd4885..d7be49df 100644 --- a/client/src/util/stateManager/colorHelpers.js +++ b/client/src/util/stateManager/colorHelpers.js @@ -14,6 +14,7 @@ fulfill it */ export function createColorQuery(colorMode, colorByAccessor, schema, genesets) { if (!colorMode || !colorByAccessor || !schema || !genesets) return null; + switch (colorMode) { case "color by categorical metadata": case "color by continuous metadata": { @@ -34,10 +35,11 @@ export function createColorQuery(colorMode, colorByAccessor, schema, genesets) { ]; } case "color by geneset mean expression": { + const varIndex = schema?.annotations?.var?.index; + if (!varIndex) return null; if (!genesets) return null; - const varIndex = schema?.annotations?.var?.index; const _geneset = genesets.get(colorByAccessor); const _setGenes = Array.from(_geneset.genes.keys());