Skip to content

Commit 8b5fbee

Browse files
committed
mouseOver tech
1 parent f04b498 commit 8b5fbee

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { pointRadial } from 'd3-shape';
77
import useForceUpdate from './useForceUpdate';
88
import LinkControls from './LinkControls';
99
import getLinkComponent from './getLinkComponent';
10+
import { localPoint } from '@visx/event';
1011
import { onHover, onHoverExit } from '../actions/actions';
1112
import { useStoreContext } from '../store';
1213

@@ -89,6 +90,10 @@ export default function ComponentMap({
8990
sizeHeight = innerWidth;
9091
}
9192
}
93+
94+
//mousing controls
95+
const handleMouseOver = () => console.log("mouse entered");
96+
9297
// controls for the map
9398
const LinkComponent = getLinkComponent({ layout, linkType, orientation });
9499
return totalWidth < 10 ? null : (
@@ -181,30 +186,8 @@ export default function ComponentMap({
181186
forceUpdate();
182187
}}
183188
//check with recoil
184-
onMouseLeave={() => {
185-
if (
186-
Object.keys(node.data.recoilDomNode).length > 0
187-
) {
188-
dispatch(
189-
onHoverExit(
190-
node.data.recoilDomNode[node.data.name]
191-
)
192-
);
193-
} else {
194-
dispatch(onHoverExit(node.data.rtid));
195-
}
196-
}}
197-
onMouseEnter={() => {
198-
if (
199-
Object.keys(node.data.recoilDomNode).length > 0
200-
) {
201-
dispatch(
202-
onHover(node.data.recoilDomNode[node.data.name])
203-
);
204-
} else {
205-
dispatch(onHover(node.data.rtid));
206-
}
207-
}}
189+
onMouseOver={handleMouseOver}
190+
onMouseOut={hideTooltip}
208191
/>
209192
)}
210193
{/* Display text inside of each component node */}

0 commit comments

Comments
 (0)