Announcing the Phantom Crowbar javascript d3 programming
Extract the raw SVG (and styles) from a webpage, from the command line!
Motivated by the desire to use d3 to make figures automatically.
Built on top of the wonderful, and more versatile, svg-crowbar.
I'm testing it on hedonometer.org, and remaining issues are converting to a PDF correctly. But this is likely a result of haphazard use of CSS styles in the page design.
Dependencies
phantomjs
brew install phantomjs
Usage
Clone this repository.
Run the `phantom-crowbar.js` with `phantomjs`, passing the webpage, the id of the svg element to grab, and the output filename. Here's the first line of test/run.sh:
phantomjs phantom-crowbar.js http://hedonometer.org timeseries test1.svg
Testing
Uses