# 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?

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

Column[OpenerView[{#, Switch[Head[#2],

• 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 '15 at 15:45