Skip to content
Advertisement

How to increase the width of a particular node of a hierarchy in D3.js?

I have a hierarchy layout as shown in the image below where the 3rd layer of nodes contains words that are quite long so I want to give these nodes more space to their left to make it easier to read. But I am not sure what to change to do so.

enter image description here

Code for the node, path and the text:

JavaScript

Advertisement

Answer

After tinkering around with it I managed to solve it by altering root.dx and root.dy.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement