diff --git a/.DS_Store b/.DS_Store index 034166d..5b3a61b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/graph.js b/graph.js index f3c0c5a..b98ae44 100644 --- a/graph.js +++ b/graph.js @@ -187,15 +187,15 @@ var rect = layer.selectAll("rect") var Offset = document.getElementById("graphSteak").offsetTop; - var pos=parseInt(data[0].length-(event.pageY-Offset-margin.top-300)/(height/yStackMax)); + var pos=parseInt(data[0].length-(event.pageY-Offset-margin.top-340)/(height/yStackMax)); var line=parseInt((event.pageX-parseFloat($("body").css('margin-left'))-margin.left)/(x.rangeBand()+1.2)-1.5); console.log(line); $("line").remove(); var myLine = d3.selectAll(".mysteak").append("svg:line") .attr("x1", margin.left) - .attr("y1", event.pageY-Offset-295) + .attr("y1", event.pageY-Offset-342) .attr("x2", width*32/30) - .attr("y2", event.pageY-Offset-295) + .attr("y2", event.pageY-Offset-342) .style("z-index",-1) .style("stroke", "grey"); //console.log(d3.event.pageX-parseFloat($("body").css('margin-left'))); @@ -205,7 +205,7 @@ console.log(line); ttip.html(toF(parseFloat(data[line][pos])).toFixed(2)+ "\xB0F") } else{ ttip.html(parseFloat(data[line][pos]).toFixed(2)+ "\xB0C")} - // ttip.html(line.toFixed(2)+ "\xB0C") + // ttip.html(pos.toFixed(2)+ "\xB0C") ttip.style("opacity", 1) .style("left", (d3.event.pageX-parseFloat($("body").css('margin-left'))+10) + "px") diff --git a/perfectSteak.css b/perfectSteak.css index e54e5ae..25509bf 100644 --- a/perfectSteak.css +++ b/perfectSteak.css @@ -1,11 +1,13 @@ -.inputTable{ +#table{ position: relative; - width: 100% !important; + width: 95% !important; text-align: center; top: 0px !important; padding: 0px !important; margin: 0px!important; - + height:260px; + overflow-y:auto; + overflow-x:hidden } .displayDiv{ @@ -96,10 +98,11 @@ input[type="radio"].toggle-right + label { #recipeName{ width: 200px !important; + } .containerm{ width:100%; -height:100px; +height:260px; } @@ -152,7 +155,7 @@ input[type="text"] { border: 1px solid black; font-size: 12px; width:100% !important; - height:100px !important; + height:300px !important; } diff --git a/perfectSteak.js b/perfectSteak.js index 06178e3..7491010 100644 --- a/perfectSteak.js +++ b/perfectSteak.js @@ -19,7 +19,42 @@ var perfectSteak = function (div) { var timeStep = 15; var inputTable = $(".inputTable"); - + var toC = function (F) { + return ((5 / 9) * (F - 32)); + } + var toC = function (F) { + return ((5 / 9) * (F - 32)); + } +var importRecipes=function(){ + var saved=[{"name":"Heston Blumenthal","data":[[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[15,73,300],[15,300,73],[300,73,73]],"Temp":73}, + {"name":"4 minutes a side","data":[[240,300,73],[240,73,300],[300,73,73]],"Temp":73}, + {"name":"America's Test Kitchen","data":[[15,450,73],[15,73,450],[300,225,225],[900,73,73]],"Temp":73}, + {"name":"Nathan Mhyrvold","data":[[3600,125,125],[30,-321,-321],[120,390,390]],"Temp":73}]; + for (var i=0;i<4;i++){ + var name=saved[i]["name"]; + var data=saved[i]["data"]; + + + for(var n=0;n"); var tableTabs = $(''); @@ -304,7 +343,7 @@ var perfectSteak = function (div) { $('#si1').html("Side 1 (°" + $('.mytog2:checked').attr('id') + ")"); $('#si2').html("Side 2 (°" + $('.mytog2:checked').attr('id') + ")"); $('#work').html("°" + $('.mytog2:checked').attr('id')); - graph(false, $('.mytog:checked').attr('id')); + //graph(false, $('.mytog:checked').attr('id')); }); var addButton; @@ -359,7 +398,7 @@ var perfectSteak = function (div) { console.log(info); d3.selectAll('.finalsteak').remove(); - drawFinished(info[0], info[1], info[2], info[3], 0,info[4],info[4]); + drawFinished(info[0], info[1], info[2], info[3], 0,info[4],info[5]); var inf = model.currentInfo['recipe'][name2]; drawFinished(inf[0], inf[1], inf[2], inf[3], 1,inf[4],inf[5]); }); @@ -685,7 +724,9 @@ var perfectSteak = function (div) { if (OKtoCook == true) { var steak = [model.currentInfo["data"][0][1]]; for (var m = 0; m < parseFloat($("#thicknessInp").val()) * 10; m++) { - steak.push(parseFloat($("#steakTemp").val())) + if($('.mytog2:checked').attr('id')=='C'){ + steak.push(parseFloat($("#steakTemp").val()))} + else{steak.push(toC(parseFloat($("#steakTemp").val())))} } steak.push(model.currentInfo["data"][0][2]); diff --git a/sample.js b/sample.js index 448c1ef..f03b6a3 100644 --- a/sample.js +++ b/sample.js @@ -5,6 +5,7 @@ with the function graphSteak */ var calculate=function(data,steak,meatType,first,totalTime,mode){ + //sets the parameters for the iterations of the diffusion equations. //parameters are initially set to a timestep of 1 second and a spacestep of 1mm, //but these can be increased with minimal error if calculation time is too great @@ -13,14 +14,16 @@ var calculate=function(data,steak,meatType,first,totalTime,mode){ { return ((5/9)*(F-32)); } - if(mode!='C'){ + if(mode=='F'){ for(var i=0;i 10000){ @@ -46,11 +49,11 @@ var calculate=function(data,steak,meatType,first,totalTime,mode){ var timestep=1/Thedata.step; var maxTemps=Thedata.maxTemps; - if(first){ + /* if(first){ drawFinished(meatType,maxTemps,data,steak[0],0,(steak.length-2)/10,'C'); drawFinished(meatType,maxTemps,data,steak[0],1,(steak.length-2)/10,'C'); } - + */ graphSteak(sampledata,flame,timestep,meatType,maxTemps,mode);