Closed Klortho closed 6 years ago
See this patch from @lianyi. It seems to fix this bug, but causes test19 to fail.
I'm working in
The differences for test19 were very small, and seemed, possibly, to be due to the same bug, but on a node deeper in the tree. I'm not 100% sure, but going cross-eyed looking at it. So, I pulled the change: https://github.com/Klortho/d3/pull/1.
The bug is fixed for this tree:
[ 40, 40,
[ 40, 40 ],
[ 40, 40,
[ 100, 40 ],
[ 200, 40 ],
],
],
Here's before and after:
But still exists for this tree:
[ 40, 40,
[ 40, 40 ],
[ 40, 40,
[ 40, 40,
[ 100, 40 ],
[ 200, 40 ],
],
],
],
I saw the same bug as well. The algorithm only moves subtree from the second index, that means the first child will never be moved if it doesn't have children.
As an improvement to the algorithm, perhaps we could add a special check for each first leaf child and move the first child instead?
This is fixed in the just-released version (2.0.0)
Discovered a bug in the layout algorithm -- see this issue. I added test trees grandkids1.json and grandkids2.json to illustrate it.