title: Change node colors in d3 Sankey Diagram based on additional column in data
body: <p>I am creating a Sankey Diagram using the D3 Sankey plugin. I have the standard columns: source, target, value plus one additional column called nodeColor. I would like the color of the target node to be dictated by the color noted in the "nodeColorTarget" column. I was able to change the source code for the nodes to be all one color. However, I was unable to develop a function to use the additional column to dictate the color.</p>
  
  <p>Sample Data:</p>
  
  <pre><code>source,target,value,nodeColorTarget
  Dist A,Place1,1,red
  DistB,Place1,5,red
  DistB,Place2,2,grey
  DistB,Place2,1,grey
  DistB,Place3,2,blue
  </code></pre>
  
  <p>Existing Code:</p>
  
  <pre><code>// add the rectangles for the nodes
    node.append("rect")
        .attr("height", function(d) { return d.dy; })
        .attr("width", sankey.nodeWidth())
        .style("fill", "red") 
        //.style("fill", function(d) { 
            //return d.color = color(d.name.replace(/ .*/, "")); })
        //.style("stroke", function(d) { 
           // return d3.rgb(d.color).darker(2); })
      //.append("title")
       // .text(function(d) { 
           // return d.name + "\n" + format(d.value); });
  </code></pre>
  
  <p>My full code is <a href="http://plnkr.co/edit/rlhBjLFu5jhwCLRpA2A1?p=preview" rel="nofollow">here</a>.</p>