I'm using d3.js and the CanvasRenderingContext2D object described here. I'm plotting a bunch of lines on the canvas using the following commands (inside a loop)
g.beginPath();
g.moveTo(nx, ny);
g.lineTo(nx+= dx*scale, ny += dy*scale);
g.stroke();
The issues I have is I want to add arrowheads (or other marker) to the end of these lines - and it's not clear to me how (or if) I can do this if the path is created using this approach. I see that it can be done if I create path directly, as shown in this example, but would prefer to use the Context2d methods above if possible. How does one add markers to the end of each path created using Context2D?