construct the canvas in JS