observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.16k stars 171 forks source link

Determine the default height when the projection domain is set #2063

Closed mbostock closed 1 day ago

mbostock commented 2 months ago

We currently determine the default height for whole-world projections automatically (for named projections):

https://github.com/observablehq/plot/blob/4bbad40906e851fe5ece146f34ecc854342b08da/src/projection.js#L237-L253

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})
  ]
})