chart = {
const w = 10000
const h = windowHeight
const amountOfLeaves = 8
const windowSize = w
const leafWidth = windowSize/weightedTree.width
const leafHeight = 30
const depth = 1;
const root =
d3.create("svg")
.attr("viewBox", [0, 0, w, h])
.attr("width", w)
.attr("height", h)
.attr("stroke-width", 2)
.attr("fill","red")
const g = root.append("g");
const svg = g.append("svg")
function zoomed({transform}) {
g.attr("transform", transform);
}
root.call(d3.zoom()
.extent([[0, 0], [w/10, h/10]])
.scaleExtent([-10, 10])
.on("zoom", zoomed));
drawTree(tree,svg,leafWidth,leafHeight);
return root.node();
}