Public
Edited
Jul 31, 2023
Insert cell
Insert cell
Plot.plot({
inset: 8,
grid: true,
title: "races in the past year",
x: {
// type: "log",
label: "distance in meters (not to scale)",
domain: [800, 1600, 5000, 10000, 16000, 42195],
grid: false
},
y: {
grid: true,
percent: true
},
marks: [
Plot.dot(races, { x: "distance", y: "age_grade" }),
Plot.linearRegressionY(races, {
x: "distance",
y: "age_grade",
stroke: "red"
}),
Plot.text(["Race performances within one year of Jul 31 2023"], {
frameAnchor: "top-left",
dy: -20,
dx: 150,
fontWeight: "bold",
fontSize: "12",
textanchor: "start"
})
]
})
Insert cell
races = [
{
distance: 800, //meters
date: "07/11/2023",
age_grade: 0.814,
vO2: 63.8,
time: 132.2 // seconds
},
{
distance: 800,
date: "06/28/2023",
age_grade: 0.785,
vO2: 61.2,
time: 137
},
{
distance: 800,
date: "06/15/2023",
age_grade: 0.768,
vO2: 59.7,
time: 140
},
{
distance: 1600,
date: "06/28/2023",
age_grade: 0.798,
vO2: 59.9,
time: 298
},
{
distance: 1600,
date: "06/15/2023",
age_grade: 0.78,
vO2: 58.4,
time: 304.9
},
{
distance: 5000,
date: "05/14/2023",
age_grade: 0.77,
vO2: 57.5,
time: 1063
},
{
distance: 16000,
date: "02/05/2023",
age_grade: 0.715,
vO2: 54.3,
time: 3837
},
{
distance: 42195,
date: "04/17/2023",
age_grade: 0.696,
vO2: 52.9,
time: 10982
},
{
distance: 10000,
date: "08/06/2022",
age_grade: 0.728,
vO2: 54.9,
time: 2295
}
]
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