vizulyJune 30, 2016 at 3:22 pm #6288
The weighted tree has some scrolling features built into the layout that allow you to programmatically scroll to a certain node. This feature isn’t demonstrated in the test container, but it is there.
As a result the layout algorithm is slightly more complex and does its best to maximize the space for a given set of nodes – thus inconsistent result you are seeing with the position of the first node.
A quick fix would be to add this line of code at the end of the
src/viz/weightedtree.jsat approximately line 378.
root.x = 0 + tree.nodeSize();
This should ensure the node is always centered vertically in the screen. (Note the x,y positions of the node are transposed in the treeview so x = y and y = x. I know it is confusing, but the original d3 tree layout assumes a vertical orientation.
You must be logged in to reply to this topic.
© 2021 — vizuly.io