Public
Edited
Mar 15, 2023
Insert cell
Insert cell
db = DuckDBClient.of({
batting:FileAttachment("Batting.csv"),
people:FileAttachment("People.csv")
})
Insert cell
db
SELECT concat(nameFirst,' ',nameLast) AS name,yearID,HR
FROM batting,people
WHERE batting.playerID == people.playerID AND teamID == 'PHI'
ORDER BY HR DESC
Insert cell
viewof season = Inputs.range([1900,2022],{step:1})
Insert cell
philsSeaons = phils.filter(d => d.yearID == season).slice(0,10)
Insert cell
Plot.plot({
marginLeft: 150,
x:{domain:[0,60]},
marks: [
Plot.barX(philsSeaons, {x: "HR", y: "name", sort: {y: "x", reverse: true},fill:"red",stroke:"blue"}),
Plot.ruleY([0])
]
})
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