Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement clinical panel feedback #151

Merged
merged 6 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function App(props: RouteComponentProps) {

const currentSpec = useRef<string>();

// Clinical Panel will only render in non-minimal mode and if the demo has clinical info
const [isClinicalPanelOpen, setIsClinicalPanelOpen] = useState(false);
const CLINICAL_PANEL_WIDTH = isMinimalMode || !demo?.clinicalInfo ? 0 : isClinicalPanelOpen ? 250 : 45;

Expand Down Expand Up @@ -145,8 +146,8 @@ function App(props: RouteComponentProps) {
}

useEffect(() => {
setVisPanelWidth(INIT_VIS_PANEL_WIDTH - (VIS_PADDING.left + VIS_PADDING.right + CLINICAL_PANEL_WIDTH));
}, [isClinicalPanelOpen]);
setVisPanelWidth(INIT_VIS_PANEL_WIDTH - (VIS_PADDING.left + VIS_PADDING.right + CLINICAL_PANEL_WIDTH + 6));
}, [demo, isClinicalPanelOpen]);

// update demo
useEffect(() => {
Expand Down Expand Up @@ -196,7 +197,7 @@ function App(props: RouteComponentProps) {
rightReads.current = [];

// Update the appearance of the clinical panel
setIsClinicalPanelOpen(!!demo?.clinicalInfo);
setIsClinicalPanelOpen(!!demo?.clinicalInfo && isClinicalPanelOpen);
}, [demo]);

useEffect(() => {
Expand Down Expand Up @@ -564,7 +565,18 @@ function App(props: RouteComponentProps) {
/>
);
// !! Removed `demo` not to update twice since `drivers` are updated right after a demo update.
}, [ready, xDomain, visPanelWidth, drivers, showOverview, showPutativeDriver, selectedSvId, breakpoints, svReads]);
}, [
ready,
xDomain,
visPanelWidth,
drivers,
showOverview,
showPutativeDriver,
selectedSvId,
breakpoints,
svReads,
isClinicalPanelOpen
]);

const trackTooltips = useMemo(() => {
// calculate the offset by the Genome View
Expand Down Expand Up @@ -981,7 +993,7 @@ function App(props: RouteComponentProps) {
{!isMinimalMode && (
<div
style={{
width: `calc(100% - ${0}px)`,
width: '100%',
height: '100%',
boxShadow: `inset 0 0 0 3px ${
interactiveMode && mouseOnVis
Expand Down Expand Up @@ -1481,7 +1493,7 @@ function App(props: RouteComponentProps) {
<GenomeViewModal />
<VariantViewModal />
</div>
{!isMinimalMode && demo?.clinicalInfo && (
{!isMinimalMode && !!demo?.clinicalInfo && (
<ClinicalPanel
demo={demo}
gosRef={gosRef}
Expand Down
Loading
Loading