Public
Edited
Apr 24, 2024
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
allAgesData
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Plot.plot({
y: { grid: true },
marks: [
Plot.ruleY([0]),
Plot.dot(bpm_2024, {
channels: { player: "Player" },
x: "Age",
y: (d) => +d["BPM▼"],
fill: (d) => (+d.Age >= 33 ? "red" : "#ccc"),
tip: true
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
allAgesData
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
lebronData.filter((f) => toHighlight.includes(f.player))
Insert cell
Insert cell
Insert cell
ageData = makeAgetiers(allAgesData)
Insert cell
Insert cell
Insert cell
function combineHOF(arr, arr2) {
let final = [];
arr.forEach((d) => {
let obj = {
player: d.Player,
season: d.Season,
age: +d.Age,
BPM: +d.BPM
};
final.push(obj);
});
arr2.forEach((d) => {
let obj = {
player: d.Player,
season: d.Season,
age: +d.Age,
BPM: +d.BPM
};
final.push(obj);
});
return final;
}
Insert cell
lebronData = combineHOF(hofData, modernHOF)
.sort((a, b) => a.age - b.age)
.sort((a, b) => a.player.localeCompare(b.player))
.filter((f) => f.player !== "Pat Riley" && f.player !== "George Karl")
Insert cell
Insert cell
allAgesData = FileAttachment("data-all_ages.csv").csv()
Insert cell
hofData = FileAttachment("hof.csv").csv()
Insert cell
modernHOF = FileAttachment("modern_players@2.csv").csv()
Insert cell
bpm_2024 = FileAttachment("bpm_2024@1.csv").csv()
Insert cell
Insert cell
Insert cell
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