@@ -21,6 +21,7 @@ import ToolTipDataDisplay from './ToolTipDataDisplay';
21
21
import { toggleExpanded , setCurrentTabInApp } from '../../../slices/mainSlice' ;
22
22
import { useDispatch } from 'react-redux' ;
23
23
import { LinkTypesProps , DefaultMargin , ToolTipStyles } from '../../../FrontendTypes' ;
24
+ import { store } from '../../../store' ;
24
25
25
26
const linkStroke = '#F00008' ; //#F00008 original
26
27
const rootStroke = '#F00008' ; //#F00008 original
@@ -30,9 +31,7 @@ const nodeParentStroke = '#F00008'; //#F00008 original
30
31
const nodeChildStroke = '#4D4D4D' ; //#4D4D4D original
31
32
let stroke = '' ;
32
33
//css class for hovered stroke change
33
- const hoverClass = {
34
- stroke : '#ab269b' //pinkish
35
- }
34
+ const hoverClass = '#ab269b' //pinkish
36
35
37
36
/* Heat Map Colors (for links) */
38
37
const lightOrange = '#F1B476' ;
@@ -239,6 +238,7 @@ export default function ComponentMap({
239
238
{ ( tree ) => (
240
239
< Group top = { origin . y + 35 } left = { origin . x + 50 / aspect } >
241
240
{ tree . links ( ) . map ( ( link , i ) => {
241
+
242
242
const linkName = link . source . data . name ;
243
243
const propsObj = link . source . data . componentData . props ;
244
244
const childPropsObj = link . target . data . componentData . props ;
@@ -247,7 +247,6 @@ export default function ComponentMap({
247
247
let childPropsLength ;
248
248
console . log ( `------------------------------${ i } :` ) ;
249
249
250
-
251
250
console . log ( `LINK: ${ linkName } ` , link ) ;
252
251
console . log ( '>PROPS: ' , propsObj ) ;
253
252
if ( propsObj ) {
@@ -284,22 +283,45 @@ export default function ComponentMap({
284
283
}
285
284
286
285
//hover state
286
+ // const [hoverStroke, setHoverStroke] = useState('');
287
+ const [ strokeColor , setStrokeColor ] = useState ( stroke ) ;
287
288
const [ isHovered , setIsHovered ] = useState ( false ) ;
288
289
const handleMouseEnter = ( ) => {
289
290
setIsHovered ( true ) ;
291
+ setStrokeColor ( hoverClass ) ;
290
292
} ;
291
293
const handleMouseLeave = ( ) => {
292
294
setIsHovered ( false ) ;
295
+ setStrokeColor ( stroke ) ;
293
296
} ;
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; */
295
317
296
318
return (
297
319
< LinkComponent
298
320
className = 'compMapLink'
299
321
key = { i }
300
322
data = { link }
301
323
percent = { stepPercent }
302
- stroke = { strokeColor } // changint this color on hover
324
+ stroke = { strokeColor } // changing this color on hover
303
325
strokeWidth = { strokeWidthIndex } /* strokeWidth */ // width of the link
304
326
fill = 'none'
305
327
//testing hover functionality
0 commit comments