plan = d3.range(0, weeks).map((d, i) => {
let days = d3.range(0, 7);
let restDayIndex = longRunIndex === 6 ? 0 : longRunIndex + 1;
days[restDayIndex] = {
type: "Rest",
distanceMin: 0,
distanceMax: 0,
durationMin: 45,
durationMax: 60,
notes:
"Take the day off completely or you may cross-train 30-45 minutes. No running."
};
days[longRunIndex] = {
type: "Long Run",
distance: startLongRun,
notes: "this is your long run where you'll get bored and do your thing"
};
for (var i = 0; i < 7; i++) {
if (i !== restDayIndex && i !== longRunIndex) {
days[i] = {
type: "Easy",
distanceMin: easyRunStartDistance,
distanceMax: easyRunStartDistance,
notes: "Keep it chill and aim for a Zone 2 pace (9:15 /mi)"
};
}
}
return {
days: days,
week: d
};
})