I have a D3.js graph drawn as an SVG. Now, I want to print the graph as an image. Taking a screenshot of the page hasn't worked because the output is the graph's background image. So now I want to try drawing the graph as a canvas. I tried changing the following:
d3.select("svg")
to
d3.select("canvas")
but the graph doesn't appear. A full link to the code is below. What else do I need to change?