mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-23 02:28:13 +08:00
Fix centroid label + continuous color-by interactions (#1484)
* add case to removing labels * add disabled state to centroid button * fix centroid test button clicking order * don't accidentally un-toggle first color
This commit is contained in:
@@ -37,6 +37,7 @@ import DiffexpButtons from "./diffexpButtons";
|
||||
showCentroidLabels: state.centroidLabels.showLabels,
|
||||
tosURL: state.config?.parameters?.["about_legal_tos"],
|
||||
privacyURL: state.config?.parameters?.["about_legal_privacy"],
|
||||
categoricalSelection: state.categoricalSelection,
|
||||
}))
|
||||
class MenuBar extends React.Component {
|
||||
static isValidDigitKeyEvent(e) {
|
||||
@@ -203,9 +204,13 @@ class MenuBar extends React.Component {
|
||||
showCentroidLabels,
|
||||
privacyURL,
|
||||
tosURL,
|
||||
categoricalSelection,
|
||||
colorAccessor,
|
||||
} = this.props;
|
||||
const { pendingClipPercentiles } = this.state;
|
||||
|
||||
const isColoredByCategorical = !!categoricalSelection?.[colorAccessor];
|
||||
|
||||
// constants used to create selection tool button
|
||||
const [selectionTooltip, selectionButtonIcon] =
|
||||
selectionTool === "brush"
|
||||
@@ -267,6 +272,7 @@ class MenuBar extends React.Component {
|
||||
onClick={this.handleCentroidChange}
|
||||
active={showCentroidLabels}
|
||||
intent={showCentroidLabels ? "primary" : "none"}
|
||||
disabled={!isColoredByCategorical}
|
||||
/>
|
||||
</Tooltip>
|
||||
<ButtonGroup className={styles.menubarButton}>
|
||||
|
||||
Reference in New Issue
Block a user