Converting an SVG animation to a video with the MediaRecorder API and a hidden canvas.
Drawing frames from img
elements can introduce an extra delay, so this version generates all the frames upfront and then renders them in a loop with requestAnimationFrame()
.
See also: Canvas animation to video
Changed /mbostock/raw/4090846/world-110m.json to a local referenece
https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.3/d3.min.js
https://d3js.org/topojson.v2.min.js