mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 02:38:11 +08:00
auto switch spatial off
This commit is contained in:
@@ -16,6 +16,7 @@ import actions from "../../actions";
|
|||||||
import { getDiscreteCellEmbeddingRowIndex } from "../../util/stateManager/viewStackHelpers";
|
import { getDiscreteCellEmbeddingRowIndex } from "../../util/stateManager/viewStackHelpers";
|
||||||
|
|
||||||
@connect((state) => ({
|
@connect((state) => ({
|
||||||
|
imageUnderlay: state.imageUnderlay,
|
||||||
layoutChoice: state.layoutChoice, // TODO: really should clean up naming, s/layout/embedding/g
|
layoutChoice: state.layoutChoice, // TODO: really should clean up naming, s/layout/embedding/g
|
||||||
schema: state.annoMatrix?.schema,
|
schema: state.annoMatrix?.schema,
|
||||||
crossfilter: state.obsCrossfilter,
|
crossfilter: state.obsCrossfilter,
|
||||||
@@ -27,8 +28,18 @@ class Embedding extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleLayoutChoiceChange = (e) => {
|
handleLayoutChoiceChange = (e) => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch, imageUnderlay } = this.props;
|
||||||
dispatch(actions.layoutChoiceAction(e.currentTarget.value));
|
dispatch(actions.layoutChoiceAction(e.currentTarget.value));
|
||||||
|
|
||||||
|
// if we just switched off spatial, if the image is on, turn it off
|
||||||
|
if (
|
||||||
|
imageUnderlay.isActive &&
|
||||||
|
e.target.value !== globals.spatialEmbeddingKeyword
|
||||||
|
) {
|
||||||
|
dispatch({
|
||||||
|
type: "toggle image underlay",
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import { getEmbSubsetView } from "../../util/stateManager/viewStackHelpers";
|
|||||||
subsetResetPossible,
|
subsetResetPossible,
|
||||||
graphInteractionMode: state.controls.graphInteractionMode,
|
graphInteractionMode: state.controls.graphInteractionMode,
|
||||||
imageUnderlay: state.imageUnderlay,
|
imageUnderlay: state.imageUnderlay,
|
||||||
|
layoutChoice: state.layoutChoice, // TODO: really should clean up naming, s/layout/embedding/g
|
||||||
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,
|
||||||
@@ -208,6 +209,7 @@ class MenuBar extends React.PureComponent {
|
|||||||
subsetPossible,
|
subsetPossible,
|
||||||
subsetResetPossible,
|
subsetResetPossible,
|
||||||
imageUnderlay,
|
imageUnderlay,
|
||||||
|
layoutChoice,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { pendingClipPercentiles } = this.state;
|
const { pendingClipPercentiles } = this.state;
|
||||||
|
|
||||||
@@ -270,6 +272,7 @@ class MenuBar extends React.PureComponent {
|
|||||||
disabled={!isColoredByCategorical}
|
disabled={!isColoredByCategorical}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
{layoutChoice?.available?.includes(globals.spatialEmbeddingKeyword) && (
|
||||||
<ButtonGroup className={styles.menubarButton}>
|
<ButtonGroup className={styles.menubarButton}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={"Toggle image"}
|
content={"Toggle image"}
|
||||||
@@ -290,6 +293,7 @@ class MenuBar extends React.PureComponent {
|
|||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
)}
|
||||||
|
|
||||||
<ButtonGroup className={styles.menubarButton}>
|
<ButtonGroup className={styles.menubarButton}>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import { Colors } from "@blueprintjs/core";
|
|||||||
import { dispatchNetworkErrorMessageToUser } from "./util/actionHelpers";
|
import { dispatchNetworkErrorMessageToUser } from "./util/actionHelpers";
|
||||||
import ENV_DEFAULT from "../../environment.default.json";
|
import ENV_DEFAULT from "../../environment.default.json";
|
||||||
|
|
||||||
|
// visium embedding word, spatial image underlay
|
||||||
|
export const spatialEmbeddingKeyword = "spatial";
|
||||||
|
|
||||||
/* overflow category values are created using this string */
|
/* overflow category values are created using this string */
|
||||||
export const overflowCategoryLabel = ": all other labels";
|
export const overflowCategoryLabel = ": all other labels";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user