// MicroSim Template// canvas regions setup// let canvasWidth = 750;letdrawHeight=335;letcontrolHeight=50;letcanvasHeight=drawHeight+controlHeight;letaspectRatio=1.91;// Open Graph standardletcanvasWidth=canvasHeight*aspectRatio;letmargin=50;functionsetup(){constcanvas=createCanvas(canvasWidth,canvasHeight);varmainElement=document.querySelector('main');canvas.parent(mainElement);textSize(16);// create a new slider at th bottom of the canvasmySlider=createSlider(0,300,150,1);mySlider.position(120,drawHeight+15);mySlider.size(canvasWidth-3*margin);}functiondraw(){// background of drawing regionfill('aliceblue');rect(0,0,canvasWidth,drawHeight);// background of controlsfill('whitegray');rect(0,drawHeight,canvasWidth,controlHeight);// get the updated slider valueradius=mySlider.value();// custom drawing herefill('blue');circle(canvasWidth/2,canvasHeight/2,radius);// add the slider label and value in control areafill('black');text("Radius:"+radius,15,drawHeight+30)}