Plot.plot({
style: "overflow: visible;",
color: {legend: true},
y: {grid: true},
marks: [
Plot.ruleY([0]),
Plot.line(weekly_mileage, {
x: "week",
y: "total_distance",
stroke: "plan"
}),
Plot.text(weekly_mileage, {
filter:(d) => d.pct_change>20 && d.pct_change<100,
x: "week",
y: "total_distance",
stroke: "plan",
text: (d) => `+${d.pct_change}%`,
dy: -5,
lineAnchor: "bottom",
fontWeight:'lighter',
fontSize:9,
strokeWidth:0.7
})
],
y: {label: "Distance (km)"}
});