Public
Edited
Apr 26, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// import {data_meteorites as data_meteoritesInitial} from "..."
Insert cell
import {data_meteorites as data_meteoritesInitial} from "b685150be868f3ab"
Insert cell
Insert cell
Insert cell
// Uncomment below to enable

Inputs.table(data_meteoritesInitial)
Insert cell
Insert cell
Insert cell
// Uncomment below to enable

data_meteorites = aq.from(data_meteoritesInitial)
.select('name','mass','fall','year')
.sample(10_000) // uncomment if your computer is slowing down
.rename({mass: "massInGrams"}) // uncomment later
.derive({mass: d => d.massInGrams/1000000}) // uncomment later
.objects()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data_meteorites, {x: "year", y: "mass"})
]
})
Insert cell
data_meteorites
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data_meteorites, {x: "year", y: "mass", r: "mass"})
]
})
Insert cell
Insert cell
// ... your code here
Plot.plot({
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "mass"
})
]
})
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "fall"
})
]
})
Insert cell
data_meteorites
Insert cell
Insert cell
// ... your code here
Plot.plot({
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "fall",
fillOpacity: 0.6
})
]
})
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "fall",
fillOpacity: 0.6
})
]
})
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "mass",
fillOpacity: 0.6
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "mass",
fillOpacity: 0.6
}),
Plot.text(data_meteorites, {
x: 1900,
y: 24,
text: ["Hello ⇢"],
fontSize: 20,
fill: 'red'
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "mass",
fillOpacity: 0.6
}),
Plot.text(data_meteorites, {
x: "year",
y: "mass",
text: "name",
fontSize: 20
})
]
})
Insert cell
Insert cell
Insert cell
// ... your code here
Plot.plot({
color: {
legend: true
},
marks: [
Plot.dot(data_meteorites, {
x: "year",
y: "mass",
r: "mass",
fill: "mass",
fillOpacity: 0.6
}),
Plot.text(data_meteorites, {
x: "year",
y: "mass",
text: d => d["mass"] > 5 ? d["name"] : "" ,
fontSize: 20
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data_meteorites, {x: "year", y: "mass", fill:"dodgerblue"})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data_meteorites, { x: "year", y: "mass", fill: "dodgerblue" }),
Plot.link(
{ length: 1 },
{
x1: 0,
y1: 0,
x2: 2000,
y2: 2
}
)
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dot(data_meteorites, { x: "year", y: "mass", fill: "dodgerblue" }),
Plot.linearRegressionY(data_meteorites, {
x: "year",
y: "mass",
stroke: "red",
ci: 0.95
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
x: {
label: "Year →"
},
y: {
label: " ↑Mass in tons",
grid: true
},
marks: [
Plot.dot(data_meteorites, { x: "year", y: "mass", fill: "dodgerblue" }),
Plot.linearRegressionY(data_meteorites, {
x: "year",
y: "mass",
stroke: "red",
ci: 0.95
})
]
})
Insert cell
Insert cell
Insert cell
Plot.plot({
x: {
label: "Year →",
tickFormat: d3.format(".0f")
},
y: {
label: " ↑Mass in tons",
grid: true
},
marks: [
Plot.dot(data_meteorites, { x: "year", y: "mass", fill: "dodgerblue" }),
Plot.linearRegressionY(data_meteorites, {
x: "year",
y: "mass",
stroke: "red",
ci: 0.95
})
]
})
Insert cell
Insert cell
Insert cell
import {Wrangler, op} from "@observablehq/data-wrangler"
Insert cell
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
imageToDo
Insert cell
import {toc} from "@nebrius/indented-toc"
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