Public
Edited
Jun 15, 2023
Fork of Plan Creator
Insert cell
Insert cell
Insert cell
plan = [
{
day: 0
}
]
Insert cell
easyRunStartDistance = 5
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plan = d3.range(0, weeks).map((d, i) => {
let days = d3.range(0, 7);
let restDayIndex = longRunIndex === 6 ? 0 : longRunIndex + 1;

// handle rest days
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."
};

// handle long runs
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
};
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more