Introducing d3-shape
Shameless plug: the design of this seems really similar to my own library paths.js. In both cases, the starting point is observing that nowadays people usually already use some framework to manipulate the DOM, so what is actually needed is some way of computing some description of shapes starting from the data (and suitable accessor functions). see https://andreaferretti.github.io/paths-js-demo