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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more