title: D3 changing color of links based on data
body: <p>I'm new to javascript and d3, I've been working with some shared code and I've been trying to modify it. </p>
  
  <p>Here is what I currently have:</p>
  
  <p><a href="https://gist.github.com/erich-kuehn/2770a7c7c1cd633f6b47ebb21b640f68" rel="nofollow noreferrer">https://gist.github.com/erich-kuehn/2770a7c7c1cd633f6b47ebb21b640f68</a></p>
  
  <p>Its based off of:</p>
  
  <p><a href="http://bl.ocks.org/erikhazzard/6201948" rel="nofollow noreferrer">http://bl.ocks.org/erikhazzard/6201948</a></p>
  
  <p>I'm trying to change the color of the links based on a new field I added the csv called status. It seems to run through ok, and if i step through the code it seems to makes some links red and some green, but when its done, they all end up green. Thoughts? Sorry i'm really new at this.</p>
  
  <pre><code> //update
      for(var i=0, len=links.length; i&lt;len; i++){
      if (links[i].status[0][0] === 'red') {
      pathArcs.attr({
              //d is the points attribute for this path, we'll draw
              //  an arc between the points using the arc function
              d: path
          })
          .style({
              stroke: 'red',
              'stroke-width': '2px'
          })
          // Uncomment this line to remove the transition
          .call(lineTransition); 
  
      //exit
      pathArcs.exit().remove();
          }else{
     pathArcs.attr({
              //d is the points attribute for this path, we'll draw
              //  an arc between the points using the arc function
              d: path
          })
          .style({
              stroke: 'green',
              'stroke-width': '2px'
          })
          // Uncomment this line to remove the transition
          .call(lineTransition);
  
      //exit
      pathArcs.exit().remove();
  }   
      }
  });
  </code></pre>