Skip to content

Selection bind for projections #4863

Open

Description

Currently selection bind supports an option "scales", which binds an interval selection to one or more scale domains to support panning and zooming. As we work towards support for selections in the context of geographic projections, it would be valuable to have an analogous "projection" option that binds to properties of a cartographic projection. Note that is possibly related to, though distinct from, #3587.

Of course, projections are quite different from scales. I think a default .bind('projection') (no additional parameters) would add panning and zooming support, binding to the projection scale parameter (for zooming) and rotate and/or center (for panning). For a Vega example using a Mercator projection, see https://vega.github.io/vega/examples/zoomable-world-map/

A slightly complicating bit is that the proper choice of parameters might vary by projection type. For example, for an orthographic projection we would want to use rotate exclusively, but for Mercator we want rotate for x-panning and center for y-panning. Additional parameters / selection projections (in the selection context, not a geographic context, which may well prove confusing to end users!!) could limit or control these choices.

In terms of resolution to a predicate, perhaps the bound selection should return true for any points drawn within the visible (clipped) region of the map? I think this would be consistent with other notions of geographic selections so far considered?

Anyway, we can use this issue to further discuss possible designs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions