In d3.js, how do you use .data on this kind of hierarchy?
data = [{node : 1, subProperties : ["A", "B", "C"]}
,{node : 2, subProperties : ["D", "E", "F"]}
]
d3.select("body")
.data(data)
.append("g") //for the node (1 and 2)
.??? //append a "sub"-g for the subProperties (A,B,C and D,E,F)
Basically, I would like to create a set of nodes, and for each sub property, append something else grouped under the same node.
Or is .data only used for "serial" structures? If so, how should hierarchichal data like this be treated?
I'm not looking the the layout-features of d3, just how to "iterate" over tree-like hierarchies. Thank you!