Created
February 18, 2019 08:45
-
-
Save alexpreynolds/f46e7ede8a2017a5b7a7ecdbbe3901ff to your computer and use it in GitHub Desktop.
PhantomJS binding SVG export test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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