@@ -29,13 +29,11 @@ const nodeParentFill = '#161521'; //#161521 original
29
29
const nodeChildFill = '#62d6fb' ; //#62d6fb original
30
30
const nodeParentStroke = '#F00008' ; //#F00008 original
31
31
const nodeChildStroke = '#4D4D4D' ; //#4D4D4D original
32
- let stroke = '' ;
33
- //css class for hovered stroke change
34
- // const hoverClass = {
35
- // stroke: "#ab269b"//pinkish
36
- // }
37
32
const hoverClass = '#ab269b' ; //pinkish
38
33
34
+ let stroke = '' ;
35
+
36
+
39
37
/* Heat Map Colors (for links) */
40
38
const lightOrange = '#F1B476' ;
41
39
const darkOrange = '#E4765B' ;
@@ -264,22 +262,19 @@ export default function ComponentMap({
264
262
const k = .4 ;
265
263
const strokeWidthIndex = yshift + L / ( 1 + Math . exp ( - k * ( childPropsLength - x0 ) ) ) ;
266
264
267
- // function findStrokeColor() {
268
- if ( strokeWidthIndex <= 1 ) {
269
- stroke = '#808080' ;
265
+ if ( strokeWidthIndex <= 1 ) {
266
+ stroke = '#808080' ;
267
+ } else {
268
+ if ( childPropsLength <= 1 ) {
269
+ stroke = lightOrange ;
270
+ } else if ( childPropsLength <= 2 ) {
271
+ stroke = darkOrange ;
272
+ } else if ( childPropsLength <= 3 ) {
273
+ stroke = red ;
270
274
} else {
271
- if ( childPropsLength <= 1 ) {
272
- stroke = lightOrange ;
273
- } else if ( childPropsLength <= 2 ) {
274
- stroke = darkOrange ;
275
- } else if ( childPropsLength <= 3 ) {
276
- stroke = red ;
277
- } else {
278
- stroke = plum ;
279
- }
275
+ stroke = plum ;
280
276
}
281
- // }
282
- // findStrokeColor();
277
+ }
283
278
284
279
285
280
const [ isHovered , setIsHovered ] = useState ( false ) ;
@@ -300,62 +295,6 @@ export default function ComponentMap({
300
295
strokeColor = stroke
301
296
}
302
297
303
-
304
-
305
-
306
-
307
-
308
- /* CODE GRAVEYARD
309
- //hover state
310
- // const [hoverStroke, setHoverStroke] = useState('');
311
- // const [strokeColor, setStrokeColor] = useState(stroke);
312
- const [isHovered, setIsHovered] = useState(false);
313
- const handleMouseEnter = () => {
314
- setIsHovered(true);
315
- // stroke = hoverClass;
316
- // setStrokeColor(hoverClass);
317
- stroke = strokeColor;
318
- // make box
319
- };
320
- const handleMouseLeave = () => {
321
- setIsHovered(false);
322
- // if (strokeWidthIndex <= 1) {
323
- // setStrokeColor = '#808080';
324
- // } else {
325
- // if (childPropsLength <= 1) {
326
- // setStrokeColor = lightOrange;
327
- // } else if (childPropsLength <= 2) {
328
- // setStrokeColor = darkOrange;
329
- // } else if (childPropsLength <= 3) {
330
- // setStrokeColor = red;
331
- // } else {
332
- // setStrokeColor = plum;
333
- // }
334
- // }
335
- stroke = hoverClass;
336
-
337
- // };
338
-
339
- let strokeColor: string;
340
- if (isHovered) {
341
- strokeColor = hoverClass
342
- // strokeColor =
343
- } else {
344
- strokeColor = stroke;
345
- };
346
- // let strokeColor: string;
347
- function linkHover() {
348
- if (isHovered) {
349
- strokeColor = hoverClass
350
- } else {
351
- strokeColor = stroke;
352
- };
353
- // return strokeColor;
354
- }
355
- strokeColor = linkHover();
356
-
357
- // // const strokeColor = isHovered ? hoverClass.stroke : stroke;
358
- // isHovered ? stroke="ab269b" : stroke; */
359
298
360
299
return (
361
300
< >
0 commit comments