Public
Edited
Jan 18, 2023
Insert cell
globe.plot({
projection: {type: "equirectangular", rotate: [160, 0, 0], inset: -450},
width: width,
height: 500,
})
Insert cell
Insert cell
Insert cell
globe = Plot.marks([Plot.graticule(), Plot.geo(land, {fill: "currentColor"}), Plot.sphere()])
Insert cell
Insert cell
globe.plot({height: 640, inset: -100, projection: {type: "orthographic", rotate: [160, -30]}})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
globe.plot({
width: 360,
projection: {
type: "azimuthal-equidistant",
rotate: [0, 90],
clip: 30, // 🇦🇶 comment this line out
domain: d3.geoCircle().center([0, -90]).radius(30)(),
inset: 2
}
})
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: { type: "identity", domain: westport },
marks: [Plot.geo(westport)]
})
Insert cell
Insert cell
Insert cell
Insert cell
globe.plot({
width: 350,
height: 454,
projection: {
type: "conic-conformal",
rotate: [60, 0],
parallels: [-5, -42],
domain: {type: "MultiPoint", coordinates: [[-90, 0], [-30, 0], [-60, 15], [-60, -60]]}
}, marks: [Plot.frame()]
})
Insert cell
Insert cell
Plot.plot({
width: 320,
height: 200,
projection: {
type: "conic-equal-area",
rotate: [96, 0],
parallels: [29.5, 45.5],
domain: states48
},
marks: [Plot.geo(states48, { strokeWidth: 1.5 })]
})
Insert cell
Insert cell
Plot.plot({
width: 320,
height: 200,
projection: "albers",
marks: [
Plot.geo(statesMesh, { strokeOpacity: 0.5 }), // see appendix for statesMesh and nation
Plot.geo(states48, { strokeWidth: 1.5 })
]
})
Insert cell
Insert cell
Plot.plot({
width: 1152,
projection: "albers-usa",
marks: [
Plot.geo(countiesMesh, { strokeOpacity: 0.15 }),
Plot.geo(statesMesh, { strokeOpacity: 0.5 }),
Plot.geo(nation, {
strokeWidth: 1.5
})
]
})
Insert cell
Insert cell
globe.plot({
width: 454,
height: 454,
projection: {
type: "azimuthal-equal-area",
rotate: [-10, -52],
domain: {type: "MultiPoint", coordinates: [[-16, 52], [42, 52], [10, 32], [10, 70]]}
}, marks: [Plot.frame()]
})
Insert cell
Insert cell
globe.plot({
width: 454,
height: 454,
marginBottom: 2,
projection: {
type: "mercator",
rotate: [-133, 27],
domain: {type: "MultiPoint", coordinates: [[113, -24], [154, -28], [141, -10.5], [146, -44]]}
}, marks: [Plot.frame()]
})
Insert cell
Insert cell
globe.plot({
width: 454,
height: 454,
projection:
{
type: "equirectangular",
domain: {
type: "MultiPoint",
coordinates: [
[54, 12],
[21, -36],
[-19, 14],
[10, 39]
]
}
}
})
Insert cell
Insert cell
<div style="display: flex;">
${globeF().plot({
width: 454,
height: 454,
projection: {
type: "azimuthal-equidistant",
rotate: [0, -90],
domain: {type:"MultiPoint", coordinates: [[-90, 65], [90, 65]]},
}
})}
${globeF().plot({
width: 474,
height: 454,
marginLeft: 20,
projection: {
type: "azimuthal-equidistant",
rotate: [0, 90],
domain: {type:"MultiPoint", coordinates: [[-90, -65], [90, -65]]},
}
})}
</div>
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
world = FileAttachment("land-110m.json").json()
Insert cell
land = topojson.feature(world, world.objects.land)
Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
nation = topojson.feature(us, us.objects.nation)
Insert cell
counties48 = us.objects.counties.geometries.filter(
({ id }) =>
!["02", "15", "60", "66", "69", "72", "78"].includes(id.slice(0, 2)) // removes Alaska, Hawaii etc.
)
Insert cell
states48 = topojson.merge(us, counties48)
Insert cell
statesMesh = topojson.mesh(us, us.objects.states, (a, b) => a !== b)
Insert cell
countiesMesh = topojson.mesh(us, us.objects.counties, (a, b) => a !== b)
Insert cell
Insert cell
westport = FileAttachment("westport-house.json").json()
Insert cell
Insert cell
// a version of globe that clips to the frame
globeF = (marks) =>
Plot.marks([
Plot.graticule({ clip: "frame" }),
Plot.geo(land, { fill: "currentColor", clip: "frame" }),
Plot.sphere(),
marks
])
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