Canvas "pipe" between two points.
$ component install component/pipe
<canvaswidth=1000height=1000style="border: 1px solid #eee"></canvas><script>varraf=require('raf');varpipe=require('pipe');varcanvas=document.querySelector('canvas');varctx=canvas.getContext('2d');vara={x: 500,y: 300};varb={x: 500,y: 500};varg=0;varx;vary;canvas.onmousemove=function(e){x=e.offsetX;y=e.offsetY;};functiondraw(){ctx.strokeStyle='#ddd';canvas.width=canvas.width;b.x=x;b.y=y;pipe(ctx,a,b);}functionanimate(){raf(animate);draw();}animate();</script>MIT