title: D3js Export SVG to Image
body: <p>I have this D3js <a href="https://jsfiddle.net/c19664p3/6/" rel="nofollow noreferrer">line graph</a> I'm working with.</p>
  
  <p>I'd like to be able to save it as an image in the same directory as shown in <a href="http://bl.ocks.org/Rokotyan/0556f8facbaf344507cdc45dc3622177" rel="nofollow noreferrer">this example</a></p>
  
  <pre><code>d3.select('#saveButton').on('click', function(){
      var svgString = getSVGString(svg.node());
      svgString2Image( svgString, 2*width, 2*height, 'png', save ); // passes Blob and filesize String to the callback
  
      function save( dataBlob, filesize ){
          saveAs( dataBlob, 'D3 vis exported to PNG.png' ); // FileSaver.js 
  function
      }
  });
  </code></pre>
  
  <p>no errors running the above</p>
  
  <p>Although I am getting no errors, the file is not downloading when the button is clicked. What am I missing here? Thanks!</p>