Public
Edited
May 9, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: {
//type: "equal-earth", // this can be set static like this
type: form.projection, // or dynamic like this, referencing the form dropdown above.
rotate: [-form.lon, -form.lat], // set from form elements above
domain: d3.geoCircle().center([form.lon, form.lat]).radius(form.scale)()
},
width,
color: {
scheme: "reds"
},
//r: {range: [1,10]},
marks: [
Plot.geo(world110m, {fill: "#eee", stroke: "#bbb"}),
Plot.graticule(),
Plot.sphere( {stroke: "#ddd"} ),
showDensity ? Plot.density(earthdata, { // <-- include density mark only if showDensity is true
x: "longitude",
y: "latitude",
bandwidth: 12,
fill: "density"
}): null,
Plot.dot(filteredData, {
x: "longitude",
y: "latitude",
r: d=>radiusScale(d.magnitude),
fill:"yellow",
stroke: "black"
}),
Plot.geo(world110m,{ strokeOpacity: 0.5 }),
]
})

Insert cell
filteredData = earthdata.filter(d => d.year == Year && (magType === 'All' || d.magType === magType));
Insert cell
radiusScale = d3.scaleLinear().domain([1,8]).range([6.4,9.2])
Insert cell
Insert cell
earthq = FileAttachment("earthquake_data@1.csv").csv()
Insert cell
earthdata = earthq
Insert cell
earthdata
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
import {basemaps} from "@emfielduva/dvlib_maps"
Insert cell
world110m = (await basemaps.world110m.geojson).json()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more