Is it possible to append an SVG canvas to an element other than using D3.js if the script is not inside that element?
For example, the code
You're trying to select #container before it exists. You'll need to put your code in an onload or move the script below #container in the page.
#container
onload