Skip to content

Commit

Permalink
fix: allow disabling motif counts
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobtroidl committed Jun 6, 2023
1 parent 30baef8 commit cf97953
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function App() {
// Example for neuprint
const [isQuerying, setIsQuerying] = useState(false);
const [attributes, setAttributes] = useState({
displayMotifCount: false,
getMotifCount: ne.getMotifCount,
getRelativeMotifCount: ne.getRelativeMotifCount,
isQuerying: isQuerying,
Expand Down
26 changes: 15 additions & 11 deletions src/lib/Sketch/components/MotifPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function MotifPanel(props) {

const motifPanelId = "motif-panel-div";
const context = useContext(AppContext);
const displayMotifCount = typeof attributes.displayMotifCount != "undefined" ? attributes.displayMotifCount : false

const handleSubmit = () => {
console.log("handle submit clicked");
Expand Down Expand Up @@ -98,18 +99,21 @@ function MotifPanel(props) {
<div id={motifPanelId}>
<div className="form">
<div className="handle">
<ThemeProvider theme={Color.theme}>
<Tooltip title={parseButtonTooltip()} arrow placement="right">
<span>
<InfoButton
text={getMotifCountAsString()}
disabled={!enableAbsMotifCountInfo}
color={countButtonColor}
icon={<SearchIcon />}
/>
</span>
</Tooltip>
{displayMotifCount ? (
<ThemeProvider theme={Color.theme}>
<Tooltip title={parseButtonTooltip()} arrow placement="right">
<span>
<InfoButton
text={getMotifCountAsString()}
disabled={!enableAbsMotifCountInfo}
color={countButtonColor}
icon={<SearchIcon />}
/>
</span>
</Tooltip>
</ThemeProvider>
): null}

{context.showWarning ? (
<InfoButton color="error" icon={<PriorityHighIcon />} />
) : null}
Expand Down

0 comments on commit cf97953

Please sign in to comment.