Draw on the canvas with the mouse. When you let go, the code kicks in and reduces the number of coordinates you drew, then tries to connect them in a "sensible" way, which right now is not actually that sensible, just Catmull-Rom spline, with cuts where the angle between three points is acute.