Krona
Krona copied to clipboard
Automate export of snapshots
Is there any way to automate (script) the export of snapshot SVG images? Thanks!
Not built into Krona...you would have to use Automator or another macro system to click the snapshot button.
I tried to convert the HTML to image using PhantomJS, but the output does not render correctly. Here is the command I used: phantomjs rasterize.js krona.out.html krona_snap.png
. Any ideas? Is this something that could be built into the program?
Rasterize.js seems to wait 200ms for the page to load before rendering, but the Krona chart is still in its opening animation at this point. It should work if you change that (at line 46) to 850, which is the current animation length.
Thanks, this worked perfectly, it also helped a lot to change the page.viewportSize = { width: 1000, height: 1000 };
at line 15 in the rasterize.js script
Has anyone been able to generate screenshots using a krona.html file with percent-encoding? This would be helpful, because it could potentially allow you to automate the screenshot of an Krona pie chart, at a specific level (i.e. the bacteria level, instead of the root level) if you know the "node" of interest (because it's embedded in the URL). To find this "percent-encoded" URL, I clicked the "link" button (next to snapshot button) on the Krona HTML page to get this URL:
krona.html?dataset=7&node=3432&collapse=true&color=false&depth=34&font=11&key=true
However, when I use that URL with the phantomjs
program, it fails. For example, this call fails: phantomjs rasterize.js krona.html?dataset=7&node=3432&collapse=true&color=false&depth=34&font=11&key=true krona_snap.png
. This might be an issue with phantomjs rasterize.js
, but I thought I would post here in case anyone figured it out. Thanks so much for Krona -- it's awesome!