mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 19:28:12 +08:00
reducer
This commit is contained in:
@@ -48,7 +48,7 @@ import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers";
|
|||||||
tosURL: state.config?.parameters?.about_legal_tos,
|
tosURL: state.config?.parameters?.about_legal_tos,
|
||||||
privacyURL: state.config?.parameters?.about_legal_privacy,
|
privacyURL: state.config?.parameters?.about_legal_privacy,
|
||||||
categoricalSelection: state.categoricalSelection,
|
categoricalSelection: state.categoricalSelection,
|
||||||
dotplotEnabled: true /* TODO(colinmegill) #632 wire dotplot*/,
|
dotplotEnabled: state.layoutChoice.dotplot,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
class MenuBar extends React.PureComponent {
|
class MenuBar extends React.PureComponent {
|
||||||
@@ -195,7 +195,10 @@ class MenuBar extends React.PureComponent {
|
|||||||
dispatch(actions.resetSubsetAction());
|
dispatch(actions.resetSubsetAction());
|
||||||
};
|
};
|
||||||
|
|
||||||
handleDotplotToggle = () => {};
|
handleDotplotToggle = () => {
|
||||||
|
const { dispatch } = this.props;
|
||||||
|
dispatch({ type: "toggle dotplot" });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
@@ -265,9 +268,6 @@ class MenuBar extends React.PureComponent {
|
|||||||
<Tooltip
|
<Tooltip
|
||||||
content="Enable dotplot mode (hides embedding)"
|
content="Enable dotplot mode (hides embedding)"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
disabled={
|
|
||||||
false /* TODO(colinmegill) #632 if no genesets or categories*/
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<AnchorButton
|
<AnchorButton
|
||||||
className={styles.menubarButton}
|
className={styles.menubarButton}
|
||||||
@@ -277,9 +277,6 @@ class MenuBar extends React.PureComponent {
|
|||||||
onClick={this.handleDotplotToggle}
|
onClick={this.handleDotplotToggle}
|
||||||
active={dotplotEnabled}
|
active={dotplotEnabled}
|
||||||
intent={dotplotEnabled ? "primary" : "none"}
|
intent={dotplotEnabled ? "primary" : "none"}
|
||||||
disabled={
|
|
||||||
false /* TODO(colinmegill) #632 if no genesets or categories*/
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
const Dotplot = (
|
||||||
|
state = {
|
||||||
|
row: null,
|
||||||
|
column: null,
|
||||||
|
},
|
||||||
|
action
|
||||||
|
) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case "set dotplot row":
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
row: action.data,
|
||||||
|
};
|
||||||
|
case "set dotplot column":
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
column: action.data,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Dotplot;
|
||||||
@@ -24,7 +24,7 @@ function setToDefaultLayout(schema) {
|
|||||||
const LayoutChoice = (
|
const LayoutChoice = (
|
||||||
state = {
|
state = {
|
||||||
available: [], // all available choices
|
available: [], // all available choices
|
||||||
dotplot: true /* todo(colinmegill) #632 wire up inputs */,
|
dotplot: true, // is the dotplot toggled on, or not
|
||||||
current: undefined, // name of the current layout, eg, 'umap'
|
current: undefined, // name of the current layout, eg, 'umap'
|
||||||
currentDimNames: [], // dimension name
|
currentDimNames: [], // dimension name
|
||||||
},
|
},
|
||||||
@@ -41,6 +41,14 @@ const LayoutChoice = (
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "toggle dotplot": {
|
||||||
|
console.log("toggle: state, newstate", state.dotplot, !state.dotplot);
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
dotplot: !state.dotplot,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case "set layout choice": {
|
case "set layout choice": {
|
||||||
const { schema } = nextSharedState.annoMatrix;
|
const { schema } = nextSharedState.annoMatrix;
|
||||||
const current = action.layoutChoice;
|
const current = action.layoutChoice;
|
||||||
|
|||||||
Reference in New Issue
Block a user