Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vega-projection): allow "fit" to auto rotate #2883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

While fit controls the projection scale and translate parameters it makes sense to also control the rotate parameter unless it has been overridden. This change uses d3.geoCentroid to rotate that to the center of the map.

While "fit" controls the projection "scale" and "translate" parameters
it makes sense to also control the "rotate" parameter unless it has been
overridden. This change uses "d3.geoCentroid" to rotate that to the center
of the map.
@terencehonles
Copy link
Contributor Author

As I was updating the documentation I realized there's also a center for the d3 projection. I'm not sure if using rotation or center is better or if they are synonyms 🤔

@terencehonles
Copy link
Contributor Author

Based on https://github.com/d3/d3-geo#projection_fitExtent and also testing using center instead of rotate and my map looking broken I think rotate is the one to use.

@kanitw kanitw requested a review from a team as a code owner May 20, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant