title: Strange path/line behaviour in d3 radial graph
body: <p>I'm trying to modify d3 radial tree graph example I found out and abouton the internet. Original had a diagonal, curved paths between nodes and I needed it to be straight lines. </p>
  
  <p>After hours of struggle I finaly managed to do just that. Well, kinda. </p>
  
  <p>As you can see in <a href="http://codepen.io/roonroon/pen/VjVpbk?editors=1000" rel="nofollow"><strong>this pen</strong></a>, the lines connecting nodes are indeed straight but also they are not originating from the same, central point. For the central node and first level of links, line starting points are converging on the edges of said node, and higher level nodes are grouping lines in sort of rows instead of one, central point I crave and desire so much.
  The part of code responsible for drawing the links in the pen starts with line <code>252</code>and ends with <code>276</code>, looking like this:</p>
  
  <pre><code>            var link = svg.selectAll("link")
              .data(links)
              .enter().append("path")
              .attr("class", "link");
  
              var lines = svg.selectAll('line')
              .data(links)
              .enter()
              .append('line')
              .attr('stroke',function(d) {
                  if(d.source.depth === 0) {
                      return 'red'
                  } else {
                      return '#ccc';
                  }
              });
  
              lines.attr('x1',function(d){return d.source.y})
              .attr('y1',function(d){return d.source.x/180*Math.PI})
              .attr('x2',function(d){return d.target.y })
              .attr('y2',function(d){return d.target.x/180*Math.PI});
  
              lines.attr("transform", function(d) {
                  return "rotate(" + (d.target.x - 90 ) + ")";
              });
  </code></pre>
  
  <p>I've already tried everything I could come up with, as far as drawing <code>x1, x2, y1, y2</code> goes, with switching them around, changing the maths in there and whatnot. Also, tried to alter rotation and forcing the coordinates onto the links. Everytime coming back empty. Could You, good people of SO, take a peek and point me in the right direction?</p>