Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

d3-save-svg

0.0.2 • Public • Published

d3-save-svg

A fork of the nytimes svg-crowbar bookmarklet that extracts SVG nodes and accompanying styles from an HTML document and downloads them as an SVG file --- A file which you could open and edit in Adobe Illustrator, for instance. Because SVGs are resolution independent, it’s great for when you want to use web technologies to create documents that are meant to be printed (like, maybe on newsprint). It was created with d3.js in mind, but it should work fine no matter how you choose to generate your SVG.

Project page

Differences from the bookmarklet

  • Can use to download specific svg, which can be incorporated into buttons for exporting images. See example on the project page.
  • Allows specification of custom file names.
  • Handles embedded raster images.
  • Has convenience method for embedding raster images.

Note

Most of this has been cobbled together from stackoverflow and issues logged on the nytimes svg-crowbar repo.

install

npm i d3-save-svg

Downloadsweekly downloads

23

version

0.0.2

license

BSD-3-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar