var script document createElement script script src https cdn plot ly plotly 2 1 0 min js document head appendChild script document body style height 400pt let div document createElement div div id myDiv document body appendChild div onload function const mymod x y return x y Math floor x y let xx let xx2 let yy for let i 0 i 300 i let y i 300 0 3 0 0 3 yy push mymod y 1 0 xx push y var data x xx y yy type scatter var layout autosize false width 500 height 500 margin l 50 r 50 b 100 t 100 pad 4 paper_bgcolor 7f7f7f plot_bgcolor c7c7c7 Plotly newPlot myDiv data layout console log finished
let y i 300 0 3 0 0 3 yy push mymod y 1 0 xx push y var data x xx y yy type scatter var layout autosize false width 500 height 500 margin l 50 r 50 b 100 t 100 pad 4 paper_bgcolor 7f7f7f plot_bgcolor c7c7c7 Plotly newPlot myDiv data layout console log finished