Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/justinmanley/playfair

Generate charts and graphs from the command line using d3 and PhantomJS.
https://github.com/justinmanley/playfair

Last synced: 16 days ago
JSON representation

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

Awesome Lists containing this project

README

        

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 .
```

### 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")`.