Skip to content

Commit

Permalink
Fixed error where dashed PPI edges were not being drawn, also added c…
Browse files Browse the repository at this point in the history
…omments
  • Loading branch information
y330 committed Jan 2, 2025
1 parent 65c5184 commit e93004c
Show file tree
Hide file tree
Showing 7 changed files with 198 additions and 193 deletions.
19 changes: 13 additions & 6 deletions Eplant/views/InteractionsViewer/components/Topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
cleanNodes,
} from '../scripts/filterLogic'

import FilterDialog from './FilterDialog'
import NumberInput from './NumberInput'

interface TopbarProps {
Expand Down Expand Up @@ -116,10 +115,10 @@ const Topbar: FC<TopbarProps> = ({ cy, gene }) => {

return (
<AppBar position='sticky' color='default' sx={{ overflow: 'overlay' }}>
<Toolbar variant='regular' sx={{ flexWrap: 'wrap', pb: 1 }}>
<Toolbar variant='regular' sx={{ flexWrap: 'wrap' }}>
{/* VIEW TITLE */}
<Typography variant='h6' sx={{ flexGrow: 2 }}>
Interactions Viewer: {gene}
ID: {gene}
</Typography>
<ButtonGroup variant='outlined' sx={{}}>
{/* LEGEND BUTTON */}
Expand Down Expand Up @@ -159,16 +158,24 @@ const Topbar: FC<TopbarProps> = ({ cy, gene }) => {
setShowLegend(!showLegend)
}}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'right',
vertical: 'top',
horizontal: 'left',
}}
transformOrigin={{
vertical: 'top',
horizontal: 'right',
}}
anchorEl={legendRef.current}
>
<Box sx={{ zIndex: 120 }}>
<Box sx={{ zIndex: 120, display: 'flex', flexDirection: 'column' }}>
<IconButton
sx={{ position: 'absolute', right: 0 }}
color='secondary'
size='small'
onClick={handleLegendClick}
>
<Close />
</IconButton>
<img src='thumbnails/legendAIV.png' width={200}></img>
</Box>
</Popover>
Expand Down
20 changes: 18 additions & 2 deletions Eplant/views/InteractionsViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ const InteractionsViewer: View = {
})
// psosible solutoon: promise chain to combine these two (promise.o)
data = loadInteractions(gene, interactions, recursive)
data.nodes = loadSublocalizations(data.nodes)
} else {
throw ViewDataError.UNSUPPORTED_GENE
}
Expand Down Expand Up @@ -150,6 +149,23 @@ const InteractionsViewer: View = {
addNodeListener(cy)
// Listen for mouseover events on edges
addEdgeListener(cy)
// add loadgene listener // NOT WORKING
const loadGeneButton = document.querySelector("loadGene_interactionsView")
loadGeneButton?.addEventListener("click", ()=>{
const id = loadGeneButton.getAttribute("id")
const aliases = loadGeneButton.getAttribute("aliases")?.split(",")
const annotation = loadGeneButton.getAttribute("annotation")
if (id != null && annotation != null && aliases != null) {
const geneticElement = new GeneticElement(
id,
annotation,
arabidopsis,
aliases
)
setGeneticElements([...geneticElements[0], geneticElement])
setActiveGeneId(geneticElement.id)
}
})
}, [])

// Add event listner to load gene button
Expand All @@ -172,7 +188,7 @@ const InteractionsViewer: View = {
}

return (
<div style={{ background: 'white' }}>
<div style={{ background: 'white', overflow: 'hidden' }}>
<Topbar cy={cyto} gene={geneId === undefined ? '' : geneId}></Topbar>
<div
ref={cyRef}
Expand Down
Loading

0 comments on commit e93004c

Please sign in to comment.