Public
Edited
May 12, 2023
27 forks
Importers
10 stars
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: {type: "orthographic", rotate: [-longitude, -30]},
r: {transform: (d) => Math.pow(10, d)}, // convert Richter to amplitude
style: "overflow: visible;", // allow dots to escape
marks: [
Plot.geo(land, {fill: "currentColor", fillOpacity: 0.2}),
Plot.sphere(),
Plot.dot(earthquakes, {x: "longitude", y: "latitude", r: "magnitude", stroke: "red", fill: "red", fillOpacity: 0.2})
]
})
Insert cell
world = FileAttachment("countries-110m.json").json()
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
earthquakes = d3.json("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojson").then(d => d.features.map(f => {
const c = d3.geoCentroid(f);
return {magnitude: f.properties.mag, longitude: c[0], latitude: c[1]};
}))
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