Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 875 Bytes

README.md

File metadata and controls

39 lines (24 loc) · 875 Bytes

playfair

Generate charts and graphs from the command line using d3 and PhantomJS.

Usage

Install playfair with

npm install -g playfair

Then, you can render SVG graphics from JavaScript (produced using d3 or any other library with facilities for SVG drawing) with the command:

playfair <myfile.html>.

Options

Output file: -o --output

By default, playfair saves SVG output to a file named output.svg. You can redirect this output with the -o --output option:

playfair index.html --output example.svg

Selector: -i --id

By default, playfair retrieves the first SVG element from the document. You can pass in an id with the -i --id option:

playfair index.html --id example-id

This will extract the first matching SVG node from the document using document.querySelector("svg#example-id").