Slight modification of https://bl.ocks.org/veltman/6a922b0fb6abbb815158 to save the resulting gif as a Base64 string for a headless browser to grab.
Uses blob-util for the blob-to-base64 conversion.
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.10/d3.min.js
https://cdnjs.cloudflare.com/ajax/libs/queue-async/1.0.7/queue.min.js