JSFiddle - React, Tailwind, and code Playground

HTML

<canvas id='canvas'></canvas>

JavaScript

Plot = function(lines, step)
{
    var size = step*lines;
    canvas.width = canvas.height = size;
    var ctx = canvas.getContext("2d");
    ctx.beginPath();

    size -= step;
        
    for (x1=0,y1=size,x2=0,y2=0,i = 0; i < lines; ++i,y1-=step,x2+=step)
    {
        ctx.moveTo(x1,y1);
        ctx.lineTo(x2,y2);
    }
    ctx.stroke();
    
}

i = prompt('Lines Step').split(' ')
Plot( i[0]|0, i[1]|0)