I would guess that there is an .on('click') or .on('mousedown') event attached to the <rect> inside the <svg>. A d3.event has properties that include the x and y coordinates of the mouse at the time of the event, which could be converted to coordinates for the circles and path.
I notice that before you start drawing, there is a <g class="user-line"> element with two <path> elements inside that have no 'd' property. Once you start drawing, the 'd' property starts getting filled in. You can see that it's possible to produce curves in the line, so it's probably not a linear interpolation. (See some of the other possible interpolations here:
https://bl.ocks.org/mbostock/4342190).
Another interesting thing that happens is that as soon as you draw the first point, all of your unfinished points are added as <circle> elements with radius of 0 and no transform attribute. So there's some logic that's paying attention to whether your mouse has passed every 5th percentile to know whether to add a circle and M/L components to the path's 'd' attribute.