@@ -21,6 +21,7 @@ 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
@@ -30,9 +31,7 @@ const nodeParentStroke = '#F00008'; //#F00008 original
3031const nodeChildStroke = '#4D4D4D' ; //#4D4D4D original
3132let stroke = '' ;
3233//css class for hovered stroke change
33- const hoverClass = {
34- stroke : '#ab269b' //pinkish
35- }
34+ const hoverClass = '#ab269b' //pinkish
3635
3736/* Heat Map Colors (for links) */
3837const lightOrange = '#F1B476' ;
@@ -239,6 +238,7 @@ export default function ComponentMap({
239238 { ( tree ) => (
240239 < Group top = { origin . y + 35 } left = { origin . x + 50 / aspect } >
241240 { tree . links ( ) . map ( ( link , i ) => {
241+
242242 const linkName = link . source . data . name ;
243243 const propsObj = link . source . data . componentData . props ;
244244 const childPropsObj = link . target . data . componentData . props ;
@@ -247,7 +247,6 @@ export default function ComponentMap({
247247 let childPropsLength ;
248248 console . log ( `------------------------------${ i } :` ) ;
249249
250-
251250 console . log ( `LINK: ${ linkName } ` , link ) ;
252251 console . log ( '>PROPS: ' , propsObj ) ;
253252 if ( propsObj ) {
@@ -284,22 +283,45 @@ export default function ComponentMap({
284283 }
285284
286285 //hover state
286+ // const [hoverStroke, setHoverStroke] = useState('');
287+ const [ strokeColor , setStrokeColor ] = useState ( stroke ) ;
287288 const [ isHovered , setIsHovered ] = useState ( false ) ;
288289 const handleMouseEnter = ( ) => {
289290 setIsHovered ( true ) ;
291+ setStrokeColor ( hoverClass ) ;
290292 } ;
291293 const handleMouseLeave = ( ) => {
292294 setIsHovered ( false ) ;
295+ setStrokeColor ( stroke ) ;
293296 } ;
294- const strokeColor = isHovered ? hoverClass . stroke : stroke ;
297+
298+ /* // let strokeColor: string;
299+ // if (isHovered) {
300+ // strokeColor = hoverClass.stroke
301+ // } else {
302+ // strokeColor = stroke;
303+ // };
304+ // let strokeColor: string;
305+ // function linkHover() {
306+ // if (isHovered) {
307+ // strokeColor = hoverClass
308+ // } else {
309+ // strokeColor = stroke;
310+ // };
311+ // // return strokeColor;
312+ // }
313+ // strokeColor = linkHover();
314+
315+ // // const strokeColor = isHovered ? hoverClass.stroke : stroke;
316+ // isHovered ? stroke="ab269b" : stroke; */
295317
296318 return (
297319 < LinkComponent
298320 className = 'compMapLink'
299321 key = { i }
300322 data = { link }
301323 percent = { stepPercent }
302- stroke = { strokeColor } // changint this color on hover
324+ stroke = { strokeColor } // changing this color on hover
303325 strokeWidth = { strokeWidthIndex } /* strokeWidth */ // width of the link
304326 fill = 'none'
305327 //testing hover functionality
0 commit comments