diff --git a/package-lock.json b/package-lock.json index 4bf8df8..ad0b825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@weng-lab/psychscreen-ui-components", - "version": "0.9.5", + "version": "0.9.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@weng-lab/psychscreen-ui-components", - "version": "0.9.5", + "version": "0.9.9", "license": "MIT", "dependencies": { "@visx/tooltip": "^3.3.0", @@ -33,6 +33,7 @@ "@storybook/react": "^7.0.7", "@storybook/react-webpack5": "^7.0.7", "@types/cytoscape": "^3.21.3", + "@types/jquery": "^3.5.30", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1", "babel-loader": "^9.1.2", @@ -7021,6 +7022,15 @@ "pretty-format": "^29.0.0" } }, + "node_modules/@types/jquery": { + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz", + "integrity": "sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, "node_modules/@types/jsdom": { "version": "20.0.1", "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", @@ -7187,6 +7197,12 @@ "@types/send": "*" } }, + "node_modules/@types/sizzle": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", + "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", + "dev": true + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", diff --git a/package.json b/package.json index f23c611..3b9ba70 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.9", + "version": "1.0.0", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -66,6 +66,7 @@ "@storybook/react": "^7.0.7", "@storybook/react-webpack5": "^7.0.7", "@types/cytoscape": "^3.21.3", + "@types/jquery": "^3.5.30", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1", "babel-loader": "^9.1.2", diff --git a/src/components/Graph/Graph.tsx b/src/components/Graph/Graph.tsx index cde1449..55f1858 100644 --- a/src/components/Graph/Graph.tsx +++ b/src/components/Graph/Graph.tsx @@ -363,7 +363,12 @@ const Graph: React.FC = ({ content.style.fontSize = '12px'; content.style.fontFamily = fontFamily; const tip = popperFactory(ref, content, {}); - node.on('mouseover', () => tip.show()); + + node.on('mouseover', () => { + tip.show(); + document.body.style.cursor = 'pointer'; + }); + if (onNodeClick) { const c = { accession: node.style('label'), @@ -371,9 +376,13 @@ const Graph: React.FC = ({ end: 0, chromosome: '', }; - node.on('click', onNodeClick(c)); + node.on('click', () => onNodeClick(c)); } - node.on('mouseout', () => tip.hide()); + + node.on('mouseout', () => { + tip.hide(); + document.body.style.cursor = 'default'; + }); }); // TOOLTIP EDGES diff --git a/yarn.lock b/yarn.lock index b82705a..440f115 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3167,6 +3167,13 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/jquery@^3.5.30": + version "3.5.30" + resolved "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz" + integrity sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A== + dependencies: + "@types/sizzle" "*" + "@types/jsdom@^20.0.0": version "20.0.1" resolved "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz" @@ -3312,6 +3319,11 @@ "@types/node" "*" "@types/send" "*" +"@types/sizzle@*": + version "2.3.8" + resolved "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz" + integrity sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg== + "@types/stack-utils@^2.0.0": version "2.0.3" resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz"