Developing ESTv2 — Linear Regression

Jiahao Chen
Nov 8, 2020

So, a tree canvas needs proper width and height. Otherwise it could look like these:

trees width bad height

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

slider to control the width and height

Using linear regression, I was able to find a best-fit line: treeCanvasHeight=45*treeDepth +150

--

--