diff --git a/package.json b/package.json index 5b0f6ff..2489db7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@weng-lab/psychscreen-ui-components", "description": "Typescript and Material UI based components used for psychSCREEN", "author": "SCREEN Team @ UMass Chan Medical School", - "version": "0.9.3", + "version": "0.9.4", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/components/Graph/Graph.tsx b/src/components/Graph/Graph.tsx index ab44eba..355f04e 100644 --- a/src/components/Graph/Graph.tsx +++ b/src/components/Graph/Graph.tsx @@ -130,9 +130,10 @@ const Graph: React.FC = ({ return; } + const containerRect = containerRef.current.getBoundingClientRect(); const coords = { - x: event.renderedPosition.x, - y: event.renderedPosition.y, + x: event.renderedPosition.x + containerRect.left, + y: event.renderedPosition.y + containerRect.top, }; showTooltip({ @@ -505,9 +506,10 @@ const Graph: React.FC = ({