title: Select d3 node by its datum
body: <p>I’d like to select a node in a callback without using <code>d3.select(this)</code>.</p>
  
  <p>I have some code that draws a pie…</p>
  
  <pre><code>function drawPie(options) {
    options || (options = {});
    var data = options.data || [],
        element = options.element,
        radius = options.radius || 100,
        xOffset = Math.floor(parseInt(d3.select(element).style('width'), 10) / 2),
        yOffset = radius + 20;
  
    var canvas = d3.select(element)
                .append("svg:svg")
                .data([data])
                .attr("width", options.width)
                .attr("height", options.height)
                .append("svg:g")
                .attr("transform", "translate(" + xOffset + "," + yOffset + ")");
  
    var arc = d3.svg.arc()
      .outerRadius(radius);
  
    var pie = d3.layout.pie()
      .value(function(data) {
        return data.percentageOfSavingsGoalValuation;
      });
  
    var arcs = canvas.selectAll("g.slice")
      .data(pie)
      .enter()
      .append("svg:g")
      .attr("class", "slice");
  
    arcs.append("svg:path")
      .on("mouseover", divergeSlice);
  </code></pre>
  
  <p>You’ll notice at the end I have a call to <code>divergeSlice()</code>. That looks like this:</p>
  
  <pre><code>function divergeSlice(datum, index) {
    var angle = (datum.endAngle + datum.startAngle) / 2,
        x = Math.sin(angle) * 10,
        y = -Math.cos(angle) * 10;
  
    d3.select(this)
      .transition()
      .attr("transform", "translate(" + x + ", " + y + ")");
  }
  </code></pre>
  
  <p>This works, but I’d like to accomplish this without using <code>this</code> as I mentioned earlier. When I log the <code>datum</code> object, I get something like the following:</p>
  
  <pre><code>{
    data: {
      uniqueID: "XX00X0XXXX00"
      name: "Name of value"
      percentageOfValuation: 0.4
      totalNetAssetValue: 0
    }
    endAngle: 5.026548245743669
    innerRadius: 80
    outerRadius: 120
    startAngle: 2.5132741228718345
    value: 0.4
  }
  </code></pre>
  
  <p>How could I use <code>d3.select()</code> to find a path that holds <code>datum.data.uniqueID</code> that is equal to "XX00X0XXXX00"?</p>