let setupCanvas = (): CanvasRenderingContext2D => {
   let canvas = <HTMLCanvasElement>document.getElementById("myCanvasContainer");
   canvas.width = window.innerWidth;
   canvas.height = window.innerHeight;
   let _oldWidth = canvas.width;
   let _oldHeight = canvas.height;
   let dpr = window.devicePixelRatio || 1;

   let rect = canvas.getBoundingClientRect();

   canvas.width = rect.width * dpr;
   canvas.height = rect.height * dpr;
   canvas.style.width = `${_oldWidth}px`;
   canvas.style.height = `${_oldHeight}px`;
   let ctx = canvas.getContext('2d');

    ctx.scale(dpr, dpr);
    return ctx;
 };