title: D3 How do I create a Star Layout for a force directed map?
body: <p>I can build a default force directed map and I can also construct a tree shaped map.  But I have a requirement to build a star shaped network topology map.  I am not sure how to go about doing this as I can't seem to find a guide to doing so.  If anyone can point me in a direction or to some resource I would be greatly appreciative.  Thanks.  </p>
  
  <p>The code I have used to render a tree topology looks like the following:</p>
  
  <pre>
  
              var k = 6 * e.alpha;
              graph.links.forEach(function(d, i) {
                d.source.y -= k;
                d.target.y += k;
              });
              node.attr("cx", function(d) { return d.x; })
                  .attr("cy", function(d) { return d.y; });
              link.attr("x1", function(d) { return d.source.x; })
                  .attr("y1", function(d) { return d.source.y; })
                  .attr("x2", function(d) { return d.target.x; })
                  .attr("y2", function(d) { return d.target.y; });
  
  </pre>
  
  <p>Here is sort of what I am trying to render.  </p>
  
  <p><img src="https://i.stack.imgur.com/kwnTI.png" alt="Star Topology"></p>