Public
Edited
Dec 17, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
width: 1200,
height: 1200,

projection: {
type: projectionType,
domain: mapBoundary,
inset: mapInset
},

color: {
type: "quantile",
n: 9,
scheme: "blues",
label: "Population",
legend: false
},

marks: [
Plot.geo(
geometry,
Plot.centroid({
stroke: "#333",
strokeWidth: 0.5,
fill: (d) => populationDict.get(d.properties.N03_007)?.value,
title: (d) => {
const props = populationDict.get(d.properties.N03_007);
return `${props?.name}\npopulation: ${props?.value}`;
},
tip: true
})
),

Plot.geo(mapBoundary, { stroke: "red", strokeWidth: 2 }),

Plot.geo(d3.geoGraticule().step([1, 1])(), {
stroke: "gray",
strokeOpacity: 0.2
}),
Plot.graticule(),
Plot.frame()
]
})
Insert cell
Insert cell
d3CompositeProjections = require("d3-composite-projections")
Insert cell
Plot.plot({
width: 800,
height: 500,

projection: ({ width, height }) =>
d3CompositeProjections.geoConicEquidistantJapan(),

marks: [Plot.geo(geometry)]
})

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

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