We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0839ef commit 842d9e3Copy full SHA for 842d9e3
1 file changed
editor-packages/editor-devtools/components/visualization/json-visualization/json-tree.tsx
@@ -42,12 +42,14 @@ export function JsonTree({
42
theme = monokai,
43
backgroundColor,
44
sortkeys = false,
45
+ expandMaxLevel = 5,
46
omitkeys = [],
47
}: {
48
data: any;
49
hideRoot?: boolean;
50
expandRoot?: boolean;
51
expandParent?: boolean;
52
+ expandMaxLevel?: number;
53
theme?: Theme;
54
backgroundColor?: React.CSSProperties["backgroundColor"];
55
sortkeys?: ReadonlyArray<string> | boolean;
@@ -100,6 +102,9 @@ export function JsonTree({
100
102
if (level === 0) {
101
103
return expandRoot;
104
}
105
+ if (expandMaxLevel > 0 && level > expandMaxLevel) {
106
+ return false;
107
+ }
108
if (keypath[keypath.length - 1] === "parent") {
109
return expandParent;
110
0 commit comments