-
vizulySeptember 22, 2017 at 10:13 am #8057
Hello Miriam,
Yes, you could modify the source code to do this. It might require a little experimenting with the layout to make sure there aren’t any edge cases with labels and other objects that need to be modified.
A good starting point would be here in src/viz/weightedtree.js. Look in the function “positionNodes()” for this block of code:
nodes.forEach(function(d) { d.y = d.depth * depthSpan; //Adjust y position to accomodate offset d.x = d.x + offsetY - tree.nodeSize()[0]; });
and modify it so it has this new measurement for the d.y variable (remember the x and y are transposed for this layout.) Make d.y = size.width – d.depth * depthSpan.
nodes.forEach(function(d) { d.y = size.width - d.depth * depthSpan; //Adjust y position to accomodate offset d.x = d.x + offsetY - tree.nodeSize()[0]; });
I did a quick test of this, and on the surface it seems to work.
Good luck,
Tom
You must be logged in to reply to this topic.
© 2024 — vizuly.io