-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
304 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PluginContext } from 'molstar/lib/mol-plugin/context' | ||
|
||
export default function clearSelection({ plugin }: { plugin: PluginContext }) { | ||
plugin?.managers.interactivity.lociSelects.deselectAll() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { useState } from 'react' | ||
import { observer } from 'mobx-react' | ||
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton' | ||
|
||
// icons | ||
import MenuIcon from '@mui/icons-material/Menu' | ||
|
||
// locals | ||
import { JBrowsePluginProteinViewModel } from '../model' | ||
import ProteinAlignment from './ProteinAlignment' | ||
import { Visibility } from '@mui/icons-material' | ||
|
||
const ProteinViewHeader = observer(function ({ | ||
model, | ||
}: { | ||
model: JBrowsePluginProteinViewModel | ||
}) { | ||
const { clickString, hoverString, showHighlight, zoomToBaseLevel } = model | ||
const [show, setShow] = useState(true) | ||
return ( | ||
<div> | ||
<div style={{ display: 'flex' }}> | ||
<span> | ||
{[ | ||
clickString ? `Click: ${clickString}` : '', | ||
hoverString ? `Hover: ${hoverString}` : '', | ||
].join(' ')} | ||
</span> | ||
<span style={{ flexGrow: 1 }} /> | ||
<CascadingMenuButton | ||
menuItems={[ | ||
{ | ||
label: 'Show alignment', | ||
type: 'checkbox', | ||
checked: show, | ||
icon: Visibility, | ||
onClick: () => setShow(!show), | ||
}, | ||
{ | ||
label: 'Show highlight', | ||
type: 'checkbox', | ||
checked: showHighlight, | ||
icon: Visibility, | ||
onClick: () => model.setShowHighlight(!showHighlight), | ||
}, | ||
{ | ||
label: 'Zoom to base level on click', | ||
type: 'checkbox', | ||
checked: zoomToBaseLevel, | ||
icon: Visibility, | ||
onClick: () => model.setZoomToBaseLevel(!zoomToBaseLevel), | ||
}, | ||
]} | ||
> | ||
<MenuIcon /> | ||
</CascadingMenuButton> | ||
</div> | ||
<div>{show ? <ProteinAlignment model={model} /> : null}</div> | ||
</div> | ||
) | ||
}) | ||
|
||
export default ProteinViewHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
import React, { Suspense, lazy, useState } from 'react' | ||
import React, { lazy } from 'react' | ||
import { IconButton } from '@mui/material' | ||
import { getSession } from '@jbrowse/core/util' | ||
|
||
// locals | ||
import { JBrowsePluginProteinViewModel } from '../model' | ||
|
||
// icons | ||
import Help from '@mui/icons-material/Help' | ||
|
||
const HelpDialog = lazy(() => import('./HelpDialog')) | ||
|
||
export default function HelpButton() { | ||
const [open, setOpen] = useState(false) | ||
export default function HelpButton({ | ||
model, | ||
}: { | ||
model: JBrowsePluginProteinViewModel | ||
}) { | ||
return ( | ||
<> | ||
<IconButton style={{ float: 'right' }} onClick={() => setOpen(true)}> | ||
<Help /> | ||
</IconButton> | ||
{open ? ( | ||
<Suspense fallback={null}> | ||
<HelpDialog handleClose={() => setOpen(false)} /> | ||
</Suspense> | ||
) : null} | ||
</> | ||
<IconButton | ||
style={{ float: 'right' }} | ||
onClick={() => | ||
getSession(model).queueDialog(handleClose => [ | ||
HelpDialog, | ||
{ handleClose }, | ||
]) | ||
} | ||
> | ||
<Help /> | ||
</IconButton> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.