Showcasing JavaScript to automatically move SVG elements into a new SVG whose viewBox is set to exactly encapsulate the element.
viewBox
Written to support this Stack Overflow answer. Copyright ©2012 Gavin Kistner.