Tag: 族谱系谱

使用深度优先search渲染一个dynamic创build的家庭graphics,不重叠?

我想要生成这个: 有了这个数据结构(ID是随机的,顺便说一句,不是顺序): var tree = [ { "id": 1, "name": "Me", "dob": "1988", "children": [4], "partners" : [2,3], root:true, level: 0, "parents": [5,6] }, { "id": 2, "name": "Mistress 1", "dob": "1987", "children": [4], "partners" : [1], level: 0, "parents": [] }, { "id": 3, "name": "Wife 1", "dob": "1988", "children": [5], "partners" : [1], […]