I'm in the process of creating a family-tree using D3. My dataset is indeed hierarchical, but the root node of the tree is the child. Each "child node" contains two "parent" nodes that represents each childs two parents. Here is an example of my data.
{
name: "Morgans Jumpin Jack Flash",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "m",
parents: [
{
name: "Moganas Heart of Fire",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "f",
parents: [
{
name: "Elkhaus Ice Storm",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "m",
parents: []
},{
name: "Morganas First Love",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "f",
parents: []
},
]
},{
name: "Desperado Hogan von der Accani",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "m",
parents: [
{
name: "Jim von Aurachgrund",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "m",
parents: []
},{
name: "Heroina D. Altobella",
imagePath: "",
description: "",
subTitle: "",
body: "",
icon: "",
iconColor: "",
gender: "f",
parents: []
},
]
},
]
}
Each node in the tree represents a Dog. The idea here is that you can see a given Dogs pedigree by going up the family tree to the parents, grand parents, etc.
Is it possible to use the given dataset with d3.tree() without modifying the data? (I know that I could probably just rename "parents" to "children", but that would be INCREDIBLY confusing to the next person who looks at the data set.)