Skip to content

Commit c9cd4c3

Browse files
committed
added name to empty spots in json tree; increased height of perfView
1 parent 423ded4 commit c9cd4c3

File tree

5 files changed

+9751
-12
lines changed

5 files changed

+9751
-12
lines changed

.gitmodules

Whitespace-only changes.

src/app/components/StateRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const StateRoute = (props:StateRouteProps) => {
4242
if (hierarchy) {
4343
return (
4444
<ErrorHandler>
45-
<PerfView viewIndex={viewIndex} snapshots={snapshots} width={600} height={600}/>
45+
<PerfView viewIndex={viewIndex} snapshots={snapshots} width={600} height={1000}/>
4646
</ErrorHandler>
4747
);
4848
}

src/app/components/Tree.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import React from 'react';
22
import JSONTree from 'react-json-tree';
33

4-
54
const getItemString = (type, data:{state?:object|string, name:string, children:[]}) => {
6-
// check to make sure that we are on the tree node, not anything else
7-
if (
8-
Object.keys(data).length > 3
9-
&& typeof data.state === 'object'
10-
&& typeof data.name === 'string'
11-
&& Array.isArray(data.children)
12-
) {
13-
return <span>{data.name}</span>;
5+
if (data && data.name) {
6+
return <span>{name}</span>;
147
}
15-
return null;
8+
return <span />;
169
};
1710

1811
interface TreeProps {
@@ -22,6 +15,8 @@ interface TreeProps {
2215
const Tree = (props:TreeProps) => {
2316
const { snapshot } = props;
2417

18+
console.log('Tree -> snapshot', snapshot);
19+
2520
return (
2621
<>
2722
{snapshot && (
@@ -30,7 +25,9 @@ const Tree = (props:TreeProps) => {
3025
theme={{ tree: () => ({ className: 'json-tree' }) }}
3126
shouldExpandNode={() => true}
3227
getItemString={getItemString}
33-
labelRenderer={(raw:any[]) => (typeof raw[0] !== 'number' ? <span>{raw[0]}</span> : null)}
28+
labelRenderer={(raw:any[]) => {
29+
return (typeof raw[0] !== 'number' ? <span>{raw[0]}</span> : null)
30+
}}
3431
/>
3532
)}
3633
</>

0 commit comments

Comments
 (0)