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:
Severiano Badajoz
2020-05-20 14:02:10 -07:00
committed by GitHub
parent bc5b01da0f
commit b06b08ce33
3 changed files with 13 additions and 3 deletions
+6
View File
@@ -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}>