@@ -29,13 +29,11 @@ const nodeParentFill = '#161521'; //#161521 original
2929const nodeChildFill = '#62d6fb' ; //#62d6fb original
3030const nodeParentStroke = '#F00008' ; //#F00008 original
3131const nodeChildStroke = '#4D4D4D' ; //#4D4D4D original
32- let stroke = '' ;
33- //css class for hovered stroke change
34- // const hoverClass = {
35- // stroke: "#ab269b"//pinkish
36- // }
3732const hoverClass = '#ab269b' ; //pinkish
3833
34+ let stroke = '' ;
35+
36+
3937/* Heat Map Colors (for links) */
4038const lightOrange = '#F1B476' ;
4139const darkOrange = '#E4765B' ;
@@ -264,22 +262,19 @@ export default function ComponentMap({
264262 const k = .4 ;
265263 const strokeWidthIndex = yshift + L / ( 1 + Math . exp ( - k * ( childPropsLength - x0 ) ) ) ;
266264
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 ;
270274 } 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 ;
280276 }
281- // }
282- // findStrokeColor();
277+ }
283278
284279
285280 const [ isHovered , setIsHovered ] = useState ( false ) ;
@@ -300,62 +295,6 @@ export default function ComponentMap({
300295 strokeColor = stroke
301296 }
302297
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; */
359298
360299 return (
361300 < >
0 commit comments