Nested list to graph
edges = Cases[li,
{node_String, subtrees__List} :> (
node \[DirectedEdge] #[[1]] & /@ {subtrees}),
{0, ∞}] // Flatten
Note the level specification within Cases
.
Graph[edges,
VertexLabels -> "Name",
ImagePadding -> 30,
GraphLayout -> {
"LayeredEmbedding",
"RootVertex" -> "fig"}]
With IGraph/M running on Mathematica 11.3,
IGExpressionTree[li /. List -> Construct]
li //. {{x_, rest__} :> x[rest], {x_} :> x} //
TreeForm[#, DirectedEdges -> True] &
A similar rule can be used to parse JSON data and display with TreeForm