-
vizulyFebruary 17, 2017 at 9:40 am #7311
Hello Daddar,
You can easily translate the vertical layout position in the
src/viz/weighted_tree.js
file by modifying the updateNode() function. Each place where a .attr(“transform”,”translate…”) call is occurring you can modify the translate to use the current height measurement AND y position. Something like this:.attr("transform", function(d) { return "translate(" + d.x + "," + (height - d.y) + ")"; });
This should have the nodes start at the bottom.
As for the root node position, check out the positionNodes() function. The root node starts at the boundary of the layout and is set here:
nodes.forEach(function(d) { // if (tree.nodeSize()) d.x= d.x + size.height/2; d.y = d.depth * depthSpan; //Adjust y position to accomodate offset d.x = d.x + offsetY - tree.nodeSize()[0]; });
I hope this helps.
– Tom
You must be logged in to reply to this topic.
© 2024 — vizuly.io