@@ -21,15 +21,19 @@ import ToolTipDataDisplay from './ToolTipDataDisplay';
2121import { toggleExpanded , setCurrentTabInApp } from '../../../slices/mainSlice' ;
2222import { useDispatch } from 'react-redux' ;
2323import { LinkTypesProps , DefaultMargin , ToolTipStyles } from '../../../FrontendTypes' ;
24+ import { store } from '../../../store' ;
2425
2526const linkStroke = '#F00008' ; //#F00008 original
2627const rootStroke = '#F00008' ; //#F00008 original
2728const nodeParentFill = '#161521' ; //#161521 original
2829const nodeChildFill = '#62d6fb' ; //#62d6fb original
2930const nodeParentStroke = '#F00008' ; //#F00008 original
3031const nodeChildStroke = '#4D4D4D' ; //#4D4D4D original
32+ const hoverClass = '#ab269b' ; //pinkish
33+
3134let stroke = '' ;
3235
36+
3337/* Heat Map Colors (for links) */
3438const lightOrange = '#F1B476' ;
3539const darkOrange = '#E4765B' ;
@@ -235,9 +239,11 @@ export default function ComponentMap({
235239 { ( tree ) => (
236240 < Group top = { origin . y + 35 } left = { origin . x + 50 / aspect } >
237241 { tree . links ( ) . map ( ( link , i ) => {
242+
238243 const linkName = link . source . data . name ;
239244 const propsObj = link . source . data . componentData . props ;
240245 const childPropsObj = link . target . data . componentData . props ;
246+ //consolelog const above
241247 let propsLength ;
242248 let childPropsLength ;
243249
@@ -250,7 +256,7 @@ export default function ComponentMap({
250256 }
251257 // go to https://en.wikipedia.org/wiki/Logistic_function
252258 // for an explanation of Logistic functions and parameters used
253- const yshift = - 3 ;
259+ const y0 = - 3 ;
254260 const x0 = 5 ;
255261 const L = 25 ;
256262 const k = .4 ;
@@ -268,19 +274,46 @@ export default function ComponentMap({
268274 } else {
269275 stroke = plum ;
270276 }
271- // stroke = '#df6f37'
272277 }
278+
279+
280+ const [ isHovered , setIsHovered ] = useState ( false ) ;
281+ const handleMouseEnter = ( ) => {
282+ setIsHovered ( true ) ;
283+ } ;
284+ const handleMouseLeave = ( ) => {
285+ setIsHovered ( false )
286+ }
287+
288+ let strokeColor ; //isHovered ? hoverClass : stroke;
289+ let chooseCursor ;
290+
291+ if ( isHovered ) {
292+ strokeColor = hoverClass ;
293+ }
294+ else {
295+ strokeColor = stroke
296+ }
297+
273298
274299 return (
275- < LinkComponent
276- className = 'compMapLink'
277- key = { i }
278- data = { link }
279- percent = { stepPercent }
280- stroke = { stroke } // color of the link --not used--
281- strokeWidth = { strokeWidthIndex } /* strokeWidth */ // width of the link
282- fill = 'none'
283- />
300+ < >
301+ < LinkComponent
302+ className = 'compMapLink'
303+ key = { i }
304+ data = { link }
305+ percent = { stepPercent }
306+ stroke = { strokeColor } // changing this color on hover
307+ strokeWidth = { strokeWidthIndex } /* strokeWidth */ // width of the link
308+ fill = 'none'
309+ //testing hover functionality
310+ onMouseEnter = { handleMouseEnter }
311+ onMouseLeave = { handleMouseLeave }
312+ />
313+ < div className = "linkHoverInfo" >
314+ < h1 > Props</ h1 >
315+ </ div >
316+ </ >
284317 )
285318 } )
286319 }
@@ -494,7 +527,7 @@ export default function ComponentMap({
494527 </ Tree >
495528 </ Group >
496529 </ svg >
497- { tooltipOpen && tooltipData && (
530+ { tooltipOpen && tooltipData && ( // if the tooltip is open and there is data to display...
498531 < TooltipInPortal
499532 // set this to random so it correctly updates with parent bounds
500533 key = { Math . random ( ) }
@@ -537,6 +570,11 @@ export default function ComponentMap({
537570 </ div >
538571 </ TooltipInPortal >
539572 ) }
573+ < div className = "linkHover-Info" >
574+ < p > < strong > Props </ strong > ():</ p >
575+ < div > </ div >
576+ </ div >
577+
540578 </ div >
541579 ) ;
542580}
0 commit comments