Developing ESTv2 — Linear Regression
Nov 8, 2020
So, a tree canvas needs proper width and height. Otherwise it could look like these:
How can you calculate the best width and height? I first built two sliders to manually adjust and tune the numbers. Then, I experimented with each tree depth from 1 to 16. (d3-hierarchy comes with HierarchyPointNode.depth, which allows easily getting the depth). The best-looking width and height were recorded
Using linear regression, I was able to find a best-fit line: treeCanvasHeight=45*treeDepth +150