In the previous section, we showed how to export our SVG visualization as an image, but we can, of course, also save the element as an SVG file so it can be imported into external programs, such as Adobe Illustrator, Boxy SVG, or Inkscape.
For exporting SVGs as .svg files, we can use two different approaches. If you use Chrome, there is a Bookmarklet that you can use, and which can be found at http://nytimes.github.io/svg-crowbar/. When you've installed this Bookmarklet, you can export SVG from any page you want. In this section, though, we'll provide an alternative approach that pretty much follows the same steps that we did for exporting SVG as a PNG file:
- We'll once again start by defining the specific CSS style that should be included in the exported SVG file.
- Then we combine the SVG and the CSS file into a single SVG string...