title: How to access weight property of a node in a force layout?
body: <p>Maybe this is a silly question but i'm a d3 newb.  I'm trying to change the radius of the circles in a force layout based on the source link weight.  Why is d.source.weight accessible within the tick function but not anywhere else?</p>
  
  <p>E.g.</p>
  
  <pre><code>force.on("tick", function() {
      link.attr("x1", function(d) {console.log(d.source.name + " " + d.source.weight; 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; });
  </code></pre>
  
  <p>returns the correct values to the console, but why aren't those properties accessible when appending the circles?</p>
  
  <pre><code>node.append("circle")
       .attr("class", "node")
       .attr("r", function(d) {return d.source.weight * 2;});  // breaks
  </code></pre>
  
  <p>I feel like this is more of a basic javascript question than a d3 question, but i can't find much help on it.  Any help is appreciated.</p>