title: error line expected length x1 x2 y2 y2 and transform d3 js
body: <p>I develop an application web where I'm using lib d3 and javascript which is display a graph with nodes. 
  I implemented a search bar which is not working well all the time.
  Sometimes it's not recover the position from the node. 
  and I have an error : </p>
  
  <pre><code>Error: &lt;line&gt; attribute x1: Expected length, "NaN"
  Error: &lt;line&gt; attribute y1: Expected length, "NaN".
  Error: &lt;line&gt; attribute x2: Expected length, "NaN".
  Error: &lt;line&gt; attribute y2: Expected length, "NaN".
  Error: &lt;g&gt; attribute transform: Expected number, "translate(NaN,NaN)".
  </code></pre>
  
  <p>and the node stay stuck on the corner of the window. 
  I specify when I am using the search bar, I delete the actual graph for the new with the search. </p>
  
  <pre><code>myWidget.svg = myWidget.d3.select(myWidget.homeViewWrapper)
                        .append("svg")
                        .attr("width", myWidget.width)
                        .attr("height", myWidget.height)
                        .append("g")
                        //TODO zoom !
                        .attr("transform", "translate(" + 0 + "," + 0 + ")")
                        .append("g")
                        .attr("transform", "translate("+ 0 +","+ 0+ ")")
                        .attr("class", "container")
                        .call(chart);
  myWidget.homeViewWrapper.inject(widget.body);
  
  myWidget.links.attr("x1", function(d) {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;})
  myWidget.node.attr("cx", function(d) { return d.x = Math.max(myWidget.status_radius, Math.min(myWidget.width - myWidget.status_radius, d.x)); })
          .attr("cy", function(d) { return d.y = Math.max(myWidget.status_radius, Math.min(myWidget.height - myWidget.status_radius, d.y));});
  myWidget.node.attr("transform", function(d){return "translate(" + d.x + "," + d.y + ")";});
  </code></pre>