diff --git a/data/allStravaSplits.csv b/data/allStravaSplits.csv index 2794f4d..e103426 100644 --- a/data/allStravaSplits.csv +++ b/data/allStravaSplits.csv @@ -122,4 +122,4 @@ Lauren Elkins,10:53,5 Lauren Elkins,10:23,4 Lauren Elkins,10:50,3 Lauren Elkins,10:00,2 -Lauren Elkins,9:48,1 \ No newline at end of file +Lauren Elkins,9:48,1 diff --git a/data/raceSplits.csv b/data/raceSplits.csv new file mode 100644 index 0000000..3843218 --- /dev/null +++ b/data/raceSplits.csv @@ -0,0 +1,131 @@ +athlete_id,pace,mile +Greg McQuaid,9:15,1 +Greg McQuaid,8:48,2 +Greg McQuaid,9:39,3 +Greg McQuaid,9:24,4 +Greg McQuaid,9:32,5 +Greg McQuaid,10:25,6 +Greg McQuaid,9:42,7 +Greg McQuaid,9:51,8 +Greg McQuaid,9:36,9 +Greg McQuaid,9:25,10 +Greg McQuaid,9:54,11 +Greg McQuaid,9:46,12 +Greg McQuaid,9:42,13 +Greg McQuaid,8:45,14 +Greg McQuaid,8:50,15 +Greg McQuaid,10:06,16 +Greg McQuaid,10:11,17 +Greg McQuaid,9:58,18 +Greg McQuaid,9:30,19 +Greg McQuaid,9:41,20 +Greg McQuaid,8:44,21 +Greg McQuaid,9:09,22 +Greg McQuaid,9:15,23 +Greg McQuaid,8:25,24 +Greg McQuaid,8:09,25 +Greg McQuaid,8:46,26 +Jorge Maravilla,5:44,1 +Jorge Maravilla,5:53,2 +Jorge Maravilla,5:40,3 +Jorge Maravilla,5:42,4 +Jorge Maravilla,5:42,5 +Jorge Maravilla,5:55,6 +Jorge Maravilla,5:19,7 +Jorge Maravilla,5:26,8 +Jorge Maravilla,5:34,9 +Jorge Maravilla,5:37,10 +Jorge Maravilla,5:02,11 +Jorge Maravilla,5:53,12 +Jorge Maravilla,5:41,13 +Jorge Maravilla,5:24,14 +Jorge Maravilla,5:37,15 +Jorge Maravilla,5:46,16 +Jorge Maravilla,5:46,17 +Jorge Maravilla,5:23,18 +Jorge Maravilla,5:30,19 +Jorge Maravilla,5:25,20 +Jorge Maravilla,5:10,21 +Jorge Maravilla,5:12,22 +Jorge Maravilla,5:39,23 +Jorge Maravilla,5:33,24 +Jorge Maravilla,5:29,25 +Jorge Maravilla,5:46,26 +Hilary Shirazi,8:02,1 +Hilary Shirazi,7:49,2 +Hilary Shirazi,7:47,3 +Hilary Shirazi,7:37,4 +Hilary Shirazi,7:50,5 +Hilary Shirazi,8:49,6 +Hilary Shirazi,7:42,7 +Hilary Shirazi,7:48,8 +Hilary Shirazi,7:57,9 +Hilary Shirazi,8:12,10 +Hilary Shirazi,7:37,11 +Hilary Shirazi,8:11,12 +Hilary Shirazi,7:56,13 +Hilary Shirazi,7:56,14 +Hilary Shirazi,8:05,15 +Hilary Shirazi,8:18,16 +Hilary Shirazi,8:59,17 +Hilary Shirazi,7:51,18 +Hilary Shirazi,8:05,19 +Hilary Shirazi,8:06,20 +Hilary Shirazi,7:43,21 +Hilary Shirazi,7:47,22 +Hilary Shirazi,8:24,23 +Hilary Shirazi,8:14,24 +Hilary Shirazi,8:01,25 +Hilary Shirazi,8:07,26 +Iain Mickle,6:46,1 +Iain Mickle,6:40,2 +Iain Mickle,6:41,3 +Iain Mickle,6:34,4 +Iain Mickle,6:35,5 +Iain Mickle,7:26,6 +Iain Mickle,6:34,7 +Iain Mickle,6:37,8 +Iain Mickle,6:46,9 +Iain Mickle,7:02,10 +Iain Mickle,6:27,11 +Iain Mickle,7:09,12 +Iain Mickle,6:56,13 +Iain Mickle,6:38,14 +Iain Mickle,6:55,15 +Iain Mickle,6:51,16 +Iain Mickle,6:52,17 +Iain Mickle,6:29,18 +Iain Mickle,6:30,19 +Iain Mickle,6:40,20 +Iain Mickle,6:18,21 +Iain Mickle,6:32,22 +Iain Mickle,6:44,23 +Iain Mickle,6:50,24 +Iain Mickle,6:38,25 +Iain Mickle,6:51,26 +Balint Gal,8:49,1 +Balint Gal,8:59,2 +Balint Gal,9:00,3 +Balint Gal,8:56,4 +Balint Gal,8:49,5 +Balint Gal,9:34,6 +Balint Gal,8:32,7 +Balint Gal,8:31,8 +Balint Gal,8:46,9 +Balint Gal,8:44,10 +Balint Gal,8:17,11 +Balint Gal,9:08,12 +Balint Gal,8:42,13 +Balint Gal,8:34,14 +Balint Gal,9:16,15 +Balint Gal,9:09,16 +Balint Gal,9:07,17 +Balint Gal,8:42,18 +Balint Gal,8:37,19 +Balint Gal,8:41,20 +Balint Gal,8:23,21 +Balint Gal,8:32,22 +Balint Gal,8:51,23 +Balint Gal,8:49,24 +Balint Gal,8:24,25 +Balint Gal,8:44,26 diff --git a/src/css/project.less b/src/css/project.less index 1e5dc32..32f5c4f 100644 --- a/src/css/project.less +++ b/src/css/project.less @@ -22,6 +22,15 @@ a { } } +.landing-image { + max-width: 1000px; + margin: auto; + padding: 0; + img { + width: 100%; + } +} + .gif-container { max-width: 800px; margin: auto; @@ -227,6 +236,9 @@ a { &.nomargin { margin: 0 auto 20px auto; } + &.narrow { + max-width: 800px; + } } .text-pullout { @@ -241,6 +253,10 @@ a { &.padded { margin-bottom: 40px; } + &.centered { + max-width: 600px; + margin: 20px auto; + } // @media @mobile { width: 90%; diff --git a/src/css/sfchronicle.less b/src/css/sfchronicle.less index 5537891..585fc31 100644 --- a/src/css/sfchronicle.less +++ b/src/css/sfchronicle.less @@ -395,6 +395,9 @@ header { &.landing { margin-bottom: 2.5em; } + &.top { + margin-top: 0; + } } .byline { diff --git a/src/js/races.js b/src/js/races.js index 5cd02a4..55df31d 100644 --- a/src/js/races.js +++ b/src/js/races.js @@ -131,10 +131,10 @@ function hoverChart(targetID,maxval,yLabel,units,runnerID) { }; if (screen.width > 768) { // var width = 440 - margin.left - margin.right; - var height = 450 - margin.top - margin.bottom; + var height = 500 - margin.top - margin.bottom; } else if (screen.width <= 768 && screen.width > 480) { // var width = 440 - margin.left - margin.right; - var height = 450 - margin.top - margin.bottom; + var height = 500 - margin.top - margin.bottom; } else if (screen.width <= 480 && screen.width > 340) { console.log("big phone"); var margin = { @@ -217,20 +217,20 @@ function hoverChart(targetID,maxval,yLabel,units,runnerID) { var voronoi = d3.voronoi() // .curve(d3.curveBasis) .x(function(d) { - return x(d["mileShort"]); + return x(d["mile"]); }) .y(function(d) { - return y(parsePace(d["paceShort"])) + return y(parsePace(d["pace"])) }) .extent([[-margin.left, -margin.top], [width + margin.right, height + margin.bottom]]); var line = d3.line() .curve(d3.curveCardinal) .x(function(d) { - return x(d["mileShort"]); + return x(d["mile"]); }) .y(function(d) { - return y(parsePace(d["paceShort"])); + return y(parsePace(d["pace"])); }); var elevationLine = d3.line() @@ -281,8 +281,8 @@ function hoverChart(targetID,maxval,yLabel,units,runnerID) { function mouseover(d) { d3.select(".id"+d.data.athlete_id.toLowerCase().replace(/ /g,'')+runnerID.toLowerCase().replace(/ /g,'')).classed("line-hover-races", true); d3.select("#hover-race-name-"+runnerID.split(" ")[0].toLowerCase()).text(d.data.athlete_id); - d3.select("#hover-race-pace-"+runnerID.split(" ")[0].toLowerCase()).text("Mile "+d.data.mileShort+" pace: "+d.data.paceShort); - focus.attr("transform", "translate(" + x(d.data["mileShort"]) + "," + y(parsePace(d.data["paceShort"])) + ")"); + d3.select("#hover-race-pace-"+runnerID.split(" ")[0].toLowerCase()).text("Mile "+d.data.mile+" pace: "+d.data.pace); + focus.attr("transform", "translate(" + x(d.data["mile"]) + "," + y(parsePace(d.data["pace"])) + ")"); } function mouseout(d) { @@ -414,9 +414,9 @@ function dotChart(targetID,maxval,runnerID){ .attr("r", function(d) { if (d["Daily Elevation"] ) { if (screen.width <= 480) { - return (d["Daily Elevation"]/1000+5) + return (d["Daily Elevation"]/1000+6) } else { - return (d["Daily Elevation"]/500+5) + return (d["Daily Elevation"]/500+6) } } else { return 5; @@ -427,25 +427,25 @@ function dotChart(targetID,maxval,runnerID){ .attr("opacity",function(d) { // all data displayed if (runnerID == "all") { - if (d.Date == "2017-07-01"){ + if (d.Date == "2017-07-23"){ // <------------------------------------------------------- CHANGE THIS ON MONDAY! return 1.0; } else { - return 0.2; + return 0.3; } // data just for one runner is displayed and this is the one } else if (d.name.split(" ")[0].toLowerCase() == runnerID) { - if (d.Date == "2017-07-01"){ + if (d.Date == "2017-07-23"){ // <------------------------------------------------------- CHANGE THIS ON MONDAY! return 1.0; } else { return 0.3; } // just one runner is displayed and this is not the one } else { - if (d.Date == "2017-07-01"){ - return 0.5; - } else { + // if (d.Date == "2017-07-01"){ // <------------------------------------------------------- CHANGE THIS ON MONDAY! + // return 0.5; + // } else { return 0.2; - } + // } } }) .attr("fill",function(d) { diff --git a/src/partials/_head_races.html b/src/partials/_head_races.html index afe1186..f2028df 100644 --- a/src/partials/_head_races.html +++ b/src/partials/_head_races.html @@ -14,5 +14,5 @@ - + diff --git a/src/partials/_head_training.html b/src/partials/_head_training.html index bf65c36..7de2a17 100644 --- a/src/partials/_head_training.html +++ b/src/partials/_head_training.html @@ -14,5 +14,5 @@ - + diff --git a/src/races/index.html b/src/races/index.html index 183bd65..45f748e 100644 --- a/src/races/index.html +++ b/src/races/index.html @@ -20,6 +20,11 @@ <%= t.include("partials/_flat_nav_races.html") %> <%= t.include("partials/_nav_races.html") %> +
<%=d.value%>
@@ -120,16 +114,18 @@ <%= t.include("partials/_footer.html") %>