Skip to content

Instantly share code, notes, and snippets.

@alexpreynolds
Created February 18, 2019 08:45
Show Gist options
  • Save alexpreynolds/f46e7ede8a2017a5b7a7ecdbbe3901ff to your computer and use it in GitHub Desktop.
Save alexpreynolds/f46e7ede8a2017a5b7a7ecdbbe3901ff to your computer and use it in GitHub Desktop.
PhantomJS binding SVG export test
"use strict";
var url = "http://explorer.altius.org/app/?config=SUFTOi4wT5S79NgyLKPTcg&chr=chr3&start=181500000&stop=181800000";
//var url = 'http://higlass.io/app';
var page = require('webpage').create();
page.viewportSize = {
width: 1024,
height: 1280
};
page.open(url, function(status) {
if (status === "success") {
console.log("Status: " + status);
setTimeout(function() {
var svg = page.evaluate(function() {
return window.higlassApi.exportAsSvg();
});
console.log("svg: " + svg);
phantom.exit();
}, 5000);
}
else {
console.log("Error: " + status);
phantom.exit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment