tonic + npm: d3-hierarchy
var d3 = require("d3-hierarchy");
var table = [
{"id": "Eve", "parentId": ""},
{"id": "Cain", "parentId": "Eve"},
{"id": "Seth", "parentId": "Eve"},
{"id": "Enos", "parentId": "Seth"},
{"id": "Noam", "parentId": "Seth"},
{"id": "Abel", "parentId": "Eve"},
{"id": "Awan", "parentId": "Eve"},
{"id": "Enoch", "parentId": "Awan"},
{"id": "Azura", "parentId": "Eve"}
];
var root = d3.stratify()(table);
no comments