title: How do I change the color of path in D3.js?
body: <p>I am creating some paths ina  tree-graph in D3 and I'd like to change the color of the lines (paths), but I can't make my code work:</p>
  
  <pre><code> // Enter any new links at the parent's previous position.
        link.enter().insert("svg:path", "g")
            .attr("class", "link")
            .attr("d", function(d) {
              var o = {x: source.x0, y: source.y0};
              return diagonal({source: o, target: o});
            })
          .transition()
            .duration(duration)
            .attr("d", diagonal);
  
        // Transition links to their new position.
        link.transition()
            .duration(duration)
            .attr("d", diagonal);
  
        // Transition exiting nodes to the parent's new position.
        link.exit().transition()
            .duration(duration)
            .attr("d", function(d) {
              var o = {x: source.x, y: source.y};
              return diagonal({source: o, target: o});
            })
            .remove();
  </code></pre>
  
  <p>I tried using the following to change and I've look-up up a few other solution, but I can't really understand what I need to select in my update selection to change it.</p>
  
  <pre><code>  link.selectAll("path")
        .attr("stroke", "#000000");
  </code></pre>
  
  <p>Thanks for the help in advance.</p>