For this particular one I used d3.js, but honestly this isn't really the type of thing it's designed for. I've also used GSAP for this type of thing on this article I wrote about database sharding.
As someone who has also use GSAP a decent amount, these days I usually have a better experience with SVG.js [1].