Published
Edited
Jul 30, 2021
8 stars
Insert cell
Insert cell
addTooltips(
Plot.plot({
marks: [
Plot.dot(data, {
x: "Year",
y: "Age",
stroke: "Event",
title: (d) => `Name: ${d.Name}
Medal: ${d.Medal}
Team: ${d.Team}
Event: ${d.Event}
Year: ${d.Year}`
})
]
})
)
Insert cell
addTooltips(
Plot.plot({
marks: [
Plot.text(data, {
text: d => {
// 🥇🥈🥉
if(d.Medal == "Gold") return "🥇"
if(d.Medal == "Silver") return "🥈"
if(d.Medal == "Bronze") return "🥉"
return "."
},
x: "Year",
y: "Age",
title: (d) => `Name: ${d.Name}
Medal: ${d.Medal}
Team: ${d.Team}
Event: ${d.Event}
Year: ${d.Year}`
})
]
})
)
Insert cell
countryEmoji //Try pulling this into the plot!
Insert cell
import { countryEmoji } from "@mattdzugan/making-maps-out-of-emojis"
Insert cell
addTooltips(
Plot.plot({
facet: {
data: data,
y: "Event"
},
marks: [
Plot.dot(data, {
x: "Year",
y: "Age",
stroke: "Event",
title: (d) => `Name: ${d.Name}
Medal: ${d.Medal}
Team: ${d.Team}
Event: ${d.Event}
Year: ${d.Year}`
})
]
})
)
Insert cell
d3.rollups(data, v => v.length, d => d.Name).sort((a,b) => b[1] - a[1])
Insert cell
Inputs.table(data)
Insert cell
data
Insert cell
import { gymnastics as data } from "@zanarmstrong/dataset-olympics"
Insert cell
import {addTooltips} from "@mkfreeman/plot-tooltip"
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