From 9af583e0abd27e4512d97d970954fabf353d2938 Mon Sep 17 00:00:00 2001 From: Graham McNeill Date: Wed, 11 Dec 2024 06:32:20 +0000 Subject: [PATCH] [Platform]: Fix lead variant link from PheWas plot tooltip (#620) --- .../src/variant/GWASCredibleSets/Body.tsx | 2 ++ .../variant/GWASCredibleSets/PheWasPlot.tsx | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/sections/src/variant/GWASCredibleSets/Body.tsx b/packages/sections/src/variant/GWASCredibleSets/Body.tsx index de0c31015..d8648641f 100644 --- a/packages/sections/src/variant/GWASCredibleSets/Body.tsx +++ b/packages/sections/src/variant/GWASCredibleSets/Body.tsx @@ -24,6 +24,7 @@ import { import PheWasPlot from "./PheWasPlot"; import { useEffect, useState } from "react"; import { responseType } from "ui/src/types/response"; +import { v1 } from "uuid"; type getColumnsType = { id: string; @@ -286,6 +287,7 @@ function Body({ id, entity }: BodyProps) { }); return ( yMin} pxWidth={tooltipWidth} pxHeight={tooltipHeight} - content={tooltipContent} + content={d => tooltipContent(d, id)} xOffset={40} yOffset={-20} /> @@ -278,8 +279,16 @@ export default function PheWasPlot({ ); } -function tooltipContent(data) { +function tooltipContent(data, pageVariantId) { const labelWidth = 160; + + const displayId = ; + return ( @@ -288,14 +297,13 @@ function tooltipContent(data) { - - - + {data.variant.id === pageVariantId + ? + {displayId} + + + : {displayId} + }