# Visualizing nested lists for easier human understanding

When interacting with Mathematica, I often find myself staring blankly at waves of curly braces, trying to understand how data is organized hierarchically. For example, the beginning of the result to

WolframAlpha["temperature in Toronto yesterday", "DataRules"]


looks like this:

To visualize the hierarchy, I typically turn to TreeForm, but that's often unwieldy. There's no way to collapse parts of the tree you don't care about (as there would be in, say, a file system browser), so the visualization frequently spreads well off screen or is illegibly small. For example,

TreeForm[WolframAlpha["temperature in Toronto yesterday", "DataRules"]]


produces:

Is there a better way?

-
"staring blankly at waves of curly braces" is a song by Pink Floyd – belisarius has settled Oct 24 '13 at 0:09
TableForm works pretty well for that particular example. – Pickett Oct 24 '13 at 0:25
Is something like this what you are looking for? mathematica.stackexchange.com/questions/29339/… – Mike Honeychurch Oct 24 '13 at 1:46
Or this? – cormullion Oct 24 '13 at 6:52
Thanks for the lead, @Mike. TraceView led me to the OpenerTree example in Virtual Book, which is a good start. – duozmo Oct 24 '13 at 21:39

data = WolframAlpha["temperature in Toronto yesterday", "DataRules"];


Is this enough?

Column[OpenerView[{#, Switch[Head[#2],
List, Pane[Column@#2, {Full, 200}, Scrollbars -> True],
_, #2]}
] & @@@ data]


-
Certainly works well for Wolfram Alpha output, which has a consistent nesting structure. For arbitrarily nested lists, I'm still using OpenerTree from Virtual Book. – duozmo Nov 14 at 15:45