Unlisted
Edited
Dec 17
Insert cell
Insert cell
Plot.plot({
projection: "equal-earth",
width,
color: { scheme: "greys", range: [0.2, 0.8] },
marks: [
Plot.graticule(),
Plot.geo(land, { fill: "#AAA" }),
Plot.geo(countries, { fill: (d) => +d.id }),
Plot.geo(countries, {
// give it a class for easier CSS matching
className: "country",
pointerEvents: "fill",
strokeOpacity: 0,
title: (d) => d.properties.name
}),
Plot.sphere(),
// highlight
() =>
svg`<style>
// g[aria-label=geo] path:hover {stroke: red; stroke-width: 2; stroke-opacity: 1.0; transition: stroke-opacity .1s }
.country path:hover {stroke: red; stroke-width: 2; stroke-opacity: 1.0; transition: stroke-opacity 1s }
`
]
})
Insert cell
land = topojson.feature(land50m, land50m.objects.land)
Insert cell
land50m = FileAttachment("land-50m.json").json()
Insert cell
countries = topojson.feature(countries50m, countries50m.objects.countries)
Insert cell
countries50m = FileAttachment("countries-50m.json").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