-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
We currently determine the default height for whole-world projections automatically (for named projections):
Lines 237 to 253 in 4bbad40
| // When a named projection is specified, we can use its natural aspect ratio to | |
| // determine a good value for the projection’s height based on the desired | |
| // width. When we don’t have a way to know, the golden ratio is our best guess. | |
| // Due to a circular dependency (we need to know the height before we can | |
| // construct the projection), we have to test the raw projection option rather | |
| // than the materialized projection; therefore we must be extremely careful that | |
| // the logic of this function exactly matches createProjection above! | |
| export function projectionAspectRatio(projection) { | |
| if (typeof projection?.stream === "function") return defaultAspectRatio; | |
| if (isObject(projection)) projection = projection.type; | |
| if (projection == null) return; | |
| if (typeof projection !== "function") { | |
| const {aspectRatio} = namedProjection(projection); | |
| if (aspectRatio) return aspectRatio; | |
| } | |
| return defaultAspectRatio; | |
| } |
It’d be nice to do that if the domain is specified, too. For example:
Plot.plot({
projection: {
type: "conic-conformal",
parallels: [34.3333, 36.1667],
rotate: [79, 0],
domain: ncstate
},
marks: [
Plot.geo(ncstate),
Plot.geo(nccounties, {strokeOpacity: 0.1})
]
})Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request