Skip to content

Commit 4c0add8

Browse files
committed
added heat map functionallity
1 parent 87d24a7 commit 4c0add8

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

reactime-website

src/app/components/StateRoute/ComponentMap/ComponentMap.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ const nodeParentStroke = '#F00008'; //#F00008 original
3030
const nodeChildStroke = '#4D4D4D'; //#4D4D4D original
3131
let stroke = '';
3232

33+
/* Heat Map Colors (for links) */
34+
const lightOrange = '#F1B476';
35+
const darkOrange = '#E4765B';
36+
const red = '#C64442';
37+
const plum = '#8C2743';
3338

3439
const defaultMargin: DefaultMargin = {
3540
top: 30,
@@ -257,12 +262,20 @@ export default function ComponentMap({
257262
const strokeWidthIndex = yshift + L / (1 + Math.exp(-k * (childPropsLength - x0)));
258263
// const strokeWidthIndex = childPropsLength * 2.5 + 1;
259264
console.log('strokeWidthIndex: ', strokeWidthIndex);
260-
265+
261266
if (strokeWidthIndex <= 1) {
262-
// strokeWidthIndex = 1;
263-
stroke = '#000000';
267+
stroke = '#808080';
264268
} else {
265-
stroke = '#df6f37'
269+
if (childPropsLength <= 1) {
270+
stroke = lightOrange;
271+
} else if (childPropsLength <= 2) {
272+
stroke = darkOrange;
273+
} else if (childPropsLength <= 3) {
274+
stroke = red;
275+
} else {
276+
stroke = plum;
277+
}
278+
// stroke = '#df6f37'
266279
}
267280

268281
return (

src/app/components/StateRoute/StateRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useDispatch, useSelector } from 'react-redux';
1515
import PerformanceVisx from './PerformanceVisx/PerformanceVisx';
1616
import WebMetricsContainer from './WebMetrics/WebMetricsContainer';
1717
import { MainState, RootState, StateRouteProps } from '../../FrontendTypes';
18-
import AxContainer from './AxMap/AxMap';
18+
import type AxContainer from './AxMap/AxMap';
1919

2020
/*
2121
Loads the appropriate StateRoute view and renders the Map, Performance, History, Webmetrics, and Tree navbar buttons after clicking on the 'State' button located near the top rightmost corner.

0 commit comments

Comments
 (0)