title: d3 react chart width calculation
body: <p>I have a simple d3 barChart inside a React Component using react-faux-dom.</p>
  
  <p>In order to create the graph</p>
  
  <pre><code>    let svg = d3.select(ReactFauxDOM.createElement('div')).append('svg')
          .attr("width", width + margin.left + margin.right)
          .attr("height", height + margin.top + margin.bottom)
  </code></pre>
  
  <p>and to go back to react:</p>
  
  <pre><code>    let graph = svg.node().toReact();
  </code></pre>
  
  <p>This is working great and allows me to fastly create d3 graphs. I can manage width by passing it as a prop from parent component.</p>
  
  <p>Does anybody know any more elegant way to do it?
  I would like to select an element, and read the .offsetWidth proprierty.</p>
  
  <p>But, of course, when I do:</p>
  
  <pre><code>    svg.offsetWidth
  </code></pre>
  
  <p>I get undefined...</p>
  
  <p>any ideas?</p>