manipulating d3.js in jsdom
===

I'm creating a d3.js visualization using node.js and jsdom. I have successfully created the visualization by producing an SVG String, passing that into an html document so I can then call the library canvg to produce this same d3.js visualization in canvas format.

My problem: My visualization's axes do not draw properly. None of them receive the proper formatting, which I'm trying to produce with the code below: 

     // create Axis
      svg.selectAll(".axis")
          .data(d3.range(angle.domain()[1]))
        .enter().append("g")
          .attr("class", "axis")
          .attr("transform", function(d) { return "rotate(" + angle(d) * 180 / Math.PI + ")"; })
        .call(d3.svg.axis()
          .scale(radius.copy().range([-5, -outerRadius]))
          .ticks(5)
          .orient("left"))
        .append("text")
          .attr("y", 
            function (d) {
              if (window.innerWidth < 455){
                console.log("innerWidth less than 455: ",window.innerWidth);
                return -(window.innerHeight * .33);
              }
              else{
                console.log("innerWidth greater than 455: ",window.innerWidth);
                return -(window.innerHeight * .33);
              }
            })
          .attr("dy", ".71em")
          .attr("text-anchor", "middle")
          .text(function(d, i) { return capitalMeta[i]; })
          .attr("style","font-size:12px;");