title: How can I scale my map to fit my svg size with d3 and geojson path data
body: <p>I am trying to create a d3 SVG that draws a map of New York State and scale it so that it fits the size of my SVG, the issue I am having is that when I use <code>.fitSize([height, width], mapObject)</code> it only returns a <code>NaN</code> error in the console.</p>
  
  <p>the <a href="https://raw.githubusercontent.com/deldersveld/topojson/master/countries/us-states/NY-36-new-york-counties.json" rel="nofollow noreferrer">topoJSON file of NYS</a> I am using</p>
  
  <p>I am able to get the map to display without scaling but of course, it is not optimized and needs to be scaled </p>
  
  <p>I have attempted what is said in this <a href="https://stackoverflow.com/questions/42430361/scaling-d3-v4-map-to-fit-svg-or-at-all">post</a> but I have not figured out the correct solution</p>
  
  <pre><code>var map = d3.json('./ny.json')
  
  Promise.all([map]).then(data =&gt; {
    var height = 800;
    var width  = 800;
    var mapData = data[0]
  
    // original geoJSON to that works without scaling 
    // var geoData = topojson.feature(mapData, mapData.objects["cb_2015_new_york_county_20m"]).features
    //
  
    var geoData = topojson.feature(mapData, {
      type:"GeometryCollection",
      geometries: mapData.objects["cb_2015_new_york_county_20m"].geometries,
    })
  
    var projection = d3.geoMercator()
                       .fitSize([width, height], geoData)
  
    var path = d3.geoPath()
                 .projection(projection)
  
    d3.select('svg')
      .attr('height', height)
      .attr('width', width)
      .selectAll('.county')
        .data(geoData)
        .enter()
        .append('path')
          .classed('.county', true)
          .attr('d', path)
  
  })
  </code></pre>
  
  <p>I am pretty sure this is a formatting error on my part, but I am unsure of what data <code>.fitSize()</code> or <code>.fitExtent()</code> is trying to compare against. </p>
  
  <p>right now the way the code site I receive no error outputted to the console but I also have no data append to the SVG</p>