how to encode this data to parent / children structure in JSON
I am working with d3.js to visualise families of animals (organisms) (up to 4000 at a time) as a tree graph, though the data source could just as well be a directory listing, or list of namespaced objects. my data looks like: json = { organisms:[ {name: 'Hemiptera.Miridae.Kanakamiris'}, {name: 'Hemiptera.Miridae.Neophloeobia.incisa'}, {name: 'Lepidoptera.Nymphalidae.Ephinephile.rawnsleyi'}, ... etc ... ] } my question is: I am trying to find the best way to convert the above data to the hierarchical parent / children data structure as is used by a number of the d3 visualisations such as