Mike Bostock's closest point on path with SVG.JS