mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 12:47:56 +08:00
button, reducer state
This commit is contained in:
@@ -28,6 +28,7 @@ import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers";
|
||||
subsetPossible,
|
||||
subsetResetPossible,
|
||||
graphInteractionMode: state.controls.graphInteractionMode,
|
||||
imageUnderlay: state.imageUnderlay,
|
||||
clipPercentileMin: Math.round(100 * (annoMatrix?.clipRange?.[0] ?? 0)),
|
||||
clipPercentileMax: Math.round(100 * (annoMatrix?.clipRange?.[1] ?? 1)),
|
||||
userDefinedGenes: state.controls.userDefinedGenes,
|
||||
@@ -206,6 +207,7 @@ class MenuBar extends React.PureComponent {
|
||||
colorAccessor,
|
||||
subsetPossible,
|
||||
subsetResetPossible,
|
||||
imageUnderlay,
|
||||
} = this.props;
|
||||
const { pendingClipPercentiles } = this.state;
|
||||
|
||||
@@ -268,6 +270,26 @@ class MenuBar extends React.PureComponent {
|
||||
disabled={!isColoredByCategorical}
|
||||
/>
|
||||
</Tooltip>
|
||||
<ButtonGroup className={styles.menubarButton}>
|
||||
<Tooltip
|
||||
content={"Toggle image"}
|
||||
position="bottom"
|
||||
hoverOpenDelay={globals.tooltipHoverOpenDelay}
|
||||
>
|
||||
<AnchorButton
|
||||
type="button"
|
||||
data-testid="toggle-image-underlay"
|
||||
icon={"media"}
|
||||
active={imageUnderlay.isActive}
|
||||
onClick={() => {
|
||||
dispatch({
|
||||
type: "toggle image underlay",
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
</ButtonGroup>
|
||||
|
||||
<ButtonGroup className={styles.menubarButton}>
|
||||
<Tooltip
|
||||
content={selectionTooltip}
|
||||
|
||||
14
client/src/reducers/imageUnderlay.js
Normal file
14
client/src/reducers/imageUnderlay.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const imageUnderlay = (state = { isActive: false }, action) => {
|
||||
switch (action.type) {
|
||||
case "toggle image underlay":
|
||||
return {
|
||||
...state,
|
||||
isActive: !state.isActive,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default imageUnderlay;
|
||||
@@ -19,6 +19,7 @@ import genesetsUI from "./genesetsUI";
|
||||
import autosave from "./autosave";
|
||||
import centroidLabels from "./centroidLabels";
|
||||
import pointDialation from "./pointDilation";
|
||||
import imageUnderlay from "./imageUnderlay";
|
||||
import { gcMiddleware as annoMatrixGC } from "../annoMatrix";
|
||||
|
||||
import undoableConfig from "./undoableConfig";
|
||||
@@ -39,6 +40,7 @@ const Reducer = undoable(
|
||||
["controls", controls],
|
||||
["differential", differential],
|
||||
["centroidLabels", centroidLabels],
|
||||
["imageUnderlay", imageUnderlay],
|
||||
["pointDilation", pointDialation],
|
||||
["autosave", autosave],
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user