This code is in a really bad state and might not work as expected. Backend for ffmap-d3