mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 05:38:12 +08:00
button, reducer state
This commit is contained in:
@@ -28,6 +28,7 @@ import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers";
|
|||||||
subsetPossible,
|
subsetPossible,
|
||||||
subsetResetPossible,
|
subsetResetPossible,
|
||||||
graphInteractionMode: state.controls.graphInteractionMode,
|
graphInteractionMode: state.controls.graphInteractionMode,
|
||||||
|
imageUnderlay: state.imageUnderlay,
|
||||||
clipPercentileMin: Math.round(100 * (annoMatrix?.clipRange?.[0] ?? 0)),
|
clipPercentileMin: Math.round(100 * (annoMatrix?.clipRange?.[0] ?? 0)),
|
||||||
clipPercentileMax: Math.round(100 * (annoMatrix?.clipRange?.[1] ?? 1)),
|
clipPercentileMax: Math.round(100 * (annoMatrix?.clipRange?.[1] ?? 1)),
|
||||||
userDefinedGenes: state.controls.userDefinedGenes,
|
userDefinedGenes: state.controls.userDefinedGenes,
|
||||||
@@ -206,6 +207,7 @@ class MenuBar extends React.PureComponent {
|
|||||||
colorAccessor,
|
colorAccessor,
|
||||||
subsetPossible,
|
subsetPossible,
|
||||||
subsetResetPossible,
|
subsetResetPossible,
|
||||||
|
imageUnderlay,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { pendingClipPercentiles } = this.state;
|
const { pendingClipPercentiles } = this.state;
|
||||||
|
|
||||||
@@ -268,6 +270,26 @@ class MenuBar extends React.PureComponent {
|
|||||||
disabled={!isColoredByCategorical}
|
disabled={!isColoredByCategorical}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</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}>
|
<ButtonGroup className={styles.menubarButton}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={selectionTooltip}
|
content={selectionTooltip}
|
||||||
|
|||||||
@@ -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 autosave from "./autosave";
|
||||||
import centroidLabels from "./centroidLabels";
|
import centroidLabels from "./centroidLabels";
|
||||||
import pointDialation from "./pointDilation";
|
import pointDialation from "./pointDilation";
|
||||||
|
import imageUnderlay from "./imageUnderlay";
|
||||||
import { gcMiddleware as annoMatrixGC } from "../annoMatrix";
|
import { gcMiddleware as annoMatrixGC } from "../annoMatrix";
|
||||||
|
|
||||||
import undoableConfig from "./undoableConfig";
|
import undoableConfig from "./undoableConfig";
|
||||||
@@ -39,6 +40,7 @@ const Reducer = undoable(
|
|||||||
["controls", controls],
|
["controls", controls],
|
||||||
["differential", differential],
|
["differential", differential],
|
||||||
["centroidLabels", centroidLabels],
|
["centroidLabels", centroidLabels],
|
||||||
|
["imageUnderlay", imageUnderlay],
|
||||||
["pointDilation", pointDialation],
|
["pointDilation", pointDialation],
|
||||||
["autosave", autosave],
|
["autosave", autosave],
|
||||||
]),
|
]),
|
||||||
|
|||||||
Reference in New Issue
Block a user