diff --git a/data.js b/data.js index 40e10a5..29b3baa 100644 --- a/data.js +++ b/data.js @@ -5,7 +5,9 @@ var tempScale={"Steak": {'info':'Myoglobin denatures 60-70\xB0 C','position':2}, {'info':'Actin denatures 70-120\xB0 C','position':1}, {'info':'Browning reactions occur 120+\xB0 C','position':0}], + "Tuna": + [{'info':'lack of protein denaturization below 40\xB0 C','position':5}, {'info':'Myosin breaks down 40-50\xB0 C','position':4}, {'info':'Myocommata begins to rupture 50\xB0 C','position':3}, @@ -27,6 +29,7 @@ var tempScale={"Steak": {'info':'Actin denatures 70-120\xB0 C','position':1}, {'info':'Browning reactions occur 120+\xB0 C','position':0}], + }; //color @@ -39,6 +42,7 @@ var color = { d3.scale.linear() .domain([0,1,5,9,10]) .range(['#692901','#FAEEE6','#FA3491', '#FAEEE6','#692901']), + "Turkey": d3.scale.linear() .domain([0,1,5,9,10]) @@ -46,7 +50,9 @@ var color = { "Tofu": d3.scale.linear() .domain([0,1,5,9,10]) + + .range(['#DE843A','#F7DEC8','#F5F2F0','#F7DEC8','#DE843A']) }; //boundaries where color change occurs -var boundaries= {"Steak":[120,70,60,55,40], "Tuna": [90,70,60,50,40],"Turkey":[120,70,60,55,40],"Tuna":[120,70,60,55,40]}; \ No newline at end of file +var boundaries= {"Steak":[120,70,60,55,40], "Tuna": [90,70,60,50,40],"Turkey":[120,70,60,55,40],"Tuna":[120,70,60,55,40]}; diff --git a/graph.js b/graph.js index 0d08348..b85a43f 100644 --- a/graph.js +++ b/graph.js @@ -131,7 +131,7 @@ var svg = d3.select("body").append("svg") .attr("x", width/1.3) .attr("y", -margin.top/2) .style("font-size",'30px') - .text("Steak temperature is: ______\xB0C"); + .text(meatType+ " temperature is: ______\xB0C"); var layer = svg.selectAll(".layer") .data(layers) @@ -170,8 +170,8 @@ var rect = layer.selectAll("rect") var Offset = document.getElementById("graphSteak").offsetTop; var pos=parseInt(data[0].length-(event.pageY-Offset-margin.top)/(height/yStackMax)); var line=parseInt((event.pageX-margin.left)/(x.rangeBand()+1)-4.0); -$(d3.select('.mylabel')[0][0]).text("Steak temperature is "+ data[line][pos].toFixed(2)+ "\xB0C"); - +$(d3.select('.mylabel')[0][0]).text( meatType+ " temperature is "+ data[line][pos].toFixed(2)+ "\xB0C"); + //$(d3.select('.mylabel')[0][0]).text("Steak temperature is "+ line.toFixed(2)+ "\xB0C"); }) @@ -236,7 +236,7 @@ svg.append("text") .attr("x", -height/3) .attr("y",-30) .attr("transform", "rotate(-90)") - .text("Steak Thickness (cm)"); + .text(meatType+" Thickness (cm)"); svg.append("text") .attr("class", "y label1") diff --git a/perfectSteak.css b/perfectSteak.css index 7278deb..729fe47 100644 --- a/perfectSteak.css +++ b/perfectSteak.css @@ -15,4 +15,9 @@ position: relative; top: 0%; float: left; +} + +#meatInp{ + position:relative; + float:left; } \ No newline at end of file diff --git a/perfectSteak.js b/perfectSteak.js index 05632b0..e722394 100644 --- a/perfectSteak.js +++ b/perfectSteak.js @@ -122,11 +122,14 @@ var perfectSteak = function (div) { timeFun(i); flipButtonFun(i); } + model.dataClear(); addButtonFun(); subButtonFun(); CookButtonFun(); }; + + var addRow = function (table) { flipButton = $(""); var row = $("