code: function resizeCanvas() {
    var divElement = document.getElementById("mainCanvas");
    var screenHeight = window.innerHeight || document.body.offsetHeight;
    divElement.style.height = (screenHeight - 16) + "px";
  }
docs: Resizes the main canvas to the maximum visible height.