title: How can I construct a tree using d3 and its force layout?
body: <p>I am trying to arrange my nodes in the form of a tree. For now, I am working off of this example from <a href="http://jsfiddle.net/xReHA/2/" rel="nofollow noreferrer">here</a>. Currently, I am relying on a force directed layout but am trying to modify it such that I can obtain a tree with predetermined number of levels i.e. if a node belongs to a particular "Layer" it should belong to the same area as other nodes in the layer.</p>
  
  <p>I have tried to explain more in the picture below but does anyone have any suggestions for this? Are there any predetermined algorithms inside <code>d3</code> that do this or can be tweaked to achieve this?</p>
  
  <p><img src="https://i.stack.imgur.com/HCFRp.png" alt="enter image description here"></p>