diff --git a/client/src/components/geneExpression/geneSet.js b/client/src/components/geneExpression/geneSet.js
index aeb359ca..b0a649ed 100644
--- a/client/src/components/geneExpression/geneSet.js
+++ b/client/src/components/geneExpression/geneSet.js
@@ -179,7 +179,12 @@ class GeneSet extends React.Component {
)}
-
+
diff --git a/client/src/components/geneExpression/menus/genesetMenus.js b/client/src/components/geneExpression/menus/genesetMenus.js
index 7f48948d..d7b7b6b3 100644
--- a/client/src/components/geneExpression/menus/genesetMenus.js
+++ b/client/src/components/geneExpression/menus/genesetMenus.js
@@ -1,12 +1,14 @@
import React from "react";
import { connect } from "react-redux";
+import { Tooltip2 } from "@blueprintjs/popover2";
+
import {
Button,
+ AnchorButton,
Menu,
MenuItem,
Popover,
Position,
- Tooltip,
Icon,
PopoverInteractionKind,
} from "@blueprintjs/core";
@@ -18,6 +20,7 @@ import AddGeneToGenesetDialogue from "./addGeneToGenesetDialogue";
@connect((state) => {
return {
genesetsUI: state.genesetsUI,
+ colorAccessor: state.colors.colorAccessor,
};
})
class GenesetMenus extends React.PureComponent {
@@ -43,19 +46,41 @@ class GenesetMenus extends React.PureComponent {
});
};
+ handleColorByEntireGeneset = () => {
+ const { dispatch, geneset } = this.props;
+
+ dispatch({
+ type: "color by geneset mean expression",
+ geneset,
+ });
+ };
+
handleDeleteCategory = () => {
const { dispatch, geneset } = this.props;
dispatch(actions.genesetDelete(geneset));
};
render() {
- const { geneset, genesetsEditable, createText } = this.props;
+ const {
+ geneset,
+ genesetsEditable,
+ createText,
+ colorAccessor,
+ isOpen,
+ toggleSummaryHisto,
+ } = this.props;
+
+ const isColorBy = geneset === colorAccessor;
+ const genesetClosed = !isOpen;
+ const showingAllGenes = !toggleSummaryHisto;
+
+ const notShowingSummary = genesetClosed || showingAllGenes;
return (
<>
{genesetsEditable ? (
<>
-
-
+
- }
- />
+
+ }
+ />
+
>
) : null}
>
diff --git a/client/src/reducers/colors.js b/client/src/reducers/colors.js
index a95b51ce..39d021a1 100644
--- a/client/src/reducers/colors.js
+++ b/client/src/reducers/colors.js
@@ -4,8 +4,8 @@ Color By UI state
const ColorsReducer = (
state = {
- colorMode: null,
- colorAccessor: null,
+ colorMode: null /* by continuous, by expression */,
+ colorAccessor: null /* tissue, Apod */,
},
action,
nextSharedState,
@@ -96,6 +96,21 @@ const ColorsReducer = (
};
}
+ case "color by geneset mean expression": {
+ /* toggle between this mode and reset */
+ const resetCurrent =
+ action.type === state.colorMode &&
+ action.geneset === state.colorAccessor;
+ const colorMode = !resetCurrent ? action.type : null;
+ const colorAccessor = !resetCurrent ? action.geneset : null;
+
+ return {
+ ...state,
+ colorMode,
+ colorAccessor,
+ };
+ }
+
default: {
return state;
}