Yeah, I was really interested too. From what I can get from playing around in the console, they (probably jashkenas and his cronies) they're using d3 to do the rendering. Since d3 has convenient map / filter / reduce chains, I assume (though have no proof), they can figure out the shape of your line by doing ye olde' rise / run calculation for each point. If your slopes gets significantly bigger at some point, you must have a S shape. They also force you draw only 1 point per x-increment, so they don't have to handle bad users drawing vertical lines.