Public
Edited
Dec 13, 2023
5 forks
Insert cell
Insert cell
Insert cell
land
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: "equal-earth",
marks: [
Plot.geo(land, { fill: "grey", stroke: "red" })
]
})
Insert cell
import {land} from "@observablehq/plot-live-earthquake-map"
Insert cell
Insert cell
meteorites = FileAttachment("meteorites.json").json()
Insert cell
Insert cell
d3.extent(meteorites, (d) => d.year)
Insert cell
viewof year = Inputs.range(d3.extent(meteorites, (d) => d.year), {label: "Pick a year", step: 10})
Insert cell
Insert cell
import {us} from "@observablehq/plot-us-choropleth"
Insert cell
us
Insert cell
Insert cell
states = topojson.feature(us, us.objects.counties)
Insert cell
import {us_power_plants} from "@observablehq/build-your-first-map-with-observable-plot"
Insert cell
## Choropleth Map
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: "albers-usa",
color: {
legend: true,
type: "quantile",
n: 9,
scheme: "Blues",
label: "Unemployment rate (%)"
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: (d) => d.properties.unemployment,
channels: {
county: (d) => d.properties.name,
// "unemployment rate": (d) => d.properties.unemployment
},
tip: true
}))
]
})
Insert cell
Insert cell
Insert cell
massMunicipalities = FileAttachment("mass-municipalities.geojson").json()
Insert cell
counties_polym = FileAttachment("COUNTIES_POLYM.geojson").json()
Insert cell
Plot.plot({
marks: [
Plot.geo(counties_polym)
]
})
Insert cell
townGeo = FileAttachment("TOWN.geo.json").json()
Insert cell
Plot.plot({
color: {
legend: true,
type: "quantile",
scheme: "Greens",
n: 7
},
marks: [
Plot.geo(townGeo, Plot.centroid({
fill: (d) => d.properties.POP2000,
stroke: "white",
tip: true
}))
]
})
Insert cell
maps_substance_data = FileAttachment("maps_susbtance_data.json").json()
Insert cell
Insert cell
Insert cell
screenShot20231206At120844Am = FileAttachment("Screen Shot 2023-12-06 at 12.08.44 AM.png").image()
Insert cell
Insert cell
Insert cell
substance2000 = maps_substance_data.data[0]
Insert cell
substance2000Features = townGeo.features.map((g) => ({
...g,
properties: {
substance2000: substance2000.values[g.properties.TOWN_1],
town: g.properties.TOWN_1
}
}))
Insert cell
Insert cell
substance2000Geo = {
return {
type: "FeatureCollection",
features: substance2000Features
}
}
Insert cell
Plot.plot({
x: {
axis: null
},
y: {
axis: null
},
color: {
legend: true,
type: "quantile",
scheme: "PuBuGn",
n: 8,
tickFormat: ".2f"
},
marks: [
Plot.geo(substance2000Geo, Plot.centroid({
fill: (d) => d.properties.substance2000,
stroke: "white",
tip: true
})),
Plot.axisX(substance2000, {
label: "2000",
anchor: "bottom",
labelAnchor: "center",
fontSize: 15, fontWeight: 700, color: "purple"
})
]
})
Insert cell
townGeo.features[0]
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