Skip to content

Commit

Permalink
nodeclick
Browse files Browse the repository at this point in the history
  • Loading branch information
evc29 committed Aug 1, 2024
1 parent 01b2f51 commit c77cfa3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
20 changes: 18 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
15 changes: 12 additions & 3 deletions src/components/Graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,17 +363,26 @@ const Graph: React.FC<GraphProps> = ({
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'),
start: 0,
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
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c77cfa3

Please sign in to comment.