js_family_tree
js_family_tree copied to clipboard
Making a vertical family tree
how can i change tree from a horizontal view to a vertical one ?
Hi @Ayesha-Sayyed,
Thanks for using js_family_tree. I just pushed version 0.2.0, which implements a new orientation
setter/getter. To get a vertical family tree, you can use it as follows:
// insert svg object to hold the family tree
const svg = d3.select("body").append("svg")
.attr("width", document.body.offsetWidth)
.attr("height", document.documentElement.clientHeight);
// make family tree object
FT = new FamilyTree(data, svg).orientation("vertical");
// draw family tree
FT.draw();
Let me know if it works for you! :)
Cheers. Ben
I found a bug in the vertical links, opened a PR for it :)