Skip to content

Commit e967eb9

Browse files
committed
updates
2 parents 028519a + a68f1f7 commit e967eb9

File tree

5 files changed

+47
-56
lines changed

5 files changed

+47
-56
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export default function ComponentMap({
229229
if (nestedObj) {
230230
propsFormat.push(nestedObj);
231231
}
232-
// console.log('this is propsformat', propsFormat);
232+
233233
return propsFormat;
234234
};
235235

@@ -261,7 +261,7 @@ export default function ComponentMap({
261261
};
262262
findSelectedNode();
263263

264-
// controls for the map
264+
// controls for the map
265265
const LinkComponent = getLinkComponent({ layout, linkType, orientation });
266266
return totalWidth < 10 ? null : (
267267
<div>
@@ -398,7 +398,7 @@ export default function ComponentMap({
398398
// setTooltip(true);
399399
// }
400400
}}
401-
onMouseEnter={() => dispatch(onHover(node.data.rtid))} // fix this not working
401+
onMouseEnter={() => dispatch(onHover(node.data.rtid))}
402402
onMouseLeave={() => dispatch(onHoverExit(node.data.rtid))}
403403
/>
404404
)}

src/app/components/History.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ function History(props: Record<string, unknown>) {
3131
const svgRef = React.useRef(null);
3232
const root = JSON.parse(JSON.stringify(hierarchy));
3333

34-
console.log('DEBUG >>> HISTORY currLocation: ', currLocation);
35-
3634
// setting the margins for the Map to render in the tab window.
3735
const innerWidth = totalWidth - margin.left - margin.right;
3836
const innerHeight = totalHeight - margin.top - margin.bottom - 60;

src/app/components/PerformanceVisx.tsx

Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,9 @@ interface BarStackProps {
4040
hierarchy: any;
4141
}
4242

43-
// function getComponentsArr(componentName, snapshots, node) {
44-
// //Input: Name of component and all snapshots
45-
// //Output: One array of each individual snapshot
46-
47-
// //NOTE:
48-
// //Every snapshot is an object with a children array with a snapshot that also has a children array etc
49-
// //Children arrays more than one signify siblings
50-
51-
// }
52-
// // snapshots.map(rootNode => {
53-
// // // rootNode.name
54-
// // let currNode = rootNode
55-
// // while (currNode) {
56-
// // if (currNode.name === componentName) {
57-
// // return currNode.componentData.props
58-
// // } else {
59-
// // currNode = currNode.children[0]
60-
// // currNode = currNode.children[1]
61-
// // }
62-
// // }
63-
// // })
6443
const makePropsPretty = data => {
6544
const propsFormat = [];
6645
const nestedObj = [];
67-
// console.log('show me the data we are getting', data);
6846
if (typeof data !== 'object') {
6947
return <p>{data}</p>;
7048
}
@@ -81,7 +59,6 @@ const makePropsPretty = data => {
8159
if (nestedObj) {
8260
propsFormat.push(nestedObj);
8361
}
84-
// console.log('this is propsformat', propsFormat);
8562
return propsFormat;
8663
};
8764

@@ -104,15 +81,13 @@ const collectNodes = (snaps, componentName) => {
10481
} else {
10582
renderResult.push(renderTime);
10683
}
107-
console.log('show me the render time', renderTime);
10884
// compare the last pushed component Data from the array to the current one to see if there are differences
10985
if (x !== 0 && componentsResult.length !== 0) {
11086
// needs to be stringified because values are hard to determine if true or false if in they're seen as objects
11187
if (JSON.stringify(Object.values(componentsResult[newChange ? componentsResult.length - 1 : trackChanges])[0]) !== JSON.stringify(cur.componentData.props)) {
11288
newChange = true;
11389
// const props = { [`snapshot${x}`]: { rendertime: formatRenderTime(cur.componentData.actualDuration), ...cur.componentData.props } };
11490
const props = { [`snapshot${x}`]: { ...cur.componentData.props } };
115-
console.log('show me props structure', props)
11691
componentsResult.push(props);
11792
} else {
11893
newChange = false;
@@ -135,23 +110,18 @@ const collectNodes = (snaps, componentName) => {
135110
}
136111
}
137112
}
138-
// console.log('componentsResult looks like: ', componentsResult);
139113

140-
// console.log('we should be seeing react components with information', componentsResult);
141-
// componentsResult.push(renderResult);
142114
const finalResults = componentsResult.map((e, index) => {
143115
const name = Object.keys(e)[0];
144-
console.log('this is name', name, 'show me e', e);
145116
e[name].rendertime = renderResult[index];
146-
console.log('this is e', e);
147117
return e;
148118
});
149119
for (let i = 0; i < finalResults.length; i++) {
150120
for (const componentSnapshot in finalResults[i]) {
151-
finalResults[i][componentSnapshot] = makePropsPretty(finalResults[i][componentSnapshot]);
121+
finalResults[i][componentSnapshot] = makePropsPretty(finalResults[i][componentSnapshot]).reverse();
152122
}
153123
}
154-
console.log('finalresults', finalResults);
124+
console.log('is this going to reverse', finalResults);
155125
return finalResults;
156126
};
157127

@@ -185,13 +155,11 @@ const traverse = (snapshot, data, snapshots, currTotalRender = 0) => {
185155
}
186156
// increment render frequencies
187157
if (renderTime > 0) {
188-
// console.log('what is the child', child);
189-
// console.log('por que?', data.componentData[componentName]);
190158
data.componentData[componentName].renderFrequency++;
191-
} else {
192-
// console.log('what is the child', child);
193-
// console.log('we dont increment here', data.componentData[componentName], 'and the child', child);
194159
}
160+
// else {
161+
162+
// }
195163

196164
// add to total render time
197165
data.componentData[componentName].totalRenderTime += renderTime;
@@ -258,7 +226,6 @@ const PerformanceVisx = (props: BarStackProps) => {
258226
const [comparisonData, setComparisonData] = useState();
259227
const NO_STATE_MSG = 'No state change detected. Trigger an event to change state';
260228
const data = getPerfMetrics(snapshots, getSnapshotIds(hierarchy));
261-
// console.log('this is line 220', data);
262229

263230
const renderComparisonBargraph = () => {
264231
if (hierarchy) {

src/app/components/RenderingFrequency.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const ComponentCard = props => {
5454
// render time for each component from each snapshot
5555
// differences in state change that happened prior;
5656

57-
5857
const dataComponentArray = [];
5958
for (let i = 0; i < information.length; i++) {
6059
dataComponentArray.push(<DataComponent header={Object.keys(information[i])} paragraphs={Object.values(information[i])} />);
@@ -92,10 +91,9 @@ const ComponentCard = props => {
9291
<p>{renderFrequency}</p>
9392
</div>
9493
</div>
95-
<div className="DataComponent">
96-
{expand && dataComponentArray}
94+
<div className={expand === true ? 'DataComponent' : null} >
95+
{expand === true ? dataComponentArray : null}
9796
</div>
98-
9997
</div>
10098
);
10199
};
@@ -112,15 +110,19 @@ const DataComponent = props => {
112110
paragraphs,
113111
} = props;
114112

113+
// current bug
114+
// we want render time to display first but it gets push to the end of the array
115+
// first pop is because the last item of array is always empty for some reason
116+
115117
// const [{ tabs, currentTab }, dispatch] = useStoreContext();
116118
return (
117-
<div>
119+
<div className="borderCheck">
118120
<h4>
119121
{' '}
120122
{header}
121123
</h4>
122124
<p>
123-
{' '}
125+
124126
{paragraphs}
125127
</p>
126128
</div>

src/app/styles/components/_renderingFrequency.scss

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,45 @@
22
border-radius: 5px;
33
border: 1px solid rgba(184, 196, 194, 0.25);
44
box-shadow: 2px 3px 4px 2px rgba(0, 0, 0, 0.2);
5-
width: 40vh;
5+
width: 53vw;
6+
}
7+
8+
.borderCheck {
9+
border-radius: 5px;
10+
border: 1px solid rgba(184, 196, 194, 0.25);
11+
box-shadow: 2px 3px 4px 2px rgba(0, 0, 0, 0.2);
12+
padding: 5px;
13+
width: 10vw;
14+
height: 25vw;
15+
overflow-y: scroll;
16+
overflow-wrap: break-word;
617
}
718

819
.DataComponent {
20+
padding-left: 30px;
921
display: flex;
1022
flex-direction: row;
1123
flex-wrap: wrap;
12-
width: 80vw;
24+
width: 50vw;
25+
height: 40vw;
26+
overflow-y: scroll;
27+
overflow-wrap: break-word;
1328
}
1429

30+
1531
.StyledGridElement {
1632
display: flex;
1733
align-items: center;
1834
justify-content: space-between;
1935
background: #242529;
2036
padding: 20px;
21-
width: 80vw;
37+
width: 50vw;
2238
height: 5vh;
2339
margin: 20px 10px;
2440
font-family: 'Roboto', sans-serif;
25-
41+
// border-radius: 5px;
42+
// border: 1px solid rgba(184, 196, 194, 0.25);
43+
// box-shadow: 2px 3px 4px 2px rgba(0, 0, 0, 0.2);
2644

2745
h3 {
2846
color: $text-color;
@@ -51,13 +69,18 @@
5169

5270
.ExpandStyledGridElement {
5371
display: flex;
72+
flex-direction: row;
5473
align-items: center;
5574
justify-content: space-between;
5675
background: #242529;
5776
padding: 20px;
58-
width: 80vh;
77+
width: 50vw;
78+
// height: 1000px;
5979
margin: 20px 10px;
6080
font-family: 'Roboto', sans-serif;
81+
// border-radius: 5px;
82+
// border: 1px solid rgba(184, 196, 194, 0.25);
83+
// box-shadow: 2px 3px 4px 2px rgba(0, 0, 0, 0.2);
6184

6285

6386
h3 {
@@ -86,8 +109,9 @@
86109
}
87110

88111
.RenderRight {
89-
border-radius: 5px;
112+
padding-right: 5px;
90113
background: $blue-color-gradient;
91-
width: 10%;
114+
width: 50px;
92115
padding: 0 0.5em;
116+
right: 10%;
93117
}

0 commit comments

Comments
 (0)