@@ -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- // // })
6443const 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,7 +81,6 @@ 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
@@ -134,23 +110,18 @@ const collectNodes = (snaps, componentName) => {
134110 }
135111 }
136112 }
137- // console.log('componentsResult looks like: ', componentsResult);
138113
139- // console.log('we should be seeing react components with information', componentsResult);
140- // componentsResult.push(renderResult);
141114 const finalResults = componentsResult . map ( ( e , index ) => {
142115 const name = Object . keys ( e ) [ 0 ] ;
143- console . log ( 'this is name' , name , 'show me e' , e ) ;
144116 e [ name ] . rendertime = renderResult [ index ] ;
145- console . log ( 'this is e' , e ) ;
146117 return e ;
147118 } ) ;
148119 for ( let i = 0 ; i < finalResults . length ; i ++ ) {
149120 for ( const componentSnapshot in finalResults [ i ] ) {
150- finalResults [ i ] [ componentSnapshot ] = makePropsPretty ( finalResults [ i ] [ componentSnapshot ] ) ;
121+ finalResults [ i ] [ componentSnapshot ] = makePropsPretty ( finalResults [ i ] [ componentSnapshot ] ) . reverse ( ) ;
151122 }
152123 }
153- console . log ( 'finalresults ' , finalResults ) ;
124+ console . log ( 'is this going to reverse ' , finalResults ) ;
154125 return finalResults ;
155126} ;
156127
@@ -184,13 +155,11 @@ const traverse = (snapshot, data, snapshots, currTotalRender = 0) => {
184155 }
185156 // increment render frequencies
186157 if ( renderTime > 0 ) {
187- // console.log('what is the child', child);
188- // console.log('por que?', data.componentData[componentName]);
189158 data . componentData [ componentName ] . renderFrequency ++ ;
190- } else {
191- // console.log('what is the child', child);
192- // console.log('we dont increment here', data.componentData[componentName], 'and the child', child);
193159 }
160+ // else {
161+
162+ // }
194163
195164 // add to total render time
196165 data . componentData [ componentName ] . totalRenderTime += renderTime ;
@@ -257,7 +226,6 @@ const PerformanceVisx = (props: BarStackProps) => {
257226 const [ comparisonData , setComparisonData ] = useState ( ) ;
258227 const NO_STATE_MSG = 'No state change detected. Trigger an event to change state' ;
259228 const data = getPerfMetrics ( snapshots , getSnapshotIds ( hierarchy ) ) ;
260- // console.log('this is line 220', data);
261229
262230 const renderComparisonBargraph = ( ) => {
263231 if ( hierarchy ) {
0 commit comments