Public
Edited
Sep 3, 2024
Insert cell
Insert cell
data = FileAttachment("players_20.csv").csv()
Insert cell
Insert cell
table = {
const columns = ["Nationality", "Number of Players", "Avg. Age"];

const table = d3.create("table"),
thead = table.append("thead"),
tbody = table.append("tbody");

// the header row
thead
.append("tr")
.selectAll("th")
.data(columns)
.join("th")
.text((d) => d);

// row for each object in the data
tbody
.selectAll("tr")
.data(groupedData)
.join("tr")
.selectAll("td")
.data((d) => [d[0], d[1].count, d3.format(".2f")(d[1].avgAge)])
.join("td")
.text((d) => d);

return table.node();
}
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