For the past decade I've been a software engineer at Google in California. In my spare time I've created a mélange of open-source software. I've also built some rather unusual hardware. On rare occasions I've even been known to write something interesting.
SVG-edit is a fantastic open-source client-side full-featured SVG editor. It is split into two components, the UI (svg-editor.js) and the drawing surface (svgcanvas.js). This allows one to create a project based solely on the drawing surface, while providing a custom UI.
Unfortunately the documentation is quite sparse and I had to do a lot of detective work to figure out how to make the SvgCanvas do anything on its own. But I eventually figured it out and created a minimal demo.
If you are trying to use SvgCanvas outside of SVG-Edit, the above demo would be a good place to start. But please ask follow-up questions in the mailing list, don't ask me.