This interactive example is adapted from the Observable notebook Basic map projections.
import {
d3,
loadLandFeature,
projectionOptions,
createProjectionState,
advanceProjectionState,
renderAnimatedProjectionMap
} from "./components/projection_examples.js"
viewof projection = Inputs.select(projectionOptions, {
value: projectionOptions[0],
format: (o) => o.name,
label: "Projection:"
})
land = loadLandFeature(await FileAttachment("data/ne_110m_land.json").json())
state = createProjectionState()
advance = advanceProjectionState(state, projection)
map = {
advance;
return renderAnimatedProjectionMap(state, projection, land, invalidation);
}
comment = md`${projection.comment}`