title: "Unexpected value NaN" error when dragging D3 objects with mouse
body: <p>I'm having difficulty getting some circles to move when asked to by the mouse.  I'm adapting this <a href="http://bl.ocks.org/mbostock/6123708" rel="nofollow">example by Mike Bostock</a>, using the code below (<a href="http://jsfiddle.net/geotheory/aB8jr/" rel="nofollow">see jsfiddle here</a>).</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;script type="text/javascript"&gt;
  
  var points = [
      [100,100],
      [200,300],
      [250,150],
      [300,200],
      [350,350],
      [450,300],
      [450,400]
  ];
  
  var drag = d3.behavior.drag()
      .origin(function(d) { return d; })
      .on("dragstart", dragstarted)
      .on("drag", dragged)
      .on("dragend", dragended);
  
  var svg = d3.select("body").append("svg")
      .attr("width", 500)
      .attr("height", 500);
  
  svg.selectAll("circle")
      .data(points)
      .enter().append("circle")
      .attr("r", 10)
      .attr("cx", function(d) { return d[0]; })
      .attr("cy", function(d) { return d[1]; })
      .call(drag);
  
  function dragstarted(d) {
    d3.event.sourceEvent.stopPropagation();
    d3.select(this).classed("dragging", true);
  }
  
  function dragged(d) {
    d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y);
  }
  
  function dragended(d) {
    d3.select(this).classed("dragging", false);
  }
  
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But I get this errors when trying to drag points with the mouse:</p>
  
  <pre><code>Unexpected value NaN parsing cx attribute.
  ...},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n...
   1)
  
  Unexpected value NaN parsing cy attribute.
  ...},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n...
  </code></pre>
  
  <p>Grateful for an idea where I'm going wrong, and thanks in advance.</p>