Hey @Hysteresis,
You should coordinate line draw and scroll movement also so that the course of your green line (the tip)
does not run out of the viewport, is always in the picture. Here's an example ...
https://codepen.io/mikeK/pen/MWoaXjV/13e3ffd92460b9cd26b1e5f793b640f8?editors=0110
Happy scrolling ...
Mikel