I gave it a try... you have to do all the scaling manually, and calculate what should be visible or not.
here is what I came up with - it can zoom in or out indefinitely, although I didn't have it show simplified labelling the way the program you linked does. I also don't zoom into the mouse location.
drawing graphs gets very tricky! if the canvas size does not match the screen resolution, then the lines will get blurry, different thicknesses, and lighter or darker than their neighbours - which looks terrible.
so, you have to set the canvas size to match the window size if you want nice looking lines.
Use the mouse wheel to zoom in and out, and you can use the left mouse button to make lines: click and hold to make the first point, drag to another location and release to complete the line. when you zoom, the lines get updated.
https://www.rieperts.com/games/forum/Graph.c3p
oh yeah, since I am resetting the canvas and using scale outer to use the whole screen, you can't assume that the top left screen coordinate is 0,0. So you MUST ALWAYS add in viewportLeft and viewportTop to make sure you are where you think you are on the screen. It took me a very long weekend of work a year ago to figure that out - and you would not believe how subtle that mistaken assumption can get!