title: Uncaught TypeError: n.apply is not a function - what could be the issue?
body: <p>Trying to access the parent of a node in d3 tree layout my code looks like this</p>
  
  <p>Here is the function supposed to display the parent name which it accepts as parameter</p>
  
  <pre><code>function draw(a){
    console.log(a);
  
    }
  </code></pre>
  
  <p>Here is the function that calls it in the node's mouseover event, see the last line</p>
  
  <pre><code>node.append("circle")
      .attr("class", function (d) {
          var value; 
          if(d.depth == 1){value = "marker";}
          else{value = "else";}
          return value;}
      )
      .attr("r", function(d){return d.depth == 1?d.children.length:3})
      .style("fill", function (d) {
          return d.depth&gt;1?colors(d.parent.name):colors(d.name);})
      .style("stroke", "none")
     .on("mouseover", "draw(function(d){return d.parent.name;})");
  </code></pre>
  
  <p>However instead I get the error above. Any takers?</p>